]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13828 Updated to YUI 2.5.0
authornicolasconnault <nicolasconnault>
Fri, 7 Mar 2008 09:48:29 +0000 (09:48 +0000)
committernicolasconnault <nicolasconnault>
Fri, 7 Mar 2008 09:48:29 +0000 (09:48 +0000)
297 files changed:
lib/yui/README.txt
lib/yui/animation/README
lib/yui/animation/animation-debug.js
lib/yui/animation/animation-min.js
lib/yui/animation/animation.js
lib/yui/assets/skins/sam/asc.gif [new file with mode: 0644]
lib/yui/assets/skins/sam/autocomplete.css
lib/yui/assets/skins/sam/button.css
lib/yui/assets/skins/sam/calendar.css
lib/yui/assets/skins/sam/colorpicker.css
lib/yui/assets/skins/sam/container.css
lib/yui/assets/skins/sam/datatable.css
lib/yui/assets/skins/sam/desc.gif [new file with mode: 0644]
lib/yui/assets/skins/sam/dt-arrow-dn.png
lib/yui/assets/skins/sam/dt-arrow-up.png
lib/yui/assets/skins/sam/editor.css
lib/yui/assets/skins/sam/header_background.png [new file with mode: 0644]
lib/yui/assets/skins/sam/imagecropper.css [new file with mode: 0644]
lib/yui/assets/skins/sam/layout.css [new file with mode: 0644]
lib/yui/assets/skins/sam/layout_sprite.png [new file with mode: 0644]
lib/yui/assets/skins/sam/logger.css
lib/yui/assets/skins/sam/menu.css
lib/yui/assets/skins/sam/menubaritem_submenuindicator.png [new file with mode: 0644]
lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/assets/skins/sam/menuitem_checkbox.png [new file with mode: 0644]
lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png [new file with mode: 0644]
lib/yui/assets/skins/sam/menuitem_submenuindicator.png [new file with mode: 0644]
lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/assets/skins/sam/profilerviewer.css [new file with mode: 0644]
lib/yui/assets/skins/sam/resize.css [new file with mode: 0644]
lib/yui/assets/skins/sam/simpleeditor.css [new file with mode: 0644]
lib/yui/assets/skins/sam/skin.css
lib/yui/assets/skins/sam/tabview.css
lib/yui/assets/skins/sam/treeview.css
lib/yui/assets/skins/sam/wait.gif [new file with mode: 0644]
lib/yui/assets/skins/sam/yuitest.css
lib/yui/autocomplete/README
lib/yui/autocomplete/assets/autocomplete-core.css
lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css
lib/yui/autocomplete/assets/skins/sam/autocomplete.css
lib/yui/autocomplete/autocomplete-debug.js
lib/yui/autocomplete/autocomplete-min.js
lib/yui/autocomplete/autocomplete.js
lib/yui/base/README
lib/yui/base/base-min.css
lib/yui/base/base.css
lib/yui/button/README
lib/yui/button/assets/button-core.css
lib/yui/button/assets/skins/sam/button-skin.css
lib/yui/button/assets/skins/sam/button.css
lib/yui/button/button-debug.js [new file with mode: 0644]
lib/yui/button/button-min.js [new file with mode: 0644]
lib/yui/button/button.js [new file with mode: 0644]
lib/yui/calendar/README
lib/yui/calendar/assets/calendar-core.css
lib/yui/calendar/assets/calendar.css
lib/yui/calendar/assets/calgrad.png [new file with mode: 0644]
lib/yui/calendar/assets/skins/sam/calendar-skin.css
lib/yui/calendar/assets/skins/sam/calendar.css
lib/yui/calendar/calendar-debug.js
lib/yui/calendar/calendar-min.js
lib/yui/calendar/calendar.js
lib/yui/charts/README [new file with mode: 0644]
lib/yui/charts/assets/charts.swf [new file with mode: 0644]
lib/yui/charts/charts-experimental-debug.js [new file with mode: 0644]
lib/yui/charts/charts-experimental-min.js [new file with mode: 0644]
lib/yui/charts/charts-experimental.js [new file with mode: 0644]
lib/yui/colorpicker/README
lib/yui/colorpicker/assets/colorpicker_core.css
lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css
lib/yui/colorpicker/assets/skins/sam/colorpicker.css
lib/yui/colorpicker/colorpicker-debug.js [new file with mode: 0644]
lib/yui/colorpicker/colorpicker-min.js [new file with mode: 0644]
lib/yui/colorpicker/colorpicker.js [new file with mode: 0644]
lib/yui/connection/README
lib/yui/connection/connection-debug.js
lib/yui/connection/connection-min.js
lib/yui/connection/connection.js
lib/yui/container/README
lib/yui/container/assets/container-core.css
lib/yui/container/assets/container.css
lib/yui/container/assets/skins/sam/container-skin.css
lib/yui/container/assets/skins/sam/container.css
lib/yui/container/container-debug.js
lib/yui/container/container-min.js
lib/yui/container/container.js
lib/yui/container/container_core-debug.js
lib/yui/container/container_core-min.js
lib/yui/container/container_core.js
lib/yui/cookie/README [new file with mode: 0644]
lib/yui/cookie/cookie-beta-debug.js [new file with mode: 0644]
lib/yui/cookie/cookie-beta-min.js [new file with mode: 0644]
lib/yui/cookie/cookie-beta.js [new file with mode: 0644]
lib/yui/datasource/README
lib/yui/datasource/datasource-beta-debug.js
lib/yui/datasource/datasource-beta-min.js
lib/yui/datasource/datasource-beta.js
lib/yui/datatable/README
lib/yui/datatable/assets/datatable-core.css
lib/yui/datatable/assets/datatable.css
lib/yui/datatable/assets/skins/sam/datatable-skin.css
lib/yui/datatable/assets/skins/sam/datatable.css
lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png
lib/yui/datatable/assets/skins/sam/dt-arrow-up.png
lib/yui/datatable/datatable-beta-debug.js
lib/yui/datatable/datatable-beta-min.js
lib/yui/datatable/datatable-beta.js
lib/yui/dom/README
lib/yui/dom/dom-debug.js
lib/yui/dom/dom-min.js
lib/yui/dom/dom.js
lib/yui/dragdrop/README
lib/yui/dragdrop/dragdrop-debug.js
lib/yui/dragdrop/dragdrop-min.js
lib/yui/dragdrop/dragdrop.js
lib/yui/editor/README
lib/yui/editor/assets/editor-core.css
lib/yui/editor/assets/simpleeditor-core.css [new file with mode: 0644]
lib/yui/editor/assets/skins/sam/editor-skin.css
lib/yui/editor/assets/skins/sam/editor.css
lib/yui/editor/assets/skins/sam/simpleeditor-skin.css [new file with mode: 0644]
lib/yui/editor/assets/skins/sam/simpleeditor.css [new file with mode: 0644]
lib/yui/editor/editor-beta-debug.js
lib/yui/editor/editor-beta-min.js
lib/yui/editor/editor-beta.js
lib/yui/editor/simpleeditor-beta-debug.js [new file with mode: 0644]
lib/yui/editor/simpleeditor-beta-min.js [new file with mode: 0644]
lib/yui/editor/simpleeditor-beta.js [new file with mode: 0644]
lib/yui/element/README
lib/yui/element/element-beta-debug.js
lib/yui/element/element-beta-min.js
lib/yui/element/element-beta.js
lib/yui/event/README
lib/yui/event/event-debug.js
lib/yui/event/event-min.js
lib/yui/event/event.js
lib/yui/fonts/README
lib/yui/fonts/fonts-min.css
lib/yui/fonts/fonts.css
lib/yui/get/README [new file with mode: 0644]
lib/yui/get/get-debug.js [new file with mode: 0644]
lib/yui/get/get-min.js [new file with mode: 0644]
lib/yui/get/get.js [new file with mode: 0644]
lib/yui/grids/README
lib/yui/grids/grids-min.css
lib/yui/grids/grids.css
lib/yui/history/README
lib/yui/history/assets/blank.html
lib/yui/history/history-debug.js [new file with mode: 0644]
lib/yui/history/history-min.js [new file with mode: 0644]
lib/yui/history/history.js [new file with mode: 0644]
lib/yui/imagecropper/README [new file with mode: 0644]
lib/yui/imagecropper/assets/imagecropper-core.css [new file with mode: 0644]
lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css [new file with mode: 0644]
lib/yui/imagecropper/assets/skins/sam/imagecropper.css [new file with mode: 0644]
lib/yui/imagecropper/imagecropper-beta-debug.js [new file with mode: 0644]
lib/yui/imagecropper/imagecropper-beta-min.js [new file with mode: 0644]
lib/yui/imagecropper/imagecropper-beta.js [new file with mode: 0644]
lib/yui/imageloader/README
lib/yui/imageloader/imageloader-debug.js [new file with mode: 0644]
lib/yui/imageloader/imageloader-min.js [new file with mode: 0644]
lib/yui/imageloader/imageloader.js [new file with mode: 0644]
lib/yui/json/README [new file with mode: 0644]
lib/yui/json/json-debug.js [new file with mode: 0644]
lib/yui/json/json-min.js [new file with mode: 0644]
lib/yui/json/json.js [new file with mode: 0644]
lib/yui/layout/README [new file with mode: 0644]
lib/yui/layout/assets/layout-core.css [new file with mode: 0644]
lib/yui/layout/assets/skins/sam/layout-skin.css [new file with mode: 0644]
lib/yui/layout/assets/skins/sam/layout.css [new file with mode: 0644]
lib/yui/layout/assets/skins/sam/layout_sprite.png [new file with mode: 0644]
lib/yui/layout/layout-beta-debug.js [new file with mode: 0644]
lib/yui/layout/layout-beta-min.js [new file with mode: 0644]
lib/yui/layout/layout-beta.js [new file with mode: 0644]
lib/yui/logger/README
lib/yui/logger/assets/logger-core.css
lib/yui/logger/assets/logger.css
lib/yui/logger/assets/skins/sam/logger-skin.css
lib/yui/logger/assets/skins/sam/logger.css
lib/yui/logger/logger-debug.js
lib/yui/logger/logger-min.js
lib/yui/logger/logger.js
lib/yui/menu/README
lib/yui/menu/assets/menu-core.css
lib/yui/menu/assets/menu.css
lib/yui/menu/assets/menu_down_arrow.png [new file with mode: 0644]
lib/yui/menu/assets/menu_down_arrow_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/menu_up_arrow.png [new file with mode: 0644]
lib/yui/menu/assets/menu_up_arrow_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/menubaritem_submenuindicator.png [new file with mode: 0644]
lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/menubaritem_submenuindicator_selected.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_checkbox.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_checkbox_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_checkbox_selected.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_submenuindicator.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/menuitem_submenuindicator_selected.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menu-skin.css
lib/yui/menu/assets/skins/sam/menu.css
lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menuitem_checkbox.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png [new file with mode: 0644]
lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png [new file with mode: 0644]
lib/yui/menu/menu-debug.js
lib/yui/menu/menu-min.js
lib/yui/menu/menu.js
lib/yui/profiler/README [new file with mode: 0644]
lib/yui/profiler/profiler-beta-debug.js [new file with mode: 0644]
lib/yui/profiler/profiler-beta-min.js [new file with mode: 0644]
lib/yui/profiler/profiler-beta.js [new file with mode: 0644]
lib/yui/profilerviewer/README [new file with mode: 0644]
lib/yui/profilerviewer/assets/skins/sam/asc.gif [new file with mode: 0644]
lib/yui/profilerviewer/assets/skins/sam/desc.gif [new file with mode: 0644]
lib/yui/profilerviewer/assets/skins/sam/header_background.png [new file with mode: 0644]
lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css [new file with mode: 0644]
lib/yui/profilerviewer/assets/skins/sam/wait.gif [new file with mode: 0644]
lib/yui/profilerviewer/profilerviewer-beta-debug.js [new file with mode: 0644]
lib/yui/profilerviewer/profilerviewer-beta-min.js [new file with mode: 0644]
lib/yui/profilerviewer/profilerviewer-beta.js [new file with mode: 0644]
lib/yui/reset-fonts-grids/README
lib/yui/reset-fonts-grids/reset-fonts-grids.css
lib/yui/reset-fonts/README [new file with mode: 0644]
lib/yui/reset-fonts/reset-fonts.css [new file with mode: 0644]
lib/yui/reset/README
lib/yui/reset/reset-min.css
lib/yui/reset/reset.css
lib/yui/resize/README [new file with mode: 0644]
lib/yui/resize/assets/resize-core.css [new file with mode: 0644]
lib/yui/resize/assets/skins/sam/layout_sprite.png [new file with mode: 0644]
lib/yui/resize/assets/skins/sam/resize-skin.css [new file with mode: 0644]
lib/yui/resize/assets/skins/sam/resize.css [new file with mode: 0644]
lib/yui/resize/resize-beta-debug.js [new file with mode: 0644]
lib/yui/resize/resize-beta-min.js [new file with mode: 0644]
lib/yui/resize/resize-beta.js [new file with mode: 0644]
lib/yui/selector/README [new file with mode: 0644]
lib/yui/selector/selector-beta-debug.js [new file with mode: 0644]
lib/yui/selector/selector-beta-min.js [new file with mode: 0644]
lib/yui/selector/selector-beta.js [new file with mode: 0644]
lib/yui/slider/README
lib/yui/slider/slider-debug.js
lib/yui/slider/slider-min.js
lib/yui/slider/slider.js
lib/yui/tabview/README
lib/yui/tabview/assets/border_tabs.css
lib/yui/tabview/assets/skin-sam.css
lib/yui/tabview/assets/skins/sam/tabview-skin.css
lib/yui/tabview/assets/skins/sam/tabview.css
lib/yui/tabview/assets/tabview-core.css
lib/yui/tabview/assets/tabview.css
lib/yui/tabview/tabview-debug.js
lib/yui/tabview/tabview-min.js
lib/yui/tabview/tabview.js
lib/yui/treeview/README
lib/yui/treeview/assets/skins/sam/treeview-skin.css
lib/yui/treeview/assets/skins/sam/treeview.css
lib/yui/treeview/assets/sprite-menu.gif [new file with mode: 0644]
lib/yui/treeview/assets/treeview-core.css
lib/yui/treeview/assets/treeview-menu.css [new file with mode: 0644]
lib/yui/treeview/assets/treeview.css
lib/yui/treeview/treeview-debug.js
lib/yui/treeview/treeview-min.js
lib/yui/treeview/treeview.js
lib/yui/uploader/README [new file with mode: 0644]
lib/yui/uploader/assets/uploader.swf [new file with mode: 0644]
lib/yui/uploader/uploader-experimental-debug.js [new file with mode: 0644]
lib/yui/uploader/uploader-experimental-min.js [new file with mode: 0644]
lib/yui/uploader/uploader-experimental.js [new file with mode: 0644]
lib/yui/utilities/utilities.js
lib/yui/yahoo-dom-event/yahoo-dom-event.js
lib/yui/yahoo/README
lib/yui/yahoo/yahoo-debug.js
lib/yui/yahoo/yahoo-min.js
lib/yui/yahoo/yahoo.js
lib/yui/yuiloader/README
lib/yui/yuiloader/yuiloader-beta-debug.js
lib/yui/yuiloader/yuiloader-beta-min.js
lib/yui/yuiloader/yuiloader-beta.js
lib/yui/yuitest/README
lib/yui/yuitest/assets/skins/sam/yuitest-skin.css
lib/yui/yuitest/assets/skins/sam/yuitest.css
lib/yui/yuitest/assets/testlogger.css
lib/yui/yuitest/assets/yuitest-core.css
lib/yui/yuitest/yuitest-beta-debug.js
lib/yui/yuitest/yuitest-beta-min.js
lib/yui/yuitest/yuitest-beta.js
lib/yui/yuitest/yuitest-debug.js [new file with mode: 0644]
lib/yui/yuitest/yuitest-min.js [new file with mode: 0644]
lib/yui/yuitest/yuitest.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core-beta-debug.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core-beta-min.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core-beta.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core-debug.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core-min.js [new file with mode: 0644]
lib/yui/yuitest/yuitest_core.js [new file with mode: 0644]

index 81a21aa89a2a7261704afa685b83492c8c8f4045..89dd4ee384550a86e226e741af5ccde7e1ea82c0 100644 (file)
@@ -10,3 +10,4 @@ Updated to YUI 0.12.0, 23 November 2006
 Updated to YUI 0.12.1, 8 January 2007
 Updated to YUI 0.12.2, 8 Febuary 2007
 Updated to YUI 2.3.0, 3 August 2007
+Updated to YUI 2.5.0, 7 March 2008
\ No newline at end of file
index f5dc0bda215eb7e5a7158815aaefdb4c92bd056a..313c2d9e568353679ae872e527a52b32d7664deb 100755 (executable)
@@ -1,45 +1,51 @@
 Animation Release Notes
 
+*** version 2.5.0 ***
+* replace toString overrides with static NAME property
+
+*** version 2.4.0 ***
+* calling stop() on an non-animated Anim no longer fires onComplete
+
+*** version 2.3.1 ***
+* no change
+
 *** version 2.3.0 ***
 
 * duration of zero now executes 1 frame animation
 * added setEl() method to enable reuse
 * fixed stop() for multiple animations
 
-*** version 2.2.2 **
+*** version 2.3.0 ***
+* duration of zero now executes 1 frame animation
+* added setEl() method to enable reuse
+* fixed stop() for multiple animations
 
+*** version 2.2.2 ***
 * no change
 
-*** version 2.2.1 **
-
+*** version 2.2.1 ***
 * no change
 
-*** version 2.2.0 **
-
+*** version 2.2.0 ***
 * Fixed AnimMgr.stop() when called without tween
 
 *** version 0.12.2 ***
-
 * raised AnimMgr.fps to 1000
 
 *** version 0.12.1 ***
 * minified version no longer strips line breaks
 
 *** version 0.12.0 ***
-
 * added boolean finish argument to Anim.stop()
 
 *** version 0.11.3 ***
-
 * no changes
 
 *** version 0.11.1 ***
-
 * changed "prototype" shorthand to "proto" (workaround firefox < 1.5 scoping
 bug)
 
 *** version 0.11.0 ***
-
 * ColorAnim subclass added
 * Motion and Scroll now inherit from ColorAnim
 * getDefaultUnit method added
@@ -47,13 +53,10 @@ bug)
 * getDefault and setDefault methods deprecated
 
 *** version 0.10.0 ***
-
 * Scroll now handles relative ("by") animation correctly
-
 * Now converts "auto" values of "from" to appropriate initial values
 
 *** version 0.9.0 ***
-
 * Initial release
 
 
index 4980ffadb3b8f8b101fe6cac4e9a1b8f442dfb6d..1bfb6974cc9c043d62c2ff281e62c4e61ef02a19 100755 (executable)
@@ -1,9 +1,13 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+(function() {
+
+var Y = YAHOO.util;
+
 /*
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
@@ -37,23 +41,25 @@ http://developer.yahoo.net/yui/license.txt
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
 
-YAHOO.util.Anim = function(el, attributes, duration, method) {
+var Anim = function(el, attributes, duration, method) {
     if (!el) {
         YAHOO.log('element required to create Anim instance', 'error', 'Anim');
     }
     this.init(el, attributes, duration, method); 
 };
 
-YAHOO.util.Anim.prototype = {
+Anim.NAME = 'Anim';
+
+Anim.prototype = {
     /**
      * Provides a readable name for the Anim instance.
      * @method toString
      * @return {String}
      */
     toString: function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName || el;
-        return ("Anim " + id);
+        var el = this.getEl() || {};
+        var id = el.id || el.tagName;
+        return (this.constructor.NAME + ': ' + id);
     },
     
     patterns: { // cached for performance
@@ -87,7 +93,7 @@ YAHOO.util.Anim.prototype = {
             val = (val > 0) ? val : 0;
         }
 
-        YAHOO.util.Dom.setStyle(this.getEl(), attr, val + unit);
+        Y.Dom.setStyle(this.getEl(), attr, val + unit);
     },                        
     
     /**
@@ -98,7 +104,7 @@ YAHOO.util.Anim.prototype = {
      */
     getAttribute: function(attr) {
         var el = this.getEl();
-        var val = YAHOO.util.Dom.getStyle(el, attr);
+        var val = Y.Dom.getStyle(el, attr);
 
         if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
             return parseFloat(val);
@@ -109,7 +115,7 @@ YAHOO.util.Anim.prototype = {
         var box = !!( a[2] ); // width or height
         
         // use offsets for width/height and abs pos top/left
-        if ( box || (YAHOO.util.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
+        if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
             val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
         } else { // default to zero for other 'auto'
             val = 0;
@@ -220,7 +226,7 @@ YAHOO.util.Anim.prototype = {
          * @private
          * @type HTMLElement
          */
-        el = YAHOO.util.Dom.get(el);
+        el = Y.Dom.get(el);
         
         /**
          * The collection of attributes to be animated.  
@@ -247,7 +253,7 @@ YAHOO.util.Anim.prototype = {
          * @property method
          * @type Function
          */
-        this.method = method || YAHOO.util.Easing.easeNone;
+        this.method = method || Y.Easing.easeNone;
 
         /**
          * Whether or not the duration should be treated as seconds.
@@ -271,14 +277,14 @@ YAHOO.util.Anim.prototype = {
          * @property totalFrames
          * @type Int
          */
-        this.totalFrames = YAHOO.util.AnimMgr.fps;
+        this.totalFrames = Y.AnimMgr.fps;
         
         /**
          * Changes the animated element
          * @method setEl
          */
         this.setEl = function(element) {
-            el = YAHOO.util.Dom.get(element);
+            el = Y.Dom.get(element);
         };
         
         /**
@@ -324,12 +330,12 @@ YAHOO.util.Anim.prototype = {
             
             this.currentFrame = 0;
             
-            this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration;
+            this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration;
     
-            if (this.duration === 0 && this.useSeconds) {
-                this.totalFrames = 1; // jump to last frame if no duration
+            if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration 
+                this.totalFrames = 1; 
             }
-            YAHOO.util.AnimMgr.registerElement(this);
+            Y.AnimMgr.registerElement(this);
             return true;
         };
           
@@ -339,11 +345,15 @@ YAHOO.util.Anim.prototype = {
          * @param {Boolean} finish (optional) If true, animation will jump to final frame.
          */ 
         this.stop = function(finish) {
+            if (!this.isAnimated()) { // nothing to stop
+                return false;
+            }
+
             if (finish) {
                  this.currentFrame = this.totalFrames;
                  this._onTween.fire();
             }
-            YAHOO.util.AnimMgr.stop(this);
+            Y.AnimMgr.stop(this);
         };
         
         var onStart = function() {            
@@ -414,39 +424,39 @@ YAHOO.util.Anim.prototype = {
          * Custom event that fires after onStart, useful in subclassing
          * @private
          */    
-        this._onStart = new YAHOO.util.CustomEvent('_start', this, true);
+        this._onStart = new Y.CustomEvent('_start', this, true);
 
         /**
          * Custom event that fires when animation begins
          * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)
          * @event onStart
          */    
-        this.onStart = new YAHOO.util.CustomEvent('start', this);
+        this.onStart = new Y.CustomEvent('start', this);
         
         /**
          * Custom event that fires between each frame
          * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)
          * @event onTween
          */
-        this.onTween = new YAHOO.util.CustomEvent('tween', this);
+        this.onTween = new Y.CustomEvent('tween', this);
         
         /**
          * Custom event that fires after onTween
          * @private
          */
-        this._onTween = new YAHOO.util.CustomEvent('_tween', this, true);
+        this._onTween = new Y.CustomEvent('_tween', this, true);
         
         /**
          * Custom event that fires when animation ends
          * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)
          * @event onComplete
          */
-        this.onComplete = new YAHOO.util.CustomEvent('complete', this);
+        this.onComplete = new Y.CustomEvent('complete', this);
         /**
          * Custom event that fires after onComplete
          * @private
          */
-        this._onComplete = new YAHOO.util.CustomEvent('_complete', this, true);
+        this._onComplete = new Y.CustomEvent('_complete', this, true);
 
         this._onStart.subscribe(onStart);
         this._onTween.subscribe(onTween);
@@ -454,6 +464,8 @@ YAHOO.util.Anim.prototype = {
     }
 };
 
+    Y.Anim = Anim;
+})();
 /**
  * Handles animation queueing and threading.
  * Used by Anim and subclasses.
@@ -524,12 +536,12 @@ YAHOO.util.AnimMgr = new function() {
      * @private
      */
     this.unRegister = function(tween, index) {
-        tween._onComplete.fire();
         index = index || getIndex(tween);
-        if (index == -1) {
+        if (!tween.isAnimated() || index == -1) {
             return false;
         }
         
+        tween._onComplete.fire();
         queue.splice(index, 1);
 
         tweenCount -= 1;
@@ -562,9 +574,7 @@ YAHOO.util.AnimMgr = new function() {
             clearInterval(thread);
             
             for (var i = 0, len = queue.length; i < len; ++i) {
-                if ( queue[0].isAnimated() ) {
-                    this.unRegister(queue[0], 0);  
-                }
+                this.unRegister(queue[0], 0);  
             }
 
             queue = [];
@@ -694,23 +704,19 @@ YAHOO.util.Bezier = new function() {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.ColorAnim = function(el, attributes, duration,  method) {
-        YAHOO.util.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
+    var ColorAnim = function(el, attributes, duration,  method) {
+        ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
     };
     
-    YAHOO.extend(YAHOO.util.ColorAnim, YAHOO.util.Anim);
-    
+    ColorAnim.NAME = 'ColorAnim';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.ColorAnim.superclass;
-    var proto = Y.ColorAnim.prototype;
-    
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("ColorAnim " + id);
-    };
+    YAHOO.extend(ColorAnim, Y.Anim);
 
+    var superclass = ColorAnim.superclass;
+    var proto = ColorAnim.prototype;
+    
     proto.patterns.color = /color$/i;
     proto.patterns.rgb            = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
     proto.patterns.hex            = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
@@ -806,8 +812,10 @@ YAHOO.util.Bezier = new function() {
             this.runtimeAttributes[attr].end = end;
         }
     };
+
+    Y.ColorAnim = ColorAnim;
 })();
-/*
+/*!
 TERMS OF USE - EASING EQUATIONS
 Open source under the BSD License.
 Copyright 2001 Robert Penner All rights reserved.
@@ -1157,7 +1165,7 @@ YAHOO.util.Easing = {
  * @requires YAHOO.util.Event
  * @requires YAHOO.util.CustomEvent 
  * @constructor
- * @extends YAHOO.util.Anim
+ * @extends YAHOO.util.ColorAnim
  * @param {String | HTMLElement} el Reference to the element that will be animated
  * @param {Object} attributes The attribute(s) to be animated.  
  * Each attribute is an object with at minimum a "to" or "by" member defined.  
@@ -1166,25 +1174,22 @@ YAHOO.util.Easing = {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.Motion = function(el, attributes, duration,  method) {
+    var Motion = function(el, attributes, duration,  method) {
         if (el) { // dont break existing subclasses not using YAHOO.extend
-            YAHOO.util.Motion.superclass.constructor.call(this, el, attributes, duration, method);
+            Motion.superclass.constructor.call(this, el, attributes, duration, method);
         }
     };
 
-    YAHOO.extend(YAHOO.util.Motion, YAHOO.util.ColorAnim);
-    
+
+    Motion.NAME = 'Motion';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.Motion.superclass;
-    var proto = Y.Motion.prototype;
-
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("Motion " + id);
-    };
+    YAHOO.extend(Motion, Y.ColorAnim);
     
+    var superclass = Motion.superclass;
+    var proto = Motion.prototype;
+
     proto.patterns.points = /^points$/i;
     
     proto.setAttribute = function(attr, val, unit) {
@@ -1293,6 +1298,8 @@ YAHOO.util.Easing = {
     var isset = function(prop) {
         return (typeof prop !== 'undefined');
     };
+
+    Y.Motion = Motion;
 })();
 (function() {
 /**
@@ -1308,7 +1315,7 @@ YAHOO.util.Easing = {
  * @requires YAHOO.util.Dom
  * @requires YAHOO.util.Event
  * @requires YAHOO.util.CustomEvent 
- * @extends YAHOO.util.Anim
+ * @extends YAHOO.util.ColorAnim
  * @constructor
  * @param {String or HTMLElement} el Reference to the element that will be animated
  * @param {Object} attributes The attribute(s) to be animated.  
@@ -1318,24 +1325,20 @@ YAHOO.util.Easing = {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.Scroll = function(el, attributes, duration,  method) {
+    var Scroll = function(el, attributes, duration,  method) {
         if (el) { // dont break existing subclasses not using YAHOO.extend
-            YAHOO.util.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
+            Scroll.superclass.constructor.call(this, el, attributes, duration, method);
         }
     };
 
-    YAHOO.extend(YAHOO.util.Scroll, YAHOO.util.ColorAnim);
-    
+    Scroll.NAME = 'Scroll';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.Scroll.superclass;
-    var proto = Y.Scroll.prototype;
-
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("Scroll " + id);
-    };
+    YAHOO.extend(Scroll, Y.ColorAnim);
+    
+    var superclass = Scroll.superclass;
+    var proto = Scroll.prototype;
 
     proto.doMethod = function(attr, start, end) {
         var val = null;
@@ -1375,5 +1378,7 @@ YAHOO.util.Easing = {
             superclass.setAttribute.call(this, attr, val, unit);
         }
     };
+
+    Y.Scroll = Scroll;
 })();
-YAHOO.register("animation", YAHOO.util.Anim, {version: "2.3.0", build: "442"});
+YAHOO.register("animation", YAHOO.util.Anim, {version: "2.5.0", build: "895"});
index 284ff25f750d1caa98312142e44d7892b95dd5ae..840c05d21c8994bdea0ea3ba3cdcf5260c8b3087 100755 (executable)
@@ -1,78 +1,23 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);
+if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
+/*
+TERMS OF USE - EASING EQUATIONS
+Open source under the BSD License.
+Copyright 2001 Robert Penner All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
-YAHOO.util.Anim=function(el,attributes,duration,method){if(!el){}
-this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
-YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
-var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
-return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
-return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
-start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
-this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
-this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
-YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
-YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
-isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
-actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
-queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
-return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
-queue=[];thread=null;tweenCount=0;}
-else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
-if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
-{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
-tween._onTween.fire();}
-else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
-return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
-if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
-tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
-for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
-return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
-var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
-c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
-c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
-return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
-val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
-else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
-this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
-return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
-return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d)==1){return b+c;}
-if(!p){p=d*.3;}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d)==1){return b+c;}
-if(!p){p=d*.3;}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d/2)==2){return b+c;}
-if(!p){p=d*(.3*1.5);}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
-return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
-return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
-return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
-return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
-control=tmp;}
-if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}
-if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
-else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
-start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
-this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
-this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
-else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});
\ No newline at end of file
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);
+var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 236d338353a7c43178274f204cb512f2a58d6664..a601597267da19df14324feb18ad2efe9e6ee30c 100755 (executable)
@@ -1,9 +1,13 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+(function() {
+
+var Y = YAHOO.util;
+
 /*
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
@@ -37,22 +41,24 @@ http://developer.yahoo.net/yui/license.txt
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
 
-YAHOO.util.Anim = function(el, attributes, duration, method) {
+var Anim = function(el, attributes, duration, method) {
     if (!el) {
     }
     this.init(el, attributes, duration, method); 
 };
 
-YAHOO.util.Anim.prototype = {
+Anim.NAME = 'Anim';
+
+Anim.prototype = {
     /**
      * Provides a readable name for the Anim instance.
      * @method toString
      * @return {String}
      */
     toString: function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName || el;
-        return ("Anim " + id);
+        var el = this.getEl() || {};
+        var id = el.id || el.tagName;
+        return (this.constructor.NAME + ': ' + id);
     },
     
     patterns: { // cached for performance
@@ -86,7 +92,7 @@ YAHOO.util.Anim.prototype = {
             val = (val > 0) ? val : 0;
         }
 
-        YAHOO.util.Dom.setStyle(this.getEl(), attr, val + unit);
+        Y.Dom.setStyle(this.getEl(), attr, val + unit);
     },                        
     
     /**
@@ -97,7 +103,7 @@ YAHOO.util.Anim.prototype = {
      */
     getAttribute: function(attr) {
         var el = this.getEl();
-        var val = YAHOO.util.Dom.getStyle(el, attr);
+        var val = Y.Dom.getStyle(el, attr);
 
         if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
             return parseFloat(val);
@@ -108,7 +114,7 @@ YAHOO.util.Anim.prototype = {
         var box = !!( a[2] ); // width or height
         
         // use offsets for width/height and abs pos top/left
-        if ( box || (YAHOO.util.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
+        if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
             val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
         } else { // default to zero for other 'auto'
             val = 0;
@@ -219,7 +225,7 @@ YAHOO.util.Anim.prototype = {
          * @private
          * @type HTMLElement
          */
-        el = YAHOO.util.Dom.get(el);
+        el = Y.Dom.get(el);
         
         /**
          * The collection of attributes to be animated.  
@@ -246,7 +252,7 @@ YAHOO.util.Anim.prototype = {
          * @property method
          * @type Function
          */
-        this.method = method || YAHOO.util.Easing.easeNone;
+        this.method = method || Y.Easing.easeNone;
 
         /**
          * Whether or not the duration should be treated as seconds.
@@ -270,14 +276,14 @@ YAHOO.util.Anim.prototype = {
          * @property totalFrames
          * @type Int
          */
-        this.totalFrames = YAHOO.util.AnimMgr.fps;
+        this.totalFrames = Y.AnimMgr.fps;
         
         /**
          * Changes the animated element
          * @method setEl
          */
         this.setEl = function(element) {
-            el = YAHOO.util.Dom.get(element);
+            el = Y.Dom.get(element);
         };
         
         /**
@@ -320,12 +326,12 @@ YAHOO.util.Anim.prototype = {
             
             this.currentFrame = 0;
             
-            this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration;
+            this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration;
     
-            if (this.duration === 0 && this.useSeconds) {
-                this.totalFrames = 1; // jump to last frame if no duration
+            if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration 
+                this.totalFrames = 1; 
             }
-            YAHOO.util.AnimMgr.registerElement(this);
+            Y.AnimMgr.registerElement(this);
             return true;
         };
           
@@ -335,11 +341,15 @@ YAHOO.util.Anim.prototype = {
          * @param {Boolean} finish (optional) If true, animation will jump to final frame.
          */ 
         this.stop = function(finish) {
+            if (!this.isAnimated()) { // nothing to stop
+                return false;
+            }
+
             if (finish) {
                  this.currentFrame = this.totalFrames;
                  this._onTween.fire();
             }
-            YAHOO.util.AnimMgr.stop(this);
+            Y.AnimMgr.stop(this);
         };
         
         var onStart = function() {            
@@ -410,39 +420,39 @@ YAHOO.util.Anim.prototype = {
          * Custom event that fires after onStart, useful in subclassing
          * @private
          */    
-        this._onStart = new YAHOO.util.CustomEvent('_start', this, true);
+        this._onStart = new Y.CustomEvent('_start', this, true);
 
         /**
          * Custom event that fires when animation begins
          * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)
          * @event onStart
          */    
-        this.onStart = new YAHOO.util.CustomEvent('start', this);
+        this.onStart = new Y.CustomEvent('start', this);
         
         /**
          * Custom event that fires between each frame
          * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)
          * @event onTween
          */
-        this.onTween = new YAHOO.util.CustomEvent('tween', this);
+        this.onTween = new Y.CustomEvent('tween', this);
         
         /**
          * Custom event that fires after onTween
          * @private
          */
-        this._onTween = new YAHOO.util.CustomEvent('_tween', this, true);
+        this._onTween = new Y.CustomEvent('_tween', this, true);
         
         /**
          * Custom event that fires when animation ends
          * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)
          * @event onComplete
          */
-        this.onComplete = new YAHOO.util.CustomEvent('complete', this);
+        this.onComplete = new Y.CustomEvent('complete', this);
         /**
          * Custom event that fires after onComplete
          * @private
          */
-        this._onComplete = new YAHOO.util.CustomEvent('_complete', this, true);
+        this._onComplete = new Y.CustomEvent('_complete', this, true);
 
         this._onStart.subscribe(onStart);
         this._onTween.subscribe(onTween);
@@ -450,6 +460,8 @@ YAHOO.util.Anim.prototype = {
     }
 };
 
+    Y.Anim = Anim;
+})();
 /**
  * Handles animation queueing and threading.
  * Used by Anim and subclasses.
@@ -520,12 +532,12 @@ YAHOO.util.AnimMgr = new function() {
      * @private
      */
     this.unRegister = function(tween, index) {
-        tween._onComplete.fire();
         index = index || getIndex(tween);
-        if (index == -1) {
+        if (!tween.isAnimated() || index == -1) {
             return false;
         }
         
+        tween._onComplete.fire();
         queue.splice(index, 1);
 
         tweenCount -= 1;
@@ -558,9 +570,7 @@ YAHOO.util.AnimMgr = new function() {
             clearInterval(thread);
             
             for (var i = 0, len = queue.length; i < len; ++i) {
-                if ( queue[0].isAnimated() ) {
-                    this.unRegister(queue[0], 0);  
-                }
+                this.unRegister(queue[0], 0);  
             }
 
             queue = [];
@@ -690,23 +700,19 @@ YAHOO.util.Bezier = new function() {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.ColorAnim = function(el, attributes, duration,  method) {
-        YAHOO.util.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
+    var ColorAnim = function(el, attributes, duration,  method) {
+        ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
     };
     
-    YAHOO.extend(YAHOO.util.ColorAnim, YAHOO.util.Anim);
-    
+    ColorAnim.NAME = 'ColorAnim';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.ColorAnim.superclass;
-    var proto = Y.ColorAnim.prototype;
-    
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("ColorAnim " + id);
-    };
+    YAHOO.extend(ColorAnim, Y.Anim);
 
+    var superclass = ColorAnim.superclass;
+    var proto = ColorAnim.prototype;
+    
     proto.patterns.color = /color$/i;
     proto.patterns.rgb            = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
     proto.patterns.hex            = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
@@ -802,8 +808,10 @@ YAHOO.util.Bezier = new function() {
             this.runtimeAttributes[attr].end = end;
         }
     };
+
+    Y.ColorAnim = ColorAnim;
 })();
-/*
+/*!
 TERMS OF USE - EASING EQUATIONS
 Open source under the BSD License.
 Copyright 2001 Robert Penner All rights reserved.
@@ -1153,7 +1161,7 @@ YAHOO.util.Easing = {
  * @requires YAHOO.util.Event
  * @requires YAHOO.util.CustomEvent 
  * @constructor
- * @extends YAHOO.util.Anim
+ * @extends YAHOO.util.ColorAnim
  * @param {String | HTMLElement} el Reference to the element that will be animated
  * @param {Object} attributes The attribute(s) to be animated.  
  * Each attribute is an object with at minimum a "to" or "by" member defined.  
@@ -1162,25 +1170,22 @@ YAHOO.util.Easing = {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.Motion = function(el, attributes, duration,  method) {
+    var Motion = function(el, attributes, duration,  method) {
         if (el) { // dont break existing subclasses not using YAHOO.extend
-            YAHOO.util.Motion.superclass.constructor.call(this, el, attributes, duration, method);
+            Motion.superclass.constructor.call(this, el, attributes, duration, method);
         }
     };
 
-    YAHOO.extend(YAHOO.util.Motion, YAHOO.util.ColorAnim);
-    
+
+    Motion.NAME = 'Motion';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.Motion.superclass;
-    var proto = Y.Motion.prototype;
-
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("Motion " + id);
-    };
+    YAHOO.extend(Motion, Y.ColorAnim);
     
+    var superclass = Motion.superclass;
+    var proto = Motion.prototype;
+
     proto.patterns.points = /^points$/i;
     
     proto.setAttribute = function(attr, val, unit) {
@@ -1289,6 +1294,8 @@ YAHOO.util.Easing = {
     var isset = function(prop) {
         return (typeof prop !== 'undefined');
     };
+
+    Y.Motion = Motion;
 })();
 (function() {
 /**
@@ -1304,7 +1311,7 @@ YAHOO.util.Easing = {
  * @requires YAHOO.util.Dom
  * @requires YAHOO.util.Event
  * @requires YAHOO.util.CustomEvent 
- * @extends YAHOO.util.Anim
+ * @extends YAHOO.util.ColorAnim
  * @constructor
  * @param {String or HTMLElement} el Reference to the element that will be animated
  * @param {Object} attributes The attribute(s) to be animated.  
@@ -1314,24 +1321,20 @@ YAHOO.util.Easing = {
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
  */
-    YAHOO.util.Scroll = function(el, attributes, duration,  method) {
+    var Scroll = function(el, attributes, duration,  method) {
         if (el) { // dont break existing subclasses not using YAHOO.extend
-            YAHOO.util.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
+            Scroll.superclass.constructor.call(this, el, attributes, duration, method);
         }
     };
 
-    YAHOO.extend(YAHOO.util.Scroll, YAHOO.util.ColorAnim);
-    
+    Scroll.NAME = 'Scroll';
+
     // shorthand
     var Y = YAHOO.util;
-    var superclass = Y.Scroll.superclass;
-    var proto = Y.Scroll.prototype;
-
-    proto.toString = function() {
-        var el = this.getEl();
-        var id = el.id || el.tagName;
-        return ("Scroll " + id);
-    };
+    YAHOO.extend(Scroll, Y.ColorAnim);
+    
+    var superclass = Scroll.superclass;
+    var proto = Scroll.prototype;
 
     proto.doMethod = function(attr, start, end) {
         var val = null;
@@ -1371,5 +1374,7 @@ YAHOO.util.Easing = {
             superclass.setAttribute.call(this, attr, val, unit);
         }
     };
+
+    Y.Scroll = Scroll;
 })();
-YAHOO.register("animation", YAHOO.util.Anim, {version: "2.3.0", build: "442"});
+YAHOO.register("animation", YAHOO.util.Anim, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/assets/skins/sam/asc.gif b/lib/yui/assets/skins/sam/asc.gif
new file mode 100644 (file)
index 0000000..a1fe738
Binary files /dev/null and b/lib/yui/assets/skins/sam/asc.gif differ
index 98b473e26a6e3c9a6a92abe182e86a352feb337e..ed09f85f97a115f4b06feb838c5a516b5d7a8103 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
index c1e05f48a2541b53e45ccc628851151d5c58d912..a34617a8c8f1caf5272ecdd61dcd7e5ee4dbefd2 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
+.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:2;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
index 18e466b65836a0f39885fde58a0efb727ffd480d..f5a7f8f0eaf97f0fc8ba6313c734c3dc3e5c783b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:0.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;}
index f07aa5140bf36f31e706fb87ec2cd6fe1c9bc73e..b4a18d7eaa2fbc4fde9b52aca289d2ff9e2a3f13 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;list-style:none;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
index 39eb8f52f8ce53bfd4eb5382e31f1f6203dcdd8d..b0d7e4925f0cff07f9fb26040281fcf7808efce4 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay{display:none;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
index bff0dbf339ad9f46b008f6851f4166ce139042f3..ac21fba675430a0c433421280a4ce1a1d42cdf39 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
+.yui-dt{border:1px solid transparent;}.yui-dt-noop{border:none;}.yui-dt-liner{overflow:hidden;}.yui-dt-bd thead tr,.yui-dt-bd thead th{position:absolute;left:-1500px;}.yui-dt-draggable{cursor:move;}.yui-dt-coltarget{position:absolute;z-index:999;}.yui-dt-hd{zoom:1;}th.yui-dt-resizeable .yui-dt-liner{position:relative;}.yui-dt-resizer{position:absolute;right:0;bottom:0;height:100%;cursor:e-resize;cursor:col-resize;}.yui-dt-resizerproxy{visibility:hidden;position:absolute;z-index:9000;}.yui-skin-sam th.yui-dt-hidden .yui-dt-liner,.yui-skin-sam td.yui-dt-hidden .yui-dt-liner{margin:0;padding:0;overflow:hidden;white-space:nowrap;}.yui-dt-scrollable .yui-dt-bd{overflow:auto;}.yui-dt-scrollable .yui-dt-hd{overflow:hidden;position:relative;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border-spacing:0;}.yui-skin-sam .yui-dt thead{border-spacing:0;}.yui-skin-sam .yui-dt caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-hd table{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-bd table{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt th{background:#D8D8DA url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt th,.yui-skin-sam .yui-dt th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt th{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-liner{margin:0;padding:0;padding:4px 10px 4px 10px;}.yui-skin-sam .yui-dt-coltarget{width:5px;background-color:red;}.yui-skin-sam .yui-dt td{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;text-align:left;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-resizer{width:6px;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-empty{background-color:#FFF;}.yui-skin-sam .yui-dt-error{background-color:#FFF;}.yui-skin-sam thead .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:10px;}.yui-skin-sam th.yui-dt-asc .yui-dt-liner{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-liner{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam th.yui-dt-highlighted,.yui-skin-sam th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list th.yui-dt-highlighted,.yui-skin-sam .yui-dt-list th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam th.yui-dt-selected,.yui-skin-sam th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list th.yui-dt-selected,.yui-skin-sam .yui-dt-list th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-pg-container,.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-last,.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam a.yui-pg-first,.yui-skin-sam a.yui-pg-previous,.yui-skin-sam a.yui-pg-next,.yui-skin-sam a.yui-pg-last,.yui-skin-sam a.yui-pg-page,.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-pg-page,.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;background-color:#fff}.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-selected{border:1px solid #fff;background-color:#fff;}.yui-skin-sam .yui-pg-pages{margin-left:1ex;margin-right:1ex;}.yui-skin-sam .yui-pg-page{margin-right:1px;margin-left:1px;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous{margin-right:3px;}.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last{margin-left:3px;}.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-rpp-options{margin-right:1em;margin-left:1em;}
diff --git a/lib/yui/assets/skins/sam/desc.gif b/lib/yui/assets/skins/sam/desc.gif
new file mode 100644 (file)
index 0000000..c114f29
Binary files /dev/null and b/lib/yui/assets/skins/sam/desc.gif differ
index 2178f11e327167c25acfb35264b03dd87b9486b4..85fda0bbca21cefc6b8cf1726bc83e43bff993c4 100755 (executable)
Binary files a/lib/yui/assets/skins/sam/dt-arrow-dn.png and b/lib/yui/assets/skins/sam/dt-arrow-dn.png differ
index 5a543a573e9a94a27d32d646bd6a62a4d35139f8..1c674316aed41943dae79b01583956db63c8be08 100755 (executable)
Binary files a/lib/yui/assets/skins/sam/dt-arrow-up.png and b/lib/yui/assets/skins/sam/dt-arrow-up.png differ
index 950a2a69d41293d3323960da5e7d962ab92a9e95..05d6f112482215ab902836be3b8df6f05b05db03 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
diff --git a/lib/yui/assets/skins/sam/header_background.png b/lib/yui/assets/skins/sam/header_background.png
new file mode 100644 (file)
index 0000000..3ef7909
Binary files /dev/null and b/lib/yui/assets/skins/sam/header_background.png differ
diff --git a/lib/yui/assets/skins/sam/imagecropper.css b/lib/yui/assets/skins/sam/imagecropper.css
new file mode 100644 (file)
index 0000000..66f861b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-crop{position:relative;}.yui-crop .yui-crop-mask{position:absolute;top:0;left:0;height:100%;width:100%;}.yui-crop .yui-resize{position:absolute;top:10px;left:10px;}.yui-crop .yui-crop-resize-mask{position:absolute;top:0;left:0;height:100%;width:100%;background-position:-10px -10px;overflow:hidden;}.yui-skin-sam .yui-crop .yui-crop-mask{background-color:#000;opacity:.5;filter:alpha(opacity=50);}.yui-skin-sam .yui-crop .yui-resize{border:1px dashed #fff;}
diff --git a/lib/yui/assets/skins/sam/layout.css b/lib/yui/assets/skins/sam/layout.css
new file mode 100644 (file)
index 0000000..cd33f52
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-layout-loading{visibility:hidden;}body.yui-layout{overflow:hidden;position:relative;padding:0;margin:0;}.yui-layout-doc{position:relative;}.yui-layout-unit{height:50px;width:50px;padding:0;margin:0;float:none;z-index:0;overflow:hidden;}.yui-layout-unit-top{position:absolute;top:0;left:0;width:100%;}.yui-layout-unit-left{position:absolute;top:0;left:0;}.yui-layout-unit-right{position:absolute;top:0;right:0;}.yui-layout-unit-bottom{position:absolute;bottom:0;left:0;width:100%;}.yui-layout-unit-center{position:absolute;top:0;left:0;width:100%;}.yui-layout div.yui-layout-hd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout div.yui-layout-bd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout .yui-layout-scroll div.yui-layout-bd{overflow:auto;}.yui-layout div.yui-layout-ft{position:absolute;bottom:0;left:0;width:100%;zoom:1;overflow:hidden;}.yui-layout .yui-layout-unit div.yui-layout-hd h2{text-align:left;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .close{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse-close{right:25px;}.yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#c0c0c0;display:none;}.yui-layout .yui-layout-clip .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0px;}.yui-layout .yui-layout-wrap{height:100%;width:100%;position:absolute;left:0;}.yui-layout .yui-layout-unit .yui-content{overflow:hidden;}.yui-layout .yui-layout-unit .yui-layout-scroll{overflow:auto;}.yui-skin-sam .yui-layout .yui-resize-proxy{border:none;font-size:0;margin:0;padding:0;}.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-skin-sam .yui-layout .yui-resize-proxy div{position:absolute;border:1px solid #808080;background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r{width:5px;top:0;right:0;height:100%;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b{width:100%;bottom:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t{width:100%;top:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -160px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -140px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -200px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -120px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -220px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -240px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -260px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -180px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close{background:transparent url(layout_sprite.png) no-repeat -20px -100px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-hd{background:url(sprite.png) repeat-x 0 -1400px;border:1px solid #808080;}.yui-skin-sam .yui-layout{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2{font-weight:bold;color:#fff;padding:3px;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd{border:1px solid #808080;border-bottom:none;border-top:none;*border-bottom-width:0;*border-top-width:0;background-color:#f2f2f2;text-align:left;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft{border-bottom:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd{border-top:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#EDF5FF;display:none;border:1px solid #808080;}.yui-skin-sam .yui-layout div.yui-layout-ft{border:1px solid #808080;border-top:none;*border-top-width:0;background-color:#f2f2f2;}.yui-skin-sam .yui-layout-unit .yui-resize-handle{background-color:transparent;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-b{right:0;bottom:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob{position:absolute;height:16px;width:6px;top:45%;left:0px;background:transparent url(layout_sprite.png) no-repeat 0 -5px;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob{position:absolute;height:6px;width:16px;left:45%;background:transparent url(layout_sprite.png) no-repeat -20px 0;}
diff --git a/lib/yui/assets/skins/sam/layout_sprite.png b/lib/yui/assets/skins/sam/layout_sprite.png
new file mode 100644 (file)
index 0000000..d6fce3c
Binary files /dev/null and b/lib/yui/assets/skins/sam/layout_sprite.png differ
index 5b8077f1848b3196603008c57f7034fb66621afd..f91c8c333e71e40dc3782a77bc62b82afea9a839 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
index 046a9c6a4f4dd68b4c7f960fb99c50435554c58a..bb8989a2b742572aa49f560d36e13a43c21db8b4 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
+.yuimenubar{visibility:visible;position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{visibility:hidden;position:absolute;top:-10000px;left:-10000px;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);}
diff --git a/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png b/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png
new file mode 100644 (file)
index 0000000..030941c
Binary files /dev/null and b/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png differ
diff --git a/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..6c16122
Binary files /dev/null and b/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png differ
diff --git a/lib/yui/assets/skins/sam/menuitem_checkbox.png b/lib/yui/assets/skins/sam/menuitem_checkbox.png
new file mode 100644 (file)
index 0000000..1437a4f
Binary files /dev/null and b/lib/yui/assets/skins/sam/menuitem_checkbox.png differ
diff --git a/lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png b/lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png
new file mode 100644 (file)
index 0000000..5d5b998
Binary files /dev/null and b/lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png differ
diff --git a/lib/yui/assets/skins/sam/menuitem_submenuindicator.png b/lib/yui/assets/skins/sam/menuitem_submenuindicator.png
new file mode 100644 (file)
index 0000000..ea4f660
Binary files /dev/null and b/lib/yui/assets/skins/sam/menuitem_submenuindicator.png differ
diff --git a/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png b/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..427d60a
Binary files /dev/null and b/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png differ
diff --git a/lib/yui/assets/skins/sam/profilerviewer.css b/lib/yui/assets/skins/sam/profilerviewer.css
new file mode 100644 (file)
index 0000000..dce1d57
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-skin-sam .yui-pv{background-color:#4a4a4a;font:arial;position:relative;width:99%;z-index:1000;margin-bottom:1em;overflow:hidden;}.yui-skin-sam .yui-pv .hd{background:url(header_background.png) repeat-x;min-height:30px;overflow:hidden;zoom:1;padding:2px 0;}.yui-skin-sam .yui-pv .hd h4{padding:8px 10px;margin:0;font:bold 14px arial;color:#fff;}.yui-skin-sam .yui-pv .hd a{background:#3f6bc3;font:bold 11px arial;color:#fff;padding:4px;margin:3px 10px 0 0;border:1px solid #3f567d;cursor:pointer;display:block;float:right;}.yui-skin-sam .yui-pv .hd span{display:none;}.yui-skin-sam .yui-pv .hd span.yui-pv-busy{height:18px;width:18px;background:url(wait.gif) no-repeat;overflow:hidden;display:block;float:right;margin:4px 10px 0 0;}.yui-skin-sam .yui-pv .hd:after,.yui-pv .bd:after,.yui-skin-sam .yui-pv-chartlegend dl:after{content:'.';visibility:hidden;clear:left;height:0;display:block;}.yui-skin-sam .yui-pv .bd{position:relative;zoom:1;overflow-x:auto;overflow-y:hidden;}.yui-skin-sam .yui-pv .yui-pv-table{padding:0 10px;margin:5px 0 10px 0;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-bd td{color:#eeee5c;font:12px arial;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd{background:#929292;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even{background:#58637a;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-desc{background:#384970;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-desc{background:#6F6E6E;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th{background-image:none;background:#2E2D2D;}.yui-skin-sam .yui-pv th.yui-dt-asc .yui-dt-liner{background:transparent url(asc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv th.yui-dt-desc .yui-dt-liner{background:transparent url(desc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th a{color:#fff;font:bold 12px arial;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-desc{background:#333;}.yui-skin-sam .yui-pv-chartcontainer{padding:0 10px;}.yui-skin-sam .yui-pv-chart{height:250px;clear:right;margin:5px 0 0 0;color:#fff;}.yui-skin-sam .yui-pv-chartlegend div{float:right;margin:0 0 0 10px;_width:250px;}.yui-skin-sam .yui-pv-chartlegend dl{border:1px solid #999;padding:.2em 0 .2em .5em;zoom:1;margin:5px 0;}.yui-skin-sam .yui-pv-chartlegend dt{float:left;display:block;height:.7em;width:.7em;padding:0;}.yui-skin-sam .yui-pv-chartlegend dd{float:left;display:block;color:#fff;margin:0 1em 0 .5em;padding:0;font:11px arial;}.yui-skin-sam .yui-pv-minimized{height:35px;}.yui-skin-sam .yui-pv-minimized .bd{top:-3000px;}.yui-skin-sam .yui-pv-minimized .hd a.yui-pv-refresh{display:none;}
diff --git a/lib/yui/assets/skins/sam/resize.css b/lib/yui/assets/skins/sam/resize.css
new file mode 100644 (file)
index 0000000..45a907d
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-resize{position:relative;zoom:1;z-index:0;}.yui-resize-wrap{zoom:1;}.yui-draggable{cursor:move;}.yui-resize .yui-resize-handle{position:absolute;z-index:1;font-size:0;margin:0;padding:0;zoom:1;height:1px;width:1px;}.yui-resize .yui-resize-handle-br{height:5px;width:5px;bottom:0;right:0;cursor:se-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-bl{height:5px;width:5px;bottom:0;left:0;cursor:sw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tl{height:5px;width:5px;top:0;left:0;cursor:nw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tr{height:5px;width:5px;top:0;right:0;cursor:ne-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-r{width:5px;height:100%;top:0;right:0;cursor:e-resize;zoom:1;}.yui-resize .yui-resize-handle-l{height:100%;width:5px;top:0;left:0;cursor:w-resize;zoom:1;}.yui-resize .yui-resize-handle-b{width:100%;height:5px;bottom:0;right:0;cursor:s-resize;zoom:1;}.yui-resize .yui-resize-handle-t{width:100%;height:5px;top:0;right:0;cursor:n-resize;zoom:1;}.yui-resize-proxy{position:absolute;border:1px dashed #000;visibility:hidden;z-index:1000;}.yui-resize-hover .yui-resize-handle,.yui-resize-hidden .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-resize-ghost{opacity:.5;filter:alpha(opacity=50);}.yui-resize-knob .yui-resize-handle{height:6px;width:6px;}.yui-resize-knob .yui-resize-handle-tr{right:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-tl{left:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-bl{left:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-br{right:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-t{left:45%;top:-3px;}.yui-resize-knob .yui-resize-handle-r{right:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-l{left:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-b{left:45%;bottom:-3px;}.yui-resize-status{position:absolute;top:-999px;left:-999px;padding:2px;font-size:80%;display:none;zoom:1;z-index:9999;}.yui-resize-status strong,.yui-resize-status em{font-weight:normal;font-style:normal;padding:1px;zoom:1;}.yui-skin-sam .yui-resize .yui-resize-handle{background-color:#F2F2F2;}.yui-skin-sam .yui-resize .yui-resize-handle-active{background-color:#7D98B8;zoom:1;}.yui-skin-sam .yui-resize-knob .yui-resize-handle{border:1px solid #808080;}.yui-skin-sam .yui-resize-hover .yui-resize-handle-active{opacity:1;filter:alpha(opacity=100);}.yui-skin-sam .yui-resize-proxy{border:1px dashed #426FD9;}.yui-skin-sam .yui-resize-status{border:1px solid #A6982B;border-top:1px solid #D4C237;background-color:#FFEE69}.yui-skin-sam .yui-resize-status strong,.yui-skin-sam .yui-resize-status em{float:left;display:block;clear:both;padding:1px;text-align:center;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize .yui-resize-handle-inner-l{background:transparent url( layout_sprite.png) no-repeat 0 -5px;height:16px;width:5px;position:absolute;top:45%;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize .yui-resize-handle-inner-b{background:transparent url(layout_sprite.png) no-repeat -20px 0;height:5px;width:16px;position:absolute;left:50%;}.yui-skin-sam .yui-resize .yui-resize-handle-br{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -62px;}.yui-skin-sam .yui-resize .yui-resize-handle-tr{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -42px;}.yui-skin-sam .yui-resize .yui-resize-handle-tl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -82px;}.yui-skin-sam .yui-resize .yui-resize-handle-bl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -23px;}.yui-skin-sam .yui-resize-knob .yui-resize-handle-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-br,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br{background-image:none;}
diff --git a/lib/yui/assets/skins/sam/simpleeditor.css b/lib/yui/assets/skins/sam/simpleeditor.css
new file mode 100644 (file)
index 0000000..05d6f11
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
index 66c2fc561281754247b92c3770629524c91378c3..ba3a7d141a9b9d1de8ce18831ccfbe3389ce5022 100755 (executable)
@@ -1,18 +1,23 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
-.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
-.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
-.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
-.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
-.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
-.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:2;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:0.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;}
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;list-style:none;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay{display:none;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
+.yui-dt{border:1px solid transparent;}.yui-dt-noop{border:none;}.yui-dt-liner{overflow:hidden;}.yui-dt-bd thead tr,.yui-dt-bd thead th{position:absolute;left:-1500px;}.yui-dt-draggable{cursor:move;}.yui-dt-coltarget{position:absolute;z-index:999;}.yui-dt-hd{zoom:1;}th.yui-dt-resizeable .yui-dt-liner{position:relative;}.yui-dt-resizer{position:absolute;right:0;bottom:0;height:100%;cursor:e-resize;cursor:col-resize;}.yui-dt-resizerproxy{visibility:hidden;position:absolute;z-index:9000;}.yui-skin-sam th.yui-dt-hidden .yui-dt-liner,.yui-skin-sam td.yui-dt-hidden .yui-dt-liner{margin:0;padding:0;overflow:hidden;white-space:nowrap;}.yui-dt-scrollable .yui-dt-bd{overflow:auto;}.yui-dt-scrollable .yui-dt-hd{overflow:hidden;position:relative;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border-spacing:0;}.yui-skin-sam .yui-dt thead{border-spacing:0;}.yui-skin-sam .yui-dt caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-hd table{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-bd table{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt th{background:#D8D8DA url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt th,.yui-skin-sam .yui-dt th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt th{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-liner{margin:0;padding:0;padding:4px 10px 4px 10px;}.yui-skin-sam .yui-dt-coltarget{width:5px;background-color:red;}.yui-skin-sam .yui-dt td{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;text-align:left;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-resizer{width:6px;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-empty{background-color:#FFF;}.yui-skin-sam .yui-dt-error{background-color:#FFF;}.yui-skin-sam thead .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:10px;}.yui-skin-sam th.yui-dt-asc .yui-dt-liner{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-liner{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam th.yui-dt-highlighted,.yui-skin-sam th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list th.yui-dt-highlighted,.yui-skin-sam .yui-dt-list th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam th.yui-dt-selected,.yui-skin-sam th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list th.yui-dt-selected,.yui-skin-sam .yui-dt-list th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-pg-container,.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-last,.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam a.yui-pg-first,.yui-skin-sam a.yui-pg-previous,.yui-skin-sam a.yui-pg-next,.yui-skin-sam a.yui-pg-last,.yui-skin-sam a.yui-pg-page,.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-pg-page,.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;background-color:#fff}.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-selected{border:1px solid #fff;background-color:#fff;}.yui-skin-sam .yui-pg-pages{margin-left:1ex;margin-right:1ex;}.yui-skin-sam .yui-pg-page{margin-right:1px;margin-left:1px;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous{margin-right:3px;}.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last{margin-left:3px;}.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-rpp-options{margin-right:1em;margin-left:1em;}
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-crop{position:relative;}.yui-crop .yui-crop-mask{position:absolute;top:0;left:0;height:100%;width:100%;}.yui-crop .yui-resize{position:absolute;top:10px;left:10px;}.yui-crop .yui-crop-resize-mask{position:absolute;top:0;left:0;height:100%;width:100%;background-position:-10px -10px;overflow:hidden;}.yui-skin-sam .yui-crop .yui-crop-mask{background-color:#000;opacity:.5;filter:alpha(opacity=50);}.yui-skin-sam .yui-crop .yui-resize{border:1px dashed #fff;}
+.yui-layout-loading{visibility:hidden;}body.yui-layout{overflow:hidden;position:relative;padding:0;margin:0;}.yui-layout-doc{position:relative;}.yui-layout-unit{height:50px;width:50px;padding:0;margin:0;float:none;z-index:0;overflow:hidden;}.yui-layout-unit-top{position:absolute;top:0;left:0;width:100%;}.yui-layout-unit-left{position:absolute;top:0;left:0;}.yui-layout-unit-right{position:absolute;top:0;right:0;}.yui-layout-unit-bottom{position:absolute;bottom:0;left:0;width:100%;}.yui-layout-unit-center{position:absolute;top:0;left:0;width:100%;}.yui-layout div.yui-layout-hd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout div.yui-layout-bd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout .yui-layout-scroll div.yui-layout-bd{overflow:auto;}.yui-layout div.yui-layout-ft{position:absolute;bottom:0;left:0;width:100%;zoom:1;overflow:hidden;}.yui-layout .yui-layout-unit div.yui-layout-hd h2{text-align:left;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .close{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse-close{right:25px;}.yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#c0c0c0;display:none;}.yui-layout .yui-layout-clip .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0px;}.yui-layout .yui-layout-wrap{height:100%;width:100%;position:absolute;left:0;}.yui-layout .yui-layout-unit .yui-content{overflow:hidden;}.yui-layout .yui-layout-unit .yui-layout-scroll{overflow:auto;}.yui-skin-sam .yui-layout .yui-resize-proxy{border:none;font-size:0;margin:0;padding:0;}.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-skin-sam .yui-layout .yui-resize-proxy div{position:absolute;border:1px solid #808080;background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r{width:5px;top:0;right:0;height:100%;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b{width:100%;bottom:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t{width:100%;top:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -160px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -140px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -200px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -120px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -220px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -240px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -260px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -180px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close{background:transparent url(layout_sprite.png) no-repeat -20px -100px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-hd{background:url(sprite.png) repeat-x 0 -1400px;border:1px solid #808080;}.yui-skin-sam .yui-layout{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2{font-weight:bold;color:#fff;padding:3px;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd{border:1px solid #808080;border-bottom:none;border-top:none;*border-bottom-width:0;*border-top-width:0;background-color:#f2f2f2;text-align:left;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft{border-bottom:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd{border-top:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#EDF5FF;display:none;border:1px solid #808080;}.yui-skin-sam .yui-layout div.yui-layout-ft{border:1px solid #808080;border-top:none;*border-top-width:0;background-color:#f2f2f2;}.yui-skin-sam .yui-layout-unit .yui-resize-handle{background-color:transparent;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-b{right:0;bottom:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob{position:absolute;height:16px;width:6px;top:45%;left:0px;background:transparent url(layout_sprite.png) no-repeat 0 -5px;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob{position:absolute;height:6px;width:16px;left:45%;background:transparent url(layout_sprite.png) no-repeat -20px 0;}
 .yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
-.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
-.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
-.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
+.yuimenubar{visibility:visible;position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{visibility:hidden;position:absolute;top:-10000px;left:-10000px;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);}
+.yui-skin-sam .yui-pv{background-color:#4a4a4a;font:arial;position:relative;width:99%;z-index:1000;margin-bottom:1em;overflow:hidden;}.yui-skin-sam .yui-pv .hd{background:url(header_background.png) repeat-x;min-height:30px;overflow:hidden;zoom:1;padding:2px 0;}.yui-skin-sam .yui-pv .hd h4{padding:8px 10px;margin:0;font:bold 14px arial;color:#fff;}.yui-skin-sam .yui-pv .hd a{background:#3f6bc3;font:bold 11px arial;color:#fff;padding:4px;margin:3px 10px 0 0;border:1px solid #3f567d;cursor:pointer;display:block;float:right;}.yui-skin-sam .yui-pv .hd span{display:none;}.yui-skin-sam .yui-pv .hd span.yui-pv-busy{height:18px;width:18px;background:url(wait.gif) no-repeat;overflow:hidden;display:block;float:right;margin:4px 10px 0 0;}.yui-skin-sam .yui-pv .hd:after,.yui-pv .bd:after,.yui-skin-sam .yui-pv-chartlegend dl:after{content:'.';visibility:hidden;clear:left;height:0;display:block;}.yui-skin-sam .yui-pv .bd{position:relative;zoom:1;overflow-x:auto;overflow-y:hidden;}.yui-skin-sam .yui-pv .yui-pv-table{padding:0 10px;margin:5px 0 10px 0;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-bd td{color:#eeee5c;font:12px arial;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd{background:#929292;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even{background:#58637a;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-desc{background:#384970;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-desc{background:#6F6E6E;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th{background-image:none;background:#2E2D2D;}.yui-skin-sam .yui-pv th.yui-dt-asc .yui-dt-liner{background:transparent url(asc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv th.yui-dt-desc .yui-dt-liner{background:transparent url(desc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th a{color:#fff;font:bold 12px arial;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-desc{background:#333;}.yui-skin-sam .yui-pv-chartcontainer{padding:0 10px;}.yui-skin-sam .yui-pv-chart{height:250px;clear:right;margin:5px 0 0 0;color:#fff;}.yui-skin-sam .yui-pv-chartlegend div{float:right;margin:0 0 0 10px;_width:250px;}.yui-skin-sam .yui-pv-chartlegend dl{border:1px solid #999;padding:.2em 0 .2em .5em;zoom:1;margin:5px 0;}.yui-skin-sam .yui-pv-chartlegend dt{float:left;display:block;height:.7em;width:.7em;padding:0;}.yui-skin-sam .yui-pv-chartlegend dd{float:left;display:block;color:#fff;margin:0 1em 0 .5em;padding:0;font:11px arial;}.yui-skin-sam .yui-pv-minimized{height:35px;}.yui-skin-sam .yui-pv-minimized .bd{top:-3000px;}.yui-skin-sam .yui-pv-minimized .hd a.yui-pv-refresh{display:none;}
+.yui-resize{position:relative;zoom:1;z-index:0;}.yui-resize-wrap{zoom:1;}.yui-draggable{cursor:move;}.yui-resize .yui-resize-handle{position:absolute;z-index:1;font-size:0;margin:0;padding:0;zoom:1;height:1px;width:1px;}.yui-resize .yui-resize-handle-br{height:5px;width:5px;bottom:0;right:0;cursor:se-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-bl{height:5px;width:5px;bottom:0;left:0;cursor:sw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tl{height:5px;width:5px;top:0;left:0;cursor:nw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tr{height:5px;width:5px;top:0;right:0;cursor:ne-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-r{width:5px;height:100%;top:0;right:0;cursor:e-resize;zoom:1;}.yui-resize .yui-resize-handle-l{height:100%;width:5px;top:0;left:0;cursor:w-resize;zoom:1;}.yui-resize .yui-resize-handle-b{width:100%;height:5px;bottom:0;right:0;cursor:s-resize;zoom:1;}.yui-resize .yui-resize-handle-t{width:100%;height:5px;top:0;right:0;cursor:n-resize;zoom:1;}.yui-resize-proxy{position:absolute;border:1px dashed #000;visibility:hidden;z-index:1000;}.yui-resize-hover .yui-resize-handle,.yui-resize-hidden .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-resize-ghost{opacity:.5;filter:alpha(opacity=50);}.yui-resize-knob .yui-resize-handle{height:6px;width:6px;}.yui-resize-knob .yui-resize-handle-tr{right:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-tl{left:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-bl{left:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-br{right:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-t{left:45%;top:-3px;}.yui-resize-knob .yui-resize-handle-r{right:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-l{left:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-b{left:45%;bottom:-3px;}.yui-resize-status{position:absolute;top:-999px;left:-999px;padding:2px;font-size:80%;display:none;zoom:1;z-index:9999;}.yui-resize-status strong,.yui-resize-status em{font-weight:normal;font-style:normal;padding:1px;zoom:1;}.yui-skin-sam .yui-resize .yui-resize-handle{background-color:#F2F2F2;}.yui-skin-sam .yui-resize .yui-resize-handle-active{background-color:#7D98B8;zoom:1;}.yui-skin-sam .yui-resize-knob .yui-resize-handle{border:1px solid #808080;}.yui-skin-sam .yui-resize-hover .yui-resize-handle-active{opacity:1;filter:alpha(opacity=100);}.yui-skin-sam .yui-resize-proxy{border:1px dashed #426FD9;}.yui-skin-sam .yui-resize-status{border:1px solid #A6982B;border-top:1px solid #D4C237;background-color:#FFEE69}.yui-skin-sam .yui-resize-status strong,.yui-skin-sam .yui-resize-status em{float:left;display:block;clear:both;padding:1px;text-align:center;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize .yui-resize-handle-inner-l{background:transparent url( layout_sprite.png) no-repeat 0 -5px;height:16px;width:5px;position:absolute;top:45%;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize .yui-resize-handle-inner-b{background:transparent url(layout_sprite.png) no-repeat -20px 0;height:5px;width:16px;position:absolute;left:50%;}.yui-skin-sam .yui-resize .yui-resize-handle-br{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -62px;}.yui-skin-sam .yui-resize .yui-resize-handle-tr{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -42px;}.yui-skin-sam .yui-resize .yui-resize-handle-tl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -82px;}.yui-skin-sam .yui-resize .yui-resize-handle-bl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -23px;}.yui-skin-sam .yui-resize-knob .yui-resize-handle-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-br,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br{background-image:none;}
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:12px;}
 
index 247414abb6fdd88946b7b92ca4a7a20be51d6ede..85b05bb9be1e714620172ddc89cafcfdbace7aee 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
index b82d34e6e8ff9f8b07173a014b2f79b8f126b0f8..447c4a5e881017d12e770e836e267a612d74212a 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:12px;}
diff --git a/lib/yui/assets/skins/sam/wait.gif b/lib/yui/assets/skins/sam/wait.gif
new file mode 100644 (file)
index 0000000..471c1a4
Binary files /dev/null and b/lib/yui/assets/skins/sam/wait.gif differ
index 8b4d7cdee740befffa02866743cde5dda3987895..4bee47ea74a6f6569ac01feefc6d80a8fe86e03b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
index 89659ae9fb8384d009e118a1b5e4d008ef423c55..16d0eb70a0c7c0f529eeae87c35b19e8a16f13e1 100755 (executable)
@@ -1,8 +1,48 @@
 AutoComplete Release Notes
 
+*** version 2.5.0 ***
+
+* Fixed bug where Mac users were not able to input "&" or "(" characters.
+
+
+
+*** version 2.4.0 ***
+
+* Support for YUI JSON Utility.
+
+* The allowBrowserAutocomplete property now supports cases when the user navigates
+away from page via mean other than a form submission.
+
+* Added support for integration with the Get Utility, for proxyless data
+retrieval from dynamically loaded script nodes.
+
+* Typing 'Enter' to select item no longer causes automatic form submission on
+Mac browsers.
+
+
+
+*** version 2.3.1 ***
+
+* AutoComplete no longer throw a JavaScript error due to an invalid or
+non-existent parent container. While a wrapper DIV element is still expected in
+order to enable skinning (see 2.3.0 release note), a lack of such will not
+cause an error.
+
+* When suggestion container is collapsed, Mac users no longer need to type
+Enter twice to submit input.
+
+
+
 *** version 2.3.0 ***
 
-* Applied new skinning model.
+* Applied new skinning model. Please note that in order to enable skinning,
+AutoComplete now expects a wrapper DIV element around the INPUT element and the
+container DIV element, in this fashion:
+
+<div id="myAutoComplete">
+    <input type="text" id="myInput">
+    <div id="myContainer"></div>
+</div>
 
 * The default queryDelay value has been changed to 0.2. In low-latency
 implementations (e.g., when queryDelay is set to 0 against a local
index 921fad9617ae6604f08b5d987ba4ea59c6bb00fc..38a466d85d883cce0f62ee31791e555167d7b43b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* This file intentionally left blank */\r
+/* This file intentionally left blank */
index a2d23590727f3386c4dcd500b8a48c17c444d2e4..343e4bb96c8432559dc93a23bc2550e9885bb8c2 100755 (executable)
@@ -1,50 +1,50 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* styles for entire widget */\r
-.yui-skin-sam .yui-ac {\r
-    position:relative;font-family:arial;font-size:100%;\r
-}\r
-\r
-/* styles for input field */\r
-.yui-skin-sam .yui-ac-input {\r
-    position:absolute;width:100%;\r
-}\r
-\r
-/* styles for results container */\r
-.yui-skin-sam .yui-ac-container {\r
-    position:absolute;top:1.6em;width:100%;\r
-}\r
-\r
-/* styles for header/body/footer wrapper within container */\r
-.yui-skin-sam .yui-ac-content {\r
-    position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;\r
-}\r
-\r
-/* styles for container shadow */\r
-.yui-skin-sam .yui-ac-shadow {\r
-    position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity: 0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;\r
-}\r
-\r
-/* styles for results list */\r
-.yui-skin-sam .yui-ac-content ul{\r
-    margin:0;padding:0;width:100%;\r
-}\r
-\r
-/* styles for result item */\r
-.yui-skin-sam .yui-ac-content li {\r
-    margin:0;padding:2px 5px;cursor:default;white-space:nowrap;\r
-}\r
-\r
-/* styles for prehighlighted result item */\r
-.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight {\r
-    background:#B3D4FF;\r
-}\r
-\r
-/* styles for highlighted result item */\r
-.yui-skin-sam .yui-ac-content li.yui-ac-highlight {\r
-    background:#426FD9;color:#FFF;\r
-}\r
+/* styles for entire widget */
+.yui-skin-sam .yui-ac {
+    position:relative;font-family:arial;font-size:100%;
+}
+
+/* styles for input field */
+.yui-skin-sam .yui-ac-input {
+    position:absolute;width:100%;
+}
+
+/* styles for results container */
+.yui-skin-sam .yui-ac-container {
+    position:absolute;top:1.6em;width:100%;
+}
+
+/* styles for header/body/footer wrapper within container */
+.yui-skin-sam .yui-ac-content {
+    position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;
+}
+
+/* styles for container shadow */
+.yui-skin-sam .yui-ac-shadow {
+    position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity: 0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;
+}
+
+/* styles for results list */
+.yui-skin-sam .yui-ac-content ul{
+    margin:0;padding:0;width:100%;
+}
+
+/* styles for result item */
+.yui-skin-sam .yui-ac-content li {
+    margin:0;padding:2px 5px;cursor:default;white-space:nowrap;
+}
+
+/* styles for prehighlighted result item */
+.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight {
+    background:#B3D4FF;
+}
+
+/* styles for highlighted result item */
+.yui-skin-sam .yui-ac-content li.yui-ac-highlight {
+    background:#426FD9;color:#FFF;
+}
index 98b473e26a6e3c9a6a92abe182e86a352feb337e..ed09f85f97a115f4b06feb838c5a516b5d7a8103 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
index 522add11f01e52337db2b22e5f806ecabff69810..47eec8d6c44b5dec7b66cebf41b4aa374d13c7c7 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
  /**
  * The AutoComplete control provides the front-end logic for text-entry suggestion and
@@ -10,7 +10,7 @@ version: 2.3.0
  *
  * @module autocomplete
  * @requires yahoo, dom, event, datasource
- * @optional animation, connection
+ * @optional animation, connection, get
  * @namespace YAHOO.widget
  * @title AutoComplete Widget
  */
@@ -54,15 +54,15 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         if(YAHOO.util.Dom.inDocument(elInput)) {
             if(YAHOO.lang.isString(elInput)) {
                     this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;
-                    this._oTextbox = document.getElementById(elInput);
+                    this._elTextbox = document.getElementById(elInput);
             }
             else {
                 this._sName = (elInput.id) ?
                     "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:
                     "instance" + YAHOO.widget.AutoComplete._nIndex;
-                this._oTextbox = elInput;
+                this._elTextbox = elInput;
             }
-            YAHOO.util.Dom.addClass(this._oTextbox, "yui-ac-input");
+            YAHOO.util.Dom.addClass(this._elTextbox, "yui-ac-input");
         }
         else {
             YAHOO.log("Could not instantiate AutoComplete due to an invalid input element", "error", this.toString());
@@ -72,30 +72,23 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         // Validate container element
         if(YAHOO.util.Dom.inDocument(elContainer)) {
             if(YAHOO.lang.isString(elContainer)) {
-                    this._oContainer = document.getElementById(elContainer);
+                    this._elContainer = document.getElementById(elContainer);
             }
             else {
-                this._oContainer = elContainer;
+                this._elContainer = elContainer;
             }
-            if(this._oContainer.style.display == "none") {
+            if(this._elContainer.style.display == "none") {
                 YAHOO.log("The container may not display properly if display is set to \"none\" in CSS", "warn", this.toString());
             }
             
             // For skinning
-            var elParent = this._oContainer.parentNode;
+            var elParent = this._elContainer.parentNode;
             var elTag = elParent.tagName.toLowerCase();
-            while(elParent && (elParent != "document")) {
-                if(elTag == "div") {
-                    YAHOO.util.Dom.addClass(elParent, "yui-ac");
-                    break;
-                }
-                else {
-                    elParent = elParent.parentNode;
-                    elTag = elParent.tagName.toLowerCase();
-                }
+            if(elTag == "div") {
+                YAHOO.util.Dom.addClass(elParent, "yui-ac");
             }
-            if(elTag != "div") {
-                YAHOO.log("Could not find an appropriate parent container for skinning", "warn", this.toString());
+            else {
+                YAHOO.log("Could not find the wrapper element for skinning", "warn", this.toString());
             }
         }
         else {
@@ -120,23 +113,21 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
 
         // Set up events
         var oSelf = this;
-        var oTextbox = this._oTextbox;
+        var elTextbox = this._elTextbox;
         // Events are actually for the content module within the container
-        var oContent = this._oContainer._oContent;
+        var elContent = this._elContent;
 
         // Dom events
-        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);
-        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);
-        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);
-        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);
-        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);
-        if(oTextbox.form) {
-            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);
-        }
-        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"focus",oSelf._onTextboxFocus,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"blur",oSelf._onTextboxBlur,oSelf);
+        YAHOO.util.Event.addListener(elContent,"mouseover",oSelf._onContainerMouseover,oSelf);
+        YAHOO.util.Event.addListener(elContent,"mouseout",oSelf._onContainerMouseout,oSelf);
+        YAHOO.util.Event.addListener(elContent,"scroll",oSelf._onContainerScroll,oSelf);
+        YAHOO.util.Event.addListener(elContent,"resize",oSelf._onContainerResize,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+        YAHOO.util.Event.addListener(window,"unload",oSelf._onWindowUnload,oSelf);
 
         // Custom events
         this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);
@@ -157,7 +148,7 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);
         
         // Finish up
-        oTextbox.setAttribute("autocomplete","off");
+        elTextbox.setAttribute("autocomplete","off");
         YAHOO.widget.AutoComplete._nIndex++;
         YAHOO.log("AutoComplete initialized","info",this.toString());
     }
@@ -415,15 +406,16 @@ YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {
  * @param sHeader {String} HTML markup for results container header.
  */
 YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
-    if(sHeader) {
-        if(this._oContainer._oContent._oHeader) {
-            this._oContainer._oContent._oHeader.innerHTML = sHeader;
-            this._oContainer._oContent._oHeader.style.display = "block";
+    if(this._elHeader) {
+        var elHeader = this._elHeader;
+        if(sHeader) {
+            elHeader.innerHTML = sHeader;
+            elHeader.style.display = "block";
+        }
+        else {
+            elHeader.innerHTML = "";
+            elHeader.style.display = "none";
         }
-    }
-    else {
-        this._oContainer._oContent._oHeader.innerHTML = "";
-        this._oContainer._oContent._oHeader.style.display = "none";
     }
 };
 
@@ -435,15 +427,16 @@ YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
  * @param sFooter {String} HTML markup for results container footer.
  */
 YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
-    if(sFooter) {
-        if(this._oContainer._oContent._oFooter) {
-            this._oContainer._oContent._oFooter.innerHTML = sFooter;
-            this._oContainer._oContent._oFooter.style.display = "block";
+    if(this._elFooter) {
+        var elFooter = this._elFooter;
+        if(sFooter) {
+                elFooter.innerHTML = sFooter;
+                elFooter.style.display = "block";
+        }
+        else {
+            elFooter.innerHTML = "";
+            elFooter.style.display = "none";
         }
-    }
-    else {
-        this._oContainer._oContent._oFooter.innerHTML = "";
-        this._oContainer._oContent._oFooter.style.display = "none";
     }
 };
 
@@ -455,18 +448,19 @@ YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
  * @param sBody {String} HTML markup for results container body.
  */
 YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {
-    if(sBody) {
-        if(this._oContainer._oContent._oBody) {
-            this._oContainer._oContent._oBody.innerHTML = sBody;
-            this._oContainer._oContent._oBody.style.display = "block";
-            this._oContainer._oContent.style.display = "block";
+    if(this._elBody) {
+        var elBody = this._elBody;
+        if(sBody) {
+                elBody.innerHTML = sBody;
+                elBody.style.display = "block";
+                elBody.style.display = "block";
         }
+        else {
+            elBody.innerHTML = "";
+            elBody.style.display = "none";
+        }
+        this._maxResultsDisplayed = 0;
     }
-    else {
-        this._oContainer._oContent._oBody.innerHTML = "";
-        this._oContainer._oContent.style.display = "none";
-    }
-    this._maxResultsDisplayed = 0;
 };
 
 /**
@@ -495,13 +489,13 @@ YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery)
  * and DOM elements.
  *
  * @method doBeforeExpandContainer
- * @param oTextbox {HTMLElement} The text input box.
- * @param oContainer {HTMLElement} The container element.
+ * @param elTextbox {HTMLElement} The text input box.
+ * @param elContainer {HTMLElement} The container element.
  * @param sQuery {String} The query string.
  * @param aResults {Object[]}  An array of query results.
  * @return {Boolean} Return true to continue expanding container, false to cancel the expand.
  */
-YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(elTextbox, elContainer, sQuery, aResults) {
     return true;
 };
 
@@ -536,26 +530,26 @@ YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) {
  */
 YAHOO.widget.AutoComplete.prototype.destroy = function() {
     var instanceName = this.toString();
-    var elInput = this._oTextbox;
-    var elContainer = this._oContainer;
+    var elInput = this._elTextbox;
+    var elContainer = this._elContainer;
 
     // Unhook custom events
-    this.textboxFocusEvent.unsubscribe();
-    this.textboxKeyEvent.unsubscribe();
-    this.dataRequestEvent.unsubscribe();
-    this.dataReturnEvent.unsubscribe();
-    this.dataErrorEvent.unsubscribe();
-    this.containerExpandEvent.unsubscribe();
-    this.typeAheadEvent.unsubscribe();
-    this.itemMouseOverEvent.unsubscribe();
-    this.itemMouseOutEvent.unsubscribe();
-    this.itemArrowToEvent.unsubscribe();
-    this.itemArrowFromEvent.unsubscribe();
-    this.itemSelectEvent.unsubscribe();
-    this.unmatchedItemSelectEvent.unsubscribe();
-    this.selectionEnforceEvent.unsubscribe();
-    this.containerCollapseEvent.unsubscribe();
-    this.textboxBlurEvent.unsubscribe();
+    this.textboxFocusEvent.unsubscribeAll();
+    this.textboxKeyEvent.unsubscribeAll();
+    this.dataRequestEvent.unsubscribeAll();
+    this.dataReturnEvent.unsubscribeAll();
+    this.dataErrorEvent.unsubscribeAll();
+    this.containerExpandEvent.unsubscribeAll();
+    this.typeAheadEvent.unsubscribeAll();
+    this.itemMouseOverEvent.unsubscribeAll();
+    this.itemMouseOutEvent.unsubscribeAll();
+    this.itemArrowToEvent.unsubscribeAll();
+    this.itemArrowFromEvent.unsubscribeAll();
+    this.itemSelectEvent.unsubscribeAll();
+    this.unmatchedItemSelectEvent.unsubscribeAll();
+    this.selectionEnforceEvent.unsubscribeAll();
+    this.containerCollapseEvent.unsubscribeAll();
+    this.textboxBlurEvent.unsubscribeAll();
 
     // Unhook DOM events
     YAHOO.util.Event.purgeElement(elInput, true);
@@ -566,7 +560,7 @@ YAHOO.widget.AutoComplete.prototype.destroy = function() {
 
     // Null out objects
     for(var key in this) {
-        if(this.hasOwnProperty(key)) {
+        if(YAHOO.lang.hasOwnProperty(this, key)) {
             this[key] = null;
         }
     }
@@ -695,12 +689,9 @@ YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;
 
 /**
  * Fired when a user selection does not match any of the displayed result items.
- * Note that this event may not behave as expected when delimiter characters
- * have been defined. 
  *
  * @event unmatchedItemSelectEvent
  * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
- * @param sQuery {String} The user-typed query string.
  */
 YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;
 
@@ -757,11 +748,74 @@ YAHOO.widget.AutoComplete.prototype._sName = null;
 /**
  * Text input field DOM element.
  *
- * @property _oTextbox
+ * @property _elTextbox
  * @type HTMLElement
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._oTextbox = null;
+YAHOO.widget.AutoComplete.prototype._elTextbox = null;
+
+/**
+ * Container DOM element.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elContainer = null;
+
+/**
+ * Reference to content element within container element.
+ *
+ * @property _elContent
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elContent = null;
+
+/**
+ * Reference to header element within content element.
+ *
+ * @property _elHeader
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elHeader = null;
+
+/**
+ * Reference to body element within content element.
+ *
+ * @property _elBody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elBody = null;
+
+/**
+ * Reference to footer element within content element.
+ *
+ * @property _elFooter
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elFooter = null;
+
+/**
+ * Reference to shadow element within container element.
+ *
+ * @property _elShadow
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elShadow = null;
+
+/**
+ * Reference to iframe element within container element.
+ *
+ * @property _elIFrame
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elIFrame = null;
 
 /**
  * Whether or not the input field is currently in focus. If query results come back
@@ -782,15 +836,6 @@ YAHOO.widget.AutoComplete.prototype._bFocused = true;
  */
 YAHOO.widget.AutoComplete.prototype._oAnim = null;
 
-/**
- * Container DOM element.
- *
- * @property _oContainer
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.AutoComplete.prototype._oContainer = null;
-
 /**
  * Whether or not the results container is currently open.
  *
@@ -952,7 +997,7 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
         this.queryDelay = 0.2;
     }
     var delimChar = this.delimChar;
-    if(YAHOO.lang.isString(delimChar)) {
+    if(YAHOO.lang.isString(delimChar) && (delimChar.length > 0)) {
         this.delimChar = [delimChar];
     }
     else if(!YAHOO.lang.isArray(delimChar)) {
@@ -964,7 +1009,7 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
             this.animSpeed = 0.3;
         }
         if(!this._oAnim ) {
-            this._oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);
+            this._oAnim = new YAHOO.util.Anim(this._elContent, {}, this.animSpeed);
         }
         else {
             this._oAnim.duration = this.animSpeed;
@@ -983,21 +1028,21 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
-    if(this.useShadow && !this._oContainer._oShadow) {
-        var oShadow = document.createElement("div");
-        oShadow.className = "yui-ac-shadow";
-        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);
-    }
-    if(this.useIFrame && !this._oContainer._oIFrame) {
-        var oIFrame = document.createElement("iframe");
-        oIFrame.src = this._iFrameSrc;
-        oIFrame.frameBorder = 0;
-        oIFrame.scrolling = "no";
-        oIFrame.style.position = "absolute";
-        oIFrame.style.width = "100%";
-        oIFrame.style.height = "100%";
-        oIFrame.tabIndex = -1;
-        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);
+    if(this.useShadow && !this._elShadow) {
+        var elShadow = document.createElement("div");
+        elShadow.className = "yui-ac-shadow";
+        this._elShadow = this._elContainer.appendChild(elShadow);
+    }
+    if(this.useIFrame && !this._elIFrame) {
+        var elIFrame = document.createElement("iframe");
+        elIFrame.src = this._iFrameSrc;
+        elIFrame.frameBorder = 0;
+        elIFrame.scrolling = "no";
+        elIFrame.style.position = "absolute";
+        elIFrame.style.width = "100%";
+        elIFrame.style.height = "100%";
+        elIFrame.tabIndex = -1;
+        this._elIFrame = this._elContainer.appendChild(elIFrame);
     }
 };
 
@@ -1008,28 +1053,28 @@ YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._initContainer = function() {
-    YAHOO.util.Dom.addClass(this._oContainer, "yui-ac-container");
+    YAHOO.util.Dom.addClass(this._elContainer, "yui-ac-container");
     
-    if(!this._oContainer._oContent) {
-        // The oContent div helps size the iframe and shadow properly
-        var oContent = document.createElement("div");
-        oContent.className = "yui-ac-content";
-        oContent.style.display = "none";
-        this._oContainer._oContent = this._oContainer.appendChild(oContent);
-
-        var oHeader = document.createElement("div");
-        oHeader.className = "yui-ac-hd";
-        oHeader.style.display = "none";
-        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);
-
-        var oBody = document.createElement("div");
-        oBody.className = "yui-ac-bd";
-        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);
-
-        var oFooter = document.createElement("div");
-        oFooter.className = "yui-ac-ft";
-        oFooter.style.display = "none";
-        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);
+    if(!this._elContent) {
+        // The elContent div helps size the iframe and shadow properly
+        var elContent = document.createElement("div");
+        elContent.className = "yui-ac-content";
+        elContent.style.display = "none";
+        this._elContent = this._elContainer.appendChild(elContent);
+
+        var elHeader = document.createElement("div");
+        elHeader.className = "yui-ac-hd";
+        elHeader.style.display = "none";
+        this._elHeader = this._elContent.appendChild(elHeader);
+
+        var elBody = document.createElement("div");
+        elBody.className = "yui-ac-bd";
+        this._elBody = this._elContent.appendChild(elBody);
+
+        var elFooter = document.createElement("div");
+        elFooter.className = "yui-ac-ft";
+        elFooter.style.display = "none";
+        this._elFooter = this._elContent.appendChild(elFooter);
     }
     else {
         YAHOO.log("Could not initialize the container","warn",this.toString());
@@ -1046,18 +1091,18 @@ YAHOO.widget.AutoComplete.prototype._initContainer = function() {
  */
 YAHOO.widget.AutoComplete.prototype._initList = function() {
     this._aListItems = [];
-    while(this._oContainer._oContent._oBody.hasChildNodes()) {
+    while(this._elBody.hasChildNodes()) {
         var oldListItems = this.getListItems();
         if(oldListItems) {
             for(var oldi = oldListItems.length-1; oldi >= 0; oldi--) {
                 oldListItems[oldi] = null;
             }
         }
-        this._oContainer._oContent._oBody.innerHTML = "";
+        this._elBody.innerHTML = "";
     }
 
     var oList = document.createElement("ul");
-    oList = this._oContainer._oContent._oBody.appendChild(oList);
+    oList = this._elBody.appendChild(oList);
     for(var i=0; i<this.maxResultsDisplayed; i++) {
         var oItem = document.createElement("li");
         oItem = oList.appendChild(oItem);
@@ -1105,7 +1150,7 @@ YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {
-    var currValue = this._oTextbox.value;
+    var currValue = this._elTextbox.value;
     var lastValue = this._sLastTextboxValue;
     if(currValue != lastValue) {
         this._sLastTextboxValue = currValue;
@@ -1247,7 +1292,7 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
     }
 
     var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
-    var contentStyle = oSelf._oContainer._oContent.style;
+    var contentStyle = oSelf._elContent.style;
     contentStyle.width = (!isOpera) ? null : "";
     contentStyle.height = (!isOpera) ? null : "";
 
@@ -1286,7 +1331,7 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
         }
 
         // Expand the container
-        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);
+        var ok = oSelf.doBeforeExpandContainer(oSelf._elTextbox, oSelf._elContainer, sQuery, aResults);
         oSelf._toggleContainer(ok);
         
         if(oSelf.autoHighlight) {
@@ -1318,16 +1363,16 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._clearSelection = function() {
-    var sValue = this._oTextbox.value;
+    var sValue = this._elTextbox.value;
     var sChar = (this.delimChar) ? this.delimChar[0] : null;
     var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;
     if(nIndex > -1) {
-        this._oTextbox.value = sValue.substring(0,nIndex);
+        this._elTextbox.value = sValue.substring(0,nIndex);
     }
     else {
-         this._oTextbox.value = "";
+         this._elTextbox.value = "";
     }
-    this._sSavedQuery = this._oTextbox.value;
+    this._sSavedQuery = this._elTextbox.value;
 
     // Fire custom event
     this.selectionEnforceEvent.fire(this);
@@ -1372,20 +1417,20 @@ YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
         return;
     }
 
-    var oTextbox = this._oTextbox;
-    var sValue = this._oTextbox.value; // any saved queries plus what user has typed
+    var elTextbox = this._elTextbox;
+    var sValue = this._elTextbox.value; // any saved queries plus what user has typed
 
     // Don't update with type-ahead if text selection is not supported
-    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {
+    if(!elTextbox.setSelectionRange && !elTextbox.createTextRange) {
         return;
     }
 
     // Select the portion of text that the user has not typed
     var nStart = sValue.length;
     this._updateValue(oItem);
-    var nEnd = oTextbox.value.length;
-    this._selectText(oTextbox,nStart,nEnd);
-    var sPrefill = oTextbox.value.substr(nStart,nEnd);
+    var nEnd = elTextbox.value.length;
+    this._selectText(elTextbox,nStart,nEnd);
+    var sPrefill = elTextbox.value.substr(nStart,nEnd);
     this.typeAheadEvent.fire(this,sQuery,sPrefill);
     YAHOO.log("Typeahead occured with prefill string \"" + sPrefill + "\"", "info", this.toString());
 };
@@ -1394,23 +1439,23 @@ YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
  * Selects text in the input field.
  *
  * @method _selectText
- * @param oTextbox {HTMLElement} Text input box element in which to select text.
+ * @param elTextbox {HTMLElement} Text input box element in which to select text.
  * @param nStart {Number} Starting index of text string to select.
  * @param nEnd {Number} Ending index of text selection.
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {
-    if(oTextbox.setSelectionRange) { // For Mozilla
-        oTextbox.setSelectionRange(nStart,nEnd);
+YAHOO.widget.AutoComplete.prototype._selectText = function(elTextbox, nStart, nEnd) {
+    if(elTextbox.setSelectionRange) { // For Mozilla
+        elTextbox.setSelectionRange(nStart,nEnd);
     }
-    else if(oTextbox.createTextRange) { // For IE
-        var oTextRange = oTextbox.createTextRange();
+    else if(elTextbox.createTextRange) { // For IE
+        var oTextRange = elTextbox.createTextRange();
         oTextRange.moveStart("character", nStart);
-        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);
+        oTextRange.moveEnd("character", nEnd-elTextbox.value.length);
         oTextRange.select();
     }
     else {
-        oTextbox.select();
+        elTextbox.select();
     }
 };
 
@@ -1423,29 +1468,29 @@ YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEn
  */
 YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
     var bFireEvent = false;
-    var width = this._oContainer._oContent.offsetWidth + "px";
-    var height = this._oContainer._oContent.offsetHeight + "px";
+    var width = this._elContent.offsetWidth + "px";
+    var height = this._elContent.offsetHeight + "px";
 
-    if(this.useIFrame && this._oContainer._oIFrame) {
+    if(this.useIFrame && this._elIFrame) {
         bFireEvent = true;
         if(bShow) {
-            this._oContainer._oIFrame.style.width = width;
-            this._oContainer._oIFrame.style.height = height;
+            this._elIFrame.style.width = width;
+            this._elIFrame.style.height = height;
         }
         else {
-            this._oContainer._oIFrame.style.width = 0;
-            this._oContainer._oIFrame.style.height = 0;
+            this._elIFrame.style.width = 0;
+            this._elIFrame.style.height = 0;
         }
     }
-    if(this.useShadow && this._oContainer._oShadow) {
+    if(this.useShadow && this._elShadow) {
         bFireEvent = true;
         if(bShow) {
-            this._oContainer._oShadow.style.width = width;
-            this._oContainer._oShadow.style.height = height;
+            this._elShadow.style.width = width;
+            this._elShadow.style.height = height;
         }
         else {
-           this._oContainer._oShadow.style.width = 0;
-            this._oContainer._oShadow.style.height = 0;
+           this._elShadow.style.width = 0;
+            this._elShadow.style.height = 0;
         }
     }
 };
@@ -1458,7 +1503,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
-    var oContainer = this._oContainer;
+    var elContainer = this._elContainer;
 
     // Implementer has container always open so don't mess with it
     if(this.alwaysShowContainer && this._bContainerOpen) {
@@ -1467,7 +1512,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
     
     // Clear contents of container
     if(!bShow) {
-        this._oContainer._oContent.scrollTop = 0;
+        this._elContent.scrollTop = 0;
         var aItems = this._aListItems;
 
         if(aItems && (aItems.length > 0)) {
@@ -1487,7 +1532,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
 
     // Container is already closed
     if(!bShow && !this._bContainerOpen) {
-        oContainer._oContent.style.display = "none";
+        this._elContent.style.display = "none";
         return;
     }
 
@@ -1505,8 +1550,8 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
         }
 
         // Clone container to grab current size offscreen
-        var oClone = oContainer._oContent.cloneNode(true);
-        oContainer.appendChild(oClone);
+        var oClone = this._elContent.cloneNode(true);
+        elContainer.appendChild(oClone);
         oClone.style.top = "-9000px";
         oClone.style.display = "block";
 
@@ -1525,16 +1570,16 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
 
         // If opening anew, set to a collapsed size...
         if(bShow && !this._bContainerOpen) {
-            oContainer._oContent.style.width = wColl+"px";
-            oContainer._oContent.style.height = hColl+"px";
+            this._elContent.style.width = wColl+"px";
+            this._elContent.style.height = hColl+"px";
         }
         // Else, set it to its last known size.
         else {
-            oContainer._oContent.style.width = wExp+"px";
-            oContainer._oContent.style.height = hExp+"px";
+            this._elContent.style.width = wExp+"px";
+            this._elContent.style.height = hExp+"px";
         }
 
-        oContainer.removeChild(oClone);
+        elContainer.removeChild(oClone);
         oClone = null;
 
        var oSelf = this;
@@ -1547,7 +1592,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
                 YAHOO.log("Container expanded", "info", oSelf.toString());
             }
             else {
-                oContainer._oContent.style.display = "none";
+                oSelf._elContent.style.display = "none";
                 oSelf.containerCollapseEvent.fire(oSelf);
                 YAHOO.log("Container collapsed", "info", oSelf.toString());
             }
@@ -1555,7 +1600,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
        };
 
         // Display container and animate it
-        oContainer._oContent.style.display = "block";
+        this._elContent.style.display = "block";
         oAnim.onComplete.subscribe(onAnimComplete);
         oAnim.animate();
         this._bContainerOpen = bShow;
@@ -1563,12 +1608,12 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
     // Else don't animate, just show or hide
     else {
         if(bShow) {
-            oContainer._oContent.style.display = "block";
+            this._elContent.style.display = "block";
             this.containerExpandEvent.fire(this);
             YAHOO.log("Container expanded", "info", this.toString());
         }
         else {
-            oContainer._oContent.style.display = "none";
+            this._elContent.style.display = "none";
             this.containerCollapseEvent.fire(this);
             YAHOO.log("Container collapsed", "info", this.toString());
         }
@@ -1634,34 +1679,34 @@ YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sTy
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {
-    var oTextbox = this._oTextbox;
+    var elTextbox = this._elTextbox;
     var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null;
     var sSavedQuery = this._sSavedQuery;
     var sResultKey = oItem._sResultKey;
-    oTextbox.focus();
+    elTextbox.focus();
 
     // First clear text field
-    oTextbox.value = "";
+    elTextbox.value = "";
     // Grab data to put into text field
     if(sDelimChar) {
         if(sSavedQuery) {
-            oTextbox.value = sSavedQuery;
+            elTextbox.value = sSavedQuery;
         }
-        oTextbox.value += sResultKey + sDelimChar;
+        elTextbox.value += sResultKey + sDelimChar;
         if(sDelimChar != " ") {
-            oTextbox.value += " ";
+            elTextbox.value += " ";
         }
     }
-    else { oTextbox.value = sResultKey; }
+    else { elTextbox.value = sResultKey; }
 
     // scroll to bottom of textarea if necessary
-    if(oTextbox.type == "textarea") {
-        oTextbox.scrollTop = oTextbox.scrollHeight;
+    if(elTextbox.type == "textarea") {
+        elTextbox.scrollTop = elTextbox.scrollHeight;
     }
 
     // move cursor to end
-    var end = oTextbox.value.length;
-    this._selectText(oTextbox,end,end);
+    var end = elTextbox.value.length;
+    this._selectText(elTextbox,end,end);
 
     this._oCurItem = oItem;
 };
@@ -1735,14 +1780,14 @@ YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
            // Go back to query (remove type-ahead string)
             if(this.delimChar && this._sSavedQuery) {
                 if(!this._textMatchesOption()) {
-                    this._oTextbox.value = this._sSavedQuery;
+                    this._elTextbox.value = this._sSavedQuery;
                 }
                 else {
-                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;
+                    this._elTextbox.value = this._sSavedQuery + this._sCurQuery;
                 }
             }
             else {
-                this._oTextbox.value = this._sCurQuery;
+                this._elTextbox.value = this._sCurQuery;
             }
             this._oCurItem = null;
             return;
@@ -1756,36 +1801,36 @@ YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
         var oNewItem = this._aListItems[nNewItemIndex];
 
         // Scroll the container if necessary
-        var oContent = this._oContainer._oContent;
-        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||
-            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));
+        var elContent = this._elContent;
+        var scrollOn = ((YAHOO.util.Dom.getStyle(elContent,"overflow") == "auto") ||
+            (YAHOO.util.Dom.getStyle(elContent,"overflowY") == "auto"));
         if(scrollOn && (nNewItemIndex > -1) &&
         (nNewItemIndex < this._nDisplayedItems)) {
             // User is keying down
             if(nKeyCode == 40) {
                 // Bottom of selected item is below scroll area...
-                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (elContent.scrollTop + elContent.offsetHeight)) {
                     // Set bottom of scroll area to bottom of selected item
-                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                    elContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - elContent.offsetHeight;
                 }
                 // Bottom of selected item is above scroll area...
-                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < elContent.scrollTop) {
                     // Set top of selected item to top of scroll area
-                    oContent.scrollTop = oNewItem.offsetTop;
+                    elContent.scrollTop = oNewItem.offsetTop;
 
                 }
             }
             // User is keying up
             else {
                 // Top of selected item is above scroll area
-                if(oNewItem.offsetTop < oContent.scrollTop) {
+                if(oNewItem.offsetTop < elContent.scrollTop) {
                     // Set top of scroll area to top of selected item
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;
+                    this._elContent.scrollTop = oNewItem.offsetTop;
                 }
                 // Top of selected item is below scroll area
-                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {
+                else if(oNewItem.offsetTop > (elContent.scrollTop + elContent.offsetHeight)) {
                     // Set bottom of selected item to bottom of scroll area
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                    this._elContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - elContent.offsetHeight;
                 }
             }
         }
@@ -1896,7 +1941,7 @@ YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {
-    oSelf._oTextbox.focus();
+    oSelf._elTextbox.focus();
 };
 
 /**
@@ -1939,16 +1984,18 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {
             }
             break;
         case 13: // enter
-            if(oSelf._oCurItem) {
-                if(oSelf._nKeyCode != nKeyCode) {
-                    if(oSelf._bContainerOpen) {
-                        YAHOO.util.Event.stopEvent(v);
+            if(!YAHOO.env.ua.webkit) {
+                if(oSelf._oCurItem) {
+                    if(oSelf._nKeyCode != nKeyCode) {
+                        if(oSelf._bContainerOpen) {
+                            YAHOO.util.Event.stopEvent(v);
+                        }
                     }
+                    oSelf._selectItem(oSelf._oCurItem);
+                }
+                else {
+                    oSelf._toggleContainer(false);
                 }
-                oSelf._selectItem(oSelf._oCurItem);
-            }
-            else {
-                oSelf._toggleContainer(false);
             }
             break;
         case 27: // esc
@@ -1981,22 +2028,27 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {
     var nKeyCode = v.keyCode;
 
         //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)
-        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
-        if(isMac) {
+        if(YAHOO.env.ua.webkit) {
             switch (nKeyCode) {
             case 9: // tab
-                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
-                    YAHOO.util.Event.stopEvent(v);
+                if(oSelf._oCurItem) {
+                    if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
                 }
                 break;
             case 13: // enter
-                if(oSelf._nKeyCode != nKeyCode) {
-                    YAHOO.util.Event.stopEvent(v);
+                if(oSelf._oCurItem) {
+                    if(oSelf._nKeyCode != nKeyCode) {
+                        if(oSelf._bContainerOpen) {
+                            YAHOO.util.Event.stopEvent(v);
+                        }
+                    }
+                    oSelf._selectItem(oSelf._oCurItem);
+                }
+                else {
+                    oSelf._toggleContainer(false);
                 }
-                break;
-            case 38: // up
-            case 40: // down
-                YAHOO.util.Event.stopEvent(v);
                 break;
             default:
                 break;
@@ -2023,6 +2075,7 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
     oSelf._initProps();
 
     var nKeyCode = v.keyCode;
+
     oSelf._nKeyCode = nKeyCode;
     var sText = this.value; //string in textbox
 
@@ -2065,7 +2118,7 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
-    oSelf._oTextbox.setAttribute("autocomplete","off");
+    oSelf._elTextbox.setAttribute("autocomplete","off");
     oSelf._bFocused = true;
     if(!oSelf._bItemSelected) {
         oSelf.textboxFocusEvent.fire(oSelf);
@@ -2084,20 +2137,27 @@ YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
 YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
     // Don't treat as a blur if it was a selection via mouse click
     if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {
-        // Current query needs to be validated
+        // Current query needs to be validated as a selection
         if(!oSelf._bItemSelected) {
             var oMatch = oSelf._textMatchesOption();
+            // Container is closed or current query doesn't match any result
             if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (oMatch === null))) {
+                // Force selection is enabled so clear the current query
                 if(oSelf.forceSelection) {
                     oSelf._clearSelection();
                 }
+                // Treat current query as a valid selection
                 else {
-                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf);
                     YAHOO.log("Unmatched item selected", "info", oSelf.toString());
                 }
             }
+            // Container is open and current query matches a result
             else {
-                oSelf._selectItem(oMatch);
+                // Force a selection when textbox is blurred with a match
+                if(oSelf.forceSelection) {
+                    oSelf._selectItem(oMatch);
+                }
             }
         }
 
@@ -2112,19 +2172,16 @@ YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
 };
 
 /**
- * Handles form submission event.
+ * Handles window unload event.
  *
- * @method _onFormSubmit
- * @param v {HTMLEvent} The submit event.
+ * @method _onWindowUnload
+ * @param v {HTMLEvent} The unload event.
  * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {
-    if(oSelf.allowBrowserAutocomplete) {
-        oSelf._oTextbox.setAttribute("autocomplete","on");
-    }
-    else {
-        oSelf._oTextbox.setAttribute("autocomplete","off");
+YAHOO.widget.AutoComplete.prototype._onWindowUnload = function(v,oSelf) {
+    if(oSelf && oSelf._elTextbox && oSelf.allowBrowserAutocomplete) {
+        oSelf._elTextbox.setAttribute("autocomplete","on");
     }
 };
 
@@ -2478,6 +2535,7 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
     var aCache = this._aCache;
     var nCacheLength = (aCache) ? aCache.length : 0;
     var bMatchContains = this.queryMatchContains;
+    var sOrigQuery;
     
     // If cache is enabled...
     if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
@@ -2485,7 +2543,7 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
         YAHOO.log("Querying cache: \"" + sQuery + "\"", "info", this.toString());
         // If case is unimportant, normalize query now instead of in loops
         if(!this.queryMatchCase) {
-            var sOrigQuery = sQuery;
+            sOrigQuery = sQuery;
             sQuery = sQuery.toLowerCase();
         }
 
@@ -2660,8 +2718,7 @@ YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";
 /////////////////////////////////////////////////////////////////////////////
 
 /**
- * Alias to YUI Connection Manager. Allows implementers to specify their own
- * subclasses of the YUI Connection Manager utility.
+ * Alias to YUI Connection Manager, to allow implementers to customize the utility.
  *
  * @property connMgr
  * @type Object
@@ -2853,9 +2910,27 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     switch (this.responseType) {
         case YAHOO.widget.DS_XHR.TYPE_JSON:
             var jsonList, jsonObjParsed;
-            // Check for JSON lib but divert KHTML clients
-            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
-            if(oResponse.parseJSON && isNotMac) {
+            // Check for YUI JSON
+            if(YAHOO.lang.JSON) {
+                // Use the JSON utility if available
+                jsonObjParsed = YAHOO.lang.JSON.parse(oResponse);
+                if(!jsonObjParsed) {
+                    bError = true;
+                    break;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            // Check for JSON lib
+            else if(oResponse.parseJSON) {
                 // Use the new JSON utility if available
                 jsonObjParsed = oResponse.parseJSON();
                 if(!jsonObjParsed) {
@@ -2872,8 +2947,8 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                    }
                 }
             }
-            else if(window.JSON && isNotMac) {
-                // Use older JSON lib if available
+            // Use older JSON lib if available
+            else if(window.JSON) {
                 jsonObjParsed = JSON.parse(oResponse);
                 if(!jsonObjParsed) {
                     bError = true;
@@ -2935,7 +3010,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
             if(!YAHOO.lang.isArray(jsonList)) {
                 jsonList = [jsonList];
             }
-            
+
             // Loop through the array of all responses...
             for(var i = jsonList.length-1; i >= 0 ; i--) {
                 var aResultItem = [];
@@ -3042,6 +3117,293 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
 YAHOO.widget.DS_XHR.prototype._oConn = null;
 
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using the Get Utility to generate
+ * dynamic SCRIPT nodes for data retrieval.
+ *
+ * @class DS_ScriptNode
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param sUri {String} URI to the script location that will return data.
+ * @param aSchema {String[]} Data schema definition of results.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_ScriptNode = function(sUri, aSchema, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aSchema) || !YAHOO.lang.isString(sUri)) {
+        YAHOO.log("Could not instantiate Script Node DataSource due to invalid arguments", "error", this.toString());
+        return;
+    }
+
+    this.schema = aSchema;
+    this.scriptURI = sUri;
+
+    this._init();
+    YAHOO.log("Script Node DataSource initialized","info",this.toString());
+};
+
+YAHOO.widget.DS_ScriptNode.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Alias to YUI Get Utility. Allows implementers to specify their own
+ * subclasses of the YUI Get Utility.
+ *
+ * @property getUtility
+ * @type Object
+ * @default YAHOO.util.Get
+ */
+YAHOO.widget.DS_ScriptNode.prototype.getUtility = YAHOO.util.Get;
+
+/**
+ * URI to the script that returns data.
+ *
+ * @property scriptURI
+ * @type String
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptURI = null;
+
+/**
+ * Query string parameter name sent to scriptURI. For instance, requests will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=queryString
+ *
+ * @property scriptQueryParam
+ * @type String
+ * @default "query"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptQueryParam = "query";
+
+/**
+ * Defines request/response management in the following manner:
+ * <dl>
+ *     <!--<dt>queueRequests</dt>
+ *     <dd>If a request is already in progress, wait until response is returned before sending the next request.</dd>
+ *     <dt>cancelStaleRequests</dt>
+ *     <dd>If a request is already in progress, cancel it before sending the next request.</dd>-->
+ *     <dt>ignoreStaleResponses</dt>
+ *     <dd>Send all requests, but handle only the response for the most recently sent request.</dd>
+ *     <dt>allowAll</dt>
+ *     <dd>Send all requests and handle all responses.</dd>
+ * </dl>
+ *
+ * @property asyncMode
+ * @type String
+ * @default "allowAll"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.asyncMode = "allowAll";
+
+/**
+ * Callback string parameter name sent to scriptURI. For instance, requests will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptCallbackParam&#62;=callbackFunction
+ *
+ * @property scriptCallbackParam
+ * @type String
+ * @default "callback"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptCallbackParam = "callback";
+
+/**
+ * Global array of callback functions, one for each request sent.
+ *
+ * @property callbacks
+ * @type Function[]
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode.callbacks = [];
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Unique ID to track requests.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode._nId = 0;
+
+/**
+ * Counter for pending requests. When this is 0, it is safe to purge callbacks
+ * array.
+ *
+ * @property _nPending
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode._nPending = 0;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source. Results are passed back to a callback function.
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_ScriptNode.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var oSelf = this;
+    
+    // If there are no global pending requests, it is safe to purge global callback stack and global counter
+    if(YAHOO.widget.DS_ScriptNode._nPending === 0) {
+        YAHOO.widget.DS_ScriptNode.callbacks = [];
+        YAHOO.widget.DS_ScriptNode._nId = 0;
+    }
+    
+    // ID for this request
+    var id = YAHOO.widget.DS_ScriptNode._nId;
+    YAHOO.widget.DS_ScriptNode._nId++;
+
+    // Dynamically add handler function with a closure to the callback stack
+    YAHOO.widget.DS_ScriptNode.callbacks[id] = function(oResponse) {
+        if((oSelf.asyncMode !== "ignoreStaleResponses")||
+                (id === YAHOO.widget.DS_ScriptNode.callbacks.length-1)) { // Must ignore stale responses
+            oSelf.handleResponse(oResponse, oCallbackFn, sQuery, oParent);
+        }
+        else {
+            YAHOO.log("DataSource ignored stale response for " + sQuery, "info", oSelf.toString());
+        }
+
+        delete YAHOO.widget.DS_ScriptNode.callbacks[id];
+    };
+
+    // We are now creating a request
+    YAHOO.widget.DS_ScriptNode._nPending++;
+
+    var sUri = this.scriptURI+"&"+ this.scriptQueryParam+"="+sQuery+"&"+
+            this.scriptCallbackParam+"=YAHOO.widget.DS_ScriptNode.callbacks["+id+"]";
+    YAHOO.log("DataSource is querying URL " + sUri, "info", this.toString());
+    this.getUtility.script(sUri,
+            {autopurge:true,
+            onsuccess:YAHOO.widget.DS_ScriptNode._bumpPendingDown,
+            onfail:YAHOO.widget.DS_ScriptNode._bumpPendingDown});
+};
+
+/**
+ * Parses JSON response data into an array of result objects and passes it to
+ * the callback function.
+ *
+ * @method handleResponse
+ * @param oResponse {Object} The raw response data to parse.
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_ScriptNode.prototype.handleResponse = function(oResponse, oCallbackFn, sQuery, oParent) {
+    var aSchema = this.schema;
+    var aResults = [];
+    var bError = false;
+
+    var jsonList, jsonObjParsed;
+
+    // Parse the JSON response as a string
+    try {
+        // Grab the object member that contains an array of all reponses...
+        // ...eval is necessary here since aSchema[0] is of unknown depth
+        jsonList = eval("(oResponse." + aSchema[0]+")");
+    }
+    catch(e) {
+        bError = true;
+   }
+
+    if(!jsonList) {
+        bError = true;
+        jsonList = [];
+    }
+
+    else if(!YAHOO.lang.isArray(jsonList)) {
+        jsonList = [jsonList];
+    }
+
+    // Loop through the array of all responses...
+    for(var i = jsonList.length-1; i >= 0 ; i--) {
+        var aResultItem = [];
+        var jsonResult = jsonList[i];
+        // ...and loop through each data field value of each response
+        for(var j = aSchema.length-1; j >= 1 ; j--) {
+            // ...and capture data into an array mapped according to the schema...
+            var dataFieldValue = jsonResult[aSchema[j]];
+            if(!dataFieldValue) {
+                dataFieldValue = "";
+            }
+            //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());
+            aResultItem.unshift(dataFieldValue);
+        }
+        // If schema isn't well defined, pass along the entire result object
+        if(aResultItem.length == 1) {
+            aResultItem.push(jsonResult);
+        }
+        // Capture the array of data field values in an array of results
+        aResults.unshift(aResultItem);
+    }
+
+    if(bError) {
+        aResults = null;
+    }
+
+    if(aResults === null) {
+        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);
+        YAHOO.log(YAHOO.widget.DataSource.ERROR_DATAPARSE, "error", this.toString());
+        aResults = [];
+    }
+    else {
+        var resultObj = {};
+        resultObj.query = decodeURIComponent(sQuery);
+        resultObj.results = aResults;
+        this._addCacheElem(resultObj);
+        
+        this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+        YAHOO.log("Results returned for query \"" + sQuery + "\": " +
+                YAHOO.lang.dump(aResults), "info", this.toString());
+    }
+
+    oCallbackFn(sQuery, aResults, oParent);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Any success/failure response should decrement counter.
+ *
+ * @method _bumpPendingDown
+ * @private
+ */
+YAHOO.widget.DS_ScriptNode._bumpPendingDown = function() {
+    YAHOO.widget.DS_ScriptNode._nPending--;
+};
+
+
 /****************************************************************************/
 /****************************************************************************/
 /****************************************************************************/
@@ -3130,6 +3492,7 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
     return;
 };
 
+
 /****************************************************************************/
 /****************************************************************************/
 /****************************************************************************/
@@ -3250,4 +3613,4 @@ YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParen
     oCallbackFn(sQuery, aResults, oParent);
 };
 
-YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.3.0", build: "442"});
+YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.5.0", build: "895"});
index d877c981f5f8810cc71922d572c37f90ca743fc7..77eacceb940901ee7343a952ba294965b8746d05 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource instanceof YAHOO.widget.DataSource){this.dataSource=oDataSource;}
-else{return;}
-if(YAHOO.util.Dom.inDocument(elInput)){if(YAHOO.lang.isString(elInput)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}
-else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}
-YAHOO.util.Dom.addClass(this._oTextbox,"yui-ac-input");}
-else{return;}
-if(YAHOO.util.Dom.inDocument(elContainer)){if(YAHOO.lang.isString(elContainer)){this._oContainer=document.getElementById(elContainer);}
-else{this._oContainer=elContainer;}
-if(this._oContainer.style.display=="none"){}
-var elParent=this._oContainer.parentNode;var elTag=elParent.tagName.toLowerCase();while(elParent&&(elParent!="document")){if(elTag=="div"){YAHOO.util.Dom.addClass(elParent,"yui-ac");break;}
-else{elParent=elParent.parentNode;elTag=elParent.tagName.toLowerCase();}}
-if(elTag!="div"){}}
-else{return;}
-if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
-this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
-YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
-else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
-else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;this._oContainer._oContent._oHeader.style.display="block";}}
-else{this._oContainer._oContent._oHeader.innerHTML="";this._oContainer._oContent._oHeader.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;this._oContainer._oContent._oFooter.style.display="block";}}
-else{this._oContainer._oContent._oFooter.innerHTML="";this._oContainer._oContent._oFooter.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;this._oContainer._oContent._oBody.style.display="block";this._oContainer._oContent.style.display="block";}}
-else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}
-this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
-else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oTextbox,oContainer,sQuery,aResults){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(sQuery){return sQuery;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var instanceName=this.toString();var elInput=this._oTextbox;var elContainer=this._oContainer;this.textboxFocusEvent.unsubscribe();this.textboxKeyEvent.unsubscribe();this.dataRequestEvent.unsubscribe();this.dataReturnEvent.unsubscribe();this.dataErrorEvent.unsubscribe();this.containerExpandEvent.unsubscribe();this.typeAheadEvent.unsubscribe();this.itemMouseOverEvent.unsubscribe();this.itemMouseOutEvent.unsubscribe();this.itemArrowToEvent.unsubscribe();this.itemArrowFromEvent.unsubscribe();this.itemSelectEvent.unsubscribe();this.unmatchedItemSelectEvent.unsubscribe();this.selectionEnforceEvent.unsubscribe();this.containerCollapseEvent.unsubscribe();this.textboxBlurEvent.unsubscribe();YAHOO.util.Event.purgeElement(elInput,true);YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var key in this){if(this.hasOwnProperty(key)){this[key]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(!YAHOO.lang.isNumber(minQueryLength)){this.minQueryLength=1;}
-var maxResultsDisplayed=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(maxResultsDisplayed)||(maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
-var queryDelay=this.queryDelay;if(!YAHOO.lang.isNumber(queryDelay)||(queryDelay<0)){this.queryDelay=0.2;}
-var delimChar=this.delimChar;if(YAHOO.lang.isString(delimChar)){this.delimChar=[delimChar];}
-else if(!YAHOO.lang.isArray(delimChar)){this.delimChar=null;}
-var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(animSpeed)||(animSpeed<0)){this.animSpeed=0.3;}
-if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);}
-else{this._oAnim.duration=this.animSpeed;}}
-if(this.forceSelection&&delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
-if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";oIFrame.tabIndex=-1;this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){YAHOO.util.Dom.addClass(this._oContainer,"yui-ac-container");if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
-else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;oldi--){oldListItems[oldi]=null;}}
-this._oContainer._oContent._oBody.innerHTML="";}
-var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
-this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(oSelf){oSelf._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var currValue=this._oTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(oSelf){if(oSelf._queryInterval){clearInterval(oSelf._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
-return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}
-var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
-if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
-if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
-this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
-else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
-if((sQuery&&(sQuery.length<this.minQueryLength))||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
-this._toggleContainer(false);return;}
-sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;sQuery=this.doBeforeSendQuery(sQuery);this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
-if(!oSelf._bFocused||!aResults){return;}
-var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
-var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);oItemi.style.display="list-item";oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
-for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;oItemj.style.display="none";oItemj._sResultKey=null;oItemj._oResultData=null;}
-var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
-else{oSelf._oCurItem=null;}}
-else{oSelf._toggleContainer(false);}
-oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
-else{this._oTextbox.value="";}
-this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=null;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=oItem;break;}}
-return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}
-var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
-var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
-else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
-else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
-else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}
-if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
-else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var oContainer=this._oContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}
-if(!bShow){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
-if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
-this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}
-if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
-var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
-if(oAnim.isAnimated()){oAnim.stop();}
-var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.display="block";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){oContainer._oContent.style.width=wColl+"px";oContainer._oContent.style.height=hColl+"px";}
-else{oContainer._oContent.style.width=wExp+"px";oContainer._oContent.style.height=hExp+"px";}
-oContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf.containerExpandEvent.fire(oSelf);}
-else{oContainer._oContent.style.display="none";oSelf.containerCollapseEvent.fire(oSelf);}
-oSelf._toggleContainerHelpers(bShow);};oContainer._oContent.style.display="block";oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();this._bContainerOpen=bShow;}
-else{if(bShow){oContainer._oContent.style.display="block";this.containerExpandEvent.fire(this);}
-else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(this);}
-this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
-if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
-var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
-else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
-oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
-else{oTextbox.value=sResultKey;}
-if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
-var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._oCurItem){this._selectItem(this._oCurItem);}
-else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
-var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
-if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
-if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}
-else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}
-else{this._oTextbox.value=this._sCurQuery;}
-this._oCurItem=null;return;}
-if(nNewItemIndex==-2){this._toggleContainer(false);return;}
-var oNewItem=this._aListItems[nNewItemIndex];var oContent=this._oContainer._oContent;var scrollOn=((YAHOO.util.Dom.getStyle(oContent,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}
-else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
-else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
-else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
-this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
-else{oSelf._toggleHighlight(this,"to");}
-oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
-else{oSelf._toggleHighlight(this,"from");}
-oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf._oCurItem){if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
-oSelf._selectItem(oSelf._oCurItem);}
-else{oSelf._toggleContainer(false);}
-break;case 13:if(oSelf._oCurItem){if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
-oSelf._selectItem(oSelf._oCurItem);}
-else{oSelf._toggleContainer(false);}
-break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
-break;case 13:if(oSelf._nKeyCode!=nKeyCode){YAHOO.util.Event.stopEvent(v);}
-break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}
-else if(nKeyCode==229){oSelf._queryInterval=setInterval(function(){oSelf._onIMEDetected(oSelf);},500);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
-else{oSelf._bItemSelected=false;YAHOO.util.Dom.removeClass(oSelf._oCurItem,oSelf.highlightClassName);oSelf._oCurItem=null;oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
-if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
-oSelf._nDelayID=nDelayID;}
-else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;if(!oSelf._bItemSelected){oSelf.textboxFocusEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){var oMatch=oSelf._textMatchesOption();if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&(oMatch===null))){if(oSelf.forceSelection){oSelf._clearSelection();}
-else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}
-else{oSelf._selectItem(oMatch);}}
-if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}
-oSelf._cancelIntervalDetection(oSelf);oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
-else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
-if(this._aCacheHelper){this._aCacheHelper=[];}
-this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var maxCacheEntries=this.maxCacheEntries;if(!YAHOO.lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
-if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
-this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(oResult){var aCache=this._aCache;if(!aCache||!oResult||!oResult.query||!oResult.results){return;}
-if(aCache.length>=this.maxCacheEntries){aCache.shift();}
-aCache.push(oResult);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
-for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query).toLowerCase():encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
-break;}
-else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
-resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
-if(bMatchFound){break;}}}
-if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults);oCallbackFn(sOrigQuery,aResults,oParent);}}
-return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
-if(!YAHOO.lang.isArray(aSchema)||!YAHOO.lang.isString(sScriptURI)){return;}
-this.schema=aSchema;this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
-var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
-for(var foo in oResp){}
-if(!isXML){oResp=oResp.responseText;}
-else{oResp=oResp.responseXML;}
-if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
-var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}
-else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}
-oCallbackFn(sQuery,aResults,oParent);};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(YAHOO.lang.isNumber(this.connTimeout)&&(this.connTimeout>0)){oCallback.timeout=this.connTimeout;}
-if(this._oConn){this.connMgr.abort(this._oConn);}
-oSelf._oConn=this.connMgr.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
-switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList,jsonObjParsed;var isNotMac=(navigator.userAgent.toLowerCase().indexOf('khtml')==-1);if(oResponse.parseJSON&&isNotMac){jsonObjParsed=oResponse.parseJSON();if(!jsonObjParsed){bError=true;}
-else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
-catch(e){bError=true;break;}}}
-else if(window.JSON&&isNotMac){jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
-else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
-catch(e){bError=true;break;}}}
-else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
-if(oResponse.indexOf("{")<0){bError=true;break;}
-if(oResponse.indexOf("{}")===0){break;}
-var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
-jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
-catch(e){bError=true;break;}}
-if(!jsonList){bError=true;break;}
-if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}
-for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
-aResultItem.unshift(dataFieldValue);}
-if(aResultItem.length==1){aResultItem.push(jsonResult);}
-aResults.unshift(aResultItem);}
-break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
-for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
-else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
-else{sValue="";}}
-aFieldSet.unshift(sValue);}
-aResults.unshift(aFieldSet);}
-break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
-var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
-break;default:break;}
-sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
-else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
-if(!YAHOO.lang.isFunction(oFunction)){return;}
-else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
-var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
-if(!YAHOO.lang.isArray(aData)){return;}
-else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var i;var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
-for(i=aData.length-1;i>=0;i--){var aDataset=[];if(YAHOO.lang.isString(aData[i])){aDataset[0]=aData[i];}
-else if(YAHOO.lang.isArray(aData[i])){aDataset=aData[i];}
-if(YAHOO.lang.isString(aDataset[0])){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}}
-else{for(i=aData.length-1;i>=0;i--){if(YAHOO.lang.isString(aData[i])){aResults.unshift([aData[i]]);}
-else if(YAHOO.lang.isArray(aData[i])){aResults.unshift(aData[i]);}}}
-this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.widget.AutoComplete=function(G,B,J,C){if(G&&B&&J){if(J instanceof YAHOO.widget.DataSource){this.dataSource=J;}else{return ;}if(YAHOO.util.Dom.inDocument(G)){if(YAHOO.lang.isString(G)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+G;this._elTextbox=document.getElementById(G);}else{this._sName=(G.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+G.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=G;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return ;}if(YAHOO.util.Dom.inDocument(B)){if(YAHOO.lang.isString(B)){this._elContainer=document.getElementById(B);}else{this._elContainer=B;}if(this._elContainer.style.display=="none"){}var D=this._elContainer.parentNode;var A=D.tagName.toLowerCase();if(A=="div"){YAHOO.util.Dom.addClass(D,"yui-ac");}else{}}else{return ;}if(C&&(C.constructor==Object)){for(var I in C){if(I){this[I]=C[I];}}}this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var H=this;var F=this._elTextbox;var E=this._elContent;YAHOO.util.Event.addListener(F,"keyup",H._onTextboxKeyUp,H);YAHOO.util.Event.addListener(F,"keydown",H._onTextboxKeyDown,H);YAHOO.util.Event.addListener(F,"focus",H._onTextboxFocus,H);YAHOO.util.Event.addListener(F,"blur",H._onTextboxBlur,H);YAHOO.util.Event.addListener(E,"mouseover",H._onContainerMouseover,H);YAHOO.util.Event.addListener(E,"mouseout",H._onContainerMouseout,H);YAHOO.util.Event.addListener(E,"scroll",H._onContainerScroll,H);YAHOO.util.Event.addListener(E,"resize",H._onContainerResize,H);YAHOO.util.Event.addListener(F,"keypress",H._onTextboxKeyPress,H);YAHOO.util.Event.addListener(window,"unload",H._onWindowUnload,H);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);F.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(A){if(A._oResultData){return A._oResultData;}else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(B){if(this._elHeader){var A=this._elHeader;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(B){if(this._elFooter){var A=this._elFooter;if(B){A.innerHTML=B;A.style.display="block";}else{A.innerHTML="";A.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(A){if(this._elBody){var B=this._elBody;if(A){B.innerHTML=A;B.style.display="block";B.style.display="block";}else{B.innerHTML="";B.style.display="none";}this._maxResultsDisplayed=0;}};YAHOO.widget.AutoComplete.prototype.formatResult=function(B,C){var A=B[0];if(A){return A;}else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(D,A,C,B){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(A){this._sendQuery(A);};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(A){return A;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var B=this.toString();var A=this._elTextbox;var D=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(A,true);
+YAHOO.util.Event.purgeElement(D,true);D.innerHTML="";for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var B=this.minQueryLength;if(!YAHOO.lang.isNumber(B)){this.minQueryLength=1;}var D=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(D)||(D<1)){this.maxResultsDisplayed=10;}var E=this.queryDelay;if(!YAHOO.lang.isNumber(E)||(E<0)){this.queryDelay=0.2;}var A=this.delimChar;if(YAHOO.lang.isString(A)&&(A.length>0)){this.delimChar=[A];}else{if(!YAHOO.lang.isArray(A)){this.delimChar=null;}}var C=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(C)||(C<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&A){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._elShadow){var A=document.createElement("div");A.className="yui-ac-shadow";this._elShadow=this._elContainer.appendChild(A);}if(this.useIFrame&&!this._elIFrame){var B=document.createElement("iframe");B.src=this._iFrameSrc;B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width="100%";B.style.height="100%";B.tabIndex=-1;this._elIFrame=this._elContainer.appendChild(B);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var C=document.createElement("div");C.className="yui-ac-content";C.style.display="none";this._elContent=this._elContainer.appendChild(C);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._elHeader=this._elContent.appendChild(B);var D=document.createElement("div");D.className="yui-ac-bd";this._elBody=this._elContent.appendChild(D);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._elFooter=this._elContent.appendChild(A);}else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._elBody.hasChildNodes()){var B=this.getListItems();if(B){for(var A=B.length-1;A>=0;A--){B[A]=null;}}this._elBody.innerHTML="";}var E=document.createElement("ul");E=this._elBody.appendChild(E);for(var C=0;C<this.maxResultsDisplayed;C++){var D=document.createElement("li");D=E.appendChild(D);this._aListItems[C]=D;this._initListItem(D,C);}this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(C,B){var A=this;C.style.display="none";C._nItemIndex=B;C.mouseover=C.mouseout=C.onclick=null;YAHOO.util.Event.addListener(C,"mouseover",A._onItemMouseover,A);YAHOO.util.Event.addListener(C,"mouseout",A._onItemMouseout,A);YAHOO.util.Event.addListener(C,"click",A._onItemMouseclick,A);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(A){A._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var A=this._elTextbox.value;var B=this._sLastTextboxValue;if(A!=B){this._sLastTextboxValue=A;this._sendQuery(A);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(A){if(A._queryInterval){clearInterval(A._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(A){if((A==9)||(A==13)||(A==16)||(A==17)||(A>=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=40)||(A>=44&&A<=45)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){if(this.minQueryLength==-1){this._toggleContainer(false);return ;}var C=(this.delimChar)?this.delimChar:null;if(C){var E=-1;for(var B=C.length-1;B>=0;B--){var F=G.lastIndexOf(C[B]);if(F>E){E=F;
+}}if(C[B]==" "){for(var A=C.length-1;A>=0;A--){if(G[E-1]==C[A]){E--;break;}}}if(E>-1){var D=E+1;while(G.charAt(D)==" "){D+=1;}this._sSavedQuery=G.substring(0,D);G=G.substr(D);}else{if(G.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}}if((G&&(G.length<this.minQueryLength))||(!G&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}this._toggleContainer(false);return ;}G=encodeURIComponent(G);this._nDelayID=-1;G=this.doBeforeSendQuery(G);this.dataRequestEvent.fire(this,G);this.dataSource.getResults(this._populateList,G,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(K,L,I){if(L===null){I.dataErrorEvent.fire(I,K);}if(!I._bFocused||!L){return ;}var A=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var O=I._elContent.style;O.width=(!A)?null:"";O.height=(!A)?null:"";var H=decodeURIComponent(K);I._sCurQuery=H;I._bItemSelected=false;if(I._maxResultsDisplayed!=I.maxResultsDisplayed){I._initList();}var C=Math.min(L.length,I.maxResultsDisplayed);I._nDisplayedItems=C;if(C>0){I._initContainerHelpers();var D=I._aListItems;for(var G=C-1;G>=0;G--){var N=D[G];var B=L[G];N.innerHTML=I.formatResult(B,H);N.style.display="list-item";N._sResultKey=B[0];N._oResultData=B;}for(var F=D.length-1;F>=C;F--){var M=D[F];M.innerHTML=null;M.style.display="none";M._sResultKey=null;M._oResultData=null;}var J=I.doBeforeExpandContainer(I._elTextbox,I._elContainer,K,L);I._toggleContainer(J);if(I.autoHighlight){var E=D[0];I._toggleHighlight(E,"to");I.itemArrowToEvent.fire(I,E);I._typeAhead(E,K);}else{I._oCurItem=null;}}else{I._toggleContainer(false);}I.dataReturnEvent.fire(I,K,L);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._elTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._elTextbox.value=C.substring(0,A);}else{this._elTextbox.value="";}this._sSavedQuery=this._elTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var D=null;for(var A=this._nDisplayedItems-1;A>=0;A--){var C=this._aListItems[A];var B=C._sResultKey.toLowerCase();if(B==this._sCurQuery.toLowerCase()){D=C;break;}}return(D);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(D,G){if(!this.typeAhead||(this._nKeyCode==8)){return ;}var F=this._elTextbox;var E=this._elTextbox.value;if(!F.setSelectionRange&&!F.createTextRange){return ;}var B=E.length;this._updateValue(D);var C=F.value.length;this._selectText(F,B,C);var A=F.value.substr(B,C);this.typeAheadEvent.fire(this,G,A);};YAHOO.widget.AutoComplete.prototype._selectText=function(D,A,B){if(D.setSelectionRange){D.setSelectionRange(A,B);}else{if(D.createTextRange){var C=D.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-D.value.length);C.select();}else{D.select();}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(B){var D=false;var C=this._elContent.offsetWidth+"px";var A=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){D=true;if(B){this._elIFrame.style.width=C;this._elIFrame.style.height=A;}else{this._elIFrame.style.width=0;this._elIFrame.style.height=0;}}if(this.useShadow&&this._elShadow){D=true;if(B){this._elShadow.style.width=C;this._elShadow.style.height=A;}else{this._elShadow.style.width=0;this._elShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(K){var E=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return ;}if(!K){this._elContent.scrollTop=0;var C=this._aListItems;if(C&&(C.length>0)){for(var H=C.length-1;H>=0;H--){C[H].style.display="none";}}if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}if(!K&&!this._bContainerOpen){this._elContent.style.display="none";return ;}var B=this._oAnim;if(B&&B.getEl()&&(this.animHoriz||this.animVert)){if(!K){this._toggleContainerHelpers(K);}if(B.isAnimated()){B.stop();}var I=this._elContent.cloneNode(true);E.appendChild(I);I.style.top="-9000px";I.style.display="block";var G=I.offsetWidth;var D=I.offsetHeight;var A=(this.animHoriz)?0:G;var F=(this.animVert)?0:D;B.attributes=(K)?{width:{to:G},height:{to:D}}:{width:{to:A},height:{to:F}};if(K&&!this._bContainerOpen){this._elContent.style.width=A+"px";this._elContent.style.height=F+"px";}else{this._elContent.style.width=G+"px";this._elContent.style.height=D+"px";}E.removeChild(I);I=null;var J=this;var L=function(){B.onComplete.unsubscribeAll();if(K){J.containerExpandEvent.fire(J);}else{J._elContent.style.display="none";J.containerCollapseEvent.fire(J);}J._toggleContainerHelpers(K);};this._elContent.style.display="block";B.onComplete.subscribe(L);B.animate();this._bContainerOpen=K;}else{if(K){this._elContent.style.display="block";this.containerExpandEvent.fire(this);}else{this._elContent.style.display="none";this.containerCollapseEvent.fire(this);}this._toggleContainerHelpers(K);this._bContainerOpen=K;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){var B=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,B);}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._oCurItem=A;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(A,C){if(A==this._oCurItem){return ;}var B=this.prehighlightClassName;if((C=="mouseover")&&B){YAHOO.util.Dom.addClass(A,B);}else{YAHOO.util.Dom.removeClass(A,B);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(E){var F=this._elTextbox;var D=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var B=this._sSavedQuery;var C=E._sResultKey;F.focus();F.value="";if(D){if(B){F.value=B;}F.value+=C+D;if(D!=" "){F.value+=" ";}}else{F.value=C;}if(F.type=="textarea"){F.scrollTop=F.scrollHeight;}var A=F.value.length;this._selectText(F,A,A);this._oCurItem=E;};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,A,A._oResultData);
+this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._oCurItem){this._selectItem(this._oCurItem);}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var E=this._oCurItem;var F=-1;if(E){F=E._nItemIndex;}var D=(G==40)?(F+1):(F-1);if(D<-2||D>=this._nDisplayedItems){return ;}if(E){this._toggleHighlight(E,"from");this.itemArrowFromEvent.fire(this,E);}if(D==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._elTextbox.value=this._sSavedQuery;}else{this._elTextbox.value=this._sSavedQuery+this._sCurQuery;}}else{this._elTextbox.value=this._sCurQuery;}this._oCurItem=null;return ;}if(D==-2){this._toggleContainer(false);return ;}var C=this._aListItems[D];var A=this._elContent;var B=((YAHOO.util.Dom.getStyle(A,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(A,"overflowY")=="auto"));if(B&&(D>-1)&&(D<this._nDisplayedItems)){if(G==40){if((C.offsetTop+C.offsetHeight)>(A.scrollTop+A.offsetHeight)){A.scrollTop=(C.offsetTop+C.offsetHeight)-A.offsetHeight;}else{if((C.offsetTop+C.offsetHeight)<A.scrollTop){A.scrollTop=C.offsetTop;}}}else{if(C.offsetTop<A.scrollTop){this._elContent.scrollTop=C.offsetTop;}else{if(C.offsetTop>(A.scrollTop+A.offsetHeight)){this._elContent.scrollTop=(C.offsetTop+C.offsetHeight)-A.offsetHeight;}}}}this._toggleHighlight(C,"to");this.itemArrowToEvent.fire(this,C);if(this.typeAhead){this._updateValue(C);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseover");}else{B._toggleHighlight(this,"to");}B.itemMouseOverEvent.fire(B,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseout");}else{B._toggleHighlight(this,"from");}B.itemMouseOutEvent.fire(B,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(A,B){B._toggleHighlight(this,"to");B._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,B){B._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,B){B._bOverContainer=false;if(B._oCurItem){B._toggleHighlight(B._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._elTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;switch(C){case 9:if(B._oCurItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._oCurItem);}else{B._toggleContainer(false);}break;case 13:if(!YAHOO.env.ua.webkit){if(B._oCurItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._oCurItem);}else{B._toggleContainer(false);}}break;case 27:B._toggleContainer(false);return ;case 39:B._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;case 40:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;if(YAHOO.env.ua.webkit){switch(C){case 9:if(B._oCurItem){if(B.delimChar&&(B._nKeyCode!=C)){YAHOO.util.Event.stopEvent(A);}}break;case 13:if(B._oCurItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._oCurItem);}else{B._toggleContainer(false);}break;default:break;}}else{if(C==229){B._queryInterval=setInterval(function(){B._onIMEDetected(B);},500);}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(B,D){D._initProps();var E=B.keyCode;D._nKeyCode=E;var C=this.value;if(D._isIgnoreKey(E)||(C.toLowerCase()==D._sCurQuery)){return ;}else{D._bItemSelected=false;YAHOO.util.Dom.removeClass(D._oCurItem,D.highlightClassName);D._oCurItem=null;D.textboxKeyEvent.fire(D,E);}if(D.queryDelay>0){var A=setTimeout(function(){D._sendQuery(C);},(D.queryDelay*1000));if(D._nDelayID!=-1){clearTimeout(D._nDelayID);}D._nDelayID=A;}else{D._sendQuery(C);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){B._elTextbox.setAttribute("autocomplete","off");B._bFocused=true;if(!B._bItemSelected){B.textboxFocusEvent.fire(B);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,B){if(!B._bOverContainer||(B._nKeyCode==9)){if(!B._bItemSelected){var C=B._textMatchesOption();if(!B._bContainerOpen||(B._bContainerOpen&&(C===null))){if(B.forceSelection){B._clearSelection();}else{B.unmatchedItemSelectEvent.fire(B);}}else{if(B.forceSelection){B._selectItem(C);}}}if(B._bContainerOpen){B._toggleContainer(false);}B._cancelIntervalDetection(B);B._bFocused=false;B.textboxBlurEvent.fire(B);}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(A,B){if(B&&B._elTextbox&&B.allowBrowserAutocomplete){B._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(A,D,B){var C=this._doQueryCache(A,D,B);if(C.length===0){this.queryEvent.fire(this,B,D);this.doQuery(A,D,B);}};YAHOO.widget.DataSource.prototype.doQuery=function(A,C,B){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}if(this._aCacheHelper){this._aCacheHelper=[];}this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;
+YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var A=this.maxCacheEntries;if(!YAHOO.lang.isNumber(A)||(A<0)){A=0;}if(A>0&&!this._aCache){this._aCache=[];}this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(B){var A=this._aCache;if(!A||!B||!B.query||!B.results){return ;}if(A.length>=this.maxCacheEntries){A.shift();}A.push(B);};YAHOO.widget.DataSource.prototype._doQueryCache=function(A,I,N){var H=[];var G=false;var J=this._aCache;var F=(J)?J.length:0;var K=this.queryMatchContains;var D;if((this.maxCacheEntries>0)&&J&&(F>0)){this.cacheQueryEvent.fire(this,N,I);if(!this.queryMatchCase){D=I;I=I.toLowerCase();}for(var P=F-1;P>=0;P--){var E=J[P];var B=E.results;var C=(!this.queryMatchCase)?encodeURIComponent(E.query).toLowerCase():encodeURIComponent(E.query);if(C==I){G=true;H=B;if(P!=F-1){J.splice(P,1);this._addCacheElem(E);}break;}else{if(this.queryMatchSubset){for(var O=I.length-1;O>=0;O--){var R=I.substr(0,O);if(C==R){G=true;for(var M=B.length-1;M>=0;M--){var Q=B[M];var L=(this.queryMatchCase)?encodeURIComponent(Q[0]).indexOf(I):encodeURIComponent(Q[0]).toLowerCase().indexOf(I);if((!K&&(L===0))||(K&&(L>-1))){H.unshift(Q);}}E={};E.query=I;E.results=H;this._addCacheElem(E);break;}}if(G){break;}}}}if(G){this.getCachedResultsEvent.fire(this,N,D,H);A(D,H,N);}}return H;};YAHOO.widget.DS_XHR=function(C,A,D){if(D&&(D.constructor==Object)){for(var B in D){this[B]=D[B];}}if(!YAHOO.lang.isArray(A)||!YAHOO.lang.isString(C)){return ;}this.schema=A;this.scriptURI=C;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(E,G,B){var J=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var D=this.scriptURI+"?"+this.scriptQueryParam+"="+G;if(this.scriptQueryAppend.length>0){D+="&"+this.scriptQueryAppend;}var C=null;var F=this;var I=function(K){if(!F._oConn||(K.tId!=F._oConn.tId)){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATANULL);return ;}for(var N in K){}if(!J){K=K.responseText;}else{K=K.responseXML;}if(K===null){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATANULL);return ;}var M=F.parseResponse(G,K,B);var L={};L.query=decodeURIComponent(G);L.results=M;if(M===null){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATAPARSE);M=[];}else{F.getResultsEvent.fire(F,B,G,M);F._addCacheElem(L);}E(G,M,B);};var A=function(K){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return ;};var H={success:I,failure:A};if(YAHOO.lang.isNumber(this.connTimeout)&&(this.connTimeout>0)){H.timeout=this.connTimeout;}if(this._oConn){this.connMgr.abort(this._oConn);}F._oConn=this.connMgr.asyncRequest("GET",D,H,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList,jsonObjParsed;if(YAHOO.lang.JSON){jsonObjParsed=YAHOO.lang.JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}catch(e){bError=true;break;}}}else{if(oResponse.parseJSON){jsonObjParsed=oResponse.parseJSON();if(!jsonObjParsed){bError=true;}else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}catch(e){bError=true;break;}}}else{if(window.JSON){jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}catch(e){bError=true;break;}}}else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}if(oResponse.indexOf("{")<0){bError=true;break;}if(oResponse.indexOf("{}")===0){break;}var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}catch(e){bError=true;break;}}}}if(!jsonList){bError=true;break;}if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}aResultItem.unshift(dataFieldValue);}if(aResultItem.length==1){aResultItem.push(jsonResult);}aResults.unshift(aResultItem);}break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;
+}else{sValue="";}}aFieldSet.unshift(sValue);}aResults.unshift(aFieldSet);}break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}break;default:break;}sQuery=null;oResponse=null;oParent=null;if(bError){return null;}else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_ScriptNode=function(D,A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B];}}if(!YAHOO.lang.isArray(A)||!YAHOO.lang.isString(D)){return ;}this.schema=A;this.scriptURI=D;this._init();};YAHOO.widget.DS_ScriptNode.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_ScriptNode.prototype.getUtility=YAHOO.util.Get;YAHOO.widget.DS_ScriptNode.prototype.scriptURI=null;YAHOO.widget.DS_ScriptNode.prototype.scriptQueryParam="query";YAHOO.widget.DS_ScriptNode.prototype.asyncMode="allowAll";YAHOO.widget.DS_ScriptNode.prototype.scriptCallbackParam="callback";YAHOO.widget.DS_ScriptNode.callbacks=[];YAHOO.widget.DS_ScriptNode._nId=0;YAHOO.widget.DS_ScriptNode._nPending=0;YAHOO.widget.DS_ScriptNode.prototype.doQuery=function(A,F,C){var B=this;if(YAHOO.widget.DS_ScriptNode._nPending===0){YAHOO.widget.DS_ScriptNode.callbacks=[];YAHOO.widget.DS_ScriptNode._nId=0;}var E=YAHOO.widget.DS_ScriptNode._nId;YAHOO.widget.DS_ScriptNode._nId++;YAHOO.widget.DS_ScriptNode.callbacks[E]=function(G){if((B.asyncMode!=="ignoreStaleResponses")||(E===YAHOO.widget.DS_ScriptNode.callbacks.length-1)){B.handleResponse(G,A,F,C);}else{}delete YAHOO.widget.DS_ScriptNode.callbacks[E];};YAHOO.widget.DS_ScriptNode._nPending++;var D=this.scriptURI+"&"+this.scriptQueryParam+"="+F+"&"+this.scriptCallbackParam+"=YAHOO.widget.DS_ScriptNode.callbacks["+E+"]";this.getUtility.script(D,{autopurge:true,onsuccess:YAHOO.widget.DS_ScriptNode._bumpPendingDown,onfail:YAHOO.widget.DS_ScriptNode._bumpPendingDown});};YAHOO.widget.DS_ScriptNode.prototype.handleResponse=function(oResponse,oCallbackFn,sQuery,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var jsonList,jsonObjParsed;try{jsonList=eval("(oResponse."+aSchema[0]+")");}catch(e){bError=true;}if(!jsonList){bError=true;jsonList=[];}else{if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}}for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}aResultItem.unshift(dataFieldValue);}if(aResultItem.length==1){aResultItem.push(jsonResult);}aResults.unshift(aResultItem);}if(bError){aResults=null;}if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}else{var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);}oCallbackFn(sQuery,aResults,oParent);};YAHOO.widget.DS_ScriptNode._bumpPendingDown=function(){YAHOO.widget.DS_ScriptNode._nPending--;};YAHOO.widget.DS_JSFunction=function(A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B];}}if(!YAHOO.lang.isFunction(A)){return ;}else{this.dataFunction=A;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(C,F,D){var B=this.dataFunction;var E=[];E=B(F);if(E===null){this.dataErrorEvent.fire(this,D,F,YAHOO.widget.DataSource.ERROR_DATANULL);return ;}var A={};A.query=decodeURIComponent(F);A.results=E;this._addCacheElem(A);this.getResultsEvent.fire(this,D,F,E);C(F,E,D);return ;};YAHOO.widget.DS_JSArray=function(A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B];}}if(!YAHOO.lang.isArray(A)){return ;}else{this.data=A;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(E,I,A){var F;var C=this.data;var J=[];var D=false;var B=this.queryMatchContains;if(I){if(!this.queryMatchCase){I=I.toLowerCase();}for(F=C.length-1;F>=0;F--){var H=[];if(YAHOO.lang.isString(C[F])){H[0]=C[F];}else{if(YAHOO.lang.isArray(C[F])){H=C[F];}}if(YAHOO.lang.isString(H[0])){var G=(this.queryMatchCase)?encodeURIComponent(H[0]).indexOf(I):encodeURIComponent(H[0]).toLowerCase().indexOf(I);if((!B&&(G===0))||(B&&(G>-1))){J.unshift(H);}}}}else{for(F=C.length-1;F>=0;F--){if(YAHOO.lang.isString(C[F])){J.unshift([C[F]]);}else{if(YAHOO.lang.isArray(C[F])){J.unshift(C[F]);}}}}this.getResultsEvent.fire(this,A,I,J);E(I,J,A);};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 72a6772b599b9f52c483b181a7cc70d40f919b97..d435e873c43aaabd5b883eac733d1504cd1b05fa 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
  /**
  * The AutoComplete control provides the front-end logic for text-entry suggestion and
@@ -10,7 +10,7 @@ version: 2.3.0
  *
  * @module autocomplete
  * @requires yahoo, dom, event, datasource
- * @optional animation, connection
+ * @optional animation, connection, get
  * @namespace YAHOO.widget
  * @title AutoComplete Widget
  */
@@ -53,15 +53,15 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         if(YAHOO.util.Dom.inDocument(elInput)) {
             if(YAHOO.lang.isString(elInput)) {
                     this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;
-                    this._oTextbox = document.getElementById(elInput);
+                    this._elTextbox = document.getElementById(elInput);
             }
             else {
                 this._sName = (elInput.id) ?
                     "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:
                     "instance" + YAHOO.widget.AutoComplete._nIndex;
-                this._oTextbox = elInput;
+                this._elTextbox = elInput;
             }
-            YAHOO.util.Dom.addClass(this._oTextbox, "yui-ac-input");
+            YAHOO.util.Dom.addClass(this._elTextbox, "yui-ac-input");
         }
         else {
             return;
@@ -70,28 +70,21 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         // Validate container element
         if(YAHOO.util.Dom.inDocument(elContainer)) {
             if(YAHOO.lang.isString(elContainer)) {
-                    this._oContainer = document.getElementById(elContainer);
+                    this._elContainer = document.getElementById(elContainer);
             }
             else {
-                this._oContainer = elContainer;
+                this._elContainer = elContainer;
             }
-            if(this._oContainer.style.display == "none") {
+            if(this._elContainer.style.display == "none") {
             }
             
             // For skinning
-            var elParent = this._oContainer.parentNode;
+            var elParent = this._elContainer.parentNode;
             var elTag = elParent.tagName.toLowerCase();
-            while(elParent && (elParent != "document")) {
-                if(elTag == "div") {
-                    YAHOO.util.Dom.addClass(elParent, "yui-ac");
-                    break;
-                }
-                else {
-                    elParent = elParent.parentNode;
-                    elTag = elParent.tagName.toLowerCase();
-                }
+            if(elTag == "div") {
+                YAHOO.util.Dom.addClass(elParent, "yui-ac");
             }
-            if(elTag != "div") {
+            else {
             }
         }
         else {
@@ -115,23 +108,21 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
 
         // Set up events
         var oSelf = this;
-        var oTextbox = this._oTextbox;
+        var elTextbox = this._elTextbox;
         // Events are actually for the content module within the container
-        var oContent = this._oContainer._oContent;
+        var elContent = this._elContent;
 
         // Dom events
-        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);
-        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);
-        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);
-        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);
-        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);
-        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);
-        if(oTextbox.form) {
-            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);
-        }
-        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"focus",oSelf._onTextboxFocus,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"blur",oSelf._onTextboxBlur,oSelf);
+        YAHOO.util.Event.addListener(elContent,"mouseover",oSelf._onContainerMouseover,oSelf);
+        YAHOO.util.Event.addListener(elContent,"mouseout",oSelf._onContainerMouseout,oSelf);
+        YAHOO.util.Event.addListener(elContent,"scroll",oSelf._onContainerScroll,oSelf);
+        YAHOO.util.Event.addListener(elContent,"resize",oSelf._onContainerResize,oSelf);
+        YAHOO.util.Event.addListener(elTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+        YAHOO.util.Event.addListener(window,"unload",oSelf._onWindowUnload,oSelf);
 
         // Custom events
         this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);
@@ -152,7 +143,7 @@ YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
         this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);
         
         // Finish up
-        oTextbox.setAttribute("autocomplete","off");
+        elTextbox.setAttribute("autocomplete","off");
         YAHOO.widget.AutoComplete._nIndex++;
     }
     // Required arguments were not found
@@ -408,15 +399,16 @@ YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {
  * @param sHeader {String} HTML markup for results container header.
  */
 YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
-    if(sHeader) {
-        if(this._oContainer._oContent._oHeader) {
-            this._oContainer._oContent._oHeader.innerHTML = sHeader;
-            this._oContainer._oContent._oHeader.style.display = "block";
+    if(this._elHeader) {
+        var elHeader = this._elHeader;
+        if(sHeader) {
+            elHeader.innerHTML = sHeader;
+            elHeader.style.display = "block";
+        }
+        else {
+            elHeader.innerHTML = "";
+            elHeader.style.display = "none";
         }
-    }
-    else {
-        this._oContainer._oContent._oHeader.innerHTML = "";
-        this._oContainer._oContent._oHeader.style.display = "none";
     }
 };
 
@@ -428,15 +420,16 @@ YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
  * @param sFooter {String} HTML markup for results container footer.
  */
 YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
-    if(sFooter) {
-        if(this._oContainer._oContent._oFooter) {
-            this._oContainer._oContent._oFooter.innerHTML = sFooter;
-            this._oContainer._oContent._oFooter.style.display = "block";
+    if(this._elFooter) {
+        var elFooter = this._elFooter;
+        if(sFooter) {
+                elFooter.innerHTML = sFooter;
+                elFooter.style.display = "block";
+        }
+        else {
+            elFooter.innerHTML = "";
+            elFooter.style.display = "none";
         }
-    }
-    else {
-        this._oContainer._oContent._oFooter.innerHTML = "";
-        this._oContainer._oContent._oFooter.style.display = "none";
     }
 };
 
@@ -448,18 +441,19 @@ YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
  * @param sBody {String} HTML markup for results container body.
  */
 YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {
-    if(sBody) {
-        if(this._oContainer._oContent._oBody) {
-            this._oContainer._oContent._oBody.innerHTML = sBody;
-            this._oContainer._oContent._oBody.style.display = "block";
-            this._oContainer._oContent.style.display = "block";
+    if(this._elBody) {
+        var elBody = this._elBody;
+        if(sBody) {
+                elBody.innerHTML = sBody;
+                elBody.style.display = "block";
+                elBody.style.display = "block";
         }
+        else {
+            elBody.innerHTML = "";
+            elBody.style.display = "none";
+        }
+        this._maxResultsDisplayed = 0;
     }
-    else {
-        this._oContainer._oContent._oBody.innerHTML = "";
-        this._oContainer._oContent.style.display = "none";
-    }
-    this._maxResultsDisplayed = 0;
 };
 
 /**
@@ -488,13 +482,13 @@ YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery)
  * and DOM elements.
  *
  * @method doBeforeExpandContainer
- * @param oTextbox {HTMLElement} The text input box.
- * @param oContainer {HTMLElement} The container element.
+ * @param elTextbox {HTMLElement} The text input box.
+ * @param elContainer {HTMLElement} The container element.
  * @param sQuery {String} The query string.
  * @param aResults {Object[]}  An array of query results.
  * @return {Boolean} Return true to continue expanding container, false to cancel the expand.
  */
-YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(elTextbox, elContainer, sQuery, aResults) {
     return true;
 };
 
@@ -529,26 +523,26 @@ YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) {
  */
 YAHOO.widget.AutoComplete.prototype.destroy = function() {
     var instanceName = this.toString();
-    var elInput = this._oTextbox;
-    var elContainer = this._oContainer;
+    var elInput = this._elTextbox;
+    var elContainer = this._elContainer;
 
     // Unhook custom events
-    this.textboxFocusEvent.unsubscribe();
-    this.textboxKeyEvent.unsubscribe();
-    this.dataRequestEvent.unsubscribe();
-    this.dataReturnEvent.unsubscribe();
-    this.dataErrorEvent.unsubscribe();
-    this.containerExpandEvent.unsubscribe();
-    this.typeAheadEvent.unsubscribe();
-    this.itemMouseOverEvent.unsubscribe();
-    this.itemMouseOutEvent.unsubscribe();
-    this.itemArrowToEvent.unsubscribe();
-    this.itemArrowFromEvent.unsubscribe();
-    this.itemSelectEvent.unsubscribe();
-    this.unmatchedItemSelectEvent.unsubscribe();
-    this.selectionEnforceEvent.unsubscribe();
-    this.containerCollapseEvent.unsubscribe();
-    this.textboxBlurEvent.unsubscribe();
+    this.textboxFocusEvent.unsubscribeAll();
+    this.textboxKeyEvent.unsubscribeAll();
+    this.dataRequestEvent.unsubscribeAll();
+    this.dataReturnEvent.unsubscribeAll();
+    this.dataErrorEvent.unsubscribeAll();
+    this.containerExpandEvent.unsubscribeAll();
+    this.typeAheadEvent.unsubscribeAll();
+    this.itemMouseOverEvent.unsubscribeAll();
+    this.itemMouseOutEvent.unsubscribeAll();
+    this.itemArrowToEvent.unsubscribeAll();
+    this.itemArrowFromEvent.unsubscribeAll();
+    this.itemSelectEvent.unsubscribeAll();
+    this.unmatchedItemSelectEvent.unsubscribeAll();
+    this.selectionEnforceEvent.unsubscribeAll();
+    this.containerCollapseEvent.unsubscribeAll();
+    this.textboxBlurEvent.unsubscribeAll();
 
     // Unhook DOM events
     YAHOO.util.Event.purgeElement(elInput, true);
@@ -559,7 +553,7 @@ YAHOO.widget.AutoComplete.prototype.destroy = function() {
 
     // Null out objects
     for(var key in this) {
-        if(this.hasOwnProperty(key)) {
+        if(YAHOO.lang.hasOwnProperty(this, key)) {
             this[key] = null;
         }
     }
@@ -687,12 +681,9 @@ YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;
 
 /**
  * Fired when a user selection does not match any of the displayed result items.
- * Note that this event may not behave as expected when delimiter characters
- * have been defined. 
  *
  * @event unmatchedItemSelectEvent
  * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
- * @param sQuery {String} The user-typed query string.
  */
 YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;
 
@@ -749,11 +740,74 @@ YAHOO.widget.AutoComplete.prototype._sName = null;
 /**
  * Text input field DOM element.
  *
- * @property _oTextbox
+ * @property _elTextbox
  * @type HTMLElement
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._oTextbox = null;
+YAHOO.widget.AutoComplete.prototype._elTextbox = null;
+
+/**
+ * Container DOM element.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elContainer = null;
+
+/**
+ * Reference to content element within container element.
+ *
+ * @property _elContent
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elContent = null;
+
+/**
+ * Reference to header element within content element.
+ *
+ * @property _elHeader
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elHeader = null;
+
+/**
+ * Reference to body element within content element.
+ *
+ * @property _elBody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elBody = null;
+
+/**
+ * Reference to footer element within content element.
+ *
+ * @property _elFooter
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elFooter = null;
+
+/**
+ * Reference to shadow element within container element.
+ *
+ * @property _elShadow
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elShadow = null;
+
+/**
+ * Reference to iframe element within container element.
+ *
+ * @property _elIFrame
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._elIFrame = null;
 
 /**
  * Whether or not the input field is currently in focus. If query results come back
@@ -774,15 +828,6 @@ YAHOO.widget.AutoComplete.prototype._bFocused = true;
  */
 YAHOO.widget.AutoComplete.prototype._oAnim = null;
 
-/**
- * Container DOM element.
- *
- * @property _oContainer
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.AutoComplete.prototype._oContainer = null;
-
 /**
  * Whether or not the results container is currently open.
  *
@@ -944,7 +989,7 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
         this.queryDelay = 0.2;
     }
     var delimChar = this.delimChar;
-    if(YAHOO.lang.isString(delimChar)) {
+    if(YAHOO.lang.isString(delimChar) && (delimChar.length > 0)) {
         this.delimChar = [delimChar];
     }
     else if(!YAHOO.lang.isArray(delimChar)) {
@@ -956,7 +1001,7 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
             this.animSpeed = 0.3;
         }
         if(!this._oAnim ) {
-            this._oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);
+            this._oAnim = new YAHOO.util.Anim(this._elContent, {}, this.animSpeed);
         }
         else {
             this._oAnim.duration = this.animSpeed;
@@ -974,21 +1019,21 @@ YAHOO.widget.AutoComplete.prototype._initProps = function() {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
-    if(this.useShadow && !this._oContainer._oShadow) {
-        var oShadow = document.createElement("div");
-        oShadow.className = "yui-ac-shadow";
-        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);
-    }
-    if(this.useIFrame && !this._oContainer._oIFrame) {
-        var oIFrame = document.createElement("iframe");
-        oIFrame.src = this._iFrameSrc;
-        oIFrame.frameBorder = 0;
-        oIFrame.scrolling = "no";
-        oIFrame.style.position = "absolute";
-        oIFrame.style.width = "100%";
-        oIFrame.style.height = "100%";
-        oIFrame.tabIndex = -1;
-        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);
+    if(this.useShadow && !this._elShadow) {
+        var elShadow = document.createElement("div");
+        elShadow.className = "yui-ac-shadow";
+        this._elShadow = this._elContainer.appendChild(elShadow);
+    }
+    if(this.useIFrame && !this._elIFrame) {
+        var elIFrame = document.createElement("iframe");
+        elIFrame.src = this._iFrameSrc;
+        elIFrame.frameBorder = 0;
+        elIFrame.scrolling = "no";
+        elIFrame.style.position = "absolute";
+        elIFrame.style.width = "100%";
+        elIFrame.style.height = "100%";
+        elIFrame.tabIndex = -1;
+        this._elIFrame = this._elContainer.appendChild(elIFrame);
     }
 };
 
@@ -999,28 +1044,28 @@ YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._initContainer = function() {
-    YAHOO.util.Dom.addClass(this._oContainer, "yui-ac-container");
+    YAHOO.util.Dom.addClass(this._elContainer, "yui-ac-container");
     
-    if(!this._oContainer._oContent) {
-        // The oContent div helps size the iframe and shadow properly
-        var oContent = document.createElement("div");
-        oContent.className = "yui-ac-content";
-        oContent.style.display = "none";
-        this._oContainer._oContent = this._oContainer.appendChild(oContent);
-
-        var oHeader = document.createElement("div");
-        oHeader.className = "yui-ac-hd";
-        oHeader.style.display = "none";
-        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);
-
-        var oBody = document.createElement("div");
-        oBody.className = "yui-ac-bd";
-        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);
-
-        var oFooter = document.createElement("div");
-        oFooter.className = "yui-ac-ft";
-        oFooter.style.display = "none";
-        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);
+    if(!this._elContent) {
+        // The elContent div helps size the iframe and shadow properly
+        var elContent = document.createElement("div");
+        elContent.className = "yui-ac-content";
+        elContent.style.display = "none";
+        this._elContent = this._elContainer.appendChild(elContent);
+
+        var elHeader = document.createElement("div");
+        elHeader.className = "yui-ac-hd";
+        elHeader.style.display = "none";
+        this._elHeader = this._elContent.appendChild(elHeader);
+
+        var elBody = document.createElement("div");
+        elBody.className = "yui-ac-bd";
+        this._elBody = this._elContent.appendChild(elBody);
+
+        var elFooter = document.createElement("div");
+        elFooter.className = "yui-ac-ft";
+        elFooter.style.display = "none";
+        this._elFooter = this._elContent.appendChild(elFooter);
     }
     else {
     }
@@ -1036,18 +1081,18 @@ YAHOO.widget.AutoComplete.prototype._initContainer = function() {
  */
 YAHOO.widget.AutoComplete.prototype._initList = function() {
     this._aListItems = [];
-    while(this._oContainer._oContent._oBody.hasChildNodes()) {
+    while(this._elBody.hasChildNodes()) {
         var oldListItems = this.getListItems();
         if(oldListItems) {
             for(var oldi = oldListItems.length-1; oldi >= 0; oldi--) {
                 oldListItems[oldi] = null;
             }
         }
-        this._oContainer._oContent._oBody.innerHTML = "";
+        this._elBody.innerHTML = "";
     }
 
     var oList = document.createElement("ul");
-    oList = this._oContainer._oContent._oBody.appendChild(oList);
+    oList = this._elBody.appendChild(oList);
     for(var i=0; i<this.maxResultsDisplayed; i++) {
         var oItem = document.createElement("li");
         oItem = oList.appendChild(oItem);
@@ -1095,7 +1140,7 @@ YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {
-    var currValue = this._oTextbox.value;
+    var currValue = this._elTextbox.value;
     var lastValue = this._sLastTextboxValue;
     if(currValue != lastValue) {
         this._sLastTextboxValue = currValue;
@@ -1233,7 +1278,7 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
     }
 
     var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
-    var contentStyle = oSelf._oContainer._oContent.style;
+    var contentStyle = oSelf._elContent.style;
     contentStyle.width = (!isOpera) ? null : "";
     contentStyle.height = (!isOpera) ? null : "";
 
@@ -1272,7 +1317,7 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
         }
 
         // Expand the container
-        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);
+        var ok = oSelf.doBeforeExpandContainer(oSelf._elTextbox, oSelf._elContainer, sQuery, aResults);
         oSelf._toggleContainer(ok);
         
         if(oSelf.autoHighlight) {
@@ -1302,16 +1347,16 @@ YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, o
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._clearSelection = function() {
-    var sValue = this._oTextbox.value;
+    var sValue = this._elTextbox.value;
     var sChar = (this.delimChar) ? this.delimChar[0] : null;
     var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;
     if(nIndex > -1) {
-        this._oTextbox.value = sValue.substring(0,nIndex);
+        this._elTextbox.value = sValue.substring(0,nIndex);
     }
     else {
-         this._oTextbox.value = "";
+         this._elTextbox.value = "";
     }
-    this._sSavedQuery = this._oTextbox.value;
+    this._sSavedQuery = this._elTextbox.value;
 
     // Fire custom event
     this.selectionEnforceEvent.fire(this);
@@ -1355,20 +1400,20 @@ YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
         return;
     }
 
-    var oTextbox = this._oTextbox;
-    var sValue = this._oTextbox.value; // any saved queries plus what user has typed
+    var elTextbox = this._elTextbox;
+    var sValue = this._elTextbox.value; // any saved queries plus what user has typed
 
     // Don't update with type-ahead if text selection is not supported
-    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {
+    if(!elTextbox.setSelectionRange && !elTextbox.createTextRange) {
         return;
     }
 
     // Select the portion of text that the user has not typed
     var nStart = sValue.length;
     this._updateValue(oItem);
-    var nEnd = oTextbox.value.length;
-    this._selectText(oTextbox,nStart,nEnd);
-    var sPrefill = oTextbox.value.substr(nStart,nEnd);
+    var nEnd = elTextbox.value.length;
+    this._selectText(elTextbox,nStart,nEnd);
+    var sPrefill = elTextbox.value.substr(nStart,nEnd);
     this.typeAheadEvent.fire(this,sQuery,sPrefill);
 };
 
@@ -1376,23 +1421,23 @@ YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
  * Selects text in the input field.
  *
  * @method _selectText
- * @param oTextbox {HTMLElement} Text input box element in which to select text.
+ * @param elTextbox {HTMLElement} Text input box element in which to select text.
  * @param nStart {Number} Starting index of text string to select.
  * @param nEnd {Number} Ending index of text selection.
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {
-    if(oTextbox.setSelectionRange) { // For Mozilla
-        oTextbox.setSelectionRange(nStart,nEnd);
+YAHOO.widget.AutoComplete.prototype._selectText = function(elTextbox, nStart, nEnd) {
+    if(elTextbox.setSelectionRange) { // For Mozilla
+        elTextbox.setSelectionRange(nStart,nEnd);
     }
-    else if(oTextbox.createTextRange) { // For IE
-        var oTextRange = oTextbox.createTextRange();
+    else if(elTextbox.createTextRange) { // For IE
+        var oTextRange = elTextbox.createTextRange();
         oTextRange.moveStart("character", nStart);
-        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);
+        oTextRange.moveEnd("character", nEnd-elTextbox.value.length);
         oTextRange.select();
     }
     else {
-        oTextbox.select();
+        elTextbox.select();
     }
 };
 
@@ -1405,29 +1450,29 @@ YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEn
  */
 YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
     var bFireEvent = false;
-    var width = this._oContainer._oContent.offsetWidth + "px";
-    var height = this._oContainer._oContent.offsetHeight + "px";
+    var width = this._elContent.offsetWidth + "px";
+    var height = this._elContent.offsetHeight + "px";
 
-    if(this.useIFrame && this._oContainer._oIFrame) {
+    if(this.useIFrame && this._elIFrame) {
         bFireEvent = true;
         if(bShow) {
-            this._oContainer._oIFrame.style.width = width;
-            this._oContainer._oIFrame.style.height = height;
+            this._elIFrame.style.width = width;
+            this._elIFrame.style.height = height;
         }
         else {
-            this._oContainer._oIFrame.style.width = 0;
-            this._oContainer._oIFrame.style.height = 0;
+            this._elIFrame.style.width = 0;
+            this._elIFrame.style.height = 0;
         }
     }
-    if(this.useShadow && this._oContainer._oShadow) {
+    if(this.useShadow && this._elShadow) {
         bFireEvent = true;
         if(bShow) {
-            this._oContainer._oShadow.style.width = width;
-            this._oContainer._oShadow.style.height = height;
+            this._elShadow.style.width = width;
+            this._elShadow.style.height = height;
         }
         else {
-           this._oContainer._oShadow.style.width = 0;
-            this._oContainer._oShadow.style.height = 0;
+           this._elShadow.style.width = 0;
+            this._elShadow.style.height = 0;
         }
     }
 };
@@ -1440,7 +1485,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
-    var oContainer = this._oContainer;
+    var elContainer = this._elContainer;
 
     // Implementer has container always open so don't mess with it
     if(this.alwaysShowContainer && this._bContainerOpen) {
@@ -1449,7 +1494,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
     
     // Clear contents of container
     if(!bShow) {
-        this._oContainer._oContent.scrollTop = 0;
+        this._elContent.scrollTop = 0;
         var aItems = this._aListItems;
 
         if(aItems && (aItems.length > 0)) {
@@ -1469,7 +1514,7 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
 
     // Container is already closed
     if(!bShow && !this._bContainerOpen) {
-        oContainer._oContent.style.display = "none";
+        this._elContent.style.display = "none";
         return;
     }
 
@@ -1487,8 +1532,8 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
         }
 
         // Clone container to grab current size offscreen
-        var oClone = oContainer._oContent.cloneNode(true);
-        oContainer.appendChild(oClone);
+        var oClone = this._elContent.cloneNode(true);
+        elContainer.appendChild(oClone);
         oClone.style.top = "-9000px";
         oClone.style.display = "block";
 
@@ -1507,16 +1552,16 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
 
         // If opening anew, set to a collapsed size...
         if(bShow && !this._bContainerOpen) {
-            oContainer._oContent.style.width = wColl+"px";
-            oContainer._oContent.style.height = hColl+"px";
+            this._elContent.style.width = wColl+"px";
+            this._elContent.style.height = hColl+"px";
         }
         // Else, set it to its last known size.
         else {
-            oContainer._oContent.style.width = wExp+"px";
-            oContainer._oContent.style.height = hExp+"px";
+            this._elContent.style.width = wExp+"px";
+            this._elContent.style.height = hExp+"px";
         }
 
-        oContainer.removeChild(oClone);
+        elContainer.removeChild(oClone);
         oClone = null;
 
        var oSelf = this;
@@ -1528,14 +1573,14 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
                 oSelf.containerExpandEvent.fire(oSelf);
             }
             else {
-                oContainer._oContent.style.display = "none";
+                oSelf._elContent.style.display = "none";
                 oSelf.containerCollapseEvent.fire(oSelf);
             }
             oSelf._toggleContainerHelpers(bShow);
        };
 
         // Display container and animate it
-        oContainer._oContent.style.display = "block";
+        this._elContent.style.display = "block";
         oAnim.onComplete.subscribe(onAnimComplete);
         oAnim.animate();
         this._bContainerOpen = bShow;
@@ -1543,11 +1588,11 @@ YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
     // Else don't animate, just show or hide
     else {
         if(bShow) {
-            oContainer._oContent.style.display = "block";
+            this._elContent.style.display = "block";
             this.containerExpandEvent.fire(this);
         }
         else {
-            oContainer._oContent.style.display = "none";
+            this._elContent.style.display = "none";
             this.containerCollapseEvent.fire(this);
         }
         this._toggleContainerHelpers(bShow);
@@ -1612,34 +1657,34 @@ YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sTy
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {
-    var oTextbox = this._oTextbox;
+    var elTextbox = this._elTextbox;
     var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null;
     var sSavedQuery = this._sSavedQuery;
     var sResultKey = oItem._sResultKey;
-    oTextbox.focus();
+    elTextbox.focus();
 
     // First clear text field
-    oTextbox.value = "";
+    elTextbox.value = "";
     // Grab data to put into text field
     if(sDelimChar) {
         if(sSavedQuery) {
-            oTextbox.value = sSavedQuery;
+            elTextbox.value = sSavedQuery;
         }
-        oTextbox.value += sResultKey + sDelimChar;
+        elTextbox.value += sResultKey + sDelimChar;
         if(sDelimChar != " ") {
-            oTextbox.value += " ";
+            elTextbox.value += " ";
         }
     }
-    else { oTextbox.value = sResultKey; }
+    else { elTextbox.value = sResultKey; }
 
     // scroll to bottom of textarea if necessary
-    if(oTextbox.type == "textarea") {
-        oTextbox.scrollTop = oTextbox.scrollHeight;
+    if(elTextbox.type == "textarea") {
+        elTextbox.scrollTop = elTextbox.scrollHeight;
     }
 
     // move cursor to end
-    var end = oTextbox.value.length;
-    this._selectText(oTextbox,end,end);
+    var end = elTextbox.value.length;
+    this._selectText(elTextbox,end,end);
 
     this._oCurItem = oItem;
 };
@@ -1711,14 +1756,14 @@ YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
            // Go back to query (remove type-ahead string)
             if(this.delimChar && this._sSavedQuery) {
                 if(!this._textMatchesOption()) {
-                    this._oTextbox.value = this._sSavedQuery;
+                    this._elTextbox.value = this._sSavedQuery;
                 }
                 else {
-                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;
+                    this._elTextbox.value = this._sSavedQuery + this._sCurQuery;
                 }
             }
             else {
-                this._oTextbox.value = this._sCurQuery;
+                this._elTextbox.value = this._sCurQuery;
             }
             this._oCurItem = null;
             return;
@@ -1732,36 +1777,36 @@ YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
         var oNewItem = this._aListItems[nNewItemIndex];
 
         // Scroll the container if necessary
-        var oContent = this._oContainer._oContent;
-        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||
-            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));
+        var elContent = this._elContent;
+        var scrollOn = ((YAHOO.util.Dom.getStyle(elContent,"overflow") == "auto") ||
+            (YAHOO.util.Dom.getStyle(elContent,"overflowY") == "auto"));
         if(scrollOn && (nNewItemIndex > -1) &&
         (nNewItemIndex < this._nDisplayedItems)) {
             // User is keying down
             if(nKeyCode == 40) {
                 // Bottom of selected item is below scroll area...
-                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (elContent.scrollTop + elContent.offsetHeight)) {
                     // Set bottom of scroll area to bottom of selected item
-                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                    elContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - elContent.offsetHeight;
                 }
                 // Bottom of selected item is above scroll area...
-                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < elContent.scrollTop) {
                     // Set top of selected item to top of scroll area
-                    oContent.scrollTop = oNewItem.offsetTop;
+                    elContent.scrollTop = oNewItem.offsetTop;
 
                 }
             }
             // User is keying up
             else {
                 // Top of selected item is above scroll area
-                if(oNewItem.offsetTop < oContent.scrollTop) {
+                if(oNewItem.offsetTop < elContent.scrollTop) {
                     // Set top of scroll area to top of selected item
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;
+                    this._elContent.scrollTop = oNewItem.offsetTop;
                 }
                 // Top of selected item is below scroll area
-                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {
+                else if(oNewItem.offsetTop > (elContent.scrollTop + elContent.offsetHeight)) {
                     // Set bottom of selected item to bottom of scroll area
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                    this._elContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - elContent.offsetHeight;
                 }
             }
         }
@@ -1869,7 +1914,7 @@ YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {
-    oSelf._oTextbox.focus();
+    oSelf._elTextbox.focus();
 };
 
 /**
@@ -1912,16 +1957,18 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {
             }
             break;
         case 13: // enter
-            if(oSelf._oCurItem) {
-                if(oSelf._nKeyCode != nKeyCode) {
-                    if(oSelf._bContainerOpen) {
-                        YAHOO.util.Event.stopEvent(v);
+            if(!YAHOO.env.ua.webkit) {
+                if(oSelf._oCurItem) {
+                    if(oSelf._nKeyCode != nKeyCode) {
+                        if(oSelf._bContainerOpen) {
+                            YAHOO.util.Event.stopEvent(v);
+                        }
                     }
+                    oSelf._selectItem(oSelf._oCurItem);
+                }
+                else {
+                    oSelf._toggleContainer(false);
                 }
-                oSelf._selectItem(oSelf._oCurItem);
-            }
-            else {
-                oSelf._toggleContainer(false);
             }
             break;
         case 27: // esc
@@ -1954,22 +2001,27 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {
     var nKeyCode = v.keyCode;
 
         //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)
-        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
-        if(isMac) {
+        if(YAHOO.env.ua.webkit) {
             switch (nKeyCode) {
             case 9: // tab
-                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
-                    YAHOO.util.Event.stopEvent(v);
+                if(oSelf._oCurItem) {
+                    if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
                 }
                 break;
             case 13: // enter
-                if(oSelf._nKeyCode != nKeyCode) {
-                    YAHOO.util.Event.stopEvent(v);
+                if(oSelf._oCurItem) {
+                    if(oSelf._nKeyCode != nKeyCode) {
+                        if(oSelf._bContainerOpen) {
+                            YAHOO.util.Event.stopEvent(v);
+                        }
+                    }
+                    oSelf._selectItem(oSelf._oCurItem);
+                }
+                else {
+                    oSelf._toggleContainer(false);
                 }
-                break;
-            case 38: // up
-            case 40: // down
-                YAHOO.util.Event.stopEvent(v);
                 break;
             default:
                 break;
@@ -1996,6 +2048,7 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
     oSelf._initProps();
 
     var nKeyCode = v.keyCode;
+
     oSelf._nKeyCode = nKeyCode;
     var sText = this.value; //string in textbox
 
@@ -2037,7 +2090,7 @@ YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
  * @private
  */
 YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
-    oSelf._oTextbox.setAttribute("autocomplete","off");
+    oSelf._elTextbox.setAttribute("autocomplete","off");
     oSelf._bFocused = true;
     if(!oSelf._bItemSelected) {
         oSelf.textboxFocusEvent.fire(oSelf);
@@ -2055,19 +2108,26 @@ YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
 YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
     // Don't treat as a blur if it was a selection via mouse click
     if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {
-        // Current query needs to be validated
+        // Current query needs to be validated as a selection
         if(!oSelf._bItemSelected) {
             var oMatch = oSelf._textMatchesOption();
+            // Container is closed or current query doesn't match any result
             if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (oMatch === null))) {
+                // Force selection is enabled so clear the current query
                 if(oSelf.forceSelection) {
                     oSelf._clearSelection();
                 }
+                // Treat current query as a valid selection
                 else {
-                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf);
                 }
             }
+            // Container is open and current query matches a result
             else {
-                oSelf._selectItem(oMatch);
+                // Force a selection when textbox is blurred with a match
+                if(oSelf.forceSelection) {
+                    oSelf._selectItem(oMatch);
+                }
             }
         }
 
@@ -2081,19 +2141,16 @@ YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
 };
 
 /**
- * Handles form submission event.
+ * Handles window unload event.
  *
- * @method _onFormSubmit
- * @param v {HTMLEvent} The submit event.
+ * @method _onWindowUnload
+ * @param v {HTMLEvent} The unload event.
  * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
  * @private
  */
-YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {
-    if(oSelf.allowBrowserAutocomplete) {
-        oSelf._oTextbox.setAttribute("autocomplete","on");
-    }
-    else {
-        oSelf._oTextbox.setAttribute("autocomplete","off");
+YAHOO.widget.AutoComplete.prototype._onWindowUnload = function(v,oSelf) {
+    if(oSelf && oSelf._elTextbox && oSelf.allowBrowserAutocomplete) {
+        oSelf._elTextbox.setAttribute("autocomplete","on");
     }
 };
 
@@ -2445,13 +2502,14 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
     var aCache = this._aCache;
     var nCacheLength = (aCache) ? aCache.length : 0;
     var bMatchContains = this.queryMatchContains;
+    var sOrigQuery;
     
     // If cache is enabled...
     if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
         this.cacheQueryEvent.fire(this, oParent, sQuery);
         // If case is unimportant, normalize query now instead of in loops
         if(!this.queryMatchCase) {
-            var sOrigQuery = sQuery;
+            sOrigQuery = sQuery;
             sQuery = sQuery.toLowerCase();
         }
 
@@ -2622,8 +2680,7 @@ YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";
 /////////////////////////////////////////////////////////////////////////////
 
 /**
- * Alias to YUI Connection Manager. Allows implementers to specify their own
- * subclasses of the YUI Connection Manager utility.
+ * Alias to YUI Connection Manager, to allow implementers to customize the utility.
  *
  * @property connMgr
  * @type Object
@@ -2805,9 +2862,27 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     switch (this.responseType) {
         case YAHOO.widget.DS_XHR.TYPE_JSON:
             var jsonList, jsonObjParsed;
-            // Check for JSON lib but divert KHTML clients
-            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
-            if(oResponse.parseJSON && isNotMac) {
+            // Check for YUI JSON
+            if(YAHOO.lang.JSON) {
+                // Use the JSON utility if available
+                jsonObjParsed = YAHOO.lang.JSON.parse(oResponse);
+                if(!jsonObjParsed) {
+                    bError = true;
+                    break;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            // Check for JSON lib
+            else if(oResponse.parseJSON) {
                 // Use the new JSON utility if available
                 jsonObjParsed = oResponse.parseJSON();
                 if(!jsonObjParsed) {
@@ -2824,8 +2899,8 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                    }
                 }
             }
-            else if(window.JSON && isNotMac) {
-                // Use older JSON lib if available
+            // Use older JSON lib if available
+            else if(window.JSON) {
                 jsonObjParsed = JSON.parse(oResponse);
                 if(!jsonObjParsed) {
                     bError = true;
@@ -2887,7 +2962,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
             if(!YAHOO.lang.isArray(jsonList)) {
                 jsonList = [jsonList];
             }
-            
+
             // Loop through the array of all responses...
             for(var i = jsonList.length-1; i >= 0 ; i--) {
                 var aResultItem = [];
@@ -2988,6 +3063,285 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
 YAHOO.widget.DS_XHR.prototype._oConn = null;
 
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using the Get Utility to generate
+ * dynamic SCRIPT nodes for data retrieval.
+ *
+ * @class DS_ScriptNode
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param sUri {String} URI to the script location that will return data.
+ * @param aSchema {String[]} Data schema definition of results.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_ScriptNode = function(sUri, aSchema, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aSchema) || !YAHOO.lang.isString(sUri)) {
+        return;
+    }
+
+    this.schema = aSchema;
+    this.scriptURI = sUri;
+
+    this._init();
+};
+
+YAHOO.widget.DS_ScriptNode.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Alias to YUI Get Utility. Allows implementers to specify their own
+ * subclasses of the YUI Get Utility.
+ *
+ * @property getUtility
+ * @type Object
+ * @default YAHOO.util.Get
+ */
+YAHOO.widget.DS_ScriptNode.prototype.getUtility = YAHOO.util.Get;
+
+/**
+ * URI to the script that returns data.
+ *
+ * @property scriptURI
+ * @type String
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptURI = null;
+
+/**
+ * Query string parameter name sent to scriptURI. For instance, requests will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=queryString
+ *
+ * @property scriptQueryParam
+ * @type String
+ * @default "query"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptQueryParam = "query";
+
+/**
+ * Defines request/response management in the following manner:
+ * <dl>
+ *     <!--<dt>queueRequests</dt>
+ *     <dd>If a request is already in progress, wait until response is returned before sending the next request.</dd>
+ *     <dt>cancelStaleRequests</dt>
+ *     <dd>If a request is already in progress, cancel it before sending the next request.</dd>-->
+ *     <dt>ignoreStaleResponses</dt>
+ *     <dd>Send all requests, but handle only the response for the most recently sent request.</dd>
+ *     <dt>allowAll</dt>
+ *     <dd>Send all requests and handle all responses.</dd>
+ * </dl>
+ *
+ * @property asyncMode
+ * @type String
+ * @default "allowAll"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.asyncMode = "allowAll";
+
+/**
+ * Callback string parameter name sent to scriptURI. For instance, requests will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptCallbackParam&#62;=callbackFunction
+ *
+ * @property scriptCallbackParam
+ * @type String
+ * @default "callback"
+ */
+YAHOO.widget.DS_ScriptNode.prototype.scriptCallbackParam = "callback";
+
+/**
+ * Global array of callback functions, one for each request sent.
+ *
+ * @property callbacks
+ * @type Function[]
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode.callbacks = [];
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Unique ID to track requests.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode._nId = 0;
+
+/**
+ * Counter for pending requests. When this is 0, it is safe to purge callbacks
+ * array.
+ *
+ * @property _nPending
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DS_ScriptNode._nPending = 0;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source. Results are passed back to a callback function.
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_ScriptNode.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var oSelf = this;
+    
+    // If there are no global pending requests, it is safe to purge global callback stack and global counter
+    if(YAHOO.widget.DS_ScriptNode._nPending === 0) {
+        YAHOO.widget.DS_ScriptNode.callbacks = [];
+        YAHOO.widget.DS_ScriptNode._nId = 0;
+    }
+    
+    // ID for this request
+    var id = YAHOO.widget.DS_ScriptNode._nId;
+    YAHOO.widget.DS_ScriptNode._nId++;
+
+    // Dynamically add handler function with a closure to the callback stack
+    YAHOO.widget.DS_ScriptNode.callbacks[id] = function(oResponse) {
+        if((oSelf.asyncMode !== "ignoreStaleResponses")||
+                (id === YAHOO.widget.DS_ScriptNode.callbacks.length-1)) { // Must ignore stale responses
+            oSelf.handleResponse(oResponse, oCallbackFn, sQuery, oParent);
+        }
+        else {
+        }
+
+        delete YAHOO.widget.DS_ScriptNode.callbacks[id];
+    };
+
+    // We are now creating a request
+    YAHOO.widget.DS_ScriptNode._nPending++;
+
+    var sUri = this.scriptURI+"&"+ this.scriptQueryParam+"="+sQuery+"&"+
+            this.scriptCallbackParam+"=YAHOO.widget.DS_ScriptNode.callbacks["+id+"]";
+    this.getUtility.script(sUri,
+            {autopurge:true,
+            onsuccess:YAHOO.widget.DS_ScriptNode._bumpPendingDown,
+            onfail:YAHOO.widget.DS_ScriptNode._bumpPendingDown});
+};
+
+/**
+ * Parses JSON response data into an array of result objects and passes it to
+ * the callback function.
+ *
+ * @method handleResponse
+ * @param oResponse {Object} The raw response data to parse.
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_ScriptNode.prototype.handleResponse = function(oResponse, oCallbackFn, sQuery, oParent) {
+    var aSchema = this.schema;
+    var aResults = [];
+    var bError = false;
+
+    var jsonList, jsonObjParsed;
+
+    // Parse the JSON response as a string
+    try {
+        // Grab the object member that contains an array of all reponses...
+        // ...eval is necessary here since aSchema[0] is of unknown depth
+        jsonList = eval("(oResponse." + aSchema[0]+")");
+    }
+    catch(e) {
+        bError = true;
+   }
+
+    if(!jsonList) {
+        bError = true;
+        jsonList = [];
+    }
+
+    else if(!YAHOO.lang.isArray(jsonList)) {
+        jsonList = [jsonList];
+    }
+
+    // Loop through the array of all responses...
+    for(var i = jsonList.length-1; i >= 0 ; i--) {
+        var aResultItem = [];
+        var jsonResult = jsonList[i];
+        // ...and loop through each data field value of each response
+        for(var j = aSchema.length-1; j >= 1 ; j--) {
+            // ...and capture data into an array mapped according to the schema...
+            var dataFieldValue = jsonResult[aSchema[j]];
+            if(!dataFieldValue) {
+                dataFieldValue = "";
+            }
+            aResultItem.unshift(dataFieldValue);
+        }
+        // If schema isn't well defined, pass along the entire result object
+        if(aResultItem.length == 1) {
+            aResultItem.push(jsonResult);
+        }
+        // Capture the array of data field values in an array of results
+        aResults.unshift(aResultItem);
+    }
+
+    if(bError) {
+        aResults = null;
+    }
+
+    if(aResults === null) {
+        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);
+        aResults = [];
+    }
+    else {
+        var resultObj = {};
+        resultObj.query = decodeURIComponent(sQuery);
+        resultObj.results = aResults;
+        this._addCacheElem(resultObj);
+        
+        this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+    }
+
+    oCallbackFn(sQuery, aResults, oParent);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Any success/failure response should decrement counter.
+ *
+ * @method _bumpPendingDown
+ * @private
+ */
+YAHOO.widget.DS_ScriptNode._bumpPendingDown = function() {
+    YAHOO.widget.DS_ScriptNode._nPending--;
+};
+
+
 /****************************************************************************/
 /****************************************************************************/
 /****************************************************************************/
@@ -3071,6 +3425,7 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
     return;
 };
 
+
 /****************************************************************************/
 /****************************************************************************/
 /****************************************************************************/
@@ -3187,4 +3542,4 @@ YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParen
     oCallbackFn(sQuery, aResults, oParent);
 };
 
-YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.3.0", build: "442"});
+YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.5.0", build: "895"});
index 287f22ea11007a0d6218256fab1c365fcb3914a8..a5f3562d1f14a7a77884d37e040205bbf425bd7a 100755 (executable)
@@ -1,5 +1,17 @@
 YUI Library - Base - Release Notes
 
+Version 2.5.0
+
+  * No changes.
+
+Version 2.4.0
+
+  * Fixed typo in comments.
+  * Added margin-bottom:1em; for PRE element to match P
+  * Added color:#000 for legend element, accomodation for IE
+  * Added set width (equivilant to 160px but set in EMs) for input's
+    width type = text or password, and for textareas. 
+  
 Version 2.3.0
 
   * Initial release.
\ No newline at end of file
index a4dcc816f623247cfe6ee7e94e8609f8b2e52ec6..fcb5b2c85334a995abc44312a82c33ac6a9a9d83 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:bold;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style: decimal outside;}ul li{list-style: disc outside;}dl dd{margin-left:1em;}th,td {border:1px solid #000;padding:.5em;}th {font-weight:bold;text-align:center;}caption {margin-bottom:.5em;text-align:center;}p,fieldset,table {margin-bottom:1em;}
\ No newline at end of file
+h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:bold;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;} em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:bold;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
index 85dcca7dd2e7768e4d9e33076af927f418bc6472..bb504f88730e2dd3c3b6df6b6d81f94a4d77fd86 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* base.css, part of YUI's CSS Foundation */
 h1 {
@@ -65,12 +65,15 @@ th {
        text-align:center;
 }
 caption {
-       /*coordinated marking to match cell's padding*/
+       /*coordinated margin to match cell's padding*/
        margin-bottom:.5em;
        /*centered so it doesn't blend in to other content*/
        text-align:center;
 }
-p,fieldset,table {
+p,fieldset,table,pre {
        /*so things don't run into each other*/
        margin-bottom:1em;
-}
\ No newline at end of file
+}
+/* setting a consistent width, 160px; 
+   control of type=file still not possible */
+input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
index a0bcb588316648a40002695c2e509d65f2524e1d..b0dca1d4a4d3c603d4bf3a87fa6bfc909b44cc4b 100755 (executable)
@@ -1,4 +1,75 @@
-*** Version 2.3.0 ***
+*** Version 2.5.0 ***
+
++ Fixed issue where returning false inside the scope of a listener for attribute "before" 
+  events (i.e "beforeCheckedChange") would not cancel the attribute's default setter.
+
+
+
+*** Version 2.4.1 ***
+
++ No changes.
+
+
+
+*** Version 2.4.0 ***
+
+Added the following features:
+-----------------------------
+
++ Added a static method "YAHOO.widget.Button.getButton" that returns a Button 
+  instance with the specified HTML element id.
+
+
+Fixed the following bugs:
+-------------------------
+
++ Removed the ".yui-skin-sam" CSS class name from style rules in the core 
+  stylesheet so that it is now truly skin agnostic.
+
++ Updated the default text for tooltips for Buttons of type "radio" so that 
+  they offer the correct instructional text.
+
++ Menus with grouped YAHOO.widget.MenuItem instances will now highlight 
+  correctly when used with Button.
+
++ Buttons of type "link" now have the same default height as other Button
+  types in Internet Explorer.
+
++ Buttons of various types now line up correctly on the same line.
+
++ Menu is now truly an optional dependancy of Button.
+
++ Menus now render with the correct width when the "yui-skin-sam" CSS class 
+  name is applied to an element other than the <BODY>.
+
+
+
+*** Version 2.3.1 ***
+
+Fixed the following bugs:
+-------------------------
++ Purged the old 2.2.2 Button stylesheet and related image assets that was 
+  mistakenly included in the 2.3.0 build.
+
++ Fixed an issue in Gecko where changing a Button instance's "label" attribute
+  after the Button had been created would not result in the Button redrawing at
+  a width to fit its content.
+  
++ Fixed an issue where the singleton keypress event handler
+  (YAHOO.widget.Button.onFormKeyPress) registered for forms containing
+  Button instances of type "submit" was not removed from the form once all of 
+  its child Button instances are destroyed.
+
++ Submitting a form by clicking on a MenuItem of a SplitButton's or MenuButton's
+  Menu will no longer result in a JavaScript error.
+  
++ Modified how element tag names are compared to support XHTML applications.
+
++ Added code to remove the CSS class names representing the "hover," "focus," 
+  and "active" states when a Button instance is disabled.
+
+
+*** Version 2.3 ***
 
 Added the following features:
 -----------------------------
index 5aa3015efec53e0f6343b326a6d0a85cb47c12f3..e3ff7ea186afd58ed151193838b74706a7295074 100755 (executable)
@@ -1,6 +1,44 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+.yui-button  {
+
+    display: -moz-inline-box; /* Gecko */
+    display: inline-block; /* IE, Opera and Safari */
+    vertical-align: text-bottom;
+    
+}
+
+.yui-button .first-child {
+
+    display: block;
+    *display: inline-block; /* IE */
+
+}
+
+.yui-button button,
+.yui-button a {
+
+    display: block;
+    *display: inline-block; /* IE */
+    border: none;
+    margin: 0;
+
+}
+
+.yui-button button {
+
+    background-color: transparent;
+    *overflow: visible; /* Remove superfluous padding for IE */
+    cursor: pointer;
+
+}
+
+.yui-button a {
+
+    text-decoration: none;
+
+}
\ No newline at end of file
index e8f8011a81ec34ba67d9b78b8ed9cf6772833a1d..ad97242ac3eeca40e89cacf370f9daa5e00a0a34 100755 (executable)
@@ -1,13 +1,11 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-button  {
 
-    display: -moz-inline-box; /* Gecko */
-    display: inline-block; /* IE, Opera and Safari */
     border-width: 1px 0;
     border-style: solid;
     border-color: #808080;
@@ -18,13 +16,11 @@ version: 2.3.0
 
 .yui-skin-sam .yui-button .first-child {
 
-    display: block;
-    *display: inline-block; /* IE */
     border-width: 0 1px;
     border-style: solid;
     border-color: #808080;
     margin: 0 -1px;
-    *position: relative;
+    *position: relative;    /* Necessary to get negative margins working in IE */
     *left: -1px;
 
 }
@@ -32,10 +28,7 @@ version: 2.3.0
 .yui-skin-sam .yui-button button,
 .yui-skin-sam .yui-button a {
 
-    display: block;
-    *display: inline-block; /* IE */
     padding: 0 10px;
-    border: none;
     font-size: 93%;  /* 12px */
     line-height: 2;  /* ~24px */
     *line-height: 1.7; /* For IE */
@@ -45,22 +38,16 @@ version: 2.3.0
 
 }
 
-.yui-skin-sam .yui-button button {
-
-    *overflow: visible; /* Remove superfluous padding for IE */
-    background-color: transparent;
-    cursor: pointer;
-    cursor: hand;
-
-}
-
 .yui-skin-sam .yui-button a {
 
-    text-decoration: none;
+    /*
+        Necessary to get Button's of type "link" to be the correct 
+        height in IE.
+    */
+    *line-height: 2;
 
 }
 
-
 .yui-skin-sam .yui-split-button button,
 .yui-skin-sam .yui-menu-button button {
 
index 0de5e6e01ec8fbf7a2779092f45d3272a732001e..cef04bbe92857296dcca35128429bdbaf09a99e0 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
+.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:2;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
diff --git a/lib/yui/button/button-debug.js b/lib/yui/button/button-debug.js
new file mode 100644 (file)
index 0000000..2474c91
--- /dev/null
@@ -0,0 +1,4738 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+* @module button
+* @description <p>The Button Control enables the creation of rich, graphical 
+* buttons that function like traditional HTML form buttons.  <em>Unlike</em> 
+* tradition HTML form buttons, buttons created with the Button Control can have 
+* a label that is different from its value.  With the inclusion of the optional 
+* <a href="module_menu.html">Menu Control</a>, the Button Control can also be
+* used to create menu buttons and split buttons, controls that are not 
+* available natively in HTML.  The Button Control can also be thought of as a 
+* way to create more visually engaging implementations of the browser's 
+* default radio-button and check-box controls.</p>
+* <p>The Button Control supports the following types:</p>
+* <dl>
+* <dt>push</dt>
+* <dd>Basic push button that can execute a user-specified command when 
+* pressed.</dd>
+* <dt>link</dt>
+* <dd>Navigates to a specified url when pressed.</dd>
+* <dt>submit</dt>
+* <dd>Submits the parent form when pressed.</dd>
+* <dt>reset</dt>
+* <dd>Resets the parent form when pressed.</dd>
+* <dt>checkbox</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.</dd>
+* <dt>radio</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.  Use with 
+* the ButtonGroup class to create a set of controls that are mutually 
+* exclusive; checking one button in the set will uncheck all others in 
+* the group.</dd>
+* <dt>menu</dt>
+* <dd>When pressed will show/hide a menu.</dd>
+* <dt>split</dt>
+* <dd>Can execute a user-specified command or display a menu when pressed.</dd>
+* </dl>
+* @title Button
+* @namespace YAHOO.widget
+* @requires yahoo, dom, element, event
+* @optional container, menu
+*/
+
+
+(function () {
+
+
+    /**
+    * The Button class creates a rich, graphical button.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+    * be used to create the button.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org
+    * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697">
+    * HTMLButtonElement</a>|<a href="
+    * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+    * ID-33759296">HTMLElement</a>} p_oElement Object reference for the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+    * used to create the button.
+    * @param {Object} p_oElement Object literal specifying a set of   
+    * configuration attributes used to create the button.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set  
+    * of configuration attributes used to create the button.
+    * @namespace YAHOO.widget
+    * @class Button
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+
+
+
+    // Shorthard for utilities
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Overlay = YAHOO.widget.Overlay,
+        Menu = YAHOO.widget.Menu,
+    
+    
+        // Private member variables
+    
+        m_oButtons = {},    // Collection of all Button instances
+        m_oOverlayManager = null,   // YAHOO.widget.OverlayManager instance
+        m_oSubmitTrigger = null,    // The button that submitted the form 
+        m_oFocusedButton = null;    // The button that has focus
+
+
+
+    // Private methods
+
+    
+    
+    /**
+    * @method createInputElement
+    * @description Creates an <code>&#60;input&#62;</code> element of the 
+    * specified type.
+    * @private
+    * @param {String} p_sType String specifying the type of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sName String specifying the name of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sValue String specifying the value of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_bChecked Boolean specifying if the  
+    * <code>&#60;input&#62;</code> element is to be checked.
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>}
+    */
+    function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) {
+    
+        var oInput,
+            sInput;
+    
+        if (Lang.isString(p_sType) && Lang.isString(p_sName)) {
+        
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                    For IE it is necessary to create the element with the 
+                    "type," "name," "value," and "checked" properties set all 
+                    at once.
+                */
+            
+                sInput = "<input type=\"" + p_sType + "\" name=\"" + 
+                    p_sName + "\"";
+        
+                if (p_bChecked) {
+        
+                    sInput += " checked";
+                
+                }
+                
+                sInput += ">";
+        
+                oInput = document.createElement(sInput);
+        
+            }
+            else {
+            
+                oInput = document.createElement("input");
+                oInput.name = p_sName;
+                oInput.type = p_sType;
+        
+                if (p_bChecked) {
+        
+                    oInput.checked = true;
+                
+                }
+        
+            }
+        
+            oInput.value = p_sValue;
+            
+            return oInput;
+        
+        }
+    
+    }
+    
+    
+    /**
+    * @method setAttributesFromSrcElement
+    * @description Gets the values for all the attributes of the source element 
+    * (either <code>&#60;input&#62;</code> or <code>&#60;a&#62;</code>) that 
+    * map to Button configuration attributes and sets them into a collection 
+    * that is passed to the Button constructor.
+    * @private
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/
+    * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-
+    * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML 
+    * element (either <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+    * </code>) used to create the button.
+    * @param {Object} p_oAttributes Object reference for the collection of 
+    * configuration attributes used to create the button.
+    */
+    function setAttributesFromSrcElement(p_oElement, p_oAttributes) {
+    
+        var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(),
+            me = this,
+            oAttribute,
+            oRootNode,
+            sText;
+            
+    
+        /**
+        * @method setAttributeFromDOMAttribute
+        * @description Gets the value of the specified DOM attribute and sets it 
+        * into the collection of configuration attributes used to configure 
+        * the button.
+        * @private
+        * @param {String} p_sAttribute String representing the name of the 
+        * attribute to retrieve from the DOM element.
+        */
+        function setAttributeFromDOMAttribute(p_sAttribute) {
+    
+            if (!(p_sAttribute in p_oAttributes)) {
+    
+                /*
+                    Need to use "getAttributeNode" instead of "getAttribute" 
+                    because using "getAttribute," IE will return the innerText 
+                    of a <code>&#60;button&#62;</code> for the value attribute  
+                    rather than the value of the "value" attribute.
+                */
+        
+                oAttribute = p_oElement.getAttributeNode(p_sAttribute);
+        
+    
+                if (oAttribute && ("value" in oAttribute)) {
+    
+                    me.logger.log("Setting attribute \"" + p_sAttribute + 
+                        "\" using source element's attribute value of \"" + 
+                        oAttribute.value + "\"");
+    
+                    p_oAttributes[p_sAttribute] = oAttribute.value;
+    
+                }
+    
+            }
+        
+        }
+    
+    
+        /**
+        * @method setFormElementProperties
+        * @description Gets the value of the attributes from the form element  
+        * and sets them into the collection of configuration attributes used to 
+        * configure the button.
+        * @private
+        */
+        function setFormElementProperties() {
+    
+            setAttributeFromDOMAttribute("type");
+    
+            if (p_oAttributes.type == "button") {
+            
+                p_oAttributes.type = "push";
+            
+            }
+    
+            if (!("disabled" in p_oAttributes)) {
+    
+                p_oAttributes.disabled = p_oElement.disabled;
+    
+            }
+    
+            setAttributeFromDOMAttribute("name");
+            setAttributeFromDOMAttribute("value");
+            setAttributeFromDOMAttribute("title");
+    
+        }
+
+    
+        switch (sSrcElementNodeName) {
+        
+        case "A":
+            
+            p_oAttributes.type = "link";
+            
+            setAttributeFromDOMAttribute("href");
+            setAttributeFromDOMAttribute("target");
+        
+            break;
+    
+        case "INPUT":
+
+            setFormElementProperties();
+
+            if (!("checked" in p_oAttributes)) {
+    
+                p_oAttributes.checked = p_oElement.checked;
+    
+            }
+
+            break;
+
+        case "BUTTON":
+
+            setFormElementProperties();
+
+            oRootNode = p_oElement.parentNode.parentNode;
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) {
+            
+                p_oAttributes.checked = true;
+            
+            }
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) {
+
+                p_oAttributes.disabled = true;
+            
+            }
+
+            p_oElement.removeAttribute("value");
+
+            p_oElement.setAttribute("type", "button");
+
+            break;
+        
+        }
+
+        p_oElement.removeAttribute("id");
+        p_oElement.removeAttribute("name");
+        
+        if (!("tabindex" in p_oAttributes)) {
+
+            p_oAttributes.tabindex = p_oElement.tabIndex;
+
+        }
+    
+        if (!("label" in p_oAttributes)) {
+    
+            // Set the "label" property
+        
+            sText = sSrcElementNodeName == "INPUT" ? 
+                            p_oElement.value : p_oElement.innerHTML;
+        
+    
+            if (sText && sText.length > 0) {
+                
+                p_oAttributes.label = sText;
+                
+            } 
+    
+        }
+    
+    }
+    
+    
+    /**
+    * @method initConfig
+    * @description Initializes the set of configuration attributes that are 
+    * used to instantiate the button.
+    * @private
+    * @param {Object} Object representing the button's set of 
+    * configuration attributes.
+    */
+    function initConfig(p_oConfig) {
+    
+        var oAttributes = p_oConfig.attributes,
+            oSrcElement = oAttributes.srcelement,
+            sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(),
+            me = this;
+    
+    
+        if (sSrcElementNodeName == this.NODE_NAME) {
+    
+            p_oConfig.element = oSrcElement;
+            p_oConfig.id = oSrcElement.id;
+
+            Dom.getElementsBy(function (p_oElement) {
+            
+                switch (p_oElement.nodeName.toUpperCase()) {
+                
+                case "BUTTON":
+                case "A":
+                case "INPUT":
+
+                    setAttributesFromSrcElement.call(me, p_oElement, 
+                        oAttributes);
+
+                    break;                        
+                
+                }
+            
+            }, "*", oSrcElement);
+        
+        }
+        else {
+    
+            switch (sSrcElementNodeName) {
+
+            case "BUTTON":
+            case "A":
+            case "INPUT":
+
+                setAttributesFromSrcElement.call(this, oSrcElement, 
+                    oAttributes);
+
+                break;
+
+            }
+        
+        }
+    
+    }
+
+
+
+    //  Constructor
+
+    YAHOO.widget.Button = function (p_oElement, p_oAttributes) {
+    
+               if (!Overlay && YAHOO.widget.Overlay) {
+               
+                       Overlay = YAHOO.widget.Overlay;
+               
+               }
+
+
+               if (!Menu && YAHOO.widget.Menu) {
+               
+                       Menu = YAHOO.widget.Menu;
+               
+               }
+
+
+        var fnSuperClass = YAHOO.widget.Button.superclass.constructor,
+            oConfig,
+            oElement;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                p_oElement.id = Dom.generateId();
+    
+                YAHOO.log("No value specified for the button's \"id\" " + 
+                    "attribute. Setting button id to \"" + p_oElement.id + 
+                    "\".", "warn");
+    
+            }
+    
+            this.logger = new YAHOO.widget.LogWriter("Button " + p_oElement.id);
+    
+            this.logger.log("No source HTML element.  Building the button " +
+                    "using the set of configuration attributes.");
+    
+            fnSuperClass.call(this, 
+                (this.createButtonElement(p_oElement.type)),
+                p_oElement);
+    
+        }
+        else {
+    
+            oConfig = { element: null, attributes: (p_oAttributes || {}) };
+    
+    
+            if (Lang.isString(p_oElement)) {
+    
+                oElement = Dom.get(p_oElement);
+    
+                if (oElement) {
+
+                    if (!oConfig.attributes.id) {
+                    
+                        oConfig.attributes.id = p_oElement;
+                    
+                    }
+    
+                    this.logger = new YAHOO.widget.LogWriter(
+                                        "Button " + oConfig.attributes.id);
+                
+                    this.logger.log("Building the button using an existing " + 
+                            "HTML element as a source element.");
+                
+                
+                    oConfig.attributes.srcelement = oElement;
+                
+                    initConfig.call(this, oConfig);
+                
+                
+                    if (!oConfig.element) {
+                
+                        this.logger.log("Source element could not be used " +
+                                "as is.  Creating a new HTML element for " + 
+                                "the button.");
+                
+                        oConfig.element = 
+                            this.createButtonElement(oConfig.attributes.type);
+                
+                    }
+                
+                    fnSuperClass.call(this, oConfig.element, 
+                        oConfig.attributes);
+    
+                }
+    
+            }
+            else if (p_oElement.nodeName) {
+    
+                if (!oConfig.attributes.id) {
+    
+                    if (p_oElement.id) {
+        
+                        oConfig.attributes.id = p_oElement.id;
+                    
+                    }
+                    else {
+        
+                        oConfig.attributes.id = Dom.generateId();
+        
+                        YAHOO.log("No value specified for the button's " +
+                            "\"id\" attribute. Setting button id to \"" + 
+                            oConfig.attributes.id + "\".", "warn");
+        
+                    }
+    
+                }
+    
+    
+                this.logger = new YAHOO.widget.LogWriter(
+                    "Button " + oConfig.attributes.id);
+    
+                this.logger.log("Building the button using an existing HTML " + 
+                    "element as a source element.");
+    
+    
+                oConfig.attributes.srcelement = p_oElement;
+        
+                initConfig.call(this, oConfig);
+        
+        
+                if (!oConfig.element) {
+    
+                    this.logger.log("Source element could not be used as is." +
+                            "  Creating a new HTML element for the button.");
+            
+                    oConfig.element = 
+                        this.createButtonElement(oConfig.attributes.type);
+            
+                }
+            
+                fnSuperClass.call(this, oConfig.element, oConfig.attributes);
+            
+            }
+    
+        }
+    
+    };
+
+
+
+    YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _button
+        * @description Object reference to the button's internal 
+        * <code>&#60;a&#62;</code> or <code>&#60;button&#62;</code> element.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>
+        */
+        _button: null,
+        
+        
+        /** 
+        * @property _menu
+        * @description Object reference to the button's menu.
+        * @default null
+        * @protected
+        * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|
+        * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        _menu: null,
+        
+        
+        /** 
+        * @property _hiddenFields
+        * @description Object reference to the <code>&#60;input&#62;</code>  
+        * element, or array of HTML form elements used to represent the button
+        *  when its parent form is submitted.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array
+        */
+        _hiddenFields: null,
+        
+        
+        /** 
+        * @property _onclickAttributeValue
+        * @description Object reference to the button's current value for the 
+        * "onclick" configuration attribute.
+        * @default null
+        * @protected
+        * @type Object
+        */
+        _onclickAttributeValue: null,
+        
+        
+        /** 
+        * @property _activationKeyPressed
+        * @description Boolean indicating if the key(s) that toggle the button's 
+        * "active" state have been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationKeyPressed: false,
+        
+        
+        /** 
+        * @property _activationButtonPressed
+        * @description Boolean indicating if the mouse button that toggles 
+        * the button's "active" state has been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationButtonPressed: false,
+        
+        
+        /** 
+        * @property _hasKeyEventHandlers
+        * @description Boolean indicating if the button's "blur", "keydown" and 
+        * "keyup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasKeyEventHandlers: false,
+        
+        
+        /** 
+        * @property _hasMouseEventHandlers
+        * @description Boolean indicating if the button's "mouseout," 
+        * "mousedown," and "mouseup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasMouseEventHandlers: false,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the node to be used for the button's 
+        * root element.
+        * @default "SPAN"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "SPAN",
+        
+        
+        /**
+        * @property CHECK_ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when pressed) 
+        * toggle the button's "checked" attribute.
+        * @default [32]
+        * @final
+        * @type Array
+        */
+        CHECK_ACTIVATION_KEYS: [32],
+        
+        
+        /**
+        * @property ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when presed) 
+        * toggle the button's "active" state.
+        * @default [13, 32]
+        * @final
+        * @type Array
+        */
+        ACTIVATION_KEYS: [13, 32],
+        
+        
+        /**
+        * @property OPTION_AREA_WIDTH
+        * @description Width (in pixels) of the area of a split button that  
+        * when pressed will display a menu.
+        * @default 20
+        * @final
+        * @type Number
+        */
+        OPTION_AREA_WIDTH: 20,
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied to  
+        * the button's root element.
+        * @default "yui-button"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-button",
+        
+        
+        /**
+        * @property RADIO_DEFAULT_TITLE
+        * @description String representing the default title applied to buttons 
+        * of type "radio." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        RADIO_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property RADIO_CHECKED_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "radio" when checked.
+        * @default "Checked.  Click another button to uncheck"
+        * @final
+        * @type String
+        */
+        RADIO_CHECKED_TITLE: "Checked.  Click another button to uncheck",
+        
+        
+        /**
+        * @property CHECKBOX_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "checkbox." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        CHECKBOX_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property CHECKBOX_CHECKED_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "checkbox" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        CHECKBOX_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property MENUBUTTON_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "menu." 
+        * @default "Menu collapsed.  Click to expand."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_DEFAULT_TITLE: "Menu collapsed.  Click to expand.",
+        
+        
+        /**
+        * @property MENUBUTTON_MENU_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "menu" when the button's menu is visible. 
+        * @default "Menu expanded.  Click or press Esc to collapse."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_MENU_VISIBLE_TITLE: 
+            "Menu expanded.  Click or press Esc to collapse.",
+        
+        
+        /**
+        * @property SPLITBUTTON_DEFAULT_TITLE
+        * @description  String representing the default title applied to 
+        * buttons of type "split." 
+        * @default "Menu collapsed.  Click inside option region or press 
+        * Ctrl + Shift + M to show the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed.  Click inside option " + 
+            "region or press Ctrl + Shift + M to show the menu."),
+        
+        
+        /**
+        * @property SPLITBUTTON_OPTION_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "split" when the button's menu is visible. 
+        * @default "Menu expanded.  Press Esc or Ctrl + Shift + M to hide 
+        * the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_OPTION_VISIBLE_TITLE: 
+            "Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",
+        
+        
+        /**
+        * @property SUBMIT_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "submit." 
+        * @default "Click to submit form."
+        * @final
+        * @type String
+        */
+        SUBMIT_TITLE: "Click to submit form.",
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setType
+        * @description Sets the value of the button's "type" attribute.
+        * @protected
+        * @param {String} p_sType String indicating the value for the button's 
+        * "type" attribute.
+        */
+        _setType: function (p_sType) {
+        
+            if (p_sType == "split") {
+        
+                this.on("option", this._onOption);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setLabel
+        * @description Sets the value of the button's "label" attribute.
+        * @protected
+        * @param {String} p_sLabel String indicating the value for the button's 
+        * "label" attribute.
+        */
+        _setLabel: function (p_sLabel) {
+
+            this._button.innerHTML = p_sLabel;
+            
+            /*
+                Remove and add the default class name from the root element
+                for Gecko to ensure that the button shrinkwraps to the label.
+                Without this the button will not be rendered at the correct 
+                width when the label changes.  The most likely cause for this 
+                bug is button's use of the Gecko-specific CSS display type of 
+                "-moz-inline-box" to simulate "inline-block" supported by IE, 
+                Safari and Opera.
+            */
+            
+            var sClass,
+                me;
+            
+            if (YAHOO.env.ua.gecko && Dom.inDocument(this.get("element"))) {
+            
+                me = this;
+                sClass = this.CSS_CLASS_NAME;                
+
+                this.removeClass(sClass);
+                
+                window.setTimeout(function () {
+                
+                    me.addClass(sClass);
+                
+                }, 0);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTabIndex
+        * @description Sets the value of the button's "tabindex" attribute.
+        * @protected
+        * @param {Number} p_nTabIndex Number indicating the value for the 
+        * button's "tabindex" attribute.
+        */
+        _setTabIndex: function (p_nTabIndex) {
+        
+            this._button.tabIndex = p_nTabIndex;
+        
+        },
+        
+        
+        /**
+        * @method _setTitle
+        * @description Sets the value of the button's "title" attribute.
+        * @protected
+        * @param {String} p_nTabIndex Number indicating the value for 
+        * the button's "title" attribute.
+        */
+        _setTitle: function (p_sTitle) {
+        
+            var sTitle = p_sTitle;
+        
+            if (this.get("type") != "link") {
+        
+                if (!sTitle) {
+        
+                    switch (this.get("type")) {
+        
+                    case "radio":
+    
+                        sTitle = this.RADIO_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "checkbox":
+    
+                        sTitle = this.CHECKBOX_DEFAULT_TITLE;
+    
+                        break;
+                    
+                    case "menu":
+    
+                        sTitle = this.MENUBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "split":
+    
+                        sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "submit":
+    
+                        sTitle = this.SUBMIT_TITLE;
+    
+                        break;
+        
+                    }
+        
+                }
+        
+                this._button.title = sTitle;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button's "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for 
+        * the button's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            if (this.get("type") != "link") {
+        
+                if (p_bDisabled) {
+        
+                    if (this._menu) {
+        
+                        this._menu.hide();
+        
+                    }
+        
+                    if (this.hasFocus()) {
+                    
+                        this.blur();
+                    
+                    }
+        
+                    this._button.setAttribute("disabled", "disabled");
+        
+                    this.addStateCSSClasses("disabled");
+
+                    this.removeStateCSSClasses("hover");
+                    this.removeStateCSSClasses("active");
+                    this.removeStateCSSClasses("focus");
+        
+                }
+                else {
+        
+                    this._button.removeAttribute("disabled");
+        
+                    this.removeStateCSSClasses("disabled");
+                
+                }
+        
+            }
+        
+        },
+
+        
+        /**
+        * @method _setHref
+        * @description Sets the value of the button's "href" attribute.
+        * @protected
+        * @param {String} p_sHref String indicating the value for the button's 
+        * "href" attribute.
+        */
+        _setHref: function (p_sHref) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.href = p_sHref;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTarget
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {String} p_sTarget String indicating the value for the button's 
+        * "target" attribute.
+        */
+        _setTarget: function (p_sTarget) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.setAttribute("target", p_sTarget);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setChecked
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {Boolean} p_bChecked Boolean indicating the value for  
+        * the button's "checked" attribute.
+        */
+        _setChecked: function (p_bChecked) {
+        
+            var sType = this.get("type"),
+                sTitle;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                if (p_bChecked) {
+        
+                    this.addStateCSSClasses("checked");
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+
+                    this.removeStateCSSClasses("checked");
+        
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+        
+                this.set("title", sTitle);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setMenu
+        * @description Sets the value of the button's "menu" attribute.
+        * @protected
+        * @param {Object} p_oMenu Object indicating the value for the button's 
+        * "menu" attribute.
+        */
+        _setMenu: function (p_oMenu) {
+
+            var bLazyLoad = this.get("lazyloadmenu"),
+                oButtonElement = this.get("element"),
+                sMenuCSSClassName,
+        
+                /*
+                    Boolean indicating if the value of p_oMenu is an instance 
+                    of YAHOO.widget.Menu or YAHOO.widget.Overlay.
+                */
+        
+                bInstance = false,
+        
+
+                oMenu,
+                oMenuElement,
+                oSrcElement,
+                aItems,
+                nItems,
+                oItem,
+                i;
+        
+        
+            if (!Overlay) {
+        
+                this.logger.log("YAHOO.widget.Overlay dependency not met.", 
+                    "error");
+        
+                return false;
+            
+            }
+
+
+            if (Menu) {
+            
+                sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME;
+            
+            }
+        
+        
+            function onAppendTo() {
+
+                oMenu.render(oButtonElement.parentNode);
+                
+                this.removeListener("appendTo", onAppendTo);
+            
+            }
+        
+        
+            function initMenu() {
+        
+                if (oMenu) {
+
+                    Dom.addClass(oMenu.element, this.get("menuclassname"));
+                    Dom.addClass(oMenu.element, 
+                            "yui-" + this.get("type") + "-button-menu");
+
+                    oMenu.showEvent.subscribe(this._onMenuShow, null, this);
+                    oMenu.hideEvent.subscribe(this._onMenuHide, null, this);
+                    oMenu.renderEvent.subscribe(this._onMenuRender, null, this);
+        
+        
+                    if (Menu && oMenu instanceof Menu) {
+        
+                        oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, 
+                            this, true);
+
+                        oMenu.subscribe("click", this._onMenuClick, 
+                            this, true);
+
+                        oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, 
+                            this, true);
+        
+                        oSrcElement = oMenu.srcElement;
+        
+                        if (oSrcElement && 
+                            oSrcElement.nodeName.toUpperCase() == "SELECT") {
+                
+                            oSrcElement.style.display = "none";
+                            oSrcElement.parentNode.removeChild(oSrcElement);
+        
+                        }
+        
+                    }
+                    else if (Overlay && oMenu instanceof Overlay) {
+        
+                        if (!m_oOverlayManager) {
+        
+                            m_oOverlayManager = 
+                                new YAHOO.widget.OverlayManager();
+                        
+                        }
+                        
+                        m_oOverlayManager.register(oMenu);
+                        
+                    }
+        
+        
+                    this._menu = oMenu;
+
+        
+                    if (!bInstance) {
+        
+                        if (bLazyLoad && Menu && !(oMenu instanceof Menu)) {
+        
+                            /*
+                                Mimic Menu's "lazyload" functionality by adding  
+                                a "beforeshow" event listener that renders the 
+                                Overlay instance before it is made visible by  
+                                the button.
+                            */
+        
+                            oMenu.beforeShowEvent.subscribe(
+                                this._onOverlayBeforeShow, null, this);
+            
+                        }
+                        else if (!bLazyLoad) {
+        
+                            if (Dom.inDocument(oButtonElement)) {
+        
+                                oMenu.render(oButtonElement.parentNode);
+                            
+                            }
+                            else {
+            
+                                this.on("appendTo", onAppendTo);
+                            
+                            }
+                        
+                        }
+                    
+                    }
+        
+                }
+        
+            }
+        
+        
+            if (p_oMenu && Menu && (p_oMenu instanceof Menu)) {
+        
+                oMenu = p_oMenu;
+                aItems = oMenu.getItems();
+                nItems = aItems.length;
+                bInstance = true;
+        
+        
+                if (nItems > 0) {
+        
+                    i = nItems - 1;
+        
+                    do {
+        
+                        oItem = aItems[i];
+        
+                        if (oItem) {
+        
+                            oItem.cfg.subscribeToConfigEvent("selected", 
+                                this._onMenuItemSelected, 
+                                oItem, 
+                                this);
+        
+                        }
+        
+                    }
+                    while (i--);
+        
+                }
+        
+                initMenu.call(this);
+        
+            }
+            else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) {
+        
+                oMenu = p_oMenu;
+                bInstance = true;
+        
+                oMenu.cfg.setProperty("visible", false);
+                oMenu.cfg.setProperty("context", [oButtonElement, "tl", "bl"]);
+        
+                initMenu.call(this);
+        
+            }
+            else if (Menu && Lang.isArray(p_oMenu)) {
+        
+                this.on("appendTo", function () {
+        
+                    oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, 
+                        itemdata: p_oMenu });
+        
+                    initMenu.call(this);
+        
+                });
+        
+            }
+            else if (Lang.isString(p_oMenu)) {
+        
+                oMenuElement = Dom.get(p_oMenu);
+        
+                if (oMenuElement) {
+        
+                    if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || 
+                        oMenuElement.nodeName.toUpperCase() == "SELECT") {
+            
+                        oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+            
+                        initMenu.call(this);
+            
+                    }
+                    else if (Overlay) {
+        
+                        oMenu = new Overlay(p_oMenu, { visible: false, 
+                            context: [oButtonElement, "tl", "bl"] });
+            
+                        initMenu.call(this);
+            
+                    }
+        
+                }
+        
+            }
+            else if (p_oMenu && p_oMenu.nodeName) {
+        
+                if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || 
+                        p_oMenu.nodeName.toUpperCase() == "SELECT") {
+        
+                    oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+                
+                    initMenu.call(this);
+        
+                }
+                else if (Overlay) {
+        
+                    if (!p_oMenu.id) {
+                    
+                        Dom.generateId(p_oMenu);
+                    
+                    }
+        
+                    oMenu = new Overlay(p_oMenu, { visible: false, 
+                                    context: [oButtonElement, "tl", "bl"] });
+        
+                    initMenu.call(this);
+                
+                }
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setOnClick
+        * @description Sets the value of the button's "onclick" attribute.
+        * @protected
+        * @param {Object} p_oObject Object indicating the value for the button's 
+        * "onclick" attribute.
+        */
+        _setOnClick: function (p_oObject) {
+        
+            /*
+                Remove any existing listeners if a "click" event handler 
+                has already been specified.
+            */
+        
+            if (this._onclickAttributeValue && 
+                (this._onclickAttributeValue != p_oObject)) {
+        
+                this.removeListener("click", this._onclickAttributeValue.fn);
+        
+                this._onclickAttributeValue = null;
+        
+            }
+        
+        
+            if (!this._onclickAttributeValue && 
+                Lang.isObject(p_oObject) && 
+                Lang.isFunction(p_oObject.fn)) {
+        
+                this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope);
+        
+                this._onclickAttributeValue = p_oObject;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setSelectedMenuItem
+        * @description Sets the value of the button's 
+        * "selectedMenuItem" attribute.
+        * @protected
+        * @param {Number} p_nIndex Number representing the index of the item 
+        * in the button's menu that is currently selected.
+        */
+        _setSelectedMenuItem: function (p_nIndex) {
+
+            var oMenu = this._menu,
+                oMenuItem;
+
+
+            if (Menu && oMenu && oMenu instanceof Menu) {
+
+                oMenuItem = oMenu.getItem(p_nIndex);
+                
+
+                if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) {
+                
+                    oMenuItem.cfg.setProperty("selected", true);
+                
+                }
+            
+            }
+
+        },
+        
+        
+        // Protected methods
+
+        
+        
+        /**
+        * @method _isActivationKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the button's "active" state.
+        * @protected
+        * @param {Number} p_nKeyCode Number representing the keycode to 
+        * be evaluated.
+        * @return {Boolean}
+        */
+        _isActivationKey: function (p_nKeyCode) {
+        
+            var sType = this.get("type"),
+                aKeyCodes = (sType == "checkbox" || sType == "radio") ? 
+                    this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS,
+        
+                nKeyCodes = aKeyCodes.length,
+                i;
+        
+            if (nKeyCodes > 0) {
+        
+                i = nKeyCodes - 1;
+        
+                do {
+        
+                    if (p_nKeyCode == aKeyCodes[i]) {
+        
+                        return true;
+        
+                    }
+        
+                }
+                while (i--);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _isSplitButtonOptionKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the display of the split button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        * @return {Boolean}
+        */
+        _isSplitButtonOptionKey: function (p_oEvent) {
+        
+            return (p_oEvent.ctrlKey && p_oEvent.shiftKey && 
+                Event.getCharCode(p_oEvent) == 77);
+        
+        },
+        
+        
+        /**
+        * @method _addListenersToForm
+        * @description Adds event handlers to the button's form.
+        * @protected
+        */
+        _addListenersToForm: function () {
+        
+            var oForm = this.getForm(),
+                onFormKeyPress = YAHOO.widget.Button.onFormKeyPress,
+                bHasKeyPressListener,
+                oSrcElement,
+                aListeners,
+                nListeners,
+                i;
+        
+        
+            if (oForm) {
+        
+                Event.on(oForm, "reset", this._onFormReset, null, this);
+                Event.on(oForm, "submit", this.createHiddenFields, null, this);
+        
+                oSrcElement = this.get("srcelement");
+        
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+                
+                    aListeners = Event.getListeners(oForm, "keypress");
+                    bHasKeyPressListener = false;
+            
+                    if (aListeners) {
+            
+                        nListeners = aListeners.length;
+        
+                        if (nListeners > 0) {
+            
+                            i = nListeners - 1;
+                            
+                            do {
+               
+                                if (aListeners[i].fn == onFormKeyPress) {
+                
+                                    bHasKeyPressListener = true;
+                                    break;
+                                
+                                }
+                
+                            }
+                            while (i--);
+                        
+                        }
+                    
+                    }
+            
+            
+                    if (!bHasKeyPressListener) {
+               
+                        Event.on(oForm, "keypress", onFormKeyPress);
+            
+                    }
+        
+                }
+            
+            }
+        
+        },
+        
+        
+        
+        /**
+        * @method _showMenu
+        * @description Shows the button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object 
+        * passed back by the event utility (YAHOO.util.Event) that triggered 
+        * the display of the menu.
+        */
+        _showMenu: function (p_oEvent) {
+
+            if (YAHOO.widget.MenuManager) {
+
+                YAHOO.widget.MenuManager.hideVisible();
+            
+            }
+
+        
+            if (m_oOverlayManager) {
+        
+                m_oOverlayManager.hideAll();
+            
+            }
+
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,   
+        
+                oMenu = this._menu,
+                oButton = this,
+                oButtonEL = oButton.get("element"),
+                bMenuFlipped = false,
+                nButtonY = Dom.getY(oButtonEL),
+                nScrollTop = Dom.getDocumentScrollTop(),
+                nMenuMinScrollHeight,
+                nMenuHeight,
+                oMenuShadow;
+    
+    
+            if (nScrollTop) {
+        
+                nButtonY = nButtonY - nScrollTop;
+        
+            }
+        
+        
+            var nTopRegion = nButtonY,
+                nBottomRegion = (Dom.getViewportHeight() - 
+                    (nButtonY + oButtonEL.offsetHeight));
+        
+
+            /*
+                 Uses the Button's position to calculate the availble height 
+                 above and below it to display its corresponding Menu.
+            */
+        
+            function getMenuDisplayRegionHeight() {
+        
+                if (bMenuFlipped) {
+        
+                    return (nTopRegion - nViewportOffset);
+        
+                }
+                else {
+        
+                    return (nBottomRegion - nViewportOffset);
+        
+                }
+        
+            }
+
+    
+    
+            /*
+                Sets the Menu's "maxheight" configuration property and trys to 
+                place the Menu in the best possible position (either above or 
+                below its corresponding Button).
+            */
+        
+            function sizeAndPositionMenu() {
+        
+                var nDisplayRegionHeight = getMenuDisplayRegionHeight();
+        
+        
+                if (nMenuHeight > nDisplayRegionHeight) {
+        
+                    nMenuMinScrollHeight = oMenu.cfg.getProperty("minscrollheight");
+        
+        
+                    if (nDisplayRegionHeight > nMenuMinScrollHeight) {
+        
+                        oMenu.cfg.setProperty("maxheight", 
+                                    nDisplayRegionHeight);
+            
+        
+                        if (bMenuFlipped) {
+                        
+                            oMenu.align("bl", "tl");
+                        
+                        }
+            
+                    }
+            
+        
+                    if (nDisplayRegionHeight < nMenuMinScrollHeight) {
+                   
+                        if (bMenuFlipped) {
+            
+                            /*
+                                 All possible positions and values for the 
+                                 "maxheight" configuration property have been 
+                                 tried, but none were successful, so fall back 
+                                 to the original size and position.
+                            */
+        
+                            oMenu.cfg.setProperty("context", 
+                                [oButtonEL, "tl", "bl"], true);
+
+                            oMenu.align("tl", "bl");
+                            
+                        }
+                        else {
+            
+                            oMenu.cfg.setProperty("context", 
+                                [oButtonEL, "bl", "tl"], true);
+
+                            oMenu.align("bl", "tl");
+            
+                            bMenuFlipped = true;
+            
+                            return sizeAndPositionMenu();
+            
+                        }
+                    
+                    }
+                
+                }
+        
+            }
+
+
+            if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+                oMenu.cfg.applyConfig({ context: [oButtonEL, "tl", "bl"],
+                    clicktohide: false,
+                    visible: true });
+                    
+                oMenu.cfg.fireQueue();
+                
+                oMenu.cfg.setProperty("maxheight", 0);
+            
+                oMenu.align("tl", "bl");
+        
+        
+                /*
+                    Stop the propagation of the event so that the MenuManager 
+                    doesn't blur the menu after it gets focus.
+                */
+        
+                if (p_oEvent.type == "mousedown") {
+        
+                    Event.stopPropagation(p_oEvent);
+        
+                }
+        
+                
+                nMenuHeight = oMenu.element.offsetHeight;
+                
+                oMenuShadow = oMenu.element.lastChild; 
+        
+                sizeAndPositionMenu();
+        
+                if (this.get("focusmenu")) {
+        
+                    this._menu.focus();
+                
+                }
+
+            }
+            else if (Overlay && oMenu && (oMenu instanceof Overlay)) {
+        
+                oMenu.show();
+                oMenu.align("tl", "bl");
+                
+                var nDisplayRegionHeight = getMenuDisplayRegionHeight();
+
+                nMenuHeight = oMenu.element.offsetHeight;
+
+
+                if (nDisplayRegionHeight < nMenuHeight) {
+
+                    oMenu.align("bl", "tl");
+
+                    bMenuFlipped = true;
+
+                    nDisplayRegionHeight = getMenuDisplayRegionHeight();
+
+                    if (nDisplayRegionHeight < nMenuHeight) {
+
+                        oMenu.align("tl", "bl");
+                    
+                    }
+
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _hideMenu
+        * @description Hides the button's menu.
+        * @protected
+        */
+        _hideMenu: function () {
+        
+            var oMenu = this._menu;
+        
+            if (oMenu) {
+        
+                oMenu.hide();
+        
+            }
+        
+        },
+        
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onMouseOver
+        * @description "mouseover" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOver: function (p_oEvent) {
+        
+            if (!this._hasMouseEventHandlers) {
+        
+                this.on("mouseout", this._onMouseOut);
+                this.on("mousedown", this._onMouseDown);
+                this.on("mouseup", this._onMouseUp);
+        
+                this._hasMouseEventHandlers = true;
+        
+            }
+        
+            this.addStateCSSClasses("hover");
+        
+            if (this._activationButtonPressed) {
+        
+                this.addStateCSSClasses("active");
+        
+            }
+        
+        
+            if (this._bOptionPressed) {
+        
+                this.addStateCSSClasses("activeoption");
+            
+            }
+
+
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+            }
+
+        },
+        
+        
+        /**
+        * @method _onMouseOut
+        * @description "mouseout" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOut: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("hover");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }
+        
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.on(document, "mouseup", this._onDocumentMouseUp, 
+                    null, this);
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseUp: function (p_oEvent) {
+        
+            this._activationButtonPressed = false;
+            this._bOptionPressed = false;
+        
+            var sType = this.get("type"),
+                oTarget,
+                oMenuElement;
+        
+            if (sType == "menu" || sType == "split") {
+
+                oTarget = Event.getTarget(p_oEvent);
+                oMenuElement = this._menu.element;
+        
+                if (oTarget != oMenuElement && 
+                    !Dom.isAncestor(oMenuElement, oTarget)) {
+
+                    this.removeStateCSSClasses((sType == "menu" ? 
+                        "active" : "activeoption"));
+            
+                    this._hideMenu();
+
+                }
+        
+            }
+        
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+        },
+        
+        
+        /**
+        * @method _onMouseDown
+        * @description "mousedown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseDown: function (p_oEvent) {
+        
+            var sType,
+                oElement,
+                nX,
+                me;
+        
+        
+            function onMouseUp() {
+            
+                this._hideMenu();
+                this.removeListener("mouseup", onMouseUp);
+            
+            }
+        
+        
+            if ((p_oEvent.which || p_oEvent.button) == 1) {
+        
+        
+                if (!this.hasFocus()) {
+                
+                    this.focus();
+                
+                }
+        
+        
+                sType = this.get("type");
+        
+        
+                if (sType == "split") {
+                
+                    oElement = this.get("element");
+                    nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+        
+                    if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+                        
+                        this.fireEvent("option", p_oEvent);
+        
+                    }
+                    else {
+        
+                        this.addStateCSSClasses("active");
+        
+                        this._activationButtonPressed = true;
+        
+                    }
+        
+                }
+                else if (sType == "menu") {
+        
+                    if (this.isActive()) {
+        
+                        this._hideMenu();
+        
+                        this._activationButtonPressed = false;
+        
+                    }
+                    else {
+        
+                        this._showMenu(p_oEvent);
+        
+                        this._activationButtonPressed = true;
+                    
+                    }
+        
+                }
+                else {
+        
+                    this.addStateCSSClasses("active");
+        
+                    this._activationButtonPressed = true;
+                
+                }
+        
+        
+        
+                if (sType == "split" || sType == "menu") {
+
+                    me = this;
+        
+                    this._hideMenuTimerId = window.setTimeout(function () {
+                    
+                        me.on("mouseup", onMouseUp);
+                    
+                    }, 250);
+        
+                }
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseUp: function (p_oEvent) {
+        
+            var sType = this.get("type");
+        
+        
+            if (this._hideMenuTimerId) {
+        
+                window.clearTimeout(this._hideMenuTimerId);
+        
+            }
+        
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.set("checked", !(this.get("checked")));
+            
+            }
+        
+        
+            this._activationButtonPressed = false;
+            
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+            
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onFocus
+        * @description "focus" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFocus: function (p_oEvent) {
+        
+            var oElement;
+        
+            this.addStateCSSClasses("focus");
+        
+            if (this._activationKeyPressed) {
+        
+                this.addStateCSSClasses("active");
+           
+            }
+        
+            m_oFocusedButton = this;
+        
+        
+            if (!this._hasKeyEventHandlers) {
+        
+                oElement = this._button;
+        
+                Event.on(oElement, "blur", this._onBlur, null, this);
+                Event.on(oElement, "keydown", this._onKeyDown, null, this);
+                Event.on(oElement, "keyup", this._onKeyUp, null, this);
+        
+                this._hasKeyEventHandlers = true;
+        
+            }
+        
+        
+            this.fireEvent("focus", p_oEvent);
+        
+        },
+        
+        
+        /**
+        * @method _onBlur
+        * @description "blur" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onBlur: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("focus");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+
+            }    
+        
+            if (this._activationKeyPressed) {
+        
+                Event.on(document, "keyup", this._onDocumentKeyUp, null, this);
+        
+            }
+        
+        
+            m_oFocusedButton = null;
+        
+            this.fireEvent("blur", p_oEvent);
+           
+        },
+        
+        
+        /**
+        * @method _onDocumentKeyUp
+        * @description "keyup" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentKeyUp: function (p_oEvent) {
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                this._activationKeyPressed = false;
+                
+                Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oMenu = this._menu;
+        
+        
+            if (this.get("type") == "split" && 
+                this._isSplitButtonOptionKey(p_oEvent)) {
+        
+                this.fireEvent("option", p_oEvent);
+        
+            }
+            else if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                if (this.get("type") == "menu") {
+        
+                    this._showMenu(p_oEvent);
+        
+                }
+                else {
+        
+                    this._activationKeyPressed = true;
+                    
+                    this.addStateCSSClasses("active");
+                
+                }
+            
+            }
+        
+        
+            if (oMenu && oMenu.cfg.getProperty("visible") && 
+                Event.getCharCode(p_oEvent) == 27) {
+            
+                oMenu.hide();
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyUp
+        * @description "keyup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyUp: function (p_oEvent) {
+        
+            var sType;
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                sType = this.get("type");
+        
+                if (sType == "checkbox" || sType == "radio") {
+        
+                    this.set("checked", !(this.get("checked")));
+                
+                }
+        
+                this._activationKeyPressed = false;
+        
+                if (this.get("type") != "menu") {
+        
+                    this.removeStateCSSClasses("active");
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onClick
+        * @description "click" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onClick: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                sTitle,
+                oForm,
+                oSrcElement,
+                oElement,
+                nX;
+        
+        
+            switch (sType) {
+        
+            case "radio":
+            case "checkbox":
+    
+                if (this.get("checked")) {
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+                
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+                
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "submit":
+    
+                this.submitForm();
+            
+                break;
+    
+            case "reset":
+    
+                oForm = this.getForm();
+    
+                if (oForm) {
+    
+                    oForm.reset();
+                
+                }
+    
+                break;
+    
+            case "menu":
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.MENUBUTTON_MENU_VISIBLE_TITLE : 
+                                this.MENUBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "split":
+    
+                oElement = this.get("element");
+                nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+    
+                if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+    
+                    return false;
+                
+                }
+                else {
+    
+                    this._hideMenu();
+        
+                    oSrcElement = this.get("srcelement");
+        
+                    if (oSrcElement && oSrcElement.type == "submit") {
+    
+                        this.submitForm();
+                    
+                    }
+                
+                }
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.SPLITBUTTON_OPTION_VISIBLE_TITLE : 
+                                this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            /*
+                It is necessary to call "_addListenersToForm" using 
+                "setTimeout" to make sure that the button's "form" property 
+                returns a node reference.  Sometimes, if you try to get the 
+                reference immediately after appending the field, it is null.
+            */
+        
+            var me = this;
+        
+            window.setTimeout(function () {
+        
+                me._addListenersToForm();
+        
+            }, 0);
+        
+        },
+        
+        
+        /**
+        * @method _onFormReset
+        * @description "reset" event handler for the button's form.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFormReset: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                oMenu = this._menu;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.resetValue("checked");
+        
+            }
+        
+        
+            if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+                this.resetValue("selectedMenuItem");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseDown
+        * @description "mousedown" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseDown: function (p_oEvent) {
+
+            var oTarget = Event.getTarget(p_oEvent),
+                oButtonElement = this.get("element"),
+                oMenuElement = this._menu.element;
+           
+        
+            if (oTarget != oButtonElement && 
+                !Dom.isAncestor(oButtonElement, oTarget) && 
+                oTarget != oMenuElement && 
+                !Dom.isAncestor(oMenuElement, oTarget)) {
+        
+                this._hideMenu();
+        
+                Event.removeListener(document, "mousedown", 
+                    this._onDocumentMouseDown);    
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOption
+        * @description "option" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onOption: function (p_oEvent) {
+        
+            if (this.hasClass("yui-split-button-activeoption")) {
+        
+                this._hideMenu();
+        
+                this._bOptionPressed = false;
+        
+            }
+            else {
+        
+                this._showMenu(p_oEvent);    
+        
+                this._bOptionPressed = true;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayBeforeShow
+        * @description "beforeshow" event handler for the 
+        * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> instance 
+        * serving as the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onOverlayBeforeShow: function (p_sType) {
+        
+            var oMenu = this._menu;
+        
+            oMenu.render(this.get("element").parentNode);
+            
+            oMenu.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuShow
+        * @description "show" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuShow: function (p_sType) {
+        
+            Event.on(document, "mousedown", this._onDocumentMouseDown, 
+                null, this);
+        
+            var sTitle,
+                sState;
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE;
+                sState = "activeoption";
+            
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE;        
+                sState = "active";
+        
+            }
+        
+            this.addStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuHide
+        * @description "hide" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuHide: function (p_sType) {
+            
+            var oMenu = this._menu,
+                sTitle,
+                sState;
+        
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+                sState = "activeoption";
+        
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_DEFAULT_TITLE;        
+                sState = "active";
+            }
+        
+        
+            this.removeStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        
+            if (this.get("type") == "split") {
+        
+                this._bOptionPressed = false;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuKeyDown
+        * @description "keydown" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuKeyDown: function (p_sType, p_aArgs) {
+        
+            var oEvent = p_aArgs[0];
+        
+            if (Event.getCharCode(oEvent) == 27) {
+        
+                this.focus();
+        
+                if (this.get("type") == "split") {
+                
+                    this._bOptionPressed = false;
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuRender
+        * @description "render" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the  
+        * event thatwas fired.
+        */
+        _onMenuRender: function (p_sType) {
+        
+            var oButtonElement = this.get("element"),
+                oButtonParent = oButtonElement.parentNode,
+                oMenuElement = this._menu.element;
+        
+        
+            if (oButtonParent != oMenuElement.parentNode) {
+        
+                oButtonParent.appendChild(oMenuElement);
+            
+            }
+
+            this.set("selectedMenuItem", this.get("selectedMenuItem"));
+
+        },
+        
+        
+        /**
+        * @method _onMenuItemSelected
+        * @description "selectedchange" event handler for each item in the 
+        * button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {MenuItem} p_oItem Object representing the menu item that
+        * subscribed to the event.
+        */
+        _onMenuItemSelected: function (p_sType, p_aArgs, p_oItem) {
+
+            var bSelected = p_aArgs[0];
+
+            if (bSelected) {
+            
+                this.set("selectedMenuItem", p_oItem);
+
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuItemAdded
+        * @description "itemadded" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event
+        * was fired.
+        * @param {<a href="YAHOO.widget.MenuItem.html">
+        * YAHOO.widget.MenuItem</a>} p_oItem Object representing the menu 
+        * item that subscribed to the event.
+        */
+        _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) {
+            
+            var oItem = p_aArgs[0];
+        
+            oItem.cfg.subscribeToConfigEvent("selected", 
+                this._onMenuItemSelected, oItem, this);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuClick
+        * @description "click" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuClick: function (p_sType, p_aArgs) {
+
+            var oItem = p_aArgs[1],
+                oSrcElement;
+        
+            if (oItem) {
+        
+                oSrcElement = this.get("srcelement");
+            
+                if (oSrcElement && oSrcElement.type == "submit") {
+        
+                    this.submitForm();
+            
+                }
+            
+                this._hideMenu();
+            
+            }
+        
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method createButtonElement
+        * @description Creates the button's HTML elements.
+        * @param {String} p_sType String indicating the type of element 
+        * to create.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>}
+        */
+        createButtonElement: function (p_sType) {
+        
+            var sNodeName = this.NODE_NAME,
+                oElement = document.createElement(sNodeName);
+        
+            oElement.innerHTML =  "<" + sNodeName + " class=\"first-child\">" + 
+                (p_sType == "link" ? "<a></a>" : 
+                "<button type=\"button\"></button>") + "</" + sNodeName + ">";
+        
+            return oElement;
+        
+        },
+
+        
+        /**
+        * @method addStateCSSClasses
+        * @description Appends state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        addStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                if (p_sState != "activeoption") {
+        
+                    this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+        
+                }
+        
+                this.addClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeStateCSSClasses
+        * @description Removes state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        removeStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+                this.removeClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method createHiddenFields
+        * @description Creates the button's hidden form field and appends it 
+        * to its parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        createHiddenFields: function () {
+        
+            this.removeHiddenFields();
+        
+            var oForm = this.getForm(),
+                oButtonField,
+                sType,     
+                bCheckable,
+                oMenu,
+                oMenuItem,
+                sName,
+                oValue,
+                oMenuField;
+        
+        
+            if (oForm && !this.get("disabled")) {
+        
+                sType = this.get("type");
+                bCheckable = (sType == "checkbox" || sType == "radio");
+        
+        
+                if (bCheckable || (m_oSubmitTrigger == this)) {
+                
+                    this.logger.log("Creating hidden field.");
+        
+                    oButtonField = createInputElement(
+                                    (bCheckable ? sType : "hidden"),
+                                    this.get("name"),
+                                    this.get("value"),
+                                    this.get("checked"));
+            
+            
+                    if (oButtonField) {
+            
+                        if (bCheckable) {
+            
+                            oButtonField.style.display = "none";
+            
+                        }
+            
+                        oForm.appendChild(oButtonField);
+            
+                    }
+        
+                }
+                    
+        
+                oMenu = this._menu;
+            
+            
+                if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+                    this.logger.log("Creating hidden field for menu.");
+        
+                    oMenuField = oMenu.srcElement;
+                    oMenuItem = this.get("selectedMenuItem");
+
+                    if (oMenuItem) {
+
+                        if (oMenuField && 
+                            oMenuField.nodeName.toUpperCase() == "SELECT") {
+            
+                            oForm.appendChild(oMenuField);
+                            oMenuField.selectedIndex = oMenuItem.index;
+            
+                        }
+                        else {
+            
+                            oValue = (oMenuItem.value === null || 
+                                        oMenuItem.value === "") ? 
+                                        oMenuItem.cfg.getProperty("text") : 
+                                        oMenuItem.value;
+            
+                            sName = this.get("name");
+            
+                            if (oValue && sName) {
+            
+                                oMenuField = createInputElement("hidden", 
+                                                    (sName + "_options"),
+                                                    oValue);
+            
+                                oForm.appendChild(oMenuField);
+            
+                            }
+            
+                        }  
+                    
+                    }
+        
+                }
+            
+            
+                if (oButtonField && oMenuField) {
+        
+                    this._hiddenFields = [oButtonField, oMenuField];
+        
+                }
+                else if (!oButtonField && oMenuField) {
+        
+                    this._hiddenFields = oMenuField;
+                
+                }
+                else if (oButtonField && !oMenuField) {
+        
+                    this._hiddenFields = oButtonField;
+                
+                }
+        
+        
+                return this._hiddenFields;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeHiddenFields
+        * @description Removes the button's hidden form field(s) from its 
+        * parent form.
+        */
+        removeHiddenFields: function () {
+        
+            var oField = this._hiddenFields,
+                nFields,
+                i;
+        
+            function removeChild(p_oElement) {
+        
+                if (Dom.inDocument(p_oElement)) {
+        
+                    p_oElement.parentNode.removeChild(p_oElement);
+                
+                }
+                
+            }
+            
+        
+            if (oField) {
+        
+                if (Lang.isArray(oField)) {
+        
+                    nFields = oField.length;
+                    
+                    if (nFields > 0) {
+                    
+                        i = nFields - 1;
+                        
+                        do {
+        
+                            removeChild(oField[i]);
+        
+                        }
+                        while (i--);
+                    
+                    }
+                
+                }
+                else {
+        
+                    removeChild(oField);
+        
+                }
+        
+                this._hiddenFields = null;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method submitForm
+        * @description Submits the form to which the button belongs.  Returns  
+        * true if the form was submitted successfully, false if the submission 
+        * was cancelled.
+        * @protected
+        * @return {Boolean}
+        */
+        submitForm: function () {
+        
+            var oForm = this.getForm(),
+        
+                oSrcElement = this.get("srcelement"),
+        
+                /*
+                    Boolean indicating if the event fired successfully 
+                    (was not cancelled by any handlers)
+                */
+        
+                bSubmitForm = false,
+                
+                oEvent;
+        
+        
+            if (oForm) {
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+        
+                    m_oSubmitTrigger = this;
+                    
+                }
+        
+        
+                if (YAHOO.env.ua.ie) {
+        
+                    bSubmitForm = oForm.fireEvent("onsubmit");
+        
+                }
+                else {  // Gecko, Opera, and Safari
+        
+                    oEvent = document.createEvent("HTMLEvents");
+                    oEvent.initEvent("submit", true, true);
+        
+                    bSubmitForm = oForm.dispatchEvent(oEvent);
+        
+                }
+        
+        
+                /*
+                    In IE and Safari, dispatching a "submit" event to a form 
+                    WILL cause the form's "submit" event to fire, but WILL NOT 
+                    submit the form.  Therefore, we need to call the "submit" 
+                    method as well.
+                */
+              
+                if ((YAHOO.env.ua.ie || YAHOO.env.ua.webkit) && bSubmitForm) {
+        
+                    oForm.submit();
+                
+                }
+            
+            }
+        
+            return bSubmitForm;
+            
+        },
+        
+        
+        /**
+        * @method init
+        * @description The Button class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+        * be used to create the button.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://
+        * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR
+        * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296">
+        * HTMLElement</a>} p_oElement Object reference for the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+        * used to create the button.
+        * @param {Object} p_oElement Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a 
+        * set of configuration attributes used to create the button.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            var sNodeName = p_oAttributes.type == "link" ? "a" : "button",
+                oSrcElement = p_oAttributes.srcelement,
+                oButton = p_oElement.getElementsByTagName(sNodeName)[0],
+                oInput;
+        
+
+            if (!oButton) {
+
+                oInput = p_oElement.getElementsByTagName("input")[0];
+
+
+                if (oInput) {
+
+                    oButton = document.createElement("button");
+                    oButton.setAttribute("type", "button");
+
+                    oInput.parentNode.replaceChild(oButton, oInput);
+                
+                }
+
+            }
+
+            this._button = oButton;
+        
+
+            YAHOO.widget.Button.superclass.init.call(this, p_oElement, 
+                p_oAttributes);
+        
+        
+            m_oButtons[this.get("id")] = this;
+        
+        
+            this.addClass(this.CSS_CLASS_NAME);
+            
+            this.addClass("yui-" + this.get("type") + "-button");
+        
+            Event.on(this._button, "focus", this._onFocus, null, this);
+            this.on("mouseover", this._onMouseOver);
+            this.on("click", this._onClick);
+            this.on("appendTo", this._onAppendTo);
+            
+        
+            var oContainer = this.get("container"),
+                oElement = this.get("element"),
+                bElInDoc = Dom.inDocument(oElement),
+                oParentNode;
+
+
+            if (oContainer) {
+        
+                if (oSrcElement && oSrcElement != oElement) {
+                
+                    oParentNode = oSrcElement.parentNode;
+
+                    if (oParentNode) {
+                    
+                        oParentNode.removeChild(oSrcElement);
+                    
+                    }
+
+                }
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+            else if (!bElInDoc && oSrcElement && oSrcElement != oElement) {
+
+                oParentNode = oSrcElement.parentNode;
+        
+                if (oParentNode) {
+        
+                    this.fireEvent("beforeAppendTo", {
+                        type: "beforeAppendTo",
+                        target: oParentNode
+                    });
+            
+                    oParentNode.replaceChild(oElement, oSrcElement);
+            
+                    this.fireEvent("appendTo", {
+                        type: "appendTo",
+                        target: oParentNode
+                    });
+                
+                }
+        
+            }
+            else if (this.get("type") != "link" && bElInDoc && oSrcElement && 
+                oSrcElement == oElement) {
+        
+                this._addListenersToForm();
+        
+            }
+        
+            this.logger.log("Initialization completed.");
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.Button.superclass.initAttributes.call(this, 
+                oAttributes);
+        
+        
+            /**
+            * @attribute type
+            * @description String specifying the button's type.  Possible 
+            * values are: "push," "link," "submit," "reset," "checkbox," 
+            * "radio," "menu," and "split."
+            * @default "push"
+            * @type String
+            */
+            this.setAttributeConfig("type", {
+        
+                value: (oAttributes.type || "push"),
+                validator: Lang.isString,
+                writeOnce: true,
+                method: this._setType
+        
+            });
+        
+        
+            /**
+            * @attribute label
+            * @description String specifying the button's text label 
+            * or innerHTML.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("label", {
+        
+                value: oAttributes.label,
+                validator: Lang.isString,
+                method: this._setLabel
+        
+            });
+        
+        
+            /**
+            * @attribute value
+            * @description Object specifying the value for the button.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @attribute name
+            * @description String specifying the name for the button.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @attribute tabindex
+            * @description Number specifying the tabindex for the button.
+            * @default null
+            * @type Number
+            */
+            this.setAttributeConfig("tabindex", {
+        
+                value: oAttributes.tabindex,
+                validator: Lang.isNumber,
+                method: this._setTabIndex
+        
+            });
+        
+        
+            /**
+            * @attribute title
+            * @description String specifying the title for the button.
+            * @default null
+            * @type String
+            */
+            this.configureAttribute("title", {
+        
+                value: oAttributes.title,
+                validator: Lang.isString,
+                method: this._setTitle
+        
+            });
+        
+        
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the button should be disabled.  
+            * (Disabled buttons are dimmed and will not respond to user input 
+            * or fire events.  Does not apply to button's of type "link.")
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @attribute href
+            * @description String specifying the href for the button.  Applies
+            * only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("href", {
+        
+                value: oAttributes.href,
+                validator: Lang.isString,
+                method: this._setHref
+        
+            });
+        
+        
+            /**
+            * @attribute target
+            * @description String specifying the target for the button.  
+            * Applies only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("target", {
+        
+                value: oAttributes.target,
+                validator: Lang.isString,
+                method: this._setTarget
+        
+            });
+        
+        
+            /**
+            * @attribute checked
+            * @description Boolean indicating if the button is checked. 
+            * Applies only to buttons of type "radio" and "checkbox."
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("checked", {
+        
+                value: (oAttributes.checked || false),
+                validator: Lang.isBoolean,
+                method: this._setChecked
+        
+            });
+        
+        
+            /**
+            * @attribute container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button's markup should be 
+            * rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute srcelement
+            * @description Object reference to the HTML element (either 
+            * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code>) 
+            * used to create the button.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("srcelement", {
+        
+                value: oAttributes.srcelement,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute menu
+            * @description Object specifying the menu for the button.  
+            * The value can be one of the following:
+            * <ul>
+            * <li>Object specifying a <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> instance.</li>
+            * <li>Object specifying a <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instance.</li>
+            * <li>String specifying the id attribute of the <code>&#60;div&#62;
+            * </code> element used to create the menu.  By default the menu 
+            * will be created as an instance of 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>.  
+            * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME">
+            * default CSS class name for YAHOO.widget.Menu</a> is applied to 
+            * the <code>&#60;div&#62;</code> element, it will be created as an
+            * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu
+            * </a>.</li><li>String specifying the id attribute of the 
+            * <code>&#60;select&#62;</code> element used to create the menu.
+            * </li><li>Object specifying the <code>&#60;div&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Object specifying the <code>&#60;select&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Array of object literals, each representing a set of 
+            * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> 
+            * configuration attributes.</li>
+            * <li>Array of strings representing the text labels for each menu 
+            * item in the menu.</li>
+            * </ul>
+            * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a 
+            * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a 
+            * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+            * one-html.html#ID-58190037">HTMLElement</a>|String|Array
+            * @default null
+            */
+            this.setAttributeConfig("menu", {
+        
+                value: null,
+                method: this._setMenu,
+                writeOnce: true
+            
+            });
+        
+        
+            /**
+            * @attribute lazyloadmenu
+            * @description Boolean indicating the value to set for the 
+            * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a>
+            * configuration property of the button's menu.  Setting 
+            * "lazyloadmenu" to <code>true </code> will defer rendering of 
+            * the button's menu until the first time it is made visible.  
+            * If "lazyloadmenu" is set to <code>false</code>, the button's 
+            * menu will be rendered immediately if the button is in the 
+            * document, or in response to the button's "appendTo" event if 
+            * the button is not yet in the document.  In either case, the 
+            * menu is rendered into the button's parent HTML element.  
+            * <em>This attribute does not apply if a 
+            * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> 
+            * instance is passed as the value of the button's "menu" 
+            * configuration attribute. <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instances should be rendered before 
+            * being set as the value for the "menu" configuration 
+            * attribute.</em>
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig("lazyloadmenu", {
+        
+                value: (oAttributes.lazyloadmenu === false ? false : true),
+                validator: Lang.isBoolean,
+                writeOnce: true
+        
+            });
+
+
+            /**
+            * @attribute menuclassname
+            * @description String representing the CSS class name to be 
+            * applied to the root element of the button's menu.
+            * @type String
+            * @default "yui-button-menu"
+            */
+            this.setAttributeConfig("menuclassname", {
+        
+                value: (oAttributes.menuclassname || "yui-button-menu"),
+                validator: Lang.isString,
+                method: this._setMenuClassName,
+                writeOnce: true
+        
+            });        
+
+
+            /**
+            * @attribute selectedMenuItem
+            * @description Object representing the item in the button's menu 
+            * that is currently selected.
+            * @type Number
+            * @default null
+            */
+            this.setAttributeConfig("selectedMenuItem", {
+        
+                value: null,
+                method: this._setSelectedMenuItem
+        
+            });
+        
+        
+            /**
+            * @attribute onclick
+            * @description Object literal representing the code to be executed  
+            * when the button is clicked.  Format:<br> <code> {<br> 
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An object to pass back to the handler.<br> 
+            * <strong>scope:</strong> Object &#47;&#47;  The object to use 
+            * for the scope of the handler.<br> } </code>
+            * @type Object
+            * @default null
+            */
+            this.setAttributeConfig("onclick", {
+        
+                value: oAttributes.onclick,
+                method: this._setOnClick
+            
+            });
+
+
+            /**
+            * @attribute focusmenu
+            * @description Boolean indicating whether or not the button's menu 
+            * should be focused when it is made visible.
+            * @type Boolean
+            * @default true
+            */
+            this.setAttributeConfig("focusmenu", {
+        
+                value: (oAttributes.focusmenu === false ? false : true),
+                validator: Lang.isBoolean
+        
+            });
+
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Causes the button to receive the focus and fires the 
+        * button's "focus" event.
+        */
+        focus: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method blur
+        * @description Causes the button to lose focus and fires the button's
+        * "blur" event.
+        */
+        blur: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.blur();
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method hasFocus
+        * @description Returns a boolean indicating whether or not the button 
+        * has focus.
+        * @return {Boolean}
+        */
+        hasFocus: function () {
+        
+            return (m_oFocusedButton == this);
+        
+        },
+        
+        
+        /**
+        * @method isActive
+        * @description Returns a boolean indicating whether or not the button 
+        * is active.
+        * @return {Boolean}
+        */
+        isActive: function () {
+        
+            return this.hasClass(this.CSS_CLASS_NAME + "-active");
+        
+        },
+        
+        
+        /**
+        * @method getMenu
+        * @description Returns a reference to the button's menu.
+        * @return {<a href="YAHOO.widget.Overlay.html">
+        * YAHOO.widget.Overlay</a>|<a 
+        * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        getMenu: function () {
+        
+            return this._menu;
+        
+        },
+        
+        
+        /**
+        * @method getForm
+        * @description Returns a reference to the button's parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-
+        * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>}
+        */
+        getForm: function () {
+        
+            return this._button.form;
+        
+        },
+        
+        
+        /** 
+        * @method getHiddenFields
+        * @description Returns an <code>&#60;input&#62;</code> element or 
+        * array of form elements used to represent the button when its parent 
+        * form is submitted.  
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        getHiddenFields: function () {
+        
+            return this._hiddenFields;
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button's element from its parent element and 
+        * removes all event handlers.
+        */
+        destroy: function () {
+        
+            this.logger.log("Destroying ...");
+        
+            var oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                oMenu = this._menu,
+                aButtons;
+        
+            if (oMenu) {
+        
+                this.logger.log("Destroying menu.");
+
+                if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) {
+
+                    m_oOverlayManager.remove(oMenu);
+
+                }
+        
+                oMenu.destroy();
+        
+            }
+        
+            this.logger.log("Removing DOM event listeners.");
+        
+            Event.purgeElement(oElement);
+            Event.purgeElement(this._button);
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+            Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            Event.removeListener(document, "mousedown", 
+                this._onDocumentMouseDown);
+        
+        
+            var oForm = this.getForm();
+            
+            if (oForm) {
+        
+                Event.removeListener(oForm, "reset", this._onFormReset);
+                Event.removeListener(oForm, "submit", this.createHiddenFields);
+        
+            }
+
+            this.logger.log("Removing CustomEvent listeners.");
+
+            this.unsubscribeAll();
+
+            if (oParentNode) {
+
+                oParentNode.removeChild(oElement);
+            
+            }
+        
+            this.logger.log("Removing from document.");
+        
+            delete m_oButtons[this.get("id")];
+
+            aButtons = Dom.getElementsByClassName(this.CSS_CLASS_NAME, 
+                                this.NODE_NAME, oForm); 
+
+            if (Lang.isArray(aButtons) && aButtons.length === 0) {
+
+                Event.removeListener(oForm, "keypress", 
+                        YAHOO.widget.Button.onFormKeyPress);
+
+            }
+
+            this.logger.log("Destroyed.");
+        
+        },
+        
+        
+        fireEvent: function (p_sType , p_aArgs) {
+        
+                       var sType = arguments[0];
+               
+                       //  Disabled buttons should not respond to DOM events
+               
+                       if (this.DOM_EVENTS[sType] && this.get("disabled")) {
+               
+                               return;
+               
+                       }
+               
+                       return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("Button " + this.get("id"));
+        
+        }
+    
+    });
+    
+    
+    /**
+    * @method YAHOO.widget.Button.onFormKeyPress
+    * @description "keypress" event handler for the button's form.
+    * @param {Event} p_oEvent Object representing the DOM event object passed 
+    * back by the event utility (YAHOO.util.Event).
+    */
+    YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) {
+    
+        var oTarget = Event.getTarget(p_oEvent),
+            nCharCode = Event.getCharCode(p_oEvent),
+            sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(),
+            sType = oTarget.type,
+    
+            /*
+                Boolean indicating if the form contains any enabled or 
+                disabled YUI submit buttons
+            */
+    
+            bFormContainsYUIButtons = false,
+    
+            oButton,
+    
+            oYUISubmitButton,   // The form's first, enabled YUI submit button
+    
+            /*
+                 The form's first, enabled HTML submit button that precedes any 
+                 YUI submit button
+            */
+    
+            oPrecedingSubmitButton,
+            
+    
+            /*
+                 The form's first, enabled HTML submit button that follows a 
+                 YUI button
+            */
+            
+            oFollowingSubmitButton; 
+    
+    
+        function isSubmitButton(p_oElement) {
+    
+            var sId,
+                oSrcElement;
+    
+            switch (p_oElement.nodeName.toUpperCase()) {
+    
+            case "INPUT":
+            case "BUTTON":
+            
+                if (p_oElement.type == "submit" && !p_oElement.disabled) {
+                    
+                    if (!bFormContainsYUIButtons && 
+                        !oPrecedingSubmitButton) {
+
+                        oPrecedingSubmitButton = p_oElement;
+
+                    }
+                    
+                    if (oYUISubmitButton && !oFollowingSubmitButton) {
+                    
+                        oFollowingSubmitButton = p_oElement;
+                    
+                    }
+                
+                }
+
+                break;
+            
+
+            default:
+            
+                sId = p_oElement.id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+
+                        bFormContainsYUIButtons = true;
+        
+                        if (!oButton.get("disabled")) {
+
+                            oSrcElement = oButton.get("srcelement");
+    
+                            if (!oYUISubmitButton &&
+                                (oButton.get("type") == "submit" || 
+                                (oSrcElement && oSrcElement.type == "submit"))) 
+                            {
+
+                                oYUISubmitButton = oButton;
+                            
+                            }
+                        
+                        }
+                        
+                    }
+                
+                }
+
+                break;
+    
+            }
+    
+        }
+    
+    
+        if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || 
+            sType == "password" || sType == "checkbox" || sType == "radio" || 
+            sType == "file")) || sNodeName == "SELECT"))
+        {
+    
+            Dom.getElementsBy(isSubmitButton, "*", this);
+    
+    
+            if (oPrecedingSubmitButton) {
+    
+                /*
+                     Need to set focus to the first enabled submit button
+                     to make sure that IE includes its name and value 
+                     in the form's data set.
+                */
+    
+                oPrecedingSubmitButton.focus();
+            
+            }
+            else if (!oPrecedingSubmitButton && oYUISubmitButton) {
+    
+                if (oFollowingSubmitButton) {
+    
+                    /*
+                        Need to call "preventDefault" to ensure that 
+                        the name and value of the regular submit button 
+                        following the YUI button doesn't get added to the 
+                        form's data set when it is submitted.
+                    */
+    
+                    Event.preventDefault(p_oEvent);
+                
+                }
+    
+                oYUISubmitButton.submitForm();
+    
+            }
+            
+        }
+    
+    };
+    
+    
+    /**
+    * @method YAHOO.widget.Button.addHiddenFieldsToForm
+    * @description Searches the specified form and adds hidden fields for  
+    * instances of YAHOO.widget.Button that are of type "radio," "checkbox," 
+    * "menu," and "split."
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference 
+    * for the form to search.
+    */
+    YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) {
+    
+        var aButtons = Dom.getElementsByClassName(
+                            YAHOO.widget.Button.prototype.CSS_CLASS_NAME, 
+                            "*", 
+                            p_oForm),
+    
+            nButtons = aButtons.length,
+            oButton,
+            sId,
+            i;
+    
+        if (nButtons > 0) {
+    
+            YAHOO.log("Form contains " + nButtons + " YUI buttons.");
+    
+            for (i = 0; i < nButtons; i++) {
+    
+                sId = aButtons[i].id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+           
+                        oButton.createHiddenFields();
+                        
+                    }
+                
+                }
+            
+            }
+    
+        }
+    
+    };
+    
+
+    /**
+    * @method YAHOO.widget.Button.getButton
+    * @description Returns a button with the specified id.
+    * @param {String} p_sId String specifying the id of the root node of the 
+    * HTML element representing the button to be retrieved.
+    * @return {YAHOO.widget.Button}
+    */
+    YAHOO.widget.Button.getButton = function (p_sId) {
+
+        var oButton = m_oButtons[p_sId];
+
+        if (oButton) {
+        
+            return oButton;
+        
+        }
+
+    };
+    
+    
+    // Events
+    
+    
+    /**
+    * @event focus
+    * @description Fires when the menu item receives focus.  Passes back a  
+    * single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event blur
+    * @description Fires when the menu item loses the input focus.  Passes back  
+    * a single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for  
+    * more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event option
+    * @description Fires when the user invokes the button's option.  Passes 
+    * back a single object representing the original DOM event (either 
+    * "mousedown" or "keydown") that caused the "option" event to fire.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+
+})();
+(function () {
+
+    // Shorthard for utilities
+    
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Button = YAHOO.widget.Button,  
+    
+        // Private collection of radio buttons
+    
+        m_oButtons = {};
+
+
+
+    /**
+    * The ButtonGroup class creates a set of buttons that are mutually 
+    * exclusive; checking one button in the set will uncheck all others in the 
+    * button group.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;div&#62;</code> element of the button group.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+    * specifying the <code>&#60;div&#62;</code> element of the button group.
+    * @param {Object} p_oElement Object literal specifying a set of 
+    * configuration attributes used to create the button group.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set 
+    * of configuration attributes used to create the button group.
+    * @namespace YAHOO.widget
+    * @class ButtonGroup
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+    YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor,
+            sNodeName,
+            oElement,
+            sId;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                sId = Dom.generateId();
+    
+                p_oElement.id = sId;
+    
+                YAHOO.log("No value specified for the button group's \"id\"" +
+                    " attribute. Setting button group id to \"" + sId + "\".",
+                    "warn");
+    
+            }
+    
+            this.logger = new YAHOO.widget.LogWriter("ButtonGroup " + sId);
+    
+            this.logger.log("No source HTML element.  Building the button " +
+                    "group using the set of configuration attributes.");
+    
+            fnSuperClass.call(this, (this._createGroupElement()), p_oElement);
+    
+        }
+        else if (Lang.isString(p_oElement)) {
+    
+            oElement = Dom.get(p_oElement);
+    
+            if (oElement) {
+            
+                if (oElement.nodeName.toUpperCase() == this.NODE_NAME) {
+    
+                    this.logger = 
+                        new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement);
+            
+                    fnSuperClass.call(this, oElement, p_oAttributes);
+    
+                }
+    
+            }
+        
+        }
+        else {
+    
+            sNodeName = p_oElement.nodeName.toUpperCase();
+    
+            if (sNodeName && sNodeName == this.NODE_NAME) {
+        
+                if (!p_oElement.id) {
+        
+                    p_oElement.id = Dom.generateId();
+        
+                    YAHOO.log("No value specified for the button group's" +
+                        " \"id\" attribute. Setting button group id " +
+                        "to \"" + p_oElement.id + "\".", "warn");
+        
+                }
+        
+                this.logger = 
+                    new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement.id);
+        
+                fnSuperClass.call(this, p_oElement, p_oAttributes);
+    
+            }
+    
+        }
+    
+    };
+    
+    
+    YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _buttons
+        * @description Array of buttons in the button group.
+        * @default null
+        * @protected
+        * @type Array
+        */
+        _buttons: null,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the tag to be used for the button 
+        * group's element. 
+        * @default "DIV"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "DIV",
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied  
+        * to the button group's element.
+        * @default "yui-buttongroup"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-buttongroup",
+    
+    
+    
+        // Protected methods
+        
+        
+        /**
+        * @method _createGroupElement
+        * @description Creates the button group's element.
+        * @protected
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>}
+        */
+        _createGroupElement: function () {
+        
+            var oElement = document.createElement(this.NODE_NAME);
+        
+            return oElement;
+        
+        },
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button groups's 
+        * "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for
+        * the button group's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            var nButtons = this.getCount(),
+                i;
+        
+            if (nButtons > 0) {
+        
+                i = nButtons - 1;
+                
+                do {
+        
+                    this._buttons[i].set("disabled", p_bDisabled);
+                
+                }
+                while (i--);
+        
+            }
+        
+        },
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                nCharCode = Event.getCharCode(p_oEvent),
+                sId = oTarget.parentNode.parentNode.id,
+                oButton = m_oButtons[sId],
+                nIndex = -1;
+        
+        
+            if (nCharCode == 37 || nCharCode == 38) {
+        
+                nIndex = (oButton.index === 0) ? 
+                            (this._buttons.length - 1) : (oButton.index - 1);
+            
+            }
+            else if (nCharCode == 39 || nCharCode == 40) {
+        
+                nIndex = (oButton.index === (this._buttons.length - 1)) ? 
+                            0 : (oButton.index + 1);
+        
+            }
+        
+        
+            if (nIndex > -1) {
+        
+                this.check(nIndex);
+                this.getButton(nIndex).focus();
+            
+            }        
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            var aButtons = this._buttons,
+                nButtons = aButtons.length,
+                i;
+        
+            for (i = 0; i < nButtons; i++) {
+        
+                aButtons[i].appendTo(this.get("element"));
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onButtonCheckedChange
+        * @description "checkedChange" event handler for each button in the 
+        * button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object representing the button that fired the event.
+        */
+        _onButtonCheckedChange: function (p_oEvent, p_oButton) {
+        
+            var bChecked = p_oEvent.newValue,
+                oCheckedButton = this.get("checkedButton");
+        
+            if (bChecked && oCheckedButton != p_oButton) {
+        
+                if (oCheckedButton) {
+        
+                    oCheckedButton.set("checked", false, true);
+        
+                }
+        
+                this.set("checkedButton", p_oButton);
+                this.set("value", p_oButton.get("value"));
+        
+            }
+            else if (oCheckedButton && !oCheckedButton.set("checked")) {
+        
+                oCheckedButton.set("checked", true, true);
+        
+            }
+           
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method init
+        * @description The ButtonGroup class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;div&#62;</code> element of the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+        * specifying the <code>&#60;div&#62;</code> element of the button group.
+        * @param {Object} p_oElement Object literal specifying a set of  
+        * configuration attributes used to create the button group.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a
+        * set of configuration attributes used to create the button group.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            this._buttons = [];
+        
+            YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, 
+                    p_oAttributes);
+        
+            this.addClass(this.CSS_CLASS_NAME);
+        
+            this.logger.log("Searching for child nodes with the class name " +
+                "\"yui-radio-button\" to add to the button group.");
+        
+            var aButtons = this.getElementsByClassName("yui-radio-button");
+        
+        
+            if (aButtons.length > 0) {
+        
+                this.logger.log("Found " + aButtons.length + 
+                    " child nodes with the class name \"yui-radio-button.\"" + 
+                    "  Attempting to add to button group.");
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+        
+            this.logger.log("Searching for child nodes with the type of " +
+                " \"radio\" to add to the button group.");
+        
+            function isRadioButton(p_oElement) {
+        
+                return (p_oElement.type == "radio");
+        
+            }
+        
+            aButtons = 
+                Dom.getElementsBy(isRadioButton, "input", this.get("element"));
+        
+        
+            if (aButtons.length > 0) {
+        
+                this.logger.log("Found " + aButtons.length + " child nodes" +
+                    " with the type of \"radio.\"  Attempting to add to" +
+                    " button group.");
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+            this.on("keydown", this._onKeyDown);
+            this.on("appendTo", this._onAppendTo);
+        
+
+            var oContainer = this.get("container");
+
+            if (oContainer) {
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);            
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+        
+        
+            this.logger.log("Initialization completed.");
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button group.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button group.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.ButtonGroup.superclass.initAttributes.call(
+                this, oAttributes);
+        
+        
+            /**
+            * @attribute name
+            * @description String specifying the name for the button group.  
+            * This name will be applied to each button in the button group.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the button group should be 
+            * disabled.  Disabling the button group will disable each button 
+            * in the button group.  Disabled buttons are dimmed and will not 
+            * respond to user input or fire events.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @attribute value
+            * @description Object specifying the value for the button group.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @attribute container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button group's markup
+            * should be rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute checkedButton
+            * @description Reference for the button in the button group that 
+            * is checked.
+            * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+            * @default null
+            */
+            this.setAttributeConfig("checkedButton", {
+        
+                value: null
+        
+            });
+        
+        },
+        
+        
+        /**
+        * @method addButton
+        * @description Adds the button to the button group.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object reference for the <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instance to be added to the button group.
+        * @param {String} p_oButton String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+        * ID-33759296">HTMLElement</a>} p_oButton Object reference for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {Object} p_oButton Object literal specifying a set of 
+        * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> 
+        * configuration attributes used to configure the button to be added to 
+        * the button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} 
+        */
+        addButton: function (p_oButton) {
+        
+            var oButton,
+                oButtonElement,
+                oGroupElement,
+                nIndex,
+                sButtonName,
+                sGroupName;
+        
+        
+            if (p_oButton instanceof Button && 
+                p_oButton.get("type") == "radio") {
+        
+                oButton = p_oButton;
+        
+            }
+            else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) {
+        
+                p_oButton.type = "radio";
+        
+                oButton = new Button(p_oButton);
+
+            }
+            else {
+        
+                oButton = new Button(p_oButton, { type: "radio" });
+        
+            }
+        
+        
+            if (oButton) {
+        
+                nIndex = this._buttons.length;
+                sButtonName = oButton.get("name");
+                sGroupName = this.get("name");
+        
+                oButton.index = nIndex;
+        
+                this._buttons[nIndex] = oButton;
+                m_oButtons[oButton.get("id")] = oButton;
+        
+        
+                if (sButtonName != sGroupName) {
+        
+                    oButton.set("name", sGroupName);
+                
+                }
+        
+        
+                if (this.get("disabled")) {
+        
+                    oButton.set("disabled", true);
+        
+                }
+        
+        
+                if (oButton.get("checked")) {
+        
+                    this.set("checkedButton", oButton);
+        
+                }
+
+                
+                oButtonElement = oButton.get("element");
+                oGroupElement = this.get("element");
+                
+                if (oButtonElement.parentNode != oGroupElement) {
+                
+                    oGroupElement.appendChild(oButtonElement);
+                
+                }
+        
+                
+                oButton.on("checkedChange", 
+                    this._onButtonCheckedChange, oButton, this);
+        
+                this.logger.log("Button " + oButton.get("id") + " added.");
+        
+                return oButton;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method addButtons
+        * @description Adds the array of buttons to the button group.
+        * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instances to be added 
+        * to the button group.
+        * @param {Array} p_aButtons Array of strings specifying the id 
+        * attribute of the <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+        * </code> elements to be used to create the buttons to be added to the 
+        * button group.
+        * @param {Array} p_aButtons Array of object references for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> elements 
+        * to be used to create the buttons to be added to the button group.
+        * @param {Array} p_aButtons Array of object literals, each containing
+        * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>  
+        * configuration attributes used to configure each button to be added 
+        * to the button group.
+        * @return {Array}
+        */
+        addButtons: function (p_aButtons) {
+    
+            var nButtons,
+                oButton,
+                aButtons,
+                i;
+        
+            if (Lang.isArray(p_aButtons)) {
+            
+                nButtons = p_aButtons.length;
+                aButtons = [];
+        
+                if (nButtons > 0) {
+        
+                    for (i = 0; i < nButtons; i++) {
+        
+                        oButton = this.addButton(p_aButtons[i]);
+                        
+                        if (oButton) {
+        
+                            aButtons[aButtons.length] = oButton;
+        
+                        }
+                    
+                    }
+        
+                    if (aButtons.length > 0) {
+        
+                        this.logger.log(aButtons.length + " buttons added.");
+        
+                        return aButtons;
+        
+                    }
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeButton
+        * @description Removes the button at the specified index from the 
+        * button group.
+        * @param {Number} p_nIndex Number specifying the index of the button 
+        * to be removed from the button group.
+        */
+        removeButton: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex),
+                nButtons,
+                i;
+            
+            if (oButton) {
+        
+                this.logger.log("Removing button " + oButton.get("id") + ".");
+        
+                this._buttons.splice(p_nIndex, 1);
+                delete m_oButtons[oButton.get("id")];
+        
+                oButton.removeListener("checkedChange", 
+                    this._onButtonCheckedChange);
+
+                oButton.destroy();
+        
+        
+                nButtons = this._buttons.length;
+                
+                if (nButtons > 0) {
+        
+                    i = this._buttons.length - 1;
+                    
+                    do {
+        
+                        this._buttons[i].index = i;
+        
+                    }
+                    while (i--);
+                
+                }
+        
+                this.logger.log("Button " + oButton.get("id") + " removed.");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButton
+        * @description Returns the button at the specified index.
+        * @param {Number} p_nIndex The index of the button to retrieve from the 
+        * button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButton: function (p_nIndex) {
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                return this._buttons[p_nIndex];
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButtons
+        * @description Returns an array of the buttons in the button group.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            return this._buttons;
+        
+        },
+        
+        
+        /**
+        * @method getCount
+        * @description Returns the number of buttons in the button group.
+        * @return {Number}
+        */
+        getCount: function () {
+        
+            return this._buttons.length;
+        
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Sets focus to the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to focus. 
+        */
+        focus: function (p_nIndex) {
+        
+            var oButton,
+                nButtons,
+                i;
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                oButton = this._buttons[p_nIndex];
+                
+                if (oButton) {
+        
+                    oButton.focus();
+        
+                }
+            
+            }
+            else {
+        
+                nButtons = this.getCount();
+        
+                for (i = 0; i < nButtons; i++) {
+        
+                    oButton = this._buttons[i];
+        
+                    if (!oButton.get("disabled")) {
+        
+                        oButton.focus();
+                        break;
+        
+                    }
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method check
+        * @description Checks the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to check. 
+        */
+        check: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex);
+            
+            if (oButton) {
+        
+                oButton.set("checked", true);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button group's element from its parent 
+        * element and removes all event handlers.
+        */
+        destroy: function () {
+        
+            this.logger.log("Destroying...");
+        
+            var nButtons = this._buttons.length,
+                oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                i;
+            
+            if (nButtons > 0) {
+        
+                i = this._buttons.length - 1;
+        
+                do {
+        
+                    this._buttons[i].destroy();
+        
+                }
+                while (i--);
+            
+            }
+        
+            this.logger.log("Removing DOM event handlers.");
+        
+            Event.purgeElement(oElement);
+            
+            this.logger.log("Removing from document.");
+        
+            oParentNode.removeChild(oElement);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button group.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("ButtonGroup " + this.get("id"));
+        
+        }
+    
+    });
+
+})();
+YAHOO.register("button", YAHOO.widget.Button, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/button/button-min.js b/lib/yui/button/button-min.js
new file mode 100644 (file)
index 0000000..e1d1b6d
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var G=YAHOO.util.Dom,L=YAHOO.util.Event,I=YAHOO.lang,B=YAHOO.widget.Overlay,J=YAHOO.widget.Menu,D={},K=null,E=null,C=null;function F(N,M,Q,O){var R,P;if(I.isString(N)&&I.isString(M)){if(YAHOO.env.ua.ie){P="<input type=\""+N+"\" name=\""+M+"\"";if(O){P+=" checked";}P+=">";R=document.createElement(P);}else{R=document.createElement("input");R.name=M;R.type=N;if(O){R.checked=true;}}R.value=Q;return R;}}function H(N,T){var M=N.nodeName.toUpperCase(),R=this,S,O,P;function U(V){if(!(V in T)){S=N.getAttributeNode(V);if(S&&("value" in S)){T[V]=S.value;}}}function Q(){U("type");if(T.type=="button"){T.type="push";}if(!("disabled" in T)){T.disabled=N.disabled;}U("name");U("value");U("title");}switch(M){case"A":T.type="link";U("href");U("target");break;case"INPUT":Q();if(!("checked" in T)){T.checked=N.checked;}break;case"BUTTON":Q();O=N.parentNode.parentNode;if(G.hasClass(O,this.CSS_CLASS_NAME+"-checked")){T.checked=true;}if(G.hasClass(O,this.CSS_CLASS_NAME+"-disabled")){T.disabled=true;}N.removeAttribute("value");N.setAttribute("type","button");break;}N.removeAttribute("id");N.removeAttribute("name");if(!("tabindex" in T)){T.tabindex=N.tabIndex;}if(!("label" in T)){P=M=="INPUT"?N.value:N.innerHTML;if(P&&P.length>0){T.label=P;}}}function A(O){var N=O.attributes,M=N.srcelement,Q=M.nodeName.toUpperCase(),P=this;if(Q==this.NODE_NAME){O.element=M;O.id=M.id;G.getElementsBy(function(R){switch(R.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":H.call(P,R,N);break;}},"*",M);}else{switch(Q){case"BUTTON":case"A":case"INPUT":H.call(this,M,N);break;}}}YAHOO.widget.Button=function(Q,N){if(!B&&YAHOO.widget.Overlay){B=YAHOO.widget.Overlay;}if(!J&&YAHOO.widget.Menu){J=YAHOO.widget.Menu;}var P=YAHOO.widget.Button.superclass.constructor,O,M;if(arguments.length==1&&!I.isString(Q)&&!Q.nodeName){if(!Q.id){Q.id=G.generateId();}P.call(this,(this.createButtonElement(Q.type)),Q);}else{O={element:null,attributes:(N||{})};if(I.isString(Q)){M=G.get(Q);if(M){if(!O.attributes.id){O.attributes.id=Q;}O.attributes.srcelement=M;A.call(this,O);if(!O.element){O.element=this.createButtonElement(O.attributes.type);}P.call(this,O.element,O.attributes);}}else{if(Q.nodeName){if(!O.attributes.id){if(Q.id){O.attributes.id=Q.id;}else{O.attributes.id=G.generateId();}}O.attributes.srcelement=Q;A.call(this,O);if(!O.element){O.element=this.createButtonElement(O.attributes.type);}P.call(this,O.element,O.attributes);}}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"yui-button",RADIO_DEFAULT_TITLE:"Unchecked.  Click to check.",RADIO_CHECKED_TITLE:"Checked.  Click another button to uncheck",CHECKBOX_DEFAULT_TITLE:"Unchecked.  Click to check.",CHECKBOX_CHECKED_TITLE:"Checked.  Click to uncheck.",MENUBUTTON_DEFAULT_TITLE:"Menu collapsed.  Click to expand.",MENUBUTTON_MENU_VISIBLE_TITLE:"Menu expanded.  Click or press Esc to collapse.",SPLITBUTTON_DEFAULT_TITLE:("Menu collapsed.  Click inside option region or press Ctrl + Shift + M to show the menu."),SPLITBUTTON_OPTION_VISIBLE_TITLE:"Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",SUBMIT_TITLE:"Click to submit form.",_setType:function(M){if(M=="split"){this.on("option",this._onOption);}},_setLabel:function(M){this._button.innerHTML=M;var O,N;if(YAHOO.env.ua.gecko&&G.inDocument(this.get("element"))){N=this;O=this.CSS_CLASS_NAME;this.removeClass(O);window.setTimeout(function(){N.addClass(O);},0);}},_setTabIndex:function(M){this._button.tabIndex=M;},_setTitle:function(N){var M=N;if(this.get("type")!="link"){if(!M){switch(this.get("type")){case"radio":M=this.RADIO_DEFAULT_TITLE;break;case"checkbox":M=this.CHECKBOX_DEFAULT_TITLE;break;case"menu":M=this.MENUBUTTON_DEFAULT_TITLE;break;case"split":M=this.SPLITBUTTON_DEFAULT_TITLE;break;case"submit":M=this.SUBMIT_TITLE;break;}}this._button.title=M;}},_setDisabled:function(M){if(this.get("type")!="link"){if(M){if(this._menu){this._menu.hide();}if(this.hasFocus()){this.blur();}this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");this.removeStateCSSClasses("hover");this.removeStateCSSClasses("active");this.removeStateCSSClasses("focus");}else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(M){if(this.get("type")=="link"){this._button.href=M;}},_setTarget:function(M){if(this.get("type")=="link"){this._button.setAttribute("target",M);}},_setChecked:function(N){var O=this.get("type"),M;if(O=="checkbox"||O=="radio"){if(N){this.addStateCSSClasses("checked");M=(O=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{this.removeStateCSSClasses("checked");M=(O=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",M);}},_setMenu:function(W){var Q=this.get("lazyloadmenu"),T=this.get("element"),M,Y=false,Z,P,S,O,N,V,R;if(!B){return false;}if(J){M=J.prototype.CSS_CLASS_NAME;}function X(){Z.render(T.parentNode);this.removeListener("appendTo",X);}function U(){if(Z){G.addClass(Z.element,this.get("menuclassname"));G.addClass(Z.element,"yui-"+this.get("type")+"-button-menu");Z.showEvent.subscribe(this._onMenuShow,null,this);Z.hideEvent.subscribe(this._onMenuHide,null,this);Z.renderEvent.subscribe(this._onMenuRender,null,this);if(J&&Z instanceof J){Z.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);Z.subscribe("click",this._onMenuClick,this,true);Z.itemAddedEvent.subscribe(this._onMenuItemAdded,this,true);S=Z.srcElement;if(S&&S.nodeName.toUpperCase()=="SELECT"){S.style.display="none";S.parentNode.removeChild(S);}}else{if(B&&Z instanceof B){if(!K){K=new YAHOO.widget.OverlayManager();}K.register(Z);}}this._menu=Z;if(!Y){if(Q&&J&&!(Z instanceof J)){Z.beforeShowEvent.subscribe(this._onOverlayBeforeShow,null,this);}else{if(!Q){if(G.inDocument(T)){Z.render(T.parentNode);
+}else{this.on("appendTo",X);}}}}}}if(W&&J&&(W instanceof J)){Z=W;O=Z.getItems();N=O.length;Y=true;if(N>0){R=N-1;do{V=O[R];if(V){V.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,V,this);}}while(R--);}U.call(this);}else{if(B&&W&&(W instanceof B)){Z=W;Y=true;Z.cfg.setProperty("visible",false);Z.cfg.setProperty("context",[T,"tl","bl"]);U.call(this);}else{if(J&&I.isArray(W)){this.on("appendTo",function(){Z=new J(G.generateId(),{lazyload:Q,itemdata:W});U.call(this);});}else{if(I.isString(W)){P=G.get(W);if(P){if(J&&G.hasClass(P,M)||P.nodeName.toUpperCase()=="SELECT"){Z=new J(W,{lazyload:Q});U.call(this);}else{if(B){Z=new B(W,{visible:false,context:[T,"tl","bl"]});U.call(this);}}}}else{if(W&&W.nodeName){if(J&&G.hasClass(W,M)||W.nodeName.toUpperCase()=="SELECT"){Z=new J(W,{lazyload:Q});U.call(this);}else{if(B){if(!W.id){G.generateId(W);}Z=new B(W,{visible:false,context:[T,"tl","bl"]});U.call(this);}}}}}}}},_setOnClick:function(M){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=M)){this.removeListener("click",this._onclickAttributeValue.fn);this._onclickAttributeValue=null;}if(!this._onclickAttributeValue&&I.isObject(M)&&I.isFunction(M.fn)){this.on("click",M.fn,M.obj,M.scope);this._onclickAttributeValue=M;}},_setSelectedMenuItem:function(N){var M=this._menu,O;if(J&&M&&M instanceof J){O=M.getItem(N);if(O&&!O.cfg.getProperty("selected")){O.cfg.setProperty("selected",true);}}},_isActivationKey:function(M){var Q=this.get("type"),N=(Q=="checkbox"||Q=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,P=N.length,O;if(P>0){O=P-1;do{if(M==N[O]){return true;}}while(O--);}},_isSplitButtonOptionKey:function(M){return(M.ctrlKey&&M.shiftKey&&L.getCharCode(M)==77);},_addListenersToForm:function(){var S=this.getForm(),R=YAHOO.widget.Button.onFormKeyPress,Q,M,P,O,N;if(S){L.on(S,"reset",this._onFormReset,null,this);L.on(S,"submit",this.createHiddenFields,null,this);M=this.get("srcelement");if(this.get("type")=="submit"||(M&&M.type=="submit")){P=L.getListeners(S,"keypress");Q=false;if(P){O=P.length;if(O>0){N=O-1;do{if(P[N].fn==R){Q=true;break;}}while(N--);}}if(!Q){L.on(S,"keypress",R);}}}},_showMenu:function(R){if(YAHOO.widget.MenuManager){YAHOO.widget.MenuManager.hideVisible();}if(K){K.hideAll();}var P=B.VIEWPORT_OFFSET,Y=this._menu,W=this,Z=W.get("element"),T=false,V=G.getY(Z),U=G.getDocumentScrollTop(),M,Q,b;if(U){V=V-U;}var O=V,N=(G.getViewportHeight()-(V+Z.offsetHeight));function S(){if(T){return(O-P);}else{return(N-P);}}function a(){var c=S();if(Q>c){M=Y.cfg.getProperty("minscrollheight");if(c>M){Y.cfg.setProperty("maxheight",c);if(T){Y.align("bl","tl");}}if(c<M){if(T){Y.cfg.setProperty("context",[Z,"tl","bl"],true);Y.align("tl","bl");}else{Y.cfg.setProperty("context",[Z,"bl","tl"],true);Y.align("bl","tl");T=true;return a();}}}}if(J&&Y&&(Y instanceof J)){Y.cfg.applyConfig({context:[Z,"tl","bl"],clicktohide:false,visible:true});Y.cfg.fireQueue();Y.cfg.setProperty("maxheight",0);Y.align("tl","bl");if(R.type=="mousedown"){L.stopPropagation(R);}Q=Y.element.offsetHeight;b=Y.element.lastChild;a();if(this.get("focusmenu")){this._menu.focus();}}else{if(B&&Y&&(Y instanceof B)){Y.show();Y.align("tl","bl");var X=S();Q=Y.element.offsetHeight;if(X<Q){Y.align("bl","tl");T=true;X=S();if(X<Q){Y.align("tl","bl");}}}}},_hideMenu:function(){var M=this._menu;if(M){M.hide();}},_onMouseOver:function(M){if(!this._hasMouseEventHandlers){this.on("mouseout",this._onMouseOut);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this._hasMouseEventHandlers=true;}this.addStateCSSClasses("hover");if(this._activationButtonPressed){this.addStateCSSClasses("active");}if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}if(this._activationButtonPressed||this._bOptionPressed){L.removeListener(document,"mouseup",this._onDocumentMouseUp);}},_onMouseOut:function(M){this.removeStateCSSClasses("hover");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationButtonPressed||this._bOptionPressed){L.on(document,"mouseup",this._onDocumentMouseUp,null,this);}},_onDocumentMouseUp:function(O){this._activationButtonPressed=false;this._bOptionPressed=false;var P=this.get("type"),M,N;if(P=="menu"||P=="split"){M=L.getTarget(O);N=this._menu.element;if(M!=N&&!G.isAncestor(N,M)){this.removeStateCSSClasses((P=="menu"?"active":"activeoption"));this._hideMenu();}}L.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(P){var R,N,Q,O;function M(){this._hideMenu();this.removeListener("mouseup",M);}if((P.which||P.button)==1){if(!this.hasFocus()){this.focus();}R=this.get("type");if(R=="split"){N=this.get("element");Q=L.getPageX(P)-G.getX(N);if((N.offsetWidth-this.OPTION_AREA_WIDTH)<Q){this.fireEvent("option",P);}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}else{if(R=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}else{this._showMenu(P);this._activationButtonPressed=true;}}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}if(R=="split"||R=="menu"){O=this;this._hideMenuTimerId=window.setTimeout(function(){O.on("mouseup",M);},250);}}},_onMouseUp:function(M){var N=this.get("type");if(this._hideMenuTimerId){window.clearTimeout(this._hideMenuTimerId);}if(N=="checkbox"||N=="radio"){this.set("checked",!(this.get("checked")));}this._activationButtonPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}},_onFocus:function(N){var M;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}C=this;if(!this._hasKeyEventHandlers){M=this._button;L.on(M,"blur",this._onBlur,null,this);L.on(M,"keydown",this._onKeyDown,null,this);L.on(M,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}this.fireEvent("focus",N);},_onBlur:function(M){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationKeyPressed){L.on(document,"keyup",this._onDocumentKeyUp,null,this);
+}C=null;this.fireEvent("blur",M);},_onDocumentKeyUp:function(M){if(this._isActivationKey(L.getCharCode(M))){this._activationKeyPressed=false;L.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(N){var M=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(N)){this.fireEvent("option",N);}else{if(this._isActivationKey(L.getCharCode(N))){if(this.get("type")=="menu"){this._showMenu(N);}else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}}if(M&&M.cfg.getProperty("visible")&&L.getCharCode(N)==27){M.hide();this.focus();}},_onKeyUp:function(M){var N;if(this._isActivationKey(L.getCharCode(M))){N=this.get("type");if(N=="checkbox"||N=="radio"){this.set("checked",!(this.get("checked")));}this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(P){var S=this.get("type"),M,Q,N,O,R;switch(S){case"radio":case"checkbox":if(this.get("checked")){M=(S=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{M=(S=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",M);break;case"submit":this.submitForm();break;case"reset":Q=this.getForm();if(Q){Q.reset();}break;case"menu":M=this._menu.cfg.getProperty("visible")?this.MENUBUTTON_MENU_VISIBLE_TITLE:this.MENUBUTTON_DEFAULT_TITLE;this.set("title",M);break;case"split":O=this.get("element");R=L.getPageX(P)-G.getX(O);if((O.offsetWidth-this.OPTION_AREA_WIDTH)<R){return false;}else{this._hideMenu();N=this.get("srcelement");if(N&&N.type=="submit"){this.submitForm();}}M=this._menu.cfg.getProperty("visible")?this.SPLITBUTTON_OPTION_VISIBLE_TITLE:this.SPLITBUTTON_DEFAULT_TITLE;this.set("title",M);break;}},_onAppendTo:function(N){var M=this;window.setTimeout(function(){M._addListenersToForm();},0);},_onFormReset:function(N){var O=this.get("type"),M=this._menu;if(O=="checkbox"||O=="radio"){this.resetValue("checked");}if(J&&M&&(M instanceof J)){this.resetValue("selectedMenuItem");}},_onDocumentMouseDown:function(P){var M=L.getTarget(P),O=this.get("element"),N=this._menu.element;if(M!=O&&!G.isAncestor(O,M)&&M!=N&&!G.isAncestor(N,M)){this._hideMenu();L.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(M){if(this.hasClass("yui-split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}else{this._showMenu(M);this._bOptionPressed=true;}},_onOverlayBeforeShow:function(N){var M=this._menu;M.render(this.get("element").parentNode);M.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);},_onMenuShow:function(N){L.on(document,"mousedown",this._onDocumentMouseDown,null,this);var M,O;if(this.get("type")=="split"){M=this.SPLITBUTTON_OPTION_VISIBLE_TITLE;O="activeoption";}else{M=this.MENUBUTTON_MENU_VISIBLE_TITLE;O="active";}this.addStateCSSClasses(O);this.set("title",M);},_onMenuHide:function(O){var N=this._menu,M,P;if(this.get("type")=="split"){M=this.SPLITBUTTON_DEFAULT_TITLE;P="activeoption";}else{M=this.MENUBUTTON_DEFAULT_TITLE;P="active";}this.removeStateCSSClasses(P);this.set("title",M);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(O,N){var M=N[0];if(L.getCharCode(M)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(N){var P=this.get("element"),M=P.parentNode,O=this._menu.element;if(M!=O.parentNode){M.appendChild(O);}this.set("selectedMenuItem",this.get("selectedMenuItem"));},_onMenuItemSelected:function(O,N,M){var P=N[0];if(P){this.set("selectedMenuItem",M);}},_onMenuItemAdded:function(O,N,M){var P=N[0];P.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,P,this);},_onMenuClick:function(N,M){var P=M[1],O;if(P){O=this.get("srcelement");if(O&&O.type=="submit"){this.submitForm();}this._hideMenu();}},createButtonElement:function(M){var O=this.NODE_NAME,N=document.createElement(O);N.innerHTML="<"+O+" class=\"first-child\">"+(M=="link"?"<a></a>":"<button type=\"button\"></button>")+"</"+O+">";return N;},addStateCSSClasses:function(M){var N=this.get("type");if(I.isString(M)){if(M!="activeoption"){this.addClass(this.CSS_CLASS_NAME+("-"+M));}this.addClass("yui-"+N+("-button-"+M));}},removeStateCSSClasses:function(M){var N=this.get("type");if(I.isString(M)){this.removeClass(this.CSS_CLASS_NAME+("-"+M));this.removeClass("yui-"+N+("-button-"+M));}},createHiddenFields:function(){this.removeHiddenFields();var R=this.getForm(),U,N,P,S,T,O,Q,M;if(R&&!this.get("disabled")){N=this.get("type");P=(N=="checkbox"||N=="radio");if(P||(E==this)){U=F((P?N:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(U){if(P){U.style.display="none";}R.appendChild(U);}}S=this._menu;if(J&&S&&(S instanceof J)){M=S.srcElement;T=this.get("selectedMenuItem");if(T){if(M&&M.nodeName.toUpperCase()=="SELECT"){R.appendChild(M);M.selectedIndex=T.index;}else{Q=(T.value===null||T.value==="")?T.cfg.getProperty("text"):T.value;O=this.get("name");if(Q&&O){M=F("hidden",(O+"_options"),Q);R.appendChild(M);}}}}if(U&&M){this._hiddenFields=[U,M];}else{if(!U&&M){this._hiddenFields=M;}else{if(U&&!M){this._hiddenFields=U;}}}return this._hiddenFields;}},removeHiddenFields:function(){var P=this._hiddenFields,N,O;function M(Q){if(G.inDocument(Q)){Q.parentNode.removeChild(Q);}}if(P){if(I.isArray(P)){N=P.length;if(N>0){O=N-1;do{M(P[O]);}while(O--);}}else{M(P);}this._hiddenFields=null;}},submitForm:function(){var P=this.getForm(),O=this.get("srcelement"),N=false,M;if(P){if(this.get("type")=="submit"||(O&&O.type=="submit")){E=this;}if(YAHOO.env.ua.ie){N=P.fireEvent("onsubmit");}else{M=document.createEvent("HTMLEvents");M.initEvent("submit",true,true);N=P.dispatchEvent(M);}if((YAHOO.env.ua.ie||YAHOO.env.ua.webkit)&&N){P.submit();}}return N;},init:function(M,T){var O=T.type=="link"?"a":"button",Q=T.srcelement,S=M.getElementsByTagName(O)[0],R;if(!S){R=M.getElementsByTagName("input")[0];if(R){S=document.createElement("button");S.setAttribute("type","button");R.parentNode.replaceChild(S,R);}}this._button=S;YAHOO.widget.Button.superclass.init.call(this,M,T);
+D[this.get("id")]=this;this.addClass(this.CSS_CLASS_NAME);this.addClass("yui-"+this.get("type")+"-button");L.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("click",this._onClick);this.on("appendTo",this._onAppendTo);var V=this.get("container"),N=this.get("element"),U=G.inDocument(N),P;if(V){if(Q&&Q!=N){P=Q.parentNode;if(P){P.removeChild(Q);}}if(I.isString(V)){L.onContentReady(V,function(){this.appendTo(V);},null,this);}else{this.appendTo(V);}}else{if(!U&&Q&&Q!=N){P=Q.parentNode;if(P){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:P});P.replaceChild(N,Q);this.fireEvent("appendTo",{type:"appendTo",target:P});}}else{if(this.get("type")!="link"&&U&&Q&&Q==N){this._addListenersToForm();}}}},initAttributes:function(N){var M=N||{};YAHOO.widget.Button.superclass.initAttributes.call(this,M);this.setAttributeConfig("type",{value:(M.type||"push"),validator:I.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:M.label,validator:I.isString,method:this._setLabel});this.setAttributeConfig("value",{value:M.value});this.setAttributeConfig("name",{value:M.name,validator:I.isString});this.setAttributeConfig("tabindex",{value:M.tabindex,validator:I.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:M.title,validator:I.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(M.disabled||false),validator:I.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:M.href,validator:I.isString,method:this._setHref});this.setAttributeConfig("target",{value:M.target,validator:I.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(M.checked||false),validator:I.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:M.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:M.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(M.lazyloadmenu===false?false:true),validator:I.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(M.menuclassname||"yui-button-menu"),validator:I.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("selectedMenuItem",{value:null,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:M.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(M.focusmenu===false?false:true),validator:I.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(C==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){return this._button.form;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var O=this.get("element"),N=O.parentNode,M=this._menu,Q;if(M){if(K&&K.find(M)){K.remove(M);}M.destroy();}L.purgeElement(O);L.purgeElement(this._button);L.removeListener(document,"mouseup",this._onDocumentMouseUp);L.removeListener(document,"keyup",this._onDocumentKeyUp);L.removeListener(document,"mousedown",this._onDocumentMouseDown);var P=this.getForm();if(P){L.removeListener(P,"reset",this._onFormReset);L.removeListener(P,"submit",this.createHiddenFields);}this.unsubscribeAll();if(N){N.removeChild(O);}delete D[this.get("id")];Q=G.getElementsByClassName(this.CSS_CLASS_NAME,this.NODE_NAME,P);if(I.isArray(Q)&&Q.length===0){L.removeListener(P,"keypress",YAHOO.widget.Button.onFormKeyPress);}},fireEvent:function(N,M){var O=arguments[0];if(this.DOM_EVENTS[O]&&this.get("disabled")){return ;}return YAHOO.widget.Button.superclass.fireEvent.apply(this,arguments);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(Q){var O=L.getTarget(Q),R=L.getCharCode(Q),P=O.nodeName&&O.nodeName.toUpperCase(),M=O.type,S=false,U,V,N,W;function T(Z){var Y,X;switch(Z.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(Z.type=="submit"&&!Z.disabled){if(!S&&!N){N=Z;}if(V&&!W){W=Z;}}break;default:Y=Z.id;if(Y){U=D[Y];if(U){S=true;if(!U.get("disabled")){X=U.get("srcelement");if(!V&&(U.get("type")=="submit"||(X&&X.type=="submit"))){V=U;}}}}break;}}if(R==13&&((P=="INPUT"&&(M=="text"||M=="password"||M=="checkbox"||M=="radio"||M=="file"))||P=="SELECT")){G.getElementsBy(T,"*",this);if(N){N.focus();}else{if(!N&&V){if(W){L.preventDefault(Q);}V.submitForm();}}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(M){var R=G.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",M),P=R.length,Q,N,O;if(P>0){for(O=0;O<P;O++){N=R[O].id;if(N){Q=D[N];if(Q){Q.createHiddenFields();}}}}};YAHOO.widget.Button.getButton=function(M){var N=D[M];if(N){return N;}};})();(function(){var C=YAHOO.util.Dom,B=YAHOO.util.Event,D=YAHOO.lang,A=YAHOO.widget.Button,E={};YAHOO.widget.ButtonGroup=function(J,H){var I=YAHOO.widget.ButtonGroup.superclass.constructor,K,G,F;if(arguments.length==1&&!D.isString(J)&&!J.nodeName){if(!J.id){F=C.generateId();J.id=F;}I.call(this,(this._createGroupElement()),J);}else{if(D.isString(J)){G=C.get(J);if(G){if(G.nodeName.toUpperCase()==this.NODE_NAME){I.call(this,G,H);}}}else{K=J.nodeName.toUpperCase();if(K&&K==this.NODE_NAME){if(!J.id){J.id=C.generateId();}I.call(this,J,H);}}}};YAHOO.extend(YAHOO.widget.ButtonGroup,YAHOO.util.Element,{_buttons:null,NODE_NAME:"DIV",CSS_CLASS_NAME:"yui-buttongroup",_createGroupElement:function(){var F=document.createElement(this.NODE_NAME);return F;},_setDisabled:function(G){var H=this.getCount(),F;if(H>0){F=H-1;do{this._buttons[F].set("disabled",G);}while(F--);}},_onKeyDown:function(K){var G=B.getTarget(K),I=B.getCharCode(K),H=G.parentNode.parentNode.id,J=E[H],F=-1;if(I==37||I==38){F=(J.index===0)?(this._buttons.length-1):(J.index-1);}else{if(I==39||I==40){F=(J.index===(this._buttons.length-1))?0:(J.index+1);}}if(F>-1){this.check(F);this.getButton(F).focus();
+}},_onAppendTo:function(H){var I=this._buttons,G=I.length,F;for(F=0;F<G;F++){I[F].appendTo(this.get("element"));}},_onButtonCheckedChange:function(G,F){var I=G.newValue,H=this.get("checkedButton");if(I&&H!=F){if(H){H.set("checked",false,true);}this.set("checkedButton",F);this.set("value",F.get("value"));}else{if(H&&!H.set("checked")){H.set("checked",true,true);}}},init:function(I,H){this._buttons=[];YAHOO.widget.ButtonGroup.superclass.init.call(this,I,H);this.addClass(this.CSS_CLASS_NAME);var J=this.getElementsByClassName("yui-radio-button");if(J.length>0){this.addButtons(J);}function F(K){return(K.type=="radio");}J=C.getElementsBy(F,"input",this.get("element"));if(J.length>0){this.addButtons(J);}this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var G=this.get("container");if(G){if(D.isString(G)){B.onContentReady(G,function(){this.appendTo(G);},null,this);}else{this.appendTo(G);}}},initAttributes:function(G){var F=G||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,F);this.setAttributeConfig("name",{value:F.name,validator:D.isString});this.setAttributeConfig("disabled",{value:(F.disabled||false),validator:D.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:F.value});this.setAttributeConfig("container",{value:F.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(J){var L,K,G,F,H,I;if(J instanceof A&&J.get("type")=="radio"){L=J;}else{if(!D.isString(J)&&!J.nodeName){J.type="radio";L=new A(J);}else{L=new A(J,{type:"radio"});}}if(L){F=this._buttons.length;H=L.get("name");I=this.get("name");L.index=F;this._buttons[F]=L;E[L.get("id")]=L;if(H!=I){L.set("name",I);}if(this.get("disabled")){L.set("disabled",true);}if(L.get("checked")){this.set("checkedButton",L);}K=L.get("element");G=this.get("element");if(K.parentNode!=G){G.appendChild(K);}L.on("checkedChange",this._onButtonCheckedChange,L,this);return L;}},addButtons:function(G){var H,I,J,F;if(D.isArray(G)){H=G.length;J=[];if(H>0){for(F=0;F<H;F++){I=this.addButton(G[F]);if(I){J[J.length]=I;}}if(J.length>0){return J;}}}},removeButton:function(H){var I=this.getButton(H),G,F;if(I){this._buttons.splice(H,1);delete E[I.get("id")];I.removeListener("checkedChange",this._onButtonCheckedChange);I.destroy();G=this._buttons.length;if(G>0){F=this._buttons.length-1;do{this._buttons[F].index=F;}while(F--);}}},getButton:function(F){if(D.isNumber(F)){return this._buttons[F];}},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(H){var I,G,F;if(D.isNumber(H)){I=this._buttons[H];if(I){I.focus();}}else{G=this.getCount();for(F=0;F<G;F++){I=this._buttons[F];if(!I.get("disabled")){I.focus();break;}}}},check:function(F){var G=this.getButton(F);if(G){G.set("checked",true);}},destroy:function(){var I=this._buttons.length,H=this.get("element"),F=H.parentNode,G;if(I>0){G=this._buttons.length-1;do{this._buttons[G].destroy();}while(G--);}B.purgeElement(H);F.removeChild(H);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/button/button.js b/lib/yui/button/button.js
new file mode 100644 (file)
index 0000000..ff3a1aa
--- /dev/null
@@ -0,0 +1,4670 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+* @module button
+* @description <p>The Button Control enables the creation of rich, graphical 
+* buttons that function like traditional HTML form buttons.  <em>Unlike</em> 
+* tradition HTML form buttons, buttons created with the Button Control can have 
+* a label that is different from its value.  With the inclusion of the optional 
+* <a href="module_menu.html">Menu Control</a>, the Button Control can also be
+* used to create menu buttons and split buttons, controls that are not 
+* available natively in HTML.  The Button Control can also be thought of as a 
+* way to create more visually engaging implementations of the browser's 
+* default radio-button and check-box controls.</p>
+* <p>The Button Control supports the following types:</p>
+* <dl>
+* <dt>push</dt>
+* <dd>Basic push button that can execute a user-specified command when 
+* pressed.</dd>
+* <dt>link</dt>
+* <dd>Navigates to a specified url when pressed.</dd>
+* <dt>submit</dt>
+* <dd>Submits the parent form when pressed.</dd>
+* <dt>reset</dt>
+* <dd>Resets the parent form when pressed.</dd>
+* <dt>checkbox</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.</dd>
+* <dt>radio</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.  Use with 
+* the ButtonGroup class to create a set of controls that are mutually 
+* exclusive; checking one button in the set will uncheck all others in 
+* the group.</dd>
+* <dt>menu</dt>
+* <dd>When pressed will show/hide a menu.</dd>
+* <dt>split</dt>
+* <dd>Can execute a user-specified command or display a menu when pressed.</dd>
+* </dl>
+* @title Button
+* @namespace YAHOO.widget
+* @requires yahoo, dom, element, event
+* @optional container, menu
+*/
+
+
+(function () {
+
+
+    /**
+    * The Button class creates a rich, graphical button.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+    * be used to create the button.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org
+    * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697">
+    * HTMLButtonElement</a>|<a href="
+    * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+    * ID-33759296">HTMLElement</a>} p_oElement Object reference for the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+    * used to create the button.
+    * @param {Object} p_oElement Object literal specifying a set of   
+    * configuration attributes used to create the button.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set  
+    * of configuration attributes used to create the button.
+    * @namespace YAHOO.widget
+    * @class Button
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+
+
+
+    // Shorthard for utilities
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Overlay = YAHOO.widget.Overlay,
+        Menu = YAHOO.widget.Menu,
+    
+    
+        // Private member variables
+    
+        m_oButtons = {},    // Collection of all Button instances
+        m_oOverlayManager = null,   // YAHOO.widget.OverlayManager instance
+        m_oSubmitTrigger = null,    // The button that submitted the form 
+        m_oFocusedButton = null;    // The button that has focus
+
+
+
+    // Private methods
+
+    
+    
+    /**
+    * @method createInputElement
+    * @description Creates an <code>&#60;input&#62;</code> element of the 
+    * specified type.
+    * @private
+    * @param {String} p_sType String specifying the type of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sName String specifying the name of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sValue String specifying the value of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_bChecked Boolean specifying if the  
+    * <code>&#60;input&#62;</code> element is to be checked.
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>}
+    */
+    function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) {
+    
+        var oInput,
+            sInput;
+    
+        if (Lang.isString(p_sType) && Lang.isString(p_sName)) {
+        
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                    For IE it is necessary to create the element with the 
+                    "type," "name," "value," and "checked" properties set all 
+                    at once.
+                */
+            
+                sInput = "<input type=\"" + p_sType + "\" name=\"" + 
+                    p_sName + "\"";
+        
+                if (p_bChecked) {
+        
+                    sInput += " checked";
+                
+                }
+                
+                sInput += ">";
+        
+                oInput = document.createElement(sInput);
+        
+            }
+            else {
+            
+                oInput = document.createElement("input");
+                oInput.name = p_sName;
+                oInput.type = p_sType;
+        
+                if (p_bChecked) {
+        
+                    oInput.checked = true;
+                
+                }
+        
+            }
+        
+            oInput.value = p_sValue;
+            
+            return oInput;
+        
+        }
+    
+    }
+    
+    
+    /**
+    * @method setAttributesFromSrcElement
+    * @description Gets the values for all the attributes of the source element 
+    * (either <code>&#60;input&#62;</code> or <code>&#60;a&#62;</code>) that 
+    * map to Button configuration attributes and sets them into a collection 
+    * that is passed to the Button constructor.
+    * @private
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/
+    * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-
+    * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML 
+    * element (either <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+    * </code>) used to create the button.
+    * @param {Object} p_oAttributes Object reference for the collection of 
+    * configuration attributes used to create the button.
+    */
+    function setAttributesFromSrcElement(p_oElement, p_oAttributes) {
+    
+        var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(),
+            me = this,
+            oAttribute,
+            oRootNode,
+            sText;
+            
+    
+        /**
+        * @method setAttributeFromDOMAttribute
+        * @description Gets the value of the specified DOM attribute and sets it 
+        * into the collection of configuration attributes used to configure 
+        * the button.
+        * @private
+        * @param {String} p_sAttribute String representing the name of the 
+        * attribute to retrieve from the DOM element.
+        */
+        function setAttributeFromDOMAttribute(p_sAttribute) {
+    
+            if (!(p_sAttribute in p_oAttributes)) {
+    
+                /*
+                    Need to use "getAttributeNode" instead of "getAttribute" 
+                    because using "getAttribute," IE will return the innerText 
+                    of a <code>&#60;button&#62;</code> for the value attribute  
+                    rather than the value of the "value" attribute.
+                */
+        
+                oAttribute = p_oElement.getAttributeNode(p_sAttribute);
+        
+    
+                if (oAttribute && ("value" in oAttribute)) {
+    
+    
+                    p_oAttributes[p_sAttribute] = oAttribute.value;
+    
+                }
+    
+            }
+        
+        }
+    
+    
+        /**
+        * @method setFormElementProperties
+        * @description Gets the value of the attributes from the form element  
+        * and sets them into the collection of configuration attributes used to 
+        * configure the button.
+        * @private
+        */
+        function setFormElementProperties() {
+    
+            setAttributeFromDOMAttribute("type");
+    
+            if (p_oAttributes.type == "button") {
+            
+                p_oAttributes.type = "push";
+            
+            }
+    
+            if (!("disabled" in p_oAttributes)) {
+    
+                p_oAttributes.disabled = p_oElement.disabled;
+    
+            }
+    
+            setAttributeFromDOMAttribute("name");
+            setAttributeFromDOMAttribute("value");
+            setAttributeFromDOMAttribute("title");
+    
+        }
+
+    
+        switch (sSrcElementNodeName) {
+        
+        case "A":
+            
+            p_oAttributes.type = "link";
+            
+            setAttributeFromDOMAttribute("href");
+            setAttributeFromDOMAttribute("target");
+        
+            break;
+    
+        case "INPUT":
+
+            setFormElementProperties();
+
+            if (!("checked" in p_oAttributes)) {
+    
+                p_oAttributes.checked = p_oElement.checked;
+    
+            }
+
+            break;
+
+        case "BUTTON":
+
+            setFormElementProperties();
+
+            oRootNode = p_oElement.parentNode.parentNode;
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) {
+            
+                p_oAttributes.checked = true;
+            
+            }
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) {
+
+                p_oAttributes.disabled = true;
+            
+            }
+
+            p_oElement.removeAttribute("value");
+
+            p_oElement.setAttribute("type", "button");
+
+            break;
+        
+        }
+
+        p_oElement.removeAttribute("id");
+        p_oElement.removeAttribute("name");
+        
+        if (!("tabindex" in p_oAttributes)) {
+
+            p_oAttributes.tabindex = p_oElement.tabIndex;
+
+        }
+    
+        if (!("label" in p_oAttributes)) {
+    
+            // Set the "label" property
+        
+            sText = sSrcElementNodeName == "INPUT" ? 
+                            p_oElement.value : p_oElement.innerHTML;
+        
+    
+            if (sText && sText.length > 0) {
+                
+                p_oAttributes.label = sText;
+                
+            } 
+    
+        }
+    
+    }
+    
+    
+    /**
+    * @method initConfig
+    * @description Initializes the set of configuration attributes that are 
+    * used to instantiate the button.
+    * @private
+    * @param {Object} Object representing the button's set of 
+    * configuration attributes.
+    */
+    function initConfig(p_oConfig) {
+    
+        var oAttributes = p_oConfig.attributes,
+            oSrcElement = oAttributes.srcelement,
+            sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(),
+            me = this;
+    
+    
+        if (sSrcElementNodeName == this.NODE_NAME) {
+    
+            p_oConfig.element = oSrcElement;
+            p_oConfig.id = oSrcElement.id;
+
+            Dom.getElementsBy(function (p_oElement) {
+            
+                switch (p_oElement.nodeName.toUpperCase()) {
+                
+                case "BUTTON":
+                case "A":
+                case "INPUT":
+
+                    setAttributesFromSrcElement.call(me, p_oElement, 
+                        oAttributes);
+
+                    break;                        
+                
+                }
+            
+            }, "*", oSrcElement);
+        
+        }
+        else {
+    
+            switch (sSrcElementNodeName) {
+
+            case "BUTTON":
+            case "A":
+            case "INPUT":
+
+                setAttributesFromSrcElement.call(this, oSrcElement, 
+                    oAttributes);
+
+                break;
+
+            }
+        
+        }
+    
+    }
+
+
+
+    //  Constructor
+
+    YAHOO.widget.Button = function (p_oElement, p_oAttributes) {
+    
+               if (!Overlay && YAHOO.widget.Overlay) {
+               
+                       Overlay = YAHOO.widget.Overlay;
+               
+               }
+
+
+               if (!Menu && YAHOO.widget.Menu) {
+               
+                       Menu = YAHOO.widget.Menu;
+               
+               }
+
+
+        var fnSuperClass = YAHOO.widget.Button.superclass.constructor,
+            oConfig,
+            oElement;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                p_oElement.id = Dom.generateId();
+    
+    
+            }
+    
+    
+    
+            fnSuperClass.call(this, 
+                (this.createButtonElement(p_oElement.type)),
+                p_oElement);
+    
+        }
+        else {
+    
+            oConfig = { element: null, attributes: (p_oAttributes || {}) };
+    
+    
+            if (Lang.isString(p_oElement)) {
+    
+                oElement = Dom.get(p_oElement);
+    
+                if (oElement) {
+
+                    if (!oConfig.attributes.id) {
+                    
+                        oConfig.attributes.id = p_oElement;
+                    
+                    }
+    
+                
+                
+                
+                    oConfig.attributes.srcelement = oElement;
+                
+                    initConfig.call(this, oConfig);
+                
+                
+                    if (!oConfig.element) {
+                
+                
+                        oConfig.element = 
+                            this.createButtonElement(oConfig.attributes.type);
+                
+                    }
+                
+                    fnSuperClass.call(this, oConfig.element, 
+                        oConfig.attributes);
+    
+                }
+    
+            }
+            else if (p_oElement.nodeName) {
+    
+                if (!oConfig.attributes.id) {
+    
+                    if (p_oElement.id) {
+        
+                        oConfig.attributes.id = p_oElement.id;
+                    
+                    }
+                    else {
+        
+                        oConfig.attributes.id = Dom.generateId();
+        
+        
+                    }
+    
+                }
+    
+    
+    
+    
+    
+                oConfig.attributes.srcelement = p_oElement;
+        
+                initConfig.call(this, oConfig);
+        
+        
+                if (!oConfig.element) {
+    
+            
+                    oConfig.element = 
+                        this.createButtonElement(oConfig.attributes.type);
+            
+                }
+            
+                fnSuperClass.call(this, oConfig.element, oConfig.attributes);
+            
+            }
+    
+        }
+    
+    };
+
+
+
+    YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _button
+        * @description Object reference to the button's internal 
+        * <code>&#60;a&#62;</code> or <code>&#60;button&#62;</code> element.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>
+        */
+        _button: null,
+        
+        
+        /** 
+        * @property _menu
+        * @description Object reference to the button's menu.
+        * @default null
+        * @protected
+        * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|
+        * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        _menu: null,
+        
+        
+        /** 
+        * @property _hiddenFields
+        * @description Object reference to the <code>&#60;input&#62;</code>  
+        * element, or array of HTML form elements used to represent the button
+        *  when its parent form is submitted.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array
+        */
+        _hiddenFields: null,
+        
+        
+        /** 
+        * @property _onclickAttributeValue
+        * @description Object reference to the button's current value for the 
+        * "onclick" configuration attribute.
+        * @default null
+        * @protected
+        * @type Object
+        */
+        _onclickAttributeValue: null,
+        
+        
+        /** 
+        * @property _activationKeyPressed
+        * @description Boolean indicating if the key(s) that toggle the button's 
+        * "active" state have been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationKeyPressed: false,
+        
+        
+        /** 
+        * @property _activationButtonPressed
+        * @description Boolean indicating if the mouse button that toggles 
+        * the button's "active" state has been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationButtonPressed: false,
+        
+        
+        /** 
+        * @property _hasKeyEventHandlers
+        * @description Boolean indicating if the button's "blur", "keydown" and 
+        * "keyup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasKeyEventHandlers: false,
+        
+        
+        /** 
+        * @property _hasMouseEventHandlers
+        * @description Boolean indicating if the button's "mouseout," 
+        * "mousedown," and "mouseup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasMouseEventHandlers: false,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the node to be used for the button's 
+        * root element.
+        * @default "SPAN"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "SPAN",
+        
+        
+        /**
+        * @property CHECK_ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when pressed) 
+        * toggle the button's "checked" attribute.
+        * @default [32]
+        * @final
+        * @type Array
+        */
+        CHECK_ACTIVATION_KEYS: [32],
+        
+        
+        /**
+        * @property ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when presed) 
+        * toggle the button's "active" state.
+        * @default [13, 32]
+        * @final
+        * @type Array
+        */
+        ACTIVATION_KEYS: [13, 32],
+        
+        
+        /**
+        * @property OPTION_AREA_WIDTH
+        * @description Width (in pixels) of the area of a split button that  
+        * when pressed will display a menu.
+        * @default 20
+        * @final
+        * @type Number
+        */
+        OPTION_AREA_WIDTH: 20,
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied to  
+        * the button's root element.
+        * @default "yui-button"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-button",
+        
+        
+        /**
+        * @property RADIO_DEFAULT_TITLE
+        * @description String representing the default title applied to buttons 
+        * of type "radio." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        RADIO_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property RADIO_CHECKED_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "radio" when checked.
+        * @default "Checked.  Click another button to uncheck"
+        * @final
+        * @type String
+        */
+        RADIO_CHECKED_TITLE: "Checked.  Click another button to uncheck",
+        
+        
+        /**
+        * @property CHECKBOX_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "checkbox." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        CHECKBOX_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property CHECKBOX_CHECKED_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "checkbox" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        CHECKBOX_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property MENUBUTTON_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "menu." 
+        * @default "Menu collapsed.  Click to expand."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_DEFAULT_TITLE: "Menu collapsed.  Click to expand.",
+        
+        
+        /**
+        * @property MENUBUTTON_MENU_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "menu" when the button's menu is visible. 
+        * @default "Menu expanded.  Click or press Esc to collapse."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_MENU_VISIBLE_TITLE: 
+            "Menu expanded.  Click or press Esc to collapse.",
+        
+        
+        /**
+        * @property SPLITBUTTON_DEFAULT_TITLE
+        * @description  String representing the default title applied to 
+        * buttons of type "split." 
+        * @default "Menu collapsed.  Click inside option region or press 
+        * Ctrl + Shift + M to show the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed.  Click inside option " + 
+            "region or press Ctrl + Shift + M to show the menu."),
+        
+        
+        /**
+        * @property SPLITBUTTON_OPTION_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "split" when the button's menu is visible. 
+        * @default "Menu expanded.  Press Esc or Ctrl + Shift + M to hide 
+        * the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_OPTION_VISIBLE_TITLE: 
+            "Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",
+        
+        
+        /**
+        * @property SUBMIT_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "submit." 
+        * @default "Click to submit form."
+        * @final
+        * @type String
+        */
+        SUBMIT_TITLE: "Click to submit form.",
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setType
+        * @description Sets the value of the button's "type" attribute.
+        * @protected
+        * @param {String} p_sType String indicating the value for the button's 
+        * "type" attribute.
+        */
+        _setType: function (p_sType) {
+        
+            if (p_sType == "split") {
+        
+                this.on("option", this._onOption);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setLabel
+        * @description Sets the value of the button's "label" attribute.
+        * @protected
+        * @param {String} p_sLabel String indicating the value for the button's 
+        * "label" attribute.
+        */
+        _setLabel: function (p_sLabel) {
+
+            this._button.innerHTML = p_sLabel;
+            
+            /*
+                Remove and add the default class name from the root element
+                for Gecko to ensure that the button shrinkwraps to the label.
+                Without this the button will not be rendered at the correct 
+                width when the label changes.  The most likely cause for this 
+                bug is button's use of the Gecko-specific CSS display type of 
+                "-moz-inline-box" to simulate "inline-block" supported by IE, 
+                Safari and Opera.
+            */
+            
+            var sClass,
+                me;
+            
+            if (YAHOO.env.ua.gecko && Dom.inDocument(this.get("element"))) {
+            
+                me = this;
+                sClass = this.CSS_CLASS_NAME;                
+
+                this.removeClass(sClass);
+                
+                window.setTimeout(function () {
+                
+                    me.addClass(sClass);
+                
+                }, 0);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTabIndex
+        * @description Sets the value of the button's "tabindex" attribute.
+        * @protected
+        * @param {Number} p_nTabIndex Number indicating the value for the 
+        * button's "tabindex" attribute.
+        */
+        _setTabIndex: function (p_nTabIndex) {
+        
+            this._button.tabIndex = p_nTabIndex;
+        
+        },
+        
+        
+        /**
+        * @method _setTitle
+        * @description Sets the value of the button's "title" attribute.
+        * @protected
+        * @param {String} p_nTabIndex Number indicating the value for 
+        * the button's "title" attribute.
+        */
+        _setTitle: function (p_sTitle) {
+        
+            var sTitle = p_sTitle;
+        
+            if (this.get("type") != "link") {
+        
+                if (!sTitle) {
+        
+                    switch (this.get("type")) {
+        
+                    case "radio":
+    
+                        sTitle = this.RADIO_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "checkbox":
+    
+                        sTitle = this.CHECKBOX_DEFAULT_TITLE;
+    
+                        break;
+                    
+                    case "menu":
+    
+                        sTitle = this.MENUBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "split":
+    
+                        sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "submit":
+    
+                        sTitle = this.SUBMIT_TITLE;
+    
+                        break;
+        
+                    }
+        
+                }
+        
+                this._button.title = sTitle;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button's "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for 
+        * the button's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            if (this.get("type") != "link") {
+        
+                if (p_bDisabled) {
+        
+                    if (this._menu) {
+        
+                        this._menu.hide();
+        
+                    }
+        
+                    if (this.hasFocus()) {
+                    
+                        this.blur();
+                    
+                    }
+        
+                    this._button.setAttribute("disabled", "disabled");
+        
+                    this.addStateCSSClasses("disabled");
+
+                    this.removeStateCSSClasses("hover");
+                    this.removeStateCSSClasses("active");
+                    this.removeStateCSSClasses("focus");
+        
+                }
+                else {
+        
+                    this._button.removeAttribute("disabled");
+        
+                    this.removeStateCSSClasses("disabled");
+                
+                }
+        
+            }
+        
+        },
+
+        
+        /**
+        * @method _setHref
+        * @description Sets the value of the button's "href" attribute.
+        * @protected
+        * @param {String} p_sHref String indicating the value for the button's 
+        * "href" attribute.
+        */
+        _setHref: function (p_sHref) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.href = p_sHref;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTarget
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {String} p_sTarget String indicating the value for the button's 
+        * "target" attribute.
+        */
+        _setTarget: function (p_sTarget) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.setAttribute("target", p_sTarget);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setChecked
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {Boolean} p_bChecked Boolean indicating the value for  
+        * the button's "checked" attribute.
+        */
+        _setChecked: function (p_bChecked) {
+        
+            var sType = this.get("type"),
+                sTitle;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                if (p_bChecked) {
+        
+                    this.addStateCSSClasses("checked");
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+
+                    this.removeStateCSSClasses("checked");
+        
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+        
+                this.set("title", sTitle);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setMenu
+        * @description Sets the value of the button's "menu" attribute.
+        * @protected
+        * @param {Object} p_oMenu Object indicating the value for the button's 
+        * "menu" attribute.
+        */
+        _setMenu: function (p_oMenu) {
+
+            var bLazyLoad = this.get("lazyloadmenu"),
+                oButtonElement = this.get("element"),
+                sMenuCSSClassName,
+        
+                /*
+                    Boolean indicating if the value of p_oMenu is an instance 
+                    of YAHOO.widget.Menu or YAHOO.widget.Overlay.
+                */
+        
+                bInstance = false,
+        
+
+                oMenu,
+                oMenuElement,
+                oSrcElement,
+                aItems,
+                nItems,
+                oItem,
+                i;
+        
+        
+            if (!Overlay) {
+        
+        
+                return false;
+            
+            }
+
+
+            if (Menu) {
+            
+                sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME;
+            
+            }
+        
+        
+            function onAppendTo() {
+
+                oMenu.render(oButtonElement.parentNode);
+                
+                this.removeListener("appendTo", onAppendTo);
+            
+            }
+        
+        
+            function initMenu() {
+        
+                if (oMenu) {
+
+                    Dom.addClass(oMenu.element, this.get("menuclassname"));
+                    Dom.addClass(oMenu.element, 
+                            "yui-" + this.get("type") + "-button-menu");
+
+                    oMenu.showEvent.subscribe(this._onMenuShow, null, this);
+                    oMenu.hideEvent.subscribe(this._onMenuHide, null, this);
+                    oMenu.renderEvent.subscribe(this._onMenuRender, null, this);
+        
+        
+                    if (Menu && oMenu instanceof Menu) {
+        
+                        oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, 
+                            this, true);
+
+                        oMenu.subscribe("click", this._onMenuClick, 
+                            this, true);
+
+                        oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, 
+                            this, true);
+        
+                        oSrcElement = oMenu.srcElement;
+        
+                        if (oSrcElement && 
+                            oSrcElement.nodeName.toUpperCase() == "SELECT") {
+                
+                            oSrcElement.style.display = "none";
+                            oSrcElement.parentNode.removeChild(oSrcElement);
+        
+                        }
+        
+                    }
+                    else if (Overlay && oMenu instanceof Overlay) {
+        
+                        if (!m_oOverlayManager) {
+        
+                            m_oOverlayManager = 
+                                new YAHOO.widget.OverlayManager();
+                        
+                        }
+                        
+                        m_oOverlayManager.register(oMenu);
+                        
+                    }
+        
+        
+                    this._menu = oMenu;
+
+        
+                    if (!bInstance) {
+        
+                        if (bLazyLoad && Menu && !(oMenu instanceof Menu)) {
+        
+                            /*
+                                Mimic Menu's "lazyload" functionality by adding  
+                                a "beforeshow" event listener that renders the 
+                                Overlay instance before it is made visible by  
+                                the button.
+                            */
+        
+                            oMenu.beforeShowEvent.subscribe(
+                                this._onOverlayBeforeShow, null, this);
+            
+                        }
+                        else if (!bLazyLoad) {
+        
+                            if (Dom.inDocument(oButtonElement)) {
+        
+                                oMenu.render(oButtonElement.parentNode);
+                            
+                            }
+                            else {
+            
+                                this.on("appendTo", onAppendTo);
+                            
+                            }
+                        
+                        }
+                    
+                    }
+        
+                }
+        
+            }
+        
+        
+            if (p_oMenu && Menu && (p_oMenu instanceof Menu)) {
+        
+                oMenu = p_oMenu;
+                aItems = oMenu.getItems();
+                nItems = aItems.length;
+                bInstance = true;
+        
+        
+                if (nItems > 0) {
+        
+                    i = nItems - 1;
+        
+                    do {
+        
+                        oItem = aItems[i];
+        
+                        if (oItem) {
+        
+                            oItem.cfg.subscribeToConfigEvent("selected", 
+                                this._onMenuItemSelected, 
+                                oItem, 
+                                this);
+        
+                        }
+        
+                    }
+                    while (i--);
+        
+                }
+        
+                initMenu.call(this);
+        
+            }
+            else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) {
+        
+                oMenu = p_oMenu;
+                bInstance = true;
+        
+                oMenu.cfg.setProperty("visible", false);
+                oMenu.cfg.setProperty("context", [oButtonElement, "tl", "bl"]);
+        
+                initMenu.call(this);
+        
+            }
+            else if (Menu && Lang.isArray(p_oMenu)) {
+        
+                this.on("appendTo", function () {
+        
+                    oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, 
+                        itemdata: p_oMenu });
+        
+                    initMenu.call(this);
+        
+                });
+        
+            }
+            else if (Lang.isString(p_oMenu)) {
+        
+                oMenuElement = Dom.get(p_oMenu);
+        
+                if (oMenuElement) {
+        
+                    if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || 
+                        oMenuElement.nodeName.toUpperCase() == "SELECT") {
+            
+                        oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+            
+                        initMenu.call(this);
+            
+                    }
+                    else if (Overlay) {
+        
+                        oMenu = new Overlay(p_oMenu, { visible: false, 
+                            context: [oButtonElement, "tl", "bl"] });
+            
+                        initMenu.call(this);
+            
+                    }
+        
+                }
+        
+            }
+            else if (p_oMenu && p_oMenu.nodeName) {
+        
+                if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || 
+                        p_oMenu.nodeName.toUpperCase() == "SELECT") {
+        
+                    oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+                
+                    initMenu.call(this);
+        
+                }
+                else if (Overlay) {
+        
+                    if (!p_oMenu.id) {
+                    
+                        Dom.generateId(p_oMenu);
+                    
+                    }
+        
+                    oMenu = new Overlay(p_oMenu, { visible: false, 
+                                    context: [oButtonElement, "tl", "bl"] });
+        
+                    initMenu.call(this);
+                
+                }
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setOnClick
+        * @description Sets the value of the button's "onclick" attribute.
+        * @protected
+        * @param {Object} p_oObject Object indicating the value for the button's 
+        * "onclick" attribute.
+        */
+        _setOnClick: function (p_oObject) {
+        
+            /*
+                Remove any existing listeners if a "click" event handler 
+                has already been specified.
+            */
+        
+            if (this._onclickAttributeValue && 
+                (this._onclickAttributeValue != p_oObject)) {
+        
+                this.removeListener("click", this._onclickAttributeValue.fn);
+        
+                this._onclickAttributeValue = null;
+        
+            }
+        
+        
+            if (!this._onclickAttributeValue && 
+                Lang.isObject(p_oObject) && 
+                Lang.isFunction(p_oObject.fn)) {
+        
+                this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope);
+        
+                this._onclickAttributeValue = p_oObject;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setSelectedMenuItem
+        * @description Sets the value of the button's 
+        * "selectedMenuItem" attribute.
+        * @protected
+        * @param {Number} p_nIndex Number representing the index of the item 
+        * in the button's menu that is currently selected.
+        */
+        _setSelectedMenuItem: function (p_nIndex) {
+
+            var oMenu = this._menu,
+                oMenuItem;
+
+
+            if (Menu && oMenu && oMenu instanceof Menu) {
+
+                oMenuItem = oMenu.getItem(p_nIndex);
+                
+
+                if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) {
+                
+                    oMenuItem.cfg.setProperty("selected", true);
+                
+                }
+            
+            }
+
+        },
+        
+        
+        // Protected methods
+
+        
+        
+        /**
+        * @method _isActivationKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the button's "active" state.
+        * @protected
+        * @param {Number} p_nKeyCode Number representing the keycode to 
+        * be evaluated.
+        * @return {Boolean}
+        */
+        _isActivationKey: function (p_nKeyCode) {
+        
+            var sType = this.get("type"),
+                aKeyCodes = (sType == "checkbox" || sType == "radio") ? 
+                    this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS,
+        
+                nKeyCodes = aKeyCodes.length,
+                i;
+        
+            if (nKeyCodes > 0) {
+        
+                i = nKeyCodes - 1;
+        
+                do {
+        
+                    if (p_nKeyCode == aKeyCodes[i]) {
+        
+                        return true;
+        
+                    }
+        
+                }
+                while (i--);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _isSplitButtonOptionKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the display of the split button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        * @return {Boolean}
+        */
+        _isSplitButtonOptionKey: function (p_oEvent) {
+        
+            return (p_oEvent.ctrlKey && p_oEvent.shiftKey && 
+                Event.getCharCode(p_oEvent) == 77);
+        
+        },
+        
+        
+        /**
+        * @method _addListenersToForm
+        * @description Adds event handlers to the button's form.
+        * @protected
+        */
+        _addListenersToForm: function () {
+        
+            var oForm = this.getForm(),
+                onFormKeyPress = YAHOO.widget.Button.onFormKeyPress,
+                bHasKeyPressListener,
+                oSrcElement,
+                aListeners,
+                nListeners,
+                i;
+        
+        
+            if (oForm) {
+        
+                Event.on(oForm, "reset", this._onFormReset, null, this);
+                Event.on(oForm, "submit", this.createHiddenFields, null, this);
+        
+                oSrcElement = this.get("srcelement");
+        
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+                
+                    aListeners = Event.getListeners(oForm, "keypress");
+                    bHasKeyPressListener = false;
+            
+                    if (aListeners) {
+            
+                        nListeners = aListeners.length;
+        
+                        if (nListeners > 0) {
+            
+                            i = nListeners - 1;
+                            
+                            do {
+               
+                                if (aListeners[i].fn == onFormKeyPress) {
+                
+                                    bHasKeyPressListener = true;
+                                    break;
+                                
+                                }
+                
+                            }
+                            while (i--);
+                        
+                        }
+                    
+                    }
+            
+            
+                    if (!bHasKeyPressListener) {
+               
+                        Event.on(oForm, "keypress", onFormKeyPress);
+            
+                    }
+        
+                }
+            
+            }
+        
+        },
+        
+        
+        
+        /**
+        * @method _showMenu
+        * @description Shows the button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object 
+        * passed back by the event utility (YAHOO.util.Event) that triggered 
+        * the display of the menu.
+        */
+        _showMenu: function (p_oEvent) {
+
+            if (YAHOO.widget.MenuManager) {
+
+                YAHOO.widget.MenuManager.hideVisible();
+            
+            }
+
+        
+            if (m_oOverlayManager) {
+        
+                m_oOverlayManager.hideAll();
+            
+            }
+
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,   
+        
+                oMenu = this._menu,
+                oButton = this,
+                oButtonEL = oButton.get("element"),
+                bMenuFlipped = false,
+                nButtonY = Dom.getY(oButtonEL),
+                nScrollTop = Dom.getDocumentScrollTop(),
+                nMenuMinScrollHeight,
+                nMenuHeight,
+                oMenuShadow;
+    
+    
+            if (nScrollTop) {
+        
+                nButtonY = nButtonY - nScrollTop;
+        
+            }
+        
+        
+            var nTopRegion = nButtonY,
+                nBottomRegion = (Dom.getViewportHeight() - 
+                    (nButtonY + oButtonEL.offsetHeight));
+        
+
+            /*
+                 Uses the Button's position to calculate the availble height 
+                 above and below it to display its corresponding Menu.
+            */
+        
+            function getMenuDisplayRegionHeight() {
+        
+                if (bMenuFlipped) {
+        
+                    return (nTopRegion - nViewportOffset);
+        
+                }
+                else {
+        
+                    return (nBottomRegion - nViewportOffset);
+        
+                }
+        
+            }
+
+    
+    
+            /*
+                Sets the Menu's "maxheight" configuration property and trys to 
+                place the Menu in the best possible position (either above or 
+                below its corresponding Button).
+            */
+        
+            function sizeAndPositionMenu() {
+        
+                var nDisplayRegionHeight = getMenuDisplayRegionHeight();
+        
+        
+                if (nMenuHeight > nDisplayRegionHeight) {
+        
+                    nMenuMinScrollHeight = oMenu.cfg.getProperty("minscrollheight");
+        
+        
+                    if (nDisplayRegionHeight > nMenuMinScrollHeight) {
+        
+                        oMenu.cfg.setProperty("maxheight", 
+                                    nDisplayRegionHeight);
+            
+        
+                        if (bMenuFlipped) {
+                        
+                            oMenu.align("bl", "tl");
+                        
+                        }
+            
+                    }
+            
+        
+                    if (nDisplayRegionHeight < nMenuMinScrollHeight) {
+                   
+                        if (bMenuFlipped) {
+            
+                            /*
+                                 All possible positions and values for the 
+                                 "maxheight" configuration property have been 
+                                 tried, but none were successful, so fall back 
+                                 to the original size and position.
+                            */
+        
+                            oMenu.cfg.setProperty("context", 
+                                [oButtonEL, "tl", "bl"], true);
+
+                            oMenu.align("tl", "bl");
+                            
+                        }
+                        else {
+            
+                            oMenu.cfg.setProperty("context", 
+                                [oButtonEL, "bl", "tl"], true);
+
+                            oMenu.align("bl", "tl");
+            
+                            bMenuFlipped = true;
+            
+                            return sizeAndPositionMenu();
+            
+                        }
+                    
+                    }
+                
+                }
+        
+            }
+
+
+            if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+                oMenu.cfg.applyConfig({ context: [oButtonEL, "tl", "bl"],
+                    clicktohide: false,
+                    visible: true });
+                    
+                oMenu.cfg.fireQueue();
+                
+                oMenu.cfg.setProperty("maxheight", 0);
+            
+                oMenu.align("tl", "bl");
+        
+        
+                /*
+                    Stop the propagation of the event so that the MenuManager 
+                    doesn't blur the menu after it gets focus.
+                */
+        
+                if (p_oEvent.type == "mousedown") {
+        
+                    Event.stopPropagation(p_oEvent);
+        
+                }
+        
+                
+                nMenuHeight = oMenu.element.offsetHeight;
+                
+                oMenuShadow = oMenu.element.lastChild; 
+        
+                sizeAndPositionMenu();
+        
+                if (this.get("focusmenu")) {
+        
+                    this._menu.focus();
+                
+                }
+
+            }
+            else if (Overlay && oMenu && (oMenu instanceof Overlay)) {
+        
+                oMenu.show();
+                oMenu.align("tl", "bl");
+                
+                var nDisplayRegionHeight = getMenuDisplayRegionHeight();
+
+                nMenuHeight = oMenu.element.offsetHeight;
+
+
+                if (nDisplayRegionHeight < nMenuHeight) {
+
+                    oMenu.align("bl", "tl");
+
+                    bMenuFlipped = true;
+
+                    nDisplayRegionHeight = getMenuDisplayRegionHeight();
+
+                    if (nDisplayRegionHeight < nMenuHeight) {
+
+                        oMenu.align("tl", "bl");
+                    
+                    }
+
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _hideMenu
+        * @description Hides the button's menu.
+        * @protected
+        */
+        _hideMenu: function () {
+        
+            var oMenu = this._menu;
+        
+            if (oMenu) {
+        
+                oMenu.hide();
+        
+            }
+        
+        },
+        
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onMouseOver
+        * @description "mouseover" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOver: function (p_oEvent) {
+        
+            if (!this._hasMouseEventHandlers) {
+        
+                this.on("mouseout", this._onMouseOut);
+                this.on("mousedown", this._onMouseDown);
+                this.on("mouseup", this._onMouseUp);
+        
+                this._hasMouseEventHandlers = true;
+        
+            }
+        
+            this.addStateCSSClasses("hover");
+        
+            if (this._activationButtonPressed) {
+        
+                this.addStateCSSClasses("active");
+        
+            }
+        
+        
+            if (this._bOptionPressed) {
+        
+                this.addStateCSSClasses("activeoption");
+            
+            }
+
+
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+            }
+
+        },
+        
+        
+        /**
+        * @method _onMouseOut
+        * @description "mouseout" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOut: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("hover");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }
+        
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.on(document, "mouseup", this._onDocumentMouseUp, 
+                    null, this);
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseUp: function (p_oEvent) {
+        
+            this._activationButtonPressed = false;
+            this._bOptionPressed = false;
+        
+            var sType = this.get("type"),
+                oTarget,
+                oMenuElement;
+        
+            if (sType == "menu" || sType == "split") {
+
+                oTarget = Event.getTarget(p_oEvent);
+                oMenuElement = this._menu.element;
+        
+                if (oTarget != oMenuElement && 
+                    !Dom.isAncestor(oMenuElement, oTarget)) {
+
+                    this.removeStateCSSClasses((sType == "menu" ? 
+                        "active" : "activeoption"));
+            
+                    this._hideMenu();
+
+                }
+        
+            }
+        
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+        },
+        
+        
+        /**
+        * @method _onMouseDown
+        * @description "mousedown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseDown: function (p_oEvent) {
+        
+            var sType,
+                oElement,
+                nX,
+                me;
+        
+        
+            function onMouseUp() {
+            
+                this._hideMenu();
+                this.removeListener("mouseup", onMouseUp);
+            
+            }
+        
+        
+            if ((p_oEvent.which || p_oEvent.button) == 1) {
+        
+        
+                if (!this.hasFocus()) {
+                
+                    this.focus();
+                
+                }
+        
+        
+                sType = this.get("type");
+        
+        
+                if (sType == "split") {
+                
+                    oElement = this.get("element");
+                    nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+        
+                    if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+                        
+                        this.fireEvent("option", p_oEvent);
+        
+                    }
+                    else {
+        
+                        this.addStateCSSClasses("active");
+        
+                        this._activationButtonPressed = true;
+        
+                    }
+        
+                }
+                else if (sType == "menu") {
+        
+                    if (this.isActive()) {
+        
+                        this._hideMenu();
+        
+                        this._activationButtonPressed = false;
+        
+                    }
+                    else {
+        
+                        this._showMenu(p_oEvent);
+        
+                        this._activationButtonPressed = true;
+                    
+                    }
+        
+                }
+                else {
+        
+                    this.addStateCSSClasses("active");
+        
+                    this._activationButtonPressed = true;
+                
+                }
+        
+        
+        
+                if (sType == "split" || sType == "menu") {
+
+                    me = this;
+        
+                    this._hideMenuTimerId = window.setTimeout(function () {
+                    
+                        me.on("mouseup", onMouseUp);
+                    
+                    }, 250);
+        
+                }
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseUp: function (p_oEvent) {
+        
+            var sType = this.get("type");
+        
+        
+            if (this._hideMenuTimerId) {
+        
+                window.clearTimeout(this._hideMenuTimerId);
+        
+            }
+        
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.set("checked", !(this.get("checked")));
+            
+            }
+        
+        
+            this._activationButtonPressed = false;
+            
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+            
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onFocus
+        * @description "focus" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFocus: function (p_oEvent) {
+        
+            var oElement;
+        
+            this.addStateCSSClasses("focus");
+        
+            if (this._activationKeyPressed) {
+        
+                this.addStateCSSClasses("active");
+           
+            }
+        
+            m_oFocusedButton = this;
+        
+        
+            if (!this._hasKeyEventHandlers) {
+        
+                oElement = this._button;
+        
+                Event.on(oElement, "blur", this._onBlur, null, this);
+                Event.on(oElement, "keydown", this._onKeyDown, null, this);
+                Event.on(oElement, "keyup", this._onKeyUp, null, this);
+        
+                this._hasKeyEventHandlers = true;
+        
+            }
+        
+        
+            this.fireEvent("focus", p_oEvent);
+        
+        },
+        
+        
+        /**
+        * @method _onBlur
+        * @description "blur" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onBlur: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("focus");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+
+            }    
+        
+            if (this._activationKeyPressed) {
+        
+                Event.on(document, "keyup", this._onDocumentKeyUp, null, this);
+        
+            }
+        
+        
+            m_oFocusedButton = null;
+        
+            this.fireEvent("blur", p_oEvent);
+           
+        },
+        
+        
+        /**
+        * @method _onDocumentKeyUp
+        * @description "keyup" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentKeyUp: function (p_oEvent) {
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                this._activationKeyPressed = false;
+                
+                Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oMenu = this._menu;
+        
+        
+            if (this.get("type") == "split" && 
+                this._isSplitButtonOptionKey(p_oEvent)) {
+        
+                this.fireEvent("option", p_oEvent);
+        
+            }
+            else if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                if (this.get("type") == "menu") {
+        
+                    this._showMenu(p_oEvent);
+        
+                }
+                else {
+        
+                    this._activationKeyPressed = true;
+                    
+                    this.addStateCSSClasses("active");
+                
+                }
+            
+            }
+        
+        
+            if (oMenu && oMenu.cfg.getProperty("visible") && 
+                Event.getCharCode(p_oEvent) == 27) {
+            
+                oMenu.hide();
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyUp
+        * @description "keyup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyUp: function (p_oEvent) {
+        
+            var sType;
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                sType = this.get("type");
+        
+                if (sType == "checkbox" || sType == "radio") {
+        
+                    this.set("checked", !(this.get("checked")));
+                
+                }
+        
+                this._activationKeyPressed = false;
+        
+                if (this.get("type") != "menu") {
+        
+                    this.removeStateCSSClasses("active");
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onClick
+        * @description "click" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onClick: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                sTitle,
+                oForm,
+                oSrcElement,
+                oElement,
+                nX;
+        
+        
+            switch (sType) {
+        
+            case "radio":
+            case "checkbox":
+    
+                if (this.get("checked")) {
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+                
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+                
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "submit":
+    
+                this.submitForm();
+            
+                break;
+    
+            case "reset":
+    
+                oForm = this.getForm();
+    
+                if (oForm) {
+    
+                    oForm.reset();
+                
+                }
+    
+                break;
+    
+            case "menu":
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.MENUBUTTON_MENU_VISIBLE_TITLE : 
+                                this.MENUBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "split":
+    
+                oElement = this.get("element");
+                nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+    
+                if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+    
+                    return false;
+                
+                }
+                else {
+    
+                    this._hideMenu();
+        
+                    oSrcElement = this.get("srcelement");
+        
+                    if (oSrcElement && oSrcElement.type == "submit") {
+    
+                        this.submitForm();
+                    
+                    }
+                
+                }
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.SPLITBUTTON_OPTION_VISIBLE_TITLE : 
+                                this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            /*
+                It is necessary to call "_addListenersToForm" using 
+                "setTimeout" to make sure that the button's "form" property 
+                returns a node reference.  Sometimes, if you try to get the 
+                reference immediately after appending the field, it is null.
+            */
+        
+            var me = this;
+        
+            window.setTimeout(function () {
+        
+                me._addListenersToForm();
+        
+            }, 0);
+        
+        },
+        
+        
+        /**
+        * @method _onFormReset
+        * @description "reset" event handler for the button's form.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFormReset: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                oMenu = this._menu;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.resetValue("checked");
+        
+            }
+        
+        
+            if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+                this.resetValue("selectedMenuItem");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseDown
+        * @description "mousedown" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseDown: function (p_oEvent) {
+
+            var oTarget = Event.getTarget(p_oEvent),
+                oButtonElement = this.get("element"),
+                oMenuElement = this._menu.element;
+           
+        
+            if (oTarget != oButtonElement && 
+                !Dom.isAncestor(oButtonElement, oTarget) && 
+                oTarget != oMenuElement && 
+                !Dom.isAncestor(oMenuElement, oTarget)) {
+        
+                this._hideMenu();
+        
+                Event.removeListener(document, "mousedown", 
+                    this._onDocumentMouseDown);    
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOption
+        * @description "option" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onOption: function (p_oEvent) {
+        
+            if (this.hasClass("yui-split-button-activeoption")) {
+        
+                this._hideMenu();
+        
+                this._bOptionPressed = false;
+        
+            }
+            else {
+        
+                this._showMenu(p_oEvent);    
+        
+                this._bOptionPressed = true;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayBeforeShow
+        * @description "beforeshow" event handler for the 
+        * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> instance 
+        * serving as the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onOverlayBeforeShow: function (p_sType) {
+        
+            var oMenu = this._menu;
+        
+            oMenu.render(this.get("element").parentNode);
+            
+            oMenu.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuShow
+        * @description "show" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuShow: function (p_sType) {
+        
+            Event.on(document, "mousedown", this._onDocumentMouseDown, 
+                null, this);
+        
+            var sTitle,
+                sState;
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE;
+                sState = "activeoption";
+            
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE;        
+                sState = "active";
+        
+            }
+        
+            this.addStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuHide
+        * @description "hide" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuHide: function (p_sType) {
+            
+            var oMenu = this._menu,
+                sTitle,
+                sState;
+        
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+                sState = "activeoption";
+        
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_DEFAULT_TITLE;        
+                sState = "active";
+            }
+        
+        
+            this.removeStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        
+            if (this.get("type") == "split") {
+        
+                this._bOptionPressed = false;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuKeyDown
+        * @description "keydown" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuKeyDown: function (p_sType, p_aArgs) {
+        
+            var oEvent = p_aArgs[0];
+        
+            if (Event.getCharCode(oEvent) == 27) {
+        
+                this.focus();
+        
+                if (this.get("type") == "split") {
+                
+                    this._bOptionPressed = false;
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuRender
+        * @description "render" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the  
+        * event thatwas fired.
+        */
+        _onMenuRender: function (p_sType) {
+        
+            var oButtonElement = this.get("element"),
+                oButtonParent = oButtonElement.parentNode,
+                oMenuElement = this._menu.element;
+        
+        
+            if (oButtonParent != oMenuElement.parentNode) {
+        
+                oButtonParent.appendChild(oMenuElement);
+            
+            }
+
+            this.set("selectedMenuItem", this.get("selectedMenuItem"));
+
+        },
+        
+        
+        /**
+        * @method _onMenuItemSelected
+        * @description "selectedchange" event handler for each item in the 
+        * button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {MenuItem} p_oItem Object representing the menu item that
+        * subscribed to the event.
+        */
+        _onMenuItemSelected: function (p_sType, p_aArgs, p_oItem) {
+
+            var bSelected = p_aArgs[0];
+
+            if (bSelected) {
+            
+                this.set("selectedMenuItem", p_oItem);
+
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuItemAdded
+        * @description "itemadded" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event
+        * was fired.
+        * @param {<a href="YAHOO.widget.MenuItem.html">
+        * YAHOO.widget.MenuItem</a>} p_oItem Object representing the menu 
+        * item that subscribed to the event.
+        */
+        _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) {
+            
+            var oItem = p_aArgs[0];
+        
+            oItem.cfg.subscribeToConfigEvent("selected", 
+                this._onMenuItemSelected, oItem, this);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuClick
+        * @description "click" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuClick: function (p_sType, p_aArgs) {
+
+            var oItem = p_aArgs[1],
+                oSrcElement;
+        
+            if (oItem) {
+        
+                oSrcElement = this.get("srcelement");
+            
+                if (oSrcElement && oSrcElement.type == "submit") {
+        
+                    this.submitForm();
+            
+                }
+            
+                this._hideMenu();
+            
+            }
+        
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method createButtonElement
+        * @description Creates the button's HTML elements.
+        * @param {String} p_sType String indicating the type of element 
+        * to create.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>}
+        */
+        createButtonElement: function (p_sType) {
+        
+            var sNodeName = this.NODE_NAME,
+                oElement = document.createElement(sNodeName);
+        
+            oElement.innerHTML =  "<" + sNodeName + " class=\"first-child\">" + 
+                (p_sType == "link" ? "<a></a>" : 
+                "<button type=\"button\"></button>") + "</" + sNodeName + ">";
+        
+            return oElement;
+        
+        },
+
+        
+        /**
+        * @method addStateCSSClasses
+        * @description Appends state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        addStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                if (p_sState != "activeoption") {
+        
+                    this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+        
+                }
+        
+                this.addClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeStateCSSClasses
+        * @description Removes state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        removeStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+                this.removeClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method createHiddenFields
+        * @description Creates the button's hidden form field and appends it 
+        * to its parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        createHiddenFields: function () {
+        
+            this.removeHiddenFields();
+        
+            var oForm = this.getForm(),
+                oButtonField,
+                sType,     
+                bCheckable,
+                oMenu,
+                oMenuItem,
+                sName,
+                oValue,
+                oMenuField;
+        
+        
+            if (oForm && !this.get("disabled")) {
+        
+                sType = this.get("type");
+                bCheckable = (sType == "checkbox" || sType == "radio");
+        
+        
+                if (bCheckable || (m_oSubmitTrigger == this)) {
+                
+        
+                    oButtonField = createInputElement(
+                                    (bCheckable ? sType : "hidden"),
+                                    this.get("name"),
+                                    this.get("value"),
+                                    this.get("checked"));
+            
+            
+                    if (oButtonField) {
+            
+                        if (bCheckable) {
+            
+                            oButtonField.style.display = "none";
+            
+                        }
+            
+                        oForm.appendChild(oButtonField);
+            
+                    }
+        
+                }
+                    
+        
+                oMenu = this._menu;
+            
+            
+                if (Menu && oMenu && (oMenu instanceof Menu)) {
+        
+        
+                    oMenuField = oMenu.srcElement;
+                    oMenuItem = this.get("selectedMenuItem");
+
+                    if (oMenuItem) {
+
+                        if (oMenuField && 
+                            oMenuField.nodeName.toUpperCase() == "SELECT") {
+            
+                            oForm.appendChild(oMenuField);
+                            oMenuField.selectedIndex = oMenuItem.index;
+            
+                        }
+                        else {
+            
+                            oValue = (oMenuItem.value === null || 
+                                        oMenuItem.value === "") ? 
+                                        oMenuItem.cfg.getProperty("text") : 
+                                        oMenuItem.value;
+            
+                            sName = this.get("name");
+            
+                            if (oValue && sName) {
+            
+                                oMenuField = createInputElement("hidden", 
+                                                    (sName + "_options"),
+                                                    oValue);
+            
+                                oForm.appendChild(oMenuField);
+            
+                            }
+            
+                        }  
+                    
+                    }
+        
+                }
+            
+            
+                if (oButtonField && oMenuField) {
+        
+                    this._hiddenFields = [oButtonField, oMenuField];
+        
+                }
+                else if (!oButtonField && oMenuField) {
+        
+                    this._hiddenFields = oMenuField;
+                
+                }
+                else if (oButtonField && !oMenuField) {
+        
+                    this._hiddenFields = oButtonField;
+                
+                }
+        
+        
+                return this._hiddenFields;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeHiddenFields
+        * @description Removes the button's hidden form field(s) from its 
+        * parent form.
+        */
+        removeHiddenFields: function () {
+        
+            var oField = this._hiddenFields,
+                nFields,
+                i;
+        
+            function removeChild(p_oElement) {
+        
+                if (Dom.inDocument(p_oElement)) {
+        
+                    p_oElement.parentNode.removeChild(p_oElement);
+                
+                }
+                
+            }
+            
+        
+            if (oField) {
+        
+                if (Lang.isArray(oField)) {
+        
+                    nFields = oField.length;
+                    
+                    if (nFields > 0) {
+                    
+                        i = nFields - 1;
+                        
+                        do {
+        
+                            removeChild(oField[i]);
+        
+                        }
+                        while (i--);
+                    
+                    }
+                
+                }
+                else {
+        
+                    removeChild(oField);
+        
+                }
+        
+                this._hiddenFields = null;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method submitForm
+        * @description Submits the form to which the button belongs.  Returns  
+        * true if the form was submitted successfully, false if the submission 
+        * was cancelled.
+        * @protected
+        * @return {Boolean}
+        */
+        submitForm: function () {
+        
+            var oForm = this.getForm(),
+        
+                oSrcElement = this.get("srcelement"),
+        
+                /*
+                    Boolean indicating if the event fired successfully 
+                    (was not cancelled by any handlers)
+                */
+        
+                bSubmitForm = false,
+                
+                oEvent;
+        
+        
+            if (oForm) {
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+        
+                    m_oSubmitTrigger = this;
+                    
+                }
+        
+        
+                if (YAHOO.env.ua.ie) {
+        
+                    bSubmitForm = oForm.fireEvent("onsubmit");
+        
+                }
+                else {  // Gecko, Opera, and Safari
+        
+                    oEvent = document.createEvent("HTMLEvents");
+                    oEvent.initEvent("submit", true, true);
+        
+                    bSubmitForm = oForm.dispatchEvent(oEvent);
+        
+                }
+        
+        
+                /*
+                    In IE and Safari, dispatching a "submit" event to a form 
+                    WILL cause the form's "submit" event to fire, but WILL NOT 
+                    submit the form.  Therefore, we need to call the "submit" 
+                    method as well.
+                */
+              
+                if ((YAHOO.env.ua.ie || YAHOO.env.ua.webkit) && bSubmitForm) {
+        
+                    oForm.submit();
+                
+                }
+            
+            }
+        
+            return bSubmitForm;
+            
+        },
+        
+        
+        /**
+        * @method init
+        * @description The Button class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+        * be used to create the button.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://
+        * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR
+        * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296">
+        * HTMLElement</a>} p_oElement Object reference for the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+        * used to create the button.
+        * @param {Object} p_oElement Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a 
+        * set of configuration attributes used to create the button.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            var sNodeName = p_oAttributes.type == "link" ? "a" : "button",
+                oSrcElement = p_oAttributes.srcelement,
+                oButton = p_oElement.getElementsByTagName(sNodeName)[0],
+                oInput;
+        
+
+            if (!oButton) {
+
+                oInput = p_oElement.getElementsByTagName("input")[0];
+
+
+                if (oInput) {
+
+                    oButton = document.createElement("button");
+                    oButton.setAttribute("type", "button");
+
+                    oInput.parentNode.replaceChild(oButton, oInput);
+                
+                }
+
+            }
+
+            this._button = oButton;
+        
+
+            YAHOO.widget.Button.superclass.init.call(this, p_oElement, 
+                p_oAttributes);
+        
+        
+            m_oButtons[this.get("id")] = this;
+        
+        
+            this.addClass(this.CSS_CLASS_NAME);
+            
+            this.addClass("yui-" + this.get("type") + "-button");
+        
+            Event.on(this._button, "focus", this._onFocus, null, this);
+            this.on("mouseover", this._onMouseOver);
+            this.on("click", this._onClick);
+            this.on("appendTo", this._onAppendTo);
+            
+        
+            var oContainer = this.get("container"),
+                oElement = this.get("element"),
+                bElInDoc = Dom.inDocument(oElement),
+                oParentNode;
+
+
+            if (oContainer) {
+        
+                if (oSrcElement && oSrcElement != oElement) {
+                
+                    oParentNode = oSrcElement.parentNode;
+
+                    if (oParentNode) {
+                    
+                        oParentNode.removeChild(oSrcElement);
+                    
+                    }
+
+                }
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+            else if (!bElInDoc && oSrcElement && oSrcElement != oElement) {
+
+                oParentNode = oSrcElement.parentNode;
+        
+                if (oParentNode) {
+        
+                    this.fireEvent("beforeAppendTo", {
+                        type: "beforeAppendTo",
+                        target: oParentNode
+                    });
+            
+                    oParentNode.replaceChild(oElement, oSrcElement);
+            
+                    this.fireEvent("appendTo", {
+                        type: "appendTo",
+                        target: oParentNode
+                    });
+                
+                }
+        
+            }
+            else if (this.get("type") != "link" && bElInDoc && oSrcElement && 
+                oSrcElement == oElement) {
+        
+                this._addListenersToForm();
+        
+            }
+        
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.Button.superclass.initAttributes.call(this, 
+                oAttributes);
+        
+        
+            /**
+            * @attribute type
+            * @description String specifying the button's type.  Possible 
+            * values are: "push," "link," "submit," "reset," "checkbox," 
+            * "radio," "menu," and "split."
+            * @default "push"
+            * @type String
+            */
+            this.setAttributeConfig("type", {
+        
+                value: (oAttributes.type || "push"),
+                validator: Lang.isString,
+                writeOnce: true,
+                method: this._setType
+        
+            });
+        
+        
+            /**
+            * @attribute label
+            * @description String specifying the button's text label 
+            * or innerHTML.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("label", {
+        
+                value: oAttributes.label,
+                validator: Lang.isString,
+                method: this._setLabel
+        
+            });
+        
+        
+            /**
+            * @attribute value
+            * @description Object specifying the value for the button.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @attribute name
+            * @description String specifying the name for the button.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @attribute tabindex
+            * @description Number specifying the tabindex for the button.
+            * @default null
+            * @type Number
+            */
+            this.setAttributeConfig("tabindex", {
+        
+                value: oAttributes.tabindex,
+                validator: Lang.isNumber,
+                method: this._setTabIndex
+        
+            });
+        
+        
+            /**
+            * @attribute title
+            * @description String specifying the title for the button.
+            * @default null
+            * @type String
+            */
+            this.configureAttribute("title", {
+        
+                value: oAttributes.title,
+                validator: Lang.isString,
+                method: this._setTitle
+        
+            });
+        
+        
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the button should be disabled.  
+            * (Disabled buttons are dimmed and will not respond to user input 
+            * or fire events.  Does not apply to button's of type "link.")
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @attribute href
+            * @description String specifying the href for the button.  Applies
+            * only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("href", {
+        
+                value: oAttributes.href,
+                validator: Lang.isString,
+                method: this._setHref
+        
+            });
+        
+        
+            /**
+            * @attribute target
+            * @description String specifying the target for the button.  
+            * Applies only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("target", {
+        
+                value: oAttributes.target,
+                validator: Lang.isString,
+                method: this._setTarget
+        
+            });
+        
+        
+            /**
+            * @attribute checked
+            * @description Boolean indicating if the button is checked. 
+            * Applies only to buttons of type "radio" and "checkbox."
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("checked", {
+        
+                value: (oAttributes.checked || false),
+                validator: Lang.isBoolean,
+                method: this._setChecked
+        
+            });
+        
+        
+            /**
+            * @attribute container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button's markup should be 
+            * rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute srcelement
+            * @description Object reference to the HTML element (either 
+            * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code>) 
+            * used to create the button.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("srcelement", {
+        
+                value: oAttributes.srcelement,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute menu
+            * @description Object specifying the menu for the button.  
+            * The value can be one of the following:
+            * <ul>
+            * <li>Object specifying a <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> instance.</li>
+            * <li>Object specifying a <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instance.</li>
+            * <li>String specifying the id attribute of the <code>&#60;div&#62;
+            * </code> element used to create the menu.  By default the menu 
+            * will be created as an instance of 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>.  
+            * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME">
+            * default CSS class name for YAHOO.widget.Menu</a> is applied to 
+            * the <code>&#60;div&#62;</code> element, it will be created as an
+            * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu
+            * </a>.</li><li>String specifying the id attribute of the 
+            * <code>&#60;select&#62;</code> element used to create the menu.
+            * </li><li>Object specifying the <code>&#60;div&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Object specifying the <code>&#60;select&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Array of object literals, each representing a set of 
+            * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> 
+            * configuration attributes.</li>
+            * <li>Array of strings representing the text labels for each menu 
+            * item in the menu.</li>
+            * </ul>
+            * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a 
+            * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a 
+            * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+            * one-html.html#ID-58190037">HTMLElement</a>|String|Array
+            * @default null
+            */
+            this.setAttributeConfig("menu", {
+        
+                value: null,
+                method: this._setMenu,
+                writeOnce: true
+            
+            });
+        
+        
+            /**
+            * @attribute lazyloadmenu
+            * @description Boolean indicating the value to set for the 
+            * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a>
+            * configuration property of the button's menu.  Setting 
+            * "lazyloadmenu" to <code>true </code> will defer rendering of 
+            * the button's menu until the first time it is made visible.  
+            * If "lazyloadmenu" is set to <code>false</code>, the button's 
+            * menu will be rendered immediately if the button is in the 
+            * document, or in response to the button's "appendTo" event if 
+            * the button is not yet in the document.  In either case, the 
+            * menu is rendered into the button's parent HTML element.  
+            * <em>This attribute does not apply if a 
+            * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> 
+            * instance is passed as the value of the button's "menu" 
+            * configuration attribute. <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instances should be rendered before 
+            * being set as the value for the "menu" configuration 
+            * attribute.</em>
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig("lazyloadmenu", {
+        
+                value: (oAttributes.lazyloadmenu === false ? false : true),
+                validator: Lang.isBoolean,
+                writeOnce: true
+        
+            });
+
+
+            /**
+            * @attribute menuclassname
+            * @description String representing the CSS class name to be 
+            * applied to the root element of the button's menu.
+            * @type String
+            * @default "yui-button-menu"
+            */
+            this.setAttributeConfig("menuclassname", {
+        
+                value: (oAttributes.menuclassname || "yui-button-menu"),
+                validator: Lang.isString,
+                method: this._setMenuClassName,
+                writeOnce: true
+        
+            });        
+
+
+            /**
+            * @attribute selectedMenuItem
+            * @description Object representing the item in the button's menu 
+            * that is currently selected.
+            * @type Number
+            * @default null
+            */
+            this.setAttributeConfig("selectedMenuItem", {
+        
+                value: null,
+                method: this._setSelectedMenuItem
+        
+            });
+        
+        
+            /**
+            * @attribute onclick
+            * @description Object literal representing the code to be executed  
+            * when the button is clicked.  Format:<br> <code> {<br> 
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An object to pass back to the handler.<br> 
+            * <strong>scope:</strong> Object &#47;&#47;  The object to use 
+            * for the scope of the handler.<br> } </code>
+            * @type Object
+            * @default null
+            */
+            this.setAttributeConfig("onclick", {
+        
+                value: oAttributes.onclick,
+                method: this._setOnClick
+            
+            });
+
+
+            /**
+            * @attribute focusmenu
+            * @description Boolean indicating whether or not the button's menu 
+            * should be focused when it is made visible.
+            * @type Boolean
+            * @default true
+            */
+            this.setAttributeConfig("focusmenu", {
+        
+                value: (oAttributes.focusmenu === false ? false : true),
+                validator: Lang.isBoolean
+        
+            });
+
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Causes the button to receive the focus and fires the 
+        * button's "focus" event.
+        */
+        focus: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method blur
+        * @description Causes the button to lose focus and fires the button's
+        * "blur" event.
+        */
+        blur: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.blur();
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method hasFocus
+        * @description Returns a boolean indicating whether or not the button 
+        * has focus.
+        * @return {Boolean}
+        */
+        hasFocus: function () {
+        
+            return (m_oFocusedButton == this);
+        
+        },
+        
+        
+        /**
+        * @method isActive
+        * @description Returns a boolean indicating whether or not the button 
+        * is active.
+        * @return {Boolean}
+        */
+        isActive: function () {
+        
+            return this.hasClass(this.CSS_CLASS_NAME + "-active");
+        
+        },
+        
+        
+        /**
+        * @method getMenu
+        * @description Returns a reference to the button's menu.
+        * @return {<a href="YAHOO.widget.Overlay.html">
+        * YAHOO.widget.Overlay</a>|<a 
+        * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        getMenu: function () {
+        
+            return this._menu;
+        
+        },
+        
+        
+        /**
+        * @method getForm
+        * @description Returns a reference to the button's parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-
+        * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>}
+        */
+        getForm: function () {
+        
+            return this._button.form;
+        
+        },
+        
+        
+        /** 
+        * @method getHiddenFields
+        * @description Returns an <code>&#60;input&#62;</code> element or 
+        * array of form elements used to represent the button when its parent 
+        * form is submitted.  
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        getHiddenFields: function () {
+        
+            return this._hiddenFields;
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button's element from its parent element and 
+        * removes all event handlers.
+        */
+        destroy: function () {
+        
+        
+            var oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                oMenu = this._menu,
+                aButtons;
+        
+            if (oMenu) {
+        
+
+                if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) {
+
+                    m_oOverlayManager.remove(oMenu);
+
+                }
+        
+                oMenu.destroy();
+        
+            }
+        
+        
+            Event.purgeElement(oElement);
+            Event.purgeElement(this._button);
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+            Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            Event.removeListener(document, "mousedown", 
+                this._onDocumentMouseDown);
+        
+        
+            var oForm = this.getForm();
+            
+            if (oForm) {
+        
+                Event.removeListener(oForm, "reset", this._onFormReset);
+                Event.removeListener(oForm, "submit", this.createHiddenFields);
+        
+            }
+
+
+            this.unsubscribeAll();
+
+            if (oParentNode) {
+
+                oParentNode.removeChild(oElement);
+            
+            }
+        
+        
+            delete m_oButtons[this.get("id")];
+
+            aButtons = Dom.getElementsByClassName(this.CSS_CLASS_NAME, 
+                                this.NODE_NAME, oForm); 
+
+            if (Lang.isArray(aButtons) && aButtons.length === 0) {
+
+                Event.removeListener(oForm, "keypress", 
+                        YAHOO.widget.Button.onFormKeyPress);
+
+            }
+
+        
+        },
+        
+        
+        fireEvent: function (p_sType , p_aArgs) {
+        
+                       var sType = arguments[0];
+               
+                       //  Disabled buttons should not respond to DOM events
+               
+                       if (this.DOM_EVENTS[sType] && this.get("disabled")) {
+               
+                               return;
+               
+                       }
+               
+                       return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("Button " + this.get("id"));
+        
+        }
+    
+    });
+    
+    
+    /**
+    * @method YAHOO.widget.Button.onFormKeyPress
+    * @description "keypress" event handler for the button's form.
+    * @param {Event} p_oEvent Object representing the DOM event object passed 
+    * back by the event utility (YAHOO.util.Event).
+    */
+    YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) {
+    
+        var oTarget = Event.getTarget(p_oEvent),
+            nCharCode = Event.getCharCode(p_oEvent),
+            sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(),
+            sType = oTarget.type,
+    
+            /*
+                Boolean indicating if the form contains any enabled or 
+                disabled YUI submit buttons
+            */
+    
+            bFormContainsYUIButtons = false,
+    
+            oButton,
+    
+            oYUISubmitButton,   // The form's first, enabled YUI submit button
+    
+            /*
+                 The form's first, enabled HTML submit button that precedes any 
+                 YUI submit button
+            */
+    
+            oPrecedingSubmitButton,
+            
+    
+            /*
+                 The form's first, enabled HTML submit button that follows a 
+                 YUI button
+            */
+            
+            oFollowingSubmitButton; 
+    
+    
+        function isSubmitButton(p_oElement) {
+    
+            var sId,
+                oSrcElement;
+    
+            switch (p_oElement.nodeName.toUpperCase()) {
+    
+            case "INPUT":
+            case "BUTTON":
+            
+                if (p_oElement.type == "submit" && !p_oElement.disabled) {
+                    
+                    if (!bFormContainsYUIButtons && 
+                        !oPrecedingSubmitButton) {
+
+                        oPrecedingSubmitButton = p_oElement;
+
+                    }
+                    
+                    if (oYUISubmitButton && !oFollowingSubmitButton) {
+                    
+                        oFollowingSubmitButton = p_oElement;
+                    
+                    }
+                
+                }
+
+                break;
+            
+
+            default:
+            
+                sId = p_oElement.id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+
+                        bFormContainsYUIButtons = true;
+        
+                        if (!oButton.get("disabled")) {
+
+                            oSrcElement = oButton.get("srcelement");
+    
+                            if (!oYUISubmitButton &&
+                                (oButton.get("type") == "submit" || 
+                                (oSrcElement && oSrcElement.type == "submit"))) 
+                            {
+
+                                oYUISubmitButton = oButton;
+                            
+                            }
+                        
+                        }
+                        
+                    }
+                
+                }
+
+                break;
+    
+            }
+    
+        }
+    
+    
+        if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || 
+            sType == "password" || sType == "checkbox" || sType == "radio" || 
+            sType == "file")) || sNodeName == "SELECT"))
+        {
+    
+            Dom.getElementsBy(isSubmitButton, "*", this);
+    
+    
+            if (oPrecedingSubmitButton) {
+    
+                /*
+                     Need to set focus to the first enabled submit button
+                     to make sure that IE includes its name and value 
+                     in the form's data set.
+                */
+    
+                oPrecedingSubmitButton.focus();
+            
+            }
+            else if (!oPrecedingSubmitButton && oYUISubmitButton) {
+    
+                if (oFollowingSubmitButton) {
+    
+                    /*
+                        Need to call "preventDefault" to ensure that 
+                        the name and value of the regular submit button 
+                        following the YUI button doesn't get added to the 
+                        form's data set when it is submitted.
+                    */
+    
+                    Event.preventDefault(p_oEvent);
+                
+                }
+    
+                oYUISubmitButton.submitForm();
+    
+            }
+            
+        }
+    
+    };
+    
+    
+    /**
+    * @method YAHOO.widget.Button.addHiddenFieldsToForm
+    * @description Searches the specified form and adds hidden fields for  
+    * instances of YAHOO.widget.Button that are of type "radio," "checkbox," 
+    * "menu," and "split."
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference 
+    * for the form to search.
+    */
+    YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) {
+    
+        var aButtons = Dom.getElementsByClassName(
+                            YAHOO.widget.Button.prototype.CSS_CLASS_NAME, 
+                            "*", 
+                            p_oForm),
+    
+            nButtons = aButtons.length,
+            oButton,
+            sId,
+            i;
+    
+        if (nButtons > 0) {
+    
+    
+            for (i = 0; i < nButtons; i++) {
+    
+                sId = aButtons[i].id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+           
+                        oButton.createHiddenFields();
+                        
+                    }
+                
+                }
+            
+            }
+    
+        }
+    
+    };
+    
+
+    /**
+    * @method YAHOO.widget.Button.getButton
+    * @description Returns a button with the specified id.
+    * @param {String} p_sId String specifying the id of the root node of the 
+    * HTML element representing the button to be retrieved.
+    * @return {YAHOO.widget.Button}
+    */
+    YAHOO.widget.Button.getButton = function (p_sId) {
+
+        var oButton = m_oButtons[p_sId];
+
+        if (oButton) {
+        
+            return oButton;
+        
+        }
+
+    };
+    
+    
+    // Events
+    
+    
+    /**
+    * @event focus
+    * @description Fires when the menu item receives focus.  Passes back a  
+    * single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event blur
+    * @description Fires when the menu item loses the input focus.  Passes back  
+    * a single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for  
+    * more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event option
+    * @description Fires when the user invokes the button's option.  Passes 
+    * back a single object representing the original DOM event (either 
+    * "mousedown" or "keydown") that caused the "option" event to fire.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+
+})();
+(function () {
+
+    // Shorthard for utilities
+    
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Button = YAHOO.widget.Button,  
+    
+        // Private collection of radio buttons
+    
+        m_oButtons = {};
+
+
+
+    /**
+    * The ButtonGroup class creates a set of buttons that are mutually 
+    * exclusive; checking one button in the set will uncheck all others in the 
+    * button group.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;div&#62;</code> element of the button group.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+    * specifying the <code>&#60;div&#62;</code> element of the button group.
+    * @param {Object} p_oElement Object literal specifying a set of 
+    * configuration attributes used to create the button group.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set 
+    * of configuration attributes used to create the button group.
+    * @namespace YAHOO.widget
+    * @class ButtonGroup
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+    YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor,
+            sNodeName,
+            oElement,
+            sId;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                sId = Dom.generateId();
+    
+                p_oElement.id = sId;
+    
+    
+            }
+    
+    
+    
+            fnSuperClass.call(this, (this._createGroupElement()), p_oElement);
+    
+        }
+        else if (Lang.isString(p_oElement)) {
+    
+            oElement = Dom.get(p_oElement);
+    
+            if (oElement) {
+            
+                if (oElement.nodeName.toUpperCase() == this.NODE_NAME) {
+    
+            
+                    fnSuperClass.call(this, oElement, p_oAttributes);
+    
+                }
+    
+            }
+        
+        }
+        else {
+    
+            sNodeName = p_oElement.nodeName.toUpperCase();
+    
+            if (sNodeName && sNodeName == this.NODE_NAME) {
+        
+                if (!p_oElement.id) {
+        
+                    p_oElement.id = Dom.generateId();
+        
+        
+                }
+        
+        
+                fnSuperClass.call(this, p_oElement, p_oAttributes);
+    
+            }
+    
+        }
+    
+    };
+    
+    
+    YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _buttons
+        * @description Array of buttons in the button group.
+        * @default null
+        * @protected
+        * @type Array
+        */
+        _buttons: null,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the tag to be used for the button 
+        * group's element. 
+        * @default "DIV"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "DIV",
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied  
+        * to the button group's element.
+        * @default "yui-buttongroup"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-buttongroup",
+    
+    
+    
+        // Protected methods
+        
+        
+        /**
+        * @method _createGroupElement
+        * @description Creates the button group's element.
+        * @protected
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>}
+        */
+        _createGroupElement: function () {
+        
+            var oElement = document.createElement(this.NODE_NAME);
+        
+            return oElement;
+        
+        },
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button groups's 
+        * "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for
+        * the button group's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            var nButtons = this.getCount(),
+                i;
+        
+            if (nButtons > 0) {
+        
+                i = nButtons - 1;
+                
+                do {
+        
+                    this._buttons[i].set("disabled", p_bDisabled);
+                
+                }
+                while (i--);
+        
+            }
+        
+        },
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                nCharCode = Event.getCharCode(p_oEvent),
+                sId = oTarget.parentNode.parentNode.id,
+                oButton = m_oButtons[sId],
+                nIndex = -1;
+        
+        
+            if (nCharCode == 37 || nCharCode == 38) {
+        
+                nIndex = (oButton.index === 0) ? 
+                            (this._buttons.length - 1) : (oButton.index - 1);
+            
+            }
+            else if (nCharCode == 39 || nCharCode == 40) {
+        
+                nIndex = (oButton.index === (this._buttons.length - 1)) ? 
+                            0 : (oButton.index + 1);
+        
+            }
+        
+        
+            if (nIndex > -1) {
+        
+                this.check(nIndex);
+                this.getButton(nIndex).focus();
+            
+            }        
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            var aButtons = this._buttons,
+                nButtons = aButtons.length,
+                i;
+        
+            for (i = 0; i < nButtons; i++) {
+        
+                aButtons[i].appendTo(this.get("element"));
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onButtonCheckedChange
+        * @description "checkedChange" event handler for each button in the 
+        * button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object representing the button that fired the event.
+        */
+        _onButtonCheckedChange: function (p_oEvent, p_oButton) {
+        
+            var bChecked = p_oEvent.newValue,
+                oCheckedButton = this.get("checkedButton");
+        
+            if (bChecked && oCheckedButton != p_oButton) {
+        
+                if (oCheckedButton) {
+        
+                    oCheckedButton.set("checked", false, true);
+        
+                }
+        
+                this.set("checkedButton", p_oButton);
+                this.set("value", p_oButton.get("value"));
+        
+            }
+            else if (oCheckedButton && !oCheckedButton.set("checked")) {
+        
+                oCheckedButton.set("checked", true, true);
+        
+            }
+           
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method init
+        * @description The ButtonGroup class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;div&#62;</code> element of the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+        * specifying the <code>&#60;div&#62;</code> element of the button group.
+        * @param {Object} p_oElement Object literal specifying a set of  
+        * configuration attributes used to create the button group.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a
+        * set of configuration attributes used to create the button group.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            this._buttons = [];
+        
+            YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, 
+                    p_oAttributes);
+        
+            this.addClass(this.CSS_CLASS_NAME);
+        
+        
+            var aButtons = this.getElementsByClassName("yui-radio-button");
+        
+        
+            if (aButtons.length > 0) {
+        
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+        
+        
+            function isRadioButton(p_oElement) {
+        
+                return (p_oElement.type == "radio");
+        
+            }
+        
+            aButtons = 
+                Dom.getElementsBy(isRadioButton, "input", this.get("element"));
+        
+        
+            if (aButtons.length > 0) {
+        
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+            this.on("keydown", this._onKeyDown);
+            this.on("appendTo", this._onAppendTo);
+        
+
+            var oContainer = this.get("container");
+
+            if (oContainer) {
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);            
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+        
+        
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button group.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button group.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.ButtonGroup.superclass.initAttributes.call(
+                this, oAttributes);
+        
+        
+            /**
+            * @attribute name
+            * @description String specifying the name for the button group.  
+            * This name will be applied to each button in the button group.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the button group should be 
+            * disabled.  Disabling the button group will disable each button 
+            * in the button group.  Disabled buttons are dimmed and will not 
+            * respond to user input or fire events.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @attribute value
+            * @description Object specifying the value for the button group.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @attribute container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button group's markup
+            * should be rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @attribute checkedButton
+            * @description Reference for the button in the button group that 
+            * is checked.
+            * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+            * @default null
+            */
+            this.setAttributeConfig("checkedButton", {
+        
+                value: null
+        
+            });
+        
+        },
+        
+        
+        /**
+        * @method addButton
+        * @description Adds the button to the button group.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object reference for the <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instance to be added to the button group.
+        * @param {String} p_oButton String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+        * ID-33759296">HTMLElement</a>} p_oButton Object reference for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {Object} p_oButton Object literal specifying a set of 
+        * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> 
+        * configuration attributes used to configure the button to be added to 
+        * the button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} 
+        */
+        addButton: function (p_oButton) {
+        
+            var oButton,
+                oButtonElement,
+                oGroupElement,
+                nIndex,
+                sButtonName,
+                sGroupName;
+        
+        
+            if (p_oButton instanceof Button && 
+                p_oButton.get("type") == "radio") {
+        
+                oButton = p_oButton;
+        
+            }
+            else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) {
+        
+                p_oButton.type = "radio";
+        
+                oButton = new Button(p_oButton);
+
+            }
+            else {
+        
+                oButton = new Button(p_oButton, { type: "radio" });
+        
+            }
+        
+        
+            if (oButton) {
+        
+                nIndex = this._buttons.length;
+                sButtonName = oButton.get("name");
+                sGroupName = this.get("name");
+        
+                oButton.index = nIndex;
+        
+                this._buttons[nIndex] = oButton;
+                m_oButtons[oButton.get("id")] = oButton;
+        
+        
+                if (sButtonName != sGroupName) {
+        
+                    oButton.set("name", sGroupName);
+                
+                }
+        
+        
+                if (this.get("disabled")) {
+        
+                    oButton.set("disabled", true);
+        
+                }
+        
+        
+                if (oButton.get("checked")) {
+        
+                    this.set("checkedButton", oButton);
+        
+                }
+
+                
+                oButtonElement = oButton.get("element");
+                oGroupElement = this.get("element");
+                
+                if (oButtonElement.parentNode != oGroupElement) {
+                
+                    oGroupElement.appendChild(oButtonElement);
+                
+                }
+        
+                
+                oButton.on("checkedChange", 
+                    this._onButtonCheckedChange, oButton, this);
+        
+        
+                return oButton;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method addButtons
+        * @description Adds the array of buttons to the button group.
+        * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instances to be added 
+        * to the button group.
+        * @param {Array} p_aButtons Array of strings specifying the id 
+        * attribute of the <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+        * </code> elements to be used to create the buttons to be added to the 
+        * button group.
+        * @param {Array} p_aButtons Array of object references for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> elements 
+        * to be used to create the buttons to be added to the button group.
+        * @param {Array} p_aButtons Array of object literals, each containing
+        * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>  
+        * configuration attributes used to configure each button to be added 
+        * to the button group.
+        * @return {Array}
+        */
+        addButtons: function (p_aButtons) {
+    
+            var nButtons,
+                oButton,
+                aButtons,
+                i;
+        
+            if (Lang.isArray(p_aButtons)) {
+            
+                nButtons = p_aButtons.length;
+                aButtons = [];
+        
+                if (nButtons > 0) {
+        
+                    for (i = 0; i < nButtons; i++) {
+        
+                        oButton = this.addButton(p_aButtons[i]);
+                        
+                        if (oButton) {
+        
+                            aButtons[aButtons.length] = oButton;
+        
+                        }
+                    
+                    }
+        
+                    if (aButtons.length > 0) {
+        
+        
+                        return aButtons;
+        
+                    }
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeButton
+        * @description Removes the button at the specified index from the 
+        * button group.
+        * @param {Number} p_nIndex Number specifying the index of the button 
+        * to be removed from the button group.
+        */
+        removeButton: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex),
+                nButtons,
+                i;
+            
+            if (oButton) {
+        
+        
+                this._buttons.splice(p_nIndex, 1);
+                delete m_oButtons[oButton.get("id")];
+        
+                oButton.removeListener("checkedChange", 
+                    this._onButtonCheckedChange);
+
+                oButton.destroy();
+        
+        
+                nButtons = this._buttons.length;
+                
+                if (nButtons > 0) {
+        
+                    i = this._buttons.length - 1;
+                    
+                    do {
+        
+                        this._buttons[i].index = i;
+        
+                    }
+                    while (i--);
+                
+                }
+        
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButton
+        * @description Returns the button at the specified index.
+        * @param {Number} p_nIndex The index of the button to retrieve from the 
+        * button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButton: function (p_nIndex) {
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                return this._buttons[p_nIndex];
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButtons
+        * @description Returns an array of the buttons in the button group.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            return this._buttons;
+        
+        },
+        
+        
+        /**
+        * @method getCount
+        * @description Returns the number of buttons in the button group.
+        * @return {Number}
+        */
+        getCount: function () {
+        
+            return this._buttons.length;
+        
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Sets focus to the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to focus. 
+        */
+        focus: function (p_nIndex) {
+        
+            var oButton,
+                nButtons,
+                i;
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                oButton = this._buttons[p_nIndex];
+                
+                if (oButton) {
+        
+                    oButton.focus();
+        
+                }
+            
+            }
+            else {
+        
+                nButtons = this.getCount();
+        
+                for (i = 0; i < nButtons; i++) {
+        
+                    oButton = this._buttons[i];
+        
+                    if (!oButton.get("disabled")) {
+        
+                        oButton.focus();
+                        break;
+        
+                    }
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method check
+        * @description Checks the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to check. 
+        */
+        check: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex);
+            
+            if (oButton) {
+        
+                oButton.set("checked", true);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button group's element from its parent 
+        * element and removes all event handlers.
+        */
+        destroy: function () {
+        
+        
+            var nButtons = this._buttons.length,
+                oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                i;
+            
+            if (nButtons > 0) {
+        
+                i = this._buttons.length - 1;
+        
+                do {
+        
+                    this._buttons[i].destroy();
+        
+                }
+                while (i--);
+            
+            }
+        
+        
+            Event.purgeElement(oElement);
+            
+        
+            oParentNode.removeChild(oElement);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button group.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("ButtonGroup " + this.get("id"));
+        
+        }
+    
+    });
+
+})();
+YAHOO.register("button", YAHOO.widget.Button, {version: "2.5.0", build: "895"});
index 3c04748c14f8a35fd5ab5d6600389df5cbcd7688..9de846581b131d3b63ec919e44ff77908d13ea5a 100755 (executable)
 Calendar Release Notes
 
-*** version 2.3.0 ***
-
-       - Added checks to select, selectCell, deselect and deselectCell methods to ensure the Calendar/Calendar group was not set to an invalid state by programmatically selecting unselectable dates or cells.
-       - Added new locale configuration properties for the Month/Year label used in the Calendar header (MY_LABEL_MONTH_POSITION, MY_LABEL_YEAR_POSITION, MY_LABEL_YEAR_SUFFIX, MY_LABEL_MONTH_SUFFIX). Japan is an example locale, where customization of the Month/Year label is required.
-       - Changed "first", "last" class names to "first-of-type", "last-of-type", to avoid collision with YUI Grids' use of the "first" class name.
-       - Added public isDateOOB method, to check if a given date is outside of the minimum/maximum configuration dates of the Calendar.
-       - Deprecated YAHOO.widget.Calendar.browser, refactored to use YAHOO.env.ua instead.
-       - Removed overflow:hidden from default Calendar/CalendarGroup container for non-IE6 browsers to fix clipping issue with IE7 when CalendarGroup was inside a box with a specific width. overflow:hidden is still required for IE6 with an iframe shim.
-       - Added Opera container width calculation fix to CalendarGroup.show method, to fix incorrect wrapping when using a CalendarGroup which is initially rendered hidden (display:none). Previously this fix was only applied on render.
-
-*** version 2.2.2 ***
-
-       - Fixed problem with selected dates being shared across instances, when more than one Calendar/CalendarGroup was on the page
-
-*** version 2.2.1 ***
-
-       - Fixed problem with selectCell adding duplicate selected date entries for dates which were already selected
-       - Fixed problem with CalendarGroup iframe shim not covering the CalendarGroup title area
-       - Removed javascript:void(null) from close button and cell links which was interrupting form submission and firing onbeforeunload in IE
-       - Fixed problem with CalendarGroup getSelectedDates returning invalid results, when used in conjunction with the "selected" Config property (either passed in the constructor config argument or set seperately after construction)
-       - Refactored Calendar and CalendarGroup to improve performance, especially when working with a large number of instances in IE6
-
-*** version 2.2.0 ***
-
-       - Image customization can now be done through CSS. Images for Close, Left and Right Arrows are now pulled in using CSS defined in calendar.css and by default use relative paths to the images in the same directory as calendar.css. 
-       - Deprecated Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties. Customizations based on older releases which set these properties will still function as expected.
-       - Deprecated CalendarGroup.CSS_2UPCLOSE. Calendar's Style.CSS_CLOSE property now represents the new default CSS class (calclose) for the close button. CSS_2UPCLOSE is still applied along with CSS_CLOSE to the new markup for the close button to support existing customizations of the CSS_2UPCLOSE CSS class (close-icon)
-       - Fixed problem with Safari setting Calendar pages to incorrect dates if the pages spanned a year boundary in CalendarGroups with 3 or more pages, due to a bug in Safari's implementation of Date setMonth
-       - Fixed problem with CalendarGroup setMonth rendering Calendar pages with incorrect dates in all browsers if current pages spanned year boundary
-       - Fixed incorrect CalendarGroup logging statement in calendar-debug.js
-       - Fixed domEventMap support for Safari versions prior to 2.0.2, caused by hasOwnProperty not being supported
-       - Removed unused private property : _pageDate from Calendar class
-
-*** version 0.12.2 ***
-
-       - Corrected documentation for clearTime function to reflect the change from midnight to noon
-
-*** version 0.12.1 ***
-
-       - Calendar and CalendarGroup now automatically parse the argument passed to setMonth and setYear into an integer, eliminating potential concatenation bugs. 
-
-*** version 0.12 ***
-
-       - New documentation format implemented
-       - Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone represents the single Calendar instance, and CalendarGroup represents an n-up instance, defaulting to 2up
-       - Added semantic style classes to Calendar elements to allow for custom styling solely using CSS.
-       - Remapped all configuration properties to use the Config object (familiar to those who use the Container collection of controls). Property names are the same as their previous counterparts, but wrapped into Calendar.cfg, allowing for runtime reconfiguration of most properties
-       - Added "title" property for setting the Calendar title
-       - Added "close" property for enabling and disabling the close icon
-       - Added "iframe" property for enabling an iframe shim in Internet Explorer 6 and below to fix the select bleed-through bug
-       - pageDate moved to property:  "pagedate"
-       - selectedDates moved to property:  "selected"
-       - minDate moved to property : "mindate", which accepts a JavaScript Date object like its predecessor, but also supports string dates
-       - maxDate moved to property : "maxdate", which accepts a JavaScript Date object like its predecessor, but also supports string dates
-       - Moved style declarations to initStyles function
-       - Optimized event handling in doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the listener to the outer Calendar container, and only reacting to events on cells with the "selectable" CSS class.
-       - Added domEventMap field for applying DOM event listeners to cells containing specific class and tag combinations.
-       - Moved all cell DOM event attachment to applyListeners function
-       - Added getDateByCellId / getDateFieldsByCellId helper functions
-       - Corrected DateMath.getWeekNumber to comply with ISO week number handling
-       - Separated renderCellDefault style portions into styleCellDefault function for easy extension
-       - Deprecated onBeforeSelect. Created beforeSelectEvent which automatically subscribes to its deprecated predecessor.
-       - Deprecated onSelect. Created selectEvent, which automatically subscribes to its deprecated predecessor.
-       - Deprecated onBeforeDeselect. Created beforeSelectEvent which automatically subscribes to its deprecated predecessor.
-       - Deprecated onDeselect. Created beforeDeselectEvent, which automatically subscribes to its deprecated predecessor.
-       - Deprecated onChangePage. Created changePageEvent, which automatically subscribes to its deprecated predecessor.
-       - Deprecated onRender. Created renderEvent, which automatically subscribes to its deprecated predecessor.
-       - Deprecated onReset. Created resetEvent, which automatically subscribes to its deprecated predecessor.
-       - Deprecated onClear. Created clearEvent, which automatically subscribes to its deprecated predecessor.
-       - Corrected setMonth documentation to refer to 0-11 indexed months.
-       - Added show and hide methods to Calendar for setting the Calendar's display property.
-       - Optimized internal render classes to use innerHTML and string buffers 
-       - Removed wireCustomEvents function
-       - Removed wireDefaultEvents function
-       - Removed doNextMonth / doPreviousMonth
-       - Removed all buildShell (header, body, footer) functions, since the Calendar shell is now built dynamically on each render
-       - Wired all CalendarGroup events and configuration properties to be properly delegated to Calendar
-       - Augmented CalendarGroup with all built-in renderers, label functions, hide, show, and initStyles, creating API transparency between Calendar and CalendarGroup.
-       - Made all tagName, createElement, and entity references XHTML compliant
-       - Fixed Daylight Saving Time bug for Brazilian time zone
-
-*** version 0.11.3 ***
-
-       - Calendar_Core: Added arguments for selected/deselected dates to onSelect/onDeselect
-       - CalendarGroup: Fixed bug where selected dates passed to constructor were not represented in selectedDates
-       - Calendar2up: Now displays correctly in Opera 9
-
-*** version 0.11.0 ***
-
-       - DateMath: DateMath.add now properly adds weeks
-       - DateMath: between() function added
-       - DateMath: getWeekNumber() fixed to take starting day of week into account
-       - All references to Calendar's built in CSS class handlers are removed, replaced with calls to Dom utility (addClass, removeClass)
-       - Several CSS class constants now have clearer names
-       - All CSS classes are now properly namespaced to avoid CSS conflicts
-       - Fixed table:hover bug in CSS
-       - Calendar no longer requires the container ID and variable name to match in order for month navigation to function properly
-       - Calendar month navigation arrows are now represented as background images
-
-*** version 0.10.0 ***
-
-       - Major performance improvements from attaching DOM events to associated table cells only once, when the Calendar shell is built
-       - DOM events for mouseover/mouseout are now fired for all browsers (not just Internet Explorer)
-       - Reset functionality bug fixed for 2-up Calendar view
-
-*** version 0.9.0 ***
-
-* Initial release
+*** version 2.5.0 *** 
+
++ Prevent default event handling in CalendarNavigator enter key 
+  listener, to prevent automatic form submission when using Calendar
+  inside a form.
+
++ Added workaround to DateMath.add and subtract for Safari 2 (webkit) 
+  bug in Date.setDate(n) which doesn't handle value of n less than -128 
+  or greater than 127 correctly.
+
+  See: http://brianary.blogspot.com/2006/03/safari-date-bug.html
+
++ Added border, padding and margin rules to Calendar Sam Skin to 
+  protect Sam Skin's look and feel when Calendar is used with 
+  YUI base.css
+
+*** version 2.4.0 *** 
+
++ Added CalendarNavigator (year selector) feature to allow the user to 
+  jump to a year/month directly without having to scroll through months
+  sequentially. 
+
+  The feature is enabled/configured using the "navigator" configuration
+  property.
+
++ Added Custom Events: 
+
+    showNav/beforeShowNav
+    hideNav/beforeHideNav, 
+    renderNav/beforeRenderNav 
+
+  To Calendar/CalendarGroup, in support of the CalendarNavigator 
+  functionality. 
+
++ Added Custom Events:
+
+    show/beforeShow
+    hide/beforeHide 
+
+  To Calendar and CalendarGroup. Returning false from a 
+  beforeShow/beforeHide listener can be used to prevent the Calendar 
+  from being shown/hidden respectively. 
+
++ Added Public Methods: 
+
+    getCellIndex(date)    [ Calendar ]
+    getCalendarPage(date) [ CalendarGroup ]
+    toDate(dateArray)     [ Calendar/CalendarGroup ]
+    removeRenderers()     [ Calendar/CalendarGroup ]
+    
++ The Calendar/CalendarGroup constructor is now more flexible: 
+
+    * It no longer requires an "id" argument. 
+
+      In it's simplest form, a Calendar/CalendarGroup can be 
+      constructed by simply providing a container id or reference.
+
+          var cal = new YAHOO.widget.Calendar("container"); 
+          -or-
+          var containerDiv = YAHOO.util.Dom.get("container");
+          var cal = new YAHOO.widget.Calendar(containerDiv); 
+
+      An id for the Calendar does not need to be provided, and will be 
+      generated from the container id by appending an "_t" suffix to the
+      container id if only the container is provided. 
+
+    * The container argument can be either a string, representing the 
+      id of the container, or an HTMLElement referring to the container 
+      element itself, as suggested in the example above. 
+
+    * If an HTMLElement is provided for the container argument and the 
+      element does not have an id, one will be generated for it using 
+      YAHOO.util.Dom.generateId(). 
+
+    * The older form of Calendar/CalendarGroup signature, expecting 
+      both an id and containerId is still supported and works as it did 
+      prior to 2.4.0. 
+
++ Fixed performance issue, where the same custom renderer was being 
+  applied multiple times to the same cell.
+
++ Added getDate(year, month, date) factory method to the DateMath utility, 
+  which can be used to create JavaScript Date instances for years less 
+  than 100.
+
+  The default Date(year, month, date) constructor implementations across 
+  browsers, assume that if year < 100, the caller is referring to the 
+  nineteen hundreds, and the year is set to 19xx instead of xx (as with
+  the deprecated setYear method). However Date.setFullYear(xx) can 
+  be used to set dates below 100. The above factory method provides a 
+  construction mechanism consistent with setFullYear.
+
++ Changed Calendar/CalendarGroup/DateMath code to use the DateMath.getDate
+  method, so that 2 digit years are  not assumed to be in the 1900's. 
+
+  NOTE: Calendar's API already expects 4 digit date strings when referring 
+  to years after 999.
+
+*** version 2.3.1 *** 
+
++ Changed Calendar/CalendarGroup to render an empty title bar element 
+  when "close" is set to true, but "title" has not been set, to allow Sam 
+  Skin to render a title bar correctly. 
+
+*** version 2.3.0 *** 
+
++ Added checks to select, selectCell, deselect and deselectCell methods 
+  to ensure the Calendar/Calendar group was not set to an invalid state 
+  by programmatically selecting unselectable dates or cells.
+  
++ Added new locale configuration properties for the Month/Year label 
+  used in the Calendar header (MY_LABEL_MONTH_POSITION, 
+  MY_LABEL_YEAR_POSITION, MY_LABEL_YEAR_SUFFIX, MY_LABEL_MONTH_SUFFIX). 
+  Japan is an example locale, where customization of the Month/Year 
+  label is required.
+  
++ Changed "first", "last" class names to "first-of-type", "last-of-type", 
+  to avoid collision with YUI Grids' use of the "first" class name.
+  
++ Added public isDateOOB method, to check if a given date is outside of 
+  the minimum/maximum configuration dates of the Calendar.
+  
++ Deprecated YAHOO.widget.Calendar.browser, refactored to use 
+  YAHOO.env.ua instead. 
+  
++ Removed overflow:hidden from default Calendar/CalendarGroup container 
+  for non-IE6 browsers to fix clipping issue with IE7 when CalendarGroup 
+  was inside a box with a specific width. overflow:hidden is still 
+  required for IE6 with an iframe shim.
+
++ Added Opera container width calculation fix to CalendarGroup.show 
+  method, to fix incorrect wrapping when using a CalendarGroup which is 
+  initially rendered hidden (display:none). Previously this fix was 
+  only applied on render. 
+
+*** version 2.2.2 *** 
+
++ Fixed problem with selected dates being shared across instances, when 
+  more than one Calendar/CalendarGroup was on the page 
+
+*** version 2.2.1 *** 
+
++ Fixed problem with selectCell adding duplicate selected date entries 
+  for dates which were already selected
+
++ Fixed problem with CalendarGroup iframe shim not covering the 
+  CalendarGroup title area
+  
++ Removed javascript:void(null) from close button and cell links which 
+  was interrupting form submission and firing onbeforeunload in IE
+  
++ Fixed problem with CalendarGroup getSelectedDates returning invalid 
+  results, when used in conjunction with the "selected" Config property 
+  (either passed in the constructor config argument or set seperately 
+  after construction)
+  
++ Refactored Calendar and CalendarGroup to improve performance, 
+  especially when working with a large number of instances in 
+  IE6 
+
+*** version 2.2.0 *** 
+
++ Image customization can now be done through CSS. Images for Close, 
+  Left and Right Arrows are now pulled in using CSS defined in 
+  calendar.css and by default use relative paths to the images in 
+  the same directory as calendar.css.
+  
++ Deprecated Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT 
+  configuration properties. Customizations based on older releases 
+  which set these properties will still function as expected.
+
++ Deprecated CalendarGroup.CSS_2UPCLOSE. Calendar's Style.CSS_CLOSE 
+  property now represents the new default CSS class (calclose) for 
+  the close button. CSS_2UPCLOSE is still applied along with 
+  CSS_CLOSE to the new markup for the close button to support existing
+  customizations of the CSS_2UPCLOSE CSS class (close-icon)
+
++ Fixed problem with Safari setting Calendar pages to incorrect dates 
+  if the pages spanned a year boundary in CalendarGroups with 3 or more 
+  pages, due to a bug in Safari's implementation of Date setMonth
+
++ Fixed problem with CalendarGroup setMonth rendering Calendar pages 
+  with incorrect dates in all browsers if current pages spanned year 
+  boundary 
+
++ Fixed incorrect CalendarGroup logging statement in calendar-debug.js
+
++ Fixed domEventMap support for Safari versions prior to 2.0.2, 
+  caused by hasOwnProperty not being supported
+  
++ Removed unused private property : _pageDate from Calendar class 
+
+*** version 0.12.2 *** 
+
++ Corrected documentation for clearTime function to reflect the 
+  change from midnight to noon 
+
+*** version 0.12.1 *** 
+
++ Calendar and CalendarGroup now automatically parse the argument 
+  passed to setMonth and setYear into an integer, eliminating 
+  potential concatenation bugs. 
+
+*** version 0.12 *** 
+
++ New documentation format implemented
+
++ Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone
+  represents the single Calendar instance, and CalendarGroup represents 
+  an n-up instance, defaulting to 2up
+  
++ Added semantic style classes to Calendar elements to allow for 
+  custom styling solely using CSS.
+  
++ Remapped all configuration properties to use the Config object 
+ (familiar to those who use the Container collection of controls). 
+ Property names are the same as their previous counterparts, but 
+ wrapped into Calendar.cfg, allowing for runtime reconfiguration of 
+ most properties
++ Added "title" property for setting the Calendar title
+
++ Added "close" property for enabling and disabling the close icon
+
++ Added "iframe" property for enabling an iframe shim in Internet 
+  Explorer 6 and below to fix the select bleed-through bug
+  
++ pageDate moved to property: "pagedate"
+
++ selectedDates moved to property: "selected"
+
++ minDate moved to property : "mindate", which accepts a JavaScript 
+  Date object like its predecessor, but also supports string dates
+  
++ maxDate moved to property : "maxdate", which accepts a JavaScript 
+  Date object like its predecessor, but also supports string dates
+  
++ Moved style declarations to initStyles function
+
++ Optimized event handling in doSelectCell/doCellMouseOver/
+  doCellMouseOut by only attaching the listener to the outer 
+  Calendar container, and only reacting to events on cells with 
+  the "selectable" CSS class.
+  
++ Added domEventMap field for applying DOM event listeners to cells 
+  containing specific class and tag combinations.
+  
++ Moved all cell DOM event attachment to applyListeners function
+
++ Added getDateByCellId / getDateFieldsByCellId helper functions
+
++ Corrected DateMath.getWeekNumber to comply with ISO week number 
+  handling
+  
++ Separated renderCellDefault style portions into styleCellDefault 
+  function for easy extension
+  
++ Deprecated onBeforeSelect. Created beforeSelectEvent which 
+  automatically subscribes to its deprecated predecessor.
+  
++ Deprecated onSelect. Created selectEvent, which automatically 
+  subscribes to its deprecated predecessor.
+  
++ Deprecated onBeforeDeselect. Created beforeSelectEvent which 
+  automatically subscribes to its deprecated predecessor.
+  
++ Deprecated onDeselect. Created beforeDeselectEvent, which 
+  automatically subscribes to its deprecated predecessor.
+  
++ Deprecated onChangePage. Created changePageEvent, which automatically
+  subscribes to its deprecated predecessor.
+  
++ Deprecated onRender. Created renderEvent, which automatically 
+  subscribes to its deprecated predecessor.
+  
++ Deprecated onReset. Created resetEvent, which automatically 
+  subscribes to its deprecated predecessor.
+  
++ Deprecated onClear. Created clearEvent, which automatically 
+  subscribes to its deprecated predecessor.
+  
++ Corrected setMonth documentation to refer to 0-11 indexed months.
+
++ Added show and hide methods to Calendar for setting the Calendar's 
+  display property.
+  
++ Optimized internal render classes to use innerHTML and string buffers
++ Removed wireCustomEvents function
+
++ Removed wireDefaultEvents function 
+
++ Removed doNextMonth / doPreviousMonth
+
++ Removed all buildShell (header, body, footer) functions, since 
+  the Calendar shell is now built dynamically on each render
+  
++ Wired all CalendarGroup events and configuration properties to 
+  be properly delegated to Calendar
+  
++ Augmented CalendarGroup with all built-in renderers, label functions, 
+  hide, show, and initStyles, creating API transparency between Calendar 
+  and CalendarGroup.
+  
++ Made all tagName, createElement, and entity references XHTML compliant
+
++ Fixed Daylight Saving Time bug for Brazilian time zone 
+
+*** version 0.11.3 *** 
+
++ Calendar_Core: Added arguments for selected/deselected dates to 
+  onSelect/onDeselect
+  
++ CalendarGroup: Fixed bug where selected dates passed to constructor 
+  were not represented in selectedDates
+  
++ Calendar2up: Now displays correctly in Opera 9 
+
+*** version 0.11.0 *** 
+
++ DateMath: DateMath.add now properly adds weeks
+
++ DateMath: between() function added
+
++ DateMath: getWeekNumber() fixed to take starting day of week into
+  account
+  
++ All references to Calendar's built in CSS class handlers are 
+  removed, replaced with calls to Dom utility (addClass, removeClass)
+  
++ Several CSS class constants now have clearer names
+
++ All CSS classes are now properly namespaced to avoid CSS conflicts
+
++ Fixed table:hover bug in CSS
+
++ Calendar no longer requires the container ID and variable name to 
+  match in order for month navigation to function properly
+
++ Calendar month navigation arrows are now represented as 
+  background images 
+
+*** version 0.10.0 *** 
+
++ Major performance improvements from attaching DOM events to 
+  associated table cells only once, when the Calendar shell is built
+  
++ DOM events for mouseover/mouseout are now fired for all browsers 
+ (not just Internet Explorer)
++ Reset functionality bug fixed for 2-up Calendar view 
+
+*** version 0.9.0 *** 
+
+* Initial release
\ No newline at end of file
index d25fd0427f2f26ece3c8987b942e1c6dbc9f8d32..294405181c34d111f704de238d0e4384c570dafd 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * CORE
@@ -83,6 +83,44 @@ version: 2.3.0
        text-align:center;
 }
 
+/* CalendarNavigator */
+.yui-calcontainer .yui-cal-nav-mask {
+       position:absolute;
+       z-index:2;
+       margin:0;
+       padding:0;
+       width:100%;
+       height:100%;
+       _width:0;    /* IE6, IE7 quirks - width/height set programmatically to match container */
+       _height:0;
+       left:0;
+       top:0;
+       display:none;
+}
+
+/* NAVIGATOR BOUNDING BOX */
+.yui-calcontainer .yui-cal-nav {
+       position:absolute;
+       z-index:3;
+       top:0;
+       display:none;
+}
+
+/* NAVIGATOR BUTTONS (based on button-core.css) */
+.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn  {
+       display: -moz-inline-box; /* Gecko */
+       display: inline-block; /* IE, Opera and Safari */
+}
+
+.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button {
+       display: block;
+       *display: inline-block; /* IE */
+       *overflow: visible; /* Remove superfluous padding for IE */
+       border: none;
+       background-color: transparent;
+       cursor: pointer;
+}
+
 /* Specific changes for calendar running under fonts/reset */
 .yui-calendar .calbody a:hover {background:inherit;}
 p#clear {clear:left; padding-top:10px;}
\ No newline at end of file
index 377b93191ddf0203932b9b147fcb362c5661bd6c..26975d21dda19ca5f1ff74679411e5dece9fd50e 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-calcontainer {
        position:relative;
@@ -91,7 +91,7 @@ version: 2.3.0
        top:2px;
        bottom:0;
        width:9px;
-       height:12px;   
+       height:12px;
        left:2px;
        z-index:1;
        background: url("callt.gif") no-repeat;
@@ -200,6 +200,115 @@ version: 2.3.0
        border-right-width:2px;
 }
 
+/* CalendarNavigator */
+.yui-calendar a.calnav {
+       _position:relative;
+       padding-left:2px;
+       padding-right:2px;
+       text-decoration:none;
+       color:#000;
+}
+
+.yui-calendar a.calnav:hover {
+       border:1px solid #003366;
+       background-color:#6699cc;
+       background: url(calgrad.png) repeat-x;
+       color:#fff;
+       cursor:pointer;
+}
+
+.yui-calcontainer .yui-cal-nav-mask {
+       position:absolute;
+       z-index:2;
+       display:none;
+
+       margin:0;
+       padding:0;
+
+       left:0;
+       top:0;
+       width:100%;
+       height:100%;
+       _width:0;    /* IE6, IE7 Quirks - width/height set programmatically to match container */
+       _height:0;
+
+       background-color:#000;
+       opacity:0.25;
+       *filter:alpha(opacity=25);
+}
+
+.yui-calcontainer .yui-cal-nav {
+       position:absolute;
+       z-index:3;
+       display:none;
+
+       padding:0;
+       top:1.5em;
+       left:50%;
+       width:12em;
+       margin-left:-6em;
+
+       border:1px solid #7B9EBD;
+       background-color:#F7F9FB;
+       font-size:93%;
+}
+
+.yui-calcontainer.withtitle .yui-cal-nav {
+       top:3.5em;
+}
+
+.yui-calcontainer .yui-cal-nav-y,
+.yui-calcontainer .yui-cal-nav-m,
+.yui-calcontainer .yui-cal-nav-b {
+       padding:2px 5px 2px 5px;
+}
+
+.yui-calcontainer .yui-cal-nav-b {
+       text-align:center;
+}
+
+.yui-calcontainer .yui-cal-nav-e {
+       margin-top:2px;
+       padding:2px;
+       background-color:#EDF5FF;
+       border-top:1px solid black;
+       display:none;
+}
+
+.yui-calcontainer .yui-cal-nav label {
+       display:block;
+       font-weight:bold;
+}
+
+.yui-calcontainer .yui-cal-nav-mc {
+       width:100%;
+       _width:auto; /* IE6 doesn't like width 100% */
+}
+
+.yui-calcontainer .yui-cal-nav-y input.yui-invalid {
+       background-color:#FFEE69;
+       border: 1px solid #000;
+}
+
+.yui-calcontainer .yui-cal-nav-yc {
+       width:3em;
+}
+
+.yui-calcontainer .yui-cal-nav-b button {
+       font-size:93%;
+       text-decoration:none;
+       cursor: pointer;
+       background-color: #79b2ea;
+       border: 1px solid #003366;
+       border-top-color:#FFF;
+       border-left-color:#FFF;
+       margin:1px;
+}
+
+.yui-calcontainer .yui-cal-nav-b .yui-default button {
+       /* not implemented */
+}
+
 /* Specific changes for calendar running under fonts/reset */
 .yui-calendar .calbody a:hover {background:inherit;}
 p#clear {clear:left; padding-top:10px;}
diff --git a/lib/yui/calendar/assets/calgrad.png b/lib/yui/calendar/assets/calgrad.png
new file mode 100644 (file)
index 0000000..9be3d95
Binary files /dev/null and b/lib/yui/calendar/assets/calgrad.png differ
index 66a6df4b118f831e84c7d631df5f7d24e5a93705..2cb9a73b36b9492c39a14c66433f51e24d6b1572 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * SAM
@@ -79,6 +79,7 @@ version: 2.3.0
        border-collapse:collapse;
        font:100% sans-serif;
        text-align:center;
+       margin:0;
 }
 
 /* NAVBAR BOUNDING BOX */
@@ -86,6 +87,7 @@ version: 2.3.0
        background:transparent;
        border:none;
        vertical-align:middle;
+       padding:0;
 }
 
 /* NAVBAR TEXT CONTAINER */
@@ -129,6 +131,11 @@ version: 2.3.0
        height:2em;
 }
 
+.yui-skin-sam .yui-calendar .calweekdayrow th {
+       padding:0;
+       border:none;
+}
+
 /* WEEKDAY (Su, Mo, Tu...) HEADER CELLS */
 .yui-skin-sam .yui-calendar .calweekdaycell {
        color:#000;
@@ -148,16 +155,17 @@ version: 2.3.0
        font-size:85%;
        font-style:normal;
        font-weight:normal;
+       border:none;
 }
 
 .yui-skin-sam .yui-calendar .calrowhead {
        text-align:right;
-       padding-right:2px;
+       padding:0 2px 0 0;
 }
 
 .yui-skin-sam .yui-calendar .calrowfoot {
        text-align:left;
-       padding-left:2px;
+       padding:0 0 0 2px;
 }
 
 /* NORMAL CELLS */
@@ -228,4 +236,126 @@ version: 2.3.0
 .yui-skin-sam .yui-calendar td.calcell.highlight1 { background-color:#ccff99; }
 .yui-skin-sam .yui-calendar td.calcell.highlight2 { background-color:#99ccff; }
 .yui-skin-sam .yui-calendar td.calcell.highlight3 { background-color:#ffcccc; }
-.yui-skin-sam .yui-calendar td.calcell.highlight4 { background-color:#ccff99; }
\ No newline at end of file
+.yui-skin-sam .yui-calendar td.calcell.highlight4 { background-color:#ccff99; }
+
+/* CalendarNavigator */
+
+/* MONTH/YEAR LABEL */
+.yui-skin-sam .yui-calendar a.calnav { 
+       border: 1px solid #f2f2f2;
+       padding:0 4px;
+       text-decoration:none;
+       color:#000;
+       zoom:1;
+}
+
+.yui-skin-sam .yui-calendar a.calnav:hover { 
+       background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+       border-color:#A0A0A0;
+       cursor:pointer;
+}
+
+/* NAVIGATOR MASK */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask {
+       background-color:#000;
+       opacity:0.25;
+       *filter:alpha(opacity=25); /* IE */
+}
+
+/* NAVIGATOR BOUNDING BOX */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav {
+       font-family:arial,helvetica,clean,sans-serif;
+       font-size:93%;
+       border:1px solid #808080;
+       left:50%;
+       margin-left:-7em;
+       width:14em;
+       padding:0;
+       top:2.5em;
+       background-color:#f2f2f2;
+}
+
+.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav {
+       top:4.5em;
+}
+
+/* NAVIGATOR BOUNDING BOX */
+.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav {
+       width:16em;
+       margin-left:-8em;
+}
+
+/* NAVIGATOR YEAR/MONTH/BUTTON/ERROR BOUNDING BLOCKS */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-b {
+       padding:5px 10px 5px 10px;
+}
+
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-b {
+       text-align:center;
+}
+
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-e {
+       margin-top:5px;
+       padding:5px;
+       background-color:#EDF5FF;
+       border-top:1px solid black;
+       display:none;
+}
+
+/* NAVIGATOR LABELS */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav label {
+       display:block;
+       font-weight:bold;
+}
+
+/* NAVIGATOR MONTH CONTROL */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc {
+       width:100%;
+       _width:auto; /* IE6, IE7 Quirks don't handle 100% well */
+}
+
+/* NAVIGATOR MONTH CONTROL, VALIDATION ERROR */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid {
+       background-color:#FFEE69;
+       border: 1px solid #000;
+}
+
+/* NAVIGATOR YEAR CONTROL */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc {
+       width:4em;
+}
+
+/* NAVIGATOR BUTTONS */
+
+/* BUTTON WRAPPER */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn {
+       border:1px solid #808080;
+       background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+       background-color:#ccc;
+       margin: auto .15em;
+}
+
+/* BUTTON (based on button-skin.css) */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button {
+       padding:0 8px;
+       font-size:93%;
+       line-height: 2;  /* ~24px */
+       *line-height: 1.7; /* For IE */
+       min-height: 2em; /* For Gecko */
+       *min-height: auto; /* For IE */
+       color: #000;
+}
+
+/* DEFAULT BUTTONS */
+/* NOTE: IE6 will only pickup the yui-default specifier from the multiple class specifier */
+.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default {
+       border:1px solid #304369;
+       background-color: #426fd9;
+       background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;
+}
+
+.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button {
+       color:#fff;
+}
index 2b6d11a196fb8bf800c482897fcdbba5991ad45a..53d4a7bd72e6fede793b42914c67229142f0ae30 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:0.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;}
index 47a54b3d7d73ba1d0c1f2a949adb129aa17096a3..621b403db5fbd355149256018b16b021171af291 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,26 +18,20 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-            YAHOO.log("No owner specified for Config object", "error"); 
-    
         }
-    
+
+        if (!owner) {  YAHOO.log("No owner specified for Config object", "error", "Config"); }
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -157,7 +151,7 @@ version: 2.3.0
         * @param {value} Object The value of the correct type for the property
         */ 
         fireEvent: function ( key, value ) {
-            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config");
             var property = this.config[key];
         
             if (property && property.event) {
@@ -174,7 +168,7 @@ version: 2.3.0
         */
         addProperty: function ( key, propertyObject ) {
             key = key.toLowerCase();
-            YAHOO.log("Added property: " + key, "info");
+            YAHOO.log("Added property: " + key, "info", "Config");
         
             this.config[key] = propertyObject;
         
@@ -252,11 +246,11 @@ version: 2.3.0
                     !Lang.isUndefined(this.initialConfig[key])) {
     
                     this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
     
                 }
     
-                return true;
-    
             } else {
     
                 return false;
@@ -279,7 +273,7 @@ version: 2.3.0
             var property;
         
             key = key.toLowerCase();
-            YAHOO.log("setProperty: " + key + "=" + value, "info");
+            YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
         
             if (this.queueInProgress && ! silent) {
                 // Currently running through a queue... 
@@ -318,7 +312,7 @@ version: 2.3.0
         queueProperty: function (key, value) {
         
             key = key.toLowerCase();
-            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+            YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
         
             var property = this.config[key],
                 foundDuplicate = false,
@@ -358,7 +352,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -386,38 +380,38 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-        
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config");
+
                 return true;
             } else {
                 return false;
@@ -465,13 +459,23 @@ version: 2.3.0
         */
         applyConfig: function (userConfig, init) {
         
-            var prop;
-        
+            var sKey,
+                oConfig;
+
             if (init) {
-                this.initialConfig = userConfig;
+                oConfig = {};
+                for (sKey in userConfig) {
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+                    }
+                }
+                this.initialConfig = oConfig;
             }
-            for (prop in userConfig) {
-                this.queueProperty(prop, userConfig[prop]);
+
+            for (sKey in userConfig) {
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+                    this.queueProperty(sKey, userConfig[sKey]);
+                }
             }
         },
         
@@ -539,19 +543,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -671,28 +668,20 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
@@ -764,7 +753,6 @@ YAHOO.widget.DateMath = {
                                var newMonth = date.getMonth() + amount;
                                var years = 0;
 
-
                                if (newMonth < 0) {
                                        while (newMonth < 0) {
                                                newMonth += 12;
@@ -776,23 +764,55 @@ YAHOO.widget.DateMath = {
                                                years += 1;
                                        }
                                }
-                               
+
                                d.setMonth(newMonth);
                                d.setFullYear(date.getFullYear() + years);
                                break;
                        case this.DAY:
-                               d.setDate(date.getDate() + amount);
+                               this._addDays(d, amount);
+                               // d.setDate(date.getDate() + amount);
                                break;
                        case this.YEAR:
                                d.setFullYear(date.getFullYear() + amount);
                                break;
                        case this.WEEK:
-                               d.setDate(date.getDate() + (amount * 7));
+                               this._addDays(d, (amount * 7));
+                               // d.setDate(date.getDate() + (amount * 7));
                                break;
                }
                return d;
        },
 
+       /**
+        * Private helper method to account for bug in Safari 2 (webkit < 420)
+        * when Date.setDate(n) is called with n less than -128 or greater than 127.
+        * <p>
+        * Fix approach and original findings are available here:
+        * http://brianary.blogspot.com/2006/03/safari-date-bug.html
+        * </p>
+        * @method _addDays
+        * @param {Date} d JavaScript date object
+        * @param {Number} nDays The number of days to add to the date object (can be negative)
+        * @private
+        */
+       _addDays : function(d, nDays) {
+               if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) {
+                       if (nDays < 0) {
+                               // Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127)
+                               for(var min = -128; nDays < min; nDays -= min) {
+                                       d.setDate(d.getDate() + min);
+                               }
+                       } else {
+                               // Ensure we don't go above 96 + 31 = 127
+                               for(var max = 96; nDays > max; nDays -= max) {
+                                       d.setDate(d.getDate() + max);
+                               }
+                       }
+                       // nDays should be remainder between -128 and 96
+               }
+               d.setDate(d.getDate() + nDays);
+       },
+
        /**
        * Subtracts the specified amount of time from the this instance.
        * @method subtract
@@ -860,7 +880,7 @@ YAHOO.widget.DateMath = {
        * @return {Date}        January 1 of the calendar year specified.
        */
        getJan1 : function(calendarYear) {
-               return new Date(calendarYear,0,1); 
+               return this.getDate(calendarYear,0,1);
        },
 
        /**
@@ -896,7 +916,7 @@ YAHOO.widget.DateMath = {
                date = this.clearTime(date);
                var nearestThurs = new Date(date.getTime() + (4 * this.ONE_DAY_MS) - ((date.getDay()) * this.ONE_DAY_MS));
 
-               var jan1 = new Date(nearestThurs.getFullYear(),0,1);
+               var jan1 = this.getDate(nearestThurs.getFullYear(),0,1);
                var dayOfYear = ((nearestThurs.getTime() - jan1.getTime()) / this.ONE_DAY_MS) - 1;
 
                var weekNum = Math.ceil((dayOfYear)/ 7);
@@ -940,7 +960,7 @@ YAHOO.widget.DateMath = {
        * @return {Date}                The JavaScript Date representing the first day of the month
        */
        findMonthStart : function(date) {
-               var start = new Date(date.getFullYear(), date.getMonth(), 1);
+               var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
                return start;
        },
 
@@ -966,14 +986,46 @@ YAHOO.widget.DateMath = {
        clearTime : function(date) {
                date.setHours(12,0,0,0);
                return date;
+       },
+
+       /**
+        * Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
+        * are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations 
+        * set the year to 19xx if a year (xx) which is less than 100 is provided.
+        * <p>
+        * <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
+        * arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
+        * </p>
+        * @method getDate
+        * @param {Number} y Year.
+        * @param {Number} m Month index from 0 (Jan) to 11 (Dec).
+        * @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
+        * @return {Date} The JavaScript date object with year, month, date set as provided.
+        */
+       getDate : function(y, m, d) {
+               var dt = null;
+               if (YAHOO.lang.isUndefined(d)) {
+                       d = 1;
+               }
+               if (y >= 100) {
+                       dt = new Date(y, m, d);
+               } else {
+                       dt = new Date();
+                       dt.setFullYear(y);
+                       dt.setMonth(m);
+                       dt.setDate(d);
+                       dt.setHours(0,0,0,0);
+               }
+               return dt;
        }
 };
 
 /**
-* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month  or multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
+* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month or
+* multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
 * @module    calendar
-* @title     Calendar
-* @namespace YAHOO.widget
+* @title    Calendar
+* @namespace  YAHOO.widget
 * @requires  yahoo,dom,event
 */
 
@@ -985,18 +1037,39 @@ YAHOO.widget.DateMath = {
 * <p>To construct the placeholder for the calendar widget, the code is as
 * follows:
 *      <xmp>
-*              <div id="cal1Container"></div>
+*              <div id="calContainer"></div>
+*      </xmp>
+* </p>
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The Calendar can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*      <xmp>
+*              var c = new YAHOO.widget.Calendar("calContainer", configOptions);
+*      </xmp>
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*              var c = new YAHOO.widget.Calendar(containerDiv, configOptions);
 *      </xmp>
 * </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the Calendar's ID will be set to "calContainer_t".
+* </p>
+* 
 * @namespace YAHOO.widget
 * @class Calendar
 * @constructor
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
+* @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
 */
 YAHOO.widget.Calendar = function(id, containerId, config) {
-       this.init(id, containerId, config);
+       this.init.apply(this, arguments);
 };
 
 /**
@@ -1153,7 +1226,8 @@ YAHOO.widget.Calendar._DEFAULT_CONFIG = {
        MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
        MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
        MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
-       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""}
+       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""},
+       NAV: {key:"navigator", value: null}
 };
 
 /**
@@ -1173,7 +1247,17 @@ YAHOO.widget.Calendar._EVENT_TYPES = {
        BEFORE_RENDER : "beforeRender",
        RENDER : "render",
        RESET : "reset",
-       CLEAR : "clear"
+       CLEAR : "clear",
+       BEFORE_HIDE : "beforeHide",
+       HIDE : "hide",
+       BEFORE_SHOW : "beforeShow",
+       SHOW : "show",
+       BEFORE_HIDE_NAV : "beforeHideNav",
+       HIDE_NAV : "hideNav",
+       BEFORE_SHOW_NAV : "beforeShowNav",
+       SHOW_NAV : "showNav",
+       BEFORE_RENDER_NAV : "beforeRenderNav",
+       RENDER_NAV : "renderNav"
 };
 
 /**
@@ -1206,6 +1290,7 @@ YAHOO.widget.Calendar._STYLES = {
        CSS_CONTAINER : "yui-calcontainer",
        CSS_NAV_LEFT : "calnavleft",
        CSS_NAV_RIGHT : "calnavright",
+       CSS_NAV : "calnav",
        CSS_CLOSE : "calclose",
        CSS_CELL_TOP : "calcelltop",
        CSS_CELL_LEFT : "calcellleft",
@@ -1249,7 +1334,7 @@ YAHOO.widget.Calendar.prototype = {
        * @type HTMLTableCellElement[]
        */
        cells : null,
-       
+
        /**
        * The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].
        * @property cellDates
@@ -1258,12 +1343,19 @@ YAHOO.widget.Calendar.prototype = {
        cellDates : null,
 
        /**
-       * The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.
+       * The id that uniquely identifies this Calendar.
        * @property id
        * @type String
        */
        id : null,
 
+       /**
+       * The unique id associated with the Calendar's container
+       * @property containerId
+       * @type String
+       */
+       containerId: null,
+
        /**
        * The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered.
        * @property oDomContainer
@@ -1293,6 +1385,14 @@ YAHOO.widget.Calendar.prototype = {
        */
        _renderStack : null,
 
+       /**
+       * A reference to the CalendarNavigator instance created for this Calendar.
+       * Will be null if the "navigator" configuration property has not been set
+       * @property oNavigator
+       * @type CalendarNavigator
+       */
+       oNavigator : null,
+
        /**
        * The private list of initially selected dates.
        * @property _selectedDates
@@ -1306,3674 +1406,5416 @@ YAHOO.widget.Calendar.prototype = {
        * @property domEventMap
        * @type Object
        */
-       domEventMap : null
-};
-
-
-
-/**
-* Initializes the Calendar widget.
-* @method init
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
-       this.logger = new YAHOO.widget.LogWriter("Calendar " + id);
-       this.initEvents();
-       this.today = new Date();
-       YAHOO.widget.DateMath.clearTime(this.today);
-
-       this.id = id;
-       this.oDomContainer = document.getElementById(containerId);
-       if (! this.oDomContainer) { this.logger.log("No valid container present.", "error"); }
-
-       /**
-       * The Config object used to hold the configuration variables for the Calendar
-       * @property cfg
-       * @type YAHOO.util.Config
-       */
-       this.cfg = new YAHOO.util.Config(this);
-       
-       /**
-       * The local object which contains the Calendar's options
-       * @property Options
-       * @type Object
-       */
-       this.Options = {};
-
-       /**
-       * The local object which contains the Calendar's locale settings
-       * @property Locale
-       * @type Object
-       */
-       this.Locale = {};
-
-       this.initStyles();
-
-       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);  
-       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
-       
-       this.cellDates = [];
-       this.cells = [];
-       this.renderStack = [];
-       this._renderStack = [];
-
-       this.setupConfig();
-       
-       if (config) {
-               this.cfg.applyConfig(config, true);
-       }
-       
-       this.cfg.fireQueue();
-};
-
-/**
-* Default Config listener for the iframe property. If the iframe config property is set to true, 
-* renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
-* 
-* @method configIframe
-*/
-YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
-       var useIframe = args[0];
-
-       if (!this.parent) {
-               if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
-                       if (useIframe) {
-                               var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
-                               
-                               if (pos == "absolute" || pos == "relative") {
-                                       
-                                       if (!YAHOO.util.Dom.inDocument(this.iframe)) {
-                                               this.iframe = document.createElement("iframe");
-                                               this.iframe.src = "javascript:false;";
-
-                                               YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
-
-                                               if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
-                                                       YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
-                                               }
-
-                                               this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
-                                       }
-                               }
-                       } else {
-                               if (this.iframe) {
-                                       if (this.iframe.parentNode) {
-                                               this.iframe.parentNode.removeChild(this.iframe);
+       domEventMap : null,
+
+       /**
+        * Protected helper used to parse Calendar constructor/init arguments.
+        *
+        * As of 2.4.0, Calendar supports a simpler constructor 
+        * signature. This method reconciles arguments
+        * received in the pre 2.4.0 and 2.4.0 formats.
+        * 
+        * @protected
+        * @method _parseArgs
+        * @param {Array} Function "arguments" array
+        * @return {Object} Object with id, container, config properties containing
+        * the reconciled argument values.
+        **/
+       _parseArgs : function(args) {
+               /*
+                  2.4.0 Constructors signatures
+
+                  new Calendar(String)
+                  new Calendar(HTMLElement)
+                  new Calendar(String, ConfigObject)
+                  new Calendar(HTMLElement, ConfigObject)
+
+                  Pre 2.4.0 Constructor signatures
+
+                  new Calendar(String, String)
+                  new Calendar(String, HTMLElement)
+                  new Calendar(String, String, ConfigObject)
+                  new Calendar(String, HTMLElement, ConfigObject)
+                */
+               var nArgs = {id:null, container:null, config:null};
+
+               if (args && args.length && args.length > 0) {
+                       switch (args.length) {
+                               case 1:
+                                       nArgs.id = null;
+                                       nArgs.container = args[0];
+                                       nArgs.config = null;
+                                       break;
+                               case 2:
+                                       if (YAHOO.lang.isObject(args[1]) && !args[1].tagName && !(args[1] instanceof String)) {
+                                               nArgs.id = null;
+                                               nArgs.container = args[0];
+                                               nArgs.config = args[1];
+                                       } else {
+                                               nArgs.id = args[0];
+                                               nArgs.container = args[1];
+                                               nArgs.config = null;
                                        }
-                                       this.iframe = null;
-                               }
+                                       break;
+                               default: // 3+
+                                       nArgs.id = args[0];
+                                       nArgs.container = args[1];
+                                       nArgs.config = args[2];
+                                       break;
                        }
+               } else {
+                       this.logger.log("Invalid constructor/init arguments", "error");
                }
-       }
-};
+               return nArgs;
+       },
 
-/**
-* Default handler for the "title" property
-* @method configTitle
-*/
-YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
-       var title = args[0];
-       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
-       
-       var titleDiv;
+       /**
+       * Initializes the Calendar widget.
+       * @method init
+       *
+       * @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+       * @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+       * @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
+       */
+       init : function(id, container, config) {
+               // Normalize 2.4.0, pre 2.4.0 args
+               var nArgs = this._parseArgs(arguments);
 
-       if (title && title !== "") {
-               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
-               titleDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
-               titleDiv.innerHTML = title;
-               this.oDomContainer.insertBefore(titleDiv, this.oDomContainer.firstChild);
-               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-       } else {
-               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+               id = nArgs.id;
+               container = nArgs.container;
+               config = nArgs.config;
+
+               this.oDomContainer = YAHOO.util.Dom.get(container);
+               if (!this.oDomContainer) { this.logger.log("Container not found in document.", "error"); }
 
-               if (titleDiv) {
-                       YAHOO.util.Event.purgeElement(titleDiv);
-                       this.oDomContainer.removeChild(titleDiv);
+               if (!this.oDomContainer.id) {
+                       this.oDomContainer.id = YAHOO.util.Dom.generateId();
                }
-               if (! close) {
-                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
+               if (!id) {
+                       id = this.oDomContainer.id + "_t";
                }
-       }
-};
 
-/**
-* Default handler for the "close" property
-* @method configClose
-*/
-YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
-       var close = args[0];
-       var title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
-       
-       var DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
+               this.id = id;
+               this.containerId = this.oDomContainer.id;
 
-       var linkClose;
+               this.logger = new YAHOO.widget.LogWriter("Calendar " + this.id);
+               this.initEvents();
 
-       if (close === true) {
-               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");
-               linkClose.href = "#";
-               linkClose.className = "link-close";
-               YAHOO.util.Event.addListener(linkClose, "click", function(e, cal) {cal.hide(); YAHOO.util.Event.preventDefault(e); }, this);
-               
-               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       var imgClose = document.createElement("img");
-                       imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
-                       imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;
-                       linkClose.appendChild(imgClose);
-               } else {
-                       linkClose.innerHTML = '<span class="' + YAHOO.widget.CalendarGroup.CSS_2UPCLOSE + ' ' + this.Style.CSS_CLOSE + '"></span>';
-               }
-               
-               this.oDomContainer.appendChild(linkClose);
-               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-       } else {
-               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
-               if (linkClose) {
-                       YAHOO.util.Event.purgeElement(linkClose);
-                       this.oDomContainer.removeChild(linkClose);
-               }
-               if (! title || title === "") {
-                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
-               }
-       }
-};
+               this.today = new Date();
+               YAHOO.widget.DateMath.clearTime(this.today);
 
-/**
-* Initializes Calendar's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.Calendar.prototype.initEvents = function() {
+               /**
+               * The Config object used to hold the configuration variables for the Calendar
+               * @property cfg
+               * @type YAHOO.util.Config
+               */
+               this.cfg = new YAHOO.util.Config(this);
 
-       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+               /**
+               * The local object which contains the Calendar's options
+               * @property Options
+               * @type Object
+               */
+               this.Options = {};
 
-       /**
-       * Fired before a selection is made
-       * @event beforeSelectEvent
-       */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+               /**
+               * The local object which contains the Calendar's locale settings
+               * @property Locale
+               * @type Object
+               */
+               this.Locale = {};
 
-       /**
-       * Fired when a selection is made
-       * @event selectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+               this.initStyles();
 
-       /**
-       * Fired before a selection is made
-       * @event beforeDeselectEvent
-       */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+               YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);
+               YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
 
-       /**
-       * Fired when a selection is made
-       * @event deselectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+               this.cellDates = [];
+               this.cells = [];
+               this.renderStack = [];
+               this._renderStack = [];
 
-       /**
-       * Fired when the Calendar page is changed
-       * @event changePageEvent
-       */
-       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+               this.setupConfig();
 
-       /**
-       * Fired before the Calendar is rendered
-       * @event beforeRenderEvent
-       */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+               if (config) {
+                       this.cfg.applyConfig(config, true);
+               }
 
-       /**
-       * Fired when the Calendar is rendered
-       * @event renderEvent
-       */
-       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+               this.cfg.fireQueue();
+       },
 
        /**
-       * Fired when the Calendar is reset
-       * @event resetEvent
+       * Default Config listener for the iframe property. If the iframe config property is set to true, 
+       * renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
+       * 
+       * @method configIframe
        */
-       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+       configIframe : function(type, args, obj) {
+               var useIframe = args[0];
+       
+               if (!this.parent) {
+                       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
+                               if (useIframe) {
+                                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+                                       
+                                       if (pos == "absolute" || pos == "relative") {
+                                               
+                                               if (!YAHOO.util.Dom.inDocument(this.iframe)) {
+                                                       this.iframe = document.createElement("iframe");
+                                                       this.iframe.src = "javascript:false;";
+       
+                                                       YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
+       
+                                                       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+                                                               YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
+                                                       }
+       
+                                                       this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
+                                               }
+                                       }
+                               } else {
+                                       if (this.iframe) {
+                                               if (this.iframe.parentNode) {
+                                                       this.iframe.parentNode.removeChild(this.iframe);
+                                               }
+                                               this.iframe = null;
+                                       }
+                               }
+                       }
+               }
+       },
 
        /**
-       * Fired when the Calendar is cleared
-       * @event clearEvent
+       * Default handler for the "title" property
+       * @method configTitle
        */
-       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
-
-       this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
-       this.selectEvent.subscribe(this.onSelect, this, true);
-       this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
-       this.deselectEvent.subscribe(this.onDeselect, this, true);
-       this.changePageEvent.subscribe(this.onChangePage, this, true);
-       this.renderEvent.subscribe(this.onRender, this, true);
-       this.resetEvent.subscribe(this.onReset, this, true);
-       this.clearEvent.subscribe(this.onClear, this, true);
-};
-
-/**
-* The default event function that is attached to a date link within a calendar cell
-* when the calendar is rendered.
-* @method doSelectCell
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
-       var cell,index,d,date;
-
-       var target = YAHOO.util.Event.getTarget(e);
-       var tagName = target.tagName.toLowerCase();
-       var defSelector = false;
-
-       while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+       configTitle : function(type, args, obj) {
+               var title = args[0];
 
-               if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
-                       defSelector = true;     
-               }
-
-               target = target.parentNode;
-               tagName = target.tagName.toLowerCase(); 
-               if (tagName == "html") {
-                       return;
+               // "" disables title bar
+               if (title) {
+                       this.createTitleBar(title);
+               } else {
+                       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
+                       if (!close) {
+                               this.removeTitleBar();
+                       } else {
+                               this.createTitleBar("&#160;");
+                       }
                }
-       }
-
-       if (defSelector) {
-               // Stop link href navigation for default renderer
-               YAHOO.util.Event.preventDefault(e);
-       }
-
-       cell = target;
-
-       if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
-               index = cell.id.split("cell")[1];
-               d = cal.cellDates[index];
-               date = new Date(d[0],d[1]-1,d[2]);
+       },
        
-               var link;
-
-               cal.logger.log("Selecting cell " + index + " via click", "info");
-               if (cal.Options.MULTI_SELECT) {
-                       link = cell.getElementsByTagName("a")[0];
-                       if (link) {
-                               link.blur();
+       /**
+       * Default handler for the "close" property
+       * @method configClose
+       */
+       configClose : function(type, args, obj) {
+               var close = args[0],
+                       title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
+       
+               if (close) {
+                       if (!title) {
+                               this.createTitleBar("&#160;");
                        }
-
-                       var cellDate = cal.cellDates[index];
-                       var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
-
-                       if (cellDateIndex > -1) {       
-                               cal.deselectCell(index);
-                       } else {
-                               cal.selectCell(index);
-                       }       
-
+                       this.createCloseButton();
                } else {
-                       link = cell.getElementsByTagName("a")[0];
-                       if (link) {
-                               link.blur();
+                       this.removeCloseButton();
+                       if (!title) {
+                               this.removeTitleBar();
                        }
-                       cal.selectCell(index);
                }
-       }
-};
-
-/**
-* The event that is executed when the user hovers over a cell
-* @method doCellMouseOver
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOver = function(e, cal) {
-       var target;
-       if (e) {
-               target = YAHOO.util.Event.getTarget(e);
-       } else {
-               target = this;
-       }
-
-       while (target.tagName.toLowerCase() != "td") {
-               target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
-                       return;
-               }
-       }
-
-       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-               YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
-       }
-};
-
-/**
-* The event that is executed when the user moves the mouse out of a cell
-* @method doCellMouseOut
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {
-       var target;
-       if (e) {
-               target = YAHOO.util.Event.getTarget(e);
-       } else {
-               target = this;
-       }
-
-       while (target.tagName.toLowerCase() != "td") {
-               target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
-                       return;
-               }
-       }
-
-       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-               YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
-       }
-};
-
-YAHOO.widget.Calendar.prototype.setupConfig = function() {
-
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-       /**
-       * The month/year representing the current visible Calendar date (mm/yyyy)
-       * @config pagedate
-       * @type String
-       * @default today's date
-       */
-       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
-
-       /**
-       * The date or range of dates representing the current Calendar selection
-       * @config selected
-       * @type String
-       * @default []
-       */
-       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
-
-       /**
-       * The title to display above the Calendar's month header
-       * @config title
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
-
-       /**
-       * Whether or not a close button should be displayed for this Calendar
-       * @config close
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
-
-       /**
-       * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
-       * enabled if required.
-       * 
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all other browsers
-       */
-       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
-
-       /**
-       * The minimum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config mindate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
-
-       /**
-       * The maximum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config maxdate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
-
-
-       // Options properties
-
-       /**
-       * True if the Calendar should allow multiple selections. False by default.
-       * @config MULTI_SELECT
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * The weekday the week begins on. Default is 0 (Sunday).
-       * @config START_WEEKDAY
-       * @type number
-       * @default 0
-       */
-       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
-
-       /**
-       * True if the Calendar should show weekday labels. True by default.
-       * @config SHOW_WEEKDAYS
-       * @type Boolean
-       * @default true
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
-
-       /**
-       * True if the Calendar should show week row headers. False by default.
-       * @config SHOW_WEEK_HEADER
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * True if the Calendar should show week row footers. False by default.
-       * @config SHOW_WEEK_FOOTER
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-       * @config HIDE_BLANK_WEEKS
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * The image that should be used for the left navigation arrow.
-       * @config NAV_ARROW_LEFT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
-
-       /**
-       * The image that should be used for the right navigation arrow.
-       * @config NAV_ARROW_RIGHT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
-
-       // Locale properties
-
-       /**
-       * The short month labels for the current locale.
-       * @config MONTHS_SHORT
-       * @type String[]
-       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-       */
-       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
-       
-       /**
-       * The long month labels for the current locale.
-       * @config MONTHS_LONG
-       * @type String[]
-       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-       */      
-       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
-       
-       /**
-       * The 1-character weekday labels for the current locale.
-       * @config WEEKDAYS_1CHAR
-       * @type String[]
-       * @default ["S", "M", "T", "W", "T", "F", "S"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
-       
-       /**
-       * The short weekday labels for the current locale.
-       * @config WEEKDAYS_SHORT
-       * @type String[]
-       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
-       
-       /**
-       * The medium weekday labels for the current locale.
-       * @config WEEKDAYS_MEDIUM
-       * @type String[]
-       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
-       
-       /**
-       * The long weekday labels for the current locale.
-       * @config WEEKDAYS_LONG
-       * @type String[]
-       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
-
-       /**
-       * Refreshes the locale values used to build the Calendar.
-       * @method refreshLocale
-       * @private
-       */
-       var refreshLocale = function() {
-               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-       };
-
-       this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
-       
-       /**
-       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-       * @config LOCALE_MONTHS
-       * @type String
-       * @default "long"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
-       
-       /**
-       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-       * @config LOCALE_WEEKDAYS
-       * @type String
-       * @default "short"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
-
-       /**
-       * The value used to delimit individual dates in a date string passed to various Calendar functions.
-       * @config DATE_DELIMITER
-       * @type String
-       * @default ","
-       */      
-       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The value used to delimit date fields in a date string passed to various Calendar functions.
-       * @config DATE_FIELD_DELIMITER
-       * @type String
-       * @default "/"
-       */      
-       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The value used to delimit date ranges in a date string passed to various Calendar functions.
-       * @config DATE_RANGE_DELIMITER
-       * @type String
-       * @default "-"
-       */
-       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The position of the month in a month/year date string
-       * @config MY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in a month/year date string
-       * @config MY_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the month in a month/day date string
-       * @config MD_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the day in a month/year date string
-       * @config MD_DAY_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the month in a month/day/year date string
-       * @config MDY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the day in a month/day/year date string
-       * @config MDY_DAY_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in a month/day/year date string
-       * @config MDY_YEAR_POSITION
-       * @type Number
-       * @default 3
-       */
-       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in the month year label string used as the Calendar header
-       * @config MY_LABEL_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in the month year label string used as the Calendar header
-       * @config MY_LABEL_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       },
        
        /**
-       * The suffix used after the month when rendering the Calendar header
-       * @config MY_LABEL_MONTH_SUFFIX
-       * @type String
-       * @default " "
+       * Initializes Calendar's built-in CustomEvents
+       * @method initEvents
        */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+       initEvents : function() {
        
-       /**
-       * The suffix used after the year when rendering the Calendar header
-       * @config MY_LABEL_YEAR_SUFFIX
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
-};
-
-/**
-* The default handler for the "pagedate" property
-* @method configPageDate
-*/
-YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
-       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
-};
-
-/**
-* The default handler for the "mindate" property
-* @method configMinDate
-*/
-YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
-       var val = args[0];
-       if (YAHOO.lang.isString(val)) {
-               val = this._parseDate(val);
-               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, new Date(val[0],(val[1]-1),val[2]));
-       }
-};
-
-/**
-* The default handler for the "maxdate" property
-* @method configMaxDate
-*/
-YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
-       var val = args[0];
-       if (YAHOO.lang.isString(val)) {
-               val = this._parseDate(val);
-               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, new Date(val[0],(val[1]-1),val[2]));
-       }
-};
-
-/**
-* The default handler for the "selected" property
-* @method configSelected
-*/
-YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
-       var selected = args[0];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
        
-       if (selected) {
-               if (YAHOO.lang.isString(selected)) {
-                       this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
-               } 
-       }
-       if (! this._selectedDates) {
-               this._selectedDates = this.cfg.getProperty(cfgSelected);
-       }
-};
-
-/**
-* The default handler for all configuration options properties
-* @method configOptions
-*/
-YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
-       this.Options[type.toUpperCase()] = args[0];
-};
-
-/**
-* The default handler for all configuration locale properties
-* @method configLocale
-*/
-YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.Locale[type.toUpperCase()] = args[0];
-
-       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-};
-
-/**
-* The default handler for all configuration locale field length properties
-* @method configLocaleValues
-*/
-YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
-
-       type = type.toLowerCase();
-       var val = args[0];
-
-       switch (type) {
-               case defCfg.LOCALE_MONTHS.key:
-                       switch (val) {
-                               case YAHOO.widget.Calendar.SHORT:
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.LONG:
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
-                                       break;
-                       }
-                       break;
-               case defCfg.LOCALE_WEEKDAYS.key:
-                       switch (val) {
-                               case YAHOO.widget.Calendar.ONE_CHAR:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.SHORT:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.MEDIUM:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.LONG:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
-                                       break;
-                       }
-                       
-                       var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
-
-                       if (START_WEEKDAY > 0) {
-                               for (var w=0;w<START_WEEKDAY;++w) {
-                                       this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
-                               }
-                       }
-                       break;
-       }
-};
-
-/**
-* Defines the style constants for the Calendar
-* @method initStyles
-*/
-YAHOO.widget.Calendar.prototype.initStyles = function() {
-
-       var defStyle = YAHOO.widget.Calendar._STYLES;
-
-       this.Style = {
-               /**
-               * @property Style.CSS_ROW_HEADER
-               */
-               CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
-               /**
-               * @property Style.CSS_ROW_FOOTER
-               */
-               CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
-               /**
-               * @property Style.CSS_CELL
-               */
-               CSS_CELL : defStyle.CSS_CELL,
-               /**
-               * @property Style.CSS_CELL_SELECTOR
-               */
-               CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
-               /**
-               * @property Style.CSS_CELL_SELECTED
-               */
-               CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
-               /**
-               * @property Style.CSS_CELL_SELECTABLE
-               */
-               CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
-               /**
-               * @property Style.CSS_CELL_RESTRICTED
-               */
-               CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
-               /**
-               * @property Style.CSS_CELL_TODAY
-               */
-               CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
-               /**
-               * @property Style.CSS_CELL_OOM
-               */
-               CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
-               /**
-               * @property Style.CSS_CELL_OOB
-               */
-               CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
-               /**
-               * @property Style.CSS_HEADER
-               */
-               CSS_HEADER : defStyle.CSS_HEADER,
-               /**
-               * @property Style.CSS_HEADER_TEXT
-               */
-               CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
                /**
-               * @property Style.CSS_BODY
+               * Fired before a selection is made
+               * @event beforeSelectEvent
                */
-               CSS_BODY : defStyle.CSS_BODY,
+               this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+       
                /**
-               * @property Style.CSS_WEEKDAY_CELL
+               * Fired when a selection is made
+               * @event selectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
                */
-               CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+               this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+       
                /**
-               * @property Style.CSS_WEEKDAY_ROW
+               * Fired before a selection is made
+               * @event beforeDeselectEvent
                */
-               CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+               this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+       
                /**
-               * @property Style.CSS_FOOTER
+               * Fired when a selection is made
+               * @event deselectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
                */
-               CSS_FOOTER : defStyle.CSS_FOOTER,
+               this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+       
                /**
-               * @property Style.CSS_CALENDAR
+               * Fired when the Calendar page is changed
+               * @event changePageEvent
                */
-               CSS_CALENDAR : defStyle.CSS_CALENDAR,
+               this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+       
                /**
-               * @property Style.CSS_SINGLE
+               * Fired before the Calendar is rendered
+               * @event beforeRenderEvent
                */
-               CSS_SINGLE : defStyle.CSS_SINGLE,
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+       
                /**
-               * @property Style.CSS_CONTAINER
+               * Fired when the Calendar is rendered
+               * @event renderEvent
                */
-               CSS_CONTAINER : defStyle.CSS_CONTAINER,
+               this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+       
                /**
-               * @property Style.CSS_NAV_LEFT
+               * Fired when the Calendar is reset
+               * @event resetEvent
                */
-               CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+               this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+       
                /**
-               * @property Style.CSS_NAV_RIGHT
+               * Fired when the Calendar is cleared
+               * @event clearEvent
                */
-               CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+               this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+       
                /**
-               * @property Style.CSS_CLOSE
+               * Fired just before the Calendar is to be shown
+               * @event beforeShowEvent
                */
-               CSS_CLOSE : defStyle.CSS_CLOSE,
+               this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+       
                /**
-               * @property Style.CSS_CELL_TOP
+               * Fired after the Calendar is shown
+               * @event showEvent
                */
-               CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+               this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+       
                /**
-               * @property Style.CSS_CELL_LEFT
+               * Fired just before the Calendar is to be hidden
+               * @event beforeHideEvent
                */
-               CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+               this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+       
                /**
-               * @property Style.CSS_CELL_RIGHT
+               * Fired after the Calendar is hidden
+               * @event hideEvent
                */
-               CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+               this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
+
                /**
-               * @property Style.CSS_CELL_BOTTOM
+               * Fired just before the CalendarNavigator is to be shown
+               * @event beforeShowNavEvent
                */
-               CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+               this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HOVER
+               * Fired after the CalendarNavigator is shown
+               * @event showNavEvent
                */
-               CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+               this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT1
+               * Fired just before the CalendarNavigator is to be hidden
+               * @event beforeHideNavEvent
                */
-               CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+               this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT2
+               * Fired after the CalendarNavigator is hidden
+               * @event hideNavEvent
                */
-               CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+               this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
+
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT3
+               * Fired just before the CalendarNavigator is to be rendered
+               * @event beforeRenderNavEvent
                */
-               CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+               this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
+
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT4
+               * Fired after the CalendarNavigator is rendered
+               * @event renderNavEvent
                */
-               CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
-       };
-};
-
-/**
-* Builds the date label that will be displayed in the calendar header or
-* footer, depending on configuration.
-* @method buildMonthLabel
-* @return      {String}        The formatted calendar month label
-*/
-YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
-       var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
-
-       var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
-       var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
-
-       if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
-               return yearLabel + monthLabel;
-       } else {
-               return monthLabel + yearLabel;
-       }
-};
-
-/**
-* Builds the date digit that will be displayed in calendar cells
-* @method buildDayLabel
-* @param {Date}        workingDate     The current working date
-* @return      {String}        The formatted day label
-*/
-YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
-       return workingDate.getDate();
-};
-
-/**
-* Renders the calendar header.
-* @method renderHeader
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
-       this.logger.log("Rendering header", "info");
-       var colSpan = 7;
-       
-       var DEPR_NAV_LEFT = "us/tr/callt.gif";
-       var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+
+               this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
+               this.selectEvent.subscribe(this.onSelect, this, true);
+               this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
+               this.deselectEvent.subscribe(this.onDeselect, this, true);
+               this.changePageEvent.subscribe(this.onChangePage, this, true);
+               this.renderEvent.subscribe(this.onRender, this, true);
+               this.resetEvent.subscribe(this.onReset, this, true);
+               this.clearEvent.subscribe(this.onClear, this, true);
+       },
        
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-               colSpan += 1;
-       }
+       /**
+       * The default event function that is attached to a date link within a calendar cell
+       * when the calendar is rendered.
+       * @method doSelectCell
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doSelectCell : function(e, cal) {
+               var cell,index,d,date;
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-               colSpan += 1;
-       }
+               var target = YAHOO.util.Event.getTarget(e);
+               var tagName = target.tagName.toLowerCase();
+               var defSelector = false;
 
-       html[html.length] = "<thead>";
-       html[html.length] =             "<tr>";
-       html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
-       html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';
+               while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
 
-       var renderLeft, renderRight = false;
+                       if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
+                               defSelector = true;     
+                       }
 
-       if (this.parent) {
-               if (this.index === 0) {
-                       renderLeft = true;
-               }
-               if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
-                       renderRight = true;
+                       target = target.parentNode;
+                       tagName = target.tagName.toLowerCase();
+                       // TODO: No need to go all the way up to html.
+                       if (tagName == "html") {
+                               return;
+                       }
                }
-       } else {
-               renderLeft = true;
-               renderRight = true;
-       }
 
-       var cal = this.parent || this;
-       
-       if (renderLeft) {
-               var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
-               // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
-               if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
-               }
-               var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
-               html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
-       }
-       
-       html[html.length] = this.buildMonthLabel();
-       
-       if (renderRight) {
-               var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
-               if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+               if (defSelector) {
+                       // Stop link href navigation for default renderer
+                       YAHOO.util.Event.preventDefault(e);
                }
-               var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
-               html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
-       }
-
-       html[html.length] =     '</div>\n</th>\n</tr>';
-
-       if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
-               html = this.buildWeekdays(html);
-       }
        
-       html[html.length] = '</thead>';
-
-       return html;
-};
-
-/**
-* Renders the Calendar's weekday headers.
-* @method buildWeekdays
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
+               cell = target;
 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
+                       index = cell.id.split("cell")[1];
+                       d = cal.cellDates[index];
+                       date = YAHOO.widget.DateMath.getDate(d[0],d[1]-1,d[2]);
+               
+                       var link;
 
-       html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
+                       cal.logger.log("Selecting cell " + index + " via click", "info");
+                       if (cal.Options.MULTI_SELECT) {
+                               link = cell.getElementsByTagName("a")[0];
+                               if (link) {
+                                       link.blur();
+                               }
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-               html[html.length] = '<th>&#160;</th>';
-       }
+                               var cellDate = cal.cellDates[index];
+                               var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
 
-       for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
-               html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
-       }
+                               if (cellDateIndex > -1) {       
+                                       cal.deselectCell(index);
+                               } else {
+                                       cal.selectCell(index);
+                               }       
+       
+                       } else {
+                               link = cell.getElementsByTagName("a")[0];
+                               if (link) {
+                                       link.blur();
+                               }
+                               cal.selectCell(index);
+                       }
+               }
+       },
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-               html[html.length] = '<th>&#160;</th>';
-       }
+       /**
+       * The event that is executed when the user hovers over a cell
+       * @method doCellMouseOver
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doCellMouseOver : function(e, cal) {
+               var target;
+               if (e) {
+                       target = YAHOO.util.Event.getTarget(e);
+               } else {
+                       target = this;
+               }
 
-       html[html.length] = '</tr>';
+               while (target.tagName && target.tagName.toLowerCase() != "td") {
+                       target = target.parentNode;
+                       if (!target.tagName || target.tagName.toLowerCase() == "html") {
+                               return;
+                       }
+               }
 
-       return html;
-};
+               if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+                       YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
+               }
+       },
 
-/**
-* Renders the calendar body.
-* @method renderBody
-* @param {Date}        workingDate     The current working Date being used for the render process
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
-       this.logger.log("Rendering body", "info");
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       /**
+       * The event that is executed when the user moves the mouse out of a cell
+       * @method doCellMouseOut
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doCellMouseOut : function(e, cal) {
+               var target;
+               if (e) {
+                       target = YAHOO.util.Event.getTarget(e);
+               } else {
+                       target = this;
+               }
 
-       var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+               while (target.tagName && target.tagName.toLowerCase() != "td") {
+                       target = target.parentNode;
+                       if (!target.tagName || target.tagName.toLowerCase() == "html") {
+                               return;
+                       }
+               }
 
-       this.preMonthDays = workingDate.getDay();
-       if (startDay > 0) {
-               this.preMonthDays -= startDay;
-       }
-       if (this.preMonthDays < 0) {
-               this.preMonthDays += 7;
-       }
-       
-       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
-       this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
-       this.logger.log(this.preMonthDays + " preciding out-of-month days", "info");
-       this.logger.log(this.monthDays + " month days", "info");
-       this.logger.log(this.postMonthDays + " post-month days", "info");
-       
-       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
-       this.logger.log("Calendar page starts on " + workingDate, "info");
-
-       var weekNum,weekClass;
-       var weekPrefix = "w";
-       var cellPrefix = "_cell";
-       var workingDayPrefix = "wd";
-       var dayPrefix = "d";
-       
-       var cellRenderers;
-       var renderer;
-       
-       var todayYear = this.today.getFullYear();
-       var todayMonth = this.today.getMonth();
-       var todayDate = this.today.getDate();
-       
-       var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
-       var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
-       var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
-       var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
-       var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
-       var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
-
-       if (mindate) {
-               mindate = YAHOO.widget.DateMath.clearTime(mindate);
-       }
-       if (maxdate) {
-               maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
-       }
+               if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+                       YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
+               }
+       },
        
-       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+       setupConfig : function() {
        
-       var i = 0;
-
-       var tempDiv = document.createElement("div");
-       var cell = document.createElement("td");
-       tempDiv.appendChild(cell);
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
 
-       var jan1 = new Date(useDate.getFullYear(),0,1);
+               /**
+               * The month/year representing the current visible Calendar date (mm/yyyy)
+               * @config pagedate
+               * @type String
+               * @default today's date
+               */
+               this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-       var cal = this.parent || this;
+               /**
+               * The date or range of dates representing the current Calendar selection
+               * @config selected
+               * @type String
+               * @default []
+               */
+               this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-       for (var r=0;r<6;r++) {
+               /**
+               * The title to display above the Calendar's month header
+               * @config title
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
-               weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
-               weekClass = weekPrefix + weekNum;
+               /**
+               * Whether or not a close button should be displayed for this Calendar
+               * @config close
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-               // Local OOM check for performance, since we already have pagedate
-               if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
-                       break;
-               } else {
+               /**
+               * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+               * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+               * enabled if required.
+               * 
+               * @config iframe
+               * @type Boolean
+               * @default true for IE6 and below, false for all other browsers
+               */
+               this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
-                       html[html.length] = '<tr class="' + weekClass + '">';
-                       
-                       if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
-                       
-                       for (var d=0;d<7;d++){ // Render actual days
+               /**
+               * The minimum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config mindate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
 
-                               cellRenderers = [];
-                               renderer = null;
+               /**
+               * The maximum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config maxdate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
+       
+       
+               // Options properties
+       
+               /**
+               * True if the Calendar should allow multiple selections. False by default.
+               * @config MULTI_SELECT
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * The weekday the week begins on. Default is 0 (Sunday).
+               * @config START_WEEKDAY
+               * @type number
+               * @default 0
+               */
+               this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
+       
+               /**
+               * True if the Calendar should show weekday labels. True by default.
+               * @config SHOW_WEEKDAYS
+               * @type Boolean
+               * @default true
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
+       
+               /**
+               * True if the Calendar should show week row headers. False by default.
+               * @config SHOW_WEEK_HEADER
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * True if the Calendar should show week row footers. False by default.
+               * @config SHOW_WEEK_FOOTER
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+               * @config HIDE_BLANK_WEEKS
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * The image that should be used for the left navigation arrow.
+               * @config NAV_ARROW_LEFT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
+       
+               /**
+               * The image that should be used for the right navigation arrow.
+               * @config NAV_ARROW_RIGHT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
+       
+               // Locale properties
+       
+               /**
+               * The short month labels for the current locale.
+               * @config MONTHS_SHORT
+               * @type String[]
+               * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+               */
+               this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
+               
+               /**
+               * The long month labels for the current locale.
+               * @config MONTHS_LONG
+               * @type String[]
+               * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+               */      
+               this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
 
-                               this.clearElement(cell);
-                               cell.className = this.Style.CSS_CELL;
-                               cell.id = this.id + cellPrefix + i;
-                               this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
+               /**
+               * The 1-character weekday labels for the current locale.
+               * @config WEEKDAYS_1CHAR
+               * @type String[]
+               * @default ["S", "M", "T", "W", "T", "F", "S"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
+               
+               /**
+               * The short weekday labels for the current locale.
+               * @config WEEKDAYS_SHORT
+               * @type String[]
+               * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
+               
+               /**
+               * The medium weekday labels for the current locale.
+               * @config WEEKDAYS_MEDIUM
+               * @type String[]
+               * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
+               
+               /**
+               * The long weekday labels for the current locale.
+               * @config WEEKDAYS_LONG
+               * @type String[]
+               * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
+       
+               /**
+               * Refreshes the locale values used to build the Calendar.
+               * @method refreshLocale
+               * @private
+               */
+               var refreshLocale = function() {
+                       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+                       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+               };
+       
+               this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
+               
+               /**
+               * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+               * @config LOCALE_MONTHS
+               * @type String
+               * @default "long"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
+               
+               /**
+               * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+               * @config LOCALE_WEEKDAYS
+               * @type String
+               * @default "short"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
+       
+               /**
+               * The value used to delimit individual dates in a date string passed to various Calendar functions.
+               * @config DATE_DELIMITER
+               * @type String
+               * @default ","
+               */      
+               this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The value used to delimit date fields in a date string passed to various Calendar functions.
+               * @config DATE_FIELD_DELIMITER
+               * @type String
+               * @default "/"
+               */      
+               this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The value used to delimit date ranges in a date string passed to various Calendar functions.
+               * @config DATE_RANGE_DELIMITER
+               * @type String
+               * @default "-"
+               */
+               this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The position of the month in a month/year date string
+               * @config MY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in a month/year date string
+               * @config MY_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in a month/day date string
+               * @config MD_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the day in a month/year date string
+               * @config MD_DAY_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in a month/day/year date string
+               * @config MDY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the day in a month/day/year date string
+               * @config MDY_DAY_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in a month/day/year date string
+               * @config MDY_YEAR_POSITION
+               * @type Number
+               * @default 3
+               */
+               this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in the month year label string used as the Calendar header
+               * @config MY_LABEL_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in the month year label string used as the Calendar header
+               * @config MY_LABEL_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The suffix used after the month when rendering the Calendar header
+               * @config MY_LABEL_MONTH_SUFFIX
+               * @type String
+               * @default " "
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+               
+               /**
+               * The suffix used after the year when rendering the Calendar header
+               * @config MY_LABEL_YEAR_SUFFIX
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
 
-                               if (workingDate.getDate()               == todayDate && 
-                                       workingDate.getMonth()          == todayMonth &&
-                                       workingDate.getFullYear()       == todayYear) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
-                               }
-                               
-                               var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
-                               this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
-                               
-                               // Local OOM check for performance, since we already have pagedate
-                               if (workingDate.getMonth() != useDate.getMonth()) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
-                               } else {
-                                       YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
-                                       YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
-                               
-                                       for (var s=0;s<this.renderStack.length;++s) {
+               /**
+               * Configuration for the Month/Year CalendarNavigator UI which allows the user to jump directly to a 
+               * specific Month/Year without having to scroll sequentially through months.
+               * <p>
+               * Setting this property to null (default value) or false, will disable the CalendarNavigator UI.
+               * </p>
+               * <p>
+               * Setting this property to true will enable the CalendarNavigatior UI with the default CalendarNavigator configuration values.
+               * </p>
+               * <p>
+               * This property can also be set to an object literal containing configuration properties for the CalendarNavigator UI.
+               * The configuration object expects the the following case-sensitive properties, with the "strings" property being a nested object.
+               * Any properties which are not provided will use the default values (defined in the CalendarNavigator class).
+               * </p>
+               * <dl>
+               * <dt>strings</dt>
+               * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+               *     <dl>
+               *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+               *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+               *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+               *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+               *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+               *     </dl>
+               * </dd>
+               * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+               * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+               * </dl>
+               * <p>E.g.</p>
+               * <pre>
+               * var navConfig = {
+               *         strings: {
+               *                 month:"Calendar Month",
+               *                 year:"Calendar Year",
+               *                 submit: "Submit",
+               *                 cancel: "Cancel",
+               *                 invalidYear: "Please enter a valid year"
+               *         },
+               *         monthFormat: YAHOO.widget.Calendar.SHORT,
+               *         initialFocus: "month"
+               * }
+               * </pre>
+               * @config navigator
+               * @type {Object|Boolean}
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+       },
 
-                                               var rArray = this.renderStack[s];
-                                               var type = rArray[0];
-                                               
-                                               var month;
-                                               var day;
-                                               var year;
-                                               
-                                               switch (type) {
-                                                       case YAHOO.widget.Calendar.DATE:
-                                                               month = rArray[1][1];
-                                                               day = rArray[1][2];
-                                                               year = rArray[1][0];
-
-                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
-                                                                       renderer = rArray[2];
-                                                                       this.renderStack.splice(s,1);
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.MONTH_DAY:
-                                                               month = rArray[1][0];
-                                                               day = rArray[1][1];
-                                                               
-                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
-                                                                       renderer = rArray[2];
-                                                                       this.renderStack.splice(s,1);
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.RANGE:
-                                                               var date1 = rArray[1][0];
-                                                               var date2 = rArray[1][1];
-
-                                                               var d1month = date1[1];
-                                                               var d1day = date1[2];
-                                                               var d1year = date1[0];
-                                                               
-                                                               var d1 = new Date(d1year, d1month-1, d1day);
-
-                                                               var d2month = date2[1];
-                                                               var d2day = date2[2];
-                                                               var d2year = date2[0];
-
-                                                               var d2 = new Date(d2year, d2month-1, d2day);
-
-                                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
-                                                                       renderer = rArray[2];
-
-                                                                       if (workingDate.getTime()==d2.getTime()) { 
-                                                                               this.renderStack.splice(s,1);
-                                                                       }
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.WEEKDAY:
-                                                               
-                                                               var weekday = rArray[1][0];
-                                                               if (workingDate.getDay()+1 == weekday) {
-                                                                       renderer = rArray[2];
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.MONTH:
-                                                               
-                                                               month = rArray[1][0];
-                                                               if (workingDate.getMonth()+1 == month) {
-                                                                       renderer = rArray[2];
-                                                               }
-                                                               break;
-                                               }
-                                               
-                                               if (renderer) {
-                                                       cellRenderers[cellRenderers.length]=renderer;
-                                               }
-                                       }
+       /**
+       * The default handler for the "pagedate" property
+       * @method configPageDate
+       */
+       configPageDate : function(type, args, obj) {
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
+       },
 
-                               }
+       /**
+       * The default handler for the "mindate" property
+       * @method configMinDate
+       */
+       configMinDate : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.lang.isString(val)) {
+                       val = this._parseDate(val);
+                       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+               }
+       },
 
-                               if (this._indexOfSelectedFieldArray(workingArray) > -1) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
+       /**
+       * The default handler for the "maxdate" property
+       * @method configMaxDate
+       */
+       configMaxDate : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.lang.isString(val)) {
+                       val = this._parseDate(val);
+                       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+               }
+       },
+       
+       /**
+       * The default handler for the "selected" property
+       * @method configSelected
+       */
+       configSelected : function(type, args, obj) {
+               var selected = args[0];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               
+               if (selected) {
+                       if (YAHOO.lang.isString(selected)) {
+                               this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
+                       } 
+               }
+               if (! this._selectedDates) {
+                       this._selectedDates = this.cfg.getProperty(cfgSelected);
+               }
+       },
+       
+       /**
+       * The default handler for all configuration options properties
+       * @method configOptions
+       */
+       configOptions : function(type, args, obj) {
+               this.Options[type.toUpperCase()] = args[0];
+       },
+       
+       /**
+       * The default handler for all configuration locale properties
+       * @method configLocale
+       */
+       configLocale : function(type, args, obj) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.Locale[type.toUpperCase()] = args[0];
+       
+               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+       },
+       
+       /**
+       * The default handler for all configuration locale field length properties
+       * @method configLocaleValues
+       */
+       configLocaleValues : function(type, args, obj) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
+       
+               type = type.toLowerCase();
+               var val = args[0];
+       
+               switch (type) {
+                       case defCfg.LOCALE_MONTHS.key:
+                               switch (val) {
+                                       case YAHOO.widget.Calendar.SHORT:
+                                               this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.LONG:
+                                               this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
+                                               break;
                                }
-
-                               if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
-                                       (maxdate && (workingDate.getTime() > maxdate.getTime()))
-                               ) {
-                                       cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
-                               } else {
-                                       cellRenderers[cellRenderers.length]=cal.styleCellDefault;
-                                       cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
+                               break;
+                       case defCfg.LOCALE_WEEKDAYS.key:
+                               switch (val) {
+                                       case YAHOO.widget.Calendar.ONE_CHAR:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.SHORT:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.MEDIUM:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.LONG:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
+                                               break;
                                }
                                
-                               for (var x=0; x < cellRenderers.length; ++x) {
-                                       this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
-                                       if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
-                                               break;
+                               var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+       
+                               if (START_WEEKDAY > 0) {
+                                       for (var w=0;w<START_WEEKDAY;++w) {
+                                               this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
                                        }
                                }
+                               break;
+               }
+       },
 
-                               workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
-
-                               if (i >= 0 && i <= 6) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
-                               }
-                               if ((i % 7) === 0) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
-                               }
-                               if (((i+1) % 7) === 0) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
-                               }
-                               
-                               var postDays = this.postMonthDays; 
-                               if (hideBlankWeeks && postDays >= 7) {
-                                       var blankWeeks = Math.floor(postDays/7);
-                                       for (var p=0;p<blankWeeks;++p) {
-                                               postDays -= 7;
+       /**
+        * The default handler for the "navigator" property
+        * @method configNavigator
+        */
+       configNavigator : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.widget.CalendarNavigator && (val === true || YAHOO.lang.isObject(val))) {
+                       if (!this.oNavigator) {
+                               this.oNavigator = new YAHOO.widget.CalendarNavigator(this);
+                               // Cleanup DOM Refs/Events before innerHTML is removed.
+                               function erase() {
+                                       if (!this.pages) {
+                                               this.oNavigator.erase();
                                        }
                                }
-                               
-                               if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
-                               }
-
-                               html[html.length] = tempDiv.innerHTML;
-                               i++;
+                               this.beforeRenderEvent.subscribe(erase, this, true);
+                       }
+               } else {
+                       if (this.oNavigator) {
+                               this.oNavigator.destroy();
+                               this.oNavigator = null;
                        }
-
-                       if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
-
-                       html[html.length] = '</tr>';
                }
-       }
+       },
 
-       html[html.length] = '</tbody>';
+       /**
+       * Defines the style constants for the Calendar
+       * @method initStyles
+       */
+       initStyles : function() {
+
+               var defStyle = YAHOO.widget.Calendar._STYLES;
+
+               this.Style = {
+                       /**
+                       * @property Style.CSS_ROW_HEADER
+                       */
+                       CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
+                       /**
+                       * @property Style.CSS_ROW_FOOTER
+                       */
+                       CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
+                       /**
+                       * @property Style.CSS_CELL
+                       */
+                       CSS_CELL : defStyle.CSS_CELL,
+                       /**
+                       * @property Style.CSS_CELL_SELECTOR
+                       */
+                       CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
+                       /**
+                       * @property Style.CSS_CELL_SELECTED
+                       */
+                       CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
+                       /**
+                       * @property Style.CSS_CELL_SELECTABLE
+                       */
+                       CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
+                       /**
+                       * @property Style.CSS_CELL_RESTRICTED
+                       */
+                       CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
+                       /**
+                       * @property Style.CSS_CELL_TODAY
+                       */
+                       CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
+                       /**
+                       * @property Style.CSS_CELL_OOM
+                       */
+                       CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
+                       /**
+                       * @property Style.CSS_CELL_OOB
+                       */
+                       CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
+                       /**
+                       * @property Style.CSS_HEADER
+                       */
+                       CSS_HEADER : defStyle.CSS_HEADER,
+                       /**
+                       * @property Style.CSS_HEADER_TEXT
+                       */
+                       CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+                       /**
+                       * @property Style.CSS_BODY
+                       */
+                       CSS_BODY : defStyle.CSS_BODY,
+                       /**
+                       * @property Style.CSS_WEEKDAY_CELL
+                       */
+                       CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+                       /**
+                       * @property Style.CSS_WEEKDAY_ROW
+                       */
+                       CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+                       /**
+                       * @property Style.CSS_FOOTER
+                       */
+                       CSS_FOOTER : defStyle.CSS_FOOTER,
+                       /**
+                       * @property Style.CSS_CALENDAR
+                       */
+                       CSS_CALENDAR : defStyle.CSS_CALENDAR,
+                       /**
+                       * @property Style.CSS_SINGLE
+                       */
+                       CSS_SINGLE : defStyle.CSS_SINGLE,
+                       /**
+                       * @property Style.CSS_CONTAINER
+                       */
+                       CSS_CONTAINER : defStyle.CSS_CONTAINER,
+                       /**
+                       * @property Style.CSS_NAV_LEFT
+                       */
+                       CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+                       /**
+                       * @property Style.CSS_NAV_RIGHT
+                       */
+                       CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+                       /**
+                       * @property Style.CSS_NAV
+                       */
+                       CSS_NAV : defStyle.CSS_NAV,
+                       /**
+                       * @property Style.CSS_CLOSE
+                       */
+                       CSS_CLOSE : defStyle.CSS_CLOSE,
+                       /**
+                       * @property Style.CSS_CELL_TOP
+                       */
+                       CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+                       /**
+                       * @property Style.CSS_CELL_LEFT
+                       */
+                       CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+                       /**
+                       * @property Style.CSS_CELL_RIGHT
+                       */
+                       CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+                       /**
+                       * @property Style.CSS_CELL_BOTTOM
+                       */
+                       CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+                       /**
+                       * @property Style.CSS_CELL_HOVER
+                       */
+                       CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT1
+                       */
+                       CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT2
+                       */
+                       CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT3
+                       */
+                       CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT4
+                       */
+                       CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
+               };
+       },
+       
+       /**
+       * Builds the date label that will be displayed in the calendar header or
+       * footer, depending on configuration.
+       * @method buildMonthLabel
+       * @return       {String}        The formatted calendar month label
+       */
+       buildMonthLabel : function() {
+               var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+       
+               var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
+               var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
 
-       return html;
-};
+               if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
+                       return yearLabel + monthLabel;
+               } else {
+                       return monthLabel + yearLabel;
+               }
+       },
+       
+       /**
+       * Builds the date digit that will be displayed in calendar cells
+       * @method buildDayLabel
+       * @param {Date} workingDate     The current working date
+       * @return       {String}        The formatted day label
+       */
+       buildDayLabel : function(workingDate) {
+               return workingDate.getDate();
+       },
+       
+       /**
+        * Creates the title bar element and adds it to Calendar container DIV
+        * 
+        * @method createTitleBar
+        * @param {String} strTitle The title to display in the title bar
+        * @return The title bar element
+        */
+       createTitleBar : function(strTitle) {
+               var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
+               tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
+               tDiv.innerHTML = strTitle;
+               this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild);
+       
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
+       
+               return tDiv;
+       },
+       
+       /**
+        * Removes the title bar element from the DOM
+        * 
+        * @method removeTitleBar
+        */
+       removeTitleBar : function() {
+               var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+               if (tDiv) {
+                       YAHOO.util.Event.purgeElement(tDiv);
+                       this.oDomContainer.removeChild(tDiv);
+               }
+               YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
+       },
+       
+       /**
+        * Creates the close button HTML element and adds it to Calendar container DIV
+        * 
+        * @method createCloseButton
+        * @return The close HTML element created
+        */
+       createCloseButton : function() {
+               var Dom = YAHOO.util.Dom,
+                       Event = YAHOO.util.Event,
+                       cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,
+                       DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
+       
+               var lnk = Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0];
+       
+               if (!lnk) {
+                       lnk = document.createElement("a");  
+                       Event.addListener(lnk, "click", function(e, cal) {
+                               cal.hide(); 
+                               Event.preventDefault(e);
+                       }, this);        
+               }
+       
+               lnk.href = "#";
+               lnk.className = "link-close";
+       
+               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img");
+                       img.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
+                       img.className = cssClose;
+                       lnk.appendChild(img);
+               } else {
+                       lnk.innerHTML = '<span class="' + cssClose + ' ' + this.Style.CSS_CLOSE + '"></span>';
+               }
+               this.oDomContainer.appendChild(lnk);
+       
+               return lnk;
+       },
+       
+       /**
+        * Removes the close button HTML element from the DOM
+        * 
+        * @method removeCloseButton
+        */
+       removeCloseButton : function() {
+               var btn = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
+               if (btn) {
+                       YAHOO.util.Event.purgeElement(btn);
+                       this.oDomContainer.removeChild(btn);
+               }
+       },
 
-/**
-* Renders the calendar footer. In the default implementation, there is
-* no footer.
-* @method renderFooter
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };
+       /**
+       * Renders the calendar header.
+       * @method renderHeader
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderHeader : function(html) {
+               this.logger.log("Rendering header", "render");
+               var colSpan = 7;
+               
+               var DEPR_NAV_LEFT = "us/tr/callt.gif";
+               var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+                       colSpan += 1;
+               }
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+                       colSpan += 1;
+               }
+       
+               html[html.length] = "<thead>";
+               html[html.length] =             "<tr>";
+               html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
+               html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';
+       
+               var renderLeft, renderRight = false;
+       
+               if (this.parent) {
+                       if (this.index === 0) {
+                               renderLeft = true;
+                       }
+                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
+                               renderRight = true;
+                       }
+               } else {
+                       renderLeft = true;
+                       renderRight = true;
+               }
+       
+               if (renderLeft) {
+                       var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
+                       // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
+                       if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                               leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
+                       }
+                       var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
+               }
 
-/**
-* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
-* when the method is called: renderHeader, renderBody, renderFooter.
-* Refer to the documentation for those methods for information on 
-* individual render tasks.
-* @method render
-*/
-YAHOO.widget.Calendar.prototype.render = function() {
-       this.beforeRenderEvent.fire();
+               var lbl = this.buildMonthLabel();
+               var cal = this.parent || this;
+               if (cal.cfg.getProperty("navigator")) {
+                       lbl = "<a class=\"" + this.Style.CSS_NAV + "\" href=\"#\">" + lbl + "</a>";
+               }
+               html[html.length] = lbl;
 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               if (renderRight) {
+                       var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
+                       if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                               rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+                       }
+                       var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
+               }
 
-       // Find starting day of the current month
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
+               html[html.length] =     '</div>\n</th>\n</tr>';
 
-       this.resetRenderers();
-       this.cellDates.length = 0;
+               if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
+                       html = this.buildWeekdays(html);
+               }
+               
+               html[html.length] = '</thead>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the Calendar's weekday headers.
+       * @method buildWeekdays
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       buildWeekdays : function(html) {
+       
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+                       html[html.length] = '<th>&#160;</th>';
+               }
+       
+               for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
+                       html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
+               }
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+                       html[html.length] = '<th>&#160;</th>';
+               }
+       
+               html[html.length] = '</tr>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the calendar body.
+       * @method renderBody
+       * @param {Date} workingDate     The current working Date being used for the render process
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderBody : function(workingDate, html) {
+               this.logger.log("Rendering body", "render");
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+       
+               this.preMonthDays = workingDate.getDay();
+               if (startDay > 0) {
+                       this.preMonthDays -= startDay;
+               }
+               if (this.preMonthDays < 0) {
+                       this.preMonthDays += 7;
+               }
+               
+               this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
+               this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
+               this.logger.log(this.preMonthDays + " preciding out-of-month days", "render");
+               this.logger.log(this.monthDays + " month days", "render");
+               this.logger.log(this.postMonthDays + " post-month days", "render");
+               
+               workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
+               this.logger.log("Calendar page starts on " + workingDate, "render");
+       
+               var weekNum,weekClass;
+               var weekPrefix = "w";
+               var cellPrefix = "_cell";
+               var workingDayPrefix = "wd";
+               var dayPrefix = "d";
+               
+               var cellRenderers;
+               var renderer;
+               
+               var todayYear = this.today.getFullYear();
+               var todayMonth = this.today.getMonth();
+               var todayDate = this.today.getDate();
+               
+               var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
+               var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
+               var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
+               var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
+               var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+               var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+       
+               if (mindate) {
+                       mindate = YAHOO.widget.DateMath.clearTime(mindate);
+               }
+               if (maxdate) {
+                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
+               }
+               
+               html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+               
+               var i = 0;
+       
+               var tempDiv = document.createElement("div");
+               var cell = document.createElement("td");
+               tempDiv.appendChild(cell);
+       
+               var cal = this.parent || this;
+       
+               for (var r=0;r<6;r++) {
+       
+                       weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
+                       weekClass = weekPrefix + weekNum;
+       
+                       // Local OOM check for performance, since we already have pagedate
+                       if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
+                               break;
+                       } else {
+       
+                               html[html.length] = '<tr class="' + weekClass + '">';
+                               
+                               if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
+                               
+                               for (var d=0;d<7;d++){ // Render actual days
+       
+                                       cellRenderers = [];
+       
+                                       this.clearElement(cell);
+                                       cell.className = this.Style.CSS_CELL;
+                                       cell.id = this.id + cellPrefix + i;
+                                       this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
+
+                                       if (workingDate.getDate()               == todayDate && 
+                                               workingDate.getMonth()          == todayMonth &&
+                                               workingDate.getFullYear()       == todayYear) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
+                                       }
+                                       
+                                       var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
+                                       this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+                                       
+                                       // Local OOM check for performance, since we already have pagedate
+                                       if (workingDate.getMonth() != useDate.getMonth()) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
+                                       } else {
+                                               YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+                                               YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
+                                       
+                                               for (var s=0;s<this.renderStack.length;++s) {
+       
+                                                       renderer = null;
+       
+                                                       var rArray = this.renderStack[s];
+                                                       var type = rArray[0];
+                                                       
+                                                       var month;
+                                                       var day;
+                                                       var year;
+                                                       
+                                                       switch (type) {
+                                                               case YAHOO.widget.Calendar.DATE:
+                                                                       month = rArray[1][1];
+                                                                       day = rArray[1][2];
+                                                                       year = rArray[1][0];
+       
+                                                                       if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
+                                                                               renderer = rArray[2];
+                                                                               this.renderStack.splice(s,1);
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.MONTH_DAY:
+                                                                       month = rArray[1][0];
+                                                                       day = rArray[1][1];
+                                                                       
+                                                                       if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
+                                                                               renderer = rArray[2];
+                                                                               this.renderStack.splice(s,1);
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.RANGE:
+                                                                       var date1 = rArray[1][0];
+                                                                       var date2 = rArray[1][1];
+       
+                                                                       var d1month = date1[1];
+                                                                       var d1day = date1[2];
+                                                                       var d1year = date1[0];
+                                                                       
+                                                                       var d1 = YAHOO.widget.DateMath.getDate(d1year, d1month-1, d1day);
+       
+                                                                       var d2month = date2[1];
+                                                                       var d2day = date2[2];
+                                                                       var d2year = date2[0];
+       
+                                                                       var d2 = YAHOO.widget.DateMath.getDate(d2year, d2month-1, d2day);
+       
+                                                                       if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
+                                                                               renderer = rArray[2];
+       
+                                                                               if (workingDate.getTime()==d2.getTime()) { 
+                                                                                       this.renderStack.splice(s,1);
+                                                                               }
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.WEEKDAY:
+                                                                       
+                                                                       var weekday = rArray[1][0];
+                                                                       if (workingDate.getDay()+1 == weekday) {
+                                                                               renderer = rArray[2];
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.MONTH:
+                                                                       
+                                                                       month = rArray[1][0];
+                                                                       if (workingDate.getMonth()+1 == month) {
+                                                                               renderer = rArray[2];
+                                                                       }
+                                                                       break;
+                                                       }
+                                                       
+                                                       if (renderer) {
+                                                               cellRenderers[cellRenderers.length]=renderer;
+                                                       }
+                                               }
+       
+                                       }
+       
+                                       if (this._indexOfSelectedFieldArray(workingArray) > -1) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
+                                       }
+       
+                                       if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
+                                               (maxdate && (workingDate.getTime() > maxdate.getTime()))
+                                       ) {
+                                               cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
+                                       } else {
+                                               cellRenderers[cellRenderers.length]=cal.styleCellDefault;
+                                               cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
+                                       }
+                                       
+                                       for (var x=0; x < cellRenderers.length; ++x) {
+                                               this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
+                                               if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
+                                                       break;
+                                               }
+                                       }
+       
+                                       workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
+       
+                                       if (i >= 0 && i <= 6) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
+                                       }
+                                       if ((i % 7) === 0) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
+                                       }
+                                       if (((i+1) % 7) === 0) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
+                                       }
+                                       
+                                       var postDays = this.postMonthDays; 
+                                       if (hideBlankWeeks && postDays >= 7) {
+                                               var blankWeeks = Math.floor(postDays/7);
+                                               for (var p=0;p<blankWeeks;++p) {
+                                                       postDays -= 7;
+                                               }
+                                       }
+                                       
+                                       if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
+                                       }
+       
+                                       html[html.length] = tempDiv.innerHTML;
+                                       i++;
+                               }
+       
+                               if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
+       
+                               html[html.length] = '</tr>';
+                       }
+               }
+       
+               html[html.length] = '</tbody>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the calendar footer. In the default implementation, there is
+       * no footer.
+       * @method renderFooter
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderFooter : function(html) { return html; },
+       
+       /**
+       * Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
+       * when the method is called: renderHeader, renderBody, renderFooter.
+       * Refer to the documentation for those methods for information on 
+       * individual render tasks.
+       * @method render
+       */
+       render : function() {
+               this.beforeRenderEvent.fire();
+       
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               // Find starting day of the current month
+               var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
+       
+               this.resetRenderers();
+               this.cellDates.length = 0;
 
-       YAHOO.util.Event.purgeElement(this.oDomContainer, true);
+               YAHOO.util.Event.purgeElement(this.oDomContainer, true);
 
-       var html = [];
+               var html = [];
+       
+               html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
+               html = this.renderHeader(html);
+               html = this.renderBody(workingDate, html);
+               html = this.renderFooter(html);
+               html[html.length] = '</table>';
 
-       html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
-       html = this.renderHeader(html);
-       html = this.renderBody(workingDate, html);
-       html = this.renderFooter(html);
-       html[html.length] = '</table>';
+               this.oDomContainer.innerHTML = html.join("\n");
 
-       this.oDomContainer.innerHTML = html.join("\n");
+               this.applyListeners();
+               this.cells = this.oDomContainer.getElementsByTagName("td");
+       
+               this.cfg.refireEvent(defCfg.TITLE.key);
+               this.cfg.refireEvent(defCfg.CLOSE.key);
+               this.cfg.refireEvent(defCfg.IFRAME.key);
+       
+               this.renderEvent.fire();
+       },
 
-       this.applyListeners();
-       this.cells = this.oDomContainer.getElementsByTagName("td");
+       /**
+       * Applies the Calendar's DOM listeners to applicable elements.
+       * @method applyListeners
+       */
+       applyListeners : function() {
+               var root = this.oDomContainer;
+               var cal = this.parent || this;
+               var anchor = "a";
+               var mousedown = "mousedown";
+
+               var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
+               var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+       
+               if (linkLeft && linkLeft.length > 0) {
+                       this.linkLeft = linkLeft[0];
+                       YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
+               }
 
-       this.cfg.refireEvent(defCfg.TITLE.key);
-       this.cfg.refireEvent(defCfg.CLOSE.key);
-       this.cfg.refireEvent(defCfg.IFRAME.key);
+               if (linkRight && linkRight.length > 0) {
+                       this.linkRight = linkRight[0];
+                       YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
+               }
 
-       this.renderEvent.fire();
-};
+               if (cal.cfg.getProperty("navigator") !== null) {
+                       this.applyNavListeners();
+               }
 
-/**
-* Applies the Calendar's DOM listeners to applicable elements.
-* @method applyListeners
-*/
-YAHOO.widget.Calendar.prototype.applyListeners = function() {
+               if (this.domEventMap) {
+                       var el,elements;
+                       for (var cls in this.domEventMap) {     
+                               if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
+                                       var items = this.domEventMap[cls];
        
-       var root = this.oDomContainer;
-       var cal = this.parent || this;
+                                       if (! (items instanceof Array)) {
+                                               items = [items];
+                                       }
+       
+                                       for (var i=0;i<items.length;i++)        {
+                                               var item = items[i];
+                                               elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
+       
+                                               for (var c=0;c<elements.length;c++) {
+                                                       el = elements[c];
+                                                        YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
+                                               }
+                                       }
+                               }
+                       }
+               }
        
-       var anchor = "a";
-       var mousedown = "mousedown";
+               YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
+               YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
+               YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
+       },
 
-       var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
-       var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+       applyNavListeners : function() {
 
-       if (linkLeft && linkLeft.length > 0) {
-               this.linkLeft = linkLeft[0];
-               YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
-       }
+               var E = YAHOO.util.Event;
 
-       if (linkRight && linkRight.length > 0) {
-               this.linkRight = linkRight[0];
-               YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
-       }
+               var calParent = this.parent || this;
+               var cal = this;
 
-       if (this.domEventMap) {
-               var el,elements;
-               for (var cls in this.domEventMap) {     
-                       if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
-                               var items = this.domEventMap[cls];
+               var navBtns = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV, "a", this.oDomContainer);
 
-                               if (! (items instanceof Array)) {
-                                       items = [items];
-                               }
+               if (navBtns.length > 0) {
 
-                               for (var i=0;i<items.length;i++)        {
-                                       var item = items[i];
-                                       elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
+                       function show(e, obj) {
+                               var target = E.getTarget(e);
+                               // this == navBtn
+                               if (this === target || YAHOO.util.Dom.isAncestor(this, target)) {
+                                       E.preventDefault(e);
+                               }
+                               var navigator = calParent.oNavigator;
+                               if (navigator) {
+                                       var pgdate = cal.cfg.getProperty("pagedate");
+                                       navigator.setYear(pgdate.getFullYear());
+                                       navigator.setMonth(pgdate.getMonth());
+                                       navigator.show();
+                               }
+                       }
+                       E.addListener(navBtns, "click", show);
+               }
+       },
 
-                                       for (var c=0;c<elements.length;c++) {
-                                               el = elements[c];
-                                                YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
-                                       }
+       /**
+       * Retrieves the Date object for the specified Calendar cell
+       * @method getDateByCellId
+       * @param {String}       id      The id of the cell
+       * @return {Date} The Date object for the specified Calendar cell
+       */
+       getDateByCellId : function(id) {
+               var date = this.getDateFieldsByCellId(id);
+               return YAHOO.widget.DateMath.getDate(date[0],date[1]-1,date[2]);
+       },
+       
+       /**
+       * Retrieves the Date object for the specified Calendar cell
+       * @method getDateFieldsByCellId
+       * @param {String}       id      The id of the cell
+       * @return {Array}       The array of Date fields for the specified Calendar cell
+       */
+       getDateFieldsByCellId : function(id) {
+               id = id.toLowerCase().split("_cell")[1];
+               id = parseInt(id, 10);
+               return this.cellDates[id];
+       },
+       
+       /**
+        * Find the Calendar's cell index for a given date.
+        * If the date is not found, the method returns -1.
+        * <p>
+        * The returned index can be used to lookup the cell HTMLElement  
+        * using the Calendar's cells array or passed to selectCell to select 
+        * cells by index. 
+        * </p>
+        *
+        * See <a href="#cells">cells</a>, <a href="#selectCell">selectCell</a>.
+        *
+        * @method getCellIndex
+        * @param {Date} date JavaScript Date object, for which to find a cell index.
+        * @return {Number} The index of the date in Calendars cellDates/cells arrays, or -1 if the date 
+        * is not on the curently rendered Calendar page.
+        */
+       getCellIndex : function(date) {
+               var idx = -1;
+               if (date) {
+                       var m = date.getMonth(),
+                               y = date.getFullYear(),
+                               d = date.getDate(),
+                               dates = this.cellDates;
+
+                       for (var i = 0; i < dates.length; ++i) {
+                               var cellDate = dates[i];
+                               if (cellDate[0] === y && cellDate[1] === m+1 && cellDate[2] === d) {
+                                       idx = i;
+                                       break;
                                }
                        }
                }
+               return idx;
+       },
+       
+       // BEGIN BUILT-IN TABLE CELL RENDERERS
+       
+       /**
+       * Renders a cell that falls before the minimum date or after the maximum date.
+       * widget class.
+       * @method renderOutOfBoundsDate
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderOutOfBoundsDate : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
+               cell.innerHTML = workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       /**
+       * Renders the row header for a week.
+       * @method renderRowHeader
+       * @param {Number}       weekNum The week number of the current row
+       * @param {Array}        cell    The current working HTML array
+       */
+       renderRowHeader : function(weekNum, html) {
+               html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
+               return html;
+       },
+       
+       /**
+       * Renders the row footer for a week.
+       * @method renderRowFooter
+       * @param {Number}       weekNum The week number of the current row
+       * @param {Array}        cell    The current working HTML array
+       */
+       renderRowFooter : function(weekNum, html) {
+               html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
+               return html;
+       },
+       
+       /**
+       * Renders a single standard calendar cell in the calendar widget table.
+       * All logic for determining how a standard default cell will be rendered is 
+       * encapsulated in this method, and must be accounted for when extending the
+       * widget class.
+       * @method renderCellDefault
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellDefault : function(workingDate, cell) {
+               cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
+       },
+       
+       /**
+       * Styles a selectable cell.
+       * @method styleCellDefault
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       styleCellDefault : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       },
+       
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight1 style
+       * @method renderCellStyleHighlight1
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight1 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight2 style
+       * @method renderCellStyleHighlight2
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight2 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight3 style
+       * @method renderCellStyleHighlight3
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight3 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight4 style
+       * @method renderCellStyleHighlight4
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight4 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
+       },
+       
+       /**
+       * Applies the default style used for rendering today's date to the current calendar cell
+       * @method renderCellStyleToday
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleToday : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
+       },
+       
+       /**
+       * Applies the default style used for rendering selected dates to the current calendar cell
+       * @method renderCellStyleSelected
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderCellStyleSelected : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
+       },
+       
+       /**
+       * Applies the default style used for rendering dates that are not a part of the current
+       * month (preceding or trailing the cells for the current month)
+       * @method renderCellNotThisMonth
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderCellNotThisMonth : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
+               cell.innerHTML=workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       /**
+       * Renders the current calendar cell as a non-selectable "black-out" date using the default
+       * restricted style.
+       * @method renderBodyCellRestricted
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderBodyCellRestricted : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
+               cell.innerHTML=workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       // END BUILT-IN TABLE CELL RENDERERS
+       
+       // BEGIN MONTH NAVIGATION METHODS
+       
+       /**
+       * Adds the designated number of months to the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method addMonths
+       * @param {Number}       count   The number of months to add to the current calendar
+       */
+       addMonths : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Subtracts the designated number of months from the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method subtractMonths
+       * @param {Number}       count   The number of months to subtract from the current calendar
+       */
+       subtractMonths : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Adds the designated number of years to the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method addYears
+       * @param {Number}       count   The number of years to add to the current calendar
+       */
+       addYears : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Subtcats the designated number of years from the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method subtractYears
+       * @param {Number}       count   The number of years to subtract from the current calendar
+       */
+       subtractYears : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Navigates to the next month page in the calendar widget.
+       * @method nextMonth
+       */
+       nextMonth : function() {
+               this.addMonths(1);
+       },
+       
+       /**
+       * Navigates to the previous month page in the calendar widget.
+       * @method previousMonth
+       */
+       previousMonth : function() {
+               this.subtractMonths(1);
+       },
+       
+       /**
+       * Navigates to the next year in the currently selected month in the calendar widget.
+       * @method nextYear
+       */
+       nextYear : function() {
+               this.addYears(1);
+       },
+       
+       /**
+       * Navigates to the previous year in the currently selected month in the calendar widget.
+       * @method previousYear
+       */
+       previousYear : function() {
+               this.subtractYears(1);
+       },
+       
+       // END MONTH NAVIGATION METHODS
+       
+       // BEGIN SELECTION METHODS
+       
+       /**
+       * Resets the calendar widget to the originally selected month and year, and 
+       * sets the calendar to the initial selection(s).
+       * @method reset
+       */
+       reset : function() {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.cfg.resetProperty(defCfg.SELECTED.key);
+               this.cfg.resetProperty(defCfg.PAGEDATE.key);
+               this.resetEvent.fire();
+       },
+       
+       /**
+       * Clears the selected dates in the current calendar widget and sets the calendar
+       * to the current month and year.
+       * @method clear
+       */
+       clear : function() {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.cfg.setProperty(defCfg.SELECTED.key, []);
+               this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
+               this.clearEvent.fire();
+       },
+       
+       /**
+       * Selects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once selection has completed, render must be 
+       * called for the changes to be reflected visually.
+       *
+       * Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
+       * selected dates passed to the selectEvent will not contain OOB dates.
+       * 
+       * If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
+       *
+       * @method select
+       * @param        {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects.
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       select : function(date) {
+               this.logger.log("Select: " + date, "info");
+       
+               var aToBeSelected = this._toFieldArray(date);
+               this.logger.log("Selection field array: " + aToBeSelected, "info");
+       
+               // Filtered array of valid dates
+               var validDates = [];
+               var selected = [];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               
+               for (var a=0; a < aToBeSelected.length; ++a) {
+                       var toSelect = aToBeSelected[a];
+       
+                       if (!this.isDateOOB(this._toDate(toSelect))) {
+                               
+                               if (validDates.length === 0) {
+                                       this.beforeSelectEvent.fire();
+                                       selected = this.cfg.getProperty(cfgSelected);
+                               }
+       
+                               validDates.push(toSelect);
+                               
+                               if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
+                                       selected[selected.length] = toSelect;
+                               }
+                       }
+               }
+               
+               if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeSelect and select events not fired", "info"); }
+       
+               if (validDates.length > 0) {
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.selectEvent.fire(validDates);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Selects a date on the current calendar by referencing the index of the cell that should be selected.
+       * This method is used to easily select a single cell (usually with a mouse click) without having to do
+       * a full render. The selected style is applied to the cell directly.
+       *
+       * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+       * or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
+       * 
+       * @method selectCell
+       * @param        {Number}        cellIndex       The index of the cell to select in the current calendar. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       selectCell : function(cellIndex) {
+       
+               var cell = this.cells[cellIndex];
+               var cellDate = this.cellDates[cellIndex];
+               var dCellDate = this._toDate(cellDate);
+               this.logger.log("Select: " + dCellDate, "info");
+               
+               var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+               if (!selectable) {this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable cell. beforeSelect, select events not fired", "info"); }
+       
+               if (selectable) {
+       
+                       this.beforeSelectEvent.fire();
+       
+                       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+                       var selected = this.cfg.getProperty(cfgSelected);
+       
+                       var selectDate = cellDate.concat();
+       
+                       if (this._indexOfSelectedFieldArray(selectDate) == -1) {
+                               selected[selected.length] = selectDate;
+                       }
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.renderCellStyleSelected(dCellDate,cell);
+                       this.selectEvent.fire([selectDate]);
+       
+                       this.doCellMouseOut.call(cell, null, this);             
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once deselection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * 
+       * The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
+       * and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
+       * 
+       * If all dates are OOB, beforeDeselect and deselect events will not be fired.
+       * 
+       * @method deselect
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselect : function(date) {
+               this.logger.log("Deselect: " + date, "info");
+       
+               var aToBeDeselected = this._toFieldArray(date);
+               this.logger.log("Deselection field array: " + aToBeDeselected, "info");
+       
+               var validDates = [];
+               var selected = [];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+               for (var a=0; a < aToBeDeselected.length; ++a) {
+                       var toDeselect = aToBeDeselected[a];
+       
+                       if (!this.isDateOOB(this._toDate(toDeselect))) {
+       
+                               if (validDates.length === 0) {
+                                       this.beforeDeselectEvent.fire();
+                                       selected = this.cfg.getProperty(cfgSelected);
+                               }
+       
+                               validDates.push(toDeselect);
+       
+                               var index = this._indexOfSelectedFieldArray(toDeselect);
+                               if (index != -1) {      
+                                       selected.splice(index,1);
+                               }
+                       }
+               }
+       
+               if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeDeselect and deselect events not fired");}
+       
+               if (validDates.length > 0) {
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.deselectEvent.fire(validDates);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
+       * This method is used to easily deselect a single cell (usually with a mouse click) without having to do
+       * a full render. The selected style is removed from the cell directly.
+       * 
+       * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+       * or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
+       * deselect events will not be fired.
+       * 
+       * @method deselectCell
+       * @param        {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselectCell : function(cellIndex) {
+               var cell = this.cells[cellIndex];
+               var cellDate = this.cellDates[cellIndex];
+               var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+               
+               var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+               if (!selectable) { this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable/deselectable cell", "info"); }
+       
+               if (selectable) {
+       
+                       this.beforeDeselectEvent.fire();
+       
+                       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+                       var selected = this.cfg.getProperty(defCfg.SELECTED.key);
+       
+                       var dCellDate = this._toDate(cellDate);
+                       var selectDate = cellDate.concat();
+       
+                       if (cellDateIndex > -1) {
+                               if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
+                                       this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
+                                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+                               }
+                               selected.splice(cellDateIndex, 1);
+                       }
+       
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
+                       } else {
+                               this.cfg.setProperty(defCfg.SELECTED.key, selected);
+                       }
+       
+                       this.deselectEvent.fire(selectDate);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects all dates on the current calendar.
+       * @method deselectAll
+       * @return {Date[]}              Array of JavaScript Date objects representing all individual dates that are currently selected.
+       *                                               Assuming that this function executes properly, the return value should be an empty array.
+       *                                               However, the empty array is returned for the sake of being able to check the selection status
+       *                                               of the calendar.
+       */
+       deselectAll : function() {
+               this.beforeDeselectEvent.fire();
+               
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+               var selected = this.cfg.getProperty(cfgSelected);
+               var count = selected.length;
+               var sel = selected.concat();
+       
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, []);
+               } else {
+                       this.cfg.setProperty(cfgSelected, []);
+               }
+               
+               if (count > 0) {
+                       this.deselectEvent.fire(sel);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       // END SELECTION METHODS
+       
+       // BEGIN TYPE CONVERSION METHODS
+       
+       /**
+       * Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
+       * used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
+       * @method _toFieldArray
+       * @private
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return {Array[](Number[])}   Array of date field arrays
+       */
+       _toFieldArray : function(date) {
+               var returnDate = [];
+       
+               if (date instanceof Date) {
+                       returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
+               } else if (YAHOO.lang.isString(date)) {
+                       returnDate = this._parseDates(date);
+               } else if (YAHOO.lang.isArray(date)) {
+                       for (var i=0;i<date.length;++i) {
+                               var d = date[i];
+                               returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+                       }
+               }
+               
+               return returnDate;
+       },
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object. The date field array
+       * is the format in which dates are as provided as arguments to selectEvent and deselectEvent listeners.
+       * 
+       * @method toDate
+       * @param        {Number[]}      dateFieldArray  The date field array to convert to a JavaScript Date.
+       * @return       {Date}  JavaScript Date object representing the date field array.
+       */
+       toDate : function(dateFieldArray) {
+               return this._toDate(dateFieldArray);
+       },
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+       * @method _toDate
+       * @private
+       * @deprecated Made public, toDate 
+       * @param        {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.
+       * @return       {Date}  JavaScript Date object representing the date field array
+       */
+       _toDate : function(dateFieldArray) {
+               if (dateFieldArray instanceof Date) {
+                       return dateFieldArray;
+               } else {
+                       return YAHOO.widget.DateMath.getDate(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
+               }
+       },
+       
+       // END TYPE CONVERSION METHODS 
+       
+       // BEGIN UTILITY METHODS
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+       * @method _fieldArraysAreEqual
+       * @private
+       * @param        {Number[]}      array1  The first date field array to compare
+       * @param        {Number[]}      array2  The first date field array to compare
+       * @return       {Boolean}       The boolean that represents the equality of the two arrays
+       */
+       _fieldArraysAreEqual : function(array1, array2) {
+               var match = false;
+       
+               if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
+                       match=true;     
+               }
+       
+               return match;
+       },
+       
+       /**
+       * Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
+       * @method       _indexOfSelectedFieldArray
+       * @private
+       * @param        {Number[]}              find    The date field array to search for
+       * @return       {Number}                        The index of the date field array within the collection of selected dates.
+       *                                                               -1 will be returned if the date is not found.
+       */
+       _indexOfSelectedFieldArray : function(find) {
+               var selected = -1;
+               var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
+       
+               for (var s=0;s<seldates.length;++s) {
+                       var sArray = seldates[s];
+                       if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
+                               selected = s;
+                               break;
+                       }
+               }
+       
+               return selected;
+       },
+       
+       /**
+       * Determines whether a given date is OOM (out of month).
+       * @method       isDateOOM
+       * @param        {Date}  date    The JavaScript Date object for which to check the OOM status
+       * @return       {Boolean}       true if the date is OOM
+       */
+       isDateOOM : function(date) {
+               return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
+       },
+       
+       /**
+       * Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
+       *
+       * @method       isDateOOB
+       * @param        {Date}  date    The JavaScript Date object for which to check the OOB status
+       * @return       {Boolean}       true if the date is OOB
+       */
+       isDateOOB : function(date) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               
+               var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
+               var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
+               var dm = YAHOO.widget.DateMath;
+               
+               if (minDate) {
+                       minDate = dm.clearTime(minDate);
+               } 
+               if (maxDate) {
+                       maxDate = dm.clearTime(maxDate);
+               }
+       
+               var clearedDate = new Date(date.getTime());
+               clearedDate = dm.clearTime(clearedDate);
+       
+               return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
+       },
+       
+       /**
+        * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
+        * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
+        * @method      _parsePageDate
+        * @private
+        * @param {Date|String} date    Pagedate value which needs to be parsed
+        * @return {Date}       The Date object representing the pagedate
+        */
+       _parsePageDate : function(date) {
+               var parsedDate;
+               
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               if (date) {
+                       if (date instanceof Date) {
+                               parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
+                       } else {
+                               var month, year, aMonthYear;
+                               aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
+                               month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
+                               year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
+
+                               parsedDate = YAHOO.widget.DateMath.getDate(year, month, 1);
+                       }
+               } else {
+                       parsedDate = YAHOO.widget.DateMath.getDate(this.today.getFullYear(), this.today.getMonth(), 1);
+               }
+               return parsedDate;
+       },
+       
+       // END UTILITY METHODS
+       
+       // BEGIN EVENT HANDLERS
+       
+       /**
+       * Event executed before a date is selected in the calendar widget.
+       * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
+       */
+       onBeforeSelect : function() {
+               if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
+                       if (this.parent) {
+                               this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
+                               this.parent.deselectAll();
+                       } else {
+                               this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
+                               this.deselectAll();
+                       }
+               }
+       },
+       
+       /**
+       * Event executed when a date is selected in the calendar widget.
+       * @param        {Array} selected        An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+       * @deprecated Event handlers for this event should be susbcribed to selectEvent.
+       */
+       onSelect : function(selected) { },
+       
+       /**
+       * Event executed before a date is deselected in the calendar widget.
+       * @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
+       */
+       onBeforeDeselect : function() { },
+       
+       /**
+       * Event executed when a date is deselected in the calendar widget.
+       * @param        {Array} selected        An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+       * @deprecated Event handlers for this event should be susbcribed to deselectEvent.
+       */
+       onDeselect : function(deselected) { },
+       
+       /**
+       * Event executed when the user navigates to a different calendar page.
+       * @deprecated Event handlers for this event should be susbcribed to changePageEvent.
+       */
+       onChangePage : function() {
+               this.render();
+       },
+       
+       /**
+       * Event executed when the calendar widget is rendered.
+       * @deprecated Event handlers for this event should be susbcribed to renderEvent.
+       */
+       onRender : function() { },
+       
+       /**
+       * Event executed when the calendar widget is reset to its original state.
+       * @deprecated Event handlers for this event should be susbcribed to resetEvemt.
+       */
+       onReset : function() { this.render(); },
+       
+       /**
+       * Event executed when the calendar widget is completely cleared to the current month with no selections.
+       * @deprecated Event handlers for this event should be susbcribed to clearEvent.
+       */
+       onClear : function() { this.render(); },
+       
+       /**
+       * Validates the calendar widget. This method has no default implementation
+       * and must be extended by subclassing the widget.
+       * @return       Should return true if the widget validates, and false if
+       * it doesn't.
+       * @type Boolean
+       */
+       validate : function() { return true; },
+       
+       // END EVENT HANDLERS
+       
+       // BEGIN DATE PARSE METHODS
+       
+       /**
+       * Converts a date string to a date field array
+       * @private
+       * @param        {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.
+       * @return                               A date field array representing the string passed to the method
+       * @type Array[](Number[])
+       */
+       _parseDate : function(sDate) {
+               var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
+               var rArray;
+       
+               if (aDate.length == 2) {
+                       rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
+                       rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
+               } else {
+                       rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
+                       rArray.type = YAHOO.widget.Calendar.DATE;
+               }
+       
+               for (var i=0;i<rArray.length;i++) {
+                       rArray[i] = parseInt(rArray[i], 10);
+               }
+       
+               return rArray;
+       },
+       
+       /**
+       * Converts a multi or single-date string to an array of date field arrays
+       * @private
+       * @param        {String}        sDates          Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
+       * @return                                                       An array of date field arrays
+       * @type Array[](Number[])
+       */
+       _parseDates : function(sDates) {
+               var aReturn = [];
+       
+               var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+               
+               for (var d=0;d<aDates.length;++d) {
+                       var sDate = aDates[d];
+       
+                       if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
+                               // This is a range
+                               var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
+       
+                               var dateStart = this._parseDate(aRange[0]);
+                               var dateEnd = this._parseDate(aRange[1]);
+       
+                               var fullRange = this._parseRange(dateStart, dateEnd);
+                               aReturn = aReturn.concat(fullRange);
+                       } else {
+                               // This is not a range
+                               var aDate = this._parseDate(sDate);
+                               aReturn.push(aDate);
+                       }
+               }
+               return aReturn;
+       },
+       
+       /**
+       * Converts a date range to the full list of included dates
+       * @private
+       * @param        {Number[]}      startDate       Date field array representing the first date in the range
+       * @param        {Number[]}      endDate         Date field array representing the last date in the range
+       * @return                                                       An array of date field arrays
+       * @type Array[](Number[])
+       */
+       _parseRange : function(startDate, endDate) {
+               var dCurrent = YAHOO.widget.DateMath.add(YAHOO.widget.DateMath.getDate(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
+               var dEnd     = YAHOO.widget.DateMath.getDate(endDate[0],  endDate[1]-1,  endDate[2]);
+       
+               var results = [];
+               results.push(startDate);
+               while (dCurrent.getTime() <= dEnd.getTime()) {
+                       results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
+                       dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
+               }
+               return results;
+       },
+       
+       // END DATE PARSE METHODS
+       
+       // BEGIN RENDERER METHODS
+       
+       /**
+       * Resets the render stack of the current calendar to its original pre-render value.
+       */
+       resetRenderers : function() {
+               this.renderStack = this._renderStack.concat();
+       },
+       
+       /**
+        * Removes all custom renderers added to the Calendar through the addRenderer, addMonthRenderer and 
+        * addWeekdayRenderer methods. Calendar's render method needs to be called after removing renderers 
+        * to re-render the Calendar without custom renderers applied.
+        */
+       removeRenderers : function() {
+               this._renderStack = [];
+               this.renderStack = [];
+       },
+
+       /**
+       * Clears the inner HTML, CSS class and style information from the specified cell.
+       * @method clearElement
+       * @param        {HTMLTableCellElement} cell The cell to clear
+       */ 
+       clearElement : function(cell) {
+               cell.innerHTML = "&#160;";
+               cell.className="";
+       },
+       
+       /**
+       * Adds a renderer to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the conditions specified in the date string for this renderer.
+       * @method addRenderer
+       * @param        {String}        sDates          A date string to associate with the specified renderer. Valid formats
+       *                                                                       include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addRenderer : function(sDates, fnRender) {
+               var aDates = this._parseDates(sDates);
+               for (var i=0;i<aDates.length;++i) {
+                       var aDate = aDates[i];
+               
+                       if (aDate.length == 2) { // this is either a range or a month/day combo
+                               if (aDate[0] instanceof Array) { // this is a range
+                                       this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
+                               } else { // this is a month/day combo
+                                       this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
+                               }
+                       } else if (aDate.length == 3) {
+                               this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+                       }
+               }
+       },
+       
+       /**
+       * The private method used for adding cell renderers to the local render stack.
+       * This method is called by other methods that set the renderer type prior to the method call.
+       * @method _addRenderer
+       * @private
+       * @param        {String}        type            The type string that indicates the type of date renderer being added.
+       *                                                                       Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
+       *                                                                       YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
+       * @param        {Array}         aDates          An array of dates used to construct the renderer. The format varies based
+       *                                                                       on the renderer type
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       _addRenderer : function(type, aDates, fnRender) {
+               var add = [type,aDates,fnRender];
+               this.renderStack.unshift(add);  
+               this._renderStack = this.renderStack.concat();
+       },
+
+       /**
+       * Adds a month to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the month passed to this method.
+       * @method addMonthRenderer
+       * @param        {Number}        month           The month (1-12) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addMonthRenderer : function(month, fnRender) {
+               this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
+       },
+
+       /**
+       * Adds a weekday to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the weekday passed to this method.
+       * @method addWeekdayRenderer
+       * @param        {Number}        weekday         The weekday (0-6) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addWeekdayRenderer : function(weekday, fnRender) {
+               this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
+       },
+       
+       // END RENDERER METHODS
+       
+       // BEGIN CSS METHODS
+       
+       /**
+       * Removes all styles from all body cells in the current calendar table.
+       * @method clearAllBodyCellStyles
+       * @param        {style} style The CSS class name to remove from all calendar body cells
+       */
+       clearAllBodyCellStyles : function(style) {
+               for (var c=0;c<this.cells.length;++c) {
+                       YAHOO.util.Dom.removeClass(this.cells[c],style);
+               }
+       },
+       
+       // END CSS METHODS
+       
+       // BEGIN GETTER/SETTER METHODS
+       /**
+       * Sets the calendar's month explicitly
+       * @method setMonth
+       * @param {Number}       month           The numeric month, from 0 (January) to 11 (December)
+       */
+       setMonth : function(month) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               var current = this.cfg.getProperty(cfgPageDate);
+               current.setMonth(parseInt(month, 10));
+               this.cfg.setProperty(cfgPageDate, current);
+       },
+
+       /**
+       * Sets the calendar's year explicitly.
+       * @method setYear
+       * @param {Number}       year            The numeric 4-digit year
+       */
+       setYear : function(year) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               var current = this.cfg.getProperty(cfgPageDate);
+               current.setFullYear(parseInt(year, 10));
+               this.cfg.setProperty(cfgPageDate, current);
+       },
+
+       /**
+       * Gets the list of currently selected dates from the calendar.
+       * @method getSelectedDates
+       * @return {Date[]} An array of currently selected JavaScript Date objects.
+       */
+       getSelectedDates : function() {
+               var returnDates = [];
+               var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
+
+               for (var d=0;d<selected.length;++d) {
+                       var dateArray = selected[d];
+
+                       var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+                       returnDates.push(date);
+               }
+
+               returnDates.sort( function(a,b) { return a-b; } );
+               return returnDates;
+       },
+
+       /// END GETTER/SETTER METHODS ///
+       
+       /**
+       * Hides the Calendar's outer container from view.
+       * @method hide
+       */
+       hide : function() {
+               if (this.beforeHideEvent.fire()) {
+                       this.oDomContainer.style.display = "none";
+                       this.hideEvent.fire();
+               }
+       },
+
+       /**
+       * Shows the Calendar's outer container.
+       * @method show
+       */
+       show : function() {
+               if (this.beforeShowEvent.fire()) {
+                       this.oDomContainer.style.display = "block";
+                       this.showEvent.fire();
+               }
+       },
+
+       /**
+       * Returns a string representing the current browser.
+       * @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
+       * @see YAHOO.env.ua
+       * @property browser
+       * @type String
+       */
+       browser : (function() {
+                               var ua = navigator.userAgent.toLowerCase();
+                                         if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
+                                                return 'opera';
+                                         } else if (ua.indexOf('msie 7')!=-1) { // IE7
+                                                return 'ie7';
+                                         } else if (ua.indexOf('msie') !=-1) { // IE
+                                                return 'ie';
+                                         } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
+                                                return 'safari';
+                                         } else if (ua.indexOf('gecko') != -1) { // Gecko
+                                                return 'gecko';
+                                         } else {
+                                                return false;
+                                         }
+                               })(),
+       /**
+       * Returns a string representation of the object.
+       * @method toString
+       * @return {String}      A string representation of the Calendar object.
+       */
+       toString : function() {
+               return "Calendar " + this.id;
+       }
+};
+
+/**
+* @namespace YAHOO.widget
+* @class Calendar_Core
+* @extends YAHOO.widget.Calendar
+* @deprecated The old Calendar_Core class is no longer necessary.
+*/
+YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;
+
+YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;
+
+/**
+* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
+* the ability to have multi-page calendar views that share a single dataset and are
+* dependent on each other.
+*
+* The calendar group instance will refer to each of its elements using a 0-based index.
+* For example, to construct the placeholder for a calendar group widget with id "cal1" and
+* containerId of "cal1Container", the markup would be as follows:
+*      <xmp>
+*              <div id="cal1Container_0"></div>
+*              <div id="cal1Container_1"></div>
+*      </xmp>
+* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
+* 
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The CalendarGroup can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*      <xmp>
+*              var c = new YAHOO.widget.CalendarGroup("calContainer", configOptions);
+*      </xmp>
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*              var c = new YAHOO.widget.CalendarGroup(containerDiv, configOptions);
+*      </xmp>
+* </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the CalendarGroup's ID will be set to "calContainer_t".
+* </p>
+* 
+* @namespace YAHOO.widget
+* @class CalendarGroup
+* @constructor
+* @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
+*/
+YAHOO.widget.CalendarGroup = function(id, containerId, config) {
+       if (arguments.length > 0) {
+               this.init.apply(this, arguments);
        }
-
-       YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
-       YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
-       YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
 };
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateByCellId
-* @param {String}      id      The id of the cell
-* @return {Date} The Date object for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateByCellId = function(id) {
-       var date = this.getDateFieldsByCellId(id);
-       return new Date(date[0],date[1]-1,date[2]);
-};
+YAHOO.widget.CalendarGroup.prototype = {
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateFieldsByCellId
-* @param {String}      id      The id of the cell
-* @return {Array}      The array of Date fields for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {
-       id = id.toLowerCase().split("_cell")[1];
-       id = parseInt(id, 10);
-       return this.cellDates[id];
-};
+       /**
+       * Initializes the calendar group. All subclasses must call this method in order for the
+       * group to be initialized properly.
+       * @method init
+       * @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+       * @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+       * @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
+       */
+       init : function(id, container, config) {
 
-// BEGIN BUILT-IN TABLE CELL RENDERERS
+               // Normalize 2.4.0, pre 2.4.0 args
+               var nArgs = this._parseArgs(arguments);
 
-/**
-* Renders a cell that falls before the minimum date or after the maximum date.
-* widget class.
-* @method renderOutOfBoundsDate
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
-       cell.innerHTML = workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               id = nArgs.id;
+               container = nArgs.container;
+               config = nArgs.config;
 
-/**
-* Renders the row header for a week.
-* @method renderRowHeader
-* @param {Number}      weekNum The week number of the current row
-* @param {Array}       cell    The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowHeader = function(weekNum, html) {
-       html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
-       return html;
-};
+               this.oDomContainer = YAHOO.util.Dom.get(container);
+               if (!this.oDomContainer) { this.logger.log("Container not found in document.", "error"); }
 
-/**
-* Renders the row footer for a week.
-* @method renderRowFooter
-* @param {Number}      weekNum The week number of the current row
-* @param {Array}       cell    The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {
-       html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
-       return html;
-};
+               if (!this.oDomContainer.id) {
+                       this.oDomContainer.id = YAHOO.util.Dom.generateId();
+               }
+               if (!id) {
+                       id = this.oDomContainer.id + "_t";
+               }
 
-/**
-* Renders a single standard calendar cell in the calendar widget table.
-* All logic for determining how a standard default cell will be rendered is 
-* encapsulated in this method, and must be accounted for when extending the
-* widget class.
-* @method renderCellDefault
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {
-       cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
-};
+               /**
+               * The unique id associated with the CalendarGroup
+               * @property id
+               * @type String
+               */
+               this.id = id;
 
-/**
-* Styles a selectable cell.
-* @method styleCellDefault
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.styleCellDefault = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
-};
+               /**
+               * The unique id associated with the CalendarGroup container
+               * @property containerId
+               * @type String
+               */
+               this.containerId = this.oDomContainer.id;
 
+               this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + this.id);
+               this.initEvents();
+               this.initStyles();
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight1 style
-* @method renderCellStyleHighlight1
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
-};
+               /**
+               * The collection of Calendar pages contained within the CalendarGroup
+               * @property pages
+               * @type YAHOO.widget.Calendar[]
+               */
+               this.pages = [];
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight2 style
-* @method renderCellStyleHighlight2
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
-};
+               YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
+               YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight3 style
-* @method renderCellStyleHighlight3
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
-};
+               /**
+               * The Config object used to hold the configuration variables for the CalendarGroup
+               * @property cfg
+               * @type YAHOO.util.Config
+               */
+               this.cfg = new YAHOO.util.Config(this);
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight4 style
-* @method renderCellStyleHighlight4
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
-};
+               /**
+               * The local object which contains the CalendarGroup's options
+               * @property Options
+               * @type Object
+               */
+               this.Options = {};
 
-/**
-* Applies the default style used for rendering today's date to the current calendar cell
-* @method renderCellStyleToday
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleToday = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
-};
+               /**
+               * The local object which contains the CalendarGroup's locale settings
+               * @property Locale
+               * @type Object
+               */
+               this.Locale = {};
 
-/**
-* Applies the default style used for rendering selected dates to the current calendar cell
-* @method renderCellStyleSelected
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleSelected = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
-};
+               this.setupConfig();
 
-/**
-* Applies the default style used for rendering dates that are not a part of the current
-* month (preceding or trailing the cells for the current month)
-* @method renderCellNotThisMonth
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellNotThisMonth = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
-       cell.innerHTML=workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               if (config) {
+                       this.cfg.applyConfig(config, true);
+               }
 
-/**
-* Renders the current calendar cell as a non-selectable "black-out" date using the default
-* restricted style.
-* @method renderBodyCellRestricted
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
-       cell.innerHTML=workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               this.cfg.fireQueue();
 
-// END BUILT-IN TABLE CELL RENDERERS
+               // OPERA HACK FOR MISWRAPPED FLOATS
+               if (YAHOO.env.ua.opera){
+                       this.renderEvent.subscribe(this._fixWidth, this, true);
+                       this.showEvent.subscribe(this._fixWidth, this, true);
+               }
 
-// BEGIN MONTH NAVIGATION METHODS
+               this.logger.log("Initialized " + this.pages.length + "-page CalendarGroup", "info");
+       },
 
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}      count   The number of months to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addMonths = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+       setupConfig : function() {
 
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}      count   The number of months to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
 
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}      count   The number of years to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addYears = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               /**
+               * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
+               * @config pages
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
 
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}      count   The number of years to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractYears = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               /**
+               * The month/year representing the current visible Calendar date (mm/yyyy)
+               * @config pagedate
+               * @type String
+               * @default today's date
+               */
+               this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.Calendar.prototype.nextMonth = function() {
-       this.addMonths(1);
-};
+               /**
+               * The date or range of dates representing the current Calendar selection
+               * @config selected
+               * @type String
+               * @default []
+               */
+               this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.Calendar.prototype.previousMonth = function() {
-       this.subtractMonths(1);
-};
+               /**
+               * The title to display above the CalendarGroup's month header
+               * @config title
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.Calendar.prototype.nextYear = function() {
-       this.addYears(1);
-};
+               /**
+               * Whether or not a close button should be displayed for this CalendarGroup
+               * @config close
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.Calendar.prototype.previousYear = function() {
-       this.subtractYears(1);
-};
+               /**
+               * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+               * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+               * enabled if required.
+               * 
+               * @config iframe
+               * @type Boolean
+               * @default true for IE6 and below, false for all other browsers
+               */
+               this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * The minimum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config mindate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
+       
+               /**
+               * The maximum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config maxdate
+               * @type String
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
+       
+               // Options properties
+       
+               /**
+               * True if the Calendar should allow multiple selections. False by default.
+               * @config MULTI_SELECT
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * The weekday the week begins on. Default is 0 (Sunday).
+               * @config START_WEEKDAY
+               * @type number
+               * @default 0
+               */      
+               this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+               
+               /**
+               * True if the Calendar should show weekday labels. True by default.
+               * @config SHOW_WEEKDAYS
+               * @type Boolean
+               * @default true
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should show week row headers. False by default.
+               * @config SHOW_WEEK_HEADER
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should show week row footers. False by default.
+               * @config SHOW_WEEK_FOOTER
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+               * @config HIDE_BLANK_WEEKS
+               * @type Boolean
+               * @default false
+               */              
+               this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * The image that should be used for the left navigation arrow.
+               * @config NAV_ARROW_LEFT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
+               * @default null
+               */              
+               this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The image that should be used for the right navigation arrow.
+               * @config NAV_ARROW_RIGHT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+               * @default null
+               */              
+               this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+       
+               // Locale properties
+               
+               /**
+               * The short month labels for the current locale.
+               * @config MONTHS_SHORT
+               * @type String[]
+               * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+               */
+               this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The long month labels for the current locale.
+               * @config MONTHS_LONG
+               * @type String[]
+               * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+               */              
+               this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
+               
+               /**
+               * The 1-character weekday labels for the current locale.
+               * @config WEEKDAYS_1CHAR
+               * @type String[]
+               * @default ["S", "M", "T", "W", "T", "F", "S"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+               
+               /**
+               * The short weekday labels for the current locale.
+               * @config WEEKDAYS_SHORT
+               * @type String[]
+               * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The medium weekday labels for the current locale.
+               * @config WEEKDAYS_MEDIUM
+               * @type String[]
+               * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+               
+               /**
+               * The long weekday labels for the current locale.
+               * @config WEEKDAYS_LONG
+               * @type String[]
+               * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
+       
+               /**
+               * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+               * @config LOCALE_MONTHS
+               * @type String
+               * @default "long"
+               */
+               this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
+       
+               /**
+               * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+               * @config LOCALE_WEEKDAYS
+               * @type String
+               * @default "short"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit individual dates in a date string passed to various Calendar functions.
+               * @config DATE_DELIMITER
+               * @type String
+               * @default ","
+               */
+               this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit date fields in a date string passed to various Calendar functions.
+               * @config DATE_FIELD_DELIMITER
+               * @type String
+               * @default "/"
+               */      
+               this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit date ranges in a date string passed to various Calendar functions.
+               * @config DATE_RANGE_DELIMITER
+               * @type String
+               * @default "-"
+               */
+               this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The position of the month in a month/year date string
+               * @config MY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the year in a month/year date string
+               * @config MY_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in a month/day date string
+               * @config MD_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */      
+               this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the day in a month/year date string
+               * @config MD_DAY_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in a month/day/year date string
+               * @config MDY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */      
+               this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the day in a month/day/year date string
+               * @config MDY_DAY_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the year in a month/day/year date string
+               * @config MDY_YEAR_POSITION
+               * @type Number
+               * @default 3
+               */      
+               this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in the month year label string used as the Calendar header
+               * @config MY_LABEL_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in the month year label string used as the Calendar header
+               * @config MY_LABEL_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The suffix used after the month when rendering the Calendar header
+               * @config MY_LABEL_MONTH_SUFFIX
+               * @type String
+               * @default " "
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
+               
+               /**
+               * The suffix used after the year when rendering the Calendar header
+               * @config MY_LABEL_YEAR_SUFFIX
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
 
-// END MONTH NAVIGATION METHODS
+               /**
+               * Configuration for the Month Year Navigation UI. By default it is disabled
+               * @config NAV
+               * @type Object
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+       },
 
-// BEGIN SELECTION METHODS
+       /**
+       * Initializes CalendarGroup's built-in CustomEvents
+       * @method initEvents
+       */
+       initEvents : function() {
+               var me = this;
+               var strEvent = "Event";
 
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.Calendar.prototype.reset = function() {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.cfg.resetProperty(defCfg.SELECTED.key);
-       this.cfg.resetProperty(defCfg.PAGEDATE.key);
-       this.resetEvent.fire();
-};
+               /**
+               * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
+               * @method sub
+               * @private
+               * @param {Function} fn  The function to subscribe to this CustomEvent
+               * @param {Object}       obj     The CustomEvent's scope object
+               * @param {Boolean}      bOverride       Whether or not to apply scope correction
+               */
+               var sub = function(fn, obj, bOverride) {
+                       for (var p=0;p<me.pages.length;++p) {
+                               var cal = me.pages[p];
+                               cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+                       }
+               };
 
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.Calendar.prototype.clear = function() {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.cfg.setProperty(defCfg.SELECTED.key, []);
-       this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
-       this.clearEvent.fire();
-};
+               /**
+               * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
+               * @method unsub
+               * @private
+               * @param {Function} fn  The function to subscribe to this CustomEvent
+               * @param {Object}       obj     The CustomEvent's scope object
+               */
+               var unsub = function(fn, obj) {
+                       for (var p=0;p<me.pages.length;++p) {
+                               var cal = me.pages[p];
+                               cal[this.type + strEvent].unsubscribe(fn, obj);
+                       }
+               };
+               
+               var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+       
+               /**
+               * Fired before a selection is made
+               * @event beforeSelectEvent
+               */
+               this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
+               this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when a selection is made
+               * @event selectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
+               */
+               this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
+               this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired before a selection is made
+               * @event beforeDeselectEvent
+               */
+               this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
+               this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when a selection is made
+               * @event deselectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
+               */
+               this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
+               this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
+               
+               /**
+               * Fired when the Calendar page is changed
+               * @event changePageEvent
+               */
+               this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
+               this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired before the Calendar is rendered
+               * @event beforeRenderEvent
+               */
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+               this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is rendered
+               * @event renderEvent
+               */
+               this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+               this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is reset
+               * @event resetEvent
+               */
+               this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
+               this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is cleared
+               * @event clearEvent
+               */
+               this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+               this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired just before the CalendarGroup is to be shown
+               * @event beforeShowEvent
+               */
+               this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+       
+               /**
+               * Fired after the CalendarGroup is shown
+               * @event showEvent
+               */
+               this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+       
+               /**
+               * Fired just before the CalendarGroup is to be hidden
+               * @event beforeHideEvent
+               */
+               this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+       
+               /**
+               * Fired after the CalendarGroup is hidden
+               * @event hideEvent
+               */
+               this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
 
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-*
-* Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
-* selected dates passed to the selectEvent will not contain OOB dates.
-* 
-* If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
-*
-* @method select
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.select = function(date) {
-       this.logger.log("Select: " + date, "info");
+               /**
+               * Fired just before the CalendarNavigator is to be shown
+               * @event beforeShowNavEvent
+               */
+               this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+       
+               /**
+               * Fired after the CalendarNavigator is shown
+               * @event showNavEvent
+               */
+               this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+       
+               /**
+               * Fired just before the CalendarNavigator is to be hidden
+               * @event beforeHideNavEvent
+               */
+               this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+       
+               /**
+               * Fired after the CalendarNavigator is hidden
+               * @event hideNavEvent
+               */
+               this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
 
-       var aToBeSelected = this._toFieldArray(date);
-       this.logger.log("Selection field array: " + aToBeSelected, "info");
+               /**
+               * Fired just before the CalendarNavigator is to be rendered
+               * @event beforeRenderNavEvent
+               */
+               this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
 
-       // Filtered array of valid dates
-       var validDates = [];
-       var selected = [];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               /**
+               * Fired after the CalendarNavigator is rendered
+               * @event renderNavEvent
+               */
+               this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+       },
+       
+       /**
+       * The default Config handler for the "pages" property
+       * @method configPages
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configPages : function(type, args, obj) {
+               var pageCount = args[0];
        
-       for (var a=0; a < aToBeSelected.length; ++a) {
-               var toSelect = aToBeSelected[a];
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+               // Define literals outside loop 
+               var sep = "_";
+               var groupCalClass = "groupcal";
+       
+               var firstClass = "first-of-type";
+               var lastClass = "last-of-type";
+       
+               for (var p=0;p<pageCount;++p) {
+                       var calId = this.id + sep + p;
+                       var calContainerId = this.containerId + sep + p;
+       
+                       var childConfig = this.cfg.getConfig();
+                       childConfig.close = false;
+                       childConfig.title = false;
+                       childConfig.navigator = null;
+
+                       var cal = this.constructChild(calId, calContainerId, childConfig);
+                       var caldate = cal.cfg.getProperty(cfgPageDate);
+                       this._setMonthOnDate(caldate, caldate.getMonth() + p);
+                       cal.cfg.setProperty(cfgPageDate, caldate);
+       
+                       YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
 
-               if (!this.isDateOOB(this._toDate(toSelect))) {
-                       
-                       if (validDates.length === 0) {
-                               this.beforeSelectEvent.fire();
-                               selected = this.cfg.getProperty(cfgSelected);
+                       if (p===0) {
+                               YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
                        }
-
-                       validDates.push(toSelect);
-                       
-                       if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
-                               selected[selected.length] = toSelect;
+       
+                       if (p==(pageCount-1)) {
+                               YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
                        }
+       
+                       cal.parent = this;
+                       cal.index = p; 
+       
+                       this.pages[this.pages.length] = cal;
                }
-       }
+       },
        
-       if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeSelect and select events not fired", "info"); }
-
-       if (validDates.length > 0) {
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+       /**
+       * The default Config handler for the "pagedate" property
+       * @method configPageDate
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configPageDate : function(type, args, obj) {
+               var val = args[0];
+               var firstPageDate;
+               
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       if (p === 0) {
+                               firstPageDate = cal._parsePageDate(val);
+                               cal.cfg.setProperty(cfgPageDate, firstPageDate);
+                       } else {
+                               var pageDate = new Date(firstPageDate);
+                               this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
+                               cal.cfg.setProperty(cfgPageDate, pageDate);
+                       }
                }
-               this.selectEvent.fire(validDates);
-       }
-
-       return this.getSelectedDates();
-};
-
-/**
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.
-* This method is used to easily select a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is applied to the cell directly.
-*
-* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
-* or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
-* 
-* @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to select in the current calendar. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
-
-       var cell = this.cells[cellIndex];
-       var cellDate = this.cellDates[cellIndex];
-       var dCellDate = this._toDate(cellDate);
-       this.logger.log("Select: " + dCellDate, "info");
+       },
        
-       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
-       if (!selectable) {this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable cell. beforeSelect, select events not fired", "info"); }
-
-       if (selectable) {
-
-               this.beforeSelectEvent.fire();
-
-               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-               var selected = this.cfg.getProperty(cfgSelected);
-
-               var selectDate = cellDate.concat();
+       /**
+       * The default Config handler for the CalendarGroup "selected" property
+       * @method configSelected
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configSelected : function(type, args, obj) {
+               var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
+               this.delegateConfig(type, args, obj);
+               var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
+               this.cfg.setProperty(cfgSelected, selected, true);
+       },
 
-               if (this._indexOfSelectedFieldArray(selectDate) == -1) {
-                       selected[selected.length] = selectDate;
-               }
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+       
+       /**
+       * Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
+       * @method delegateConfig
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       delegateConfig : function(type, args, obj) {
+               var val = args[0];
+               var cal;
+       
+               for (var p=0;p<this.pages.length;p++) {
+                       cal = this.pages[p];
+                       cal.cfg.setProperty(type, val);
                }
-               this.renderCellStyleSelected(dCellDate,cell);
-               this.selectEvent.fire([selectDate]);
-
-               this.doCellMouseOut.call(cell, null, this);             
-       }
-
-       return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* 
-* The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
-* and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
-* 
-* If all dates are OOB, beforeDeselect and deselect events will not be fired.
-* 
-* @method deselect
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselect = function(date) {
-       this.logger.log("Deselect: " + date, "info");
-
-       var aToBeDeselected = this._toFieldArray(date);
-       this.logger.log("Deselection field array: " + aToBeDeselected, "info");
-
-       var validDates = [];
-       var selected = [];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-       for (var a=0; a < aToBeDeselected.length; ++a) {
-               var toDeselect = aToBeDeselected[a];
+       },
 
-               if (!this.isDateOOB(this._toDate(toDeselect))) {
+       /**
+       * Adds a function to all child Calendars within this CalendarGroup.
+       * @method setChildFunction
+       * @param {String}               fnName          The name of the function
+       * @param {Function}             fn                      The function to apply to each Calendar page object
+       */
+       setChildFunction : function(fnName, fn) {
+               var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       
+               for (var p=0;p<pageCount;++p) {
+                       this.pages[p][fnName] = fn;
+               }
+       },
 
-                       if (validDates.length === 0) {
-                               this.beforeDeselectEvent.fire();
-                               selected = this.cfg.getProperty(cfgSelected);
+       /**
+       * Calls a function within all child Calendars within this CalendarGroup.
+       * @method callChildFunction
+       * @param {String}               fnName          The name of the function
+       * @param {Array}                args            The arguments to pass to the function
+       */
+       callChildFunction : function(fnName, args) {
+               var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       
+               for (var p=0;p<pageCount;++p) {
+                       var page = this.pages[p];
+                       if (page[fnName]) {
+                               var fn = page[fnName];
+                               fn.call(page, args);
                        }
+               }       
+       },
 
-                       validDates.push(toDeselect);
-
-                       var index = this._indexOfSelectedFieldArray(toDeselect);
-                       if (index != -1) {      
-                               selected.splice(index,1);
-                       }
+       /**
+       * Constructs a child calendar. This method can be overridden if a subclassed version of the default
+       * calendar is to be used.
+       * @method constructChild
+       * @param {String}       id                      The id of the table element that will represent the calendar widget
+       * @param {String}       containerId     The id of the container div element that will wrap the calendar table
+       * @param {Object}       config          The configuration object containing the Calendar's arguments
+       * @return {YAHOO.widget.Calendar}       The YAHOO.widget.Calendar instance that is constructed
+       */
+       constructChild : function(id,containerId,config) {
+               var container = document.getElementById(containerId);
+               if (! container) {
+                       container = document.createElement("div");
+                       container.id = containerId;
+                       this.oDomContainer.appendChild(container);
                }
-       }
+               return new YAHOO.widget.Calendar(id,containerId,config);
+       },
+       
+       /**
+       * Sets the calendar group's month explicitly. This month will be set into the first
+       * page of the multi-page calendar, and all other months will be iterated appropriately.
+       * @method setMonth
+       * @param {Number}       month           The numeric month, from 0 (January) to 11 (December)
+       */
+       setMonth : function(month) {
+               month = parseInt(month, 10);
+               var currYear;
 
-       if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeDeselect and deselect events not fired");}
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
 
-       if (validDates.length > 0) {
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+               for (var p=0; p<this.pages.length; ++p) {
+                       var cal = this.pages[p];
+                       var pageDate = cal.cfg.getProperty(cfgPageDate);
+                       if (p === 0) {
+                               currYear = pageDate.getFullYear();
+                       } else {
+                               pageDate.setFullYear(currYear);
+                       }
+                       this._setMonthOnDate(pageDate, month+p); 
+                       cal.cfg.setProperty(cfgPageDate, pageDate);
                }
-               this.deselectEvent.fire(validDates);
-       }
-
-       return this.getSelectedDates();
-};
+       },
 
-/**
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is removed from the cell directly.
-* 
-* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
-* or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
-* deselect events will not be fired.
-* 
-* @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselectCell = function(cellIndex) {
-       var cell = this.cells[cellIndex];
-       var cellDate = this.cellDates[cellIndex];
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+       /**
+       * Sets the calendar group's year explicitly. This year will be set into the first
+       * page of the multi-page calendar, and all other months will be iterated appropriately.
+       * @method setYear
+       * @param {Number}       year            The numeric 4-digit year
+       */
+       setYear : function(year) {
        
-       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
-       if (!selectable) { this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable/deselectable cell", "info"); }
-
-       if (selectable) {
-
-               this.beforeDeselectEvent.fire();
-
-               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-               var selected = this.cfg.getProperty(defCfg.SELECTED.key);
-
-               var dCellDate = this._toDate(cellDate);
-               var selectDate = cellDate.concat();
-
-               if (cellDateIndex > -1) {
-                       if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
-                               this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
-                               YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+               year = parseInt(year, 10);
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       var pageDate = cal.cfg.getProperty(cfgPageDate);
+       
+                       if ((pageDate.getMonth()+1) == 1 && p>0) {
+                               year+=1;
                        }
-                       selected.splice(cellDateIndex, 1);
+                       cal.setYear(year);
                }
+       },
 
-               if (this.parent) {
-                       this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
-               } else {
-                       this.cfg.setProperty(defCfg.SELECTED.key, selected);
+       /**
+       * Calls the render function of all child calendars within the group.
+       * @method render
+       */
+       render : function() {
+               this.renderHeader();
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.render();
                }
+               this.renderFooter();
+       },
 
-               this.deselectEvent.fire(selectDate);
-       }
-
-       return this.getSelectedDates();
-};
+       /**
+       * Selects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once selection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * @method select
+       * @param        {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects.
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       select : function(date) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.select(date);
+               }
+               return this.getSelectedDates();
+       },
 
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.
-*                                              Assuming that this function executes properly, the return value should be an empty array.
-*                                              However, the empty array is returned for the sake of being able to check the selection status
-*                                              of the calendar.
-*/
-YAHOO.widget.Calendar.prototype.deselectAll = function() {
-       this.beforeDeselectEvent.fire();
+       /**
+       * Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+       * The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
+       * <ul>
+       *    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
+       *    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
+       * </ul>
+       * @method selectCell
+       * @param        {Number}        cellIndex       The index of the cell to be selected. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       selectCell : function(cellIndex) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.selectCell(cellIndex);
+               }
+               return this.getSelectedDates();
+       },
        
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-       var selected = this.cfg.getProperty(cfgSelected);
-       var count = selected.length;
-       var sel = selected.concat();
-
-       if (this.parent) {
-               this.parent.cfg.setProperty(cfgSelected, []);
-       } else {
-               this.cfg.setProperty(cfgSelected, []);
-       }
+       /**
+       * Deselects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once deselection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * @method deselect
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselect : function(date) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselect(date);
+               }
+               return this.getSelectedDates();
+       },
        
-       if (count > 0) {
-               this.deselectEvent.fire(sel);
-       }
-
-       return this.getSelectedDates();
-};
-
-// END SELECTION METHODS
-
-// BEGIN TYPE CONVERSION METHODS
-
-/**
-* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
-* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
-* @method _toFieldArray
-* @private
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return {Array[](Number[])}  Array of date field arrays
-*/
-YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {
-       var returnDate = [];
-
-       if (date instanceof Date) {
-               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
-       } else if (YAHOO.lang.isString(date)) {
-               returnDate = this._parseDates(date);
-       } else if (YAHOO.lang.isArray(date)) {
-               for (var i=0;i<date.length;++i) {
-                       var d = date[i];
-                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+       /**
+       * Deselects all dates on the current calendar.
+       * @method deselectAll
+       * @return {Date[]}              Array of JavaScript Date objects representing all individual dates that are currently selected.
+       *                                               Assuming that this function executes properly, the return value should be an empty array.
+       *                                               However, the empty array is returned for the sake of being able to check the selection status
+       *                                               of the calendar.
+       */
+       deselectAll : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselectAll();
                }
-       }
+               return this.getSelectedDates();
+       },
        
-       return returnDate;
-};
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _toDate
-* @private
-* @param       {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.
-* @return      {Date}  JavaScript Date object representing the date field array
-*/
-YAHOO.widget.Calendar.prototype._toDate = function(dateFieldArray) {
-       if (dateFieldArray instanceof Date) {
-               return dateFieldArray;
-       } else {
-               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
-       }
-};
-
-// END TYPE CONVERSION METHODS 
-
-// BEGIN UTILITY METHODS
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _fieldArraysAreEqual
-* @private
-* @param       {Number[]}      array1  The first date field array to compare
-* @param       {Number[]}      array2  The first date field array to compare
-* @return      {Boolean}       The boolean that represents the equality of the two arrays
-*/
-YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2) {
-       var match = false;
-
-       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
-               match=true;     
-       }
-
-       return match;
-};
-
-/**
-* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
-* @method      _indexOfSelectedFieldArray
-* @private
-* @param       {Number[]}              find    The date field array to search for
-* @return      {Number}                        The index of the date field array within the collection of selected dates.
-*                                                              -1 will be returned if the date is not found.
-*/
-YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
-       var selected = -1;
-       var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-       for (var s=0;s<seldates.length;++s) {
-               var sArray = seldates[s];
-               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
-                       selected = s;
-                       break;
+       /**
+       * Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+       * deselectCell will deselect the cell at the specified index on each displayed Calendar page.
+       *
+       * @method deselectCell
+       * @param        {Number}        cellIndex       The index of the cell to deselect. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselectCell : function(cellIndex) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselectCell(cellIndex);
                }
-       }
-
-       return selected;
-};
-
-/**
-* Determines whether a given date is OOM (out of month).
-* @method      isDateOOM
-* @param       {Date}  date    The JavaScript Date object for which to check the OOM status
-* @return      {Boolean}       true if the date is OOM
-*/
-YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
-       return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
-};
-
-/**
-* Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
-*
-* @method      isDateOOB
-* @param       {Date}  date    The JavaScript Date object for which to check the OOB status
-* @return      {Boolean}       true if the date is OOB
-*/
-YAHOO.widget.Calendar.prototype.isDateOOB = function(date) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       
-       var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
-       var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
-       var dm = YAHOO.widget.DateMath;
-       
-       if (minDate) {
-               minDate = dm.clearTime(minDate);
-       } 
-       if (maxDate) {
-               maxDate = dm.clearTime(maxDate);
-       }
-
-       var clearedDate = new Date(date.getTime());
-       clearedDate = dm.clearTime(clearedDate);
-
-       return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
-};
-
-/**
- * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
- * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
- * @method     _parsePageDate
- * @private
- * @param {Date|String}        date    Pagedate value which needs to be parsed
- * @return {Date}      The Date object representing the pagedate
- */
-YAHOO.widget.Calendar.prototype._parsePageDate = function(date) {
-       var parsedDate;
+               return this.getSelectedDates();
+       },
        
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-       if (date) {
-               if (date instanceof Date) {
-                       parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
-               } else {
-                       var month, year, aMonthYear;
-                       aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
-                       month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
-                       year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
-                       
-                       parsedDate = new Date(year, month, 1);
+       /**
+       * Resets the calendar widget to the originally selected month and year, and 
+       * sets the calendar to the initial selection(s).
+       * @method reset
+       */
+       reset : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.reset();
                }
-       } else {
-               parsedDate = new Date(this.today.getFullYear(), this.today.getMonth(), 1);
-       }
-       return parsedDate;
-};
-
-// END UTILITY METHODS
-
-// BEGIN EVENT HANDLERS
-
-/**
-* Event executed before a date is selected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {
-       if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
-               if (this.parent) {
-                       this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
-                       this.parent.deselectAll();
-               } else {
-                       this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
-                       this.deselectAll();
+       },
+       
+       /**
+       * Clears the selected dates in the current calendar widget and sets the calendar
+       * to the current month and year.
+       * @method clear
+       */
+       clear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.clear();
                }
-       }
-};
-
-/**
-* Event executed when a date is selected in the calendar widget.
-* @param       {Array} selected        An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to selectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onSelect = function(selected) { };
-
-/**
-* Event executed before a date is deselected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeDeselect = function() { };
-
-/**
-* Event executed when a date is deselected in the calendar widget.
-* @param       {Array} selected        An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to deselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onDeselect = function(deselected) { };
-
-/**
-* Event executed when the user navigates to a different calendar page.
-* @deprecated Event handlers for this event should be susbcribed to changePageEvent.
-*/
-YAHOO.widget.Calendar.prototype.onChangePage = function() {
-       this.render();
-};
-
-/**
-* Event executed when the calendar widget is rendered.
-* @deprecated Event handlers for this event should be susbcribed to renderEvent.
-*/
-YAHOO.widget.Calendar.prototype.onRender = function() { };
+       },
+       
+       /**
+       * Navigates to the next month page in the calendar widget.
+       * @method nextMonth
+       */
+       nextMonth : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.nextMonth();
+               }
+       },
+       
+       /**
+       * Navigates to the previous month page in the calendar widget.
+       * @method previousMonth
+       */
+       previousMonth : function() {
+               for (var p=this.pages.length-1;p>=0;--p) {
+                       var cal = this.pages[p];
+                       cal.previousMonth();
+               }
+       },
+       
+       /**
+       * Navigates to the next year in the currently selected month in the calendar widget.
+       * @method nextYear
+       */
+       nextYear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.nextYear();
+               }
+       },
 
-/**
-* Event executed when the calendar widget is reset to its original state.
-* @deprecated Event handlers for this event should be susbcribed to resetEvemt.
-*/
-YAHOO.widget.Calendar.prototype.onReset = function() { this.render(); };
+       /**
+       * Navigates to the previous year in the currently selected month in the calendar widget.
+       * @method previousYear
+       */
+       previousYear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.previousYear();
+               }
+       },
 
-/**
-* Event executed when the calendar widget is completely cleared to the current month with no selections.
-* @deprecated Event handlers for this event should be susbcribed to clearEvent.
-*/
-YAHOO.widget.Calendar.prototype.onClear = function() { this.render(); };
+       /**
+       * Gets the list of currently selected dates from the calendar.
+       * @return                       An array of currently selected JavaScript Date objects.
+       * @type Date[]
+       */
+       getSelectedDates : function() { 
+               var returnDates = [];
+               var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
+               for (var d=0;d<selected.length;++d) {
+                       var dateArray = selected[d];
+
+                       var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+                       returnDates.push(date);
+               }
 
-/**
-* Validates the calendar widget. This method has no default implementation
-* and must be extended by subclassing the widget.
-* @return      Should return true if the widget validates, and false if
-* it doesn't.
-* @type Boolean
-*/
-YAHOO.widget.Calendar.prototype.validate = function() { return true; };
+               returnDates.sort( function(a,b) { return a-b; } );
+               return returnDates;
+       },
 
-// END EVENT HANDLERS
+       /**
+       * Adds a renderer to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the conditions specified in the date string for this renderer.
+       * @method addRenderer
+       * @param        {String}        sDates          A date string to associate with the specified renderer. Valid formats
+       *                                                                       include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addRenderer : function(sDates, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addRenderer(sDates, fnRender);
+               }
+       },
 
-// BEGIN DATE PARSE METHODS
+       /**
+       * Adds a month to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the month passed to this method.
+       * @method addMonthRenderer
+       * @param        {Number}        month           The month (1-12) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addMonthRenderer : function(month, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addMonthRenderer(month, fnRender);
+               }
+       },
 
-/**
-* Converts a date string to a date field array
-* @private
-* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.
-* @return                              A date field array representing the string passed to the method
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDate = function(sDate) {
-       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
-       var rArray;
-
-       if (aDate.length == 2) {
-               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
-               rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
-       } else {
-               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
-               rArray.type = YAHOO.widget.Calendar.DATE;
-       }
+       /**
+       * Adds a weekday to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the weekday passed to this method.
+       * @method addWeekdayRenderer
+       * @param        {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addWeekdayRenderer : function(weekday, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addWeekdayRenderer(weekday, fnRender);
+               }
+       },
 
-       for (var i=0;i<rArray.length;i++) {
-               rArray[i] = parseInt(rArray[i], 10);
-       }
+       /**
+        * Removes all custom renderers added to the CalendarGroup through the addRenderer, addMonthRenderer and 
+        * addWeekRenderer methods. CalendarGroup's render method needs to be called to after removing renderers 
+        * to see the changes applied.
+        * 
+        * @method removeRenderers
+        */
+       removeRenderers : function() {
+               this.callChildFunction("removeRenderers");
+       },
 
-       return rArray;
-};
+       /**
+       * Renders the header for the CalendarGroup.
+       * @method renderHeader
+       */
+       renderHeader : function() {
+               // EMPTY DEFAULT IMPL
+       },
 
-/**
-* Converts a multi or single-date string to an array of date field arrays
-* @private
-* @param       {String}        sDates          Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
-* @return                                                      An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDates = function(sDates) {
-       var aReturn = [];
+       /**
+       * Renders a footer for the 2-up calendar container. By default, this method is
+       * unimplemented.
+       * @method renderFooter
+       */
+       renderFooter : function() {
+               // EMPTY DEFAULT IMPL
+       },
 
-       var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+       /**
+       * Adds the designated number of months to the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method addMonths
+       * @param {Number}       count   The number of months to add to the current calendar
+       */
+       addMonths : function(count) {
+               this.callChildFunction("addMonths", count);
+       },
        
-       for (var d=0;d<aDates.length;++d) {
-               var sDate = aDates[d];
+       /**
+       * Subtracts the designated number of months from the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method subtractMonths
+       * @param {Number}       count   The number of months to subtract from the current calendar
+       */
+       subtractMonths : function(count) {
+               this.callChildFunction("subtractMonths", count);
+       },
 
-               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
-                       // This is a range
-                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
+       /**
+       * Adds the designated number of years to the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method addYears
+       * @param {Number}       count   The number of years to add to the current calendar
+       */
+       addYears : function(count) {
+               this.callChildFunction("addYears", count);
+       },
 
-                       var dateStart = this._parseDate(aRange[0]);
-                       var dateEnd = this._parseDate(aRange[1]);
+       /**
+       * Subtcats the designated number of years from the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method subtractYears
+       * @param {Number}       count   The number of years to subtract from the current calendar
+       */
+       subtractYears : function(count) {
+               this.callChildFunction("subtractYears", count);
+       },
 
-                       var fullRange = this._parseRange(dateStart, dateEnd);
-                       aReturn = aReturn.concat(fullRange);
-               } else {
-                       // This is not a range
-                       var aDate = this._parseDate(sDate);
-                       aReturn.push(aDate);
+       /**
+        * Returns the Calendar page instance which has a pagedate (month/year) matching the given date. 
+        * Returns null if no match is found.
+        * 
+        * @method getCalendarPage
+        * @param {Date} date The JavaScript Date object for which a Calendar page is to be found.
+        * @return {Calendar} The Calendar page instance representing the month to which the date 
+        * belongs.
+        */
+       getCalendarPage : function(date) {
+               var cal = null;
+               if (date) {
+                       var y = date.getFullYear(),
+                               m = date.getMonth();
+
+                       var pages = this.pages;
+                       for (var i = 0; i < pages.length; ++i) {
+                               var pageDate = pages[i].cfg.getProperty("pagedate");
+                               if (pageDate.getFullYear() === y && pageDate.getMonth() === m) {
+                                       cal = pages[i];
+                                       break;
+                               }
+                       }
                }
-       }
-       return aReturn;
-};
-
-/**
-* Converts a date range to the full list of included dates
-* @private
-* @param       {Number[]}      startDate       Date field array representing the first date in the range
-* @param       {Number[]}      endDate         Date field array representing the last date in the range
-* @return                                                      An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseRange = function(startDate, endDate) {
-       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);
-       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
-       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);
-
-       var results = [];
-       results.push(startDate);
-       while (dCurrent.getTime() <= dEnd.getTime()) {
-               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
-               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
-       }
-       return results;
-};
-
-// END DATE PARSE METHODS
-
-// BEGIN RENDERER METHODS
-
-/**
-* Resets the render stack of the current calendar to its original pre-render value.
-*/
-YAHOO.widget.Calendar.prototype.resetRenderers = function() {
-       this.renderStack = this._renderStack.concat();
-};
-
-/**
-* Clears the inner HTML, CSS class and style information from the specified cell.
-* @method clearElement
-* @param       {HTMLTableCellElement}  The cell to clear
-*/ 
-YAHOO.widget.Calendar.prototype.clearElement = function(cell) {
-       cell.innerHTML = "&#160;";
-       cell.className="";
-};
+               return cal;
+       },
 
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addRenderer = function(sDates, fnRender) {
-       var aDates = this._parseDates(sDates);
-       for (var i=0;i<aDates.length;++i) {
-               var aDate = aDates[i];
-       
-               if (aDate.length == 2) { // this is either a range or a month/day combo
-                       if (aDate[0] instanceof Array) { // this is a range
-                               this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
-                       } else { // this is a month/day combo
-                               this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
-                       }
-               } else if (aDate.length == 3) {
-                       this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+       /**
+       * Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
+       * The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
+       * @method       _setMonthOnDate
+       * @private
+       * @param        {Date}  date    The Date object on which to set the month index
+       * @param        {Number}        iMonth  The month index to set
+       */
+       _setMonthOnDate : function(date, iMonth) {
+               // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
+               if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
+                       var DM = YAHOO.widget.DateMath;
+                       var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
+                       date.setTime(newDate.getTime());
+               } else {
+                       date.setMonth(iMonth);
+               }
+       },
+       
+       /**
+        * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
+        * @method _fixWidth
+        * @private
+        */
+       _fixWidth : function() {
+               var w = 0;
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       w += cal.oDomContainer.offsetWidth;
+               }
+               if (w > 0) {
+                       this.oDomContainer.style.width = w + "px";
                }
+       },
+       
+       /**
+       * Returns a string representation of the object.
+       * @method toString
+       * @return {String}      A string representation of the CalendarGroup object.
+       */
+       toString : function() {
+               return "CalendarGroup " + this.id;
        }
 };
 
 /**
-* The private method used for adding cell renderers to the local render stack.
-* This method is called by other methods that set the renderer type prior to the method call.
-* @method _addRenderer
-* @private
-* @param       {String}        type            The type string that indicates the type of date renderer being added.
-*                                                                      Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
-*                                                                      YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
-* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based
-*                                                                      on the renderer type
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype._addRenderer = function(type, aDates, fnRender) {
-       var add = [type,aDates,fnRender];
-       this.renderStack.unshift(add);  
-       this._renderStack = this.renderStack.concat();
-};
-
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param       {Number}        month           The month (1-12) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addMonthRenderer = function(month, fnRender) {
-       this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
-};
-
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-       this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
-};
-
-// END RENDERER METHODS
-
-// BEGIN CSS METHODS
-
-/**
-* Removes all styles from all body cells in the current calendar table.
-* @method clearAllBodyCellStyles
-* @param       {style}         The CSS class name to remove from all calendar body cells
+* CSS class representing the container for the calendar
+* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {
-       for (var c=0;c<this.cells.length;++c) {
-               YAHOO.util.Dom.removeClass(this.cells[c],style);
-       }
-};
-
-// END CSS METHODS
+YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";
 
-// BEGIN GETTER/SETTER METHODS
 /**
-* Sets the calendar's month explicitly
-* @method setMonth
-* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
+* CSS class representing the container for the calendar
+* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.setMonth = function(month) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       var current = this.cfg.getProperty(cfgPageDate);
-       current.setMonth(parseInt(month, 10));
-       this.cfg.setProperty(cfgPageDate, current);
-};
+YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";
 
 /**
-* Sets the calendar's year explicitly.
-* @method setYear
-* @param {Number}      year            The numeric 4-digit year
+* CSS class representing the title for the 2-up calendar
+* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.setYear = function(year) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       var current = this.cfg.getProperty(cfgPageDate);
-       current.setFullYear(parseInt(year, 10));
-       this.cfg.setProperty(cfgPageDate, current);
-};
+YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
 
 /**
-* Gets the list of currently selected dates from the calendar.
-* @method getSelectedDates
-* @return {Date[]} An array of currently selected JavaScript Date objects.
+* CSS class representing the close icon for the 2-up calendar
+* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
+* @static
+* @final
+* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
+*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
+* @type String
 */
-YAHOO.widget.Calendar.prototype.getSelectedDates = function() {
-       var returnDates = [];
-       var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-       for (var d=0;d<selected.length;++d) {
-               var dateArray = selected[d];
-
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-               returnDates.push(date);
-       }
-
-       returnDates.sort( function(a,b) { return a-b; } );
-       return returnDates;
-};
+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
 
-/// END GETTER/SETTER METHODS ///
+YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
+                                                                                                                                "buildMonthLabel",
+                                                                                                                                "renderOutOfBoundsDate",
+                                                                                                                                "renderRowHeader",
+                                                                                                                                "renderRowFooter",
+                                                                                                                                "renderCellDefault",
+                                                                                                                                "styleCellDefault",
+                                                                                                                                "renderCellStyleHighlight1",
+                                                                                                                                "renderCellStyleHighlight2",
+                                                                                                                                "renderCellStyleHighlight3",
+                                                                                                                                "renderCellStyleHighlight4",
+                                                                                                                                "renderCellStyleToday",
+                                                                                                                                "renderCellStyleSelected",
+                                                                                                                                "renderCellNotThisMonth",
+                                                                                                                                "renderBodyCellRestricted",
+                                                                                                                                "initStyles",
+                                                                                                                                "configTitle",
+                                                                                                                                "configClose",
+                                                                                                                                "configIframe",
+                                                                                                                                "configNavigator",
+                                                                                                                                "createTitleBar",
+                                                                                                                                "createCloseButton",
+                                                                                                                                "removeTitleBar",
+                                                                                                                                "removeCloseButton",
+                                                                                                                                "hide",
+                                                                                                                                "show",
+                                                                                                                                "toDate",
+                                                                                                                                "_parseArgs",
+                                                                                                                                "browser");
 
 /**
-* Hides the Calendar's outer container from view.
-* @method hide
+* The set of default Config property keys and values for the CalendarGroup
+* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
 */
-YAHOO.widget.Calendar.prototype.hide = function() {
-       this.oDomContainer.style.display = "none";
-};
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
 
-/**
-* Shows the Calendar's outer container.
-* @method show
-*/
-YAHOO.widget.Calendar.prototype.show = function() {
-       this.oDomContainer.style.display = "block";
-};
+YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;
 
 /**
-* Returns a string representing the current browser.
-* @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
-* @see YAHOO.env.ua
-* @property browser
-* @type String
-*/
-YAHOO.widget.Calendar.prototype.browser = function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }();
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     A string representation of the Calendar object.
+* @class YAHOO.widget.Calendar2up
+* @extends YAHOO.widget.CalendarGroup
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.Calendar.prototype.toString = function() {
-       return "Calendar " + this.id;
+YAHOO.widget.Calendar2up = function(id, containerId, config) {
+       this.init(id, containerId, config);
 };
 
-/**
-* @namespace YAHOO.widget
-* @class Calendar_Core
-* @extends YAHOO.widget.Calendar
-* @deprecated The old Calendar_Core class is no longer necessary.
-*/
-YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;
-
-YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;
+YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
 
 /**
-* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
-* the ability to have multi-page calendar views that share a single dataset and are
-* dependent on each other.
-* 
-* The calendar group instance will refer to each of its elements using a 0-based index.
-* For example, to construct the placeholder for a calendar group widget with id "cal1" and
-* containerId of "cal1Container", the markup would be as follows:
-*      <xmp>
-*              <div id="cal1Container_0"></div>
-*              <div id="cal1Container_1"></div>
-*      </xmp>
-* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
-* @namespace YAHOO.widget
-* @class CalendarGroup
-* @constructor
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.CalendarGroup = function(id, containerId, config) {
-       if (arguments.length > 0) {
-               this.init(id, containerId, config);
-       }
-};
+YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
 
 /**
-* Initializes the calendar group. All subclasses must call this method in order for the
-* group to be initialized properly.
-* @method init
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
-       this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + id);
-       this.initEvents();
-       this.initStyles();
-
-       /**
-       * The collection of Calendar pages contained within the CalendarGroup
-       * @property pages
-       * @type YAHOO.widget.Calendar[]
-       */
-       this.pages = [];
-       
-       /**
-       * The unique id associated with the CalendarGroup
-       * @property id
-       * @type String
-       */
-       this.id = id;
-
-       /**
-       * The unique id associated with the CalendarGroup container
-       * @property containerId
-       * @type String
-       */
-       this.containerId = containerId;
-
-       /**
-       * The outer containing element for the CalendarGroup
-       * @property oDomContainer
-       * @type HTMLElement
-       */
-       this.oDomContainer = document.getElementById(containerId);
-
-       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
-       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
-
-       /**
-       * The Config object used to hold the configuration variables for the CalendarGroup
-       * @property cfg
-       * @type YAHOO.util.Config
-       */
-       this.cfg = new YAHOO.util.Config(this);
-
-       /**
-       * The local object which contains the CalendarGroup's options
-       * @property Options
-       * @type Object
-       */
-       this.Options = {};
-
-       /**
-       * The local object which contains the CalendarGroup's locale settings
-       * @property Locale
-       * @type Object
-       */
-       this.Locale = {};
-
-       this.setupConfig();
-
-       if (config) {
-               this.cfg.applyConfig(config, true);
-       }
-
-       this.cfg.fireQueue();
-
-       // OPERA HACK FOR MISWRAPPED FLOATS
-       if (YAHOO.env.ua.opera){
-               this.renderEvent.subscribe(this._fixWidth, this, true);
-       }
-       this.logger.log("Initialized " + this.pages.length + "-page CalendarGroup", "info");
+ * The CalendarNavigator is used along with a Calendar/CalendarGroup to 
+ * provide a Month/Year popup navigation control, allowing the user to navigate 
+ * to a specific month/year in the Calendar/CalendarGroup without having to 
+ * scroll through months sequentially
+ *
+ * @namespace YAHOO.widget
+ * @class CalendarNavigator
+ * @constructor
+ * @param {Calendar|CalendarGroup} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached.
+ */
+YAHOO.widget.CalendarNavigator = function(cal) {
+       this.init(cal);
 };
 
-
-YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
-       
-       var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
-       
-       /**
-       * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
-       * @config pages
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
+(function() {
+       // Setup static properties (inside anon fn, so that we can use shortcuts)
+       var CN = YAHOO.widget.CalendarNavigator;
 
        /**
-       * The month/year representing the current visible Calendar date (mm/yyyy)
-       * @config pagedate
-       * @type String
-       * @default today's date
-       */
-       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
+        * YAHOO.widget.CalendarNavigator.CLASSES contains constants
+        * for the class values applied to the CalendarNaviatgator's 
+        * DOM elements
+        * @property YAHOO.widget.CalendarNavigator.CLASSES
+        * @type Object
+        * @static
+        */
+       CN.CLASSES = {
+               /**
+                * Class applied to the Calendar Navigator's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV
+                * @type String
+                * @static
+                */
+               NAV :"yui-cal-nav",
+               /**
+                * Class applied to the Calendar/CalendarGroup's bounding box to indicate
+                * the Navigator is currently visible
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV_VISIBLE
+                * @type String
+                * @static
+                */
+               NAV_VISIBLE: "yui-cal-nav-visible",
+               /**
+                * Class applied to the Navigator mask's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MASK
+                * @type String
+                * @static
+                */
+               MASK : "yui-cal-nav-mask",
+               /**
+                * Class applied to the year label/control bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR
+                * @type String
+                * @static
+                */
+               YEAR : "yui-cal-nav-y",
+               /**
+                * Class applied to the month label/control bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH
+                * @type String
+                * @static
+                */
+               MONTH : "yui-cal-nav-m",
+               /**
+                * Class applied to the submit/cancel button's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTONS
+                * @type String
+                * @static
+                */
+               BUTTONS : "yui-cal-nav-b",
+               /**
+                * Class applied to buttons wrapping element
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTON
+                * @type String
+                * @static
+                */
+               BUTTON : "yui-cal-nav-btn",
+               /**
+                * Class applied to the validation error area's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.ERROR
+                * @type String
+                * @static
+                */
+               ERROR : "yui-cal-nav-e",
+               /**
+                * Class applied to the year input control
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR_CTRL
+                * @type String
+                * @static
+                */
+               YEAR_CTRL : "yui-cal-nav-yc",
+               /**
+                * Class applied to the month input control
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH_CTRL
+                * @type String
+                * @static
+                */
+               MONTH_CTRL : "yui-cal-nav-mc",
+               /**
+                * Class applied to controls with invalid data (e.g. a year input field with invalid an year)
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.INVALID
+                * @type String
+                * @static
+                */
+               INVALID : "yui-invalid",
+               /**
+                * Class applied to default controls
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.DEFAULT
+                * @type String
+                * @static
+                */
+               DEFAULT : "yui-default"
+       };
 
        /**
-       * The date or range of dates representing the current Calendar selection
-       * @config selected
-       * @type String
-       * @default []
-       */
-       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
+        * Object literal containing the default configuration values for the CalendarNavigator
+        * The configuration object is expected to follow the format below, with the properties being
+        * case sensitive.
+        * <dl>
+        * <dt>strings</dt>
+        * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+        *     <dl>
+        *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+        *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+        *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+        *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+        *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+        *     </dl>
+        * </dd>
+        * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+        * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+        * </dl>
+        * @property _DEFAULT_CFG
+        * @protected
+        * @type Object
+        * @static
+        */
+       CN._DEFAULT_CFG = {
+               strings : {
+                       month: "Month",
+                       year: "Year",
+                       submit: "Okay",
+                       cancel: "Cancel",
+                       invalidYear : "Year needs to be a number"
+               },
+               monthFormat: YAHOO.widget.Calendar.LONG,
+               initialFocus: "year"
+       };
 
        /**
-       * The title to display above the CalendarGroup's month header
-       * @config title
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
+        * The suffix added to the Calendar/CalendarGroup's ID, to generate
+        * a unique ID for the Navigator and it's bounding box.
+        * @property YAHOO.widget.CalendarNavigator.ID_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.ID_SUFFIX = "_nav";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the month control.
+        * @property YAHOO.widget.CalendarNavigator.MONTH_SUFFIX
+        * @static
+        * @type String 
+        * @final
+        */
+       CN.MONTH_SUFFIX = "_month";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the year control.
+        * @property YAHOO.widget.CalendarNavigator.YEAR_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.YEAR_SUFFIX = "_year";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the error bounding box.
+        * @property YAHOO.widget.CalendarNavigator.ERROR_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.ERROR_SUFFIX = "_error";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the "Cancel" button.
+        * @property YAHOO.widget.CalendarNavigator.CANCEL_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.CANCEL_SUFFIX = "_cancel";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the "Submit" button.
+        * @property YAHOO.widget.CalendarNavigator.SUBMIT_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.SUBMIT_SUFFIX = "_submit";
+
+       /**
+        * The number of digits to which the year input control is to be limited.
+        * @property YAHOO.widget.CalendarNavigator.YR_MAX_DIGITS
+        * @static
+        * @type Number
+        */
+       CN.YR_MAX_DIGITS = 4;
+
+       /**
+        * The amount by which to increment the current year value,
+        * when the arrow up/down key is pressed on the year control
+        * @property YAHOO.widget.CalendarNavigator.YR_MINOR_INC
+        * @static
+        * @type Number
+        */
+       CN.YR_MINOR_INC = 1;
+
+       /**
+        * The amount by which to increment the current year value,
+        * when the page up/down key is pressed on the year control
+        * @property YAHOO.widget.CalendarNavigator.YR_MAJOR_INC
+        * @static
+        * @type Number
+        */
+       CN.YR_MAJOR_INC = 10;
+
+       /**
+        * Artificial delay (in ms) between the time the Navigator is hidden
+        * and the Calendar/CalendarGroup state is updated. Allows the user
+        * the see the Calendar/CalendarGroup page changing. If set to 0
+        * the Calendar/CalendarGroup page will be updated instantly
+        * @property YAHOO.widget.CalendarNavigator.UPDATE_DELAY
+        * @static
+        * @type Number
+        */
+       CN.UPDATE_DELAY = 50;
+
+       /**
+        * Regular expression used to validate the year input
+        * @property YAHOO.widget.CalendarNavigator.YR_PATTERN
+        * @static
+        * @type RegExp
+        */
+       CN.YR_PATTERN = /^\d+$/;
+       /**
+        * Regular expression used to trim strings
+        * @property YAHOO.widget.CalendarNavigator.TRIM
+        * @static
+        * @type RegExp
+        */
+       CN.TRIM = /^\s*(.*?)\s*$/;
+})();
+
+YAHOO.widget.CalendarNavigator.prototype = {
+
+       /**
+        * The unique ID for this CalendarNavigator instance
+        * @property id
+        * @type String
+        */
+       id : null,
 
        /**
-       * Whether or not a close button should be displayed for this CalendarGroup
-       * @config close
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
+        * The Calendar/CalendarGroup instance to which the navigator belongs
+        * @property cal
+        * @type {Calendar|CalendarGroup}
+        */
+       cal : null,
 
        /**
-       * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
-       * enabled if required.
-       * 
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all other browsers
-       */
-       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+        * Reference to the HTMLElement used to render the navigator's bounding box
+        * @property navEl
+        * @type HTMLElement
+        */
+       navEl : null,
 
        /**
-       * The minimum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config mindate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to render the navigator's mask
+        * @property maskEl
+        * @type HTMLElement
+        */
+       maskEl : null,
 
        /**
-       * The maximum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config maxdate
-       * @type String
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
-
-       // Options properties
+        * Reference to the HTMLElement used to input the year
+        * @property yearEl
+        * @type HTMLElement
+        */
+       yearEl : null,
 
        /**
-       * True if the Calendar should allow multiple selections. False by default.
-       * @config MULTI_SELECT
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+        * Reference to the HTMLElement used to input the month
+        * @property monthEl
+        * @type HTMLElement
+        */
+       monthEl : null,
 
        /**
-       * The weekday the week begins on. Default is 0 (Sunday).
-       * @config START_WEEKDAY
-       * @type number
-       * @default 0
-       */      
-       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
-       
-       /**
-       * True if the Calendar should show weekday labels. True by default.
-       * @config SHOW_WEEKDAYS
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should show week row headers. False by default.
-       * @config SHOW_WEEK_HEADER
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should show week row footers. False by default.
-       * @config SHOW_WEEK_FOOTER
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-       * @config HIDE_BLANK_WEEKS
-       * @type Boolean
-       * @default false
-       */              
-       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * The image that should be used for the left navigation arrow.
-       * @config NAV_ARROW_LEFT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
-       * @default null
-       */              
-       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
-       
-       /**
-       * The image that should be used for the right navigation arrow.
-       * @config NAV_ARROW_RIGHT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-       * @default null
-       */              
-       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to display validation errors
+        * @property errorEl
+        * @type HTMLElement
+        */
+       errorEl : null,
 
-       // Locale properties
-       
-       /**
-       * The short month labels for the current locale.
-       * @config MONTHS_SHORT
-       * @type String[]
-       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-       */
-       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
-       
-       /**
-       * The long month labels for the current locale.
-       * @config MONTHS_LONG
-       * @type String[]
-       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-       */              
-       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
-       
        /**
-       * The 1-character weekday labels for the current locale.
-       * @config WEEKDAYS_1CHAR
-       * @type String[]
-       * @default ["S", "M", "T", "W", "T", "F", "S"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to update the Calendar/Calendar group
+        * with the month/year values
+        * @property submitEl
+        * @type HTMLElement
+        */
+       submitEl : null,
        
        /**
-       * The short weekday labels for the current locale.
-       * @config WEEKDAYS_SHORT
-       * @type String[]
-       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to hide the navigator without updating the 
+        * Calendar/Calendar group
+        * @property cancelEl
+        * @type HTMLElement
+        */
+       cancelEl : null,
+
+       /** 
+        * Reference to the first focusable control in the navigator (by default monthEl)
+        * @property firstCtrl
+        * @type HTMLElement
+        */
+       firstCtrl : null,
        
-       /**
-       * The medium weekday labels for the current locale.
-       * @config WEEKDAYS_MEDIUM
-       * @type String[]
-       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+       /** 
+        * Reference to the last focusable control in the navigator (by default cancelEl)
+        * @property lastCtrl
+        * @type HTMLElement
+        */
+       lastCtrl : null,
+
+       /**
+        * The document containing the Calendar/Calendar group instance
+        * @protected
+        * @property _doc
+        * @type HTMLDocument
+        */
+       _doc : null,
+
+       /**
+        * Internal state property for the current year displayed in the navigator
+        * @protected
+        * @property _year
+        * @type Number
+        */
+       _year: null,
        
        /**
-       * The long weekday labels for the current locale.
-       * @config WEEKDAYS_LONG
-       * @type String[]
-       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
-
-       /**
-       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-       * @config LOCALE_MONTHS
-       * @type String
-       * @default "long"
-       */
-       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
-
-       /**
-       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-       * @config LOCALE_WEEKDAYS
-       * @type String
-       * @default "short"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+        * Internal state property for the current month index displayed in the navigator
+        * @protected
+        * @property _month
+        * @type Number
+        */
+       _month: 0,
 
        /**
-       * The value used to delimit individual dates in a date string passed to various Calendar functions.
-       * @config DATE_DELIMITER
-       * @type String
-       * @default ","
-       */
-       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+        * Private internal state property which indicates whether or not the 
+        * Navigator has been rendered.
+        * @private
+        * @property __rendered
+        * @type Boolean
+        */
+       __rendered: false,
 
        /**
-       * The value used to delimit date fields in a date string passed to various Calendar functions.
-       * @config DATE_FIELD_DELIMITER
-       * @type String
-       * @default "/"
-       */      
-       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
+        * Init lifecycle method called as part of construction
+        * 
+        * @method init
+        * @param {Calendar} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached
+        */
+       init : function(cal) {
+               var calBox = cal.oDomContainer;
 
-       /**
-       * The value used to delimit date ranges in a date string passed to various Calendar functions.
-       * @config DATE_RANGE_DELIMITER
-       * @type String
-       * @default "-"
-       */
-       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
+               this.cal = cal;
+               this.id = calBox.id + YAHOO.widget.CalendarNavigator.ID_SUFFIX;
+               this._doc = calBox.ownerDocument;
 
-       /**
-       * The position of the month in a month/year date string
-       * @config MY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the year in a month/year date string
-       * @config MY_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in a month/day date string
-       * @config MD_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */      
-       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the day in a month/year date string
-       * @config MD_DAY_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in a month/day/year date string
-       * @config MDY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */      
-       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the day in a month/day/year date string
-       * @config MDY_DAY_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the year in a month/day/year date string
-       * @config MDY_YEAR_POSITION
-       * @type Number
-       * @default 3
-       */      
-       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               /**
+                * Private flag, to identify IE6/IE7 Quirks
+                * @private
+                * @property __isIEQuirks
+                */
+               var ie = YAHOO.env.ua.ie;
+               this.__isIEQuirks = (ie && ((ie <= 6) || (ie === 7 && this._doc.compatMode == "BackCompat")));
+       },
 
        /**
-       * The position of the month in the month year label string used as the Calendar header
-       * @config MY_LABEL_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+        * Displays the navigator and mask, updating the input controls to reflect the 
+        * currently set month and year. The show method will invoke the render method
+        * if the navigator has not been renderered already, allowing for lazy rendering
+        * of the control.
+        * 
+        * The show method will fire the Calendar/CalendarGroup's beforeShowNav and showNav events
+        * 
+        * @method show
+        */
+       show : function() {
+               var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+               if (this.cal.beforeShowNavEvent.fire()) {
+                       if (!this.__rendered) {
+                               this.render();
+                       }
+                       this.clearErrors();
 
-       /**
-       * The position of the year in the month year label string used as the Calendar header
-       * @config MY_LABEL_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The suffix used after the month when rendering the Calendar header
-       * @config MY_LABEL_MONTH_SUFFIX
-       * @type String
-       * @default " "
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
-       
-       /**
-       * The suffix used after the year when rendering the Calendar header
-       * @config MY_LABEL_YEAR_SUFFIX
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
-};
+                       this._updateMonthUI();
+                       this._updateYearUI();
+                       this._show(this.navEl, true);
 
-/**
-* Initializes CalendarGroup's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
-       var me = this;
-       var strEvent = "Event";
+                       this.setInitialFocus();
+                       this.showMask();
 
-       /**
-       * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
-       * @method sub
-       * @private
-       * @param {Function} fn  The function to subscribe to this CustomEvent
-       * @param {Object}       obj     The CustomEvent's scope object
-       * @param {Boolean}      bOverride       Whether or not to apply scope correction
-       */
-       var sub = function(fn, obj, bOverride) {
-               for (var p=0;p<me.pages.length;++p) {
-                       var cal = me.pages[p];
-                       cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+                       YAHOO.util.Dom.addClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+                       this.cal.showNavEvent.fire();
                }
-       };
+       },
 
        /**
-       * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
-       * @method unsub
-       * @private
-       * @param {Function} fn  The function to subscribe to this CustomEvent
-       * @param {Object}       obj     The CustomEvent's scope object
-       */
-       var unsub = function(fn, obj) {
-               for (var p=0;p<me.pages.length;++p) {
-                       var cal = me.pages[p];
-                       cal[this.type + strEvent].unsubscribe(fn, obj);
+        * Hides the navigator and mask
+        * 
+        * The show method will fire the Calendar/CalendarGroup's beforeHideNav event and hideNav events
+        * @method hide
+        */
+       hide : function() {
+               var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+               if (this.cal.beforeHideNavEvent.fire()) {
+                       this._show(this.navEl, false);
+                       this.hideMask();
+                       YAHOO.util.Dom.removeClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+                       this.cal.hideNavEvent.fire();
                }
-       };
+       },
        
-       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
 
        /**
-       * Fired before a selection is made
-       * @event beforeSelectEvent
-       */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
-       this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+        * Displays the navigator's mask element
+        * 
+        * @method showMask
+        */
+       showMask : function() {
+               this._show(this.maskEl, true);
+               if (this.__isIEQuirks) {
+                       this._syncMask();
+               }
+       },
 
        /**
-       * Fired when a selection is made
-       * @event selectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
-       this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+        * Hides the navigator's mask element
+        * 
+        * @method hideMask
+        */
+       hideMask : function() {
+               this._show(this.maskEl, false);
+       },
 
        /**
-       * Fired before a selection is made
-       * @event beforeDeselectEvent
-       */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
-       this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+        * Returns the current month set on the navigator
+        * 
+        * Note: This may not be the month set in the UI, if 
+        * the UI contains an invalid value.
+        * 
+        * @method getMonth
+        * @return {Number} The Navigator's current month index
+        */
+       getMonth: function() {
+               return this._month;
+       },
 
        /**
-       * Fired when a selection is made
-       * @event deselectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
-       this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
-       
-       /**
-       * Fired when the Calendar page is changed
-       * @event changePageEvent
-       */
-       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
-       this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+        * Returns the current year set on the navigator
+        * 
+        * Note: This may not be the year set in the UI, if 
+        * the UI contains an invalid value.
+        * 
+        * @method getYear
+        * @return {Number} The Navigator's current year value
+        */
+       getYear: function() {
+               return this._year;
+       },
 
        /**
-       * Fired before the Calendar is rendered
-       * @event beforeRenderEvent
-       */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
-       this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+        * Sets the current month on the Navigator, and updates the UI
+        * 
+        * @method setMonth
+        * @param {Number} nMonth The month index, from 0 (Jan) through 11 (Dec).
+        */
+       setMonth : function(nMonth) {
+               if (nMonth >= 0 && nMonth < 12) {
+                       this._month = nMonth;
+               }
+               this._updateMonthUI();
+       },
 
        /**
-       * Fired when the Calendar is rendered
-       * @event renderEvent
-       */
-       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
-       this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+        * Sets the current year on the Navigator, and updates the UI. If the 
+        * provided year is invalid, it will not be set.
+        * 
+        * @method setYear
+        * @param {Number} nYear The full year value to set the Navigator to.
+        */
+       setYear : function(nYear) {
+               var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN;
+               if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
+                       this._year = nYear;
+               }
+               this._updateYearUI();
+       },
 
        /**
-       * Fired when the Calendar is reset
-       * @event resetEvent
-       */
-       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
-       this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+        * Renders the HTML for the navigator, adding it to the 
+        * document and attaches event listeners if it has not 
+        * already been rendered.
+        * 
+        * @method render
+        */
+       render: function() {
+               this.cal.beforeRenderNavEvent.fire();
+               if (!this.__rendered) {
+                       this.createNav();
+                       this.createMask();
+                       this.applyListeners();
+                       this.__rendered = true;
+               }
+               this.cal.renderNavEvent.fire();
+       },
 
        /**
-       * Fired when the Calendar is cleared
-       * @event clearEvent
-       */
-       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
-       this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
+        * Creates the navigator's containing HTMLElement, it's contents, and appends 
+        * the containg element to the Calendar/CalendarGroup's container.
+        * 
+        * @method createNav
+        */
+       createNav : function() {
+               var NAV = YAHOO.widget.CalendarNavigator;
+               var doc = this._doc;
 
-};
+               var d = doc.createElement("div");
+               d.className = NAV.CLASSES.NAV;
 
-/**
-* The default Config handler for the "pages" property
-* @method configPages
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
-       var pageCount = args[0];
+               var htmlBuf = this.renderNavContents([]);
 
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               d.innerHTML = htmlBuf.join('');
+               this.cal.oDomContainer.appendChild(d);
 
-       // Define literals outside loop 
-       var sep = "_";
-       var groupCalClass = "groupcal";
+               this.navEl = d;
 
-       var firstClass = "first-of-type";
-       var lastClass = "last-of-type";
+               this.yearEl = doc.getElementById(this.id + NAV.YEAR_SUFFIX);
+               this.monthEl = doc.getElementById(this.id + NAV.MONTH_SUFFIX);
+               this.errorEl = doc.getElementById(this.id + NAV.ERROR_SUFFIX);
+               this.submitEl = doc.getElementById(this.id + NAV.SUBMIT_SUFFIX);
+               this.cancelEl = doc.getElementById(this.id + NAV.CANCEL_SUFFIX);
 
-       for (var p=0;p<pageCount;++p) {
-               var calId = this.id + sep + p;
-               var calContainerId = this.containerId + sep + p;
+               if (YAHOO.env.ua.gecko && this.yearEl && this.yearEl.type == "text") {
+                       // Avoid XUL error on focus, select [ https://bugzilla.mozilla.org/show_bug.cgi?id=236791, 
+                       // supposedly fixed in 1.8.1, but there are reports of it still being around for methods other than blur ]
+                       this.yearEl.setAttribute("autocomplete", "off");
+               }
 
-               var childConfig = this.cfg.getConfig();
-               childConfig.close = false;
-               childConfig.title = false;
+               this._setFirstLastElements();
+       },
 
-               var cal = this.constructChild(calId, calContainerId, childConfig);
-               var caldate = cal.cfg.getProperty(cfgPageDate);
-               this._setMonthOnDate(caldate, caldate.getMonth() + p);
-               cal.cfg.setProperty(cfgPageDate, caldate);
+       /**
+        * Creates the Mask HTMLElement and appends it to the Calendar/CalendarGroups
+        * container.
+        * 
+        * @method createMask
+        */
+       createMask : function() {
+               var C = YAHOO.widget.CalendarNavigator.CLASSES;
 
-               YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
-               YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
+               var d = this._doc.createElement("div");
+               d.className = C.MASK;
 
-               if (p===0) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
-               }
+               this.cal.oDomContainer.appendChild(d);
+               this.maskEl = d;
+       },
 
-               if (p==(pageCount-1)) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
+       /**
+        * Used to set the width/height of the mask in pixels to match the Calendar Container.
+        * Currently only used for IE6 and IE7 quirks mode. The other A-Grade browser are handled using CSS (width/height 100%).
+        * <p>
+        * The method is also registered as an HTMLElement resize listener on the Calendars container element.
+        * </p>
+        * @protected
+        * @method _syncMask
+        */
+       _syncMask : function() {
+               var c = this.cal.oDomContainer;
+               if (c && this.maskEl) {
+                       var r = YAHOO.util.Dom.getRegion(c);
+                       YAHOO.util.Dom.setStyle(this.maskEl, "width", r.right - r.left + "px");
+                       YAHOO.util.Dom.setStyle(this.maskEl, "height", r.bottom - r.top + "px");
                }
+       },
 
-               cal.parent = this;
-               cal.index = p; 
-
-               this.pages[this.pages.length] = cal;
-       }
-};
+       /**
+        * Renders the contents of the navigator
+        * 
+        * @method renderNavContents
+        * 
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderNavContents : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES,
+                       h = html; // just to use a shorter name
+
+               h[h.length] = '<div class="' + C.MONTH + '">';
+               this.renderMonth(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.YEAR + '">';
+               this.renderYear(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.BUTTONS + '">';
+               this.renderButtons(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.ERROR + '" id="' + this.id + NAV.ERROR_SUFFIX + '"></div>';
+
+               return h;
+       },
 
-/**
-* The default Config handler for the "pagedate" property
-* @method configPageDate
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {
-       var val = args[0];
-       var firstPageDate;
-       
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-       
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               if (p === 0) {
-                       firstPageDate = cal._parsePageDate(val);
-                       cal.cfg.setProperty(cfgPageDate, firstPageDate);
-               } else {
-                       var pageDate = new Date(firstPageDate);
-                       this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
-                       cal.cfg.setProperty(cfgPageDate, pageDate);
+       /**
+        * Renders the month label and control for the navigator
+        * 
+        * @method renderNavContents
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderMonth : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES;
+
+               var id = this.id + NAV.MONTH_SUFFIX,
+                       mf = this.__getCfg("monthFormat"),
+                       months = this.cal.cfg.getProperty((mf == YAHOO.widget.Calendar.SHORT) ? "MONTHS_SHORT" : "MONTHS_LONG"),
+                       h = html;
+
+               if (months && months.length > 0) {
+                       h[h.length] = '<label for="' + id + '">';
+                       h[h.length] = this.__getCfg("month", true);
+                       h[h.length] = '</label>';
+                       h[h.length] = '<select name="' + id + '" id="' + id + '" class="' + C.MONTH_CTRL + '">';
+                       for (var i = 0; i < months.length; i++) {
+                               h[h.length] = '<option value="' + i + '">';
+                               h[h.length] = months[i];
+                               h[h.length] = '</option>';
+                       }
+                       h[h.length] = '</select>';
                }
-       }
-};
-
-/**
-* The default Config handler for the CalendarGroup "selected" property
-* @method configSelected
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configSelected = function(type, args, obj) {
-       var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
-       this.delegateConfig(type, args, obj);
-       var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
-       this.cfg.setProperty(cfgSelected, selected, true);
-};
-
-
-/**
-* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
-* @method delegateConfig
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj) {
-       var val = args[0];
-       var cal;
-
-       for (var p=0;p<this.pages.length;p++) {
-               cal = this.pages[p];
-               cal.cfg.setProperty(type, val);
-       }
-};
-
+               return h;
+       },
 
-/**
-* Adds a function to all child Calendars within this CalendarGroup.
-* @method setChildFunction
-* @param {String}              fnName          The name of the function
-* @param {Function}            fn                      The function to apply to each Calendar page object
-*/
-YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
-       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       /**
+        * Renders the year label and control for the navigator
+        * 
+        * @method renderYear
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderYear : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES;
+
+               var id = this.id + NAV.YEAR_SUFFIX,
+                       size = NAV.YR_MAX_DIGITS,
+                       h = html;
+
+               h[h.length] = '<label for="' + id + '">';
+               h[h.length] = this.__getCfg("year", true);
+               h[h.length] = '</label>';
+               h[h.length] = '<input type="text" name="' + id + '" id="' + id + '" class="' + C.YEAR_CTRL + '" maxlength="' + size + '"/>';
+               return h;
+       },
 
-       for (var p=0;p<pageCount;++p) {
-               this.pages[p][fnName] = fn;
-       }
-};
+       /**
+        * Renders the submit/cancel buttons for the navigator
+        * 
+        * @method renderButton
+        * @return {String} The HTML created for the Button UI
+        */
+       renderButtons : function(html) {
+               var C = YAHOO.widget.CalendarNavigator.CLASSES;
+               var h = html;
+
+               h[h.length] = '<span class="' + C.BUTTON + ' ' + C.DEFAULT + '">';
+               h[h.length] = '<button type="button" id="' + this.id + '_submit' + '">';
+               h[h.length] = this.__getCfg("submit", true);
+               h[h.length] = '</button>';
+               h[h.length] = '</span>';
+               h[h.length] = '<span class="' + C.BUTTON +'">';
+               h[h.length] = '<button type="button" id="' + this.id + '_cancel' + '">';
+               h[h.length] = this.__getCfg("cancel", true);
+               h[h.length] = '</button>';
+               h[h.length] = '</span>';
+
+               return h;
+       },
 
-/**
-* Calls a function within all child Calendars within this CalendarGroup.
-* @method callChildFunction
-* @param {String}              fnName          The name of the function
-* @param {Array}               args            The arguments to pass to the function
-*/
-YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {
-       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       /**
+        * Attaches DOM event listeners to the rendered elements
+        * <p>
+        * The method will call applyKeyListeners, to setup keyboard specific 
+        * listeners
+        * </p>
+        * @method applyListeners
+        */
+       applyListeners : function() {
+               var E = YAHOO.util.Event;
 
-       for (var p=0;p<pageCount;++p) {
-               var page = this.pages[p];
-               if (page[fnName]) {
-                       var fn = page[fnName];
-                       fn.call(page, args);
+               function yearUpdateHandler() {
+                       if (this.validate()) {
+                               this.setYear(this._getYearFromUI());
+                       }
                }
-       }       
-};
-
-/**
-* Constructs a child calendar. This method can be overridden if a subclassed version of the default
-* calendar is to be used.
-* @method constructChild
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-* @return {YAHOO.widget.Calendar}      The YAHOO.widget.Calendar instance that is constructed
-*/
-YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,config) {
-       var container = document.getElementById(containerId);
-       if (! container) {
-               container = document.createElement("div");
-               container.id = containerId;
-               this.oDomContainer.appendChild(container);
-       }
-       return new YAHOO.widget.Calendar(id,containerId,config);
-};
-
 
-/**
-* Sets the calendar group's month explicitly. This month will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setMonth
-* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
-*/
-YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
-       month = parseInt(month, 10);
-       var currYear;
-       
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-       
-       for (var p=0; p<this.pages.length; ++p) {
-               var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty(cfgPageDate);
-               if (p === 0) {
-                       currYear = pageDate.getFullYear();
-               } else {
-                       pageDate.setYear(currYear);
+               function monthUpdateHandler() {
+                       this.setMonth(this._getMonthFromUI());
                }
-               this._setMonthOnDate(pageDate, month+p); 
-               cal.cfg.setProperty(cfgPageDate, pageDate);
-       }
-};
-
-/**
-* Sets the calendar group's year explicitly. This year will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setYear
-* @param {Number}      year            The numeric 4-digit year
-*/
-YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {
 
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               E.on(this.submitEl, "click", this.submit, this, true);
+               E.on(this.cancelEl, "click", this.cancel, this, true);
+               E.on(this.yearEl, "blur", yearUpdateHandler, this, true);
+               E.on(this.monthEl, "change", monthUpdateHandler, this, true);
 
-       year = parseInt(year, 10);
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty(cfgPageDate);
-
-               if ((pageDate.getMonth()+1) == 1 && p>0) {
-                       year+=1;
+               if (this.__isIEQuirks) {
+                       YAHOO.util.Event.on(this.cal.oDomContainer, "resize", this._syncMask, this, true);
                }
-               cal.setYear(year);
-       }
-};
-/**
-* Calls the render function of all child calendars within the group.
-* @method render
-*/
-YAHOO.widget.CalendarGroup.prototype.render = function() {
-       this.renderHeader();
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.render();
-       }
-       this.renderFooter();
-};
-
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method select
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.select = function(date) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.select(date);
-       }
-       return this.getSelectedDates();
-};
 
-/**
-* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
-* <ul>
-*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
-*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
-* </ul>
-* @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to be selected. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.selectCell(cellIndex);
-       }
-       return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method deselect
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselect = function(date) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselect(date);
-       }
-       return this.getSelectedDates();
-};
+               this.applyKeyListeners();
+       },
 
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.
-*                                              Assuming that this function executes properly, the return value should be an empty array.
-*                                              However, the empty array is returned for the sake of being able to check the selection status
-*                                              of the calendar.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselectAll();
-       }
-       return this.getSelectedDates();
-};
+       /**
+        * Removes/purges DOM event listeners from the rendered elements
+        * 
+        * @method purgeListeners
+        */
+       purgeListeners : function() {
+               var E = YAHOO.util.Event;
+               E.removeListener(this.submitEl, "click", this.submit);
+               E.removeListener(this.cancelEl, "click", this.cancel);
+               E.removeListener(this.yearEl, "blur");
+               E.removeListener(this.monthEl, "change");
+               if (this.__isIEQuirks) {
+                       E.removeListener(this.cal.oDomContainer, "resize", this._syncMask);
+               }
 
-/**
-* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
-*
-* @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselectCell(cellIndex);
-       }
-       return this.getSelectedDates();
-};
+               this.purgeKeyListeners();
+       },
 
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.CalendarGroup.prototype.reset = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.reset();
-       }
-};
+       /**
+        * Attaches DOM listeners for keyboard support. 
+        * Tab/Shift-Tab looping, Enter Key Submit on Year element,
+        * Up/Down/PgUp/PgDown year increment on Year element
+        * <p>
+        * NOTE: MacOSX Safari 2.x doesn't let you tab to buttons and 
+        * MacOSX Gecko does not let you tab to buttons or select controls,
+        * so for these browsers, Tab/Shift-Tab looping is limited to the 
+        * elements which can be reached using the tab key.
+        * </p>
+        * @method applyKeyListeners
+        */
+       applyKeyListeners : function() {
+               var E = YAHOO.util.Event;
+
+               // IE doesn't fire keypress for arrow/pg keys (non-char keys)
+               var ua = YAHOO.env.ua;
+               var arrowEvt = (ua.ie) ? "keydown" : "keypress";
+
+               // - IE doesn't fire keypress for non-char keys
+               // - Opera doesn't allow us to cancel keydown or keypress for tab, but 
+               //   changes focus successfully on keydown (keypress is too late to change focus - opera's already moved on).
+               var tabEvt = (ua.ie || ua.opera) ? "keydown" : "keypress";
+
+               // Everyone likes keypress for Enter (char keys) - whoo hoo!
+               E.on(this.yearEl, "keypress", this._handleEnterKey, this, true);
+
+               E.on(this.yearEl, arrowEvt, this._handleDirectionKeys, this, true);
+               E.on(this.lastCtrl, tabEvt, this._handleTabKey, this, true);
+               E.on(this.firstCtrl, tabEvt, this._handleShiftTabKey, this, true);
+       },
 
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.CalendarGroup.prototype.clear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.clear();
-       }
-};
+       /**
+        * Removes/purges DOM listeners for keyboard support
+        *
+        * @method purgeKeyListeners
+        */
+       purgeKeyListeners : function() {
+               var E = YAHOO.util.Event;
 
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.nextMonth = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.nextMonth();
-       }
-};
+               var arrowEvt = (YAHOO.env.ua.ie) ? "keydown" : "keypress";
+               var tabEvt = (YAHOO.env.ua.ie || YAHOO.env.ua.opera) ? "keydown" : "keypress";
 
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.previousMonth = function() {
-       for (var p=this.pages.length-1;p>=0;--p) {
-               var cal = this.pages[p];
-               cal.previousMonth();
-       }
-};
+               E.removeListener(this.yearEl, "keypress", this._handleEnterKey);
+               E.removeListener(this.yearEl, arrowEvt, this._handleDirectionKeys);
+               E.removeListener(this.lastCtrl, tabEvt, this._handleTabKey);
+               E.removeListener(this.firstCtrl, tabEvt, this._handleShiftTabKey);
+       },
 
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.CalendarGroup.prototype.nextYear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.nextYear();
-       }
-};
+       /**
+        * Updates the Calendar/CalendarGroup's pagedate with the currently set month and year if valid.
+        * <p>
+        * If the currently set month/year is invalid, a validation error will be displayed and the 
+        * Calendar/CalendarGroup's pagedate will not be updated.
+        * </p>
+        * @method submit
+        */
+       submit : function() {
+               if (this.validate()) {
+                       this.hide();
 
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.CalendarGroup.prototype.previousYear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.previousYear();
-       }
-};
+                       this.setMonth(this._getMonthFromUI());
+                       this.setYear(this._getYearFromUI());
 
+                       var cal = this.cal;
+                       var nav = this;
+                       
+                       function update() {
+                               cal.setYear(nav.getYear());
+                               cal.setMonth(nav.getMonth());
+                               cal.render();
+                       }
+                       // Artificial delay, just to help the user see something changed
+                       var delay = YAHOO.widget.CalendarNavigator.UPDATE_DELAY;
+                       if (delay > 0) {
+                               window.setTimeout(update, delay);
+                       } else {
+                               update();
+                       }
+               }
+       },
 
-/**
-* Gets the list of currently selected dates from the calendar.
-* @return                      An array of currently selected JavaScript Date objects.
-* @type Date[]
-*/
-YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { 
-       var returnDates = [];
-       var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
-       for (var d=0;d<selected.length;++d) {
-               var dateArray = selected[d];
-
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-               returnDates.push(date);
-       }
+       /**
+        * Hides the navigator and mask, without updating the Calendar/CalendarGroup's state
+        * 
+        * @method cancel
+        */
+       cancel : function() {
+               this.hide();
+       },
 
-       returnDates.sort( function(a,b) { return a-b; } );
-       return returnDates;
-};
+       /**
+        * Validates the current state of the UI controls
+        * 
+        * @method validate
+        * @return {Boolean} true, if the current UI state contains valid values, false if not
+        */
+       validate : function() {
+               if (this._getYearFromUI() !== null) {
+                       this.clearErrors();
+                       return true;
+               } else {
+                       this.setYearError();
+                       this.setError(this.__getCfg("invalidYear", true));
+                       return false;
+               }
+       },
 
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addRenderer = function(sDates, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addRenderer(sDates, fnRender);
-       }
-};
+       /**
+        * Displays an error message in the Navigator's error panel
+        * @method setError
+        * @param {String} msg The error message to display
+        */
+       setError : function(msg) {
+               if (this.errorEl) {
+                       this.errorEl.innerHTML = msg;
+                       this._show(this.errorEl, true);
+               }
+       },
 
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param       {Number}        month           The month (1-12) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addMonthRenderer(month, fnRender);
-       }
-};
+       /**
+        * Clears the navigator's error message and hides the error panel
+        * @method clearError 
+        */
+       clearError : function() {
+               if (this.errorEl) {
+                       this.errorEl.innerHTML = "";
+                       this._show(this.errorEl, false);
+               }
+       },
 
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addWeekdayRenderer(weekday, fnRender);
-       }
-};
+       /**
+        * Displays the validation error UI for the year control
+        * @method setYearError
+        */
+       setYearError : function() {
+               YAHOO.util.Dom.addClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+       },
 
-/**
-* Renders the header for the CalendarGroup.
-* @method renderHeader
-*/
-YAHOO.widget.CalendarGroup.prototype.renderHeader = function() {};
+       /**
+        * Removes the validation error UI for the year control
+        * @method clearYearError
+        */
+       clearYearError : function() {
+               YAHOO.util.Dom.removeClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+       },
 
-/**
-* Renders a footer for the 2-up calendar container. By default, this method is
-* unimplemented.
-* @method renderFooter
-*/
-YAHOO.widget.CalendarGroup.prototype.renderFooter = function() {};
+       /**
+        * Clears all validation and error messages in the UI
+        * @method clearErrors
+        */
+       clearErrors : function() {
+               this.clearError();
+               this.clearYearError();
+       },
 
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}      count   The number of months to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonths = function(count) {
-       this.callChildFunction("addMonths", count);
-};
+       /**
+        * Sets the initial focus, based on the configured value
+        * @method setInitialFocus
+        */
+       setInitialFocus : function() {
+               var el = this.submitEl;
+               var f = this.__getCfg("initialFocus");
+
+               if (f && f.toLowerCase) {
+                       f = f.toLowerCase();
+                       if (f == "year") {
+                               el = this.yearEl;
+                               try {
+                                       this.yearEl.select();
+                               } catch (e) {
+                                       // Ignore;
+                               }
+                       } else if (f == "month") {
+                               el = this.monthEl;
+                       }
+               }
 
+               if (el && YAHOO.lang.isFunction(el.focus)) {
+                       try {
+                               el.focus();
+                       } catch (e) {
+                               // TODO: Fall back if focus fails?
+                       }
+               }
+       },
 
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}      count   The number of months to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractMonths = function(count) {
-       this.callChildFunction("subtractMonths", count);
-};
+       /**
+        * Removes all renderered HTML elements for the Navigator from
+        * the DOM, purges event listeners and clears (nulls) any property
+        * references to HTML references
+        * @method erase
+        */
+       erase : function() {
+               if (this.__rendered) {
+                       this.purgeListeners();
+
+                       // Clear out innerHTML references
+                       this.yearEl = null;
+                       this.monthEl = null;
+                       this.errorEl = null;
+                       this.submitEl = null;
+                       this.cancelEl = null;
+                       this.firstCtrl = null;
+                       this.lastCtrl = null;
+                       if (this.navEl) {
+                               this.navEl.innerHTML = "";
+                       }
 
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}      count   The number of years to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addYears = function(count) {
-       this.callChildFunction("addYears", count);
-};
+                       var p = this.navEl.parentNode;
+                       if (p) {
+                               p.removeChild(this.navEl);
+                       }
+                       this.navEl = null;
 
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}      count   The number of years to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {
-       this.callChildFunction("subtractYears", count);
-};
+                       var pm = this.maskEl.parentNode;
+                       if (pm) {
+                               pm.removeChild(this.maskEl);
+                       }
+                       this.maskEl = null;
+                       this.__rendered = false;
+               }
+       },
 
-/**
-* Shows the CalendarGroup's outer container.
-* @method show
-*/
-YAHOO.widget.CalendarGroup.prototype.show = function() {
-       this.oDomContainer.style.display = "block";
-       if (YAHOO.env.ua.opera) {
-               this._fixWidth();
-       }
-};
+       /**
+        * Destroys the Navigator object and any HTML references
+        * @method destroy
+        */
+       destroy : function() {
+               this.erase();
+               this._doc = null;
+               this.cal = null;
+               this.id = null;
+       },
 
-/**
-* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
-* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
-* @method      _setMonthOnDate
-* @private
-* @param       {Date}  date    The Date object on which to set the month index
-* @param       {Number}        iMonth  The month index to set
-*/
-YAHOO.widget.CalendarGroup.prototype._setMonthOnDate = function(date, iMonth) {
-       // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
-       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
-               var DM = YAHOO.widget.DateMath;
-               var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
-               date.setTime(newDate.getTime());
-       } else {
-               date.setMonth(iMonth);
-       }
-};
+       /**
+        * Protected implementation to handle how UI elements are 
+        * hidden/shown.
+        *
+        * @method _show
+        * @protected
+        */
+       _show : function(el, bShow) {
+               if (el) {
+                       YAHOO.util.Dom.setStyle(el, "display", (bShow) ? "block" : "none");
+               }
+       },
 
-/**
- * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
- * @method _fixWidth
- * @private
- */
-YAHOO.widget.CalendarGroup.prototype._fixWidth = function() {
-       var startW = this.oDomContainer.offsetWidth;
-       var w = 0;
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               w += cal.oDomContainer.offsetWidth;
-       }
-       if (w > 0) {
-               this.oDomContainer.style.width = w + "px";
-       }
-};
+       /**
+        * Returns the month value (index), from the month UI element
+        * @protected
+        * @method _getMonthFromUI
+        * @return {Number} The month index, or 0 if a UI element for the month
+        * is not found
+        */
+       _getMonthFromUI : function() {
+               if (this.monthEl) {
+                       return this.monthEl.selectedIndex;
+               } else {
+                       return 0; // Default to Jan
+               }
+       },
 
+       /**
+        * Returns the year value, from the Navitator's year UI element
+        * @protected
+        * @method _getYearFromUI
+        * @return {Number} The year value set in the UI, if valid. null is returned if 
+        * the UI does not contain a valid year value.
+        */
+       _getYearFromUI : function() {
+               var NAV = YAHOO.widget.CalendarNavigator;
 
-/**
-* CSS class representing the container for the calendar
-* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";
+               var yr = null;
+               if (this.yearEl) {
+                       var value = this.yearEl.value;
+                       value = value.replace(NAV.TRIM, "$1");
 
-/**
-* CSS class representing the container for the calendar
-* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";
+                       if (NAV.YR_PATTERN.test(value)) {
+                               yr = parseInt(value, 10);
+                       }
+               }
+               return yr;
+       },
 
-/**
-* CSS class representing the title for the 2-up calendar
-* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
+       /**
+        * Updates the Navigator's year UI, based on the year value set on the Navigator object
+        * @protected
+        * @method _updateYearUI
+        */
+       _updateYearUI : function() {
+               if (this.yearEl && this._year !== null) {
+                       this.yearEl.value = this._year;
+               }
+       },
 
-/**
-* CSS class representing the close icon for the 2-up calendar
-* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
-* @static
-* @final
-* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
-*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
+       /**
+        * Updates the Navigator's month UI, based on the month value set on the Navigator object
+        * @protected
+        * @method _updateMonthUI
+        */
+       _updateMonthUI : function() {
+               if (this.monthEl) {
+                       this.monthEl.selectedIndex = this._month;
+               }
+       },
 
-YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
-                                                                                                                                "buildMonthLabel",
-                                                                                                                                "renderOutOfBoundsDate",
-                                                                                                                                "renderRowHeader",
-                                                                                                                                "renderRowFooter",
-                                                                                                                                "renderCellDefault",
-                                                                                                                                "styleCellDefault",
-                                                                                                                                "renderCellStyleHighlight1",
-                                                                                                                                "renderCellStyleHighlight2",
-                                                                                                                                "renderCellStyleHighlight3",
-                                                                                                                                "renderCellStyleHighlight4",
-                                                                                                                                "renderCellStyleToday",
-                                                                                                                                "renderCellStyleSelected",
-                                                                                                                                "renderCellNotThisMonth",
-                                                                                                                                "renderBodyCellRestricted",
-                                                                                                                                "initStyles",
-                                                                                                                                "configTitle",
-                                                                                                                                "configClose",
-                                                                                                                                "configIframe",
-                                                                                                                                "hide",
-                                                                                                                                "browser");
+       /**
+        * Sets up references to the first and last focusable element in the Navigator's UI
+        * in terms of tab order (Naviagator's firstEl and lastEl properties). The references
+        * are used to control modality by looping around from the first to the last control
+        * and visa versa for tab/shift-tab navigation.
+        * <p>
+        * See <a href="#applyKeyListeners">applyKeyListeners</a>
+        * </p>
+        * @protected
+        * @method _setFirstLastElements
+        */
+       _setFirstLastElements : function() {
+               this.firstCtrl = this.monthEl;
+               this.lastCtrl = this.cancelEl;
+
+               // Special handling for MacOSX.
+               // - Safari 2.x can't focus on buttons
+               // - Gecko can't focus on select boxes or buttons
+               if (this.__isMac) {
+                       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420){
+                               this.firstCtrl = this.monthEl;
+                               this.lastCtrl = this.yearEl;
+                       }
+                       if (YAHOO.env.ua.gecko) {
+                               this.firstCtrl = this.yearEl;
+                               this.lastCtrl = this.yearEl;
+                       }
+               }
+       },
 
-/**
-* The set of default Config property keys and values for the CalendarGroup
-* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
-* @final
-* @static
-* @private
-* @type Object
-*/
-YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
+       /**
+        * Default Keyboard event handler to capture Enter 
+        * on the Navigator's year control (yearEl)
+        * 
+        * @method _handleEnterKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleEnterKey : function(e) {
+               var KEYS = YAHOO.util.KeyListener.KEY;
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     A string representation of the CalendarGroup object.
-*/
-YAHOO.widget.CalendarGroup.prototype.toString = function() {
-       return "CalendarGroup " + this.id;
-};
+               if (YAHOO.util.Event.getCharCode(e) == KEYS.ENTER) {
+                       YAHOO.util.Event.preventDefault(e);
+                       this.submit();
+               }
+       },
 
-YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;
+       /**
+        * Default Keyboard event handler to capture up/down/pgup/pgdown
+        * on the Navigator's year control (yearEl).
+        * 
+        * @method _handleDirectionKeys
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleDirectionKeys : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+               var NAV = YAHOO.widget.CalendarNavigator;
+
+               var value = (this.yearEl.value) ? parseInt(this.yearEl.value, 10) : null;
+               if (isFinite(value)) {
+                       var dir = false;
+                       switch(E.getCharCode(e)) {
+                               case KEYS.UP:
+                                       this.yearEl.value = value + NAV.YR_MINOR_INC;
+                                       dir = true;
+                                       break;
+                               case KEYS.DOWN:
+                                       this.yearEl.value = Math.max(value - NAV.YR_MINOR_INC, 0);
+                                       dir = true;
+                                       break;
+                               case KEYS.PAGE_UP:
+                                       this.yearEl.value = value + NAV.YR_MAJOR_INC;
+                                       dir = true;
+                                       break;
+                               case KEYS.PAGE_DOWN:
+                                       this.yearEl.value = Math.max(value - NAV.YR_MAJOR_INC, 0);
+                                       dir = true;
+                                       break;
+                               default:
+                                       break;
+                       }
+                       if (dir) {
+                               E.preventDefault(e);
+                               try {
+                                       this.yearEl.select();
+                               } catch(e) {
+                                       // Ignore
+                               }
+                       }
+               }
+       },
 
-/**
-* @class YAHOO.widget.Calendar2up
-* @extends YAHOO.widget.CalendarGroup
-* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
-*/
-YAHOO.widget.Calendar2up = function(id, containerId, config) {
-       this.init(id, containerId, config);
-};
+       /**
+        * Default Keyboard event handler to capture Tab 
+        * on the last control (lastCtrl) in the Navigator.
+        * 
+        * @method _handleTabKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleTabKey : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+
+               if (E.getCharCode(e) == KEYS.TAB && !e.shiftKey) {
+                       try {
+                               E.preventDefault(e);
+                               this.firstCtrl.focus();
+                       } catch (e) {
+                               // Ignore - mainly for focus edge cases
+                       }
+               }
+       },
 
-YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
+       /**
+        * Default Keyboard event handler to capture Shift-Tab 
+        * on the first control (firstCtrl) in the Navigator.
+        * 
+        * @method _handleShiftTabKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleShiftTabKey : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+
+               if (e.shiftKey && E.getCharCode(e) == KEYS.TAB) {
+                       try {
+                               E.preventDefault(e);
+                               this.lastCtrl.focus();
+                       } catch (e) {
+                               // Ignore - mainly for focus edge cases
+                       }
+               }
+       },
 
-/**
-* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
-*/
-YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
+       /**
+        * Retrieve Navigator configuration values from 
+        * the parent Calendar/CalendarGroup's config value.
+        * <p>
+        * If it has not been set in the user provided configuration, the method will 
+        * return the default value of the configuration property, as set in _DEFAULT_CFG
+        * </p>
+        * @private
+        * @method __getCfg
+        * @param {String} Case sensitive property name.
+        * @param {Boolean} true, if the property is a string property, false if not.
+        * @return The value of the configuration property
+        */
+       __getCfg : function(prop, bIsStr) {
+               var DEF_CFG = YAHOO.widget.CalendarNavigator._DEFAULT_CFG;
+               var cfg = this.cal.cfg.getProperty("navigator");
+
+               if (bIsStr) {
+                       return (cfg !== true && cfg.strings && cfg.strings[prop]) ? cfg.strings[prop] : DEF_CFG.strings[prop];
+               } else {
+                       return (cfg !== true && cfg[prop]) ? cfg[prop] : DEF_CFG[prop];
+               }
+       },
+
+       /**
+        * Private flag, to identify MacOS
+        * @private
+        * @property __isMac
+        */
+       __isMac : (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1)
+
+};
 
-YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.3.0", build: "442"});
+YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.5.0", build: "895"});
index 98877bae0a5d9af89b6fcdfba1682a1cd24167fd..cb632508c5b656e9178fc6767f840dcf3efeb990 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
-if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
-this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
-return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);}
-return true;}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
-return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
-foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
-if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
-if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
-return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var prop;if(init){this.initialConfig=userConfig;}
-for(prop in userConfig){this.queueProperty(prop,userConfig[prop]);}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
-this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
-return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
-return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
-return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
-this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
-while(i--);}
-return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
-d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
-return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},between:function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}},getJan1:function(calendarYear){return new Date(calendarYear,0,1);},getDayOffset:function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;},getWeekNumber:function(date,calendarYear){date=this.clearTime(date);var nearestThurs=new Date(date.getTime()+(4*this.ONE_DAY_MS)-((date.getDay())*this.ONE_DAY_MS));var jan1=new Date(nearestThurs.getFullYear(),0,1);var dayOfYear=((nearestThurs.getTime()-jan1.getTime())/this.ONE_DAY_MS)-1;var weekNum=Math.ceil((dayOfYear)/7);return weekNum;},isYearOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
-return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
-return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=null;YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.SHORT="short";YAHOO.widget.Calendar.LONG="long";YAHOO.widget.Calendar.MEDIUM="medium";YAHOO.widget.Calendar.ONE_CHAR="1char";YAHOO.widget.Calendar._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""}};YAHOO.widget.Calendar._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",RESET:"reset",CLEAR:"clear"};YAHOO.widget.Calendar._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_selectedDates:null,domEventMap:null};YAHOO.widget.Calendar.prototype.init=function(id,containerId,config){this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.id=id;this.oDomContainer=document.getElementById(containerId);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
-this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(!this.parent){if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");if(pos=="absolute"||pos=="relative"){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){YAHOO.util.Dom.addClass(this.iframe,"fixedsize");}
-this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}
-this.iframe=null;}}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);var titleDiv;if(title&&title!==""){titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");titleDiv.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;titleDiv.innerHTML=title;this.oDomContainer.insertBefore(titleDiv,this.oDomContainer.firstChild);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(titleDiv){YAHOO.util.Event.purgeElement(titleDiv);this.oDomContainer.removeChild(titleDiv);}
-if(!close){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.configClose=function(type,args,obj){var close=args[0];var title=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);var DEPR_CLOSE_PATH="us/my/bn/x_d.gif";var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="#";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",function(e,cal){cal.hide();YAHOO.util.Event.preventDefault(e);},this);if(YAHOO.widget.Calendar.IMG_ROOT!==null){var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+DEPR_CLOSE_PATH;imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);}else{linkClose.innerHTML='<span class="'+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE+' '+this.Style.CSS_CLOSE+'"></span>';}
-this.oDomContainer.appendChild(linkClose);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(linkClose){YAHOO.util.Event.purgeElement(linkClose);this.oDomContainer.removeChild(linkClose);}
-if(!title||title===""){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);};YAHOO.widget.Calendar.prototype.doSelectCell=function(e,cal){var cell,index,d,date;var target=YAHOO.util.Event.getTarget(e);var tagName=target.tagName.toLowerCase();var defSelector=false;while(tagName!="td"&&!YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){if(!defSelector&&tagName=="a"&&YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTOR)){defSelector=true;}
-target=target.parentNode;tagName=target.tagName.toLowerCase();if(tagName=="html"){return;}}
-if(defSelector){YAHOO.util.Event.preventDefault(e);}
-cell=target;if(YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_SELECTABLE)){index=cell.id.split("cell")[1];d=cal.cellDates[index];date=new Date(d[0],d[1]-1,d[2]);var link;if(cal.Options.MULTI_SELECT){link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
-var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
-cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
-while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
-if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.addClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.doCellMouseOut=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
-while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
-if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.configMinDate});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.configMaxDate});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key,refreshLocale,this,true);this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key,this._parsePageDate(args[0]),true);};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;if(selected){if(YAHOO.lang.isString(selected)){this.cfg.setProperty(cfgSelected,this._parseDates(selected),true);}}
-if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(cfgSelected);}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){this.Options[type.toUpperCase()]=args[0];};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.Locale[type.toUpperCase()]=args[0];this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;type=type.toLowerCase();var val=args[0];switch(type){case defCfg.LOCALE_MONTHS.key:switch(val){case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();break;}
-break;case defCfg.LOCALE_WEEKDAYS.key:switch(val){case YAHOO.widget.Calendar.ONE_CHAR:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();break;case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();break;case YAHOO.widget.Calendar.MEDIUM:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();break;}
-var START_WEEKDAY=this.cfg.getProperty(defCfg.START_WEEKDAY.key);if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}
-break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){var defStyle=YAHOO.widget.Calendar._STYLES;this.Style={CSS_ROW_HEADER:defStyle.CSS_ROW_HEADER,CSS_ROW_FOOTER:defStyle.CSS_ROW_FOOTER,CSS_CELL:defStyle.CSS_CELL,CSS_CELL_SELECTOR:defStyle.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:defStyle.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:defStyle.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:defStyle.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:defStyle.CSS_CELL_TODAY,CSS_CELL_OOM:defStyle.CSS_CELL_OOM,CSS_CELL_OOB:defStyle.CSS_CELL_OOB,CSS_HEADER:defStyle.CSS_HEADER,CSS_HEADER_TEXT:defStyle.CSS_HEADER_TEXT,CSS_BODY:defStyle.CSS_BODY,CSS_WEEKDAY_CELL:defStyle.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:defStyle.CSS_WEEKDAY_ROW,CSS_FOOTER:defStyle.CSS_FOOTER,CSS_CALENDAR:defStyle.CSS_CALENDAR,CSS_SINGLE:defStyle.CSS_SINGLE,CSS_CONTAINER:defStyle.CSS_CONTAINER,CSS_NAV_LEFT:defStyle.CSS_NAV_LEFT,CSS_NAV_RIGHT:defStyle.CSS_NAV_RIGHT,CSS_CLOSE:defStyle.CSS_CLOSE,CSS_CELL_TOP:defStyle.CSS_CELL_TOP,CSS_CELL_LEFT:defStyle.CSS_CELL_LEFT,CSS_CELL_RIGHT:defStyle.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:defStyle.CSS_CELL_BOTTOM,CSS_CELL_HOVER:defStyle.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:defStyle.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:defStyle.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:defStyle.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:defStyle.CSS_CELL_HIGHLIGHT4};};YAHOO.widget.Calendar.prototype.buildMonthLabel=function(){var pageDate=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);var monthLabel=this.Locale.LOCALE_MONTHS[pageDate.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX;var yearLabel=pageDate.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return yearLabel+monthLabel;}else{return monthLabel+yearLabel;}};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){return workingDate.getDate();};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;var DEPR_NAV_LEFT="us/tr/callt.gif";var DEPR_NAV_RIGHT="us/tr/calrt.gif";var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){colSpan+=1;}
-if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){colSpan+=1;}
-html[html.length]="<thead>";html[html.length]="<tr>";html[html.length]='<th colspan="'+colSpan+'" class="'+this.Style.CSS_HEADER_TEXT+'">';html[html.length]='<div class="'+this.Style.CSS_HEADER+'">';var renderLeft,renderRight=false;if(this.parent){if(this.index===0){renderLeft=true;}
-if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}
-var cal=this.parent||this;if(renderLeft){var leftArrow=this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);if(leftArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){leftArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_LEFT;}
-var leftStyle=(leftArrow===null)?"":' style="background-image:url('+leftArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+leftStyle+' >&#160;</a>';}
-html[html.length]=this.buildMonthLabel();if(renderRight){var rightArrow=this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);if(rightArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){rightArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_RIGHT;}
-var rightStyle=(rightArrow===null)?"":' style="background-image:url('+rightArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+rightStyle+' >&#160;</a>';}
-html[html.length]='</div>\n</th>\n</tr>';if(this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)){html=this.buildWeekdays(html);}
-html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){html[html.length]='<th>&#160;</th>';}
-for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}
-if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){html[html.length]='<th>&#160;</th>';}
-html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var startDay=this.cfg.getProperty(defCfg.START_WEEKDAY.key);this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}
-if(this.preMonthDays<0){this.preMonthDays+=7;}
-this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekNum,weekClass;var weekPrefix="w";var cellPrefix="_cell";var workingDayPrefix="wd";var dayPrefix="d";var cellRenderers;var renderer;var todayYear=this.today.getFullYear();var todayMonth=this.today.getMonth();var todayDate=this.today.getDate();var useDate=this.cfg.getProperty(defCfg.PAGEDATE.key);var hideBlankWeeks=this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);var showWeekFooter=this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);var showWeekHeader=this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);var mindate=this.cfg.getProperty(defCfg.MINDATE.key);var maxdate=this.cfg.getProperty(defCfg.MAXDATE.key);if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
-if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
-html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+' '+this.Style.CSS_BODY+'">';var i=0;var tempDiv=document.createElement("div");var cell=document.createElement("td");tempDiv.appendChild(cell);var jan1=new Date(useDate.getFullYear(),0,1);var cal=this.parent||this;for(var r=0;r<6;r++){weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useDate.getFullYear(),startDay);weekClass=weekPrefix+weekNum;if(r!==0&&hideBlankWeeks===true&&workingDate.getMonth()!=useDate.getMonth()){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(showWeekHeader){html=this.renderRowHeader(weekNum,html);}
-for(var d=0;d<7;d++){cellRenderers=[];renderer=null;this.clearElement(cell);cell.className=this.Style.CSS_CELL;cell.id=this.id+cellPrefix+i;if(workingDate.getDate()==todayDate&&workingDate.getMonth()==todayMonth&&workingDate.getFullYear()==todayYear){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}
-var workingArray=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];this.cellDates[this.cellDates.length]=workingArray;if(workingDate.getMonth()!=useDate.getMonth()){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{YAHOO.util.Dom.addClass(cell,workingDayPrefix+workingDate.getDay());YAHOO.util.Dom.addClass(cell,dayPrefix+workingDate.getDate());for(var s=0;s<this.renderStack.length;++s){var rArray=this.renderStack[s];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(s,1);}
-break;case YAHOO.widget.Calendar.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(s,1);}
-break;case YAHOO.widget.Calendar.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(s,1);}}
-break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
-break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
-break;}
-if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
-if(this._indexOfSelectedFieldArray(workingArray)>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
-if((mindate&&(workingDate.getTime()<mindate.getTime()))||(maxdate&&(workingDate.getTime()>maxdate.getTime()))){cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=cal.styleCellDefault;cellRenderers[cellRenderers.length]=cal.renderCellDefault;}
-for(var x=0;x<cellRenderers.length;++x){if(cellRenderers[x].call(cal,workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
-workingDate.setTime(workingDate.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(i>=0&&i<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}
-if((i%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}
-if(((i+1)%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}
-var postDays=this.postMonthDays;if(hideBlankWeeks&&postDays>=7){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
-if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}
-html[html.length]=tempDiv.innerHTML;i++;}
-if(showWeekFooter){html=this.renderRowFooter(weekNum,html);}
-html[html.length]='</tr>';}}
-html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){this.beforeRenderEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,true);var html=[];html[html.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+' y'+workingDate.getFullYear()+'" id="'+this.id+'">';html=this.renderHeader(html);html=this.renderBody(workingDate,html);html=this.renderFooter(html);html[html.length]='</table>';this.oDomContainer.innerHTML=html.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(defCfg.TITLE.key);this.cfg.refireEvent(defCfg.CLOSE.key);this.cfg.refireEvent(defCfg.IFRAME.key);this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners=function(){var root=this.oDomContainer;var cal=this.parent||this;var anchor="a";var mousedown="mousedown";var linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,anchor,root);var linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,anchor,root);if(linkLeft&&linkLeft.length>0){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,mousedown,cal.previousMonth,cal,true);}
-if(linkRight&&linkRight.length>0){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,mousedown,cal.nextMonth,cal,true);}
-if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
-for(var i=0;i<items.length;i++){var item=items[i];elements=YAHOO.util.Dom.getElementsByClassName(cls,item.tag,this.oDomContainer);for(var c=0;c<elements.length;c++){el=elements[c];YAHOO.util.Event.addListener(el,item.event,item.handler,item.scope,item.correct);}}}}}
-YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="#" class="'+this.Style.CSS_CELL_SELECTOR+'">'+this.buildDayLabel(workingDate)+"</a>";};YAHOO.widget.Calendar.prototype.styleCellDefault=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTABLE);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.addMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar.prototype.reset=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.resetProperty(defCfg.SELECTED.key);this.cfg.resetProperty(defCfg.PAGEDATE.key);this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.setProperty(defCfg.SELECTED.key,[]);this.cfg.setProperty(defCfg.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.select=function(date){var aToBeSelected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(!this.isDateOOB(this._toDate(toSelect))){if(validDates.length===0){this.beforeSelectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
-validDates.push(toSelect);if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}}
-if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
-this.selectEvent.fire(validDates);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectable=YAHOO.util.Dom.hasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeSelectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var selectDate=cellDate.concat();if(this._indexOfSelectedFieldArray(selectDate)==-1){selected[selected.length]=selectDate;}
-if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
-this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){var aToBeDeselected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeDeselected.length;++a){var toDeselect=aToBeDeselected[a];if(!this.isDateOOB(this._toDate(toDeselect))){if(validDates.length===0){this.beforeDeselectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
-validDates.push(toDeselect);var index=this._indexOfSelectedFieldArray(toDeselect);if(index!=-1){selected.splice(index,1);}}}
-if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
-this.deselectEvent.fire(validDates);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var selectable=YAHOO.util.Dom.hasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeDeselectEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var selected=this.cfg.getProperty(defCfg.SELECTED.key);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth()==dCellDate.getMonth()&&this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
-selected.splice(cellDateIndex,1);}
-if(this.parent){this.parent.cfg.setProperty(defCfg.SELECTED.key,selected);}else{this.cfg.setProperty(defCfg.SELECTED.key,selected);}
-this.deselectEvent.fire(selectDate);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty(cfgSelected,[]);}else{this.cfg.setProperty(cfgSelected,[]);}
-if(count>0){this.deselectEvent.fire(sel);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(YAHOO.lang.isString(date)){returnDate=this._parseDates(date);}else if(YAHOO.lang.isArray(date)){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
-return returnDate;};YAHOO.widget.Calendar.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
-return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var s=0;s<seldates.length;++s){var sArray=seldates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
-return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){return(date.getMonth()!=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());};YAHOO.widget.Calendar.prototype.isDateOOB=function(date){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var minDate=this.cfg.getProperty(defCfg.MINDATE.key);var maxDate=this.cfg.getProperty(defCfg.MAXDATE.key);var dm=YAHOO.widget.DateMath;if(minDate){minDate=dm.clearTime(minDate);}
-if(maxDate){maxDate=dm.clearTime(maxDate);}
-var clearedDate=new Date(date.getTime());clearedDate=dm.clearTime(clearedDate);return((minDate&&clearedDate.getTime()<minDate.getTime())||(maxDate&&clearedDate.getTime()>maxDate.getTime()));};YAHOO.widget.Calendar.prototype._parsePageDate=function(date){var parsedDate;var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(date){if(date instanceof Date){parsedDate=YAHOO.widget.DateMath.findMonthStart(date);}else{var month,year,aMonthYear;aMonthYear=date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));month=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1],10);parsedDate=new Date(year,month,1);}}else{parsedDate=new Date(this.today.getFullYear(),this.today.getMonth(),1);}
-return parsedDate;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}}};YAHOO.widget.Calendar.prototype.onSelect=function(selected){};YAHOO.widget.Calendar.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar.prototype.onDeselect=function(deselected){};YAHOO.widget.Calendar.prototype.onChangePage=function(){this.render();};YAHOO.widget.Calendar.prototype.onRender=function(){};YAHOO.widget.Calendar.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar.prototype.validate=function(){return true;};YAHOO.widget.Calendar.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.DATE;}
-for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}
-return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
-return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
-return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setMonth(parseInt(month,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setFullYear(parseInt(year,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
-returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){this.oDomContainer.style.display="none";};YAHOO.widget.Calendar.prototype.show=function(){this.oDomContainer.style.display="block";};YAHOO.widget.Calendar.prototype.browser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=document.getElementById(containerId);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
-this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){var defCfg=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGES.key,{value:defCfg.PAGES.value,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var strEvent="Event";var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].unsubscribe(fn,obj);}};var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;var sep="_";var groupCalClass="groupcal";var firstClass="first-of-type";var lastClass="last-of-type";for(var p=0;p<pageCount;++p){var calId=this.id+sep+p;var calContainerId=this.containerId+sep+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty(cfgPageDate);this._setMonthOnDate(caldate,caldate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(cal.oDomContainer,groupCalClass);if(p===0){YAHOO.util.Dom.addClass(cal.oDomContainer,firstClass);}
-if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,lastClass);}
-cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];var firstPageDate;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];if(p===0){firstPageDate=cal._parsePageDate(val);cal.cfg.setProperty(cfgPageDate,firstPageDate);}else{var pageDate=new Date(firstPageDate);this._setMonthOnDate(pageDate,pageDate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,pageDate);}}};YAHOO.widget.CalendarGroup.prototype.configSelected=function(type,args,obj){var cfgSelected=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;this.delegateConfig(type,args,obj);var selected=(this.pages.length>0)?this.pages[0].cfg.getProperty(cfgSelected):[];this.cfg.setProperty(cfgSelected,selected,true);};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=document.getElementById(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}
-return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);var currYear;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if(p===0){currYear=pageDate.getFullYear();}else{pageDate.setYear(currYear);}
-this._setMonthOnDate(pageDate,month+p);cal.cfg.setProperty(cfgPageDate,pageDate);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;year=parseInt(year,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if((pageDate.getMonth()+1)==1&&p>0){year+=1;}
-cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}
-this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselect(date);}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectCell(cellIndex);}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
-returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.renderHeader=function(){};YAHOO.widget.CalendarGroup.prototype.renderFooter=function(){};YAHOO.widget.CalendarGroup.prototype.addMonths=function(count){this.callChildFunction("addMonths",count);};YAHOO.widget.CalendarGroup.prototype.subtractMonths=function(count){this.callChildFunction("subtractMonths",count);};YAHOO.widget.CalendarGroup.prototype.addYears=function(count){this.callChildFunction("addYears",count);};YAHOO.widget.CalendarGroup.prototype.subtractYears=function(count){this.callChildFunction("subtractYears",count);};YAHOO.widget.CalendarGroup.prototype.show=function(){this.oDomContainer.style.display="block";if(YAHOO.env.ua.opera){this._fixWidth();}};YAHOO.widget.CalendarGroup.prototype._setMonthOnDate=function(date,iMonth){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(iMonth<0||iMonth>11)){var DM=YAHOO.widget.DateMath;var newDate=DM.add(date,DM.MONTH,iMonth-date.getMonth());date.setTime(newDate.getTime());}else{date.setMonth(iMonth);}};YAHOO.widget.CalendarGroup.prototype._fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}
-if(w>0){this.oDomContainer.style.width=w+"px";}};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","hide","browser");YAHOO.widget.CalendarGroup._DEFAULT_CONFIG=YAHOO.widget.Calendar._DEFAULT_CONFIG;YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES={key:"pages",value:2};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(A,D,C){var F=new Date(A.getTime());switch(D){case this.MONTH:var E=A.getMonth()+C;var B=0;if(E<0){while(E<0){E+=12;B-=1;}}else{if(E>11){while(E>11){E-=12;B+=1;}}}F.setMonth(E);F.setFullYear(A.getFullYear()+B);break;case this.DAY:this._addDays(F,C);break;case this.YEAR:F.setFullYear(A.getFullYear()+C);break;case this.WEEK:this._addDays(F,(C*7));break;}return F;},_addDays:function(D,C){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){if(C<0){for(var B=-128;C<B;C-=B){D.setDate(D.getDate()+B);}}else{for(var A=96;C>A;C-=A){D.setDate(D.getDate()+A);}}}D.setDate(D.getDate()+C);},subtract:function(A,C,B){return this.add(A,C,(B*-1));},before:function(C,B){var A=B.getTime();if(C.getTime()<A){return true;}else{return false;}},after:function(C,B){var A=B.getTime();if(C.getTime()>A){return true;}else{return false;}},between:function(B,A,C){if(this.after(B,A)&&this.before(B,C)){return true;}else{return false;}},getJan1:function(A){return this.getDate(A,0,1);},getDayOffset:function(B,D){var C=this.getJan1(D);var A=Math.ceil((B.getTime()-C.getTime())/this.ONE_DAY_MS);return A;},getWeekNumber:function(C,F){C=this.clearTime(C);var E=new Date(C.getTime()+(4*this.ONE_DAY_MS)-((C.getDay())*this.ONE_DAY_MS));var B=this.getDate(E.getFullYear(),0,1);var A=((E.getTime()-B.getTime())/this.ONE_DAY_MS)-1;var D=Math.ceil((A)/7);return D;},isYearOverlapWeek:function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getFullYear()!=A.getFullYear()){C=true;}return C;},isMonthOverlapWeek:function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getMonth()!=A.getMonth()){C=true;}return C;},findMonthStart:function(A){var B=this.getDate(A.getFullYear(),A.getMonth(),1);
+return B;},findMonthEnd:function(B){var D=this.findMonthStart(B);var C=this.add(D,this.MONTH,1);var A=this.subtract(C,this.DAY,1);return A;},clearTime:function(A){A.setHours(12,0,0,0);return A;},getDate:function(D,A,C){var B=null;if(YAHOO.lang.isUndefined(C)){C=1;}if(D>=100){B=new Date(D,A,C);}else{B=new Date();B.setFullYear(D);B.setMonth(A);B.setDate(C);B.setHours(0,0,0,0);}return B;}};YAHOO.widget.Calendar=function(C,A,B){this.init.apply(this,arguments);};YAHOO.widget.Calendar.IMG_ROOT=null;YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.SHORT="short";YAHOO.widget.Calendar.LONG="long";YAHOO.widget.Calendar.MEDIUM="medium";YAHOO.widget.Calendar.ONE_CHAR="1char";YAHOO.widget.Calendar._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""},NAV:{key:"navigator",value:null}};YAHOO.widget.Calendar._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",RESET:"reset",CLEAR:"clear",BEFORE_HIDE:"beforeHide",HIDE:"hide",BEFORE_SHOW:"beforeShow",SHOW:"show",BEFORE_HIDE_NAV:"beforeHideNav",HIDE_NAV:"hideNav",BEFORE_SHOW_NAV:"beforeShowNav",SHOW_NAV:"showNav",BEFORE_RENDER_NAV:"beforeRenderNav",RENDER_NAV:"renderNav"};YAHOO.widget.Calendar._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_NAV:"calnav",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,containerId:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,oNavigator:null,_selectedDates:null,domEventMap:null,_parseArgs:function(B){var A={id:null,container:null,config:null};if(B&&B.length&&B.length>0){switch(B.length){case 1:A.id=null;A.container=B[0];A.config=null;break;case 2:if(YAHOO.lang.isObject(B[1])&&!B[1].tagName&&!(B[1] instanceof String)){A.id=null;A.container=B[0];A.config=B[1];}else{A.id=B[0];A.container=B[1];A.config=null;}break;default:A.id=B[0];A.container=B[1];A.config=B[2];break;}}else{}return A;},init:function(D,B,C){var A=this._parseArgs(arguments);D=A.id;B=A.container;C=A.config;this.oDomContainer=YAHOO.util.Dom.get(B);if(!this.oDomContainer.id){this.oDomContainer.id=YAHOO.util.Dom.generateId();}if(!D){D=this.oDomContainer.id+"_t";}this.id=D;this.containerId=this.oDomContainer.id;this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(C){this.cfg.applyConfig(C,true);}this.cfg.fireQueue();},configIframe:function(C,B,D){var A=B[0];if(!this.parent){if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(A){var E=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");
+if(E=="absolute"||E=="relative"){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){YAHOO.util.Dom.addClass(this.iframe,"fixedsize");}this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;}}}}},configTitle:function(B,A,C){var E=A[0];if(E){this.createTitleBar(E);}else{var D=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);if(!D){this.removeTitleBar();}else{this.createTitleBar("&#160;");}}},configClose:function(B,A,C){var E=A[0],D=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);if(E){if(!D){this.createTitleBar("&#160;");}this.createCloseButton();}else{this.removeCloseButton();if(!D){this.removeTitleBar();}}},initEvents:function(){var A=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(A.BEFORE_SELECT);this.selectEvent=new YAHOO.util.CustomEvent(A.SELECT);this.beforeDeselectEvent=new YAHOO.util.CustomEvent(A.BEFORE_DESELECT);this.deselectEvent=new YAHOO.util.CustomEvent(A.DESELECT);this.changePageEvent=new YAHOO.util.CustomEvent(A.CHANGE_PAGE);this.beforeRenderEvent=new YAHOO.util.CustomEvent(A.BEFORE_RENDER);this.renderEvent=new YAHOO.util.CustomEvent(A.RENDER);this.resetEvent=new YAHOO.util.CustomEvent(A.RESET);this.clearEvent=new YAHOO.util.CustomEvent(A.CLEAR);this.beforeShowEvent=new YAHOO.util.CustomEvent(A.BEFORE_SHOW);this.showEvent=new YAHOO.util.CustomEvent(A.SHOW);this.beforeHideEvent=new YAHOO.util.CustomEvent(A.BEFORE_HIDE);this.hideEvent=new YAHOO.util.CustomEvent(A.HIDE);this.beforeShowNavEvent=new YAHOO.util.CustomEvent(A.BEFORE_SHOW_NAV);this.showNavEvent=new YAHOO.util.CustomEvent(A.SHOW_NAV);this.beforeHideNavEvent=new YAHOO.util.CustomEvent(A.BEFORE_HIDE_NAV);this.hideNavEvent=new YAHOO.util.CustomEvent(A.HIDE_NAV);this.beforeRenderNavEvent=new YAHOO.util.CustomEvent(A.BEFORE_RENDER_NAV);this.renderNavEvent=new YAHOO.util.CustomEvent(A.RENDER_NAV);this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);},doSelectCell:function(G,A){var L,F,I,C;var H=YAHOO.util.Event.getTarget(G);var B=H.tagName.toLowerCase();var E=false;while(B!="td"&&!YAHOO.util.Dom.hasClass(H,A.Style.CSS_CELL_SELECTABLE)){if(!E&&B=="a"&&YAHOO.util.Dom.hasClass(H,A.Style.CSS_CELL_SELECTOR)){E=true;}H=H.parentNode;B=H.tagName.toLowerCase();if(B=="html"){return ;}}if(E){YAHOO.util.Event.preventDefault(G);}L=H;if(YAHOO.util.Dom.hasClass(L,A.Style.CSS_CELL_SELECTABLE)){F=L.id.split("cell")[1];I=A.cellDates[F];C=YAHOO.widget.DateMath.getDate(I[0],I[1]-1,I[2]);var K;if(A.Options.MULTI_SELECT){K=L.getElementsByTagName("a")[0];if(K){K.blur();}var D=A.cellDates[F];var J=A._indexOfSelectedFieldArray(D);if(J>-1){A.deselectCell(F);}else{A.selectCell(F);}}else{K=L.getElementsByTagName("a")[0];if(K){K.blur();}A.selectCell(F);}}},doCellMouseOver:function(C,B){var A;if(C){A=YAHOO.util.Event.getTarget(C);}else{A=this;}while(A.tagName&&A.tagName.toLowerCase()!="td"){A=A.parentNode;if(!A.tagName||A.tagName.toLowerCase()=="html"){return ;}}if(YAHOO.util.Dom.hasClass(A,B.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.addClass(A,B.Style.CSS_CELL_HOVER);}},doCellMouseOut:function(C,B){var A;if(C){A=YAHOO.util.Event.getTarget(C);}else{A=this;}while(A.tagName&&A.tagName.toLowerCase()!="td"){A=A.parentNode;if(!A.tagName||A.tagName.toLowerCase()=="html"){return ;}}if(YAHOO.util.Dom.hasClass(A,B.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(A,B.Style.CSS_CELL_HOVER);}},setupConfig:function(){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.addProperty(A.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(A.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(A.TITLE.key,{value:A.TITLE.value,handler:this.configTitle});this.cfg.addProperty(A.CLOSE.key,{value:A.CLOSE.value,handler:this.configClose});this.cfg.addProperty(A.IFRAME.key,{value:A.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.MINDATE.key,{value:A.MINDATE.value,handler:this.configMinDate});this.cfg.addProperty(A.MAXDATE.key,{value:A.MAXDATE.value,handler:this.configMaxDate});this.cfg.addProperty(A.MULTI_SELECT.key,{value:A.MULTI_SELECT.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.START_WEEKDAY.key,{value:A.START_WEEKDAY.value,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty(A.SHOW_WEEKDAYS.key,{value:A.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.SHOW_WEEK_HEADER.key,{value:A.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.SHOW_WEEK_FOOTER.key,{value:A.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.HIDE_BLANK_WEEKS.key,{value:A.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.NAV_ARROW_LEFT.key,{value:A.NAV_ARROW_LEFT.value,handler:this.configOptions});this.cfg.addProperty(A.NAV_ARROW_RIGHT.key,{value:A.NAV_ARROW_RIGHT.value,handler:this.configOptions});this.cfg.addProperty(A.MONTHS_SHORT.key,{value:A.MONTHS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(A.MONTHS_LONG.key,{value:A.MONTHS_LONG.value,handler:this.configLocale});this.cfg.addProperty(A.WEEKDAYS_1CHAR.key,{value:A.WEEKDAYS_1CHAR.value,handler:this.configLocale});
+this.cfg.addProperty(A.WEEKDAYS_SHORT.key,{value:A.WEEKDAYS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(A.WEEKDAYS_MEDIUM.key,{value:A.WEEKDAYS_MEDIUM.value,handler:this.configLocale});this.cfg.addProperty(A.WEEKDAYS_LONG.key,{value:A.WEEKDAYS_LONG.value,handler:this.configLocale});var B=function(){this.cfg.refireEvent(A.LOCALE_MONTHS.key);this.cfg.refireEvent(A.LOCALE_WEEKDAYS.key);};this.cfg.subscribeToConfigEvent(A.START_WEEKDAY.key,B,this,true);this.cfg.subscribeToConfigEvent(A.MONTHS_SHORT.key,B,this,true);this.cfg.subscribeToConfigEvent(A.MONTHS_LONG.key,B,this,true);this.cfg.subscribeToConfigEvent(A.WEEKDAYS_1CHAR.key,B,this,true);this.cfg.subscribeToConfigEvent(A.WEEKDAYS_SHORT.key,B,this,true);this.cfg.subscribeToConfigEvent(A.WEEKDAYS_MEDIUM.key,B,this,true);this.cfg.subscribeToConfigEvent(A.WEEKDAYS_LONG.key,B,this,true);this.cfg.addProperty(A.LOCALE_MONTHS.key,{value:A.LOCALE_MONTHS.value,handler:this.configLocaleValues});this.cfg.addProperty(A.LOCALE_WEEKDAYS.key,{value:A.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});this.cfg.addProperty(A.DATE_DELIMITER.key,{value:A.DATE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(A.DATE_FIELD_DELIMITER.key,{value:A.DATE_FIELD_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(A.DATE_RANGE_DELIMITER.key,{value:A.DATE_RANGE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(A.MY_MONTH_POSITION.key,{value:A.MY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_YEAR_POSITION.key,{value:A.MY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MD_MONTH_POSITION.key,{value:A.MD_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MD_DAY_POSITION.key,{value:A.MD_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_MONTH_POSITION.key,{value:A.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_DAY_POSITION.key,{value:A.MDY_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_YEAR_POSITION.key,{value:A.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_MONTH_POSITION.key,{value:A.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_YEAR_POSITION.key,{value:A.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_MONTH_SUFFIX.key,{value:A.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});this.cfg.addProperty(A.MY_LABEL_YEAR_SUFFIX.key,{value:A.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});this.cfg.addProperty(A.NAV.key,{value:A.NAV.value,handler:this.configNavigator});},configPageDate:function(B,A,C){this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key,this._parsePageDate(A[0]),true);},configMinDate:function(B,A,C){var D=A[0];if(YAHOO.lang.isString(D)){D=this._parseDate(D);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key,YAHOO.widget.DateMath.getDate(D[0],(D[1]-1),D[2]));}},configMaxDate:function(B,A,C){var D=A[0];if(YAHOO.lang.isString(D)){D=this._parseDate(D);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key,YAHOO.widget.DateMath.getDate(D[0],(D[1]-1),D[2]));}},configSelected:function(C,A,E){var B=A[0];var D=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;if(B){if(YAHOO.lang.isString(B)){this.cfg.setProperty(D,this._parseDates(B),true);}}if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(D);}},configOptions:function(B,A,C){this.Options[B.toUpperCase()]=A[0];},configLocale:function(C,B,D){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.Locale[C.toUpperCase()]=B[0];this.cfg.refireEvent(A.LOCALE_MONTHS.key);this.cfg.refireEvent(A.LOCALE_WEEKDAYS.key);},configLocaleValues:function(D,C,E){var B=YAHOO.widget.Calendar._DEFAULT_CONFIG;D=D.toLowerCase();var G=C[0];switch(D){case B.LOCALE_MONTHS.key:switch(G){case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(B.MONTHS_SHORT.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(B.MONTHS_LONG.key).concat();break;}break;case B.LOCALE_WEEKDAYS.key:switch(G){case YAHOO.widget.Calendar.ONE_CHAR:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(B.WEEKDAYS_1CHAR.key).concat();break;case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(B.WEEKDAYS_SHORT.key).concat();break;case YAHOO.widget.Calendar.MEDIUM:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(B.WEEKDAYS_MEDIUM.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(B.WEEKDAYS_LONG.key).concat();break;}var F=this.cfg.getProperty(B.START_WEEKDAY.key);if(F>0){for(var A=0;A<F;++A){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}break;}},configNavigator:function(C,A,D){var E=A[0];if(YAHOO.widget.CalendarNavigator&&(E===true||YAHOO.lang.isObject(E))){if(!this.oNavigator){this.oNavigator=new YAHOO.widget.CalendarNavigator(this);function B(){if(!this.pages){this.oNavigator.erase();}}this.beforeRenderEvent.subscribe(B,this,true);}}else{if(this.oNavigator){this.oNavigator.destroy();this.oNavigator=null;}}},initStyles:function(){var A=YAHOO.widget.Calendar._STYLES;this.Style={CSS_ROW_HEADER:A.CSS_ROW_HEADER,CSS_ROW_FOOTER:A.CSS_ROW_FOOTER,CSS_CELL:A.CSS_CELL,CSS_CELL_SELECTOR:A.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:A.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:A.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:A.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:A.CSS_CELL_TODAY,CSS_CELL_OOM:A.CSS_CELL_OOM,CSS_CELL_OOB:A.CSS_CELL_OOB,CSS_HEADER:A.CSS_HEADER,CSS_HEADER_TEXT:A.CSS_HEADER_TEXT,CSS_BODY:A.CSS_BODY,CSS_WEEKDAY_CELL:A.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:A.CSS_WEEKDAY_ROW,CSS_FOOTER:A.CSS_FOOTER,CSS_CALENDAR:A.CSS_CALENDAR,CSS_SINGLE:A.CSS_SINGLE,CSS_CONTAINER:A.CSS_CONTAINER,CSS_NAV_LEFT:A.CSS_NAV_LEFT,CSS_NAV_RIGHT:A.CSS_NAV_RIGHT,CSS_NAV:A.CSS_NAV,CSS_CLOSE:A.CSS_CLOSE,CSS_CELL_TOP:A.CSS_CELL_TOP,CSS_CELL_LEFT:A.CSS_CELL_LEFT,CSS_CELL_RIGHT:A.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:A.CSS_CELL_BOTTOM,CSS_CELL_HOVER:A.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:A.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:A.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:A.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:A.CSS_CELL_HIGHLIGHT4};
+},buildMonthLabel:function(){var A=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);var C=this.Locale.LOCALE_MONTHS[A.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX;var B=A.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return B+C;}else{return C+B;}},buildDayLabel:function(A){return A.getDate();},createTitleBar:function(A){var B=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");B.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;B.innerHTML=A;this.oDomContainer.insertBefore(B,this.oDomContainer.firstChild);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");return B;},removeTitleBar:function(){var A=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(A){YAHOO.util.Event.purgeElement(A);this.oDomContainer.removeChild(A);}YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");},createCloseButton:function(){var D=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,F="us/my/bn/x_d.gif";var E=D.getElementsByClassName("link-close","a",this.oDomContainer)[0];if(!E){E=document.createElement("a");A.addListener(E,"click",function(H,G){G.hide();A.preventDefault(H);},this);}E.href="#";E.className="link-close";if(YAHOO.widget.Calendar.IMG_ROOT!==null){var B=D.getElementsByClassName(C,"img",E)[0]||document.createElement("img");B.src=YAHOO.widget.Calendar.IMG_ROOT+F;B.className=C;E.appendChild(B);}else{E.innerHTML="<span class=\""+C+" "+this.Style.CSS_CLOSE+"\"></span>";}this.oDomContainer.appendChild(E);return E;},removeCloseButton:function(){var A=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(A){YAHOO.util.Event.purgeElement(A);this.oDomContainer.removeChild(A);}},renderHeader:function(E){var H=7;var F="us/tr/callt.gif";var G="us/tr/calrt.gif";var M=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(this.cfg.getProperty(M.SHOW_WEEK_HEADER.key)){H+=1;}if(this.cfg.getProperty(M.SHOW_WEEK_FOOTER.key)){H+=1;}E[E.length]="<thead>";E[E.length]="<tr>";E[E.length]="<th colspan=\""+H+"\" class=\""+this.Style.CSS_HEADER_TEXT+"\">";E[E.length]="<div class=\""+this.Style.CSS_HEADER+"\">";var K,L=false;if(this.parent){if(this.index===0){K=true;}if(this.index==(this.parent.cfg.getProperty("pages")-1)){L=true;}}else{K=true;L=true;}if(K){var A=this.cfg.getProperty(M.NAV_ARROW_LEFT.key);if(A===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){A=YAHOO.widget.Calendar.IMG_ROOT+F;}var C=(A===null)?"":" style=\"background-image:url("+A+")\"";E[E.length]="<a class=\""+this.Style.CSS_NAV_LEFT+"\""+C+" >&#160;</a>";}var J=this.buildMonthLabel();var B=this.parent||this;if(B.cfg.getProperty("navigator")){J="<a class=\""+this.Style.CSS_NAV+"\" href=\"#\">"+J+"</a>";}E[E.length]=J;if(L){var D=this.cfg.getProperty(M.NAV_ARROW_RIGHT.key);if(D===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){D=YAHOO.widget.Calendar.IMG_ROOT+G;}var I=(D===null)?"":" style=\"background-image:url("+D+")\"";E[E.length]="<a class=\""+this.Style.CSS_NAV_RIGHT+"\""+I+" >&#160;</a>";}E[E.length]="</div>\n</th>\n</tr>";if(this.cfg.getProperty(M.SHOW_WEEKDAYS.key)){E=this.buildWeekdays(E);}E[E.length]="</thead>";return E;},buildWeekdays:function(C){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;C[C.length]="<tr class=\""+this.Style.CSS_WEEKDAY_ROW+"\">";if(this.cfg.getProperty(A.SHOW_WEEK_HEADER.key)){C[C.length]="<th>&#160;</th>";}for(var B=0;B<this.Locale.LOCALE_WEEKDAYS.length;++B){C[C.length]="<th class=\"calweekdaycell\">"+this.Locale.LOCALE_WEEKDAYS[B]+"</th>";}if(this.cfg.getProperty(A.SHOW_WEEK_FOOTER.key)){C[C.length]="<th>&#160;</th>";}C[C.length]="</tr>";return C;},renderBody:function(c,a){var m=YAHOO.widget.Calendar._DEFAULT_CONFIG;var AB=this.cfg.getProperty(m.START_WEEKDAY.key);this.preMonthDays=c.getDay();if(AB>0){this.preMonthDays-=AB;}if(this.preMonthDays<0){this.preMonthDays+=7;}this.monthDays=YAHOO.widget.DateMath.findMonthEnd(c).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;c=YAHOO.widget.DateMath.subtract(c,YAHOO.widget.DateMath.DAY,this.preMonthDays);var Q,H;var G="w";var W="_cell";var U="wd";var k="d";var I;var h;var O=this.today.getFullYear();var j=this.today.getMonth();var D=this.today.getDate();var q=this.cfg.getProperty(m.PAGEDATE.key);var C=this.cfg.getProperty(m.HIDE_BLANK_WEEKS.key);var Z=this.cfg.getProperty(m.SHOW_WEEK_FOOTER.key);var T=this.cfg.getProperty(m.SHOW_WEEK_HEADER.key);var M=this.cfg.getProperty(m.MINDATE.key);var S=this.cfg.getProperty(m.MAXDATE.key);if(M){M=YAHOO.widget.DateMath.clearTime(M);}if(S){S=YAHOO.widget.DateMath.clearTime(S);}a[a.length]="<tbody class=\"m"+(q.getMonth()+1)+" "+this.Style.CSS_BODY+"\">";var z=0;var J=document.createElement("div");var b=document.createElement("td");J.appendChild(b);var o=this.parent||this;for(var u=0;u<6;u++){Q=YAHOO.widget.DateMath.getWeekNumber(c,q.getFullYear(),AB);H=G+Q;if(u!==0&&C===true&&c.getMonth()!=q.getMonth()){break;}else{a[a.length]="<tr class=\""+H+"\">";if(T){a=this.renderRowHeader(Q,a);}for(var AA=0;AA<7;AA++){I=[];this.clearElement(b);b.className=this.Style.CSS_CELL;b.id=this.id+W+z;if(c.getDate()==D&&c.getMonth()==j&&c.getFullYear()==O){I[I.length]=o.renderCellStyleToday;}var R=[c.getFullYear(),c.getMonth()+1,c.getDate()];this.cellDates[this.cellDates.length]=R;if(c.getMonth()!=q.getMonth()){I[I.length]=o.renderCellNotThisMonth;}else{YAHOO.util.Dom.addClass(b,U+c.getDay());YAHOO.util.Dom.addClass(b,k+c.getDate());for(var t=0;t<this.renderStack.length;++t){h=null;var l=this.renderStack[t];var AC=l[0];var B;var V;var F;switch(AC){case YAHOO.widget.Calendar.DATE:B=l[1][1];V=l[1][2];F=l[1][0];if(c.getMonth()+1==B&&c.getDate()==V&&c.getFullYear()==F){h=l[2];this.renderStack.splice(t,1);}break;case YAHOO.widget.Calendar.MONTH_DAY:B=l[1][0];V=l[1][1];if(c.getMonth()+1==B&&c.getDate()==V){h=l[2];this.renderStack.splice(t,1);
+}break;case YAHOO.widget.Calendar.RANGE:var Y=l[1][0];var X=l[1][1];var e=Y[1];var L=Y[2];var P=Y[0];var y=YAHOO.widget.DateMath.getDate(P,e-1,L);var E=X[1];var g=X[2];var A=X[0];var w=YAHOO.widget.DateMath.getDate(A,E-1,g);if(c.getTime()>=y.getTime()&&c.getTime()<=w.getTime()){h=l[2];if(c.getTime()==w.getTime()){this.renderStack.splice(t,1);}}break;case YAHOO.widget.Calendar.WEEKDAY:var K=l[1][0];if(c.getDay()+1==K){h=l[2];}break;case YAHOO.widget.Calendar.MONTH:B=l[1][0];if(c.getMonth()+1==B){h=l[2];}break;}if(h){I[I.length]=h;}}}if(this._indexOfSelectedFieldArray(R)>-1){I[I.length]=o.renderCellStyleSelected;}if((M&&(c.getTime()<M.getTime()))||(S&&(c.getTime()>S.getTime()))){I[I.length]=o.renderOutOfBoundsDate;}else{I[I.length]=o.styleCellDefault;I[I.length]=o.renderCellDefault;}for(var n=0;n<I.length;++n){if(I[n].call(o,c,b)==YAHOO.widget.Calendar.STOP_RENDER){break;}}c.setTime(c.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(z>=0&&z<=6){YAHOO.util.Dom.addClass(b,this.Style.CSS_CELL_TOP);}if((z%7)===0){YAHOO.util.Dom.addClass(b,this.Style.CSS_CELL_LEFT);}if(((z+1)%7)===0){YAHOO.util.Dom.addClass(b,this.Style.CSS_CELL_RIGHT);}var f=this.postMonthDays;if(C&&f>=7){var N=Math.floor(f/7);for(var v=0;v<N;++v){f-=7;}}if(z>=((this.preMonthDays+f+this.monthDays)-7)){YAHOO.util.Dom.addClass(b,this.Style.CSS_CELL_BOTTOM);}a[a.length]=J.innerHTML;z++;}if(Z){a=this.renderRowFooter(Q,a);}a[a.length]="</tr>";}}a[a.length]="</tbody>";return a;},renderFooter:function(A){return A;},render:function(){this.beforeRenderEvent.fire();var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;var C=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(A.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,true);var B=[];B[B.length]="<table cellSpacing=\"0\" class=\""+this.Style.CSS_CALENDAR+" y"+C.getFullYear()+"\" id=\""+this.id+"\">";B=this.renderHeader(B);B=this.renderBody(C,B);B=this.renderFooter(B);B[B.length]="</table>";this.oDomContainer.innerHTML=B.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(A.TITLE.key);this.cfg.refireEvent(A.CLOSE.key);this.cfg.refireEvent(A.IFRAME.key);this.renderEvent.fire();},applyListeners:function(){var K=this.oDomContainer;var B=this.parent||this;var G="a";var D="mousedown";var H=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,G,K);var C=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,G,K);if(H&&H.length>0){this.linkLeft=H[0];YAHOO.util.Event.addListener(this.linkLeft,D,B.previousMonth,B,true);}if(C&&C.length>0){this.linkRight=C[0];YAHOO.util.Event.addListener(this.linkRight,D,B.nextMonth,B,true);}if(B.cfg.getProperty("navigator")!==null){this.applyNavListeners();}if(this.domEventMap){var E,A;for(var M in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,M)){var I=this.domEventMap[M];if(!(I instanceof Array)){I=[I];}for(var F=0;F<I.length;F++){var L=I[F];A=YAHOO.util.Dom.getElementsByClassName(M,L.tag,this.oDomContainer);for(var J=0;J<A.length;J++){E=A[J];YAHOO.util.Event.addListener(E,L.event,L.handler,L.scope,L.correct);}}}}}YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);},applyNavListeners:function(){var D=YAHOO.util.Event;var C=this.parent||this;var F=this;var B=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV,"a",this.oDomContainer);if(B.length>0){function A(J,I){var H=D.getTarget(J);if(this===H||YAHOO.util.Dom.isAncestor(this,H)){D.preventDefault(J);}var E=C.oNavigator;if(E){var G=F.cfg.getProperty("pagedate");E.setYear(G.getFullYear());E.setMonth(G.getMonth());E.show();}}D.addListener(B,"click",A);}},getDateByCellId:function(B){var A=this.getDateFieldsByCellId(B);return YAHOO.widget.DateMath.getDate(A[0],A[1]-1,A[2]);},getDateFieldsByCellId:function(A){A=A.toLowerCase().split("_cell")[1];A=parseInt(A,10);return this.cellDates[A];},getCellIndex:function(C){var B=-1;if(C){var A=C.getMonth(),H=C.getFullYear(),G=C.getDate(),E=this.cellDates;for(var D=0;D<E.length;++D){var F=E[D];if(F[0]===H&&F[1]===A+1&&F[2]===G){B=D;break;}}}return B;},renderOutOfBoundsDate:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_OOB);A.innerHTML=B.getDate();return YAHOO.widget.Calendar.STOP_RENDER;},renderRowHeader:function(B,A){A[A.length]="<th class=\"calrowhead\">"+B+"</th>";return A;},renderRowFooter:function(B,A){A[A.length]="<th class=\"calrowfoot\">"+B+"</th>";return A;},renderCellDefault:function(B,A){A.innerHTML="<a href=\"#\" class=\""+this.Style.CSS_CELL_SELECTOR+"\">"+this.buildDayLabel(B)+"</a>";},styleCellDefault:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_SELECTABLE);},renderCellStyleHighlight1:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT1);},renderCellStyleHighlight2:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT2);},renderCellStyleHighlight3:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT3);},renderCellStyleHighlight4:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT4);},renderCellStyleToday:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_TODAY);},renderCellStyleSelected:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_SELECTED);},renderCellNotThisMonth:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_OOM);A.innerHTML=B.getDate();return YAHOO.widget.Calendar.STOP_RENDER;},renderBodyCellRestricted:function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL);YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_RESTRICTED);A.innerHTML=B.getDate();return YAHOO.widget.Calendar.STOP_RENDER;},addMonths:function(B){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(A,YAHOO.widget.DateMath.add(this.cfg.getProperty(A),YAHOO.widget.DateMath.MONTH,B));this.resetRenderers();
+this.changePageEvent.fire();},subtractMonths:function(B){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(A,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(A),YAHOO.widget.DateMath.MONTH,B));this.resetRenderers();this.changePageEvent.fire();},addYears:function(B){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(A,YAHOO.widget.DateMath.add(this.cfg.getProperty(A),YAHOO.widget.DateMath.YEAR,B));this.resetRenderers();this.changePageEvent.fire();},subtractYears:function(B){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(A,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(A),YAHOO.widget.DateMath.YEAR,B));this.resetRenderers();this.changePageEvent.fire();},nextMonth:function(){this.addMonths(1);},previousMonth:function(){this.subtractMonths(1);},nextYear:function(){this.addYears(1);},previousYear:function(){this.subtractYears(1);},reset:function(){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.resetProperty(A.SELECTED.key);this.cfg.resetProperty(A.PAGEDATE.key);this.resetEvent.fire();},clear:function(){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.setProperty(A.SELECTED.key,[]);this.cfg.setProperty(A.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire();},select:function(C){var F=this._toFieldArray(C);var B=[];var E=[];var G=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var A=0;A<F.length;++A){var D=F[A];if(!this.isDateOOB(this._toDate(D))){if(B.length===0){this.beforeSelectEvent.fire();E=this.cfg.getProperty(G);}B.push(D);if(this._indexOfSelectedFieldArray(D)==-1){E[E.length]=D;}}}if(B.length>0){if(this.parent){this.parent.cfg.setProperty(G,E);}else{this.cfg.setProperty(G,E);}this.selectEvent.fire(B);}return this.getSelectedDates();},selectCell:function(D){var B=this.cells[D];var H=this.cellDates[D];var G=this._toDate(H);var C=YAHOO.util.Dom.hasClass(B,this.Style.CSS_CELL_SELECTABLE);if(C){this.beforeSelectEvent.fire();var F=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var E=this.cfg.getProperty(F);var A=H.concat();if(this._indexOfSelectedFieldArray(A)==-1){E[E.length]=A;}if(this.parent){this.parent.cfg.setProperty(F,E);}else{this.cfg.setProperty(F,E);}this.renderCellStyleSelected(G,B);this.selectEvent.fire([A]);this.doCellMouseOut.call(B,null,this);}return this.getSelectedDates();},deselect:function(E){var A=this._toFieldArray(E);var D=[];var G=[];var H=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var B=0;B<A.length;++B){var F=A[B];if(!this.isDateOOB(this._toDate(F))){if(D.length===0){this.beforeDeselectEvent.fire();G=this.cfg.getProperty(H);}D.push(F);var C=this._indexOfSelectedFieldArray(F);if(C!=-1){G.splice(C,1);}}}if(D.length>0){if(this.parent){this.parent.cfg.setProperty(H,G);}else{this.cfg.setProperty(H,G);}this.deselectEvent.fire(D);}return this.getSelectedDates();},deselectCell:function(E){var H=this.cells[E];var B=this.cellDates[E];var F=this._indexOfSelectedFieldArray(B);var G=YAHOO.util.Dom.hasClass(H,this.Style.CSS_CELL_SELECTABLE);if(G){this.beforeDeselectEvent.fire();var I=YAHOO.widget.Calendar._DEFAULT_CONFIG;var D=this.cfg.getProperty(I.SELECTED.key);var C=this._toDate(B);var A=B.concat();if(F>-1){if(this.cfg.getProperty(I.PAGEDATE.key).getMonth()==C.getMonth()&&this.cfg.getProperty(I.PAGEDATE.key).getFullYear()==C.getFullYear()){YAHOO.util.Dom.removeClass(H,this.Style.CSS_CELL_SELECTED);}D.splice(F,1);}if(this.parent){this.parent.cfg.setProperty(I.SELECTED.key,D);}else{this.cfg.setProperty(I.SELECTED.key,D);}this.deselectEvent.fire(A);}return this.getSelectedDates();},deselectAll:function(){this.beforeDeselectEvent.fire();var D=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var A=this.cfg.getProperty(D);var B=A.length;var C=A.concat();if(this.parent){this.parent.cfg.setProperty(D,[]);}else{this.cfg.setProperty(D,[]);}if(B>0){this.deselectEvent.fire(C);}return this.getSelectedDates();},_toFieldArray:function(B){var A=[];if(B instanceof Date){A=[[B.getFullYear(),B.getMonth()+1,B.getDate()]];}else{if(YAHOO.lang.isString(B)){A=this._parseDates(B);}else{if(YAHOO.lang.isArray(B)){for(var C=0;C<B.length;++C){var D=B[C];A[A.length]=[D.getFullYear(),D.getMonth()+1,D.getDate()];}}}}return A;},toDate:function(A){return this._toDate(A);},_toDate:function(A){if(A instanceof Date){return A;}else{return YAHOO.widget.DateMath.getDate(A[0],A[1]-1,A[2]);}},_fieldArraysAreEqual:function(C,B){var A=false;if(C[0]==B[0]&&C[1]==B[1]&&C[2]==B[2]){A=true;}return A;},_indexOfSelectedFieldArray:function(E){var D=-1;var A=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var C=0;C<A.length;++C){var B=A[C];if(E[0]==B[0]&&E[1]==B[1]&&E[2]==B[2]){D=C;break;}}return D;},isDateOOM:function(A){return(A.getMonth()!=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());},isDateOOB:function(D){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;var E=this.cfg.getProperty(A.MINDATE.key);var F=this.cfg.getProperty(A.MAXDATE.key);var C=YAHOO.widget.DateMath;if(E){E=C.clearTime(E);}if(F){F=C.clearTime(F);}var B=new Date(D.getTime());B=C.clearTime(B);return((E&&B.getTime()<E.getTime())||(F&&B.getTime()>F.getTime()));},_parsePageDate:function(B){var E;var A=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(B){if(B instanceof Date){E=YAHOO.widget.DateMath.findMonthStart(B);}else{var F,D,C;C=B.split(this.cfg.getProperty(A.DATE_FIELD_DELIMITER.key));F=parseInt(C[this.cfg.getProperty(A.MY_MONTH_POSITION.key)-1],10)-1;D=parseInt(C[this.cfg.getProperty(A.MY_YEAR_POSITION.key)-1],10);E=YAHOO.widget.DateMath.getDate(D,F,1);}}else{E=YAHOO.widget.DateMath.getDate(this.today.getFullYear(),this.today.getMonth(),1);}return E;},onBeforeSelect:function(){if(this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();
+}}},onSelect:function(A){},onBeforeDeselect:function(){},onDeselect:function(A){},onChangePage:function(){this.render();},onRender:function(){},onReset:function(){this.render();},onClear:function(){this.render();},validate:function(){return true;},_parseDate:function(C){var D=C.split(this.Locale.DATE_FIELD_DELIMITER);var A;if(D.length==2){A=[D[this.Locale.MD_MONTH_POSITION-1],D[this.Locale.MD_DAY_POSITION-1]];A.type=YAHOO.widget.Calendar.MONTH_DAY;}else{A=[D[this.Locale.MDY_YEAR_POSITION-1],D[this.Locale.MDY_MONTH_POSITION-1],D[this.Locale.MDY_DAY_POSITION-1]];A.type=YAHOO.widget.Calendar.DATE;}for(var B=0;B<A.length;B++){A[B]=parseInt(A[B],10);}return A;},_parseDates:function(B){var I=[];var H=B.split(this.Locale.DATE_DELIMITER);for(var G=0;G<H.length;++G){var F=H[G];if(F.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var A=F.split(this.Locale.DATE_RANGE_DELIMITER);var E=this._parseDate(A[0]);var J=this._parseDate(A[1]);var D=this._parseRange(E,J);I=I.concat(D);}else{var C=this._parseDate(F);I.push(C);}}return I;},_parseRange:function(A,E){var B=YAHOO.widget.DateMath.add(YAHOO.widget.DateMath.getDate(A[0],A[1]-1,A[2]),YAHOO.widget.DateMath.DAY,1);var D=YAHOO.widget.DateMath.getDate(E[0],E[1]-1,E[2]);var C=[];C.push(A);while(B.getTime()<=D.getTime()){C.push([B.getFullYear(),B.getMonth()+1,B.getDate()]);B=YAHOO.widget.DateMath.add(B,YAHOO.widget.DateMath.DAY,1);}return C;},resetRenderers:function(){this.renderStack=this._renderStack.concat();},removeRenderers:function(){this._renderStack=[];this.renderStack=[];},clearElement:function(A){A.innerHTML="&#160;";A.className="";},addRenderer:function(A,B){var D=this._parseDates(A);for(var C=0;C<D.length;++C){var E=D[C];if(E.length==2){if(E[0] instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,E,B);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,E,B);}}else{if(E.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,E,B);}}}},_addRenderer:function(B,C,A){var D=[B,C,A];this.renderStack.unshift(D);this._renderStack=this.renderStack.concat();},addMonthRenderer:function(B,A){this._addRenderer(YAHOO.widget.Calendar.MONTH,[B],A);},addWeekdayRenderer:function(B,A){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[B],A);},clearAllBodyCellStyles:function(A){for(var B=0;B<this.cells.length;++B){YAHOO.util.Dom.removeClass(this.cells[B],A);}},setMonth:function(C){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var B=this.cfg.getProperty(A);B.setMonth(parseInt(C,10));this.cfg.setProperty(A,B);},setYear:function(B){var A=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var C=this.cfg.getProperty(A);C.setFullYear(parseInt(B,10));this.cfg.setProperty(A,C);},getSelectedDates:function(){var C=[];var B=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var E=0;E<B.length;++E){var D=B[E];var A=YAHOO.widget.DateMath.getDate(D[0],D[1]-1,D[2]);C.push(A);}C.sort(function(G,F){return G-F;});return C;},hide:function(){if(this.beforeHideEvent.fire()){this.oDomContainer.style.display="none";this.hideEvent.fire();}},show:function(){if(this.beforeShowEvent.fire()){this.oDomContainer.style.display="block";this.showEvent.fire();}},browser:(function(){var A=navigator.userAgent.toLowerCase();if(A.indexOf("opera")!=-1){return"opera";}else{if(A.indexOf("msie 7")!=-1){return"ie7";}else{if(A.indexOf("msie")!=-1){return"ie";}else{if(A.indexOf("safari")!=-1){return"safari";}else{if(A.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}})(),toString:function(){return"Calendar "+this.id;}};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(C,A,B){if(arguments.length>0){this.init.apply(this,arguments);}};YAHOO.widget.CalendarGroup.prototype={init:function(D,B,C){var A=this._parseArgs(arguments);D=A.id;B=A.container;C=A.config;this.oDomContainer=YAHOO.util.Dom.get(B);if(!this.oDomContainer.id){this.oDomContainer.id=YAHOO.util.Dom.generateId();}if(!D){D=this.oDomContainer.id+"_t";}this.id=D;this.containerId=this.oDomContainer.id;this.initEvents();this.initStyles();this.pages=[];YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(C){this.cfg.applyConfig(C,true);}this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);this.showEvent.subscribe(this._fixWidth,this,true);}},setupConfig:function(){var A=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;this.cfg.addProperty(A.PAGES.key,{value:A.PAGES.value,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty(A.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(A.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(A.TITLE.key,{value:A.TITLE.value,handler:this.configTitle});this.cfg.addProperty(A.CLOSE.key,{value:A.CLOSE.value,handler:this.configClose});this.cfg.addProperty(A.IFRAME.key,{value:A.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.MINDATE.key,{value:A.MINDATE.value,handler:this.delegateConfig});this.cfg.addProperty(A.MAXDATE.key,{value:A.MAXDATE.value,handler:this.delegateConfig});this.cfg.addProperty(A.MULTI_SELECT.key,{value:A.MULTI_SELECT.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.START_WEEKDAY.key,{value:A.START_WEEKDAY.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.SHOW_WEEKDAYS.key,{value:A.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.SHOW_WEEK_HEADER.key,{value:A.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.SHOW_WEEK_FOOTER.key,{value:A.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});
+this.cfg.addProperty(A.HIDE_BLANK_WEEKS.key,{value:A.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(A.NAV_ARROW_LEFT.key,{value:A.NAV_ARROW_LEFT.value,handler:this.delegateConfig});this.cfg.addProperty(A.NAV_ARROW_RIGHT.key,{value:A.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});this.cfg.addProperty(A.MONTHS_SHORT.key,{value:A.MONTHS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(A.MONTHS_LONG.key,{value:A.MONTHS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(A.WEEKDAYS_1CHAR.key,{value:A.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});this.cfg.addProperty(A.WEEKDAYS_SHORT.key,{value:A.WEEKDAYS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(A.WEEKDAYS_MEDIUM.key,{value:A.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});this.cfg.addProperty(A.WEEKDAYS_LONG.key,{value:A.WEEKDAYS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(A.LOCALE_MONTHS.key,{value:A.LOCALE_MONTHS.value,handler:this.delegateConfig});this.cfg.addProperty(A.LOCALE_WEEKDAYS.key,{value:A.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});this.cfg.addProperty(A.DATE_DELIMITER.key,{value:A.DATE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(A.DATE_FIELD_DELIMITER.key,{value:A.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(A.DATE_RANGE_DELIMITER.key,{value:A.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(A.MY_MONTH_POSITION.key,{value:A.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_YEAR_POSITION.key,{value:A.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MD_MONTH_POSITION.key,{value:A.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MD_DAY_POSITION.key,{value:A.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_MONTH_POSITION.key,{value:A.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_DAY_POSITION.key,{value:A.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MDY_YEAR_POSITION.key,{value:A.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_MONTH_POSITION.key,{value:A.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_YEAR_POSITION.key,{value:A.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(A.MY_LABEL_MONTH_SUFFIX.key,{value:A.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});this.cfg.addProperty(A.MY_LABEL_YEAR_SUFFIX.key,{value:A.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});this.cfg.addProperty(A.NAV.key,{value:A.NAV.value,handler:this.configNavigator});},initEvents:function(){var C=this;var E="Event";var B=function(G,J,F){for(var I=0;I<C.pages.length;++I){var H=C.pages[I];H[this.type+E].subscribe(G,J,F);}};var A=function(F,I){for(var H=0;H<C.pages.length;++H){var G=C.pages[H];G[this.type+E].unsubscribe(F,I);}};var D=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(D.BEFORE_SELECT);this.beforeSelectEvent.subscribe=B;this.beforeSelectEvent.unsubscribe=A;this.selectEvent=new YAHOO.util.CustomEvent(D.SELECT);this.selectEvent.subscribe=B;this.selectEvent.unsubscribe=A;this.beforeDeselectEvent=new YAHOO.util.CustomEvent(D.BEFORE_DESELECT);this.beforeDeselectEvent.subscribe=B;this.beforeDeselectEvent.unsubscribe=A;this.deselectEvent=new YAHOO.util.CustomEvent(D.DESELECT);this.deselectEvent.subscribe=B;this.deselectEvent.unsubscribe=A;this.changePageEvent=new YAHOO.util.CustomEvent(D.CHANGE_PAGE);this.changePageEvent.subscribe=B;this.changePageEvent.unsubscribe=A;this.beforeRenderEvent=new YAHOO.util.CustomEvent(D.BEFORE_RENDER);this.beforeRenderEvent.subscribe=B;this.beforeRenderEvent.unsubscribe=A;this.renderEvent=new YAHOO.util.CustomEvent(D.RENDER);this.renderEvent.subscribe=B;this.renderEvent.unsubscribe=A;this.resetEvent=new YAHOO.util.CustomEvent(D.RESET);this.resetEvent.subscribe=B;this.resetEvent.unsubscribe=A;this.clearEvent=new YAHOO.util.CustomEvent(D.CLEAR);this.clearEvent.subscribe=B;this.clearEvent.unsubscribe=A;this.beforeShowEvent=new YAHOO.util.CustomEvent(D.BEFORE_SHOW);this.showEvent=new YAHOO.util.CustomEvent(D.SHOW);this.beforeHideEvent=new YAHOO.util.CustomEvent(D.BEFORE_HIDE);this.hideEvent=new YAHOO.util.CustomEvent(D.HIDE);this.beforeShowNavEvent=new YAHOO.util.CustomEvent(D.BEFORE_SHOW_NAV);this.showNavEvent=new YAHOO.util.CustomEvent(D.SHOW_NAV);this.beforeHideNavEvent=new YAHOO.util.CustomEvent(D.BEFORE_HIDE_NAV);this.hideNavEvent=new YAHOO.util.CustomEvent(D.HIDE_NAV);this.beforeRenderNavEvent=new YAHOO.util.CustomEvent(D.BEFORE_RENDER_NAV);this.renderNavEvent=new YAHOO.util.CustomEvent(D.RENDER_NAV);},configPages:function(K,J,G){var E=J[0];var C=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;var O="_";var L="groupcal";var N="first-of-type";var D="last-of-type";for(var B=0;B<E;++B){var M=this.id+O+B;var I=this.containerId+O+B;var H=this.cfg.getConfig();H.close=false;H.title=false;H.navigator=null;var A=this.constructChild(M,I,H);var F=A.cfg.getProperty(C);this._setMonthOnDate(F,F.getMonth()+B);A.cfg.setProperty(C,F);YAHOO.util.Dom.removeClass(A.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(A.oDomContainer,L);if(B===0){YAHOO.util.Dom.addClass(A.oDomContainer,N);}if(B==(E-1)){YAHOO.util.Dom.addClass(A.oDomContainer,D);}A.parent=this;A.index=B;this.pages[this.pages.length]=A;}},configPageDate:function(H,G,E){var C=G[0];var F;var D=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var B=0;B<this.pages.length;++B){var A=this.pages[B];if(B===0){F=A._parsePageDate(C);
+A.cfg.setProperty(D,F);}else{var I=new Date(F);this._setMonthOnDate(I,I.getMonth()+B);A.cfg.setProperty(D,I);}}},configSelected:function(C,A,E){var D=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;this.delegateConfig(C,A,E);var B=(this.pages.length>0)?this.pages[0].cfg.getProperty(D):[];this.cfg.setProperty(D,B,true);},delegateConfig:function(B,A,E){var F=A[0];var D;for(var C=0;C<this.pages.length;C++){D=this.pages[C];D.cfg.setProperty(B,F);}},setChildFunction:function(D,B){var A=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var C=0;C<A;++C){this.pages[C][D]=B;}},callChildFunction:function(F,B){var A=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var E=0;E<A;++E){var D=this.pages[E];if(D[F]){var C=D[F];C.call(D,B);}}},constructChild:function(D,B,C){var A=document.getElementById(B);if(!A){A=document.createElement("div");A.id=B;this.oDomContainer.appendChild(A);}return new YAHOO.widget.Calendar(D,B,C);},setMonth:function(E){E=parseInt(E,10);var F;var B=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var D=0;D<this.pages.length;++D){var C=this.pages[D];var A=C.cfg.getProperty(B);if(D===0){F=A.getFullYear();}else{A.setFullYear(F);}this._setMonthOnDate(A,E+D);C.cfg.setProperty(B,A);}},setYear:function(C){var B=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;C=parseInt(C,10);for(var E=0;E<this.pages.length;++E){var D=this.pages[E];var A=D.cfg.getProperty(B);if((A.getMonth()+1)==1&&E>0){C+=1;}D.setYear(C);}},render:function(){this.renderHeader();for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.render();}this.renderFooter();},select:function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.select(A);}return this.getSelectedDates();},selectCell:function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.selectCell(A);}return this.getSelectedDates();},deselect:function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.deselect(A);}return this.getSelectedDates();},deselectAll:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.deselectAll();}return this.getSelectedDates();},deselectCell:function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.deselectCell(A);}return this.getSelectedDates();},reset:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.reset();}},clear:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.clear();}},nextMonth:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.nextMonth();}},previousMonth:function(){for(var B=this.pages.length-1;B>=0;--B){var A=this.pages[B];A.previousMonth();}},nextYear:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.nextYear();}},previousYear:function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.previousYear();}},getSelectedDates:function(){var C=[];var B=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);for(var E=0;E<B.length;++E){var D=B[E];var A=YAHOO.widget.DateMath.getDate(D[0],D[1]-1,D[2]);C.push(A);}C.sort(function(G,F){return G-F;});return C;},addRenderer:function(A,B){for(var D=0;D<this.pages.length;++D){var C=this.pages[D];C.addRenderer(A,B);}},addMonthRenderer:function(D,A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.addMonthRenderer(D,A);}},addWeekdayRenderer:function(B,A){for(var D=0;D<this.pages.length;++D){var C=this.pages[D];C.addWeekdayRenderer(B,A);}},removeRenderers:function(){this.callChildFunction("removeRenderers");},renderHeader:function(){},renderFooter:function(){},addMonths:function(A){this.callChildFunction("addMonths",A);},subtractMonths:function(A){this.callChildFunction("subtractMonths",A);},addYears:function(A){this.callChildFunction("addYears",A);},subtractYears:function(A){this.callChildFunction("subtractYears",A);},getCalendarPage:function(D){var F=null;if(D){var G=D.getFullYear(),C=D.getMonth();var B=this.pages;for(var E=0;E<B.length;++E){var A=B[E].cfg.getProperty("pagedate");if(A.getFullYear()===G&&A.getMonth()===C){F=B[E];break;}}}return F;},_setMonthOnDate:function(C,D){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(D<0||D>11)){var B=YAHOO.widget.DateMath;var A=B.add(C,B.MONTH,D-C.getMonth());C.setTime(A.getTime());}else{C.setMonth(D);}},_fixWidth:function(){var A=0;for(var C=0;C<this.pages.length;++C){var B=this.pages[C];A+=B.oDomContainer.offsetWidth;}if(A>0){this.oDomContainer.style.width=A+"px";}},toString:function(){return"CalendarGroup "+this.id;}};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","configNavigator","createTitleBar","createCloseButton","removeTitleBar","removeCloseButton","hide","show","toDate","_parseArgs","browser");YAHOO.widget.CalendarGroup._DEFAULT_CONFIG=YAHOO.widget.Calendar._DEFAULT_CONFIG;YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES={key:"pages",value:2};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(C,A,B){this.init(C,A,B);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.widget.CalendarNavigator=function(A){this.init(A);};(function(){var A=YAHOO.widget.CalendarNavigator;A.CLASSES={NAV:"yui-cal-nav",NAV_VISIBLE:"yui-cal-nav-visible",MASK:"yui-cal-nav-mask",YEAR:"yui-cal-nav-y",MONTH:"yui-cal-nav-m",BUTTONS:"yui-cal-nav-b",BUTTON:"yui-cal-nav-btn",ERROR:"yui-cal-nav-e",YEAR_CTRL:"yui-cal-nav-yc",MONTH_CTRL:"yui-cal-nav-mc",INVALID:"yui-invalid",DEFAULT:"yui-default"};
+A._DEFAULT_CFG={strings:{month:"Month",year:"Year",submit:"Okay",cancel:"Cancel",invalidYear:"Year needs to be a number"},monthFormat:YAHOO.widget.Calendar.LONG,initialFocus:"year"};A.ID_SUFFIX="_nav";A.MONTH_SUFFIX="_month";A.YEAR_SUFFIX="_year";A.ERROR_SUFFIX="_error";A.CANCEL_SUFFIX="_cancel";A.SUBMIT_SUFFIX="_submit";A.YR_MAX_DIGITS=4;A.YR_MINOR_INC=1;A.YR_MAJOR_INC=10;A.UPDATE_DELAY=50;A.YR_PATTERN=/^\d+$/;A.TRIM=/^\s*(.*?)\s*$/;})();YAHOO.widget.CalendarNavigator.prototype={id:null,cal:null,navEl:null,maskEl:null,yearEl:null,monthEl:null,errorEl:null,submitEl:null,cancelEl:null,firstCtrl:null,lastCtrl:null,_doc:null,_year:null,_month:0,__rendered:false,init:function(A){var C=A.oDomContainer;this.cal=A;this.id=C.id+YAHOO.widget.CalendarNavigator.ID_SUFFIX;this._doc=C.ownerDocument;var B=YAHOO.env.ua.ie;this.__isIEQuirks=(B&&((B<=6)||(B===7&&this._doc.compatMode=="BackCompat")));},show:function(){var A=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeShowNavEvent.fire()){if(!this.__rendered){this.render();}this.clearErrors();this._updateMonthUI();this._updateYearUI();this._show(this.navEl,true);this.setInitialFocus();this.showMask();YAHOO.util.Dom.addClass(this.cal.oDomContainer,A.NAV_VISIBLE);this.cal.showNavEvent.fire();}},hide:function(){var A=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeHideNavEvent.fire()){this._show(this.navEl,false);this.hideMask();YAHOO.util.Dom.removeClass(this.cal.oDomContainer,A.NAV_VISIBLE);this.cal.hideNavEvent.fire();}},showMask:function(){this._show(this.maskEl,true);if(this.__isIEQuirks){this._syncMask();}},hideMask:function(){this._show(this.maskEl,false);},getMonth:function(){return this._month;},getYear:function(){return this._year;},setMonth:function(A){if(A>=0&&A<12){this._month=A;}this._updateMonthUI();},setYear:function(B){var A=YAHOO.widget.CalendarNavigator.YR_PATTERN;if(YAHOO.lang.isNumber(B)&&A.test(B+"")){this._year=B;}this._updateYearUI();},render:function(){this.cal.beforeRenderNavEvent.fire();if(!this.__rendered){this.createNav();this.createMask();this.applyListeners();this.__rendered=true;}this.cal.renderNavEvent.fire();},createNav:function(){var B=YAHOO.widget.CalendarNavigator;var C=this._doc;var D=C.createElement("div");D.className=B.CLASSES.NAV;var A=this.renderNavContents([]);D.innerHTML=A.join("");this.cal.oDomContainer.appendChild(D);this.navEl=D;this.yearEl=C.getElementById(this.id+B.YEAR_SUFFIX);this.monthEl=C.getElementById(this.id+B.MONTH_SUFFIX);this.errorEl=C.getElementById(this.id+B.ERROR_SUFFIX);this.submitEl=C.getElementById(this.id+B.SUBMIT_SUFFIX);this.cancelEl=C.getElementById(this.id+B.CANCEL_SUFFIX);if(YAHOO.env.ua.gecko&&this.yearEl&&this.yearEl.type=="text"){this.yearEl.setAttribute("autocomplete","off");}this._setFirstLastElements();},createMask:function(){var B=YAHOO.widget.CalendarNavigator.CLASSES;var A=this._doc.createElement("div");A.className=B.MASK;this.cal.oDomContainer.appendChild(A);this.maskEl=A;},_syncMask:function(){var B=this.cal.oDomContainer;if(B&&this.maskEl){var A=YAHOO.util.Dom.getRegion(B);YAHOO.util.Dom.setStyle(this.maskEl,"width",A.right-A.left+"px");YAHOO.util.Dom.setStyle(this.maskEl,"height",A.bottom-A.top+"px");}},renderNavContents:function(A){var D=YAHOO.widget.CalendarNavigator,E=D.CLASSES,B=A;B[B.length]="<div class=\""+E.MONTH+"\">";this.renderMonth(B);B[B.length]="</div>";B[B.length]="<div class=\""+E.YEAR+"\">";this.renderYear(B);B[B.length]="</div>";B[B.length]="<div class=\""+E.BUTTONS+"\">";this.renderButtons(B);B[B.length]="</div>";B[B.length]="<div class=\""+E.ERROR+"\" id=\""+this.id+D.ERROR_SUFFIX+"\"></div>";return B;},renderMonth:function(D){var G=YAHOO.widget.CalendarNavigator,H=G.CLASSES;var I=this.id+G.MONTH_SUFFIX,F=this.__getCfg("monthFormat"),A=this.cal.cfg.getProperty((F==YAHOO.widget.Calendar.SHORT)?"MONTHS_SHORT":"MONTHS_LONG"),E=D;if(A&&A.length>0){E[E.length]="<label for=\""+I+"\">";E[E.length]=this.__getCfg("month",true);E[E.length]="</label>";E[E.length]="<select name=\""+I+"\" id=\""+I+"\" class=\""+H.MONTH_CTRL+"\">";for(var B=0;B<A.length;B++){E[E.length]="<option value=\""+B+"\">";E[E.length]=A[B];E[E.length]="</option>";}E[E.length]="</select>";}return E;},renderYear:function(B){var E=YAHOO.widget.CalendarNavigator,F=E.CLASSES;var G=this.id+E.YEAR_SUFFIX,A=E.YR_MAX_DIGITS,D=B;D[D.length]="<label for=\""+G+"\">";D[D.length]=this.__getCfg("year",true);D[D.length]="</label>";D[D.length]="<input type=\"text\" name=\""+G+"\" id=\""+G+"\" class=\""+F.YEAR_CTRL+"\" maxlength=\""+A+"\"/>";return D;},renderButtons:function(A){var D=YAHOO.widget.CalendarNavigator.CLASSES;var B=A;B[B.length]="<span class=\""+D.BUTTON+" "+D.DEFAULT+"\">";B[B.length]="<button type=\"button\" id=\""+this.id+"_submit\">";B[B.length]=this.__getCfg("submit",true);B[B.length]="</button>";B[B.length]="</span>";B[B.length]="<span class=\""+D.BUTTON+"\">";B[B.length]="<button type=\"button\" id=\""+this.id+"_cancel\">";B[B.length]=this.__getCfg("cancel",true);B[B.length]="</button>";B[B.length]="</span>";return B;},applyListeners:function(){var B=YAHOO.util.Event;function A(){if(this.validate()){this.setYear(this._getYearFromUI());}}function C(){this.setMonth(this._getMonthFromUI());}B.on(this.submitEl,"click",this.submit,this,true);B.on(this.cancelEl,"click",this.cancel,this,true);B.on(this.yearEl,"blur",A,this,true);B.on(this.monthEl,"change",C,this,true);if(this.__isIEQuirks){YAHOO.util.Event.on(this.cal.oDomContainer,"resize",this._syncMask,this,true);}this.applyKeyListeners();},purgeListeners:function(){var A=YAHOO.util.Event;A.removeListener(this.submitEl,"click",this.submit);A.removeListener(this.cancelEl,"click",this.cancel);A.removeListener(this.yearEl,"blur");A.removeListener(this.monthEl,"change");if(this.__isIEQuirks){A.removeListener(this.cal.oDomContainer,"resize",this._syncMask);}this.purgeKeyListeners();},applyKeyListeners:function(){var D=YAHOO.util.Event;var A=YAHOO.env.ua;var C=(A.ie)?"keydown":"keypress";var B=(A.ie||A.opera)?"keydown":"keypress";D.on(this.yearEl,"keypress",this._handleEnterKey,this,true);
+D.on(this.yearEl,C,this._handleDirectionKeys,this,true);D.on(this.lastCtrl,B,this._handleTabKey,this,true);D.on(this.firstCtrl,B,this._handleShiftTabKey,this,true);},purgeKeyListeners:function(){var C=YAHOO.util.Event;var B=(YAHOO.env.ua.ie)?"keydown":"keypress";var A=(YAHOO.env.ua.ie||YAHOO.env.ua.opera)?"keydown":"keypress";C.removeListener(this.yearEl,"keypress",this._handleEnterKey);C.removeListener(this.yearEl,B,this._handleDirectionKeys);C.removeListener(this.lastCtrl,A,this._handleTabKey);C.removeListener(this.firstCtrl,A,this._handleShiftTabKey);},submit:function(){if(this.validate()){this.hide();this.setMonth(this._getMonthFromUI());this.setYear(this._getYearFromUI());var B=this.cal;var C=this;function D(){B.setYear(C.getYear());B.setMonth(C.getMonth());B.render();}var A=YAHOO.widget.CalendarNavigator.UPDATE_DELAY;if(A>0){window.setTimeout(D,A);}else{D();}}},cancel:function(){this.hide();},validate:function(){if(this._getYearFromUI()!==null){this.clearErrors();return true;}else{this.setYearError();this.setError(this.__getCfg("invalidYear",true));return false;}},setError:function(A){if(this.errorEl){this.errorEl.innerHTML=A;this._show(this.errorEl,true);}},clearError:function(){if(this.errorEl){this.errorEl.innerHTML="";this._show(this.errorEl,false);}},setYearError:function(){YAHOO.util.Dom.addClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID);},clearYearError:function(){YAHOO.util.Dom.removeClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID);},clearErrors:function(){this.clearError();this.clearYearError();},setInitialFocus:function(){var A=this.submitEl;var B=this.__getCfg("initialFocus");if(B&&B.toLowerCase){B=B.toLowerCase();if(B=="year"){A=this.yearEl;try{this.yearEl.select();}catch(C){}}else{if(B=="month"){A=this.monthEl;}}}if(A&&YAHOO.lang.isFunction(A.focus)){try{A.focus();}catch(C){}}},erase:function(){if(this.__rendered){this.purgeListeners();this.yearEl=null;this.monthEl=null;this.errorEl=null;this.submitEl=null;this.cancelEl=null;this.firstCtrl=null;this.lastCtrl=null;if(this.navEl){this.navEl.innerHTML="";}var B=this.navEl.parentNode;if(B){B.removeChild(this.navEl);}this.navEl=null;var A=this.maskEl.parentNode;if(A){A.removeChild(this.maskEl);}this.maskEl=null;this.__rendered=false;}},destroy:function(){this.erase();this._doc=null;this.cal=null;this.id=null;},_show:function(B,A){if(B){YAHOO.util.Dom.setStyle(B,"display",(A)?"block":"none");}},_getMonthFromUI:function(){if(this.monthEl){return this.monthEl.selectedIndex;}else{return 0;}},_getYearFromUI:function(){var B=YAHOO.widget.CalendarNavigator;var A=null;if(this.yearEl){var C=this.yearEl.value;C=C.replace(B.TRIM,"$1");if(B.YR_PATTERN.test(C)){A=parseInt(C,10);}}return A;},_updateYearUI:function(){if(this.yearEl&&this._year!==null){this.yearEl.value=this._year;}},_updateMonthUI:function(){if(this.monthEl){this.monthEl.selectedIndex=this._month;}},_setFirstLastElements:function(){this.firstCtrl=this.monthEl;this.lastCtrl=this.cancelEl;if(this.__isMac){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){this.firstCtrl=this.monthEl;this.lastCtrl=this.yearEl;}if(YAHOO.env.ua.gecko){this.firstCtrl=this.yearEl;this.lastCtrl=this.yearEl;}}},_handleEnterKey:function(B){var A=YAHOO.util.KeyListener.KEY;if(YAHOO.util.Event.getCharCode(B)==A.ENTER){YAHOO.util.Event.preventDefault(B);this.submit();}},_handleDirectionKeys:function(G){var F=YAHOO.util.Event;var A=YAHOO.util.KeyListener.KEY;var C=YAHOO.widget.CalendarNavigator;var D=(this.yearEl.value)?parseInt(this.yearEl.value,10):null;if(isFinite(D)){var B=false;switch(F.getCharCode(G)){case A.UP:this.yearEl.value=D+C.YR_MINOR_INC;B=true;break;case A.DOWN:this.yearEl.value=Math.max(D-C.YR_MINOR_INC,0);B=true;break;case A.PAGE_UP:this.yearEl.value=D+C.YR_MAJOR_INC;B=true;break;case A.PAGE_DOWN:this.yearEl.value=Math.max(D-C.YR_MAJOR_INC,0);B=true;break;default:break;}if(B){F.preventDefault(G);try{this.yearEl.select();}catch(G){}}}},_handleTabKey:function(C){var B=YAHOO.util.Event;var A=YAHOO.util.KeyListener.KEY;if(B.getCharCode(C)==A.TAB&&!C.shiftKey){try{B.preventDefault(C);this.firstCtrl.focus();}catch(C){}}},_handleShiftTabKey:function(C){var B=YAHOO.util.Event;var A=YAHOO.util.KeyListener.KEY;if(C.shiftKey&&B.getCharCode(C)==A.TAB){try{B.preventDefault(C);this.lastCtrl.focus();}catch(C){}}},__getCfg:function(D,B){var C=YAHOO.widget.CalendarNavigator._DEFAULT_CFG;var A=this.cal.cfg.getProperty("navigator");if(B){return(A!==true&&A.strings&&A.strings[D])?A.strings[D]:C.strings[D];}else{return(A!==true&&A[D])?A[D]:C[D];}},__isMac:(navigator.userAgent.toLowerCase().indexOf("macintosh")!=-1)};YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 0f554186af867f38d14c0dc7754ced3d298e6be3..9726102fdd6f034a940fb5306c40806e7dac96b1 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,25 +18,19 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-    
         }
-    
+
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -249,11 +243,11 @@ version: 2.3.0
                     !Lang.isUndefined(this.initialConfig[key])) {
     
                     this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
     
                 }
     
-                return true;
-    
             } else {
     
                 return false;
@@ -353,7 +347,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -381,37 +375,37 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-        
+
                 return true;
             } else {
                 return false;
@@ -459,13 +453,23 @@ version: 2.3.0
         */
         applyConfig: function (userConfig, init) {
         
-            var prop;
-        
+            var sKey,
+                oConfig;
+
             if (init) {
-                this.initialConfig = userConfig;
+                oConfig = {};
+                for (sKey in userConfig) {
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+                    }
+                }
+                this.initialConfig = oConfig;
             }
-            for (prop in userConfig) {
-                this.queueProperty(prop, userConfig[prop]);
+
+            for (sKey in userConfig) {
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+                    this.queueProperty(sKey, userConfig[sKey]);
+                }
             }
         },
         
@@ -533,19 +537,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -665,28 +662,20 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
@@ -758,7 +747,6 @@ YAHOO.widget.DateMath = {
                                var newMonth = date.getMonth() + amount;
                                var years = 0;
 
-
                                if (newMonth < 0) {
                                        while (newMonth < 0) {
                                                newMonth += 12;
@@ -770,23 +758,55 @@ YAHOO.widget.DateMath = {
                                                years += 1;
                                        }
                                }
-                               
+
                                d.setMonth(newMonth);
                                d.setFullYear(date.getFullYear() + years);
                                break;
                        case this.DAY:
-                               d.setDate(date.getDate() + amount);
+                               this._addDays(d, amount);
+                               // d.setDate(date.getDate() + amount);
                                break;
                        case this.YEAR:
                                d.setFullYear(date.getFullYear() + amount);
                                break;
                        case this.WEEK:
-                               d.setDate(date.getDate() + (amount * 7));
+                               this._addDays(d, (amount * 7));
+                               // d.setDate(date.getDate() + (amount * 7));
                                break;
                }
                return d;
        },
 
+       /**
+        * Private helper method to account for bug in Safari 2 (webkit < 420)
+        * when Date.setDate(n) is called with n less than -128 or greater than 127.
+        * <p>
+        * Fix approach and original findings are available here:
+        * http://brianary.blogspot.com/2006/03/safari-date-bug.html
+        * </p>
+        * @method _addDays
+        * @param {Date} d JavaScript date object
+        * @param {Number} nDays The number of days to add to the date object (can be negative)
+        * @private
+        */
+       _addDays : function(d, nDays) {
+               if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) {
+                       if (nDays < 0) {
+                               // Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127)
+                               for(var min = -128; nDays < min; nDays -= min) {
+                                       d.setDate(d.getDate() + min);
+                               }
+                       } else {
+                               // Ensure we don't go above 96 + 31 = 127
+                               for(var max = 96; nDays > max; nDays -= max) {
+                                       d.setDate(d.getDate() + max);
+                               }
+                       }
+                       // nDays should be remainder between -128 and 96
+               }
+               d.setDate(d.getDate() + nDays);
+       },
+
        /**
        * Subtracts the specified amount of time from the this instance.
        * @method subtract
@@ -854,7 +874,7 @@ YAHOO.widget.DateMath = {
        * @return {Date}        January 1 of the calendar year specified.
        */
        getJan1 : function(calendarYear) {
-               return new Date(calendarYear,0,1); 
+               return this.getDate(calendarYear,0,1);
        },
 
        /**
@@ -890,7 +910,7 @@ YAHOO.widget.DateMath = {
                date = this.clearTime(date);
                var nearestThurs = new Date(date.getTime() + (4 * this.ONE_DAY_MS) - ((date.getDay()) * this.ONE_DAY_MS));
 
-               var jan1 = new Date(nearestThurs.getFullYear(),0,1);
+               var jan1 = this.getDate(nearestThurs.getFullYear(),0,1);
                var dayOfYear = ((nearestThurs.getTime() - jan1.getTime()) / this.ONE_DAY_MS) - 1;
 
                var weekNum = Math.ceil((dayOfYear)/ 7);
@@ -934,7 +954,7 @@ YAHOO.widget.DateMath = {
        * @return {Date}                The JavaScript Date representing the first day of the month
        */
        findMonthStart : function(date) {
-               var start = new Date(date.getFullYear(), date.getMonth(), 1);
+               var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
                return start;
        },
 
@@ -960,14 +980,46 @@ YAHOO.widget.DateMath = {
        clearTime : function(date) {
                date.setHours(12,0,0,0);
                return date;
+       },
+
+       /**
+        * Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
+        * are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations 
+        * set the year to 19xx if a year (xx) which is less than 100 is provided.
+        * <p>
+        * <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
+        * arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
+        * </p>
+        * @method getDate
+        * @param {Number} y Year.
+        * @param {Number} m Month index from 0 (Jan) to 11 (Dec).
+        * @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
+        * @return {Date} The JavaScript date object with year, month, date set as provided.
+        */
+       getDate : function(y, m, d) {
+               var dt = null;
+               if (YAHOO.lang.isUndefined(d)) {
+                       d = 1;
+               }
+               if (y >= 100) {
+                       dt = new Date(y, m, d);
+               } else {
+                       dt = new Date();
+                       dt.setFullYear(y);
+                       dt.setMonth(m);
+                       dt.setDate(d);
+                       dt.setHours(0,0,0,0);
+               }
+               return dt;
        }
 };
 
 /**
-* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month  or multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
+* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month or
+* multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
 * @module    calendar
-* @title     Calendar
-* @namespace YAHOO.widget
+* @title    Calendar
+* @namespace  YAHOO.widget
 * @requires  yahoo,dom,event
 */
 
@@ -979,18 +1031,39 @@ YAHOO.widget.DateMath = {
 * <p>To construct the placeholder for the calendar widget, the code is as
 * follows:
 *      <xmp>
-*              <div id="cal1Container"></div>
+*              <div id="calContainer"></div>
+*      </xmp>
+* </p>
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The Calendar can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*      <xmp>
+*              var c = new YAHOO.widget.Calendar("calContainer", configOptions);
+*      </xmp>
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*              var c = new YAHOO.widget.Calendar(containerDiv, configOptions);
 *      </xmp>
 * </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the Calendar's ID will be set to "calContainer_t".
+* </p>
+* 
 * @namespace YAHOO.widget
 * @class Calendar
 * @constructor
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
+* @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
 */
 YAHOO.widget.Calendar = function(id, containerId, config) {
-       this.init(id, containerId, config);
+       this.init.apply(this, arguments);
 };
 
 /**
@@ -1147,7 +1220,8 @@ YAHOO.widget.Calendar._DEFAULT_CONFIG = {
        MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
        MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
        MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
-       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""}
+       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""},
+       NAV: {key:"navigator", value: null}
 };
 
 /**
@@ -1167,7 +1241,17 @@ YAHOO.widget.Calendar._EVENT_TYPES = {
        BEFORE_RENDER : "beforeRender",
        RENDER : "render",
        RESET : "reset",
-       CLEAR : "clear"
+       CLEAR : "clear",
+       BEFORE_HIDE : "beforeHide",
+       HIDE : "hide",
+       BEFORE_SHOW : "beforeShow",
+       SHOW : "show",
+       BEFORE_HIDE_NAV : "beforeHideNav",
+       HIDE_NAV : "hideNav",
+       BEFORE_SHOW_NAV : "beforeShowNav",
+       SHOW_NAV : "showNav",
+       BEFORE_RENDER_NAV : "beforeRenderNav",
+       RENDER_NAV : "renderNav"
 };
 
 /**
@@ -1200,6 +1284,7 @@ YAHOO.widget.Calendar._STYLES = {
        CSS_CONTAINER : "yui-calcontainer",
        CSS_NAV_LEFT : "calnavleft",
        CSS_NAV_RIGHT : "calnavright",
+       CSS_NAV : "calnav",
        CSS_CLOSE : "calclose",
        CSS_CELL_TOP : "calcelltop",
        CSS_CELL_LEFT : "calcellleft",
@@ -1243,7 +1328,7 @@ YAHOO.widget.Calendar.prototype = {
        * @type HTMLTableCellElement[]
        */
        cells : null,
-       
+
        /**
        * The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].
        * @property cellDates
@@ -1252,12 +1337,19 @@ YAHOO.widget.Calendar.prototype = {
        cellDates : null,
 
        /**
-       * The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.
+       * The id that uniquely identifies this Calendar.
        * @property id
        * @type String
        */
        id : null,
 
+       /**
+       * The unique id associated with the Calendar's container
+       * @property containerId
+       * @type String
+       */
+       containerId: null,
+
        /**
        * The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered.
        * @property oDomContainer
@@ -1287,6 +1379,14 @@ YAHOO.widget.Calendar.prototype = {
        */
        _renderStack : null,
 
+       /**
+       * A reference to the CalendarNavigator instance created for this Calendar.
+       * Will be null if the "navigator" configuration property has not been set
+       * @property oNavigator
+       * @type CalendarNavigator
+       */
+       oNavigator : null,
+
        /**
        * The private list of initially selected dates.
        * @property _selectedDates
@@ -1300,3652 +1400,5392 @@ YAHOO.widget.Calendar.prototype = {
        * @property domEventMap
        * @type Object
        */
-       domEventMap : null
-};
-
-
-
-/**
-* Initializes the Calendar widget.
-* @method init
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
-       this.initEvents();
-       this.today = new Date();
-       YAHOO.widget.DateMath.clearTime(this.today);
-
-       this.id = id;
-       this.oDomContainer = document.getElementById(containerId);
-
-       /**
-       * The Config object used to hold the configuration variables for the Calendar
-       * @property cfg
-       * @type YAHOO.util.Config
-       */
-       this.cfg = new YAHOO.util.Config(this);
-       
-       /**
-       * The local object which contains the Calendar's options
-       * @property Options
-       * @type Object
-       */
-       this.Options = {};
-
-       /**
-       * The local object which contains the Calendar's locale settings
-       * @property Locale
-       * @type Object
-       */
-       this.Locale = {};
-
-       this.initStyles();
-
-       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);  
-       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
-       
-       this.cellDates = [];
-       this.cells = [];
-       this.renderStack = [];
-       this._renderStack = [];
-
-       this.setupConfig();
-       
-       if (config) {
-               this.cfg.applyConfig(config, true);
-       }
-       
-       this.cfg.fireQueue();
-};
-
-/**
-* Default Config listener for the iframe property. If the iframe config property is set to true, 
-* renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
-* 
-* @method configIframe
-*/
-YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
-       var useIframe = args[0];
-
-       if (!this.parent) {
-               if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
-                       if (useIframe) {
-                               var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
-                               
-                               if (pos == "absolute" || pos == "relative") {
-                                       
-                                       if (!YAHOO.util.Dom.inDocument(this.iframe)) {
-                                               this.iframe = document.createElement("iframe");
-                                               this.iframe.src = "javascript:false;";
-
-                                               YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
-
-                                               if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
-                                                       YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
-                                               }
-
-                                               this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
-                                       }
-                               }
-                       } else {
-                               if (this.iframe) {
-                                       if (this.iframe.parentNode) {
-                                               this.iframe.parentNode.removeChild(this.iframe);
+       domEventMap : null,
+
+       /**
+        * Protected helper used to parse Calendar constructor/init arguments.
+        *
+        * As of 2.4.0, Calendar supports a simpler constructor 
+        * signature. This method reconciles arguments
+        * received in the pre 2.4.0 and 2.4.0 formats.
+        * 
+        * @protected
+        * @method _parseArgs
+        * @param {Array} Function "arguments" array
+        * @return {Object} Object with id, container, config properties containing
+        * the reconciled argument values.
+        **/
+       _parseArgs : function(args) {
+               /*
+                  2.4.0 Constructors signatures
+
+                  new Calendar(String)
+                  new Calendar(HTMLElement)
+                  new Calendar(String, ConfigObject)
+                  new Calendar(HTMLElement, ConfigObject)
+
+                  Pre 2.4.0 Constructor signatures
+
+                  new Calendar(String, String)
+                  new Calendar(String, HTMLElement)
+                  new Calendar(String, String, ConfigObject)
+                  new Calendar(String, HTMLElement, ConfigObject)
+                */
+               var nArgs = {id:null, container:null, config:null};
+
+               if (args && args.length && args.length > 0) {
+                       switch (args.length) {
+                               case 1:
+                                       nArgs.id = null;
+                                       nArgs.container = args[0];
+                                       nArgs.config = null;
+                                       break;
+                               case 2:
+                                       if (YAHOO.lang.isObject(args[1]) && !args[1].tagName && !(args[1] instanceof String)) {
+                                               nArgs.id = null;
+                                               nArgs.container = args[0];
+                                               nArgs.config = args[1];
+                                       } else {
+                                               nArgs.id = args[0];
+                                               nArgs.container = args[1];
+                                               nArgs.config = null;
                                        }
-                                       this.iframe = null;
-                               }
+                                       break;
+                               default: // 3+
+                                       nArgs.id = args[0];
+                                       nArgs.container = args[1];
+                                       nArgs.config = args[2];
+                                       break;
                        }
+               } else {
                }
-       }
-};
+               return nArgs;
+       },
 
-/**
-* Default handler for the "title" property
-* @method configTitle
-*/
-YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
-       var title = args[0];
-       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
-       
-       var titleDiv;
+       /**
+       * Initializes the Calendar widget.
+       * @method init
+       *
+       * @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+       * @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+       * @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
+       */
+       init : function(id, container, config) {
+               // Normalize 2.4.0, pre 2.4.0 args
+               var nArgs = this._parseArgs(arguments);
 
-       if (title && title !== "") {
-               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
-               titleDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
-               titleDiv.innerHTML = title;
-               this.oDomContainer.insertBefore(titleDiv, this.oDomContainer.firstChild);
-               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-       } else {
-               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+               id = nArgs.id;
+               container = nArgs.container;
+               config = nArgs.config;
+
+               this.oDomContainer = YAHOO.util.Dom.get(container);
 
-               if (titleDiv) {
-                       YAHOO.util.Event.purgeElement(titleDiv);
-                       this.oDomContainer.removeChild(titleDiv);
+               if (!this.oDomContainer.id) {
+                       this.oDomContainer.id = YAHOO.util.Dom.generateId();
                }
-               if (! close) {
-                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
+               if (!id) {
+                       id = this.oDomContainer.id + "_t";
                }
-       }
-};
 
-/**
-* Default handler for the "close" property
-* @method configClose
-*/
-YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
-       var close = args[0];
-       var title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
-       
-       var DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
+               this.id = id;
+               this.containerId = this.oDomContainer.id;
 
-       var linkClose;
+               this.initEvents();
 
-       if (close === true) {
-               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");
-               linkClose.href = "#";
-               linkClose.className = "link-close";
-               YAHOO.util.Event.addListener(linkClose, "click", function(e, cal) {cal.hide(); YAHOO.util.Event.preventDefault(e); }, this);
-               
-               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       var imgClose = document.createElement("img");
-                       imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
-                       imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;
-                       linkClose.appendChild(imgClose);
-               } else {
-                       linkClose.innerHTML = '<span class="' + YAHOO.widget.CalendarGroup.CSS_2UPCLOSE + ' ' + this.Style.CSS_CLOSE + '"></span>';
-               }
-               
-               this.oDomContainer.appendChild(linkClose);
-               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-       } else {
-               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
-               if (linkClose) {
-                       YAHOO.util.Event.purgeElement(linkClose);
-                       this.oDomContainer.removeChild(linkClose);
-               }
-               if (! title || title === "") {
-                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
-               }
-       }
-};
+               this.today = new Date();
+               YAHOO.widget.DateMath.clearTime(this.today);
 
-/**
-* Initializes Calendar's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.Calendar.prototype.initEvents = function() {
+               /**
+               * The Config object used to hold the configuration variables for the Calendar
+               * @property cfg
+               * @type YAHOO.util.Config
+               */
+               this.cfg = new YAHOO.util.Config(this);
 
-       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+               /**
+               * The local object which contains the Calendar's options
+               * @property Options
+               * @type Object
+               */
+               this.Options = {};
 
-       /**
-       * Fired before a selection is made
-       * @event beforeSelectEvent
-       */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+               /**
+               * The local object which contains the Calendar's locale settings
+               * @property Locale
+               * @type Object
+               */
+               this.Locale = {};
 
-       /**
-       * Fired when a selection is made
-       * @event selectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+               this.initStyles();
 
-       /**
-       * Fired before a selection is made
-       * @event beforeDeselectEvent
-       */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+               YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);
+               YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
 
-       /**
-       * Fired when a selection is made
-       * @event deselectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+               this.cellDates = [];
+               this.cells = [];
+               this.renderStack = [];
+               this._renderStack = [];
 
-       /**
-       * Fired when the Calendar page is changed
-       * @event changePageEvent
-       */
-       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+               this.setupConfig();
 
-       /**
-       * Fired before the Calendar is rendered
-       * @event beforeRenderEvent
-       */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+               if (config) {
+                       this.cfg.applyConfig(config, true);
+               }
 
-       /**
-       * Fired when the Calendar is rendered
-       * @event renderEvent
-       */
-       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+               this.cfg.fireQueue();
+       },
 
        /**
-       * Fired when the Calendar is reset
-       * @event resetEvent
+       * Default Config listener for the iframe property. If the iframe config property is set to true, 
+       * renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
+       * 
+       * @method configIframe
        */
-       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+       configIframe : function(type, args, obj) {
+               var useIframe = args[0];
+       
+               if (!this.parent) {
+                       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
+                               if (useIframe) {
+                                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+                                       
+                                       if (pos == "absolute" || pos == "relative") {
+                                               
+                                               if (!YAHOO.util.Dom.inDocument(this.iframe)) {
+                                                       this.iframe = document.createElement("iframe");
+                                                       this.iframe.src = "javascript:false;";
+       
+                                                       YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
+       
+                                                       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+                                                               YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
+                                                       }
+       
+                                                       this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
+                                               }
+                                       }
+                               } else {
+                                       if (this.iframe) {
+                                               if (this.iframe.parentNode) {
+                                                       this.iframe.parentNode.removeChild(this.iframe);
+                                               }
+                                               this.iframe = null;
+                                       }
+                               }
+                       }
+               }
+       },
 
        /**
-       * Fired when the Calendar is cleared
-       * @event clearEvent
+       * Default handler for the "title" property
+       * @method configTitle
        */
-       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
-
-       this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
-       this.selectEvent.subscribe(this.onSelect, this, true);
-       this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
-       this.deselectEvent.subscribe(this.onDeselect, this, true);
-       this.changePageEvent.subscribe(this.onChangePage, this, true);
-       this.renderEvent.subscribe(this.onRender, this, true);
-       this.resetEvent.subscribe(this.onReset, this, true);
-       this.clearEvent.subscribe(this.onClear, this, true);
-};
-
-/**
-* The default event function that is attached to a date link within a calendar cell
-* when the calendar is rendered.
-* @method doSelectCell
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
-       var cell,index,d,date;
-
-       var target = YAHOO.util.Event.getTarget(e);
-       var tagName = target.tagName.toLowerCase();
-       var defSelector = false;
-
-       while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+       configTitle : function(type, args, obj) {
+               var title = args[0];
 
-               if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
-                       defSelector = true;     
-               }
-
-               target = target.parentNode;
-               tagName = target.tagName.toLowerCase(); 
-               if (tagName == "html") {
-                       return;
+               // "" disables title bar
+               if (title) {
+                       this.createTitleBar(title);
+               } else {
+                       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
+                       if (!close) {
+                               this.removeTitleBar();
+                       } else {
+                               this.createTitleBar("&#160;");
+                       }
                }
-       }
-
-       if (defSelector) {
-               // Stop link href navigation for default renderer
-               YAHOO.util.Event.preventDefault(e);
-       }
-
-       cell = target;
-
-       if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
-               index = cell.id.split("cell")[1];
-               d = cal.cellDates[index];
-               date = new Date(d[0],d[1]-1,d[2]);
+       },
        
-               var link;
-
-               if (cal.Options.MULTI_SELECT) {
-                       link = cell.getElementsByTagName("a")[0];
-                       if (link) {
-                               link.blur();
+       /**
+       * Default handler for the "close" property
+       * @method configClose
+       */
+       configClose : function(type, args, obj) {
+               var close = args[0],
+                       title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
+       
+               if (close) {
+                       if (!title) {
+                               this.createTitleBar("&#160;");
                        }
-
-                       var cellDate = cal.cellDates[index];
-                       var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
-
-                       if (cellDateIndex > -1) {       
-                               cal.deselectCell(index);
-                       } else {
-                               cal.selectCell(index);
-                       }       
-
+                       this.createCloseButton();
                } else {
-                       link = cell.getElementsByTagName("a")[0];
-                       if (link) {
-                               link.blur();
+                       this.removeCloseButton();
+                       if (!title) {
+                               this.removeTitleBar();
                        }
-                       cal.selectCell(index);
                }
-       }
-};
-
-/**
-* The event that is executed when the user hovers over a cell
-* @method doCellMouseOver
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOver = function(e, cal) {
-       var target;
-       if (e) {
-               target = YAHOO.util.Event.getTarget(e);
-       } else {
-               target = this;
-       }
-
-       while (target.tagName.toLowerCase() != "td") {
-               target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
-                       return;
-               }
-       }
-
-       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-               YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
-       }
-};
-
-/**
-* The event that is executed when the user moves the mouse out of a cell
-* @method doCellMouseOut
-* @param {DOMEvent} e  The event
-* @param {Calendar} cal        A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {
-       var target;
-       if (e) {
-               target = YAHOO.util.Event.getTarget(e);
-       } else {
-               target = this;
-       }
-
-       while (target.tagName.toLowerCase() != "td") {
-               target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
-                       return;
-               }
-       }
-
-       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-               YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
-       }
-};
-
-YAHOO.widget.Calendar.prototype.setupConfig = function() {
-
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-       /**
-       * The month/year representing the current visible Calendar date (mm/yyyy)
-       * @config pagedate
-       * @type String
-       * @default today's date
-       */
-       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
-
-       /**
-       * The date or range of dates representing the current Calendar selection
-       * @config selected
-       * @type String
-       * @default []
-       */
-       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
-
-       /**
-       * The title to display above the Calendar's month header
-       * @config title
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
-
-       /**
-       * Whether or not a close button should be displayed for this Calendar
-       * @config close
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
-
-       /**
-       * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
-       * enabled if required.
-       * 
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all other browsers
-       */
-       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
-
-       /**
-       * The minimum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config mindate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
-
-       /**
-       * The maximum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config maxdate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
-
-
-       // Options properties
-
-       /**
-       * True if the Calendar should allow multiple selections. False by default.
-       * @config MULTI_SELECT
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * The weekday the week begins on. Default is 0 (Sunday).
-       * @config START_WEEKDAY
-       * @type number
-       * @default 0
-       */
-       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
-
-       /**
-       * True if the Calendar should show weekday labels. True by default.
-       * @config SHOW_WEEKDAYS
-       * @type Boolean
-       * @default true
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
-
-       /**
-       * True if the Calendar should show week row headers. False by default.
-       * @config SHOW_WEEK_HEADER
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * True if the Calendar should show week row footers. False by default.
-       * @config SHOW_WEEK_FOOTER
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
-       /**
-       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-       * @config HIDE_BLANK_WEEKS
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * The image that should be used for the left navigation arrow.
-       * @config NAV_ARROW_LEFT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
-
-       /**
-       * The image that should be used for the right navigation arrow.
-       * @config NAV_ARROW_RIGHT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
-
-       // Locale properties
-
-       /**
-       * The short month labels for the current locale.
-       * @config MONTHS_SHORT
-       * @type String[]
-       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-       */
-       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
-       
-       /**
-       * The long month labels for the current locale.
-       * @config MONTHS_LONG
-       * @type String[]
-       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-       */      
-       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
-       
-       /**
-       * The 1-character weekday labels for the current locale.
-       * @config WEEKDAYS_1CHAR
-       * @type String[]
-       * @default ["S", "M", "T", "W", "T", "F", "S"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
-       
-       /**
-       * The short weekday labels for the current locale.
-       * @config WEEKDAYS_SHORT
-       * @type String[]
-       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
-       
-       /**
-       * The medium weekday labels for the current locale.
-       * @config WEEKDAYS_MEDIUM
-       * @type String[]
-       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
-       
-       /**
-       * The long weekday labels for the current locale.
-       * @config WEEKDAYS_LONG
-       * @type String[]
-       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-       */      
-       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
-
-       /**
-       * Refreshes the locale values used to build the Calendar.
-       * @method refreshLocale
-       * @private
-       */
-       var refreshLocale = function() {
-               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-       };
-
-       this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
-       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
-       
-       /**
-       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-       * @config LOCALE_MONTHS
-       * @type String
-       * @default "long"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
-       
-       /**
-       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-       * @config LOCALE_WEEKDAYS
-       * @type String
-       * @default "short"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
-
-       /**
-       * The value used to delimit individual dates in a date string passed to various Calendar functions.
-       * @config DATE_DELIMITER
-       * @type String
-       * @default ","
-       */      
-       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The value used to delimit date fields in a date string passed to various Calendar functions.
-       * @config DATE_FIELD_DELIMITER
-       * @type String
-       * @default "/"
-       */      
-       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The value used to delimit date ranges in a date string passed to various Calendar functions.
-       * @config DATE_RANGE_DELIMITER
-       * @type String
-       * @default "-"
-       */
-       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
-
-       /**
-       * The position of the month in a month/year date string
-       * @config MY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in a month/year date string
-       * @config MY_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the month in a month/day date string
-       * @config MD_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the day in a month/year date string
-       * @config MD_DAY_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the month in a month/day/year date string
-       * @config MDY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the day in a month/day/year date string
-       * @config MDY_DAY_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in a month/day/year date string
-       * @config MDY_YEAR_POSITION
-       * @type Number
-       * @default 3
-       */
-       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in the month year label string used as the Calendar header
-       * @config MY_LABEL_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-       /**
-       * The position of the year in the month year label string used as the Calendar header
-       * @config MY_LABEL_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       },
        
        /**
-       * The suffix used after the month when rendering the Calendar header
-       * @config MY_LABEL_MONTH_SUFFIX
-       * @type String
-       * @default " "
+       * Initializes Calendar's built-in CustomEvents
+       * @method initEvents
        */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+       initEvents : function() {
        
-       /**
-       * The suffix used after the year when rendering the Calendar header
-       * @config MY_LABEL_YEAR_SUFFIX
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
-};
-
-/**
-* The default handler for the "pagedate" property
-* @method configPageDate
-*/
-YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
-       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
-};
-
-/**
-* The default handler for the "mindate" property
-* @method configMinDate
-*/
-YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
-       var val = args[0];
-       if (YAHOO.lang.isString(val)) {
-               val = this._parseDate(val);
-               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, new Date(val[0],(val[1]-1),val[2]));
-       }
-};
-
-/**
-* The default handler for the "maxdate" property
-* @method configMaxDate
-*/
-YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
-       var val = args[0];
-       if (YAHOO.lang.isString(val)) {
-               val = this._parseDate(val);
-               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, new Date(val[0],(val[1]-1),val[2]));
-       }
-};
-
-/**
-* The default handler for the "selected" property
-* @method configSelected
-*/
-YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
-       var selected = args[0];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
        
-       if (selected) {
-               if (YAHOO.lang.isString(selected)) {
-                       this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
-               } 
-       }
-       if (! this._selectedDates) {
-               this._selectedDates = this.cfg.getProperty(cfgSelected);
-       }
-};
-
-/**
-* The default handler for all configuration options properties
-* @method configOptions
-*/
-YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
-       this.Options[type.toUpperCase()] = args[0];
-};
-
-/**
-* The default handler for all configuration locale properties
-* @method configLocale
-*/
-YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.Locale[type.toUpperCase()] = args[0];
-
-       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-};
-
-/**
-* The default handler for all configuration locale field length properties
-* @method configLocaleValues
-*/
-YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
-
-       type = type.toLowerCase();
-       var val = args[0];
-
-       switch (type) {
-               case defCfg.LOCALE_MONTHS.key:
-                       switch (val) {
-                               case YAHOO.widget.Calendar.SHORT:
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.LONG:
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
-                                       break;
-                       }
-                       break;
-               case defCfg.LOCALE_WEEKDAYS.key:
-                       switch (val) {
-                               case YAHOO.widget.Calendar.ONE_CHAR:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.SHORT:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.MEDIUM:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
-                                       break;
-                               case YAHOO.widget.Calendar.LONG:
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
-                                       break;
-                       }
-                       
-                       var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
-
-                       if (START_WEEKDAY > 0) {
-                               for (var w=0;w<START_WEEKDAY;++w) {
-                                       this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
-                               }
-                       }
-                       break;
-       }
-};
-
-/**
-* Defines the style constants for the Calendar
-* @method initStyles
-*/
-YAHOO.widget.Calendar.prototype.initStyles = function() {
-
-       var defStyle = YAHOO.widget.Calendar._STYLES;
-
-       this.Style = {
-               /**
-               * @property Style.CSS_ROW_HEADER
-               */
-               CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
-               /**
-               * @property Style.CSS_ROW_FOOTER
-               */
-               CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
-               /**
-               * @property Style.CSS_CELL
-               */
-               CSS_CELL : defStyle.CSS_CELL,
-               /**
-               * @property Style.CSS_CELL_SELECTOR
-               */
-               CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
-               /**
-               * @property Style.CSS_CELL_SELECTED
-               */
-               CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
-               /**
-               * @property Style.CSS_CELL_SELECTABLE
-               */
-               CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
-               /**
-               * @property Style.CSS_CELL_RESTRICTED
-               */
-               CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
-               /**
-               * @property Style.CSS_CELL_TODAY
-               */
-               CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
-               /**
-               * @property Style.CSS_CELL_OOM
-               */
-               CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
-               /**
-               * @property Style.CSS_CELL_OOB
-               */
-               CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
-               /**
-               * @property Style.CSS_HEADER
-               */
-               CSS_HEADER : defStyle.CSS_HEADER,
-               /**
-               * @property Style.CSS_HEADER_TEXT
-               */
-               CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
                /**
-               * @property Style.CSS_BODY
+               * Fired before a selection is made
+               * @event beforeSelectEvent
                */
-               CSS_BODY : defStyle.CSS_BODY,
+               this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+       
                /**
-               * @property Style.CSS_WEEKDAY_CELL
+               * Fired when a selection is made
+               * @event selectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
                */
-               CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+               this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+       
                /**
-               * @property Style.CSS_WEEKDAY_ROW
+               * Fired before a selection is made
+               * @event beforeDeselectEvent
                */
-               CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+               this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+       
                /**
-               * @property Style.CSS_FOOTER
+               * Fired when a selection is made
+               * @event deselectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
                */
-               CSS_FOOTER : defStyle.CSS_FOOTER,
+               this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+       
                /**
-               * @property Style.CSS_CALENDAR
+               * Fired when the Calendar page is changed
+               * @event changePageEvent
                */
-               CSS_CALENDAR : defStyle.CSS_CALENDAR,
+               this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+       
                /**
-               * @property Style.CSS_SINGLE
+               * Fired before the Calendar is rendered
+               * @event beforeRenderEvent
                */
-               CSS_SINGLE : defStyle.CSS_SINGLE,
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+       
                /**
-               * @property Style.CSS_CONTAINER
+               * Fired when the Calendar is rendered
+               * @event renderEvent
                */
-               CSS_CONTAINER : defStyle.CSS_CONTAINER,
+               this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+       
                /**
-               * @property Style.CSS_NAV_LEFT
+               * Fired when the Calendar is reset
+               * @event resetEvent
                */
-               CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+               this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+       
                /**
-               * @property Style.CSS_NAV_RIGHT
+               * Fired when the Calendar is cleared
+               * @event clearEvent
                */
-               CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+               this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+       
                /**
-               * @property Style.CSS_CLOSE
+               * Fired just before the Calendar is to be shown
+               * @event beforeShowEvent
                */
-               CSS_CLOSE : defStyle.CSS_CLOSE,
+               this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+       
                /**
-               * @property Style.CSS_CELL_TOP
+               * Fired after the Calendar is shown
+               * @event showEvent
                */
-               CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+               this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+       
                /**
-               * @property Style.CSS_CELL_LEFT
+               * Fired just before the Calendar is to be hidden
+               * @event beforeHideEvent
                */
-               CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+               this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+       
                /**
-               * @property Style.CSS_CELL_RIGHT
+               * Fired after the Calendar is hidden
+               * @event hideEvent
                */
-               CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+               this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
+
                /**
-               * @property Style.CSS_CELL_BOTTOM
+               * Fired just before the CalendarNavigator is to be shown
+               * @event beforeShowNavEvent
                */
-               CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+               this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HOVER
+               * Fired after the CalendarNavigator is shown
+               * @event showNavEvent
                */
-               CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+               this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT1
+               * Fired just before the CalendarNavigator is to be hidden
+               * @event beforeHideNavEvent
                */
-               CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+               this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+       
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT2
+               * Fired after the CalendarNavigator is hidden
+               * @event hideNavEvent
                */
-               CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+               this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
+
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT3
+               * Fired just before the CalendarNavigator is to be rendered
+               * @event beforeRenderNavEvent
                */
-               CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+               this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
+
                /**
-               * @property Style.CSS_CELL_HIGHLIGHT4
+               * Fired after the CalendarNavigator is rendered
+               * @event renderNavEvent
                */
-               CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
-       };
-};
+               this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+
+               this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
+               this.selectEvent.subscribe(this.onSelect, this, true);
+               this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
+               this.deselectEvent.subscribe(this.onDeselect, this, true);
+               this.changePageEvent.subscribe(this.onChangePage, this, true);
+               this.renderEvent.subscribe(this.onRender, this, true);
+               this.resetEvent.subscribe(this.onReset, this, true);
+               this.clearEvent.subscribe(this.onClear, this, true);
+       },
+       
+       /**
+       * The default event function that is attached to a date link within a calendar cell
+       * when the calendar is rendered.
+       * @method doSelectCell
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doSelectCell : function(e, cal) {
+               var cell,index,d,date;
 
-/**
-* Builds the date label that will be displayed in the calendar header or
-* footer, depending on configuration.
-* @method buildMonthLabel
-* @return      {String}        The formatted calendar month label
-*/
-YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
-       var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+               var target = YAHOO.util.Event.getTarget(e);
+               var tagName = target.tagName.toLowerCase();
+               var defSelector = false;
 
-       var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
-       var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
+               while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
 
-       if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
-               return yearLabel + monthLabel;
-       } else {
-               return monthLabel + yearLabel;
-       }
-};
+                       if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
+                               defSelector = true;     
+                       }
 
-/**
-* Builds the date digit that will be displayed in calendar cells
-* @method buildDayLabel
-* @param {Date}        workingDate     The current working date
-* @return      {String}        The formatted day label
-*/
-YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
-       return workingDate.getDate();
-};
+                       target = target.parentNode;
+                       tagName = target.tagName.toLowerCase();
+                       // TODO: No need to go all the way up to html.
+                       if (tagName == "html") {
+                               return;
+                       }
+               }
 
-/**
-* Renders the calendar header.
-* @method renderHeader
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
-       var colSpan = 7;
-       
-       var DEPR_NAV_LEFT = "us/tr/callt.gif";
-       var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               if (defSelector) {
+                       // Stop link href navigation for default renderer
+                       YAHOO.util.Event.preventDefault(e);
+               }
        
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-               colSpan += 1;
-       }
+               cell = target;
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-               colSpan += 1;
-       }
-
-       html[html.length] = "<thead>";
-       html[html.length] =             "<tr>";
-       html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
-       html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';
+               if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
+                       index = cell.id.split("cell")[1];
+                       d = cal.cellDates[index];
+                       date = YAHOO.widget.DateMath.getDate(d[0],d[1]-1,d[2]);
+               
+                       var link;
 
-       var renderLeft, renderRight = false;
+                       if (cal.Options.MULTI_SELECT) {
+                               link = cell.getElementsByTagName("a")[0];
+                               if (link) {
+                                       link.blur();
+                               }
 
-       if (this.parent) {
-               if (this.index === 0) {
-                       renderLeft = true;
-               }
-               if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
-                       renderRight = true;
-               }
-       } else {
-               renderLeft = true;
-               renderRight = true;
-       }
+                               var cellDate = cal.cellDates[index];
+                               var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
 
-       var cal = this.parent || this;
-       
-       if (renderLeft) {
-               var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
-               // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
-               if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
-               }
-               var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
-               html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
-       }
-       
-       html[html.length] = this.buildMonthLabel();
+                               if (cellDateIndex > -1) {       
+                                       cal.deselectCell(index);
+                               } else {
+                                       cal.selectCell(index);
+                               }       
        
-       if (renderRight) {
-               var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
-               if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-                       rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+                       } else {
+                               link = cell.getElementsByTagName("a")[0];
+                               if (link) {
+                                       link.blur();
+                               }
+                               cal.selectCell(index);
+                       }
                }
-               var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
-               html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
-       }
-
-       html[html.length] =     '</div>\n</th>\n</tr>';
+       },
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
-               html = this.buildWeekdays(html);
-       }
-       
-       html[html.length] = '</thead>';
+       /**
+       * The event that is executed when the user hovers over a cell
+       * @method doCellMouseOver
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doCellMouseOver : function(e, cal) {
+               var target;
+               if (e) {
+                       target = YAHOO.util.Event.getTarget(e);
+               } else {
+                       target = this;
+               }
 
-       return html;
-};
+               while (target.tagName && target.tagName.toLowerCase() != "td") {
+                       target = target.parentNode;
+                       if (!target.tagName || target.tagName.toLowerCase() == "html") {
+                               return;
+                       }
+               }
 
-/**
-* Renders the Calendar's weekday headers.
-* @method buildWeekdays
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
+               if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+                       YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
+               }
+       },
 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       /**
+       * The event that is executed when the user moves the mouse out of a cell
+       * @method doCellMouseOut
+       * @param {DOMEvent} e   The event
+       * @param {Calendar} cal A reference to the calendar passed by the Event utility
+       */
+       doCellMouseOut : function(e, cal) {
+               var target;
+               if (e) {
+                       target = YAHOO.util.Event.getTarget(e);
+               } else {
+                       target = this;
+               }
 
-       html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
+               while (target.tagName && target.tagName.toLowerCase() != "td") {
+                       target = target.parentNode;
+                       if (!target.tagName || target.tagName.toLowerCase() == "html") {
+                               return;
+                       }
+               }
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-               html[html.length] = '<th>&#160;</th>';
-       }
+               if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+                       YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
+               }
+       },
+       
+       setupConfig : function() {
+       
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
 
-       for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
-               html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
-       }
+               /**
+               * The month/year representing the current visible Calendar date (mm/yyyy)
+               * @config pagedate
+               * @type String
+               * @default today's date
+               */
+               this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-               html[html.length] = '<th>&#160;</th>';
-       }
+               /**
+               * The date or range of dates representing the current Calendar selection
+               * @config selected
+               * @type String
+               * @default []
+               */
+               this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-       html[html.length] = '</tr>';
+               /**
+               * The title to display above the Calendar's month header
+               * @config title
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
-       return html;
-};
+               /**
+               * Whether or not a close button should be displayed for this Calendar
+               * @config close
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-/**
-* Renders the calendar body.
-* @method renderBody
-* @param {Date}        workingDate     The current working Date being used for the render process
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               /**
+               * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+               * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+               * enabled if required.
+               * 
+               * @config iframe
+               * @type Boolean
+               * @default true for IE6 and below, false for all other browsers
+               */
+               this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
-       var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+               /**
+               * The minimum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config mindate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
 
-       this.preMonthDays = workingDate.getDay();
-       if (startDay > 0) {
-               this.preMonthDays -= startDay;
-       }
-       if (this.preMonthDays < 0) {
-               this.preMonthDays += 7;
-       }
+               /**
+               * The maximum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config maxdate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
        
-       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
-       this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
        
-       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
-
-       var weekNum,weekClass;
-       var weekPrefix = "w";
-       var cellPrefix = "_cell";
-       var workingDayPrefix = "wd";
-       var dayPrefix = "d";
+               // Options properties
        
-       var cellRenderers;
-       var renderer;
+               /**
+               * True if the Calendar should allow multiple selections. False by default.
+               * @config MULTI_SELECT
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
        
-       var todayYear = this.today.getFullYear();
-       var todayMonth = this.today.getMonth();
-       var todayDate = this.today.getDate();
+               /**
+               * The weekday the week begins on. Default is 0 (Sunday).
+               * @config START_WEEKDAY
+               * @type number
+               * @default 0
+               */
+               this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
        
-       var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
-       var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
-       var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
-       var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
-       var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
-       var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
-
-       if (mindate) {
-               mindate = YAHOO.widget.DateMath.clearTime(mindate);
-       }
-       if (maxdate) {
-               maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
-       }
+               /**
+               * True if the Calendar should show weekday labels. True by default.
+               * @config SHOW_WEEKDAYS
+               * @type Boolean
+               * @default true
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
        
-       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+               /**
+               * True if the Calendar should show week row headers. False by default.
+               * @config SHOW_WEEK_HEADER
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
        
-       var i = 0;
-
-       var tempDiv = document.createElement("div");
-       var cell = document.createElement("td");
-       tempDiv.appendChild(cell);
-
-       var jan1 = new Date(useDate.getFullYear(),0,1);
-
-       var cal = this.parent || this;
-
-       for (var r=0;r<6;r++) {
-
-               weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
-               weekClass = weekPrefix + weekNum;
-
-               // Local OOM check for performance, since we already have pagedate
-               if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
-                       break;
-               } else {
-
-                       html[html.length] = '<tr class="' + weekClass + '">';
-                       
-                       if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
-                       
-                       for (var d=0;d<7;d++){ // Render actual days
-
-                               cellRenderers = [];
-                               renderer = null;
+               /**
+               * True if the Calendar should show week row footers. False by default.
+               * @config SHOW_WEEK_FOOTER
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+               * @config HIDE_BLANK_WEEKS
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * The image that should be used for the left navigation arrow.
+               * @config NAV_ARROW_LEFT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
+       
+               /**
+               * The image that should be used for the right navigation arrow.
+               * @config NAV_ARROW_RIGHT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
+       
+               // Locale properties
+       
+               /**
+               * The short month labels for the current locale.
+               * @config MONTHS_SHORT
+               * @type String[]
+               * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+               */
+               this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
+               
+               /**
+               * The long month labels for the current locale.
+               * @config MONTHS_LONG
+               * @type String[]
+               * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+               */      
+               this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
 
-                               this.clearElement(cell);
-                               cell.className = this.Style.CSS_CELL;
-                               cell.id = this.id + cellPrefix + i;
+               /**
+               * The 1-character weekday labels for the current locale.
+               * @config WEEKDAYS_1CHAR
+               * @type String[]
+               * @default ["S", "M", "T", "W", "T", "F", "S"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
+               
+               /**
+               * The short weekday labels for the current locale.
+               * @config WEEKDAYS_SHORT
+               * @type String[]
+               * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
+               
+               /**
+               * The medium weekday labels for the current locale.
+               * @config WEEKDAYS_MEDIUM
+               * @type String[]
+               * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
+               
+               /**
+               * The long weekday labels for the current locale.
+               * @config WEEKDAYS_LONG
+               * @type String[]
+               * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+               */      
+               this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
+       
+               /**
+               * Refreshes the locale values used to build the Calendar.
+               * @method refreshLocale
+               * @private
+               */
+               var refreshLocale = function() {
+                       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+                       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+               };
+       
+               this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
+               this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
+               
+               /**
+               * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+               * @config LOCALE_MONTHS
+               * @type String
+               * @default "long"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
+               
+               /**
+               * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+               * @config LOCALE_WEEKDAYS
+               * @type String
+               * @default "short"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
+       
+               /**
+               * The value used to delimit individual dates in a date string passed to various Calendar functions.
+               * @config DATE_DELIMITER
+               * @type String
+               * @default ","
+               */      
+               this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The value used to delimit date fields in a date string passed to various Calendar functions.
+               * @config DATE_FIELD_DELIMITER
+               * @type String
+               * @default "/"
+               */      
+               this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The value used to delimit date ranges in a date string passed to various Calendar functions.
+               * @config DATE_RANGE_DELIMITER
+               * @type String
+               * @default "-"
+               */
+               this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
+       
+               /**
+               * The position of the month in a month/year date string
+               * @config MY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in a month/year date string
+               * @config MY_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in a month/day date string
+               * @config MD_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the day in a month/year date string
+               * @config MD_DAY_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in a month/day/year date string
+               * @config MDY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the day in a month/day/year date string
+               * @config MDY_DAY_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in a month/day/year date string
+               * @config MDY_YEAR_POSITION
+               * @type Number
+               * @default 3
+               */
+               this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in the month year label string used as the Calendar header
+               * @config MY_LABEL_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in the month year label string used as the Calendar header
+               * @config MY_LABEL_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The suffix used after the month when rendering the Calendar header
+               * @config MY_LABEL_MONTH_SUFFIX
+               * @type String
+               * @default " "
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+               
+               /**
+               * The suffix used after the year when rendering the Calendar header
+               * @config MY_LABEL_YEAR_SUFFIX
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
 
-                               if (workingDate.getDate()               == todayDate && 
-                                       workingDate.getMonth()          == todayMonth &&
-                                       workingDate.getFullYear()       == todayYear) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
-                               }
-                               
-                               var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
-                               this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
-                               
-                               // Local OOM check for performance, since we already have pagedate
-                               if (workingDate.getMonth() != useDate.getMonth()) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
-                               } else {
-                                       YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
-                                       YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
-                               
-                                       for (var s=0;s<this.renderStack.length;++s) {
+               /**
+               * Configuration for the Month/Year CalendarNavigator UI which allows the user to jump directly to a 
+               * specific Month/Year without having to scroll sequentially through months.
+               * <p>
+               * Setting this property to null (default value) or false, will disable the CalendarNavigator UI.
+               * </p>
+               * <p>
+               * Setting this property to true will enable the CalendarNavigatior UI with the default CalendarNavigator configuration values.
+               * </p>
+               * <p>
+               * This property can also be set to an object literal containing configuration properties for the CalendarNavigator UI.
+               * The configuration object expects the the following case-sensitive properties, with the "strings" property being a nested object.
+               * Any properties which are not provided will use the default values (defined in the CalendarNavigator class).
+               * </p>
+               * <dl>
+               * <dt>strings</dt>
+               * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+               *     <dl>
+               *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+               *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+               *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+               *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+               *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+               *     </dl>
+               * </dd>
+               * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+               * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+               * </dl>
+               * <p>E.g.</p>
+               * <pre>
+               * var navConfig = {
+               *         strings: {
+               *                 month:"Calendar Month",
+               *                 year:"Calendar Year",
+               *                 submit: "Submit",
+               *                 cancel: "Cancel",
+               *                 invalidYear: "Please enter a valid year"
+               *         },
+               *         monthFormat: YAHOO.widget.Calendar.SHORT,
+               *         initialFocus: "month"
+               * }
+               * </pre>
+               * @config navigator
+               * @type {Object|Boolean}
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+       },
 
-                                               var rArray = this.renderStack[s];
-                                               var type = rArray[0];
-                                               
-                                               var month;
-                                               var day;
-                                               var year;
-                                               
-                                               switch (type) {
-                                                       case YAHOO.widget.Calendar.DATE:
-                                                               month = rArray[1][1];
-                                                               day = rArray[1][2];
-                                                               year = rArray[1][0];
-
-                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
-                                                                       renderer = rArray[2];
-                                                                       this.renderStack.splice(s,1);
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.MONTH_DAY:
-                                                               month = rArray[1][0];
-                                                               day = rArray[1][1];
-                                                               
-                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
-                                                                       renderer = rArray[2];
-                                                                       this.renderStack.splice(s,1);
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.RANGE:
-                                                               var date1 = rArray[1][0];
-                                                               var date2 = rArray[1][1];
-
-                                                               var d1month = date1[1];
-                                                               var d1day = date1[2];
-                                                               var d1year = date1[0];
-                                                               
-                                                               var d1 = new Date(d1year, d1month-1, d1day);
-
-                                                               var d2month = date2[1];
-                                                               var d2day = date2[2];
-                                                               var d2year = date2[0];
-
-                                                               var d2 = new Date(d2year, d2month-1, d2day);
-
-                                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
-                                                                       renderer = rArray[2];
-
-                                                                       if (workingDate.getTime()==d2.getTime()) { 
-                                                                               this.renderStack.splice(s,1);
-                                                                       }
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.WEEKDAY:
-                                                               
-                                                               var weekday = rArray[1][0];
-                                                               if (workingDate.getDay()+1 == weekday) {
-                                                                       renderer = rArray[2];
-                                                               }
-                                                               break;
-                                                       case YAHOO.widget.Calendar.MONTH:
-                                                               
-                                                               month = rArray[1][0];
-                                                               if (workingDate.getMonth()+1 == month) {
-                                                                       renderer = rArray[2];
-                                                               }
-                                                               break;
-                                               }
-                                               
-                                               if (renderer) {
-                                                       cellRenderers[cellRenderers.length]=renderer;
-                                               }
-                                       }
+       /**
+       * The default handler for the "pagedate" property
+       * @method configPageDate
+       */
+       configPageDate : function(type, args, obj) {
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
+       },
 
-                               }
+       /**
+       * The default handler for the "mindate" property
+       * @method configMinDate
+       */
+       configMinDate : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.lang.isString(val)) {
+                       val = this._parseDate(val);
+                       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+               }
+       },
 
-                               if (this._indexOfSelectedFieldArray(workingArray) > -1) {
-                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
+       /**
+       * The default handler for the "maxdate" property
+       * @method configMaxDate
+       */
+       configMaxDate : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.lang.isString(val)) {
+                       val = this._parseDate(val);
+                       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+               }
+       },
+       
+       /**
+       * The default handler for the "selected" property
+       * @method configSelected
+       */
+       configSelected : function(type, args, obj) {
+               var selected = args[0];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               
+               if (selected) {
+                       if (YAHOO.lang.isString(selected)) {
+                               this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
+                       } 
+               }
+               if (! this._selectedDates) {
+                       this._selectedDates = this.cfg.getProperty(cfgSelected);
+               }
+       },
+       
+       /**
+       * The default handler for all configuration options properties
+       * @method configOptions
+       */
+       configOptions : function(type, args, obj) {
+               this.Options[type.toUpperCase()] = args[0];
+       },
+       
+       /**
+       * The default handler for all configuration locale properties
+       * @method configLocale
+       */
+       configLocale : function(type, args, obj) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.Locale[type.toUpperCase()] = args[0];
+       
+               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+       },
+       
+       /**
+       * The default handler for all configuration locale field length properties
+       * @method configLocaleValues
+       */
+       configLocaleValues : function(type, args, obj) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
+       
+               type = type.toLowerCase();
+               var val = args[0];
+       
+               switch (type) {
+                       case defCfg.LOCALE_MONTHS.key:
+                               switch (val) {
+                                       case YAHOO.widget.Calendar.SHORT:
+                                               this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.LONG:
+                                               this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
+                                               break;
                                }
-
-                               if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
-                                       (maxdate && (workingDate.getTime() > maxdate.getTime()))
-                               ) {
-                                       cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
-                               } else {
-                                       cellRenderers[cellRenderers.length]=cal.styleCellDefault;
-                                       cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
+                               break;
+                       case defCfg.LOCALE_WEEKDAYS.key:
+                               switch (val) {
+                                       case YAHOO.widget.Calendar.ONE_CHAR:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.SHORT:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.MEDIUM:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
+                                               break;
+                                       case YAHOO.widget.Calendar.LONG:
+                                               this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
+                                               break;
                                }
                                
-                               for (var x=0; x < cellRenderers.length; ++x) {
-                                       if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
-                                               break;
+                               var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+       
+                               if (START_WEEKDAY > 0) {
+                                       for (var w=0;w<START_WEEKDAY;++w) {
+                                               this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
                                        }
                                }
+                               break;
+               }
+       },
 
-                               workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
-
-                               if (i >= 0 && i <= 6) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
-                               }
-                               if ((i % 7) === 0) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
-                               }
-                               if (((i+1) % 7) === 0) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
-                               }
-                               
-                               var postDays = this.postMonthDays; 
-                               if (hideBlankWeeks && postDays >= 7) {
-                                       var blankWeeks = Math.floor(postDays/7);
-                                       for (var p=0;p<blankWeeks;++p) {
-                                               postDays -= 7;
+       /**
+        * The default handler for the "navigator" property
+        * @method configNavigator
+        */
+       configNavigator : function(type, args, obj) {
+               var val = args[0];
+               if (YAHOO.widget.CalendarNavigator && (val === true || YAHOO.lang.isObject(val))) {
+                       if (!this.oNavigator) {
+                               this.oNavigator = new YAHOO.widget.CalendarNavigator(this);
+                               // Cleanup DOM Refs/Events before innerHTML is removed.
+                               function erase() {
+                                       if (!this.pages) {
+                                               this.oNavigator.erase();
                                        }
                                }
-                               
-                               if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
-                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
-                               }
-
-                               html[html.length] = tempDiv.innerHTML;
-                               i++;
+                               this.beforeRenderEvent.subscribe(erase, this, true);
+                       }
+               } else {
+                       if (this.oNavigator) {
+                               this.oNavigator.destroy();
+                               this.oNavigator = null;
                        }
-
-                       if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
-
-                       html[html.length] = '</tr>';
                }
-       }
+       },
 
-       html[html.length] = '</tbody>';
+       /**
+       * Defines the style constants for the Calendar
+       * @method initStyles
+       */
+       initStyles : function() {
+
+               var defStyle = YAHOO.widget.Calendar._STYLES;
+
+               this.Style = {
+                       /**
+                       * @property Style.CSS_ROW_HEADER
+                       */
+                       CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
+                       /**
+                       * @property Style.CSS_ROW_FOOTER
+                       */
+                       CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
+                       /**
+                       * @property Style.CSS_CELL
+                       */
+                       CSS_CELL : defStyle.CSS_CELL,
+                       /**
+                       * @property Style.CSS_CELL_SELECTOR
+                       */
+                       CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
+                       /**
+                       * @property Style.CSS_CELL_SELECTED
+                       */
+                       CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
+                       /**
+                       * @property Style.CSS_CELL_SELECTABLE
+                       */
+                       CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
+                       /**
+                       * @property Style.CSS_CELL_RESTRICTED
+                       */
+                       CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
+                       /**
+                       * @property Style.CSS_CELL_TODAY
+                       */
+                       CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
+                       /**
+                       * @property Style.CSS_CELL_OOM
+                       */
+                       CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
+                       /**
+                       * @property Style.CSS_CELL_OOB
+                       */
+                       CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
+                       /**
+                       * @property Style.CSS_HEADER
+                       */
+                       CSS_HEADER : defStyle.CSS_HEADER,
+                       /**
+                       * @property Style.CSS_HEADER_TEXT
+                       */
+                       CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+                       /**
+                       * @property Style.CSS_BODY
+                       */
+                       CSS_BODY : defStyle.CSS_BODY,
+                       /**
+                       * @property Style.CSS_WEEKDAY_CELL
+                       */
+                       CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+                       /**
+                       * @property Style.CSS_WEEKDAY_ROW
+                       */
+                       CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+                       /**
+                       * @property Style.CSS_FOOTER
+                       */
+                       CSS_FOOTER : defStyle.CSS_FOOTER,
+                       /**
+                       * @property Style.CSS_CALENDAR
+                       */
+                       CSS_CALENDAR : defStyle.CSS_CALENDAR,
+                       /**
+                       * @property Style.CSS_SINGLE
+                       */
+                       CSS_SINGLE : defStyle.CSS_SINGLE,
+                       /**
+                       * @property Style.CSS_CONTAINER
+                       */
+                       CSS_CONTAINER : defStyle.CSS_CONTAINER,
+                       /**
+                       * @property Style.CSS_NAV_LEFT
+                       */
+                       CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+                       /**
+                       * @property Style.CSS_NAV_RIGHT
+                       */
+                       CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+                       /**
+                       * @property Style.CSS_NAV
+                       */
+                       CSS_NAV : defStyle.CSS_NAV,
+                       /**
+                       * @property Style.CSS_CLOSE
+                       */
+                       CSS_CLOSE : defStyle.CSS_CLOSE,
+                       /**
+                       * @property Style.CSS_CELL_TOP
+                       */
+                       CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+                       /**
+                       * @property Style.CSS_CELL_LEFT
+                       */
+                       CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+                       /**
+                       * @property Style.CSS_CELL_RIGHT
+                       */
+                       CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+                       /**
+                       * @property Style.CSS_CELL_BOTTOM
+                       */
+                       CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+                       /**
+                       * @property Style.CSS_CELL_HOVER
+                       */
+                       CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT1
+                       */
+                       CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT2
+                       */
+                       CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT3
+                       */
+                       CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+                       /**
+                       * @property Style.CSS_CELL_HIGHLIGHT4
+                       */
+                       CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
+               };
+       },
+       
+       /**
+       * Builds the date label that will be displayed in the calendar header or
+       * footer, depending on configuration.
+       * @method buildMonthLabel
+       * @return       {String}        The formatted calendar month label
+       */
+       buildMonthLabel : function() {
+               var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+       
+               var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
+               var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
 
-       return html;
-};
+               if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
+                       return yearLabel + monthLabel;
+               } else {
+                       return monthLabel + yearLabel;
+               }
+       },
+       
+       /**
+       * Builds the date digit that will be displayed in calendar cells
+       * @method buildDayLabel
+       * @param {Date} workingDate     The current working date
+       * @return       {String}        The formatted day label
+       */
+       buildDayLabel : function(workingDate) {
+               return workingDate.getDate();
+       },
+       
+       /**
+        * Creates the title bar element and adds it to Calendar container DIV
+        * 
+        * @method createTitleBar
+        * @param {String} strTitle The title to display in the title bar
+        * @return The title bar element
+        */
+       createTitleBar : function(strTitle) {
+               var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
+               tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
+               tDiv.innerHTML = strTitle;
+               this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild);
+       
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
+       
+               return tDiv;
+       },
+       
+       /**
+        * Removes the title bar element from the DOM
+        * 
+        * @method removeTitleBar
+        */
+       removeTitleBar : function() {
+               var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+               if (tDiv) {
+                       YAHOO.util.Event.purgeElement(tDiv);
+                       this.oDomContainer.removeChild(tDiv);
+               }
+               YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
+       },
+       
+       /**
+        * Creates the close button HTML element and adds it to Calendar container DIV
+        * 
+        * @method createCloseButton
+        * @return The close HTML element created
+        */
+       createCloseButton : function() {
+               var Dom = YAHOO.util.Dom,
+                       Event = YAHOO.util.Event,
+                       cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,
+                       DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
+       
+               var lnk = Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0];
+       
+               if (!lnk) {
+                       lnk = document.createElement("a");  
+                       Event.addListener(lnk, "click", function(e, cal) {
+                               cal.hide(); 
+                               Event.preventDefault(e);
+                       }, this);        
+               }
+       
+               lnk.href = "#";
+               lnk.className = "link-close";
+       
+               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img");
+                       img.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
+                       img.className = cssClose;
+                       lnk.appendChild(img);
+               } else {
+                       lnk.innerHTML = '<span class="' + cssClose + ' ' + this.Style.CSS_CLOSE + '"></span>';
+               }
+               this.oDomContainer.appendChild(lnk);
+       
+               return lnk;
+       },
+       
+       /**
+        * Removes the close button HTML element from the DOM
+        * 
+        * @method removeCloseButton
+        */
+       removeCloseButton : function() {
+               var btn = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
+               if (btn) {
+                       YAHOO.util.Event.purgeElement(btn);
+                       this.oDomContainer.removeChild(btn);
+               }
+       },
 
-/**
-* Renders the calendar footer. In the default implementation, there is
-* no footer.
-* @method renderFooter
-* @param {Array}       html    The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };
+       /**
+       * Renders the calendar header.
+       * @method renderHeader
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderHeader : function(html) {
+               var colSpan = 7;
+               
+               var DEPR_NAV_LEFT = "us/tr/callt.gif";
+               var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+                       colSpan += 1;
+               }
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+                       colSpan += 1;
+               }
+       
+               html[html.length] = "<thead>";
+               html[html.length] =             "<tr>";
+               html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
+               html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';
+       
+               var renderLeft, renderRight = false;
+       
+               if (this.parent) {
+                       if (this.index === 0) {
+                               renderLeft = true;
+                       }
+                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
+                               renderRight = true;
+                       }
+               } else {
+                       renderLeft = true;
+                       renderRight = true;
+               }
+       
+               if (renderLeft) {
+                       var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
+                       // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
+                       if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                               leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
+                       }
+                       var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
+               }
 
-/**
-* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
-* when the method is called: renderHeader, renderBody, renderFooter.
-* Refer to the documentation for those methods for information on 
-* individual render tasks.
-* @method render
-*/
-YAHOO.widget.Calendar.prototype.render = function() {
-       this.beforeRenderEvent.fire();
+               var lbl = this.buildMonthLabel();
+               var cal = this.parent || this;
+               if (cal.cfg.getProperty("navigator")) {
+                       lbl = "<a class=\"" + this.Style.CSS_NAV + "\" href=\"#\">" + lbl + "</a>";
+               }
+               html[html.length] = lbl;
 
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               if (renderRight) {
+                       var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
+                       if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                               rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+                       }
+                       var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
+               }
 
-       // Find starting day of the current month
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
+               html[html.length] =     '</div>\n</th>\n</tr>';
 
-       this.resetRenderers();
-       this.cellDates.length = 0;
+               if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
+                       html = this.buildWeekdays(html);
+               }
+               
+               html[html.length] = '</thead>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the Calendar's weekday headers.
+       * @method buildWeekdays
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       buildWeekdays : function(html) {
+       
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+                       html[html.length] = '<th>&#160;</th>';
+               }
+       
+               for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
+                       html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
+               }
+       
+               if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+                       html[html.length] = '<th>&#160;</th>';
+               }
+       
+               html[html.length] = '</tr>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the calendar body.
+       * @method renderBody
+       * @param {Date} workingDate     The current working Date being used for the render process
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderBody : function(workingDate, html) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+       
+               this.preMonthDays = workingDate.getDay();
+               if (startDay > 0) {
+                       this.preMonthDays -= startDay;
+               }
+               if (this.preMonthDays < 0) {
+                       this.preMonthDays += 7;
+               }
+               
+               this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
+               this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
+               
+               workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
+       
+               var weekNum,weekClass;
+               var weekPrefix = "w";
+               var cellPrefix = "_cell";
+               var workingDayPrefix = "wd";
+               var dayPrefix = "d";
+               
+               var cellRenderers;
+               var renderer;
+               
+               var todayYear = this.today.getFullYear();
+               var todayMonth = this.today.getMonth();
+               var todayDate = this.today.getDate();
+               
+               var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
+               var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
+               var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
+               var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
+               var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+               var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+       
+               if (mindate) {
+                       mindate = YAHOO.widget.DateMath.clearTime(mindate);
+               }
+               if (maxdate) {
+                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
+               }
+               
+               html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+               
+               var i = 0;
+       
+               var tempDiv = document.createElement("div");
+               var cell = document.createElement("td");
+               tempDiv.appendChild(cell);
+       
+               var cal = this.parent || this;
+       
+               for (var r=0;r<6;r++) {
+       
+                       weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
+                       weekClass = weekPrefix + weekNum;
+       
+                       // Local OOM check for performance, since we already have pagedate
+                       if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
+                               break;
+                       } else {
+       
+                               html[html.length] = '<tr class="' + weekClass + '">';
+                               
+                               if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
+                               
+                               for (var d=0;d<7;d++){ // Render actual days
+       
+                                       cellRenderers = [];
+       
+                                       this.clearElement(cell);
+                                       cell.className = this.Style.CSS_CELL;
+                                       cell.id = this.id + cellPrefix + i;
+
+                                       if (workingDate.getDate()               == todayDate && 
+                                               workingDate.getMonth()          == todayMonth &&
+                                               workingDate.getFullYear()       == todayYear) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
+                                       }
+                                       
+                                       var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
+                                       this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+                                       
+                                       // Local OOM check for performance, since we already have pagedate
+                                       if (workingDate.getMonth() != useDate.getMonth()) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
+                                       } else {
+                                               YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+                                               YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
+                                       
+                                               for (var s=0;s<this.renderStack.length;++s) {
+       
+                                                       renderer = null;
+       
+                                                       var rArray = this.renderStack[s];
+                                                       var type = rArray[0];
+                                                       
+                                                       var month;
+                                                       var day;
+                                                       var year;
+                                                       
+                                                       switch (type) {
+                                                               case YAHOO.widget.Calendar.DATE:
+                                                                       month = rArray[1][1];
+                                                                       day = rArray[1][2];
+                                                                       year = rArray[1][0];
+       
+                                                                       if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
+                                                                               renderer = rArray[2];
+                                                                               this.renderStack.splice(s,1);
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.MONTH_DAY:
+                                                                       month = rArray[1][0];
+                                                                       day = rArray[1][1];
+                                                                       
+                                                                       if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
+                                                                               renderer = rArray[2];
+                                                                               this.renderStack.splice(s,1);
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.RANGE:
+                                                                       var date1 = rArray[1][0];
+                                                                       var date2 = rArray[1][1];
+       
+                                                                       var d1month = date1[1];
+                                                                       var d1day = date1[2];
+                                                                       var d1year = date1[0];
+                                                                       
+                                                                       var d1 = YAHOO.widget.DateMath.getDate(d1year, d1month-1, d1day);
+       
+                                                                       var d2month = date2[1];
+                                                                       var d2day = date2[2];
+                                                                       var d2year = date2[0];
+       
+                                                                       var d2 = YAHOO.widget.DateMath.getDate(d2year, d2month-1, d2day);
+       
+                                                                       if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
+                                                                               renderer = rArray[2];
+       
+                                                                               if (workingDate.getTime()==d2.getTime()) { 
+                                                                                       this.renderStack.splice(s,1);
+                                                                               }
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.WEEKDAY:
+                                                                       
+                                                                       var weekday = rArray[1][0];
+                                                                       if (workingDate.getDay()+1 == weekday) {
+                                                                               renderer = rArray[2];
+                                                                       }
+                                                                       break;
+                                                               case YAHOO.widget.Calendar.MONTH:
+                                                                       
+                                                                       month = rArray[1][0];
+                                                                       if (workingDate.getMonth()+1 == month) {
+                                                                               renderer = rArray[2];
+                                                                       }
+                                                                       break;
+                                                       }
+                                                       
+                                                       if (renderer) {
+                                                               cellRenderers[cellRenderers.length]=renderer;
+                                                       }
+                                               }
+       
+                                       }
+       
+                                       if (this._indexOfSelectedFieldArray(workingArray) > -1) {
+                                               cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
+                                       }
+       
+                                       if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
+                                               (maxdate && (workingDate.getTime() > maxdate.getTime()))
+                                       ) {
+                                               cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
+                                       } else {
+                                               cellRenderers[cellRenderers.length]=cal.styleCellDefault;
+                                               cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
+                                       }
+                                       
+                                       for (var x=0; x < cellRenderers.length; ++x) {
+                                               if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
+                                                       break;
+                                               }
+                                       }
+       
+                                       workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
+       
+                                       if (i >= 0 && i <= 6) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
+                                       }
+                                       if ((i % 7) === 0) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
+                                       }
+                                       if (((i+1) % 7) === 0) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
+                                       }
+                                       
+                                       var postDays = this.postMonthDays; 
+                                       if (hideBlankWeeks && postDays >= 7) {
+                                               var blankWeeks = Math.floor(postDays/7);
+                                               for (var p=0;p<blankWeeks;++p) {
+                                                       postDays -= 7;
+                                               }
+                                       }
+                                       
+                                       if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
+                                               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
+                                       }
+       
+                                       html[html.length] = tempDiv.innerHTML;
+                                       i++;
+                               }
+       
+                               if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
+       
+                               html[html.length] = '</tr>';
+                       }
+               }
+       
+               html[html.length] = '</tbody>';
+       
+               return html;
+       },
+       
+       /**
+       * Renders the calendar footer. In the default implementation, there is
+       * no footer.
+       * @method renderFooter
+       * @param {Array}        html    The current working HTML array
+       * @return {Array} The current working HTML array
+       */
+       renderFooter : function(html) { return html; },
+       
+       /**
+       * Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
+       * when the method is called: renderHeader, renderBody, renderFooter.
+       * Refer to the documentation for those methods for information on 
+       * individual render tasks.
+       * @method render
+       */
+       render : function() {
+               this.beforeRenderEvent.fire();
+       
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               // Find starting day of the current month
+               var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
+       
+               this.resetRenderers();
+               this.cellDates.length = 0;
 
-       YAHOO.util.Event.purgeElement(this.oDomContainer, true);
+               YAHOO.util.Event.purgeElement(this.oDomContainer, true);
 
-       var html = [];
+               var html = [];
+       
+               html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
+               html = this.renderHeader(html);
+               html = this.renderBody(workingDate, html);
+               html = this.renderFooter(html);
+               html[html.length] = '</table>';
 
-       html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
-       html = this.renderHeader(html);
-       html = this.renderBody(workingDate, html);
-       html = this.renderFooter(html);
-       html[html.length] = '</table>';
+               this.oDomContainer.innerHTML = html.join("\n");
 
-       this.oDomContainer.innerHTML = html.join("\n");
+               this.applyListeners();
+               this.cells = this.oDomContainer.getElementsByTagName("td");
+       
+               this.cfg.refireEvent(defCfg.TITLE.key);
+               this.cfg.refireEvent(defCfg.CLOSE.key);
+               this.cfg.refireEvent(defCfg.IFRAME.key);
+       
+               this.renderEvent.fire();
+       },
 
-       this.applyListeners();
-       this.cells = this.oDomContainer.getElementsByTagName("td");
+       /**
+       * Applies the Calendar's DOM listeners to applicable elements.
+       * @method applyListeners
+       */
+       applyListeners : function() {
+               var root = this.oDomContainer;
+               var cal = this.parent || this;
+               var anchor = "a";
+               var mousedown = "mousedown";
+
+               var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
+               var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+       
+               if (linkLeft && linkLeft.length > 0) {
+                       this.linkLeft = linkLeft[0];
+                       YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
+               }
 
-       this.cfg.refireEvent(defCfg.TITLE.key);
-       this.cfg.refireEvent(defCfg.CLOSE.key);
-       this.cfg.refireEvent(defCfg.IFRAME.key);
+               if (linkRight && linkRight.length > 0) {
+                       this.linkRight = linkRight[0];
+                       YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
+               }
 
-       this.renderEvent.fire();
-};
+               if (cal.cfg.getProperty("navigator") !== null) {
+                       this.applyNavListeners();
+               }
 
-/**
-* Applies the Calendar's DOM listeners to applicable elements.
-* @method applyListeners
-*/
-YAHOO.widget.Calendar.prototype.applyListeners = function() {
+               if (this.domEventMap) {
+                       var el,elements;
+                       for (var cls in this.domEventMap) {     
+                               if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
+                                       var items = this.domEventMap[cls];
+       
+                                       if (! (items instanceof Array)) {
+                                               items = [items];
+                                       }
        
-       var root = this.oDomContainer;
-       var cal = this.parent || this;
+                                       for (var i=0;i<items.length;i++)        {
+                                               var item = items[i];
+                                               elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
+       
+                                               for (var c=0;c<elements.length;c++) {
+                                                       el = elements[c];
+                                                        YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
+                                               }
+                                       }
+                               }
+                       }
+               }
        
-       var anchor = "a";
-       var mousedown = "mousedown";
+               YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
+               YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
+               YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
+       },
 
-       var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
-       var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+       applyNavListeners : function() {
 
-       if (linkLeft && linkLeft.length > 0) {
-               this.linkLeft = linkLeft[0];
-               YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
-       }
+               var E = YAHOO.util.Event;
 
-       if (linkRight && linkRight.length > 0) {
-               this.linkRight = linkRight[0];
-               YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
-       }
+               var calParent = this.parent || this;
+               var cal = this;
 
-       if (this.domEventMap) {
-               var el,elements;
-               for (var cls in this.domEventMap) {     
-                       if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
-                               var items = this.domEventMap[cls];
+               var navBtns = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV, "a", this.oDomContainer);
 
-                               if (! (items instanceof Array)) {
-                                       items = [items];
-                               }
+               if (navBtns.length > 0) {
 
-                               for (var i=0;i<items.length;i++)        {
-                                       var item = items[i];
-                                       elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
+                       function show(e, obj) {
+                               var target = E.getTarget(e);
+                               // this == navBtn
+                               if (this === target || YAHOO.util.Dom.isAncestor(this, target)) {
+                                       E.preventDefault(e);
+                               }
+                               var navigator = calParent.oNavigator;
+                               if (navigator) {
+                                       var pgdate = cal.cfg.getProperty("pagedate");
+                                       navigator.setYear(pgdate.getFullYear());
+                                       navigator.setMonth(pgdate.getMonth());
+                                       navigator.show();
+                               }
+                       }
+                       E.addListener(navBtns, "click", show);
+               }
+       },
 
-                                       for (var c=0;c<elements.length;c++) {
-                                               el = elements[c];
-                                                YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
-                                       }
+       /**
+       * Retrieves the Date object for the specified Calendar cell
+       * @method getDateByCellId
+       * @param {String}       id      The id of the cell
+       * @return {Date} The Date object for the specified Calendar cell
+       */
+       getDateByCellId : function(id) {
+               var date = this.getDateFieldsByCellId(id);
+               return YAHOO.widget.DateMath.getDate(date[0],date[1]-1,date[2]);
+       },
+       
+       /**
+       * Retrieves the Date object for the specified Calendar cell
+       * @method getDateFieldsByCellId
+       * @param {String}       id      The id of the cell
+       * @return {Array}       The array of Date fields for the specified Calendar cell
+       */
+       getDateFieldsByCellId : function(id) {
+               id = id.toLowerCase().split("_cell")[1];
+               id = parseInt(id, 10);
+               return this.cellDates[id];
+       },
+       
+       /**
+        * Find the Calendar's cell index for a given date.
+        * If the date is not found, the method returns -1.
+        * <p>
+        * The returned index can be used to lookup the cell HTMLElement  
+        * using the Calendar's cells array or passed to selectCell to select 
+        * cells by index. 
+        * </p>
+        *
+        * See <a href="#cells">cells</a>, <a href="#selectCell">selectCell</a>.
+        *
+        * @method getCellIndex
+        * @param {Date} date JavaScript Date object, for which to find a cell index.
+        * @return {Number} The index of the date in Calendars cellDates/cells arrays, or -1 if the date 
+        * is not on the curently rendered Calendar page.
+        */
+       getCellIndex : function(date) {
+               var idx = -1;
+               if (date) {
+                       var m = date.getMonth(),
+                               y = date.getFullYear(),
+                               d = date.getDate(),
+                               dates = this.cellDates;
+
+                       for (var i = 0; i < dates.length; ++i) {
+                               var cellDate = dates[i];
+                               if (cellDate[0] === y && cellDate[1] === m+1 && cellDate[2] === d) {
+                                       idx = i;
+                                       break;
                                }
                        }
                }
+               return idx;
+       },
+       
+       // BEGIN BUILT-IN TABLE CELL RENDERERS
+       
+       /**
+       * Renders a cell that falls before the minimum date or after the maximum date.
+       * widget class.
+       * @method renderOutOfBoundsDate
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderOutOfBoundsDate : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
+               cell.innerHTML = workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       /**
+       * Renders the row header for a week.
+       * @method renderRowHeader
+       * @param {Number}       weekNum The week number of the current row
+       * @param {Array}        cell    The current working HTML array
+       */
+       renderRowHeader : function(weekNum, html) {
+               html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
+               return html;
+       },
+       
+       /**
+       * Renders the row footer for a week.
+       * @method renderRowFooter
+       * @param {Number}       weekNum The week number of the current row
+       * @param {Array}        cell    The current working HTML array
+       */
+       renderRowFooter : function(weekNum, html) {
+               html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
+               return html;
+       },
+       
+       /**
+       * Renders a single standard calendar cell in the calendar widget table.
+       * All logic for determining how a standard default cell will be rendered is 
+       * encapsulated in this method, and must be accounted for when extending the
+       * widget class.
+       * @method renderCellDefault
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellDefault : function(workingDate, cell) {
+               cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
+       },
+       
+       /**
+       * Styles a selectable cell.
+       * @method styleCellDefault
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       styleCellDefault : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       },
+       
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight1 style
+       * @method renderCellStyleHighlight1
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight1 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight2 style
+       * @method renderCellStyleHighlight2
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight2 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight3 style
+       * @method renderCellStyleHighlight3
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight3 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
+       },
+       
+       /**
+       * Renders a single standard calendar cell using the CSS hightlight4 style
+       * @method renderCellStyleHighlight4
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleHighlight4 : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
+       },
+       
+       /**
+       * Applies the default style used for rendering today's date to the current calendar cell
+       * @method renderCellStyleToday
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       */
+       renderCellStyleToday : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
+       },
+       
+       /**
+       * Applies the default style used for rendering selected dates to the current calendar cell
+       * @method renderCellStyleSelected
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderCellStyleSelected : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
+       },
+       
+       /**
+       * Applies the default style used for rendering dates that are not a part of the current
+       * month (preceding or trailing the cells for the current month)
+       * @method renderCellNotThisMonth
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderCellNotThisMonth : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
+               cell.innerHTML=workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       /**
+       * Renders the current calendar cell as a non-selectable "black-out" date using the default
+       * restricted style.
+       * @method renderBodyCellRestricted
+       * @param {Date}                                 workingDate             The current working Date object being used to generate the calendar
+       * @param {HTMLTableCellElement} cell                    The current working cell in the calendar
+       * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+       *                       should not be terminated
+       */
+       renderBodyCellRestricted : function(workingDate, cell) {
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
+               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
+               cell.innerHTML=workingDate.getDate();
+               return YAHOO.widget.Calendar.STOP_RENDER;
+       },
+       
+       // END BUILT-IN TABLE CELL RENDERERS
+       
+       // BEGIN MONTH NAVIGATION METHODS
+       
+       /**
+       * Adds the designated number of months to the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method addMonths
+       * @param {Number}       count   The number of months to add to the current calendar
+       */
+       addMonths : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Subtracts the designated number of months from the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method subtractMonths
+       * @param {Number}       count   The number of months to subtract from the current calendar
+       */
+       subtractMonths : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Adds the designated number of years to the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method addYears
+       * @param {Number}       count   The number of years to add to the current calendar
+       */
+       addYears : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Subtcats the designated number of years from the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method subtractYears
+       * @param {Number}       count   The number of years to subtract from the current calendar
+       */
+       subtractYears : function(count) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+               this.resetRenderers();
+               this.changePageEvent.fire();
+       },
+       
+       /**
+       * Navigates to the next month page in the calendar widget.
+       * @method nextMonth
+       */
+       nextMonth : function() {
+               this.addMonths(1);
+       },
+       
+       /**
+       * Navigates to the previous month page in the calendar widget.
+       * @method previousMonth
+       */
+       previousMonth : function() {
+               this.subtractMonths(1);
+       },
+       
+       /**
+       * Navigates to the next year in the currently selected month in the calendar widget.
+       * @method nextYear
+       */
+       nextYear : function() {
+               this.addYears(1);
+       },
+       
+       /**
+       * Navigates to the previous year in the currently selected month in the calendar widget.
+       * @method previousYear
+       */
+       previousYear : function() {
+               this.subtractYears(1);
+       },
+       
+       // END MONTH NAVIGATION METHODS
+       
+       // BEGIN SELECTION METHODS
+       
+       /**
+       * Resets the calendar widget to the originally selected month and year, and 
+       * sets the calendar to the initial selection(s).
+       * @method reset
+       */
+       reset : function() {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.cfg.resetProperty(defCfg.SELECTED.key);
+               this.cfg.resetProperty(defCfg.PAGEDATE.key);
+               this.resetEvent.fire();
+       },
+       
+       /**
+       * Clears the selected dates in the current calendar widget and sets the calendar
+       * to the current month and year.
+       * @method clear
+       */
+       clear : function() {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               this.cfg.setProperty(defCfg.SELECTED.key, []);
+               this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
+               this.clearEvent.fire();
+       },
+       
+       /**
+       * Selects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once selection has completed, render must be 
+       * called for the changes to be reflected visually.
+       *
+       * Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
+       * selected dates passed to the selectEvent will not contain OOB dates.
+       * 
+       * If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
+       *
+       * @method select
+       * @param        {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects.
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       select : function(date) {
+       
+               var aToBeSelected = this._toFieldArray(date);
+       
+               // Filtered array of valid dates
+               var validDates = [];
+               var selected = [];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               
+               for (var a=0; a < aToBeSelected.length; ++a) {
+                       var toSelect = aToBeSelected[a];
+       
+                       if (!this.isDateOOB(this._toDate(toSelect))) {
+                               
+                               if (validDates.length === 0) {
+                                       this.beforeSelectEvent.fire();
+                                       selected = this.cfg.getProperty(cfgSelected);
+                               }
+       
+                               validDates.push(toSelect);
+                               
+                               if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
+                                       selected[selected.length] = toSelect;
+                               }
+                       }
+               }
+               
+       
+               if (validDates.length > 0) {
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.selectEvent.fire(validDates);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Selects a date on the current calendar by referencing the index of the cell that should be selected.
+       * This method is used to easily select a single cell (usually with a mouse click) without having to do
+       * a full render. The selected style is applied to the cell directly.
+       *
+       * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+       * or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
+       * 
+       * @method selectCell
+       * @param        {Number}        cellIndex       The index of the cell to select in the current calendar. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       selectCell : function(cellIndex) {
+       
+               var cell = this.cells[cellIndex];
+               var cellDate = this.cellDates[cellIndex];
+               var dCellDate = this._toDate(cellDate);
+               
+               var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       
+               if (selectable) {
+       
+                       this.beforeSelectEvent.fire();
+       
+                       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+                       var selected = this.cfg.getProperty(cfgSelected);
+       
+                       var selectDate = cellDate.concat();
+       
+                       if (this._indexOfSelectedFieldArray(selectDate) == -1) {
+                               selected[selected.length] = selectDate;
+                       }
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.renderCellStyleSelected(dCellDate,cell);
+                       this.selectEvent.fire([selectDate]);
+       
+                       this.doCellMouseOut.call(cell, null, this);             
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once deselection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * 
+       * The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
+       * and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
+       * 
+       * If all dates are OOB, beforeDeselect and deselect events will not be fired.
+       * 
+       * @method deselect
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselect : function(date) {
+       
+               var aToBeDeselected = this._toFieldArray(date);
+       
+               var validDates = [];
+               var selected = [];
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+               for (var a=0; a < aToBeDeselected.length; ++a) {
+                       var toDeselect = aToBeDeselected[a];
+       
+                       if (!this.isDateOOB(this._toDate(toDeselect))) {
+       
+                               if (validDates.length === 0) {
+                                       this.beforeDeselectEvent.fire();
+                                       selected = this.cfg.getProperty(cfgSelected);
+                               }
+       
+                               validDates.push(toDeselect);
+       
+                               var index = this._indexOfSelectedFieldArray(toDeselect);
+                               if (index != -1) {      
+                                       selected.splice(index,1);
+                               }
+                       }
+               }
+       
+       
+               if (validDates.length > 0) {
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(cfgSelected, selected);
+                       } else {
+                               this.cfg.setProperty(cfgSelected, selected);
+                       }
+                       this.deselectEvent.fire(validDates);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
+       * This method is used to easily deselect a single cell (usually with a mouse click) without having to do
+       * a full render. The selected style is removed from the cell directly.
+       * 
+       * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+       * or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
+       * deselect events will not be fired.
+       * 
+       * @method deselectCell
+       * @param        {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselectCell : function(cellIndex) {
+               var cell = this.cells[cellIndex];
+               var cellDate = this.cellDates[cellIndex];
+               var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+               
+               var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       
+               if (selectable) {
+       
+                       this.beforeDeselectEvent.fire();
+       
+                       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+                       var selected = this.cfg.getProperty(defCfg.SELECTED.key);
+       
+                       var dCellDate = this._toDate(cellDate);
+                       var selectDate = cellDate.concat();
+       
+                       if (cellDateIndex > -1) {
+                               if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
+                                       this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
+                                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+                               }
+                               selected.splice(cellDateIndex, 1);
+                       }
+       
+                       if (this.parent) {
+                               this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
+                       } else {
+                               this.cfg.setProperty(defCfg.SELECTED.key, selected);
+                       }
+       
+                       this.deselectEvent.fire(selectDate);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       /**
+       * Deselects all dates on the current calendar.
+       * @method deselectAll
+       * @return {Date[]}              Array of JavaScript Date objects representing all individual dates that are currently selected.
+       *                                               Assuming that this function executes properly, the return value should be an empty array.
+       *                                               However, the empty array is returned for the sake of being able to check the selection status
+       *                                               of the calendar.
+       */
+       deselectAll : function() {
+               this.beforeDeselectEvent.fire();
+               
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+               var selected = this.cfg.getProperty(cfgSelected);
+               var count = selected.length;
+               var sel = selected.concat();
+       
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, []);
+               } else {
+                       this.cfg.setProperty(cfgSelected, []);
+               }
+               
+               if (count > 0) {
+                       this.deselectEvent.fire(sel);
+               }
+       
+               return this.getSelectedDates();
+       },
+       
+       // END SELECTION METHODS
+       
+       // BEGIN TYPE CONVERSION METHODS
+       
+       /**
+       * Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
+       * used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
+       * @method _toFieldArray
+       * @private
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return {Array[](Number[])}   Array of date field arrays
+       */
+       _toFieldArray : function(date) {
+               var returnDate = [];
+       
+               if (date instanceof Date) {
+                       returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
+               } else if (YAHOO.lang.isString(date)) {
+                       returnDate = this._parseDates(date);
+               } else if (YAHOO.lang.isArray(date)) {
+                       for (var i=0;i<date.length;++i) {
+                               var d = date[i];
+                               returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+                       }
+               }
+               
+               return returnDate;
+       },
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object. The date field array
+       * is the format in which dates are as provided as arguments to selectEvent and deselectEvent listeners.
+       * 
+       * @method toDate
+       * @param        {Number[]}      dateFieldArray  The date field array to convert to a JavaScript Date.
+       * @return       {Date}  JavaScript Date object representing the date field array.
+       */
+       toDate : function(dateFieldArray) {
+               return this._toDate(dateFieldArray);
+       },
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+       * @method _toDate
+       * @private
+       * @deprecated Made public, toDate 
+       * @param        {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.
+       * @return       {Date}  JavaScript Date object representing the date field array
+       */
+       _toDate : function(dateFieldArray) {
+               if (dateFieldArray instanceof Date) {
+                       return dateFieldArray;
+               } else {
+                       return YAHOO.widget.DateMath.getDate(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
+               }
+       },
+       
+       // END TYPE CONVERSION METHODS 
+       
+       // BEGIN UTILITY METHODS
+       
+       /**
+       * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+       * @method _fieldArraysAreEqual
+       * @private
+       * @param        {Number[]}      array1  The first date field array to compare
+       * @param        {Number[]}      array2  The first date field array to compare
+       * @return       {Boolean}       The boolean that represents the equality of the two arrays
+       */
+       _fieldArraysAreEqual : function(array1, array2) {
+               var match = false;
+       
+               if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
+                       match=true;     
+               }
+       
+               return match;
+       },
+       
+       /**
+       * Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
+       * @method       _indexOfSelectedFieldArray
+       * @private
+       * @param        {Number[]}              find    The date field array to search for
+       * @return       {Number}                        The index of the date field array within the collection of selected dates.
+       *                                                               -1 will be returned if the date is not found.
+       */
+       _indexOfSelectedFieldArray : function(find) {
+               var selected = -1;
+               var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
+       
+               for (var s=0;s<seldates.length;++s) {
+                       var sArray = seldates[s];
+                       if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
+                               selected = s;
+                               break;
+                       }
+               }
+       
+               return selected;
+       },
+       
+       /**
+       * Determines whether a given date is OOM (out of month).
+       * @method       isDateOOM
+       * @param        {Date}  date    The JavaScript Date object for which to check the OOM status
+       * @return       {Boolean}       true if the date is OOM
+       */
+       isDateOOM : function(date) {
+               return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
+       },
+       
+       /**
+       * Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
+       *
+       * @method       isDateOOB
+       * @param        {Date}  date    The JavaScript Date object for which to check the OOB status
+       * @return       {Boolean}       true if the date is OOB
+       */
+       isDateOOB : function(date) {
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               
+               var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
+               var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
+               var dm = YAHOO.widget.DateMath;
+               
+               if (minDate) {
+                       minDate = dm.clearTime(minDate);
+               } 
+               if (maxDate) {
+                       maxDate = dm.clearTime(maxDate);
+               }
+       
+               var clearedDate = new Date(date.getTime());
+               clearedDate = dm.clearTime(clearedDate);
+       
+               return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
+       },
+       
+       /**
+        * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
+        * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
+        * @method      _parsePageDate
+        * @private
+        * @param {Date|String} date    Pagedate value which needs to be parsed
+        * @return {Date}       The Date object representing the pagedate
+        */
+       _parsePageDate : function(date) {
+               var parsedDate;
+               
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+               if (date) {
+                       if (date instanceof Date) {
+                               parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
+                       } else {
+                               var month, year, aMonthYear;
+                               aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
+                               month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
+                               year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
+
+                               parsedDate = YAHOO.widget.DateMath.getDate(year, month, 1);
+                       }
+               } else {
+                       parsedDate = YAHOO.widget.DateMath.getDate(this.today.getFullYear(), this.today.getMonth(), 1);
+               }
+               return parsedDate;
+       },
+       
+       // END UTILITY METHODS
+       
+       // BEGIN EVENT HANDLERS
+       
+       /**
+       * Event executed before a date is selected in the calendar widget.
+       * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
+       */
+       onBeforeSelect : function() {
+               if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
+                       if (this.parent) {
+                               this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
+                               this.parent.deselectAll();
+                       } else {
+                               this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
+                               this.deselectAll();
+                       }
+               }
+       },
+       
+       /**
+       * Event executed when a date is selected in the calendar widget.
+       * @param        {Array} selected        An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+       * @deprecated Event handlers for this event should be susbcribed to selectEvent.
+       */
+       onSelect : function(selected) { },
+       
+       /**
+       * Event executed before a date is deselected in the calendar widget.
+       * @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
+       */
+       onBeforeDeselect : function() { },
+       
+       /**
+       * Event executed when a date is deselected in the calendar widget.
+       * @param        {Array} selected        An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+       * @deprecated Event handlers for this event should be susbcribed to deselectEvent.
+       */
+       onDeselect : function(deselected) { },
+       
+       /**
+       * Event executed when the user navigates to a different calendar page.
+       * @deprecated Event handlers for this event should be susbcribed to changePageEvent.
+       */
+       onChangePage : function() {
+               this.render();
+       },
+       
+       /**
+       * Event executed when the calendar widget is rendered.
+       * @deprecated Event handlers for this event should be susbcribed to renderEvent.
+       */
+       onRender : function() { },
+       
+       /**
+       * Event executed when the calendar widget is reset to its original state.
+       * @deprecated Event handlers for this event should be susbcribed to resetEvemt.
+       */
+       onReset : function() { this.render(); },
+       
+       /**
+       * Event executed when the calendar widget is completely cleared to the current month with no selections.
+       * @deprecated Event handlers for this event should be susbcribed to clearEvent.
+       */
+       onClear : function() { this.render(); },
+       
+       /**
+       * Validates the calendar widget. This method has no default implementation
+       * and must be extended by subclassing the widget.
+       * @return       Should return true if the widget validates, and false if
+       * it doesn't.
+       * @type Boolean
+       */
+       validate : function() { return true; },
+       
+       // END EVENT HANDLERS
+       
+       // BEGIN DATE PARSE METHODS
+       
+       /**
+       * Converts a date string to a date field array
+       * @private
+       * @param        {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.
+       * @return                               A date field array representing the string passed to the method
+       * @type Array[](Number[])
+       */
+       _parseDate : function(sDate) {
+               var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
+               var rArray;
+       
+               if (aDate.length == 2) {
+                       rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
+                       rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
+               } else {
+                       rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
+                       rArray.type = YAHOO.widget.Calendar.DATE;
+               }
+       
+               for (var i=0;i<rArray.length;i++) {
+                       rArray[i] = parseInt(rArray[i], 10);
+               }
+       
+               return rArray;
+       },
+       
+       /**
+       * Converts a multi or single-date string to an array of date field arrays
+       * @private
+       * @param        {String}        sDates          Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
+       * @return                                                       An array of date field arrays
+       * @type Array[](Number[])
+       */
+       _parseDates : function(sDates) {
+               var aReturn = [];
+       
+               var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+               
+               for (var d=0;d<aDates.length;++d) {
+                       var sDate = aDates[d];
+       
+                       if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
+                               // This is a range
+                               var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
+       
+                               var dateStart = this._parseDate(aRange[0]);
+                               var dateEnd = this._parseDate(aRange[1]);
+       
+                               var fullRange = this._parseRange(dateStart, dateEnd);
+                               aReturn = aReturn.concat(fullRange);
+                       } else {
+                               // This is not a range
+                               var aDate = this._parseDate(sDate);
+                               aReturn.push(aDate);
+                       }
+               }
+               return aReturn;
+       },
+       
+       /**
+       * Converts a date range to the full list of included dates
+       * @private
+       * @param        {Number[]}      startDate       Date field array representing the first date in the range
+       * @param        {Number[]}      endDate         Date field array representing the last date in the range
+       * @return                                                       An array of date field arrays
+       * @type Array[](Number[])
+       */
+       _parseRange : function(startDate, endDate) {
+               var dCurrent = YAHOO.widget.DateMath.add(YAHOO.widget.DateMath.getDate(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
+               var dEnd     = YAHOO.widget.DateMath.getDate(endDate[0],  endDate[1]-1,  endDate[2]);
+       
+               var results = [];
+               results.push(startDate);
+               while (dCurrent.getTime() <= dEnd.getTime()) {
+                       results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
+                       dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
+               }
+               return results;
+       },
+       
+       // END DATE PARSE METHODS
+       
+       // BEGIN RENDERER METHODS
+       
+       /**
+       * Resets the render stack of the current calendar to its original pre-render value.
+       */
+       resetRenderers : function() {
+               this.renderStack = this._renderStack.concat();
+       },
+       
+       /**
+        * Removes all custom renderers added to the Calendar through the addRenderer, addMonthRenderer and 
+        * addWeekdayRenderer methods. Calendar's render method needs to be called after removing renderers 
+        * to re-render the Calendar without custom renderers applied.
+        */
+       removeRenderers : function() {
+               this._renderStack = [];
+               this.renderStack = [];
+       },
+
+       /**
+       * Clears the inner HTML, CSS class and style information from the specified cell.
+       * @method clearElement
+       * @param        {HTMLTableCellElement} cell The cell to clear
+       */ 
+       clearElement : function(cell) {
+               cell.innerHTML = "&#160;";
+               cell.className="";
+       },
+       
+       /**
+       * Adds a renderer to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the conditions specified in the date string for this renderer.
+       * @method addRenderer
+       * @param        {String}        sDates          A date string to associate with the specified renderer. Valid formats
+       *                                                                       include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addRenderer : function(sDates, fnRender) {
+               var aDates = this._parseDates(sDates);
+               for (var i=0;i<aDates.length;++i) {
+                       var aDate = aDates[i];
+               
+                       if (aDate.length == 2) { // this is either a range or a month/day combo
+                               if (aDate[0] instanceof Array) { // this is a range
+                                       this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
+                               } else { // this is a month/day combo
+                                       this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
+                               }
+                       } else if (aDate.length == 3) {
+                               this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+                       }
+               }
+       },
+       
+       /**
+       * The private method used for adding cell renderers to the local render stack.
+       * This method is called by other methods that set the renderer type prior to the method call.
+       * @method _addRenderer
+       * @private
+       * @param        {String}        type            The type string that indicates the type of date renderer being added.
+       *                                                                       Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
+       *                                                                       YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
+       * @param        {Array}         aDates          An array of dates used to construct the renderer. The format varies based
+       *                                                                       on the renderer type
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       _addRenderer : function(type, aDates, fnRender) {
+               var add = [type,aDates,fnRender];
+               this.renderStack.unshift(add);  
+               this._renderStack = this.renderStack.concat();
+       },
+
+       /**
+       * Adds a month to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the month passed to this method.
+       * @method addMonthRenderer
+       * @param        {Number}        month           The month (1-12) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addMonthRenderer : function(month, fnRender) {
+               this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
+       },
+
+       /**
+       * Adds a weekday to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the weekday passed to this method.
+       * @method addWeekdayRenderer
+       * @param        {Number}        weekday         The weekday (0-6) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addWeekdayRenderer : function(weekday, fnRender) {
+               this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
+       },
+       
+       // END RENDERER METHODS
+       
+       // BEGIN CSS METHODS
+       
+       /**
+       * Removes all styles from all body cells in the current calendar table.
+       * @method clearAllBodyCellStyles
+       * @param        {style} style The CSS class name to remove from all calendar body cells
+       */
+       clearAllBodyCellStyles : function(style) {
+               for (var c=0;c<this.cells.length;++c) {
+                       YAHOO.util.Dom.removeClass(this.cells[c],style);
+               }
+       },
+       
+       // END CSS METHODS
+       
+       // BEGIN GETTER/SETTER METHODS
+       /**
+       * Sets the calendar's month explicitly
+       * @method setMonth
+       * @param {Number}       month           The numeric month, from 0 (January) to 11 (December)
+       */
+       setMonth : function(month) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               var current = this.cfg.getProperty(cfgPageDate);
+               current.setMonth(parseInt(month, 10));
+               this.cfg.setProperty(cfgPageDate, current);
+       },
+
+       /**
+       * Sets the calendar's year explicitly.
+       * @method setYear
+       * @param {Number}       year            The numeric 4-digit year
+       */
+       setYear : function(year) {
+               var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+               var current = this.cfg.getProperty(cfgPageDate);
+               current.setFullYear(parseInt(year, 10));
+               this.cfg.setProperty(cfgPageDate, current);
+       },
+
+       /**
+       * Gets the list of currently selected dates from the calendar.
+       * @method getSelectedDates
+       * @return {Date[]} An array of currently selected JavaScript Date objects.
+       */
+       getSelectedDates : function() {
+               var returnDates = [];
+               var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
+
+               for (var d=0;d<selected.length;++d) {
+                       var dateArray = selected[d];
+
+                       var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+                       returnDates.push(date);
+               }
+
+               returnDates.sort( function(a,b) { return a-b; } );
+               return returnDates;
+       },
+
+       /// END GETTER/SETTER METHODS ///
+       
+       /**
+       * Hides the Calendar's outer container from view.
+       * @method hide
+       */
+       hide : function() {
+               if (this.beforeHideEvent.fire()) {
+                       this.oDomContainer.style.display = "none";
+                       this.hideEvent.fire();
+               }
+       },
+
+       /**
+       * Shows the Calendar's outer container.
+       * @method show
+       */
+       show : function() {
+               if (this.beforeShowEvent.fire()) {
+                       this.oDomContainer.style.display = "block";
+                       this.showEvent.fire();
+               }
+       },
+
+       /**
+       * Returns a string representing the current browser.
+       * @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
+       * @see YAHOO.env.ua
+       * @property browser
+       * @type String
+       */
+       browser : (function() {
+                               var ua = navigator.userAgent.toLowerCase();
+                                         if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
+                                                return 'opera';
+                                         } else if (ua.indexOf('msie 7')!=-1) { // IE7
+                                                return 'ie7';
+                                         } else if (ua.indexOf('msie') !=-1) { // IE
+                                                return 'ie';
+                                         } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
+                                                return 'safari';
+                                         } else if (ua.indexOf('gecko') != -1) { // Gecko
+                                                return 'gecko';
+                                         } else {
+                                                return false;
+                                         }
+                               })(),
+       /**
+       * Returns a string representation of the object.
+       * @method toString
+       * @return {String}      A string representation of the Calendar object.
+       */
+       toString : function() {
+               return "Calendar " + this.id;
+       }
+};
+
+/**
+* @namespace YAHOO.widget
+* @class Calendar_Core
+* @extends YAHOO.widget.Calendar
+* @deprecated The old Calendar_Core class is no longer necessary.
+*/
+YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;
+
+YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;
+
+/**
+* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
+* the ability to have multi-page calendar views that share a single dataset and are
+* dependent on each other.
+*
+* The calendar group instance will refer to each of its elements using a 0-based index.
+* For example, to construct the placeholder for a calendar group widget with id "cal1" and
+* containerId of "cal1Container", the markup would be as follows:
+*      <xmp>
+*              <div id="cal1Container_0"></div>
+*              <div id="cal1Container_1"></div>
+*      </xmp>
+* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
+* 
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The CalendarGroup can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*      <xmp>
+*              var c = new YAHOO.widget.CalendarGroup("calContainer", configOptions);
+*      </xmp>
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*              var c = new YAHOO.widget.CalendarGroup(containerDiv, configOptions);
+*      </xmp>
+* </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the CalendarGroup's ID will be set to "calContainer_t".
+* </p>
+* 
+* @namespace YAHOO.widget
+* @class CalendarGroup
+* @constructor
+* @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
+*/
+YAHOO.widget.CalendarGroup = function(id, containerId, config) {
+       if (arguments.length > 0) {
+               this.init.apply(this, arguments);
        }
-
-       YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
-       YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
-       YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
 };
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateByCellId
-* @param {String}      id      The id of the cell
-* @return {Date} The Date object for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateByCellId = function(id) {
-       var date = this.getDateFieldsByCellId(id);
-       return new Date(date[0],date[1]-1,date[2]);
-};
+YAHOO.widget.CalendarGroup.prototype = {
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateFieldsByCellId
-* @param {String}      id      The id of the cell
-* @return {Array}      The array of Date fields for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {
-       id = id.toLowerCase().split("_cell")[1];
-       id = parseInt(id, 10);
-       return this.cellDates[id];
-};
+       /**
+       * Initializes the calendar group. All subclasses must call this method in order for the
+       * group to be initialized properly.
+       * @method init
+       * @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+       * @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+       * @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
+       */
+       init : function(id, container, config) {
 
-// BEGIN BUILT-IN TABLE CELL RENDERERS
+               // Normalize 2.4.0, pre 2.4.0 args
+               var nArgs = this._parseArgs(arguments);
 
-/**
-* Renders a cell that falls before the minimum date or after the maximum date.
-* widget class.
-* @method renderOutOfBoundsDate
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
-       cell.innerHTML = workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               id = nArgs.id;
+               container = nArgs.container;
+               config = nArgs.config;
 
-/**
-* Renders the row header for a week.
-* @method renderRowHeader
-* @param {Number}      weekNum The week number of the current row
-* @param {Array}       cell    The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowHeader = function(weekNum, html) {
-       html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
-       return html;
-};
+               this.oDomContainer = YAHOO.util.Dom.get(container);
 
-/**
-* Renders the row footer for a week.
-* @method renderRowFooter
-* @param {Number}      weekNum The week number of the current row
-* @param {Array}       cell    The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {
-       html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
-       return html;
-};
+               if (!this.oDomContainer.id) {
+                       this.oDomContainer.id = YAHOO.util.Dom.generateId();
+               }
+               if (!id) {
+                       id = this.oDomContainer.id + "_t";
+               }
 
-/**
-* Renders a single standard calendar cell in the calendar widget table.
-* All logic for determining how a standard default cell will be rendered is 
-* encapsulated in this method, and must be accounted for when extending the
-* widget class.
-* @method renderCellDefault
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {
-       cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
-};
+               /**
+               * The unique id associated with the CalendarGroup
+               * @property id
+               * @type String
+               */
+               this.id = id;
 
-/**
-* Styles a selectable cell.
-* @method styleCellDefault
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.styleCellDefault = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
-};
+               /**
+               * The unique id associated with the CalendarGroup container
+               * @property containerId
+               * @type String
+               */
+               this.containerId = this.oDomContainer.id;
 
+               this.initEvents();
+               this.initStyles();
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight1 style
-* @method renderCellStyleHighlight1
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
-};
+               /**
+               * The collection of Calendar pages contained within the CalendarGroup
+               * @property pages
+               * @type YAHOO.widget.Calendar[]
+               */
+               this.pages = [];
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight2 style
-* @method renderCellStyleHighlight2
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
-};
+               YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
+               YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight3 style
-* @method renderCellStyleHighlight3
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
-};
+               /**
+               * The Config object used to hold the configuration variables for the CalendarGroup
+               * @property cfg
+               * @type YAHOO.util.Config
+               */
+               this.cfg = new YAHOO.util.Config(this);
 
-/**
-* Renders a single standard calendar cell using the CSS hightlight4 style
-* @method renderCellStyleHighlight4
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
-};
+               /**
+               * The local object which contains the CalendarGroup's options
+               * @property Options
+               * @type Object
+               */
+               this.Options = {};
 
-/**
-* Applies the default style used for rendering today's date to the current calendar cell
-* @method renderCellStyleToday
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleToday = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
-};
+               /**
+               * The local object which contains the CalendarGroup's locale settings
+               * @property Locale
+               * @type Object
+               */
+               this.Locale = {};
 
-/**
-* Applies the default style used for rendering selected dates to the current calendar cell
-* @method renderCellStyleSelected
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleSelected = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
-};
+               this.setupConfig();
 
-/**
-* Applies the default style used for rendering dates that are not a part of the current
-* month (preceding or trailing the cells for the current month)
-* @method renderCellNotThisMonth
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellNotThisMonth = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
-       cell.innerHTML=workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               if (config) {
+                       this.cfg.applyConfig(config, true);
+               }
 
-/**
-* Renders the current calendar cell as a non-selectable "black-out" date using the default
-* restricted style.
-* @method renderBodyCellRestricted
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*                      should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate, cell) {
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
-       cell.innerHTML=workingDate.getDate();
-       return YAHOO.widget.Calendar.STOP_RENDER;
-};
+               this.cfg.fireQueue();
 
-// END BUILT-IN TABLE CELL RENDERERS
+               // OPERA HACK FOR MISWRAPPED FLOATS
+               if (YAHOO.env.ua.opera){
+                       this.renderEvent.subscribe(this._fixWidth, this, true);
+                       this.showEvent.subscribe(this._fixWidth, this, true);
+               }
 
-// BEGIN MONTH NAVIGATION METHODS
+       },
 
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}      count   The number of months to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addMonths = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+       setupConfig : function() {
 
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}      count   The number of months to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
 
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}      count   The number of years to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addYears = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               /**
+               * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
+               * @config pages
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
 
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}      count   The number of years to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractYears = function(count) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-       this.resetRenderers();
-       this.changePageEvent.fire();
-};
+               /**
+               * The month/year representing the current visible Calendar date (mm/yyyy)
+               * @config pagedate
+               * @type String
+               * @default today's date
+               */
+               this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.Calendar.prototype.nextMonth = function() {
-       this.addMonths(1);
-};
+               /**
+               * The date or range of dates representing the current Calendar selection
+               * @config selected
+               * @type String
+               * @default []
+               */
+               this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.Calendar.prototype.previousMonth = function() {
-       this.subtractMonths(1);
-};
+               /**
+               * The title to display above the CalendarGroup's month header
+               * @config title
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.Calendar.prototype.nextYear = function() {
-       this.addYears(1);
-};
+               /**
+               * Whether or not a close button should be displayed for this CalendarGroup
+               * @config close
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.Calendar.prototype.previousYear = function() {
-       this.subtractYears(1);
-};
+               /**
+               * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+               * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+               * enabled if required.
+               * 
+               * @config iframe
+               * @type Boolean
+               * @default true for IE6 and below, false for all other browsers
+               */
+               this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * The minimum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config mindate
+               * @type String
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
+       
+               /**
+               * The maximum selectable date in the current Calendar (mm/dd/yyyy)
+               * @config maxdate
+               * @type String
+               * @default null
+               */      
+               this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
+       
+               // Options properties
+       
+               /**
+               * True if the Calendar should allow multiple selections. False by default.
+               * @config MULTI_SELECT
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       
+               /**
+               * The weekday the week begins on. Default is 0 (Sunday).
+               * @config START_WEEKDAY
+               * @type number
+               * @default 0
+               */      
+               this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+               
+               /**
+               * True if the Calendar should show weekday labels. True by default.
+               * @config SHOW_WEEKDAYS
+               * @type Boolean
+               * @default true
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should show week row headers. False by default.
+               * @config SHOW_WEEK_HEADER
+               * @type Boolean
+               * @default false
+               */      
+               this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should show week row footers. False by default.
+               * @config SHOW_WEEK_FOOTER
+               * @type Boolean
+               * @default false
+               */
+               this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+               * @config HIDE_BLANK_WEEKS
+               * @type Boolean
+               * @default false
+               */              
+               this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+               
+               /**
+               * The image that should be used for the left navigation arrow.
+               * @config NAV_ARROW_LEFT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
+               * @default null
+               */              
+               this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The image that should be used for the right navigation arrow.
+               * @config NAV_ARROW_RIGHT
+               * @type String
+               * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+               * @default null
+               */              
+               this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+       
+               // Locale properties
+               
+               /**
+               * The short month labels for the current locale.
+               * @config MONTHS_SHORT
+               * @type String[]
+               * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+               */
+               this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The long month labels for the current locale.
+               * @config MONTHS_LONG
+               * @type String[]
+               * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+               */              
+               this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
+               
+               /**
+               * The 1-character weekday labels for the current locale.
+               * @config WEEKDAYS_1CHAR
+               * @type String[]
+               * @default ["S", "M", "T", "W", "T", "F", "S"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+               
+               /**
+               * The short weekday labels for the current locale.
+               * @config WEEKDAYS_SHORT
+               * @type String[]
+               * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
+               
+               /**
+               * The medium weekday labels for the current locale.
+               * @config WEEKDAYS_MEDIUM
+               * @type String[]
+               * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+               
+               /**
+               * The long weekday labels for the current locale.
+               * @config WEEKDAYS_LONG
+               * @type String[]
+               * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+               */              
+               this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
+       
+               /**
+               * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+               * @config LOCALE_MONTHS
+               * @type String
+               * @default "long"
+               */
+               this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
+       
+               /**
+               * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+               * @config LOCALE_WEEKDAYS
+               * @type String
+               * @default "short"
+               */      
+               this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit individual dates in a date string passed to various Calendar functions.
+               * @config DATE_DELIMITER
+               * @type String
+               * @default ","
+               */
+               this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit date fields in a date string passed to various Calendar functions.
+               * @config DATE_FIELD_DELIMITER
+               * @type String
+               * @default "/"
+               */      
+               this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The value used to delimit date ranges in a date string passed to various Calendar functions.
+               * @config DATE_RANGE_DELIMITER
+               * @type String
+               * @default "-"
+               */
+               this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
+       
+               /**
+               * The position of the month in a month/year date string
+               * @config MY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the year in a month/year date string
+               * @config MY_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in a month/day date string
+               * @config MD_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */      
+               this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the day in a month/year date string
+               * @config MD_DAY_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the month in a month/day/year date string
+               * @config MDY_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */      
+               this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the day in a month/day/year date string
+               * @config MDY_DAY_POSITION
+               * @type Number
+               * @default 2
+               */      
+               this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The position of the year in a month/day/year date string
+               * @config MDY_YEAR_POSITION
+               * @type Number
+               * @default 3
+               */      
+               this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the month in the month year label string used as the Calendar header
+               * @config MY_LABEL_MONTH_POSITION
+               * @type Number
+               * @default 1
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+               /**
+               * The position of the year in the month year label string used as the Calendar header
+               * @config MY_LABEL_YEAR_POSITION
+               * @type Number
+               * @default 2
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               
+               /**
+               * The suffix used after the month when rendering the Calendar header
+               * @config MY_LABEL_MONTH_SUFFIX
+               * @type String
+               * @default " "
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
+               
+               /**
+               * The suffix used after the year when rendering the Calendar header
+               * @config MY_LABEL_YEAR_SUFFIX
+               * @type String
+               * @default ""
+               */
+               this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
 
-// END MONTH NAVIGATION METHODS
+               /**
+               * Configuration for the Month Year Navigation UI. By default it is disabled
+               * @config NAV
+               * @type Object
+               * @default null
+               */
+               this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+       },
 
-// BEGIN SELECTION METHODS
+       /**
+       * Initializes CalendarGroup's built-in CustomEvents
+       * @method initEvents
+       */
+       initEvents : function() {
+               var me = this;
+               var strEvent = "Event";
 
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.Calendar.prototype.reset = function() {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.cfg.resetProperty(defCfg.SELECTED.key);
-       this.cfg.resetProperty(defCfg.PAGEDATE.key);
-       this.resetEvent.fire();
-};
+               /**
+               * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
+               * @method sub
+               * @private
+               * @param {Function} fn  The function to subscribe to this CustomEvent
+               * @param {Object}       obj     The CustomEvent's scope object
+               * @param {Boolean}      bOverride       Whether or not to apply scope correction
+               */
+               var sub = function(fn, obj, bOverride) {
+                       for (var p=0;p<me.pages.length;++p) {
+                               var cal = me.pages[p];
+                               cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+                       }
+               };
 
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.Calendar.prototype.clear = function() {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       this.cfg.setProperty(defCfg.SELECTED.key, []);
-       this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
-       this.clearEvent.fire();
-};
+               /**
+               * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
+               * @method unsub
+               * @private
+               * @param {Function} fn  The function to subscribe to this CustomEvent
+               * @param {Object}       obj     The CustomEvent's scope object
+               */
+               var unsub = function(fn, obj) {
+                       for (var p=0;p<me.pages.length;++p) {
+                               var cal = me.pages[p];
+                               cal[this.type + strEvent].unsubscribe(fn, obj);
+                       }
+               };
+               
+               var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+       
+               /**
+               * Fired before a selection is made
+               * @event beforeSelectEvent
+               */
+               this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
+               this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when a selection is made
+               * @event selectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
+               */
+               this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
+               this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired before a selection is made
+               * @event beforeDeselectEvent
+               */
+               this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
+               this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when a selection is made
+               * @event deselectEvent
+               * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
+               */
+               this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
+               this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
+               
+               /**
+               * Fired when the Calendar page is changed
+               * @event changePageEvent
+               */
+               this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
+               this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired before the Calendar is rendered
+               * @event beforeRenderEvent
+               */
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+               this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is rendered
+               * @event renderEvent
+               */
+               this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+               this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is reset
+               * @event resetEvent
+               */
+               this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
+               this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired when the Calendar is cleared
+               * @event clearEvent
+               */
+               this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+               this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
+       
+               /**
+               * Fired just before the CalendarGroup is to be shown
+               * @event beforeShowEvent
+               */
+               this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+       
+               /**
+               * Fired after the CalendarGroup is shown
+               * @event showEvent
+               */
+               this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+       
+               /**
+               * Fired just before the CalendarGroup is to be hidden
+               * @event beforeHideEvent
+               */
+               this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+       
+               /**
+               * Fired after the CalendarGroup is hidden
+               * @event hideEvent
+               */
+               this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
 
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-*
-* Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
-* selected dates passed to the selectEvent will not contain OOB dates.
-* 
-* If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
-*
-* @method select
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.select = function(date) {
+               /**
+               * Fired just before the CalendarNavigator is to be shown
+               * @event beforeShowNavEvent
+               */
+               this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+       
+               /**
+               * Fired after the CalendarNavigator is shown
+               * @event showNavEvent
+               */
+               this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+       
+               /**
+               * Fired just before the CalendarNavigator is to be hidden
+               * @event beforeHideNavEvent
+               */
+               this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+       
+               /**
+               * Fired after the CalendarNavigator is hidden
+               * @event hideNavEvent
+               */
+               this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
 
-       var aToBeSelected = this._toFieldArray(date);
+               /**
+               * Fired just before the CalendarNavigator is to be rendered
+               * @event beforeRenderNavEvent
+               */
+               this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
 
-       // Filtered array of valid dates
-       var validDates = [];
-       var selected = [];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               /**
+               * Fired after the CalendarNavigator is rendered
+               * @event renderNavEvent
+               */
+               this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+       },
+       
+       /**
+       * The default Config handler for the "pages" property
+       * @method configPages
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configPages : function(type, args, obj) {
+               var pageCount = args[0];
        
-       for (var a=0; a < aToBeSelected.length; ++a) {
-               var toSelect = aToBeSelected[a];
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+               // Define literals outside loop 
+               var sep = "_";
+               var groupCalClass = "groupcal";
+       
+               var firstClass = "first-of-type";
+               var lastClass = "last-of-type";
+       
+               for (var p=0;p<pageCount;++p) {
+                       var calId = this.id + sep + p;
+                       var calContainerId = this.containerId + sep + p;
+       
+                       var childConfig = this.cfg.getConfig();
+                       childConfig.close = false;
+                       childConfig.title = false;
+                       childConfig.navigator = null;
+
+                       var cal = this.constructChild(calId, calContainerId, childConfig);
+                       var caldate = cal.cfg.getProperty(cfgPageDate);
+                       this._setMonthOnDate(caldate, caldate.getMonth() + p);
+                       cal.cfg.setProperty(cfgPageDate, caldate);
+       
+                       YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
 
-               if (!this.isDateOOB(this._toDate(toSelect))) {
-                       
-                       if (validDates.length === 0) {
-                               this.beforeSelectEvent.fire();
-                               selected = this.cfg.getProperty(cfgSelected);
+                       if (p===0) {
+                               YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
                        }
-
-                       validDates.push(toSelect);
-                       
-                       if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
-                               selected[selected.length] = toSelect;
+       
+                       if (p==(pageCount-1)) {
+                               YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
                        }
+       
+                       cal.parent = this;
+                       cal.index = p; 
+       
+                       this.pages[this.pages.length] = cal;
                }
-       }
+       },
        
-
-       if (validDates.length > 0) {
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+       /**
+       * The default Config handler for the "pagedate" property
+       * @method configPageDate
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configPageDate : function(type, args, obj) {
+               var val = args[0];
+               var firstPageDate;
+               
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       if (p === 0) {
+                               firstPageDate = cal._parsePageDate(val);
+                               cal.cfg.setProperty(cfgPageDate, firstPageDate);
+                       } else {
+                               var pageDate = new Date(firstPageDate);
+                               this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
+                               cal.cfg.setProperty(cfgPageDate, pageDate);
+                       }
                }
-               this.selectEvent.fire(validDates);
-       }
-
-       return this.getSelectedDates();
-};
-
-/**
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.
-* This method is used to easily select a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is applied to the cell directly.
-*
-* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
-* or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
-* 
-* @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to select in the current calendar. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
-
-       var cell = this.cells[cellIndex];
-       var cellDate = this.cellDates[cellIndex];
-       var dCellDate = this._toDate(cellDate);
+       },
        
-       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
-
-       if (selectable) {
-
-               this.beforeSelectEvent.fire();
-
-               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-               var selected = this.cfg.getProperty(cfgSelected);
-
-               var selectDate = cellDate.concat();
+       /**
+       * The default Config handler for the CalendarGroup "selected" property
+       * @method configSelected
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       configSelected : function(type, args, obj) {
+               var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
+               this.delegateConfig(type, args, obj);
+               var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
+               this.cfg.setProperty(cfgSelected, selected, true);
+       },
 
-               if (this._indexOfSelectedFieldArray(selectDate) == -1) {
-                       selected[selected.length] = selectDate;
-               }
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+       
+       /**
+       * Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
+       * @method delegateConfig
+       * @param {String} type  The CustomEvent type (usually the property name)
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
+       */
+       delegateConfig : function(type, args, obj) {
+               var val = args[0];
+               var cal;
+       
+               for (var p=0;p<this.pages.length;p++) {
+                       cal = this.pages[p];
+                       cal.cfg.setProperty(type, val);
                }
-               this.renderCellStyleSelected(dCellDate,cell);
-               this.selectEvent.fire([selectDate]);
-
-               this.doCellMouseOut.call(cell, null, this);             
-       }
-
-       return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* 
-* The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
-* and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
-* 
-* If all dates are OOB, beforeDeselect and deselect events will not be fired.
-* 
-* @method deselect
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselect = function(date) {
-
-       var aToBeDeselected = this._toFieldArray(date);
-
-       var validDates = [];
-       var selected = [];
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-       for (var a=0; a < aToBeDeselected.length; ++a) {
-               var toDeselect = aToBeDeselected[a];
+       },
 
-               if (!this.isDateOOB(this._toDate(toDeselect))) {
+       /**
+       * Adds a function to all child Calendars within this CalendarGroup.
+       * @method setChildFunction
+       * @param {String}               fnName          The name of the function
+       * @param {Function}             fn                      The function to apply to each Calendar page object
+       */
+       setChildFunction : function(fnName, fn) {
+               var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       
+               for (var p=0;p<pageCount;++p) {
+                       this.pages[p][fnName] = fn;
+               }
+       },
 
-                       if (validDates.length === 0) {
-                               this.beforeDeselectEvent.fire();
-                               selected = this.cfg.getProperty(cfgSelected);
+       /**
+       * Calls a function within all child Calendars within this CalendarGroup.
+       * @method callChildFunction
+       * @param {String}               fnName          The name of the function
+       * @param {Array}                args            The arguments to pass to the function
+       */
+       callChildFunction : function(fnName, args) {
+               var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       
+               for (var p=0;p<pageCount;++p) {
+                       var page = this.pages[p];
+                       if (page[fnName]) {
+                               var fn = page[fnName];
+                               fn.call(page, args);
                        }
+               }       
+       },
 
-                       validDates.push(toDeselect);
-
-                       var index = this._indexOfSelectedFieldArray(toDeselect);
-                       if (index != -1) {      
-                               selected.splice(index,1);
-                       }
+       /**
+       * Constructs a child calendar. This method can be overridden if a subclassed version of the default
+       * calendar is to be used.
+       * @method constructChild
+       * @param {String}       id                      The id of the table element that will represent the calendar widget
+       * @param {String}       containerId     The id of the container div element that will wrap the calendar table
+       * @param {Object}       config          The configuration object containing the Calendar's arguments
+       * @return {YAHOO.widget.Calendar}       The YAHOO.widget.Calendar instance that is constructed
+       */
+       constructChild : function(id,containerId,config) {
+               var container = document.getElementById(containerId);
+               if (! container) {
+                       container = document.createElement("div");
+                       container.id = containerId;
+                       this.oDomContainer.appendChild(container);
                }
-       }
+               return new YAHOO.widget.Calendar(id,containerId,config);
+       },
+       
+       /**
+       * Sets the calendar group's month explicitly. This month will be set into the first
+       * page of the multi-page calendar, and all other months will be iterated appropriately.
+       * @method setMonth
+       * @param {Number}       month           The numeric month, from 0 (January) to 11 (December)
+       */
+       setMonth : function(month) {
+               month = parseInt(month, 10);
+               var currYear;
 
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
 
-       if (validDates.length > 0) {
-               if (this.parent) {
-                       this.parent.cfg.setProperty(cfgSelected, selected);
-               } else {
-                       this.cfg.setProperty(cfgSelected, selected);
+               for (var p=0; p<this.pages.length; ++p) {
+                       var cal = this.pages[p];
+                       var pageDate = cal.cfg.getProperty(cfgPageDate);
+                       if (p === 0) {
+                               currYear = pageDate.getFullYear();
+                       } else {
+                               pageDate.setFullYear(currYear);
+                       }
+                       this._setMonthOnDate(pageDate, month+p); 
+                       cal.cfg.setProperty(cfgPageDate, pageDate);
                }
-               this.deselectEvent.fire(validDates);
-       }
-
-       return this.getSelectedDates();
-};
+       },
 
-/**
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is removed from the cell directly.
-* 
-* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
-* or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
-* deselect events will not be fired.
-* 
-* @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselectCell = function(cellIndex) {
-       var cell = this.cells[cellIndex];
-       var cellDate = this.cellDates[cellIndex];
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+       /**
+       * Sets the calendar group's year explicitly. This year will be set into the first
+       * page of the multi-page calendar, and all other months will be iterated appropriately.
+       * @method setYear
+       * @param {Number}       year            The numeric 4-digit year
+       */
+       setYear : function(year) {
        
-       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
-
-       if (selectable) {
-
-               this.beforeDeselectEvent.fire();
-
-               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-               var selected = this.cfg.getProperty(defCfg.SELECTED.key);
-
-               var dCellDate = this._toDate(cellDate);
-               var selectDate = cellDate.concat();
-
-               if (cellDateIndex > -1) {
-                       if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
-                               this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
-                               YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+               var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+               year = parseInt(year, 10);
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       var pageDate = cal.cfg.getProperty(cfgPageDate);
+       
+                       if ((pageDate.getMonth()+1) == 1 && p>0) {
+                               year+=1;
                        }
-                       selected.splice(cellDateIndex, 1);
+                       cal.setYear(year);
                }
+       },
 
-               if (this.parent) {
-                       this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
-               } else {
-                       this.cfg.setProperty(defCfg.SELECTED.key, selected);
+       /**
+       * Calls the render function of all child calendars within the group.
+       * @method render
+       */
+       render : function() {
+               this.renderHeader();
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.render();
                }
+               this.renderFooter();
+       },
 
-               this.deselectEvent.fire(selectDate);
-       }
-
-       return this.getSelectedDates();
-};
+       /**
+       * Selects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once selection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * @method select
+       * @param        {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects.
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       select : function(date) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.select(date);
+               }
+               return this.getSelectedDates();
+       },
 
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.
-*                                              Assuming that this function executes properly, the return value should be an empty array.
-*                                              However, the empty array is returned for the sake of being able to check the selection status
-*                                              of the calendar.
-*/
-YAHOO.widget.Calendar.prototype.deselectAll = function() {
-       this.beforeDeselectEvent.fire();
+       /**
+       * Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+       * The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
+       * <ul>
+       *    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
+       *    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
+       * </ul>
+       * @method selectCell
+       * @param        {Number}        cellIndex       The index of the cell to be selected. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       selectCell : function(cellIndex) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.selectCell(cellIndex);
+               }
+               return this.getSelectedDates();
+       },
        
-       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-       var selected = this.cfg.getProperty(cfgSelected);
-       var count = selected.length;
-       var sel = selected.concat();
-
-       if (this.parent) {
-               this.parent.cfg.setProperty(cfgSelected, []);
-       } else {
-               this.cfg.setProperty(cfgSelected, []);
-       }
+       /**
+       * Deselects a date or a collection of dates on the current calendar. This method, by default,
+       * does not call the render method explicitly. Once deselection has completed, render must be 
+       * called for the changes to be reflected visually.
+       * @method deselect
+       * @param        {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
+       *                                                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+       *                                                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+       *                                                               This method can also take a JavaScript Date object or an array of Date objects. 
+       * @return       {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselect : function(date) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselect(date);
+               }
+               return this.getSelectedDates();
+       },
        
-       if (count > 0) {
-               this.deselectEvent.fire(sel);
-       }
-
-       return this.getSelectedDates();
-};
-
-// END SELECTION METHODS
-
-// BEGIN TYPE CONVERSION METHODS
-
-/**
-* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
-* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
-* @method _toFieldArray
-* @private
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return {Array[](Number[])}  Array of date field arrays
-*/
-YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {
-       var returnDate = [];
-
-       if (date instanceof Date) {
-               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
-       } else if (YAHOO.lang.isString(date)) {
-               returnDate = this._parseDates(date);
-       } else if (YAHOO.lang.isArray(date)) {
-               for (var i=0;i<date.length;++i) {
-                       var d = date[i];
-                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+       /**
+       * Deselects all dates on the current calendar.
+       * @method deselectAll
+       * @return {Date[]}              Array of JavaScript Date objects representing all individual dates that are currently selected.
+       *                                               Assuming that this function executes properly, the return value should be an empty array.
+       *                                               However, the empty array is returned for the sake of being able to check the selection status
+       *                                               of the calendar.
+       */
+       deselectAll : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselectAll();
                }
-       }
+               return this.getSelectedDates();
+       },
        
-       return returnDate;
-};
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _toDate
-* @private
-* @param       {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.
-* @return      {Date}  JavaScript Date object representing the date field array
-*/
-YAHOO.widget.Calendar.prototype._toDate = function(dateFieldArray) {
-       if (dateFieldArray instanceof Date) {
-               return dateFieldArray;
-       } else {
-               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
-       }
-};
-
-// END TYPE CONVERSION METHODS 
-
-// BEGIN UTILITY METHODS
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _fieldArraysAreEqual
-* @private
-* @param       {Number[]}      array1  The first date field array to compare
-* @param       {Number[]}      array2  The first date field array to compare
-* @return      {Boolean}       The boolean that represents the equality of the two arrays
-*/
-YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2) {
-       var match = false;
-
-       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
-               match=true;     
-       }
-
-       return match;
-};
-
-/**
-* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
-* @method      _indexOfSelectedFieldArray
-* @private
-* @param       {Number[]}              find    The date field array to search for
-* @return      {Number}                        The index of the date field array within the collection of selected dates.
-*                                                              -1 will be returned if the date is not found.
-*/
-YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
-       var selected = -1;
-       var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-       for (var s=0;s<seldates.length;++s) {
-               var sArray = seldates[s];
-               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
-                       selected = s;
-                       break;
+       /**
+       * Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+       * deselectCell will deselect the cell at the specified index on each displayed Calendar page.
+       *
+       * @method deselectCell
+       * @param        {Number}        cellIndex       The index of the cell to deselect. 
+       * @return       {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
+       */
+       deselectCell : function(cellIndex) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.deselectCell(cellIndex);
                }
-       }
-
-       return selected;
-};
-
-/**
-* Determines whether a given date is OOM (out of month).
-* @method      isDateOOM
-* @param       {Date}  date    The JavaScript Date object for which to check the OOM status
-* @return      {Boolean}       true if the date is OOM
-*/
-YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
-       return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
-};
-
-/**
-* Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
-*
-* @method      isDateOOB
-* @param       {Date}  date    The JavaScript Date object for which to check the OOB status
-* @return      {Boolean}       true if the date is OOB
-*/
-YAHOO.widget.Calendar.prototype.isDateOOB = function(date) {
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-       
-       var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
-       var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
-       var dm = YAHOO.widget.DateMath;
-       
-       if (minDate) {
-               minDate = dm.clearTime(minDate);
-       } 
-       if (maxDate) {
-               maxDate = dm.clearTime(maxDate);
-       }
-
-       var clearedDate = new Date(date.getTime());
-       clearedDate = dm.clearTime(clearedDate);
-
-       return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
-};
-
-/**
- * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
- * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
- * @method     _parsePageDate
- * @private
- * @param {Date|String}        date    Pagedate value which needs to be parsed
- * @return {Date}      The Date object representing the pagedate
- */
-YAHOO.widget.Calendar.prototype._parsePageDate = function(date) {
-       var parsedDate;
+               return this.getSelectedDates();
+       },
        
-       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-       if (date) {
-               if (date instanceof Date) {
-                       parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
-               } else {
-                       var month, year, aMonthYear;
-                       aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
-                       month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
-                       year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
-                       
-                       parsedDate = new Date(year, month, 1);
+       /**
+       * Resets the calendar widget to the originally selected month and year, and 
+       * sets the calendar to the initial selection(s).
+       * @method reset
+       */
+       reset : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.reset();
                }
-       } else {
-               parsedDate = new Date(this.today.getFullYear(), this.today.getMonth(), 1);
-       }
-       return parsedDate;
-};
-
-// END UTILITY METHODS
-
-// BEGIN EVENT HANDLERS
-
-/**
-* Event executed before a date is selected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {
-       if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
-               if (this.parent) {
-                       this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
-                       this.parent.deselectAll();
-               } else {
-                       this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
-                       this.deselectAll();
+       },
+       
+       /**
+       * Clears the selected dates in the current calendar widget and sets the calendar
+       * to the current month and year.
+       * @method clear
+       */
+       clear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.clear();
                }
-       }
-};
-
-/**
-* Event executed when a date is selected in the calendar widget.
-* @param       {Array} selected        An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to selectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onSelect = function(selected) { };
-
-/**
-* Event executed before a date is deselected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeDeselect = function() { };
-
-/**
-* Event executed when a date is deselected in the calendar widget.
-* @param       {Array} selected        An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to deselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onDeselect = function(deselected) { };
-
-/**
-* Event executed when the user navigates to a different calendar page.
-* @deprecated Event handlers for this event should be susbcribed to changePageEvent.
-*/
-YAHOO.widget.Calendar.prototype.onChangePage = function() {
-       this.render();
-};
-
-/**
-* Event executed when the calendar widget is rendered.
-* @deprecated Event handlers for this event should be susbcribed to renderEvent.
-*/
-YAHOO.widget.Calendar.prototype.onRender = function() { };
+       },
+       
+       /**
+       * Navigates to the next month page in the calendar widget.
+       * @method nextMonth
+       */
+       nextMonth : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.nextMonth();
+               }
+       },
+       
+       /**
+       * Navigates to the previous month page in the calendar widget.
+       * @method previousMonth
+       */
+       previousMonth : function() {
+               for (var p=this.pages.length-1;p>=0;--p) {
+                       var cal = this.pages[p];
+                       cal.previousMonth();
+               }
+       },
+       
+       /**
+       * Navigates to the next year in the currently selected month in the calendar widget.
+       * @method nextYear
+       */
+       nextYear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.nextYear();
+               }
+       },
 
-/**
-* Event executed when the calendar widget is reset to its original state.
-* @deprecated Event handlers for this event should be susbcribed to resetEvemt.
-*/
-YAHOO.widget.Calendar.prototype.onReset = function() { this.render(); };
+       /**
+       * Navigates to the previous year in the currently selected month in the calendar widget.
+       * @method previousYear
+       */
+       previousYear : function() {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.previousYear();
+               }
+       },
 
-/**
-* Event executed when the calendar widget is completely cleared to the current month with no selections.
-* @deprecated Event handlers for this event should be susbcribed to clearEvent.
-*/
-YAHOO.widget.Calendar.prototype.onClear = function() { this.render(); };
+       /**
+       * Gets the list of currently selected dates from the calendar.
+       * @return                       An array of currently selected JavaScript Date objects.
+       * @type Date[]
+       */
+       getSelectedDates : function() { 
+               var returnDates = [];
+               var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
+               for (var d=0;d<selected.length;++d) {
+                       var dateArray = selected[d];
+
+                       var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+                       returnDates.push(date);
+               }
 
-/**
-* Validates the calendar widget. This method has no default implementation
-* and must be extended by subclassing the widget.
-* @return      Should return true if the widget validates, and false if
-* it doesn't.
-* @type Boolean
-*/
-YAHOO.widget.Calendar.prototype.validate = function() { return true; };
+               returnDates.sort( function(a,b) { return a-b; } );
+               return returnDates;
+       },
 
-// END EVENT HANDLERS
+       /**
+       * Adds a renderer to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the conditions specified in the date string for this renderer.
+       * @method addRenderer
+       * @param        {String}        sDates          A date string to associate with the specified renderer. Valid formats
+       *                                                                       include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addRenderer : function(sDates, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addRenderer(sDates, fnRender);
+               }
+       },
 
-// BEGIN DATE PARSE METHODS
+       /**
+       * Adds a month to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the month passed to this method.
+       * @method addMonthRenderer
+       * @param        {Number}        month           The month (1-12) to associate with this renderer
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addMonthRenderer : function(month, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addMonthRenderer(month, fnRender);
+               }
+       },
 
-/**
-* Converts a date string to a date field array
-* @private
-* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.
-* @return                              A date field array representing the string passed to the method
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDate = function(sDate) {
-       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
-       var rArray;
-
-       if (aDate.length == 2) {
-               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
-               rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
-       } else {
-               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
-               rArray.type = YAHOO.widget.Calendar.DATE;
-       }
+       /**
+       * Adds a weekday to the render stack. The function reference passed to this method will be executed
+       * when a date cell matches the weekday passed to this method.
+       * @method addWeekdayRenderer
+       * @param        {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
+       * @param        {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
+       */
+       addWeekdayRenderer : function(weekday, fnRender) {
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       cal.addWeekdayRenderer(weekday, fnRender);
+               }
+       },
 
-       for (var i=0;i<rArray.length;i++) {
-               rArray[i] = parseInt(rArray[i], 10);
-       }
+       /**
+        * Removes all custom renderers added to the CalendarGroup through the addRenderer, addMonthRenderer and 
+        * addWeekRenderer methods. CalendarGroup's render method needs to be called to after removing renderers 
+        * to see the changes applied.
+        * 
+        * @method removeRenderers
+        */
+       removeRenderers : function() {
+               this.callChildFunction("removeRenderers");
+       },
 
-       return rArray;
-};
+       /**
+       * Renders the header for the CalendarGroup.
+       * @method renderHeader
+       */
+       renderHeader : function() {
+               // EMPTY DEFAULT IMPL
+       },
 
-/**
-* Converts a multi or single-date string to an array of date field arrays
-* @private
-* @param       {String}        sDates          Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
-* @return                                                      An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDates = function(sDates) {
-       var aReturn = [];
+       /**
+       * Renders a footer for the 2-up calendar container. By default, this method is
+       * unimplemented.
+       * @method renderFooter
+       */
+       renderFooter : function() {
+               // EMPTY DEFAULT IMPL
+       },
 
-       var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+       /**
+       * Adds the designated number of months to the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method addMonths
+       * @param {Number}       count   The number of months to add to the current calendar
+       */
+       addMonths : function(count) {
+               this.callChildFunction("addMonths", count);
+       },
        
-       for (var d=0;d<aDates.length;++d) {
-               var sDate = aDates[d];
+       /**
+       * Subtracts the designated number of months from the current calendar month, and sets the current
+       * calendar page date to the new month.
+       * @method subtractMonths
+       * @param {Number}       count   The number of months to subtract from the current calendar
+       */
+       subtractMonths : function(count) {
+               this.callChildFunction("subtractMonths", count);
+       },
 
-               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
-                       // This is a range
-                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
+       /**
+       * Adds the designated number of years to the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method addYears
+       * @param {Number}       count   The number of years to add to the current calendar
+       */
+       addYears : function(count) {
+               this.callChildFunction("addYears", count);
+       },
 
-                       var dateStart = this._parseDate(aRange[0]);
-                       var dateEnd = this._parseDate(aRange[1]);
+       /**
+       * Subtcats the designated number of years from the current calendar, and sets the current
+       * calendar page date to the new month.
+       * @method subtractYears
+       * @param {Number}       count   The number of years to subtract from the current calendar
+       */
+       subtractYears : function(count) {
+               this.callChildFunction("subtractYears", count);
+       },
 
-                       var fullRange = this._parseRange(dateStart, dateEnd);
-                       aReturn = aReturn.concat(fullRange);
-               } else {
-                       // This is not a range
-                       var aDate = this._parseDate(sDate);
-                       aReturn.push(aDate);
+       /**
+        * Returns the Calendar page instance which has a pagedate (month/year) matching the given date. 
+        * Returns null if no match is found.
+        * 
+        * @method getCalendarPage
+        * @param {Date} date The JavaScript Date object for which a Calendar page is to be found.
+        * @return {Calendar} The Calendar page instance representing the month to which the date 
+        * belongs.
+        */
+       getCalendarPage : function(date) {
+               var cal = null;
+               if (date) {
+                       var y = date.getFullYear(),
+                               m = date.getMonth();
+
+                       var pages = this.pages;
+                       for (var i = 0; i < pages.length; ++i) {
+                               var pageDate = pages[i].cfg.getProperty("pagedate");
+                               if (pageDate.getFullYear() === y && pageDate.getMonth() === m) {
+                                       cal = pages[i];
+                                       break;
+                               }
+                       }
                }
-       }
-       return aReturn;
-};
-
-/**
-* Converts a date range to the full list of included dates
-* @private
-* @param       {Number[]}      startDate       Date field array representing the first date in the range
-* @param       {Number[]}      endDate         Date field array representing the last date in the range
-* @return                                                      An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseRange = function(startDate, endDate) {
-       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);
-       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
-       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);
-
-       var results = [];
-       results.push(startDate);
-       while (dCurrent.getTime() <= dEnd.getTime()) {
-               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
-               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
-       }
-       return results;
-};
-
-// END DATE PARSE METHODS
-
-// BEGIN RENDERER METHODS
-
-/**
-* Resets the render stack of the current calendar to its original pre-render value.
-*/
-YAHOO.widget.Calendar.prototype.resetRenderers = function() {
-       this.renderStack = this._renderStack.concat();
-};
-
-/**
-* Clears the inner HTML, CSS class and style information from the specified cell.
-* @method clearElement
-* @param       {HTMLTableCellElement}  The cell to clear
-*/ 
-YAHOO.widget.Calendar.prototype.clearElement = function(cell) {
-       cell.innerHTML = "&#160;";
-       cell.className="";
-};
+               return cal;
+       },
 
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addRenderer = function(sDates, fnRender) {
-       var aDates = this._parseDates(sDates);
-       for (var i=0;i<aDates.length;++i) {
-               var aDate = aDates[i];
-       
-               if (aDate.length == 2) { // this is either a range or a month/day combo
-                       if (aDate[0] instanceof Array) { // this is a range
-                               this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
-                       } else { // this is a month/day combo
-                               this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
-                       }
-               } else if (aDate.length == 3) {
-                       this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+       /**
+       * Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
+       * The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
+       * @method       _setMonthOnDate
+       * @private
+       * @param        {Date}  date    The Date object on which to set the month index
+       * @param        {Number}        iMonth  The month index to set
+       */
+       _setMonthOnDate : function(date, iMonth) {
+               // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
+               if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
+                       var DM = YAHOO.widget.DateMath;
+                       var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
+                       date.setTime(newDate.getTime());
+               } else {
+                       date.setMonth(iMonth);
+               }
+       },
+       
+       /**
+        * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
+        * @method _fixWidth
+        * @private
+        */
+       _fixWidth : function() {
+               var w = 0;
+               for (var p=0;p<this.pages.length;++p) {
+                       var cal = this.pages[p];
+                       w += cal.oDomContainer.offsetWidth;
+               }
+               if (w > 0) {
+                       this.oDomContainer.style.width = w + "px";
                }
+       },
+       
+       /**
+       * Returns a string representation of the object.
+       * @method toString
+       * @return {String}      A string representation of the CalendarGroup object.
+       */
+       toString : function() {
+               return "CalendarGroup " + this.id;
        }
 };
 
 /**
-* The private method used for adding cell renderers to the local render stack.
-* This method is called by other methods that set the renderer type prior to the method call.
-* @method _addRenderer
-* @private
-* @param       {String}        type            The type string that indicates the type of date renderer being added.
-*                                                                      Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
-*                                                                      YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
-* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based
-*                                                                      on the renderer type
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype._addRenderer = function(type, aDates, fnRender) {
-       var add = [type,aDates,fnRender];
-       this.renderStack.unshift(add);  
-       this._renderStack = this.renderStack.concat();
-};
-
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param       {Number}        month           The month (1-12) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addMonthRenderer = function(month, fnRender) {
-       this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
-};
-
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-       this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
-};
-
-// END RENDERER METHODS
-
-// BEGIN CSS METHODS
-
-/**
-* Removes all styles from all body cells in the current calendar table.
-* @method clearAllBodyCellStyles
-* @param       {style}         The CSS class name to remove from all calendar body cells
+* CSS class representing the container for the calendar
+* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {
-       for (var c=0;c<this.cells.length;++c) {
-               YAHOO.util.Dom.removeClass(this.cells[c],style);
-       }
-};
-
-// END CSS METHODS
+YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";
 
-// BEGIN GETTER/SETTER METHODS
 /**
-* Sets the calendar's month explicitly
-* @method setMonth
-* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
+* CSS class representing the container for the calendar
+* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.setMonth = function(month) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       var current = this.cfg.getProperty(cfgPageDate);
-       current.setMonth(parseInt(month, 10));
-       this.cfg.setProperty(cfgPageDate, current);
-};
+YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";
 
 /**
-* Sets the calendar's year explicitly.
-* @method setYear
-* @param {Number}      year            The numeric 4-digit year
+* CSS class representing the title for the 2-up calendar
+* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE
+* @static
+* @final
+* @type String
 */
-YAHOO.widget.Calendar.prototype.setYear = function(year) {
-       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-       var current = this.cfg.getProperty(cfgPageDate);
-       current.setFullYear(parseInt(year, 10));
-       this.cfg.setProperty(cfgPageDate, current);
-};
+YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
 
 /**
-* Gets the list of currently selected dates from the calendar.
-* @method getSelectedDates
-* @return {Date[]} An array of currently selected JavaScript Date objects.
+* CSS class representing the close icon for the 2-up calendar
+* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
+* @static
+* @final
+* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
+*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
+* @type String
 */
-YAHOO.widget.Calendar.prototype.getSelectedDates = function() {
-       var returnDates = [];
-       var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-       for (var d=0;d<selected.length;++d) {
-               var dateArray = selected[d];
-
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-               returnDates.push(date);
-       }
-
-       returnDates.sort( function(a,b) { return a-b; } );
-       return returnDates;
-};
+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
 
-/// END GETTER/SETTER METHODS ///
+YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
+                                                                                                                                "buildMonthLabel",
+                                                                                                                                "renderOutOfBoundsDate",
+                                                                                                                                "renderRowHeader",
+                                                                                                                                "renderRowFooter",
+                                                                                                                                "renderCellDefault",
+                                                                                                                                "styleCellDefault",
+                                                                                                                                "renderCellStyleHighlight1",
+                                                                                                                                "renderCellStyleHighlight2",
+                                                                                                                                "renderCellStyleHighlight3",
+                                                                                                                                "renderCellStyleHighlight4",
+                                                                                                                                "renderCellStyleToday",
+                                                                                                                                "renderCellStyleSelected",
+                                                                                                                                "renderCellNotThisMonth",
+                                                                                                                                "renderBodyCellRestricted",
+                                                                                                                                "initStyles",
+                                                                                                                                "configTitle",
+                                                                                                                                "configClose",
+                                                                                                                                "configIframe",
+                                                                                                                                "configNavigator",
+                                                                                                                                "createTitleBar",
+                                                                                                                                "createCloseButton",
+                                                                                                                                "removeTitleBar",
+                                                                                                                                "removeCloseButton",
+                                                                                                                                "hide",
+                                                                                                                                "show",
+                                                                                                                                "toDate",
+                                                                                                                                "_parseArgs",
+                                                                                                                                "browser");
 
 /**
-* Hides the Calendar's outer container from view.
-* @method hide
+* The set of default Config property keys and values for the CalendarGroup
+* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
 */
-YAHOO.widget.Calendar.prototype.hide = function() {
-       this.oDomContainer.style.display = "none";
-};
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
 
-/**
-* Shows the Calendar's outer container.
-* @method show
-*/
-YAHOO.widget.Calendar.prototype.show = function() {
-       this.oDomContainer.style.display = "block";
-};
+YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;
 
 /**
-* Returns a string representing the current browser.
-* @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
-* @see YAHOO.env.ua
-* @property browser
-* @type String
-*/
-YAHOO.widget.Calendar.prototype.browser = function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }();
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     A string representation of the Calendar object.
+* @class YAHOO.widget.Calendar2up
+* @extends YAHOO.widget.CalendarGroup
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.Calendar.prototype.toString = function() {
-       return "Calendar " + this.id;
+YAHOO.widget.Calendar2up = function(id, containerId, config) {
+       this.init(id, containerId, config);
 };
 
-/**
-* @namespace YAHOO.widget
-* @class Calendar_Core
-* @extends YAHOO.widget.Calendar
-* @deprecated The old Calendar_Core class is no longer necessary.
-*/
-YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;
-
-YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;
+YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
 
 /**
-* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
-* the ability to have multi-page calendar views that share a single dataset and are
-* dependent on each other.
-* 
-* The calendar group instance will refer to each of its elements using a 0-based index.
-* For example, to construct the placeholder for a calendar group widget with id "cal1" and
-* containerId of "cal1Container", the markup would be as follows:
-*      <xmp>
-*              <div id="cal1Container_0"></div>
-*              <div id="cal1Container_1"></div>
-*      </xmp>
-* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
-* @namespace YAHOO.widget
-* @class CalendarGroup
-* @constructor
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.CalendarGroup = function(id, containerId, config) {
-       if (arguments.length > 0) {
-               this.init(id, containerId, config);
-       }
-};
+YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
 
 /**
-* Initializes the calendar group. All subclasses must call this method in order for the
-* group to be initialized properly.
-* @method init
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
-       this.initEvents();
-       this.initStyles();
-
-       /**
-       * The collection of Calendar pages contained within the CalendarGroup
-       * @property pages
-       * @type YAHOO.widget.Calendar[]
-       */
-       this.pages = [];
-       
-       /**
-       * The unique id associated with the CalendarGroup
-       * @property id
-       * @type String
-       */
-       this.id = id;
-
-       /**
-       * The unique id associated with the CalendarGroup container
-       * @property containerId
-       * @type String
-       */
-       this.containerId = containerId;
-
-       /**
-       * The outer containing element for the CalendarGroup
-       * @property oDomContainer
-       * @type HTMLElement
-       */
-       this.oDomContainer = document.getElementById(containerId);
-
-       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
-       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
-
-       /**
-       * The Config object used to hold the configuration variables for the CalendarGroup
-       * @property cfg
-       * @type YAHOO.util.Config
-       */
-       this.cfg = new YAHOO.util.Config(this);
-
-       /**
-       * The local object which contains the CalendarGroup's options
-       * @property Options
-       * @type Object
-       */
-       this.Options = {};
-
-       /**
-       * The local object which contains the CalendarGroup's locale settings
-       * @property Locale
-       * @type Object
-       */
-       this.Locale = {};
-
-       this.setupConfig();
-
-       if (config) {
-               this.cfg.applyConfig(config, true);
-       }
-
-       this.cfg.fireQueue();
-
-       // OPERA HACK FOR MISWRAPPED FLOATS
-       if (YAHOO.env.ua.opera){
-               this.renderEvent.subscribe(this._fixWidth, this, true);
-       }
+ * The CalendarNavigator is used along with a Calendar/CalendarGroup to 
+ * provide a Month/Year popup navigation control, allowing the user to navigate 
+ * to a specific month/year in the Calendar/CalendarGroup without having to 
+ * scroll through months sequentially
+ *
+ * @namespace YAHOO.widget
+ * @class CalendarNavigator
+ * @constructor
+ * @param {Calendar|CalendarGroup} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached.
+ */
+YAHOO.widget.CalendarNavigator = function(cal) {
+       this.init(cal);
 };
 
-
-YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
-       
-       var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
-       
-       /**
-       * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
-       * @config pages
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
+(function() {
+       // Setup static properties (inside anon fn, so that we can use shortcuts)
+       var CN = YAHOO.widget.CalendarNavigator;
 
        /**
-       * The month/year representing the current visible Calendar date (mm/yyyy)
-       * @config pagedate
-       * @type String
-       * @default today's date
-       */
-       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
+        * YAHOO.widget.CalendarNavigator.CLASSES contains constants
+        * for the class values applied to the CalendarNaviatgator's 
+        * DOM elements
+        * @property YAHOO.widget.CalendarNavigator.CLASSES
+        * @type Object
+        * @static
+        */
+       CN.CLASSES = {
+               /**
+                * Class applied to the Calendar Navigator's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV
+                * @type String
+                * @static
+                */
+               NAV :"yui-cal-nav",
+               /**
+                * Class applied to the Calendar/CalendarGroup's bounding box to indicate
+                * the Navigator is currently visible
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV_VISIBLE
+                * @type String
+                * @static
+                */
+               NAV_VISIBLE: "yui-cal-nav-visible",
+               /**
+                * Class applied to the Navigator mask's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MASK
+                * @type String
+                * @static
+                */
+               MASK : "yui-cal-nav-mask",
+               /**
+                * Class applied to the year label/control bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR
+                * @type String
+                * @static
+                */
+               YEAR : "yui-cal-nav-y",
+               /**
+                * Class applied to the month label/control bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH
+                * @type String
+                * @static
+                */
+               MONTH : "yui-cal-nav-m",
+               /**
+                * Class applied to the submit/cancel button's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTONS
+                * @type String
+                * @static
+                */
+               BUTTONS : "yui-cal-nav-b",
+               /**
+                * Class applied to buttons wrapping element
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTON
+                * @type String
+                * @static
+                */
+               BUTTON : "yui-cal-nav-btn",
+               /**
+                * Class applied to the validation error area's bounding box
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.ERROR
+                * @type String
+                * @static
+                */
+               ERROR : "yui-cal-nav-e",
+               /**
+                * Class applied to the year input control
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR_CTRL
+                * @type String
+                * @static
+                */
+               YEAR_CTRL : "yui-cal-nav-yc",
+               /**
+                * Class applied to the month input control
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH_CTRL
+                * @type String
+                * @static
+                */
+               MONTH_CTRL : "yui-cal-nav-mc",
+               /**
+                * Class applied to controls with invalid data (e.g. a year input field with invalid an year)
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.INVALID
+                * @type String
+                * @static
+                */
+               INVALID : "yui-invalid",
+               /**
+                * Class applied to default controls
+                * @property YAHOO.widget.CalendarNavigator.CLASSES.DEFAULT
+                * @type String
+                * @static
+                */
+               DEFAULT : "yui-default"
+       };
 
        /**
-       * The date or range of dates representing the current Calendar selection
-       * @config selected
-       * @type String
-       * @default []
-       */
-       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
+        * Object literal containing the default configuration values for the CalendarNavigator
+        * The configuration object is expected to follow the format below, with the properties being
+        * case sensitive.
+        * <dl>
+        * <dt>strings</dt>
+        * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+        *     <dl>
+        *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+        *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+        *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+        *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+        *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+        *     </dl>
+        * </dd>
+        * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+        * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+        * </dl>
+        * @property _DEFAULT_CFG
+        * @protected
+        * @type Object
+        * @static
+        */
+       CN._DEFAULT_CFG = {
+               strings : {
+                       month: "Month",
+                       year: "Year",
+                       submit: "Okay",
+                       cancel: "Cancel",
+                       invalidYear : "Year needs to be a number"
+               },
+               monthFormat: YAHOO.widget.Calendar.LONG,
+               initialFocus: "year"
+       };
 
        /**
-       * The title to display above the CalendarGroup's month header
-       * @config title
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
+        * The suffix added to the Calendar/CalendarGroup's ID, to generate
+        * a unique ID for the Navigator and it's bounding box.
+        * @property YAHOO.widget.CalendarNavigator.ID_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.ID_SUFFIX = "_nav";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the month control.
+        * @property YAHOO.widget.CalendarNavigator.MONTH_SUFFIX
+        * @static
+        * @type String 
+        * @final
+        */
+       CN.MONTH_SUFFIX = "_month";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the year control.
+        * @property YAHOO.widget.CalendarNavigator.YEAR_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.YEAR_SUFFIX = "_year";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the error bounding box.
+        * @property YAHOO.widget.CalendarNavigator.ERROR_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.ERROR_SUFFIX = "_error";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the "Cancel" button.
+        * @property YAHOO.widget.CalendarNavigator.CANCEL_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.CANCEL_SUFFIX = "_cancel";
+       /**
+        * The suffix added to the Navigator's ID, to generate
+        * a unique ID for the "Submit" button.
+        * @property YAHOO.widget.CalendarNavigator.SUBMIT_SUFFIX
+        * @static
+        * @type String
+        * @final
+        */
+       CN.SUBMIT_SUFFIX = "_submit";
+
+       /**
+        * The number of digits to which the year input control is to be limited.
+        * @property YAHOO.widget.CalendarNavigator.YR_MAX_DIGITS
+        * @static
+        * @type Number
+        */
+       CN.YR_MAX_DIGITS = 4;
+
+       /**
+        * The amount by which to increment the current year value,
+        * when the arrow up/down key is pressed on the year control
+        * @property YAHOO.widget.CalendarNavigator.YR_MINOR_INC
+        * @static
+        * @type Number
+        */
+       CN.YR_MINOR_INC = 1;
+
+       /**
+        * The amount by which to increment the current year value,
+        * when the page up/down key is pressed on the year control
+        * @property YAHOO.widget.CalendarNavigator.YR_MAJOR_INC
+        * @static
+        * @type Number
+        */
+       CN.YR_MAJOR_INC = 10;
+
+       /**
+        * Artificial delay (in ms) between the time the Navigator is hidden
+        * and the Calendar/CalendarGroup state is updated. Allows the user
+        * the see the Calendar/CalendarGroup page changing. If set to 0
+        * the Calendar/CalendarGroup page will be updated instantly
+        * @property YAHOO.widget.CalendarNavigator.UPDATE_DELAY
+        * @static
+        * @type Number
+        */
+       CN.UPDATE_DELAY = 50;
+
+       /**
+        * Regular expression used to validate the year input
+        * @property YAHOO.widget.CalendarNavigator.YR_PATTERN
+        * @static
+        * @type RegExp
+        */
+       CN.YR_PATTERN = /^\d+$/;
+       /**
+        * Regular expression used to trim strings
+        * @property YAHOO.widget.CalendarNavigator.TRIM
+        * @static
+        * @type RegExp
+        */
+       CN.TRIM = /^\s*(.*?)\s*$/;
+})();
+
+YAHOO.widget.CalendarNavigator.prototype = {
+
+       /**
+        * The unique ID for this CalendarNavigator instance
+        * @property id
+        * @type String
+        */
+       id : null,
 
        /**
-       * Whether or not a close button should be displayed for this CalendarGroup
-       * @config close
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
+        * The Calendar/CalendarGroup instance to which the navigator belongs
+        * @property cal
+        * @type {Calendar|CalendarGroup}
+        */
+       cal : null,
 
        /**
-       * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
-       * enabled if required.
-       * 
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all other browsers
-       */
-       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+        * Reference to the HTMLElement used to render the navigator's bounding box
+        * @property navEl
+        * @type HTMLElement
+        */
+       navEl : null,
 
        /**
-       * The minimum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config mindate
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to render the navigator's mask
+        * @property maskEl
+        * @type HTMLElement
+        */
+       maskEl : null,
 
        /**
-       * The maximum selectable date in the current Calendar (mm/dd/yyyy)
-       * @config maxdate
-       * @type String
-       * @default null
-       */      
-       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
-
-       // Options properties
+        * Reference to the HTMLElement used to input the year
+        * @property yearEl
+        * @type HTMLElement
+        */
+       yearEl : null,
 
        /**
-       * True if the Calendar should allow multiple selections. False by default.
-       * @config MULTI_SELECT
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+        * Reference to the HTMLElement used to input the month
+        * @property monthEl
+        * @type HTMLElement
+        */
+       monthEl : null,
 
        /**
-       * The weekday the week begins on. Default is 0 (Sunday).
-       * @config START_WEEKDAY
-       * @type number
-       * @default 0
-       */      
-       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
-       
-       /**
-       * True if the Calendar should show weekday labels. True by default.
-       * @config SHOW_WEEKDAYS
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should show week row headers. False by default.
-       * @config SHOW_WEEK_HEADER
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should show week row footers. False by default.
-       * @config SHOW_WEEK_FOOTER
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-       * @config HIDE_BLANK_WEEKS
-       * @type Boolean
-       * @default false
-       */              
-       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
-       
-       /**
-       * The image that should be used for the left navigation arrow.
-       * @config NAV_ARROW_LEFT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
-       * @default null
-       */              
-       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
-       
-       /**
-       * The image that should be used for the right navigation arrow.
-       * @config NAV_ARROW_RIGHT
-       * @type String
-       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-       * @default null
-       */              
-       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to display validation errors
+        * @property errorEl
+        * @type HTMLElement
+        */
+       errorEl : null,
 
-       // Locale properties
-       
-       /**
-       * The short month labels for the current locale.
-       * @config MONTHS_SHORT
-       * @type String[]
-       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-       */
-       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
-       
-       /**
-       * The long month labels for the current locale.
-       * @config MONTHS_LONG
-       * @type String[]
-       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-       */              
-       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
-       
        /**
-       * The 1-character weekday labels for the current locale.
-       * @config WEEKDAYS_1CHAR
-       * @type String[]
-       * @default ["S", "M", "T", "W", "T", "F", "S"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to update the Calendar/Calendar group
+        * with the month/year values
+        * @property submitEl
+        * @type HTMLElement
+        */
+       submitEl : null,
        
        /**
-       * The short weekday labels for the current locale.
-       * @config WEEKDAYS_SHORT
-       * @type String[]
-       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
+        * Reference to the HTMLElement used to hide the navigator without updating the 
+        * Calendar/Calendar group
+        * @property cancelEl
+        * @type HTMLElement
+        */
+       cancelEl : null,
+
+       /** 
+        * Reference to the first focusable control in the navigator (by default monthEl)
+        * @property firstCtrl
+        * @type HTMLElement
+        */
+       firstCtrl : null,
        
-       /**
-       * The medium weekday labels for the current locale.
-       * @config WEEKDAYS_MEDIUM
-       * @type String[]
-       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+       /** 
+        * Reference to the last focusable control in the navigator (by default cancelEl)
+        * @property lastCtrl
+        * @type HTMLElement
+        */
+       lastCtrl : null,
+
+       /**
+        * The document containing the Calendar/Calendar group instance
+        * @protected
+        * @property _doc
+        * @type HTMLDocument
+        */
+       _doc : null,
+
+       /**
+        * Internal state property for the current year displayed in the navigator
+        * @protected
+        * @property _year
+        * @type Number
+        */
+       _year: null,
        
        /**
-       * The long weekday labels for the current locale.
-       * @config WEEKDAYS_LONG
-       * @type String[]
-       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-       */              
-       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
-
-       /**
-       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-       * @config LOCALE_MONTHS
-       * @type String
-       * @default "long"
-       */
-       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
-
-       /**
-       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-       * @config LOCALE_WEEKDAYS
-       * @type String
-       * @default "short"
-       */      
-       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+        * Internal state property for the current month index displayed in the navigator
+        * @protected
+        * @property _month
+        * @type Number
+        */
+       _month: 0,
 
        /**
-       * The value used to delimit individual dates in a date string passed to various Calendar functions.
-       * @config DATE_DELIMITER
-       * @type String
-       * @default ","
-       */
-       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+        * Private internal state property which indicates whether or not the 
+        * Navigator has been rendered.
+        * @private
+        * @property __rendered
+        * @type Boolean
+        */
+       __rendered: false,
 
        /**
-       * The value used to delimit date fields in a date string passed to various Calendar functions.
-       * @config DATE_FIELD_DELIMITER
-       * @type String
-       * @default "/"
-       */      
-       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
+        * Init lifecycle method called as part of construction
+        * 
+        * @method init
+        * @param {Calendar} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached
+        */
+       init : function(cal) {
+               var calBox = cal.oDomContainer;
 
-       /**
-       * The value used to delimit date ranges in a date string passed to various Calendar functions.
-       * @config DATE_RANGE_DELIMITER
-       * @type String
-       * @default "-"
-       */
-       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
+               this.cal = cal;
+               this.id = calBox.id + YAHOO.widget.CalendarNavigator.ID_SUFFIX;
+               this._doc = calBox.ownerDocument;
 
-       /**
-       * The position of the month in a month/year date string
-       * @config MY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the year in a month/year date string
-       * @config MY_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in a month/day date string
-       * @config MD_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */      
-       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the day in a month/year date string
-       * @config MD_DAY_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the month in a month/day/year date string
-       * @config MDY_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */      
-       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the day in a month/day/year date string
-       * @config MDY_DAY_POSITION
-       * @type Number
-       * @default 2
-       */      
-       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The position of the year in a month/day/year date string
-       * @config MDY_YEAR_POSITION
-       * @type Number
-       * @default 3
-       */      
-       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+               /**
+                * Private flag, to identify IE6/IE7 Quirks
+                * @private
+                * @property __isIEQuirks
+                */
+               var ie = YAHOO.env.ua.ie;
+               this.__isIEQuirks = (ie && ((ie <= 6) || (ie === 7 && this._doc.compatMode == "BackCompat")));
+       },
 
        /**
-       * The position of the month in the month year label string used as the Calendar header
-       * @config MY_LABEL_MONTH_POSITION
-       * @type Number
-       * @default 1
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+        * Displays the navigator and mask, updating the input controls to reflect the 
+        * currently set month and year. The show method will invoke the render method
+        * if the navigator has not been renderered already, allowing for lazy rendering
+        * of the control.
+        * 
+        * The show method will fire the Calendar/CalendarGroup's beforeShowNav and showNav events
+        * 
+        * @method show
+        */
+       show : function() {
+               var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+               if (this.cal.beforeShowNavEvent.fire()) {
+                       if (!this.__rendered) {
+                               this.render();
+                       }
+                       this.clearErrors();
 
-       /**
-       * The position of the year in the month year label string used as the Calendar header
-       * @config MY_LABEL_YEAR_POSITION
-       * @type Number
-       * @default 2
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The suffix used after the month when rendering the Calendar header
-       * @config MY_LABEL_MONTH_SUFFIX
-       * @type String
-       * @default " "
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
-       
-       /**
-       * The suffix used after the year when rendering the Calendar header
-       * @config MY_LABEL_YEAR_SUFFIX
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
-};
+                       this._updateMonthUI();
+                       this._updateYearUI();
+                       this._show(this.navEl, true);
 
-/**
-* Initializes CalendarGroup's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
-       var me = this;
-       var strEvent = "Event";
+                       this.setInitialFocus();
+                       this.showMask();
 
-       /**
-       * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
-       * @method sub
-       * @private
-       * @param {Function} fn  The function to subscribe to this CustomEvent
-       * @param {Object}       obj     The CustomEvent's scope object
-       * @param {Boolean}      bOverride       Whether or not to apply scope correction
-       */
-       var sub = function(fn, obj, bOverride) {
-               for (var p=0;p<me.pages.length;++p) {
-                       var cal = me.pages[p];
-                       cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+                       YAHOO.util.Dom.addClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+                       this.cal.showNavEvent.fire();
                }
-       };
+       },
 
        /**
-       * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
-       * @method unsub
-       * @private
-       * @param {Function} fn  The function to subscribe to this CustomEvent
-       * @param {Object}       obj     The CustomEvent's scope object
-       */
-       var unsub = function(fn, obj) {
-               for (var p=0;p<me.pages.length;++p) {
-                       var cal = me.pages[p];
-                       cal[this.type + strEvent].unsubscribe(fn, obj);
+        * Hides the navigator and mask
+        * 
+        * The show method will fire the Calendar/CalendarGroup's beforeHideNav event and hideNav events
+        * @method hide
+        */
+       hide : function() {
+               var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+               if (this.cal.beforeHideNavEvent.fire()) {
+                       this._show(this.navEl, false);
+                       this.hideMask();
+                       YAHOO.util.Dom.removeClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+                       this.cal.hideNavEvent.fire();
                }
-       };
+       },
        
-       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
 
        /**
-       * Fired before a selection is made
-       * @event beforeSelectEvent
-       */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
-       this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+        * Displays the navigator's mask element
+        * 
+        * @method showMask
+        */
+       showMask : function() {
+               this._show(this.maskEl, true);
+               if (this.__isIEQuirks) {
+                       this._syncMask();
+               }
+       },
 
        /**
-       * Fired when a selection is made
-       * @event selectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
-       this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+        * Hides the navigator's mask element
+        * 
+        * @method hideMask
+        */
+       hideMask : function() {
+               this._show(this.maskEl, false);
+       },
 
        /**
-       * Fired before a selection is made
-       * @event beforeDeselectEvent
-       */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
-       this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+        * Returns the current month set on the navigator
+        * 
+        * Note: This may not be the month set in the UI, if 
+        * the UI contains an invalid value.
+        * 
+        * @method getMonth
+        * @return {Number} The Navigator's current month index
+        */
+       getMonth: function() {
+               return this._month;
+       },
 
        /**
-       * Fired when a selection is made
-       * @event deselectEvent
-       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
-       */
-       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
-       this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
-       
-       /**
-       * Fired when the Calendar page is changed
-       * @event changePageEvent
-       */
-       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
-       this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+        * Returns the current year set on the navigator
+        * 
+        * Note: This may not be the year set in the UI, if 
+        * the UI contains an invalid value.
+        * 
+        * @method getYear
+        * @return {Number} The Navigator's current year value
+        */
+       getYear: function() {
+               return this._year;
+       },
 
        /**
-       * Fired before the Calendar is rendered
-       * @event beforeRenderEvent
-       */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
-       this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+        * Sets the current month on the Navigator, and updates the UI
+        * 
+        * @method setMonth
+        * @param {Number} nMonth The month index, from 0 (Jan) through 11 (Dec).
+        */
+       setMonth : function(nMonth) {
+               if (nMonth >= 0 && nMonth < 12) {
+                       this._month = nMonth;
+               }
+               this._updateMonthUI();
+       },
 
        /**
-       * Fired when the Calendar is rendered
-       * @event renderEvent
-       */
-       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
-       this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+        * Sets the current year on the Navigator, and updates the UI. If the 
+        * provided year is invalid, it will not be set.
+        * 
+        * @method setYear
+        * @param {Number} nYear The full year value to set the Navigator to.
+        */
+       setYear : function(nYear) {
+               var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN;
+               if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
+                       this._year = nYear;
+               }
+               this._updateYearUI();
+       },
 
        /**
-       * Fired when the Calendar is reset
-       * @event resetEvent
-       */
-       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
-       this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+        * Renders the HTML for the navigator, adding it to the 
+        * document and attaches event listeners if it has not 
+        * already been rendered.
+        * 
+        * @method render
+        */
+       render: function() {
+               this.cal.beforeRenderNavEvent.fire();
+               if (!this.__rendered) {
+                       this.createNav();
+                       this.createMask();
+                       this.applyListeners();
+                       this.__rendered = true;
+               }
+               this.cal.renderNavEvent.fire();
+       },
 
        /**
-       * Fired when the Calendar is cleared
-       * @event clearEvent
-       */
-       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
-       this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
+        * Creates the navigator's containing HTMLElement, it's contents, and appends 
+        * the containg element to the Calendar/CalendarGroup's container.
+        * 
+        * @method createNav
+        */
+       createNav : function() {
+               var NAV = YAHOO.widget.CalendarNavigator;
+               var doc = this._doc;
 
-};
+               var d = doc.createElement("div");
+               d.className = NAV.CLASSES.NAV;
 
-/**
-* The default Config handler for the "pages" property
-* @method configPages
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
-       var pageCount = args[0];
+               var htmlBuf = this.renderNavContents([]);
 
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               d.innerHTML = htmlBuf.join('');
+               this.cal.oDomContainer.appendChild(d);
 
-       // Define literals outside loop 
-       var sep = "_";
-       var groupCalClass = "groupcal";
+               this.navEl = d;
 
-       var firstClass = "first-of-type";
-       var lastClass = "last-of-type";
+               this.yearEl = doc.getElementById(this.id + NAV.YEAR_SUFFIX);
+               this.monthEl = doc.getElementById(this.id + NAV.MONTH_SUFFIX);
+               this.errorEl = doc.getElementById(this.id + NAV.ERROR_SUFFIX);
+               this.submitEl = doc.getElementById(this.id + NAV.SUBMIT_SUFFIX);
+               this.cancelEl = doc.getElementById(this.id + NAV.CANCEL_SUFFIX);
 
-       for (var p=0;p<pageCount;++p) {
-               var calId = this.id + sep + p;
-               var calContainerId = this.containerId + sep + p;
+               if (YAHOO.env.ua.gecko && this.yearEl && this.yearEl.type == "text") {
+                       // Avoid XUL error on focus, select [ https://bugzilla.mozilla.org/show_bug.cgi?id=236791, 
+                       // supposedly fixed in 1.8.1, but there are reports of it still being around for methods other than blur ]
+                       this.yearEl.setAttribute("autocomplete", "off");
+               }
 
-               var childConfig = this.cfg.getConfig();
-               childConfig.close = false;
-               childConfig.title = false;
+               this._setFirstLastElements();
+       },
 
-               var cal = this.constructChild(calId, calContainerId, childConfig);
-               var caldate = cal.cfg.getProperty(cfgPageDate);
-               this._setMonthOnDate(caldate, caldate.getMonth() + p);
-               cal.cfg.setProperty(cfgPageDate, caldate);
+       /**
+        * Creates the Mask HTMLElement and appends it to the Calendar/CalendarGroups
+        * container.
+        * 
+        * @method createMask
+        */
+       createMask : function() {
+               var C = YAHOO.widget.CalendarNavigator.CLASSES;
 
-               YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
-               YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
+               var d = this._doc.createElement("div");
+               d.className = C.MASK;
 
-               if (p===0) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
-               }
+               this.cal.oDomContainer.appendChild(d);
+               this.maskEl = d;
+       },
 
-               if (p==(pageCount-1)) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
+       /**
+        * Used to set the width/height of the mask in pixels to match the Calendar Container.
+        * Currently only used for IE6 and IE7 quirks mode. The other A-Grade browser are handled using CSS (width/height 100%).
+        * <p>
+        * The method is also registered as an HTMLElement resize listener on the Calendars container element.
+        * </p>
+        * @protected
+        * @method _syncMask
+        */
+       _syncMask : function() {
+               var c = this.cal.oDomContainer;
+               if (c && this.maskEl) {
+                       var r = YAHOO.util.Dom.getRegion(c);
+                       YAHOO.util.Dom.setStyle(this.maskEl, "width", r.right - r.left + "px");
+                       YAHOO.util.Dom.setStyle(this.maskEl, "height", r.bottom - r.top + "px");
                }
+       },
 
-               cal.parent = this;
-               cal.index = p; 
-
-               this.pages[this.pages.length] = cal;
-       }
-};
+       /**
+        * Renders the contents of the navigator
+        * 
+        * @method renderNavContents
+        * 
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderNavContents : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES,
+                       h = html; // just to use a shorter name
+
+               h[h.length] = '<div class="' + C.MONTH + '">';
+               this.renderMonth(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.YEAR + '">';
+               this.renderYear(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.BUTTONS + '">';
+               this.renderButtons(h);
+               h[h.length] = '</div>';
+               h[h.length] = '<div class="' + C.ERROR + '" id="' + this.id + NAV.ERROR_SUFFIX + '"></div>';
+
+               return h;
+       },
 
-/**
-* The default Config handler for the "pagedate" property
-* @method configPageDate
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {
-       var val = args[0];
-       var firstPageDate;
-       
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-       
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               if (p === 0) {
-                       firstPageDate = cal._parsePageDate(val);
-                       cal.cfg.setProperty(cfgPageDate, firstPageDate);
-               } else {
-                       var pageDate = new Date(firstPageDate);
-                       this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
-                       cal.cfg.setProperty(cfgPageDate, pageDate);
+       /**
+        * Renders the month label and control for the navigator
+        * 
+        * @method renderNavContents
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderMonth : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES;
+
+               var id = this.id + NAV.MONTH_SUFFIX,
+                       mf = this.__getCfg("monthFormat"),
+                       months = this.cal.cfg.getProperty((mf == YAHOO.widget.Calendar.SHORT) ? "MONTHS_SHORT" : "MONTHS_LONG"),
+                       h = html;
+
+               if (months && months.length > 0) {
+                       h[h.length] = '<label for="' + id + '">';
+                       h[h.length] = this.__getCfg("month", true);
+                       h[h.length] = '</label>';
+                       h[h.length] = '<select name="' + id + '" id="' + id + '" class="' + C.MONTH_CTRL + '">';
+                       for (var i = 0; i < months.length; i++) {
+                               h[h.length] = '<option value="' + i + '">';
+                               h[h.length] = months[i];
+                               h[h.length] = '</option>';
+                       }
+                       h[h.length] = '</select>';
                }
-       }
-};
-
-/**
-* The default Config handler for the CalendarGroup "selected" property
-* @method configSelected
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configSelected = function(type, args, obj) {
-       var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
-       this.delegateConfig(type, args, obj);
-       var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
-       this.cfg.setProperty(cfgSelected, selected, true);
-};
-
-
-/**
-* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
-* @method delegateConfig
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj) {
-       var val = args[0];
-       var cal;
-
-       for (var p=0;p<this.pages.length;p++) {
-               cal = this.pages[p];
-               cal.cfg.setProperty(type, val);
-       }
-};
-
+               return h;
+       },
 
-/**
-* Adds a function to all child Calendars within this CalendarGroup.
-* @method setChildFunction
-* @param {String}              fnName          The name of the function
-* @param {Function}            fn                      The function to apply to each Calendar page object
-*/
-YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
-       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       /**
+        * Renders the year label and control for the navigator
+        * 
+        * @method renderYear
+        * @param {Array} html The HTML buffer to append the HTML to.
+        * @return {Array} A reference to the buffer passed in.
+        */
+       renderYear : function(html) {
+               var NAV = YAHOO.widget.CalendarNavigator,
+                       C = NAV.CLASSES;
+
+               var id = this.id + NAV.YEAR_SUFFIX,
+                       size = NAV.YR_MAX_DIGITS,
+                       h = html;
+
+               h[h.length] = '<label for="' + id + '">';
+               h[h.length] = this.__getCfg("year", true);
+               h[h.length] = '</label>';
+               h[h.length] = '<input type="text" name="' + id + '" id="' + id + '" class="' + C.YEAR_CTRL + '" maxlength="' + size + '"/>';
+               return h;
+       },
 
-       for (var p=0;p<pageCount;++p) {
-               this.pages[p][fnName] = fn;
-       }
-};
+       /**
+        * Renders the submit/cancel buttons for the navigator
+        * 
+        * @method renderButton
+        * @return {String} The HTML created for the Button UI
+        */
+       renderButtons : function(html) {
+               var C = YAHOO.widget.CalendarNavigator.CLASSES;
+               var h = html;
+
+               h[h.length] = '<span class="' + C.BUTTON + ' ' + C.DEFAULT + '">';
+               h[h.length] = '<button type="button" id="' + this.id + '_submit' + '">';
+               h[h.length] = this.__getCfg("submit", true);
+               h[h.length] = '</button>';
+               h[h.length] = '</span>';
+               h[h.length] = '<span class="' + C.BUTTON +'">';
+               h[h.length] = '<button type="button" id="' + this.id + '_cancel' + '">';
+               h[h.length] = this.__getCfg("cancel", true);
+               h[h.length] = '</button>';
+               h[h.length] = '</span>';
+
+               return h;
+       },
 
-/**
-* Calls a function within all child Calendars within this CalendarGroup.
-* @method callChildFunction
-* @param {String}              fnName          The name of the function
-* @param {Array}               args            The arguments to pass to the function
-*/
-YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {
-       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+       /**
+        * Attaches DOM event listeners to the rendered elements
+        * <p>
+        * The method will call applyKeyListeners, to setup keyboard specific 
+        * listeners
+        * </p>
+        * @method applyListeners
+        */
+       applyListeners : function() {
+               var E = YAHOO.util.Event;
 
-       for (var p=0;p<pageCount;++p) {
-               var page = this.pages[p];
-               if (page[fnName]) {
-                       var fn = page[fnName];
-                       fn.call(page, args);
+               function yearUpdateHandler() {
+                       if (this.validate()) {
+                               this.setYear(this._getYearFromUI());
+                       }
                }
-       }       
-};
-
-/**
-* Constructs a child calendar. This method can be overridden if a subclassed version of the default
-* calendar is to be used.
-* @method constructChild
-* @param {String}      id                      The id of the table element that will represent the calendar widget
-* @param {String}      containerId     The id of the container div element that will wrap the calendar table
-* @param {Object}      config          The configuration object containing the Calendar's arguments
-* @return {YAHOO.widget.Calendar}      The YAHOO.widget.Calendar instance that is constructed
-*/
-YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,config) {
-       var container = document.getElementById(containerId);
-       if (! container) {
-               container = document.createElement("div");
-               container.id = containerId;
-               this.oDomContainer.appendChild(container);
-       }
-       return new YAHOO.widget.Calendar(id,containerId,config);
-};
-
 
-/**
-* Sets the calendar group's month explicitly. This month will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setMonth
-* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
-*/
-YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
-       month = parseInt(month, 10);
-       var currYear;
-       
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-       
-       for (var p=0; p<this.pages.length; ++p) {
-               var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty(cfgPageDate);
-               if (p === 0) {
-                       currYear = pageDate.getFullYear();
-               } else {
-                       pageDate.setYear(currYear);
+               function monthUpdateHandler() {
+                       this.setMonth(this._getMonthFromUI());
                }
-               this._setMonthOnDate(pageDate, month+p); 
-               cal.cfg.setProperty(cfgPageDate, pageDate);
-       }
-};
-
-/**
-* Sets the calendar group's year explicitly. This year will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setYear
-* @param {Number}      year            The numeric 4-digit year
-*/
-YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {
 
-       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+               E.on(this.submitEl, "click", this.submit, this, true);
+               E.on(this.cancelEl, "click", this.cancel, this, true);
+               E.on(this.yearEl, "blur", yearUpdateHandler, this, true);
+               E.on(this.monthEl, "change", monthUpdateHandler, this, true);
 
-       year = parseInt(year, 10);
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty(cfgPageDate);
-
-               if ((pageDate.getMonth()+1) == 1 && p>0) {
-                       year+=1;
+               if (this.__isIEQuirks) {
+                       YAHOO.util.Event.on(this.cal.oDomContainer, "resize", this._syncMask, this, true);
                }
-               cal.setYear(year);
-       }
-};
-/**
-* Calls the render function of all child calendars within the group.
-* @method render
-*/
-YAHOO.widget.CalendarGroup.prototype.render = function() {
-       this.renderHeader();
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.render();
-       }
-       this.renderFooter();
-};
-
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method select
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.select = function(date) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.select(date);
-       }
-       return this.getSelectedDates();
-};
 
-/**
-* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
-* <ul>
-*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
-*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
-* </ul>
-* @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to be selected. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.selectCell(cellIndex);
-       }
-       return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method deselect
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. 
-* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselect = function(date) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselect(date);
-       }
-       return this.getSelectedDates();
-};
+               this.applyKeyListeners();
+       },
 
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.
-*                                              Assuming that this function executes properly, the return value should be an empty array.
-*                                              However, the empty array is returned for the sake of being able to check the selection status
-*                                              of the calendar.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselectAll();
-       }
-       return this.getSelectedDates();
-};
+       /**
+        * Removes/purges DOM event listeners from the rendered elements
+        * 
+        * @method purgeListeners
+        */
+       purgeListeners : function() {
+               var E = YAHOO.util.Event;
+               E.removeListener(this.submitEl, "click", this.submit);
+               E.removeListener(this.cancelEl, "click", this.cancel);
+               E.removeListener(this.yearEl, "blur");
+               E.removeListener(this.monthEl, "change");
+               if (this.__isIEQuirks) {
+                       E.removeListener(this.cal.oDomContainer, "resize", this._syncMask);
+               }
 
-/**
-* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
-*
-* @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect. 
-* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.deselectCell(cellIndex);
-       }
-       return this.getSelectedDates();
-};
+               this.purgeKeyListeners();
+       },
 
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.CalendarGroup.prototype.reset = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.reset();
-       }
-};
+       /**
+        * Attaches DOM listeners for keyboard support. 
+        * Tab/Shift-Tab looping, Enter Key Submit on Year element,
+        * Up/Down/PgUp/PgDown year increment on Year element
+        * <p>
+        * NOTE: MacOSX Safari 2.x doesn't let you tab to buttons and 
+        * MacOSX Gecko does not let you tab to buttons or select controls,
+        * so for these browsers, Tab/Shift-Tab looping is limited to the 
+        * elements which can be reached using the tab key.
+        * </p>
+        * @method applyKeyListeners
+        */
+       applyKeyListeners : function() {
+               var E = YAHOO.util.Event;
+
+               // IE doesn't fire keypress for arrow/pg keys (non-char keys)
+               var ua = YAHOO.env.ua;
+               var arrowEvt = (ua.ie) ? "keydown" : "keypress";
+
+               // - IE doesn't fire keypress for non-char keys
+               // - Opera doesn't allow us to cancel keydown or keypress for tab, but 
+               //   changes focus successfully on keydown (keypress is too late to change focus - opera's already moved on).
+               var tabEvt = (ua.ie || ua.opera) ? "keydown" : "keypress";
+
+               // Everyone likes keypress for Enter (char keys) - whoo hoo!
+               E.on(this.yearEl, "keypress", this._handleEnterKey, this, true);
+
+               E.on(this.yearEl, arrowEvt, this._handleDirectionKeys, this, true);
+               E.on(this.lastCtrl, tabEvt, this._handleTabKey, this, true);
+               E.on(this.firstCtrl, tabEvt, this._handleShiftTabKey, this, true);
+       },
 
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.CalendarGroup.prototype.clear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.clear();
-       }
-};
+       /**
+        * Removes/purges DOM listeners for keyboard support
+        *
+        * @method purgeKeyListeners
+        */
+       purgeKeyListeners : function() {
+               var E = YAHOO.util.Event;
 
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.nextMonth = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.nextMonth();
-       }
-};
+               var arrowEvt = (YAHOO.env.ua.ie) ? "keydown" : "keypress";
+               var tabEvt = (YAHOO.env.ua.ie || YAHOO.env.ua.opera) ? "keydown" : "keypress";
 
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.previousMonth = function() {
-       for (var p=this.pages.length-1;p>=0;--p) {
-               var cal = this.pages[p];
-               cal.previousMonth();
-       }
-};
+               E.removeListener(this.yearEl, "keypress", this._handleEnterKey);
+               E.removeListener(this.yearEl, arrowEvt, this._handleDirectionKeys);
+               E.removeListener(this.lastCtrl, tabEvt, this._handleTabKey);
+               E.removeListener(this.firstCtrl, tabEvt, this._handleShiftTabKey);
+       },
 
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.CalendarGroup.prototype.nextYear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.nextYear();
-       }
-};
+       /**
+        * Updates the Calendar/CalendarGroup's pagedate with the currently set month and year if valid.
+        * <p>
+        * If the currently set month/year is invalid, a validation error will be displayed and the 
+        * Calendar/CalendarGroup's pagedate will not be updated.
+        * </p>
+        * @method submit
+        */
+       submit : function() {
+               if (this.validate()) {
+                       this.hide();
 
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.CalendarGroup.prototype.previousYear = function() {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.previousYear();
-       }
-};
+                       this.setMonth(this._getMonthFromUI());
+                       this.setYear(this._getYearFromUI());
 
+                       var cal = this.cal;
+                       var nav = this;
+                       
+                       function update() {
+                               cal.setYear(nav.getYear());
+                               cal.setMonth(nav.getMonth());
+                               cal.render();
+                       }
+                       // Artificial delay, just to help the user see something changed
+                       var delay = YAHOO.widget.CalendarNavigator.UPDATE_DELAY;
+                       if (delay > 0) {
+                               window.setTimeout(update, delay);
+                       } else {
+                               update();
+                       }
+               }
+       },
 
-/**
-* Gets the list of currently selected dates from the calendar.
-* @return                      An array of currently selected JavaScript Date objects.
-* @type Date[]
-*/
-YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { 
-       var returnDates = [];
-       var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
-       for (var d=0;d<selected.length;++d) {
-               var dateArray = selected[d];
-
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-               returnDates.push(date);
-       }
+       /**
+        * Hides the navigator and mask, without updating the Calendar/CalendarGroup's state
+        * 
+        * @method cancel
+        */
+       cancel : function() {
+               this.hide();
+       },
 
-       returnDates.sort( function(a,b) { return a-b; } );
-       return returnDates;
-};
+       /**
+        * Validates the current state of the UI controls
+        * 
+        * @method validate
+        * @return {Boolean} true, if the current UI state contains valid values, false if not
+        */
+       validate : function() {
+               if (this._getYearFromUI() !== null) {
+                       this.clearErrors();
+                       return true;
+               } else {
+                       this.setYearError();
+                       this.setError(this.__getCfg("invalidYear", true));
+                       return false;
+               }
+       },
 
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addRenderer = function(sDates, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addRenderer(sDates, fnRender);
-       }
-};
+       /**
+        * Displays an error message in the Navigator's error panel
+        * @method setError
+        * @param {String} msg The error message to display
+        */
+       setError : function(msg) {
+               if (this.errorEl) {
+                       this.errorEl.innerHTML = msg;
+                       this._show(this.errorEl, true);
+               }
+       },
 
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param       {Number}        month           The month (1-12) to associate with this renderer
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addMonthRenderer(month, fnRender);
-       }
-};
+       /**
+        * Clears the navigator's error message and hides the error panel
+        * @method clearError 
+        */
+       clearError : function() {
+               if (this.errorEl) {
+                       this.errorEl.innerHTML = "";
+                       this._show(this.errorEl, false);
+               }
+       },
 
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               cal.addWeekdayRenderer(weekday, fnRender);
-       }
-};
+       /**
+        * Displays the validation error UI for the year control
+        * @method setYearError
+        */
+       setYearError : function() {
+               YAHOO.util.Dom.addClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+       },
 
-/**
-* Renders the header for the CalendarGroup.
-* @method renderHeader
-*/
-YAHOO.widget.CalendarGroup.prototype.renderHeader = function() {};
+       /**
+        * Removes the validation error UI for the year control
+        * @method clearYearError
+        */
+       clearYearError : function() {
+               YAHOO.util.Dom.removeClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+       },
 
-/**
-* Renders a footer for the 2-up calendar container. By default, this method is
-* unimplemented.
-* @method renderFooter
-*/
-YAHOO.widget.CalendarGroup.prototype.renderFooter = function() {};
+       /**
+        * Clears all validation and error messages in the UI
+        * @method clearErrors
+        */
+       clearErrors : function() {
+               this.clearError();
+               this.clearYearError();
+       },
 
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}      count   The number of months to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonths = function(count) {
-       this.callChildFunction("addMonths", count);
-};
+       /**
+        * Sets the initial focus, based on the configured value
+        * @method setInitialFocus
+        */
+       setInitialFocus : function() {
+               var el = this.submitEl;
+               var f = this.__getCfg("initialFocus");
+
+               if (f && f.toLowerCase) {
+                       f = f.toLowerCase();
+                       if (f == "year") {
+                               el = this.yearEl;
+                               try {
+                                       this.yearEl.select();
+                               } catch (e) {
+                                       // Ignore;
+                               }
+                       } else if (f == "month") {
+                               el = this.monthEl;
+                       }
+               }
 
+               if (el && YAHOO.lang.isFunction(el.focus)) {
+                       try {
+                               el.focus();
+                       } catch (e) {
+                               // TODO: Fall back if focus fails?
+                       }
+               }
+       },
 
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}      count   The number of months to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractMonths = function(count) {
-       this.callChildFunction("subtractMonths", count);
-};
+       /**
+        * Removes all renderered HTML elements for the Navigator from
+        * the DOM, purges event listeners and clears (nulls) any property
+        * references to HTML references
+        * @method erase
+        */
+       erase : function() {
+               if (this.__rendered) {
+                       this.purgeListeners();
+
+                       // Clear out innerHTML references
+                       this.yearEl = null;
+                       this.monthEl = null;
+                       this.errorEl = null;
+                       this.submitEl = null;
+                       this.cancelEl = null;
+                       this.firstCtrl = null;
+                       this.lastCtrl = null;
+                       if (this.navEl) {
+                               this.navEl.innerHTML = "";
+                       }
 
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}      count   The number of years to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addYears = function(count) {
-       this.callChildFunction("addYears", count);
-};
+                       var p = this.navEl.parentNode;
+                       if (p) {
+                               p.removeChild(this.navEl);
+                       }
+                       this.navEl = null;
 
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}      count   The number of years to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {
-       this.callChildFunction("subtractYears", count);
-};
+                       var pm = this.maskEl.parentNode;
+                       if (pm) {
+                               pm.removeChild(this.maskEl);
+                       }
+                       this.maskEl = null;
+                       this.__rendered = false;
+               }
+       },
 
-/**
-* Shows the CalendarGroup's outer container.
-* @method show
-*/
-YAHOO.widget.CalendarGroup.prototype.show = function() {
-       this.oDomContainer.style.display = "block";
-       if (YAHOO.env.ua.opera) {
-               this._fixWidth();
-       }
-};
+       /**
+        * Destroys the Navigator object and any HTML references
+        * @method destroy
+        */
+       destroy : function() {
+               this.erase();
+               this._doc = null;
+               this.cal = null;
+               this.id = null;
+       },
 
-/**
-* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
-* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
-* @method      _setMonthOnDate
-* @private
-* @param       {Date}  date    The Date object on which to set the month index
-* @param       {Number}        iMonth  The month index to set
-*/
-YAHOO.widget.CalendarGroup.prototype._setMonthOnDate = function(date, iMonth) {
-       // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
-       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
-               var DM = YAHOO.widget.DateMath;
-               var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
-               date.setTime(newDate.getTime());
-       } else {
-               date.setMonth(iMonth);
-       }
-};
+       /**
+        * Protected implementation to handle how UI elements are 
+        * hidden/shown.
+        *
+        * @method _show
+        * @protected
+        */
+       _show : function(el, bShow) {
+               if (el) {
+                       YAHOO.util.Dom.setStyle(el, "display", (bShow) ? "block" : "none");
+               }
+       },
 
-/**
- * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
- * @method _fixWidth
- * @private
- */
-YAHOO.widget.CalendarGroup.prototype._fixWidth = function() {
-       var startW = this.oDomContainer.offsetWidth;
-       var w = 0;
-       for (var p=0;p<this.pages.length;++p) {
-               var cal = this.pages[p];
-               w += cal.oDomContainer.offsetWidth;
-       }
-       if (w > 0) {
-               this.oDomContainer.style.width = w + "px";
-       }
-};
+       /**
+        * Returns the month value (index), from the month UI element
+        * @protected
+        * @method _getMonthFromUI
+        * @return {Number} The month index, or 0 if a UI element for the month
+        * is not found
+        */
+       _getMonthFromUI : function() {
+               if (this.monthEl) {
+                       return this.monthEl.selectedIndex;
+               } else {
+                       return 0; // Default to Jan
+               }
+       },
 
+       /**
+        * Returns the year value, from the Navitator's year UI element
+        * @protected
+        * @method _getYearFromUI
+        * @return {Number} The year value set in the UI, if valid. null is returned if 
+        * the UI does not contain a valid year value.
+        */
+       _getYearFromUI : function() {
+               var NAV = YAHOO.widget.CalendarNavigator;
 
-/**
-* CSS class representing the container for the calendar
-* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";
+               var yr = null;
+               if (this.yearEl) {
+                       var value = this.yearEl.value;
+                       value = value.replace(NAV.TRIM, "$1");
 
-/**
-* CSS class representing the container for the calendar
-* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";
+                       if (NAV.YR_PATTERN.test(value)) {
+                               yr = parseInt(value, 10);
+                       }
+               }
+               return yr;
+       },
 
-/**
-* CSS class representing the title for the 2-up calendar
-* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
+       /**
+        * Updates the Navigator's year UI, based on the year value set on the Navigator object
+        * @protected
+        * @method _updateYearUI
+        */
+       _updateYearUI : function() {
+               if (this.yearEl && this._year !== null) {
+                       this.yearEl.value = this._year;
+               }
+       },
 
-/**
-* CSS class representing the close icon for the 2-up calendar
-* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
-* @static
-* @final
-* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
-*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
-* @type String
-*/
-YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
+       /**
+        * Updates the Navigator's month UI, based on the month value set on the Navigator object
+        * @protected
+        * @method _updateMonthUI
+        */
+       _updateMonthUI : function() {
+               if (this.monthEl) {
+                       this.monthEl.selectedIndex = this._month;
+               }
+       },
 
-YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
-                                                                                                                                "buildMonthLabel",
-                                                                                                                                "renderOutOfBoundsDate",
-                                                                                                                                "renderRowHeader",
-                                                                                                                                "renderRowFooter",
-                                                                                                                                "renderCellDefault",
-                                                                                                                                "styleCellDefault",
-                                                                                                                                "renderCellStyleHighlight1",
-                                                                                                                                "renderCellStyleHighlight2",
-                                                                                                                                "renderCellStyleHighlight3",
-                                                                                                                                "renderCellStyleHighlight4",
-                                                                                                                                "renderCellStyleToday",
-                                                                                                                                "renderCellStyleSelected",
-                                                                                                                                "renderCellNotThisMonth",
-                                                                                                                                "renderBodyCellRestricted",
-                                                                                                                                "initStyles",
-                                                                                                                                "configTitle",
-                                                                                                                                "configClose",
-                                                                                                                                "configIframe",
-                                                                                                                                "hide",
-                                                                                                                                "browser");
+       /**
+        * Sets up references to the first and last focusable element in the Navigator's UI
+        * in terms of tab order (Naviagator's firstEl and lastEl properties). The references
+        * are used to control modality by looping around from the first to the last control
+        * and visa versa for tab/shift-tab navigation.
+        * <p>
+        * See <a href="#applyKeyListeners">applyKeyListeners</a>
+        * </p>
+        * @protected
+        * @method _setFirstLastElements
+        */
+       _setFirstLastElements : function() {
+               this.firstCtrl = this.monthEl;
+               this.lastCtrl = this.cancelEl;
+
+               // Special handling for MacOSX.
+               // - Safari 2.x can't focus on buttons
+               // - Gecko can't focus on select boxes or buttons
+               if (this.__isMac) {
+                       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420){
+                               this.firstCtrl = this.monthEl;
+                               this.lastCtrl = this.yearEl;
+                       }
+                       if (YAHOO.env.ua.gecko) {
+                               this.firstCtrl = this.yearEl;
+                               this.lastCtrl = this.yearEl;
+                       }
+               }
+       },
 
-/**
-* The set of default Config property keys and values for the CalendarGroup
-* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
-* @final
-* @static
-* @private
-* @type Object
-*/
-YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
+       /**
+        * Default Keyboard event handler to capture Enter 
+        * on the Navigator's year control (yearEl)
+        * 
+        * @method _handleEnterKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleEnterKey : function(e) {
+               var KEYS = YAHOO.util.KeyListener.KEY;
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     A string representation of the CalendarGroup object.
-*/
-YAHOO.widget.CalendarGroup.prototype.toString = function() {
-       return "CalendarGroup " + this.id;
-};
+               if (YAHOO.util.Event.getCharCode(e) == KEYS.ENTER) {
+                       YAHOO.util.Event.preventDefault(e);
+                       this.submit();
+               }
+       },
 
-YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;
+       /**
+        * Default Keyboard event handler to capture up/down/pgup/pgdown
+        * on the Navigator's year control (yearEl).
+        * 
+        * @method _handleDirectionKeys
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleDirectionKeys : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+               var NAV = YAHOO.widget.CalendarNavigator;
+
+               var value = (this.yearEl.value) ? parseInt(this.yearEl.value, 10) : null;
+               if (isFinite(value)) {
+                       var dir = false;
+                       switch(E.getCharCode(e)) {
+                               case KEYS.UP:
+                                       this.yearEl.value = value + NAV.YR_MINOR_INC;
+                                       dir = true;
+                                       break;
+                               case KEYS.DOWN:
+                                       this.yearEl.value = Math.max(value - NAV.YR_MINOR_INC, 0);
+                                       dir = true;
+                                       break;
+                               case KEYS.PAGE_UP:
+                                       this.yearEl.value = value + NAV.YR_MAJOR_INC;
+                                       dir = true;
+                                       break;
+                               case KEYS.PAGE_DOWN:
+                                       this.yearEl.value = Math.max(value - NAV.YR_MAJOR_INC, 0);
+                                       dir = true;
+                                       break;
+                               default:
+                                       break;
+                       }
+                       if (dir) {
+                               E.preventDefault(e);
+                               try {
+                                       this.yearEl.select();
+                               } catch(e) {
+                                       // Ignore
+                               }
+                       }
+               }
+       },
 
-/**
-* @class YAHOO.widget.Calendar2up
-* @extends YAHOO.widget.CalendarGroup
-* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
-*/
-YAHOO.widget.Calendar2up = function(id, containerId, config) {
-       this.init(id, containerId, config);
-};
+       /**
+        * Default Keyboard event handler to capture Tab 
+        * on the last control (lastCtrl) in the Navigator.
+        * 
+        * @method _handleTabKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleTabKey : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+
+               if (E.getCharCode(e) == KEYS.TAB && !e.shiftKey) {
+                       try {
+                               E.preventDefault(e);
+                               this.firstCtrl.focus();
+                       } catch (e) {
+                               // Ignore - mainly for focus edge cases
+                       }
+               }
+       },
 
-YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
+       /**
+        * Default Keyboard event handler to capture Shift-Tab 
+        * on the first control (firstCtrl) in the Navigator.
+        * 
+        * @method _handleShiftTabKey
+        * @protected
+        * @param {Event} e The DOM event being handled
+        */
+       _handleShiftTabKey : function(e) {
+               var E = YAHOO.util.Event;
+               var KEYS = YAHOO.util.KeyListener.KEY;
+
+               if (e.shiftKey && E.getCharCode(e) == KEYS.TAB) {
+                       try {
+                               E.preventDefault(e);
+                               this.lastCtrl.focus();
+                       } catch (e) {
+                               // Ignore - mainly for focus edge cases
+                       }
+               }
+       },
 
-/**
-* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
-*/
-YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
+       /**
+        * Retrieve Navigator configuration values from 
+        * the parent Calendar/CalendarGroup's config value.
+        * <p>
+        * If it has not been set in the user provided configuration, the method will 
+        * return the default value of the configuration property, as set in _DEFAULT_CFG
+        * </p>
+        * @private
+        * @method __getCfg
+        * @param {String} Case sensitive property name.
+        * @param {Boolean} true, if the property is a string property, false if not.
+        * @return The value of the configuration property
+        */
+       __getCfg : function(prop, bIsStr) {
+               var DEF_CFG = YAHOO.widget.CalendarNavigator._DEFAULT_CFG;
+               var cfg = this.cal.cfg.getProperty("navigator");
+
+               if (bIsStr) {
+                       return (cfg !== true && cfg.strings && cfg.strings[prop]) ? cfg.strings[prop] : DEF_CFG.strings[prop];
+               } else {
+                       return (cfg !== true && cfg[prop]) ? cfg[prop] : DEF_CFG[prop];
+               }
+       },
+
+       /**
+        * Private flag, to identify MacOS
+        * @private
+        * @property __isMac
+        */
+       __isMac : (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1)
+
+};
 
-YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.3.0", build: "442"});
+YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/charts/README b/lib/yui/charts/README
new file mode 100644 (file)
index 0000000..2c88c6c
--- /dev/null
@@ -0,0 +1,14 @@
+YUI Library - Charts - Release Notes
+
+2.5.0
+  * Added lineSize style to series styles
+  * Added showLabels substyle to xAxis and yAxis styles
+  * Added more descriptive local content warning for ExternalInterface failure
+  * Improved minor unit calculation
+  * Fixed animation and marker positioning bugs
+  * Fixed bug that caused series definition update to fail
+  * Fixed bug that caused setting hex color values with # symbol to fail
+  * Added initialization flag to ensure DataSource doesn't receive multiple requests during initialization.
+
+2.4.0
+  * Experimental release
\ No newline at end of file
diff --git a/lib/yui/charts/assets/charts.swf b/lib/yui/charts/assets/charts.swf
new file mode 100644 (file)
index 0000000..9e9597a
Binary files /dev/null and b/lib/yui/charts/assets/charts.swf differ
diff --git a/lib/yui/charts/charts-experimental-debug.js b/lib/yui/charts/charts-experimental-debug.js
new file mode 100644 (file)
index 0000000..f936fa0
--- /dev/null
@@ -0,0 +1,1856 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/*!
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+var deconcept = deconcept || {};
+
+if(typeof deconcept.util == "undefined" || !deconcept.util)
+{
+       deconcept.util = {};
+}
+
+if(typeof deconcept.SWFObjectUtil == "undefined" || !deconcept.SWFObjectUtil)
+{
+       deconcept.SWFObjectUtil = {};
+}
+
+deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey)
+{
+       if(!document.getElementById) { return; }
+       this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
+       this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
+       this.params = {};
+       this.variables = {};
+       this.attributes = [];
+       if(swf) { this.setAttribute('swf', swf); }
+       if(id) { this.setAttribute('id', id); }
+       if(w) { this.setAttribute('width', w); }
+       if(h) { this.setAttribute('height', h); }
+       if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
+       this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
+       if (!window.opera && document.all && this.installedVer.major > 7)
+       {
+               // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
+               deconcept.SWFObject.doPrepUnload = true;
+       }
+       if(c)
+       {
+               this.addParam('bgcolor', c);
+       }
+       var q = quality ? quality : 'high';
+       this.addParam('quality', q);
+       this.setAttribute('useExpressInstall', false);
+       this.setAttribute('doExpressInstall', false);
+       var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
+       this.setAttribute('xiRedirectUrl', xir);
+       this.setAttribute('redirectUrl', '');
+       if(redirectUrl)
+       {
+               this.setAttribute('redirectUrl', redirectUrl);
+       }
+};
+
+deconcept.SWFObject.prototype =
+{
+       useExpressInstall: function(path)
+       {
+               this.xiSWFPath = !path ? "expressinstall.swf" : path;
+               this.setAttribute('useExpressInstall', true);
+       },
+       setAttribute: function(name, value){
+               this.attributes[name] = value;
+       },
+       getAttribute: function(name){
+               return this.attributes[name];
+       },
+       addParam: function(name, value){
+               this.params[name] = value;
+       },
+       getParams: function(){
+               return this.params;
+       },
+       addVariable: function(name, value){
+               this.variables[name] = value;
+       },
+       getVariable: function(name){
+               return this.variables[name];
+       },
+       getVariables: function(){
+               return this.variables;
+       },
+       getVariablePairs: function(){
+               var variablePairs = [];
+               var key;
+               var variables = this.getVariables();
+               for(key in variables){
+                       variablePairs[variablePairs.length] = key +"="+ variables[key];
+               }
+               return variablePairs;
+       },
+       getSWFHTML: function() {
+               var swfNode = "";
+               var params = {};
+               var key = "";
+               var pairs = "";
+               if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "PlugIn");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
+                       swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
+                       params = this.getParams();
+                       for(key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
+                       pairs = this.getVariablePairs().join("&");
+                       if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
+                       swfNode += '/>';
+               } else { // PC IE
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "ActiveX");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
+                       swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
+                       params = this.getParams();
+                       for(key in params) {
+                        swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
+                       }
+                       pairs = this.getVariablePairs().join("&");
+                       if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
+                       swfNode += "</object>";
+               }
+               return swfNode;
+       },
+       write: function(elementId)
+       {
+               if(this.getAttribute('useExpressInstall')) {
+                       // check to see if we need to do an express install
+                       var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
+                       if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
+                               this.setAttribute('doExpressInstall', true);
+                               this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
+                               document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+                               this.addVariable("MMdoctitle", document.title);
+                       }
+               }
+               if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version')))
+               {
+                       var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
+                       n.innerHTML = this.getSWFHTML();
+                       return true;
+               }
+               else
+               {
+                       if(this.getAttribute('redirectUrl') !== "")
+                       {
+                               document.location.replace(this.getAttribute('redirectUrl'));
+                       }
+               }
+               return false;
+       }
+};
+
+/* ---- detection functions ---- */
+deconcept.SWFObjectUtil.getPlayerVersion = function()
+{
+       var axo = null;
+       var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
+       if(navigator.plugins && navigator.mimeTypes.length)
+       {
+               var x = navigator.plugins["Shockwave Flash"];
+               if(x && x.description)
+               {
+                       PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
+               }
+       }
+       else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0)
+       { // if Windows CE
+               var counter = 3;
+               while(axo)
+               {
+                       try
+                       {
+                               counter++;
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
+//                             document.write("player v: "+ counter);
+                               PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
+                       }
+                       catch(e)
+                       {
+                               axo = null;
+                       }
+               }
+       }
+       else
+       { // Win IE (non mobile)
+               // do minor version lookup in IE, but avoid fp6 crashing issues
+               // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
+               try
+               {
+                       axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+               }
+               catch(e)
+               {
+                       try
+                       {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                               PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
+                               axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
+                       }
+                       catch(e)
+                       {
+                               if(PlayerVersion.major == 6)
+                               {
+                                       return PlayerVersion;
+                               }
+                       }
+                       try
+                       {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+                       }
+                       catch(e) {}
+               }
+               
+               if(axo !== null)
+               {
+                       PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
+               }
+       }
+       return PlayerVersion;
+};
+
+deconcept.PlayerVersion = function(arrVersion)
+{
+       this.major = arrVersion[0] !== null ? parseInt(arrVersion[0], 0) : 0;
+       this.minor = arrVersion[1] !== null ? parseInt(arrVersion[1], 0) : 0;
+       this.rev = arrVersion[2] !== null ? parseInt(arrVersion[2], 0) : 0;
+};
+
+deconcept.PlayerVersion.prototype.versionIsValid = function(fv)
+{
+       if(this.major < fv.major)
+       {
+               return false;
+       }
+       if(this.major > fv.major)
+       {
+               return true;
+       }
+       if(this.minor < fv.minor)
+       {
+               return false;
+       }
+       if(this.minor > fv.minor)
+       {
+               return true;
+       }
+       if(this.rev < fv.rev)
+       {
+               return false;
+       }
+       return true;
+};
+
+/* ---- get value of query string param ---- */
+deconcept.util =
+{
+       getRequestParameter: function(param)
+       {
+               var q = document.location.search || document.location.hash;
+               if(param === null) { return q; }
+               if(q)
+               {
+                       var pairs = q.substring(1).split("&");
+                       for(var i=0; i < pairs.length; i++)
+                       {
+                               if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
+                               {
+                                       return pairs[i].substring((pairs[i].indexOf("=") + 1));
+                               }
+                       }
+               }
+               return "";
+       }
+};
+
+/* fix for video streaming bug */
+deconcept.SWFObjectUtil.cleanupSWFs = function()
+{
+       var objects = document.getElementsByTagName("OBJECT");
+       for(var i = objects.length - 1; i >= 0; i--)
+       {
+               objects[i].style.display = 'none';
+               for(var x in objects[i])
+               {
+                       if(typeof objects[i][x] == 'function')
+                       {
+                               objects[i][x] = function(){};
+                       }
+               }
+       }
+};
+
+// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
+if(deconcept.SWFObject.doPrepUnload)
+{
+       if(!deconcept.unloadSet)
+       {
+               deconcept.SWFObjectUtil.prepUnload = function()
+               {
+                       __flash_unloadHandler = function(){};
+                       __flash_savedUnloadHandler = function(){};
+                       window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
+               };
+               window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
+               deconcept.unloadSet = true;
+       }
+}
+
+/* add document.getElementById if needed (mobile IE < 5) */
+if(!document.getElementById && document.all)
+{
+       document.getElementById = function(id) { return document.all[id]; };
+}
+
+/* add some aliases for ease of use/backwards compatibility */
+var getQueryParamValue = deconcept.util.getRequestParameter;
+var FlashObject = deconcept.SWFObject; // for legacy support
+var SWFObject = deconcept.SWFObject;
+
+/**
+ * Wraps Flash embedding functionality and allows communication with SWF through
+ * attributes.
+ *
+ * @namespace YAHOO.widget
+ * @class FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
+ */
+YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
+{
+       // set up the initial events and attributes stuff
+       this._queue = this._queue || [];
+       this._events = this._events || {};
+       this._configs = this._configs || {};
+       attributes = attributes || {};
+       
+       //the Flash Player external interface code from Adobe doesn't play nicely
+       //with the default value, yui-gen, in IE
+       this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
+       attributes.version = attributes.version || "9.0.45";
+       attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
+       
+       //we can't use the initial attributes right away
+       //so save them for once the SWF finishes loading
+       this._attributes = attributes;
+       
+       this._swfURL = swfURL;
+       
+       //embed the SWF file in the page
+       this._embedSWF(this._swfURL, containerID, attributes.id, attributes.version,
+               attributes.backgroundColor, attributes.expressInstall, attributes.wmode);
+       
+       /**
+        * Fires when the SWF is initialized and communication is possible.
+        * @event contentReady
+        */
+       this.createEvent("contentReady");
+};
+
+YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
+{
+       /**
+        * The URL of the SWF file.
+        * @property _swfURL
+        * @type String
+        * @private
+        */
+       _swfURL: null,
+
+       /**
+        * A reference to the embedded SWF file.
+        * @property _swf
+        * @private
+        */
+       _swf: null,
+
+       /**
+        * The id of this instance.
+        * @property _id
+        * @type String
+        * @private
+        */
+       _id: null,
+       
+       /**
+        * The initializing attributes are stored here until the SWF is ready.
+        * @property _attributes
+        * @type Object
+        * @private
+        */
+       _attributes: null, //the intializing attributes
+
+       /**
+        * Public accessor to the unique name of the FlashAdapter instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the FlashAdapter instance.
+        */
+       toString: function()
+       {
+               return "FlashAdapter " + this._id;
+       },
+
+       /**
+        * Embeds the SWF in the page and associates it with this instance.
+        *
+        * @method _embedSWF
+        * @private
+        */
+       _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode)
+       {
+               //standard SWFObject embed
+               var swfObj = new deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor);
+
+               if(expressInstall)
+               {
+                       swfObj.useExpressInstall(expressInstall);
+               }
+
+               //make sure we can communicate with ExternalInterface
+               swfObj.addParam("allowScriptAccess", "always");
+               
+               if(wmode !== null)
+               {
+                       swfObj.addParam("wmode", wmode);
+               }
+               
+               //again, a useful ExternalInterface trick
+               swfObj.addVariable("allowedDomain", document.location.hostname);
+
+               //tell the SWF which HTML element it is in
+               swfObj.addVariable("elementID", swfID);
+
+               // set the name of the function to call when the swf has an event
+               swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
+
+               var container = YAHOO.util.Dom.get(containerID);
+               var result = swfObj.write(container);
+               if(result)
+               {
+                       this._swf = YAHOO.util.Dom.get(swfID);
+                       //if successful, let's add an owner property to the SWF reference
+                       //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
+                       this._swf.owner = this;
+               }
+               else
+               {
+                       YAHOO.log("Unable to load SWF " + swfURL);
+               }
+       },
+
+       /**
+        * Handles or re-dispatches events received from the SWF.
+        *
+        * @method _eventHandler
+        * @private
+        */
+       _eventHandler: function(event)
+       {
+               var type = event.type;
+               switch(type)
+               {
+                       case "swfReady":
+                               this._loadHandler();
+                               return;
+                       case "log":
+                               YAHOO.log(event.message, event.category, this.toString());
+                               return;
+               }
+               
+               //be sure to return after your case or the event will automatically fire!
+               this.fireEvent(type, event);
+       },
+
+       /**
+        * Called when the SWF has been initialized.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._initAttributes(this._attributes);
+               this.setAttributes(this._attributes, true);
+               this._attributes = null;
+               
+               this.fireEvent("contentReady");
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               //should be overridden if other attributes need to be set up
+               
+               /**
+                * @attribute swfURL
+                * @description Absolute or relative URL to the SWF displayed by the FlashAdapter.
+                * @type String
+                */
+               this.getAttributeConfig("swfURL",
+               {
+                       method: this._getSWFURL
+               });
+       },
+       
+       /**
+        * Getter for swfURL attribute.
+        *
+        * @method _getSWFURL
+        * @private
+        */
+       _getSWFURL: function()
+       {
+               return this._swfURL;
+       }
+});
+
+/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of FlashAdapter.
+ *
+ * @method YAHOO.widget.FlashAdapter.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
+{
+       var loadedSWF = YAHOO.util.Dom.get(elementID);
+       if(!loadedSWF.owner)
+       {
+               //fix for ie: if owner doesn't exist yet, try again in a moment
+               setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
+       }
+       else
+       {
+               loadedSWF.owner._eventHandler(event);
+       }
+};
+
+/**
+ * The Charts widget provides a Flash control for displaying data
+ * graphically by series across A-grade browsers with Flash Player installed.
+ *
+ * @module charts
+ * @requires yahoo, dom, event, datasource
+ * @title Charts Widget
+ * @beta
+ */
+
+/**
+ * Chart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class Chart
+ * @uses YAHOO.util.FlashAdapter
+ * @constructor
+ * @param type {String} The char type. May be "line", "column", "bar", or "pie"
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
+{
+       YAHOO.widget.Chart.superclass.constructor.call(this, YAHOO.widget.Chart.SWFURL, containerId, attributes);
+       
+       this._type = type;
+       this._dataSource = dataSource;
+       
+       /**
+        * Fires when the user moves the mouse over the bounds of an item renderer in the chart.
+        *
+        * @event itemMouseOverEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemMouseOverEvent");
+       
+       /**
+        * Fires when the user moves the mouse out of the bounds of an item renderer in the chart.
+        *
+        * @event itemMouseOutEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemMouseOutEvent");
+       
+       /**
+        * Fires when the user clicks an item renderer in the chart with the mouse.
+        *
+        * @event itemClickEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemClickEvent");
+       
+       /**
+        * Fires when the user double-clicks an item renderer in the chart with the mouse.
+        *
+        * @event itemDoubleClickEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDoubleClickEvent");
+       
+       /**
+        * Fires when the user presses the mouse down on an item to initiate a drag action.
+        *
+        * @event itemDragStartEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragStartEvent");
+       
+       /**
+        * Fires when the user moves the mouse during a drag action.
+        *
+        * @event itemDragEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragEvent");
+
+       /**
+        * Fires when the user releases the mouse during a drag action.
+        *
+        * @event itemDragEndEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragEndEvent");
+};
+
+YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
+{
+       /**
+        * The type of this chart instance.
+        * @property _type
+        * @type String
+        * @private
+        */
+       _type: null,
+
+       /**
+        * The id returned from the DataSource's setInterval function.
+        * @property _pollingID
+        * @type Number
+        * @private
+        */
+       _pollingID: null,
+
+       /**
+        * The time, in ms, between requests for data.
+        * @property _pollingInterval
+        * @type Number
+        * @private
+        */
+       _pollingInterval: null,
+       
+       /**
+        * Indicates whether all attributes have been set and
+        * the dataSource may be passed to the SWF.
+        * @property _initialized
+        * @type Boolean
+        * @private
+        */
+       _initialized: false,
+
+       /**
+        * Public accessor to the unique name of the Chart instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the Chart instance.
+        */
+       toString: function()
+       {
+               return "Chart " + this._id;
+       },
+       
+       /**
+        * Sets a single style value on the Chart instance.
+        *
+        * @method setStyle
+        * @param name {String} Name of the Chart style value to change.
+        * @param value {Object} New value to pass to the Chart style.
+        */
+       setStyle: function(name, value)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               value = YAHOO.lang.JSON.stringify(value);
+               this._swf.setStyle(name, value);
+       },
+       
+       /**
+        * Resets all styles on the Chart instance.
+        *
+        * @method setStyles
+        * @param styles {Object} Initializer for all Chart styles.
+        */
+       setStyles: function(styles)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               styles = YAHOO.lang.JSON.stringify(styles);
+               this._swf.setStyles(styles);
+       },
+       
+       /**
+        * Sets the styles on all series in the Chart.
+        *
+        * @method setSeriesStyles
+        * @param styles {Array} Initializer for all Chart series styles.
+        */
+       setSeriesStyles: function(styles)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               for(var i = 0; i < styles.length; i++)
+               {
+                       styles[i] = YAHOO.lang.JSON.stringify(styles[i]);       
+               }
+               this._swf.setSeriesStyles(styles);
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+
+               /**
+                * @attribute request
+                * @description Request to be sent to the Chart's DataSource.
+                * @type String
+                */
+               this.getAttributeConfig("request",
+               {
+                       method: this._getRequest
+               });
+               
+               this.setAttributeConfig("request",
+               {
+                       method: this._setRequest
+               });
+               
+               /**
+                * @attribute dataSource
+                * @description The DataSource instance to display in the Chart.
+                * @type DataSource
+                */
+               this.getAttributeConfig("dataSource",
+               {
+                       method: this._getDataSource
+               });
+               
+               this.setAttributeConfig("dataSource",
+               {
+                       method: this._setDataSource
+               });
+               
+               /**
+                * @attribute series
+                * @description Defines the series to be displayed by the Chart.
+                * @type Array
+                */
+               this.getAttributeConfig("series",
+               {
+                       method: this._getSeriesDefs
+               });
+               
+               this.setAttributeConfig("series",
+               {
+                       method: this._setSeriesDefs
+               });
+               
+               /**
+                * @attribute categoryNames
+                * @description Defines the names of the categories to be displayed in the Chart..
+                * @type Array
+                */
+               this.getAttributeConfig("categoryNames",
+               {
+                       method: this._getCategoryNames
+               });
+               
+               this.setAttributeConfig("categoryNames",
+               {
+                       validator: YAHOO.lang.isArray,
+                       method: this._setCategoryNames
+               });
+               
+               /**
+                * @attribute dataTipFunction
+                * @description The string representation of a globally-accessible function
+                * that may be called by the SWF to generate the datatip text for a Chart's item.
+                * @type String
+                */
+               this.getAttributeConfig("dataTipFunction",
+               {
+                       method: this._getDataTipFunction
+               });
+               
+               this.setAttributeConfig("dataTipFunction",
+               {
+                       method: this._setDataTipFunction
+               });
+
+               /**
+                * @attribute polling
+                * @description A numeric value indicating the number of milliseconds between
+                * polling requests to the DataSource.
+                * @type Number
+                */
+               this.getAttributeConfig("polling",
+               {
+                       method: this._getPolling
+               });
+
+               this.setAttributeConfig("polling",
+               {
+                       method: this._setPolling
+               });
+       },
+       
+       /**
+        * Called when the SWF is ready for communication. Sets the type, initializes
+        * the styles, and sets the DataSource.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._swf.setType(this._type);
+               
+               //set initial styles
+               if(this._attributes.style)
+               {
+                       var style = this._attributes.style;
+                       this.setStyles(style);          
+               }
+               
+               YAHOO.widget.Chart.superclass._loadHandler.call(this);
+               
+               this._initialized = true;
+               
+               if(this._dataSource)
+               {
+                       this.set("dataSource", this._dataSource);
+               }
+       },
+
+       /**
+        * Sends the request to the DataSource.
+        *
+        * @method _refreshData
+        * @private
+        */
+       _refreshData: function()
+       {
+               if(!this._initialized)
+               {
+                       return;
+               }
+               
+               if(this._dataSource !== null)
+               {
+                       if(this._pollingID !== null)
+                       {
+                               this._dataSource.clearInterval(this._pollingID);
+                               this._pollingID = null;
+                       }
+                       
+                       if(this._pollingInterval > 0)
+                       {
+                               this._pollingID = this._dataSource.setInterval(this._pollingInterval, this._request, this._loadDataHandler, this);
+                       }
+                       else
+                       {
+                               this._dataSource.sendRequest(this._request, this._loadDataHandler, this);
+                       }
+               }
+       },
+
+       /**
+        * Called when the DataSource receives new data. The series definitions are used
+        * to build a data provider for the SWF chart.
+        *
+        * @method _loadDataHandler
+        * @private
+        */
+       _loadDataHandler: function(request, response, error)
+       {
+               if(error)
+               {
+                       YAHOO.log("Unable to load data.", "error");
+               }
+               else
+               {
+                       var styleChanged = false;
+                       
+                       //make a copy of the series definitions so that we aren't
+                       //editing them directly.
+                       var dataProvider = [];  
+                       var seriesCount = 0;
+                       var currentSeries = null;
+                       var i = 0;
+                       if(this._seriesDefs !== null)
+                       {
+                               seriesCount = this._seriesDefs.length;
+                               for(i = 0; i < seriesCount; i++)
+                               {
+                                       currentSeries = this._seriesDefs[i];
+                                       var clonedSeries = {};
+                                       for(var prop in currentSeries)
+                                       {
+                                               if(prop == "style" && currentSeries.style !== null)
+                                               {
+                                                       clonedSeries.style = YAHOO.lang.JSON.stringify(currentSeries.style);
+                                                       styleChanged = true;
+                                                       
+                                                       //we don't want to modify the styles again next time
+                                                       //so null out the style property.
+                                                       currentSeries.style = null;
+                                               }
+                                               else
+                                               {
+                                                       clonedSeries[prop] = currentSeries[prop];
+                                               }
+                                       }
+                                       dataProvider.push(clonedSeries);
+                               }
+                       }
+                       
+                       if(seriesCount > 0)
+                       {
+                               for(i = 0; i < seriesCount; i++)
+                               {
+                                       currentSeries = dataProvider[i];
+                                       if(!currentSeries.type)
+                                       {
+                                               currentSeries.type = this._type;
+                                       }
+                                       currentSeries.dataProvider = response.results;
+                               }
+                       }
+                       else
+                       {
+                               var series = {type: this._type, dataProvider: response.results};
+                               dataProvider.push(series);
+                       }
+                       this._swf.setDataProvider(dataProvider, styleChanged);
+               }
+       },
+
+       /**
+        * Storage for the request attribute.
+        * 
+        * @property _request
+        * @private
+        */
+       _request: "",
+       
+       /**
+        * Getter for the request attribute.
+        *
+        * @method _getRequest
+        * @private
+        */
+       _getRequest: function()
+       {
+               return this._request;
+       },
+       
+       /**
+        * Setter for the request attribute.
+        *
+        * @method _setRequest
+        * @private
+        */
+       _setRequest: function(value)
+       {
+               this._request = value;
+               this._refreshData();
+       },
+
+       /**
+        * Storage for the dataSource attribute.
+        * 
+        * @property _dataSource
+        * @private
+        */
+       _dataSource: null,
+       
+       /**
+        * Getter for the dataSource attribute.
+        *
+        * @method _getDataSource
+        * @private
+        */
+       _getDataSource: function()
+       {
+               return this._dataSource;
+       },
+
+       /**
+        * Setter for the dataSource attribute.
+        *
+        * @method _setDataSource
+        * @private
+        */
+       _setDataSource: function(value)
+       {       
+               this._dataSource = value;
+               this._refreshData();
+       },
+       
+       /**
+        * Storage for the series attribute.
+        * 
+        * @property _seriesDefs
+        * @private
+        */
+       _seriesDefs: null,
+       
+       /**
+        * Getter for the series attribute.
+        *
+        * @method _getSeriesDefs
+        * @private
+        */
+       _getSeriesDefs: function()
+       {
+               return this._seriesDefs;
+       },
+       
+       /**
+        * Setter for the series attribute.
+        *
+        * @method _setSeriesDefs
+        * @private
+        */
+       _setSeriesDefs: function(value)
+       {
+               this._seriesDefs = value;
+               this._refreshData();
+       },
+
+       /**
+        * Getter for the categoryNames attribute.
+        *
+        * @method _getCategoryNames
+        * @private
+        */
+       _getCategoryNames: function()
+       {
+               return this._swf.getCategoryNames();
+       },
+
+       /**
+        * Setter for the categoryNames attribute.
+        *
+        * @method _setCategoryNames
+        * @private
+        */
+       _setCategoryNames: function(value)
+       {
+               this._swf.setCategoryNames(value);
+       },
+       
+       /**
+        * Storage for the dataTipFunction attribute.
+        *
+        * @property _dataTipFunction
+        * @private
+        */
+       _dataTipFunction: null,
+       
+       /**
+        * Getter for the dataTipFunction attribute.
+        *
+        * @method _getDataTipFunction
+        * @private
+        */
+       _getDataTipFunction: function()
+       {
+               return this._dataTipFunction;
+       },
+       
+       /**
+        * Setter for the dataTipFunction attribute.
+        *
+        * @method _setDataTipFunction
+        * @private
+        */
+       _setDataTipFunction: function(value)
+       {
+               this._dataTipFunction = value;
+               this._swf.setDataTipFunction(value);
+       },
+
+       /**
+        * Getter for the polling attribute.
+        *
+        * @method _getPolling
+        * @private
+        */
+       _getPolling: function()
+       {
+               return this._pollingInterval;
+       },
+
+       /**
+        * Setter for the polling attribute.
+        *
+        * @method _setPolling
+        * @private
+        */
+       _setPolling: function(value)
+       {
+               this._pollingInterval = value;
+               this._refreshData();
+       }
+});
+
+/**
+ * Storage for the dataTipFunction attribute.
+ *
+ * @property Chart.SWFURL
+ * @private
+ * @static
+ * @final
+ * @default "assets/charts.swf"
+ */
+YAHOO.widget.Chart.SWFURL = "assets/charts.swf";
+
+/**
+ * PieChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class PieChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.PieChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.PieChart.superclass.constructor.call(this, "pie", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.PieChart, YAHOO.widget.Chart,
+{
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {       
+               YAHOO.widget.PieChart.superclass._initAttributes.call(this, attributes);
+               
+               /**
+                * @attribute dataField
+                * @description The field in each item that corresponds to the data value.
+                * @type String
+                */
+               this.getAttributeConfig("dataField",
+               {
+                       method: this._getDataField
+               });
+   
+               this.setAttributeConfig("dataField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setDataField
+               });
+   
+               /**
+                * @attribute categoryField
+                * @description The field in each item that corresponds to the category value.
+                * @type String
+                */
+               this.getAttributeConfig("categoryField",
+               {
+                       method: this._getCategoryField
+               });
+   
+               this.setAttributeConfig("categoryField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setCategoryField
+               });
+       },
+
+       /**
+        * Getter for the dataField attribute.
+        *
+        * @method _getDataField
+        * @private
+        */
+       _getDataField: function()
+       {
+               return this._swf.getDataField();
+       },
+
+       /**
+        * Setter for the dataField attribute.
+        *
+        * @method _setDataField
+        * @private
+        */
+       _setDataField: function(value)
+       {
+               this._swf.setDataField(value);
+       },
+
+       /**
+        * Getter for the categoryField attribute.
+        *
+        * @method _getCategoryField
+        * @private
+        */
+       _getCategoryField: function()
+       {
+               return this._swf.getCategoryField();
+       },
+
+       /**
+        * Setter for the categoryField attribute.
+        *
+        * @method _setCategoryField
+        * @private
+        */
+       _setCategoryField: function(value)
+       {
+               this._swf.setCategoryField(value);
+       }
+});
+
+/**
+ * CartesianChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class CartesianChart
+ * @uses YAHOO.widget.Charts
+ * @constructor
+ * @param type {String} The char type. May be "line", "column", or "bar"
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+ YAHOO.widget.CartesianChart = function(type, containerId, dataSource, attributes)
+{
+       YAHOO.widget.CartesianChart.superclass.constructor.call(this, type, containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
+{
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {       
+               YAHOO.widget.CartesianChart.superclass._initAttributes.call(this, attributes);
+
+               /**
+                * @attribute xField
+                * @description The field in each item that corresponds to a value on the x axis.
+                * @type String
+                */
+               this.getAttributeConfig("xField",
+               {
+                       method: this._getXField
+               });
+
+               this.setAttributeConfig("xField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setXField
+               });
+
+               /**
+                * @attribute yField
+                * @description The field in each item that corresponds to a value on the x axis.
+                * @type String
+                */
+               this.getAttributeConfig("yField",
+               {
+                       method: this._getYField
+               });
+
+               this.setAttributeConfig("yField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setYField
+               });
+
+               /**
+                * @attribute xAxis
+                * @description A custom configuration for the horizontal x axis.
+                * @type Axis
+                */
+               this.setAttributeConfig("xAxis",
+               {
+                       method: this._setXAxis
+               });
+
+               /**
+                * @attribute yAxis
+                * @description A custom configuration for the vertical y axis.
+                * @type Axis
+                */
+               this.setAttributeConfig("yAxis",
+               {
+                       method: this._setYAxis
+               });
+       },
+
+       /**
+        * Getter for the xField attribute.
+        *
+        * @method _getXField
+        * @private
+        */
+       _getXField: function()
+       {
+               return this._swf.getHorizontalField();
+       },
+
+       /**
+        * Setter for the xField attribute.
+        *
+        * @method _setXField
+        * @private
+        */
+       _setXField: function(value)
+       {
+               this._swf.setHorizontalField(value);
+       },
+
+       /**
+        * Getter for the yField attribute.
+        *
+        * @method _getYField
+        * @private
+        */
+       _getYField: function()
+       {
+               return this._swf.getVerticalField();
+       },
+
+       /**
+        * Setter for the yField attribute.
+        *
+        * @method _setYField
+        * @private
+        */
+       _setYField: function(value)
+       {
+               this._swf.setVerticalField(value);
+       },
+       
+       /**
+        * Setter for the xAxis attribute.
+        *
+        * @method _setXAxis
+        * @private
+        */
+       _setXAxis: function(value)
+       {
+               this._swf.setHorizontalAxis(value);
+       },
+
+       /**
+        * Getter for the yAxis attribute.
+        *
+        * @method _setYAxis
+        * @private
+        */
+       _setYAxis: function(value)
+       {
+               this._swf.setVerticalAxis(value);
+       }
+});
+
+/**
+ * LineChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class LineChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.LineChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.LineChart.superclass.constructor.call(this, "line", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.LineChart, YAHOO.widget.CartesianChart);
+
+/**
+ * ColumnChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.ColumnChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.ColumnChart.superclass.constructor.call(this, "column", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.ColumnChart, YAHOO.widget.CartesianChart);
+
+/**
+ * BarChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class BarChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.BarChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.BarChart.superclass.constructor.call(this, "bar", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.BarChart, YAHOO.widget.CartesianChart);
+
+/**
+ * Defines a CartesianChart's vertical or horizontal axis.
+ *
+ * @namespace YAHOO.widget
+ * @class Axis
+ * @constructor
+ */
+YAHOO.widget.Axis = function()
+{
+};
+
+YAHOO.widget.Axis.prototype = 
+{
+       /**
+        * The type of axis.
+        *
+        * @property type
+        * @type String
+        */
+       type: null,
+       
+       /**
+        * The direction in which the axis is drawn. May be "horizontal" or "vertical".
+        *
+        * @property orientation
+        * @type String
+        */
+       orientation: "horizontal",
+       
+       /**
+        * If true, the items on the axis will be drawn in opposite direction.
+        *
+        * @property reverse
+        * @type Boolean
+        */
+       reverse: false,
+       
+       /**
+        * A string reference to the globally-accessible function that may be called to
+        * determine each of the label values for this axis.
+        *
+        * @property labelFunction
+        * @type String
+        */
+       labelFunction: null,
+       
+       /**
+        * If true, labels that overlap previously drawn labels on the axis will be hidden.
+        *
+        * @property hideOverlappingLabels
+        * @type Boolean
+        */
+       hideOverlappingLabels: true
+};
+
+/**
+ * A type of axis whose units are measured in numeric values.
+ *
+ * @namespace YAHOO.widget
+ * @class NumericAxis
+ * @constructor
+ */
+YAHOO.widget.NumericAxis = function()
+{
+       YAHOO.widget.NumericAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.NumericAxis, YAHOO.widget.Axis,
+{
+       type: "numeric",
+       
+       /**
+        * The minimum value drawn by the axis. If not set explicitly, the axis minimum
+        * will be calculated automatically.
+        *
+        * @property minimum
+        * @type Number
+        */
+       minimum: NaN,
+       
+       /**
+        * The maximum value drawn by the axis. If not set explicitly, the axis maximum
+        * will be calculated automatically.
+        *
+        * @property maximum
+        * @type Number
+        */
+       maximum: NaN,
+       
+       /**
+        * The spacing between major intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       majorUnit: NaN,
+
+       /**
+        * The spacing between minor intervals on this axis.
+        *
+        * @property minorUnit
+        * @type Number
+        */
+       minorUnit: NaN,
+       
+       /**
+        * If true, the labels, ticks, gridlines, and other objects will snap to
+        * the nearest major or minor unit. If false, their position will be based
+        * on the minimum value.
+        *
+        * @property snapToUnits
+        * @type Boolean
+        */
+       snapToUnits: true,
+
+       /**
+        * If true, and the bounds are calculated automatically, either the minimum or
+        * maximum will be set to zero.
+        *
+        * @property alwaysShowZero
+        * @type Boolean
+        */
+       alwaysShowZero: true,
+
+       /**
+        * The scaling algorithm to use on this axis. May be "linear" or "logarithmic".
+        *
+        * @property scale
+        * @type String
+        */
+       scale: "linear"
+});
+
+/**
+ * A type of axis whose units are measured in time-based values.
+ *
+ * @namespace YAHOO.widget
+ * @class TimeAxis
+ * @constructor
+ */
+YAHOO.widget.TimeAxis = function()
+{
+       YAHOO.widget.TimeAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.TimeAxis, YAHOO.widget.Axis,
+{
+       type: "time",
+       
+       /**
+        * The minimum value drawn by the axis. If not set explicitly, the axis minimum
+        * will be calculated automatically.
+        *
+        * @property minimum
+        * @type Date
+        */
+       minimum: null,
+
+       /**
+        * The maximum value drawn by the axis. If not set explicitly, the axis maximum
+        * will be calculated automatically.
+        *
+        * @property maximum
+        * @type Number
+        */
+       maximum: null,
+       
+       /**
+        * The spacing between major intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       majorUnit: NaN,
+       
+       /**
+        * The time unit used by the majorUnit.
+        *
+        * @property majorTimeUnit
+        * @type String
+        */
+       majorTimeUnit: null,
+       
+       /**
+        * The spacing between minor intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       minorUnit: NaN,
+       
+       /**
+        * The time unit used by the minorUnit.
+        *
+        * @property majorTimeUnit
+        * @type String
+        */
+       minorTimeUnit: null,
+
+       /**
+        * If true, the labels, ticks, gridlines, and other objects will snap to
+        * the nearest major or minor unit. If false, their position will be based
+        * on the minimum value.
+        *
+        * @property snapToUnits
+        * @type Boolean
+        */
+       snapToUnits: true
+});
+
+/**
+ * A type of axis that displays items in categories.
+ *
+ * @namespace YAHOO.widget
+ * @class CategoryAxis
+ * @constructor
+ */
+YAHOO.widget.CategoryAxis = function()
+{
+       YAHOO.widget.CategoryAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CategoryAxis, YAHOO.widget.Axis,
+{
+       type: "category",
+       
+       /**
+        * A list of category names to display along this axis.
+        *
+        * @property categoryNames
+        * @type Array
+        */
+       categoryNames: null
+});
+
+/**
+ * Series class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class Series
+ * @constructor
+ */
+YAHOO.widget.Series = function() {};
+
+YAHOO.widget.Series.prototype = 
+{
+       /**
+        * The type of series.
+        *
+        * @property type
+        * @type String
+        */
+       type: null,
+       
+       /**
+        * The human-readable name of the series.
+        *
+        * @property displayName
+        * @type String
+        */
+       displayName: null
+};
+
+/**
+ * CartesianSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class CartesianSeries
+ * @constructor
+ */
+YAHOO.widget.CartesianSeries = function() 
+{
+       YAHOO.widget.CartesianSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CartesianSeries, YAHOO.widget.Series,
+{
+       /**
+        * The field used to access the x-axis value from the items from the data source.
+        *
+        * @property xField
+        * @type String
+        */
+       xField: null,
+       
+       /**
+        * The field used to access the y-axis value from the items from the data source.
+        *
+        * @property yField
+        * @type String
+        */
+       yField: null
+});
+
+/**
+ * ColumnSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSeries
+ * @constructor
+ */
+YAHOO.widget.ColumnSeries = function() 
+{
+       YAHOO.widget.ColumnSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.ColumnSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "column"
+});
+
+/**
+ * LineSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class LineSeries
+ * @constructor
+ */
+YAHOO.widget.LineSeries = function() 
+{
+       YAHOO.widget.LineSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.LineSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "line"
+});
+
+
+/**
+ * BarSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class BarSeries
+ * @constructor
+ */
+YAHOO.widget.BarSeries = function() 
+{
+       YAHOO.widget.BarSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.BarSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "bar"
+});
+
+
+/**
+ * PieSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class PieSeries
+ * @constructor
+ */
+YAHOO.widget.PieSeries = function() 
+{
+       YAHOO.widget.PieSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.PieSeries, YAHOO.widget.Series,
+{
+       type: "pie",
+       dataField: null,
+       categoryField: null
+});
+
+YAHOO.register("charts", YAHOO.widget.Chart, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/charts/charts-experimental-min.js b/lib/yui/charts/charts-experimental-min.js
new file mode 100644 (file)
index 0000000..4f702b1
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/*
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+var deconcept=deconcept||{};if(typeof deconcept.util=="undefined"||!deconcept.util){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"||!deconcept.SWFObjectUtil){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return ;}this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(E){this.setAttribute("swf",E);}if(C){this.setAttribute("id",C);}if(K){this.setAttribute("width",K);}if(F){this.setAttribute("height",F);}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(J){this.addParam("bgcolor",J);}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A);}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true);},setAttribute:function(A,B){this.attributes[A]=B;},getAttribute:function(A){return this.attributes[A];},addParam:function(A,B){this.params[A]=B;},getParams:function(){return this.params;},addVariable:function(A,B){this.variables[A]=B;},getVariable:function(A){return this.variables[A];},getVariables:function(){return this.variables;},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B];}return A;},getSWFHTML:function(){var D="";var C={};var A="";var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';C=this.getParams();for(A in C){D+=[A]+'="'+C[A]+'" ';}B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"';}D+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';C=this.getParams();for(A in C){D+='<param name="'+A+'" value="'+C[A]+'" />';}B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />';}D+="</object>";}return D;},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!==""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=null;var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0]);}catch(E){D=null;}}}else{try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(E){try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always";}catch(E){if(C.major==6){return C;}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(E){}}if(D!==null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","));}}}return C;};deconcept.PlayerVersion=function(A){this.major=A[0]!==null?parseInt(A[0],0):0;this.minor=A[1]!==null?parseInt(A[1],0):0;this.rev=A[2]!==null?parseInt(A[2],0):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false;}if(this.major>A.major){return true;}if(this.minor<A.minor){return false;}if(this.minor>A.minor){return true;}if(this.rev<A.rev){return false;}return true;};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D===null){return C;}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
+__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;YAHOO.widget.FlashAdapter=function(C,A,B){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};B=B||{};this._id=B.id=B.id||YAHOO.util.Dom.generateId(null,"yuigen");B.version=B.version||"9.0.45";B.backgroundColor=B.backgroundColor||"#ffffff";this._attributes=B;this._swfURL=C;this._embedSWF(this._swfURL,A,B.id,B.version,B.backgroundColor,B.expressInstall,B.wmode);this.createEvent("contentReady");};YAHOO.extend(YAHOO.widget.FlashAdapter,YAHOO.util.AttributeProvider,{_swfURL:null,_swf:null,_id:null,_attributes:null,toString:function(){return"FlashAdapter "+this._id;},_embedSWF:function(I,H,D,C,F,G,B){var E=new deconcept.SWFObject(I,D,"100%","100%",C,F);if(G){E.useExpressInstall(G);}E.addParam("allowScriptAccess","always");if(B!==null){E.addParam("wmode",B);}E.addVariable("allowedDomain",document.location.hostname);E.addVariable("elementID",D);E.addVariable("eventHandler","YAHOO.widget.FlashAdapter.eventHandler");var A=YAHOO.util.Dom.get(H);var J=E.write(A);if(J){this._swf=YAHOO.util.Dom.get(D);this._swf.owner=this;}else{}},_eventHandler:function(B){var A=B.type;switch(A){case"swfReady":this._loadHandler();return ;case"log":return ;}this.fireEvent(A,B);},_loadHandler:function(){this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._attributes=null;this.fireEvent("contentReady");},_initAttributes:function(A){this.getAttributeConfig("swfURL",{method:this._getSWFURL});},_getSWFURL:function(){return this._swfURL;}});YAHOO.widget.FlashAdapter.eventHandler=function(A,C){var B=YAHOO.util.Dom.get(A);if(!B.owner){setTimeout(function(){YAHOO.widget.FlashAdapter.eventHandler(A,C);},0);}else{B.owner._eventHandler(C);}};YAHOO.widget.Chart=function(C,A,D,B){YAHOO.widget.Chart.superclass.constructor.call(this,YAHOO.widget.Chart.SWFURL,A,B);this._type=C;this._dataSource=D;this.createEvent("itemMouseOverEvent");this.createEvent("itemMouseOutEvent");this.createEvent("itemClickEvent");this.createEvent("itemDoubleClickEvent");this.createEvent("itemDragStartEvent");this.createEvent("itemDragEvent");this.createEvent("itemDragEndEvent");};YAHOO.extend(YAHOO.widget.Chart,YAHOO.widget.FlashAdapter,{_type:null,_pollingID:null,_pollingInterval:null,_initialized:false,toString:function(){return"Chart "+this._id;},setStyle:function(A,B){B=YAHOO.lang.JSON.stringify(B);this._swf.setStyle(A,B);},setStyles:function(A){A=YAHOO.lang.JSON.stringify(A);this._swf.setStyles(A);},setSeriesStyles:function(B){for(var A=0;A<B.length;A++){B[A]=YAHOO.lang.JSON.stringify(B[A]);}this._swf.setSeriesStyles(B);},_initAttributes:function(A){YAHOO.widget.Chart.superclass._initAttributes.call(this,A);this.getAttributeConfig("request",{method:this._getRequest});this.setAttributeConfig("request",{method:this._setRequest});this.getAttributeConfig("dataSource",{method:this._getDataSource});this.setAttributeConfig("dataSource",{method:this._setDataSource});this.getAttributeConfig("series",{method:this._getSeriesDefs});this.setAttributeConfig("series",{method:this._setSeriesDefs});this.getAttributeConfig("categoryNames",{method:this._getCategoryNames});this.setAttributeConfig("categoryNames",{validator:YAHOO.lang.isArray,method:this._setCategoryNames});this.getAttributeConfig("dataTipFunction",{method:this._getDataTipFunction});this.setAttributeConfig("dataTipFunction",{method:this._setDataTipFunction});this.getAttributeConfig("polling",{method:this._getPolling});this.setAttributeConfig("polling",{method:this._setPolling});},_loadHandler:function(){this._swf.setType(this._type);if(this._attributes.style){var A=this._attributes.style;this.setStyles(A);}YAHOO.widget.Chart.superclass._loadHandler.call(this);this._initialized=true;if(this._dataSource){this.set("dataSource",this._dataSource);}},_refreshData:function(){if(!this._initialized){return ;}if(this._dataSource!==null){if(this._pollingID!==null){this._dataSource.clearInterval(this._pollingID);this._pollingID=null;}if(this._pollingInterval>0){this._pollingID=this._dataSource.setInterval(this._pollingInterval,this._request,this._loadDataHandler,this);}else{this._dataSource.sendRequest(this._request,this._loadDataHandler,this);}}},_loadDataHandler:function(D,C,J){if(J){}else{var I=false;var F=[];var E=0;var K=null;var H=0;if(this._seriesDefs!==null){E=this._seriesDefs.length;for(H=0;H<E;H++){K=this._seriesDefs[H];var B={};for(var A in K){if(A=="style"&&K.style!==null){B.style=YAHOO.lang.JSON.stringify(K.style);I=true;K.style=null;}else{B[A]=K[A];}}F.push(B);}}if(E>0){for(H=0;H<E;H++){K=F[H];if(!K.type){K.type=this._type;}K.dataProvider=C.results;}}else{var G={type:this._type,dataProvider:C.results};F.push(G);}this._swf.setDataProvider(F,I);}},_request:"",_getRequest:function(){return this._request;},_setRequest:function(A){this._request=A;this._refreshData();},_dataSource:null,_getDataSource:function(){return this._dataSource;},_setDataSource:function(A){this._dataSource=A;this._refreshData();},_seriesDefs:null,_getSeriesDefs:function(){return this._seriesDefs;},_setSeriesDefs:function(A){this._seriesDefs=A;this._refreshData();},_getCategoryNames:function(){return this._swf.getCategoryNames();},_setCategoryNames:function(A){this._swf.setCategoryNames(A);},_dataTipFunction:null,_getDataTipFunction:function(){return this._dataTipFunction;},_setDataTipFunction:function(A){this._dataTipFunction=A;this._swf.setDataTipFunction(A);},_getPolling:function(){return this._pollingInterval;},_setPolling:function(A){this._pollingInterval=A;this._refreshData();}});YAHOO.widget.Chart.SWFURL="assets/charts.swf";YAHOO.widget.PieChart=function(A,C,B){YAHOO.widget.PieChart.superclass.constructor.call(this,"pie",A,C,B);
+};YAHOO.lang.extend(YAHOO.widget.PieChart,YAHOO.widget.Chart,{_initAttributes:function(A){YAHOO.widget.PieChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("dataField",{method:this._getDataField});this.setAttributeConfig("dataField",{validator:YAHOO.lang.isString,method:this._setDataField});this.getAttributeConfig("categoryField",{method:this._getCategoryField});this.setAttributeConfig("categoryField",{validator:YAHOO.lang.isString,method:this._setCategoryField});},_getDataField:function(){return this._swf.getDataField();},_setDataField:function(A){this._swf.setDataField(A);},_getCategoryField:function(){return this._swf.getCategoryField();},_setCategoryField:function(A){this._swf.setCategoryField(A);}});YAHOO.widget.CartesianChart=function(C,A,D,B){YAHOO.widget.CartesianChart.superclass.constructor.call(this,C,A,D,B);};YAHOO.lang.extend(YAHOO.widget.CartesianChart,YAHOO.widget.Chart,{_initAttributes:function(A){YAHOO.widget.CartesianChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("xField",{method:this._getXField});this.setAttributeConfig("xField",{validator:YAHOO.lang.isString,method:this._setXField});this.getAttributeConfig("yField",{method:this._getYField});this.setAttributeConfig("yField",{validator:YAHOO.lang.isString,method:this._setYField});this.setAttributeConfig("xAxis",{method:this._setXAxis});this.setAttributeConfig("yAxis",{method:this._setYAxis});},_getXField:function(){return this._swf.getHorizontalField();},_setXField:function(A){this._swf.setHorizontalField(A);},_getYField:function(){return this._swf.getVerticalField();},_setYField:function(A){this._swf.setVerticalField(A);},_setXAxis:function(A){this._swf.setHorizontalAxis(A);},_setYAxis:function(A){this._swf.setVerticalAxis(A);}});YAHOO.widget.LineChart=function(A,C,B){YAHOO.widget.LineChart.superclass.constructor.call(this,"line",A,C,B);};YAHOO.lang.extend(YAHOO.widget.LineChart,YAHOO.widget.CartesianChart);YAHOO.widget.ColumnChart=function(A,C,B){YAHOO.widget.ColumnChart.superclass.constructor.call(this,"column",A,C,B);};YAHOO.lang.extend(YAHOO.widget.ColumnChart,YAHOO.widget.CartesianChart);YAHOO.widget.BarChart=function(A,C,B){YAHOO.widget.BarChart.superclass.constructor.call(this,"bar",A,C,B);};YAHOO.lang.extend(YAHOO.widget.BarChart,YAHOO.widget.CartesianChart);YAHOO.widget.Axis=function(){};YAHOO.widget.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true};YAHOO.widget.NumericAxis=function(){YAHOO.widget.NumericAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.NumericAxis,YAHOO.widget.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear"});YAHOO.widget.TimeAxis=function(){YAHOO.widget.TimeAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.TimeAxis,YAHOO.widget.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true});YAHOO.widget.CategoryAxis=function(){YAHOO.widget.CategoryAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.CategoryAxis,YAHOO.widget.Axis,{type:"category",categoryNames:null});YAHOO.widget.Series=function(){};YAHOO.widget.Series.prototype={type:null,displayName:null};YAHOO.widget.CartesianSeries=function(){YAHOO.widget.CartesianSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.CartesianSeries,YAHOO.widget.Series,{xField:null,yField:null});YAHOO.widget.ColumnSeries=function(){YAHOO.widget.ColumnSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.ColumnSeries,YAHOO.widget.CartesianSeries,{type:"column"});YAHOO.widget.LineSeries=function(){YAHOO.widget.LineSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.LineSeries,YAHOO.widget.CartesianSeries,{type:"line"});YAHOO.widget.BarSeries=function(){YAHOO.widget.BarSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.BarSeries,YAHOO.widget.CartesianSeries,{type:"bar"});YAHOO.widget.PieSeries=function(){YAHOO.widget.PieSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.PieSeries,YAHOO.widget.Series,{type:"pie",dataField:null,categoryField:null});YAHOO.register("charts",YAHOO.widget.Chart,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/charts/charts-experimental.js b/lib/yui/charts/charts-experimental.js
new file mode 100644 (file)
index 0000000..f97daac
--- /dev/null
@@ -0,0 +1,1853 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/*!
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+var deconcept = deconcept || {};
+
+if(typeof deconcept.util == "undefined" || !deconcept.util)
+{
+       deconcept.util = {};
+}
+
+if(typeof deconcept.SWFObjectUtil == "undefined" || !deconcept.SWFObjectUtil)
+{
+       deconcept.SWFObjectUtil = {};
+}
+
+deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey)
+{
+       if(!document.getElementById) { return; }
+       this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
+       this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
+       this.params = {};
+       this.variables = {};
+       this.attributes = [];
+       if(swf) { this.setAttribute('swf', swf); }
+       if(id) { this.setAttribute('id', id); }
+       if(w) { this.setAttribute('width', w); }
+       if(h) { this.setAttribute('height', h); }
+       if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
+       this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
+       if (!window.opera && document.all && this.installedVer.major > 7)
+       {
+               // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
+               deconcept.SWFObject.doPrepUnload = true;
+       }
+       if(c)
+       {
+               this.addParam('bgcolor', c);
+       }
+       var q = quality ? quality : 'high';
+       this.addParam('quality', q);
+       this.setAttribute('useExpressInstall', false);
+       this.setAttribute('doExpressInstall', false);
+       var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
+       this.setAttribute('xiRedirectUrl', xir);
+       this.setAttribute('redirectUrl', '');
+       if(redirectUrl)
+       {
+               this.setAttribute('redirectUrl', redirectUrl);
+       }
+};
+
+deconcept.SWFObject.prototype =
+{
+       useExpressInstall: function(path)
+       {
+               this.xiSWFPath = !path ? "expressinstall.swf" : path;
+               this.setAttribute('useExpressInstall', true);
+       },
+       setAttribute: function(name, value){
+               this.attributes[name] = value;
+       },
+       getAttribute: function(name){
+               return this.attributes[name];
+       },
+       addParam: function(name, value){
+               this.params[name] = value;
+       },
+       getParams: function(){
+               return this.params;
+       },
+       addVariable: function(name, value){
+               this.variables[name] = value;
+       },
+       getVariable: function(name){
+               return this.variables[name];
+       },
+       getVariables: function(){
+               return this.variables;
+       },
+       getVariablePairs: function(){
+               var variablePairs = [];
+               var key;
+               var variables = this.getVariables();
+               for(key in variables){
+                       variablePairs[variablePairs.length] = key +"="+ variables[key];
+               }
+               return variablePairs;
+       },
+       getSWFHTML: function() {
+               var swfNode = "";
+               var params = {};
+               var key = "";
+               var pairs = "";
+               if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "PlugIn");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
+                       swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
+                       params = this.getParams();
+                       for(key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
+                       pairs = this.getVariablePairs().join("&");
+                       if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
+                       swfNode += '/>';
+               } else { // PC IE
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "ActiveX");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
+                       swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
+                       params = this.getParams();
+                       for(key in params) {
+                        swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
+                       }
+                       pairs = this.getVariablePairs().join("&");
+                       if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
+                       swfNode += "</object>";
+               }
+               return swfNode;
+       },
+       write: function(elementId)
+       {
+               if(this.getAttribute('useExpressInstall')) {
+                       // check to see if we need to do an express install
+                       var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
+                       if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
+                               this.setAttribute('doExpressInstall', true);
+                               this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
+                               document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+                               this.addVariable("MMdoctitle", document.title);
+                       }
+               }
+               if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version')))
+               {
+                       var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
+                       n.innerHTML = this.getSWFHTML();
+                       return true;
+               }
+               else
+               {
+                       if(this.getAttribute('redirectUrl') !== "")
+                       {
+                               document.location.replace(this.getAttribute('redirectUrl'));
+                       }
+               }
+               return false;
+       }
+};
+
+/* ---- detection functions ---- */
+deconcept.SWFObjectUtil.getPlayerVersion = function()
+{
+       var axo = null;
+       var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
+       if(navigator.plugins && navigator.mimeTypes.length)
+       {
+               var x = navigator.plugins["Shockwave Flash"];
+               if(x && x.description)
+               {
+                       PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
+               }
+       }
+       else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0)
+       { // if Windows CE
+               var counter = 3;
+               while(axo)
+               {
+                       try
+                       {
+                               counter++;
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
+//                             document.write("player v: "+ counter);
+                               PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
+                       }
+                       catch(e)
+                       {
+                               axo = null;
+                       }
+               }
+       }
+       else
+       { // Win IE (non mobile)
+               // do minor version lookup in IE, but avoid fp6 crashing issues
+               // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
+               try
+               {
+                       axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+               }
+               catch(e)
+               {
+                       try
+                       {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                               PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
+                               axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
+                       }
+                       catch(e)
+                       {
+                               if(PlayerVersion.major == 6)
+                               {
+                                       return PlayerVersion;
+                               }
+                       }
+                       try
+                       {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+                       }
+                       catch(e) {}
+               }
+               
+               if(axo !== null)
+               {
+                       PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
+               }
+       }
+       return PlayerVersion;
+};
+
+deconcept.PlayerVersion = function(arrVersion)
+{
+       this.major = arrVersion[0] !== null ? parseInt(arrVersion[0], 0) : 0;
+       this.minor = arrVersion[1] !== null ? parseInt(arrVersion[1], 0) : 0;
+       this.rev = arrVersion[2] !== null ? parseInt(arrVersion[2], 0) : 0;
+};
+
+deconcept.PlayerVersion.prototype.versionIsValid = function(fv)
+{
+       if(this.major < fv.major)
+       {
+               return false;
+       }
+       if(this.major > fv.major)
+       {
+               return true;
+       }
+       if(this.minor < fv.minor)
+       {
+               return false;
+       }
+       if(this.minor > fv.minor)
+       {
+               return true;
+       }
+       if(this.rev < fv.rev)
+       {
+               return false;
+       }
+       return true;
+};
+
+/* ---- get value of query string param ---- */
+deconcept.util =
+{
+       getRequestParameter: function(param)
+       {
+               var q = document.location.search || document.location.hash;
+               if(param === null) { return q; }
+               if(q)
+               {
+                       var pairs = q.substring(1).split("&");
+                       for(var i=0; i < pairs.length; i++)
+                       {
+                               if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
+                               {
+                                       return pairs[i].substring((pairs[i].indexOf("=") + 1));
+                               }
+                       }
+               }
+               return "";
+       }
+};
+
+/* fix for video streaming bug */
+deconcept.SWFObjectUtil.cleanupSWFs = function()
+{
+       var objects = document.getElementsByTagName("OBJECT");
+       for(var i = objects.length - 1; i >= 0; i--)
+       {
+               objects[i].style.display = 'none';
+               for(var x in objects[i])
+               {
+                       if(typeof objects[i][x] == 'function')
+                       {
+                               objects[i][x] = function(){};
+                       }
+               }
+       }
+};
+
+// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
+if(deconcept.SWFObject.doPrepUnload)
+{
+       if(!deconcept.unloadSet)
+       {
+               deconcept.SWFObjectUtil.prepUnload = function()
+               {
+                       __flash_unloadHandler = function(){};
+                       __flash_savedUnloadHandler = function(){};
+                       window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
+               };
+               window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
+               deconcept.unloadSet = true;
+       }
+}
+
+/* add document.getElementById if needed (mobile IE < 5) */
+if(!document.getElementById && document.all)
+{
+       document.getElementById = function(id) { return document.all[id]; };
+}
+
+/* add some aliases for ease of use/backwards compatibility */
+var getQueryParamValue = deconcept.util.getRequestParameter;
+var FlashObject = deconcept.SWFObject; // for legacy support
+var SWFObject = deconcept.SWFObject;
+
+/**
+ * Wraps Flash embedding functionality and allows communication with SWF through
+ * attributes.
+ *
+ * @namespace YAHOO.widget
+ * @class FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
+ */
+YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
+{
+       // set up the initial events and attributes stuff
+       this._queue = this._queue || [];
+       this._events = this._events || {};
+       this._configs = this._configs || {};
+       attributes = attributes || {};
+       
+       //the Flash Player external interface code from Adobe doesn't play nicely
+       //with the default value, yui-gen, in IE
+       this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
+       attributes.version = attributes.version || "9.0.45";
+       attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
+       
+       //we can't use the initial attributes right away
+       //so save them for once the SWF finishes loading
+       this._attributes = attributes;
+       
+       this._swfURL = swfURL;
+       
+       //embed the SWF file in the page
+       this._embedSWF(this._swfURL, containerID, attributes.id, attributes.version,
+               attributes.backgroundColor, attributes.expressInstall, attributes.wmode);
+       
+       /**
+        * Fires when the SWF is initialized and communication is possible.
+        * @event contentReady
+        */
+       this.createEvent("contentReady");
+};
+
+YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
+{
+       /**
+        * The URL of the SWF file.
+        * @property _swfURL
+        * @type String
+        * @private
+        */
+       _swfURL: null,
+
+       /**
+        * A reference to the embedded SWF file.
+        * @property _swf
+        * @private
+        */
+       _swf: null,
+
+       /**
+        * The id of this instance.
+        * @property _id
+        * @type String
+        * @private
+        */
+       _id: null,
+       
+       /**
+        * The initializing attributes are stored here until the SWF is ready.
+        * @property _attributes
+        * @type Object
+        * @private
+        */
+       _attributes: null, //the intializing attributes
+
+       /**
+        * Public accessor to the unique name of the FlashAdapter instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the FlashAdapter instance.
+        */
+       toString: function()
+       {
+               return "FlashAdapter " + this._id;
+       },
+
+       /**
+        * Embeds the SWF in the page and associates it with this instance.
+        *
+        * @method _embedSWF
+        * @private
+        */
+       _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode)
+       {
+               //standard SWFObject embed
+               var swfObj = new deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor);
+
+               if(expressInstall)
+               {
+                       swfObj.useExpressInstall(expressInstall);
+               }
+
+               //make sure we can communicate with ExternalInterface
+               swfObj.addParam("allowScriptAccess", "always");
+               
+               if(wmode !== null)
+               {
+                       swfObj.addParam("wmode", wmode);
+               }
+               
+               //again, a useful ExternalInterface trick
+               swfObj.addVariable("allowedDomain", document.location.hostname);
+
+               //tell the SWF which HTML element it is in
+               swfObj.addVariable("elementID", swfID);
+
+               // set the name of the function to call when the swf has an event
+               swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
+
+               var container = YAHOO.util.Dom.get(containerID);
+               var result = swfObj.write(container);
+               if(result)
+               {
+                       this._swf = YAHOO.util.Dom.get(swfID);
+                       //if successful, let's add an owner property to the SWF reference
+                       //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
+                       this._swf.owner = this;
+               }
+               else
+               {
+               }
+       },
+
+       /**
+        * Handles or re-dispatches events received from the SWF.
+        *
+        * @method _eventHandler
+        * @private
+        */
+       _eventHandler: function(event)
+       {
+               var type = event.type;
+               switch(type)
+               {
+                       case "swfReady":
+                               this._loadHandler();
+                               return;
+                       case "log":
+                               return;
+               }
+               
+               //be sure to return after your case or the event will automatically fire!
+               this.fireEvent(type, event);
+       },
+
+       /**
+        * Called when the SWF has been initialized.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._initAttributes(this._attributes);
+               this.setAttributes(this._attributes, true);
+               this._attributes = null;
+               
+               this.fireEvent("contentReady");
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               //should be overridden if other attributes need to be set up
+               
+               /**
+                * @attribute swfURL
+                * @description Absolute or relative URL to the SWF displayed by the FlashAdapter.
+                * @type String
+                */
+               this.getAttributeConfig("swfURL",
+               {
+                       method: this._getSWFURL
+               });
+       },
+       
+       /**
+        * Getter for swfURL attribute.
+        *
+        * @method _getSWFURL
+        * @private
+        */
+       _getSWFURL: function()
+       {
+               return this._swfURL;
+       }
+});
+
+/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of FlashAdapter.
+ *
+ * @method YAHOO.widget.FlashAdapter.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
+{
+       var loadedSWF = YAHOO.util.Dom.get(elementID);
+       if(!loadedSWF.owner)
+       {
+               //fix for ie: if owner doesn't exist yet, try again in a moment
+               setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
+       }
+       else
+       {
+               loadedSWF.owner._eventHandler(event);
+       }
+};
+
+/**
+ * The Charts widget provides a Flash control for displaying data
+ * graphically by series across A-grade browsers with Flash Player installed.
+ *
+ * @module charts
+ * @requires yahoo, dom, event, datasource
+ * @title Charts Widget
+ * @beta
+ */
+
+/**
+ * Chart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class Chart
+ * @uses YAHOO.util.FlashAdapter
+ * @constructor
+ * @param type {String} The char type. May be "line", "column", "bar", or "pie"
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
+{
+       YAHOO.widget.Chart.superclass.constructor.call(this, YAHOO.widget.Chart.SWFURL, containerId, attributes);
+       
+       this._type = type;
+       this._dataSource = dataSource;
+       
+       /**
+        * Fires when the user moves the mouse over the bounds of an item renderer in the chart.
+        *
+        * @event itemMouseOverEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemMouseOverEvent");
+       
+       /**
+        * Fires when the user moves the mouse out of the bounds of an item renderer in the chart.
+        *
+        * @event itemMouseOutEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemMouseOutEvent");
+       
+       /**
+        * Fires when the user clicks an item renderer in the chart with the mouse.
+        *
+        * @event itemClickEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemClickEvent");
+       
+       /**
+        * Fires when the user double-clicks an item renderer in the chart with the mouse.
+        *
+        * @event itemDoubleClickEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDoubleClickEvent");
+       
+       /**
+        * Fires when the user presses the mouse down on an item to initiate a drag action.
+        *
+        * @event itemDragStartEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragStartEvent");
+       
+       /**
+        * Fires when the user moves the mouse during a drag action.
+        *
+        * @event itemDragEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragEvent");
+
+       /**
+        * Fires when the user releases the mouse during a drag action.
+        *
+        * @event itemDragEndEvent
+        * @param event.type {String} The event type
+        * @param event.item {Object} The data displayed by the renderer
+        * @param event.index {Number} The position within the series that the item appears.
+        * @param event.seriesIndex {Number} The position within the series definition that the series appears.
+        * @param event.x {Number} The horizontal position of the mouse, relative to the SWF.
+        * @param event.y {Number} The vertical position of the mouse, relative to the SWF.
+        */
+       this.createEvent("itemDragEndEvent");
+};
+
+YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
+{
+       /**
+        * The type of this chart instance.
+        * @property _type
+        * @type String
+        * @private
+        */
+       _type: null,
+
+       /**
+        * The id returned from the DataSource's setInterval function.
+        * @property _pollingID
+        * @type Number
+        * @private
+        */
+       _pollingID: null,
+
+       /**
+        * The time, in ms, between requests for data.
+        * @property _pollingInterval
+        * @type Number
+        * @private
+        */
+       _pollingInterval: null,
+       
+       /**
+        * Indicates whether all attributes have been set and
+        * the dataSource may be passed to the SWF.
+        * @property _initialized
+        * @type Boolean
+        * @private
+        */
+       _initialized: false,
+
+       /**
+        * Public accessor to the unique name of the Chart instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the Chart instance.
+        */
+       toString: function()
+       {
+               return "Chart " + this._id;
+       },
+       
+       /**
+        * Sets a single style value on the Chart instance.
+        *
+        * @method setStyle
+        * @param name {String} Name of the Chart style value to change.
+        * @param value {Object} New value to pass to the Chart style.
+        */
+       setStyle: function(name, value)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               value = YAHOO.lang.JSON.stringify(value);
+               this._swf.setStyle(name, value);
+       },
+       
+       /**
+        * Resets all styles on the Chart instance.
+        *
+        * @method setStyles
+        * @param styles {Object} Initializer for all Chart styles.
+        */
+       setStyles: function(styles)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               styles = YAHOO.lang.JSON.stringify(styles);
+               this._swf.setStyles(styles);
+       },
+       
+       /**
+        * Sets the styles on all series in the Chart.
+        *
+        * @method setSeriesStyles
+        * @param styles {Array} Initializer for all Chart series styles.
+        */
+       setSeriesStyles: function(styles)
+       {
+               //we must jsonify this because Flash Player versions below 9.0.60 don't handle
+               //complex ExternalInterface parsing correctly
+               for(var i = 0; i < styles.length; i++)
+               {
+                       styles[i] = YAHOO.lang.JSON.stringify(styles[i]);       
+               }
+               this._swf.setSeriesStyles(styles);
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+
+               /**
+                * @attribute request
+                * @description Request to be sent to the Chart's DataSource.
+                * @type String
+                */
+               this.getAttributeConfig("request",
+               {
+                       method: this._getRequest
+               });
+               
+               this.setAttributeConfig("request",
+               {
+                       method: this._setRequest
+               });
+               
+               /**
+                * @attribute dataSource
+                * @description The DataSource instance to display in the Chart.
+                * @type DataSource
+                */
+               this.getAttributeConfig("dataSource",
+               {
+                       method: this._getDataSource
+               });
+               
+               this.setAttributeConfig("dataSource",
+               {
+                       method: this._setDataSource
+               });
+               
+               /**
+                * @attribute series
+                * @description Defines the series to be displayed by the Chart.
+                * @type Array
+                */
+               this.getAttributeConfig("series",
+               {
+                       method: this._getSeriesDefs
+               });
+               
+               this.setAttributeConfig("series",
+               {
+                       method: this._setSeriesDefs
+               });
+               
+               /**
+                * @attribute categoryNames
+                * @description Defines the names of the categories to be displayed in the Chart..
+                * @type Array
+                */
+               this.getAttributeConfig("categoryNames",
+               {
+                       method: this._getCategoryNames
+               });
+               
+               this.setAttributeConfig("categoryNames",
+               {
+                       validator: YAHOO.lang.isArray,
+                       method: this._setCategoryNames
+               });
+               
+               /**
+                * @attribute dataTipFunction
+                * @description The string representation of a globally-accessible function
+                * that may be called by the SWF to generate the datatip text for a Chart's item.
+                * @type String
+                */
+               this.getAttributeConfig("dataTipFunction",
+               {
+                       method: this._getDataTipFunction
+               });
+               
+               this.setAttributeConfig("dataTipFunction",
+               {
+                       method: this._setDataTipFunction
+               });
+
+               /**
+                * @attribute polling
+                * @description A numeric value indicating the number of milliseconds between
+                * polling requests to the DataSource.
+                * @type Number
+                */
+               this.getAttributeConfig("polling",
+               {
+                       method: this._getPolling
+               });
+
+               this.setAttributeConfig("polling",
+               {
+                       method: this._setPolling
+               });
+       },
+       
+       /**
+        * Called when the SWF is ready for communication. Sets the type, initializes
+        * the styles, and sets the DataSource.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._swf.setType(this._type);
+               
+               //set initial styles
+               if(this._attributes.style)
+               {
+                       var style = this._attributes.style;
+                       this.setStyles(style);          
+               }
+               
+               YAHOO.widget.Chart.superclass._loadHandler.call(this);
+               
+               this._initialized = true;
+               
+               if(this._dataSource)
+               {
+                       this.set("dataSource", this._dataSource);
+               }
+       },
+
+       /**
+        * Sends the request to the DataSource.
+        *
+        * @method _refreshData
+        * @private
+        */
+       _refreshData: function()
+       {
+               if(!this._initialized)
+               {
+                       return;
+               }
+               
+               if(this._dataSource !== null)
+               {
+                       if(this._pollingID !== null)
+                       {
+                               this._dataSource.clearInterval(this._pollingID);
+                               this._pollingID = null;
+                       }
+                       
+                       if(this._pollingInterval > 0)
+                       {
+                               this._pollingID = this._dataSource.setInterval(this._pollingInterval, this._request, this._loadDataHandler, this);
+                       }
+                       else
+                       {
+                               this._dataSource.sendRequest(this._request, this._loadDataHandler, this);
+                       }
+               }
+       },
+
+       /**
+        * Called when the DataSource receives new data. The series definitions are used
+        * to build a data provider for the SWF chart.
+        *
+        * @method _loadDataHandler
+        * @private
+        */
+       _loadDataHandler: function(request, response, error)
+       {
+               if(error)
+               {
+               }
+               else
+               {
+                       var styleChanged = false;
+                       
+                       //make a copy of the series definitions so that we aren't
+                       //editing them directly.
+                       var dataProvider = [];  
+                       var seriesCount = 0;
+                       var currentSeries = null;
+                       var i = 0;
+                       if(this._seriesDefs !== null)
+                       {
+                               seriesCount = this._seriesDefs.length;
+                               for(i = 0; i < seriesCount; i++)
+                               {
+                                       currentSeries = this._seriesDefs[i];
+                                       var clonedSeries = {};
+                                       for(var prop in currentSeries)
+                                       {
+                                               if(prop == "style" && currentSeries.style !== null)
+                                               {
+                                                       clonedSeries.style = YAHOO.lang.JSON.stringify(currentSeries.style);
+                                                       styleChanged = true;
+                                                       
+                                                       //we don't want to modify the styles again next time
+                                                       //so null out the style property.
+                                                       currentSeries.style = null;
+                                               }
+                                               else
+                                               {
+                                                       clonedSeries[prop] = currentSeries[prop];
+                                               }
+                                       }
+                                       dataProvider.push(clonedSeries);
+                               }
+                       }
+                       
+                       if(seriesCount > 0)
+                       {
+                               for(i = 0; i < seriesCount; i++)
+                               {
+                                       currentSeries = dataProvider[i];
+                                       if(!currentSeries.type)
+                                       {
+                                               currentSeries.type = this._type;
+                                       }
+                                       currentSeries.dataProvider = response.results;
+                               }
+                       }
+                       else
+                       {
+                               var series = {type: this._type, dataProvider: response.results};
+                               dataProvider.push(series);
+                       }
+                       this._swf.setDataProvider(dataProvider, styleChanged);
+               }
+       },
+
+       /**
+        * Storage for the request attribute.
+        * 
+        * @property _request
+        * @private
+        */
+       _request: "",
+       
+       /**
+        * Getter for the request attribute.
+        *
+        * @method _getRequest
+        * @private
+        */
+       _getRequest: function()
+       {
+               return this._request;
+       },
+       
+       /**
+        * Setter for the request attribute.
+        *
+        * @method _setRequest
+        * @private
+        */
+       _setRequest: function(value)
+       {
+               this._request = value;
+               this._refreshData();
+       },
+
+       /**
+        * Storage for the dataSource attribute.
+        * 
+        * @property _dataSource
+        * @private
+        */
+       _dataSource: null,
+       
+       /**
+        * Getter for the dataSource attribute.
+        *
+        * @method _getDataSource
+        * @private
+        */
+       _getDataSource: function()
+       {
+               return this._dataSource;
+       },
+
+       /**
+        * Setter for the dataSource attribute.
+        *
+        * @method _setDataSource
+        * @private
+        */
+       _setDataSource: function(value)
+       {       
+               this._dataSource = value;
+               this._refreshData();
+       },
+       
+       /**
+        * Storage for the series attribute.
+        * 
+        * @property _seriesDefs
+        * @private
+        */
+       _seriesDefs: null,
+       
+       /**
+        * Getter for the series attribute.
+        *
+        * @method _getSeriesDefs
+        * @private
+        */
+       _getSeriesDefs: function()
+       {
+               return this._seriesDefs;
+       },
+       
+       /**
+        * Setter for the series attribute.
+        *
+        * @method _setSeriesDefs
+        * @private
+        */
+       _setSeriesDefs: function(value)
+       {
+               this._seriesDefs = value;
+               this._refreshData();
+       },
+
+       /**
+        * Getter for the categoryNames attribute.
+        *
+        * @method _getCategoryNames
+        * @private
+        */
+       _getCategoryNames: function()
+       {
+               return this._swf.getCategoryNames();
+       },
+
+       /**
+        * Setter for the categoryNames attribute.
+        *
+        * @method _setCategoryNames
+        * @private
+        */
+       _setCategoryNames: function(value)
+       {
+               this._swf.setCategoryNames(value);
+       },
+       
+       /**
+        * Storage for the dataTipFunction attribute.
+        *
+        * @property _dataTipFunction
+        * @private
+        */
+       _dataTipFunction: null,
+       
+       /**
+        * Getter for the dataTipFunction attribute.
+        *
+        * @method _getDataTipFunction
+        * @private
+        */
+       _getDataTipFunction: function()
+       {
+               return this._dataTipFunction;
+       },
+       
+       /**
+        * Setter for the dataTipFunction attribute.
+        *
+        * @method _setDataTipFunction
+        * @private
+        */
+       _setDataTipFunction: function(value)
+       {
+               this._dataTipFunction = value;
+               this._swf.setDataTipFunction(value);
+       },
+
+       /**
+        * Getter for the polling attribute.
+        *
+        * @method _getPolling
+        * @private
+        */
+       _getPolling: function()
+       {
+               return this._pollingInterval;
+       },
+
+       /**
+        * Setter for the polling attribute.
+        *
+        * @method _setPolling
+        * @private
+        */
+       _setPolling: function(value)
+       {
+               this._pollingInterval = value;
+               this._refreshData();
+       }
+});
+
+/**
+ * Storage for the dataTipFunction attribute.
+ *
+ * @property Chart.SWFURL
+ * @private
+ * @static
+ * @final
+ * @default "assets/charts.swf"
+ */
+YAHOO.widget.Chart.SWFURL = "assets/charts.swf";
+
+/**
+ * PieChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class PieChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.PieChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.PieChart.superclass.constructor.call(this, "pie", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.PieChart, YAHOO.widget.Chart,
+{
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {       
+               YAHOO.widget.PieChart.superclass._initAttributes.call(this, attributes);
+               
+               /**
+                * @attribute dataField
+                * @description The field in each item that corresponds to the data value.
+                * @type String
+                */
+               this.getAttributeConfig("dataField",
+               {
+                       method: this._getDataField
+               });
+   
+               this.setAttributeConfig("dataField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setDataField
+               });
+   
+               /**
+                * @attribute categoryField
+                * @description The field in each item that corresponds to the category value.
+                * @type String
+                */
+               this.getAttributeConfig("categoryField",
+               {
+                       method: this._getCategoryField
+               });
+   
+               this.setAttributeConfig("categoryField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setCategoryField
+               });
+       },
+
+       /**
+        * Getter for the dataField attribute.
+        *
+        * @method _getDataField
+        * @private
+        */
+       _getDataField: function()
+       {
+               return this._swf.getDataField();
+       },
+
+       /**
+        * Setter for the dataField attribute.
+        *
+        * @method _setDataField
+        * @private
+        */
+       _setDataField: function(value)
+       {
+               this._swf.setDataField(value);
+       },
+
+       /**
+        * Getter for the categoryField attribute.
+        *
+        * @method _getCategoryField
+        * @private
+        */
+       _getCategoryField: function()
+       {
+               return this._swf.getCategoryField();
+       },
+
+       /**
+        * Setter for the categoryField attribute.
+        *
+        * @method _setCategoryField
+        * @private
+        */
+       _setCategoryField: function(value)
+       {
+               this._swf.setCategoryField(value);
+       }
+});
+
+/**
+ * CartesianChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class CartesianChart
+ * @uses YAHOO.widget.Charts
+ * @constructor
+ * @param type {String} The char type. May be "line", "column", or "bar"
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+ YAHOO.widget.CartesianChart = function(type, containerId, dataSource, attributes)
+{
+       YAHOO.widget.CartesianChart.superclass.constructor.call(this, type, containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
+{
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {       
+               YAHOO.widget.CartesianChart.superclass._initAttributes.call(this, attributes);
+
+               /**
+                * @attribute xField
+                * @description The field in each item that corresponds to a value on the x axis.
+                * @type String
+                */
+               this.getAttributeConfig("xField",
+               {
+                       method: this._getXField
+               });
+
+               this.setAttributeConfig("xField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setXField
+               });
+
+               /**
+                * @attribute yField
+                * @description The field in each item that corresponds to a value on the x axis.
+                * @type String
+                */
+               this.getAttributeConfig("yField",
+               {
+                       method: this._getYField
+               });
+
+               this.setAttributeConfig("yField",
+               {
+                       validator: YAHOO.lang.isString,
+                       method: this._setYField
+               });
+
+               /**
+                * @attribute xAxis
+                * @description A custom configuration for the horizontal x axis.
+                * @type Axis
+                */
+               this.setAttributeConfig("xAxis",
+               {
+                       method: this._setXAxis
+               });
+
+               /**
+                * @attribute yAxis
+                * @description A custom configuration for the vertical y axis.
+                * @type Axis
+                */
+               this.setAttributeConfig("yAxis",
+               {
+                       method: this._setYAxis
+               });
+       },
+
+       /**
+        * Getter for the xField attribute.
+        *
+        * @method _getXField
+        * @private
+        */
+       _getXField: function()
+       {
+               return this._swf.getHorizontalField();
+       },
+
+       /**
+        * Setter for the xField attribute.
+        *
+        * @method _setXField
+        * @private
+        */
+       _setXField: function(value)
+       {
+               this._swf.setHorizontalField(value);
+       },
+
+       /**
+        * Getter for the yField attribute.
+        *
+        * @method _getYField
+        * @private
+        */
+       _getYField: function()
+       {
+               return this._swf.getVerticalField();
+       },
+
+       /**
+        * Setter for the yField attribute.
+        *
+        * @method _setYField
+        * @private
+        */
+       _setYField: function(value)
+       {
+               this._swf.setVerticalField(value);
+       },
+       
+       /**
+        * Setter for the xAxis attribute.
+        *
+        * @method _setXAxis
+        * @private
+        */
+       _setXAxis: function(value)
+       {
+               this._swf.setHorizontalAxis(value);
+       },
+
+       /**
+        * Getter for the yAxis attribute.
+        *
+        * @method _setYAxis
+        * @private
+        */
+       _setYAxis: function(value)
+       {
+               this._swf.setVerticalAxis(value);
+       }
+});
+
+/**
+ * LineChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class LineChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.LineChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.LineChart.superclass.constructor.call(this, "line", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.LineChart, YAHOO.widget.CartesianChart);
+
+/**
+ * ColumnChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.ColumnChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.ColumnChart.superclass.constructor.call(this, "column", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.ColumnChart, YAHOO.widget.CartesianChart);
+
+/**
+ * BarChart class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class BarChart
+ * @uses YAHOO.widget.CartesianChart
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ * @param dataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param attributes {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.BarChart = function(containerId, dataSource, attributes)
+{
+       YAHOO.widget.BarChart.superclass.constructor.call(this, "bar", containerId, dataSource, attributes);
+};
+
+YAHOO.lang.extend(YAHOO.widget.BarChart, YAHOO.widget.CartesianChart);
+
+/**
+ * Defines a CartesianChart's vertical or horizontal axis.
+ *
+ * @namespace YAHOO.widget
+ * @class Axis
+ * @constructor
+ */
+YAHOO.widget.Axis = function()
+{
+};
+
+YAHOO.widget.Axis.prototype = 
+{
+       /**
+        * The type of axis.
+        *
+        * @property type
+        * @type String
+        */
+       type: null,
+       
+       /**
+        * The direction in which the axis is drawn. May be "horizontal" or "vertical".
+        *
+        * @property orientation
+        * @type String
+        */
+       orientation: "horizontal",
+       
+       /**
+        * If true, the items on the axis will be drawn in opposite direction.
+        *
+        * @property reverse
+        * @type Boolean
+        */
+       reverse: false,
+       
+       /**
+        * A string reference to the globally-accessible function that may be called to
+        * determine each of the label values for this axis.
+        *
+        * @property labelFunction
+        * @type String
+        */
+       labelFunction: null,
+       
+       /**
+        * If true, labels that overlap previously drawn labels on the axis will be hidden.
+        *
+        * @property hideOverlappingLabels
+        * @type Boolean
+        */
+       hideOverlappingLabels: true
+};
+
+/**
+ * A type of axis whose units are measured in numeric values.
+ *
+ * @namespace YAHOO.widget
+ * @class NumericAxis
+ * @constructor
+ */
+YAHOO.widget.NumericAxis = function()
+{
+       YAHOO.widget.NumericAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.NumericAxis, YAHOO.widget.Axis,
+{
+       type: "numeric",
+       
+       /**
+        * The minimum value drawn by the axis. If not set explicitly, the axis minimum
+        * will be calculated automatically.
+        *
+        * @property minimum
+        * @type Number
+        */
+       minimum: NaN,
+       
+       /**
+        * The maximum value drawn by the axis. If not set explicitly, the axis maximum
+        * will be calculated automatically.
+        *
+        * @property maximum
+        * @type Number
+        */
+       maximum: NaN,
+       
+       /**
+        * The spacing between major intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       majorUnit: NaN,
+
+       /**
+        * The spacing between minor intervals on this axis.
+        *
+        * @property minorUnit
+        * @type Number
+        */
+       minorUnit: NaN,
+       
+       /**
+        * If true, the labels, ticks, gridlines, and other objects will snap to
+        * the nearest major or minor unit. If false, their position will be based
+        * on the minimum value.
+        *
+        * @property snapToUnits
+        * @type Boolean
+        */
+       snapToUnits: true,
+
+       /**
+        * If true, and the bounds are calculated automatically, either the minimum or
+        * maximum will be set to zero.
+        *
+        * @property alwaysShowZero
+        * @type Boolean
+        */
+       alwaysShowZero: true,
+
+       /**
+        * The scaling algorithm to use on this axis. May be "linear" or "logarithmic".
+        *
+        * @property scale
+        * @type String
+        */
+       scale: "linear"
+});
+
+/**
+ * A type of axis whose units are measured in time-based values.
+ *
+ * @namespace YAHOO.widget
+ * @class TimeAxis
+ * @constructor
+ */
+YAHOO.widget.TimeAxis = function()
+{
+       YAHOO.widget.TimeAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.TimeAxis, YAHOO.widget.Axis,
+{
+       type: "time",
+       
+       /**
+        * The minimum value drawn by the axis. If not set explicitly, the axis minimum
+        * will be calculated automatically.
+        *
+        * @property minimum
+        * @type Date
+        */
+       minimum: null,
+
+       /**
+        * The maximum value drawn by the axis. If not set explicitly, the axis maximum
+        * will be calculated automatically.
+        *
+        * @property maximum
+        * @type Number
+        */
+       maximum: null,
+       
+       /**
+        * The spacing between major intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       majorUnit: NaN,
+       
+       /**
+        * The time unit used by the majorUnit.
+        *
+        * @property majorTimeUnit
+        * @type String
+        */
+       majorTimeUnit: null,
+       
+       /**
+        * The spacing between minor intervals on this axis.
+        *
+        * @property majorUnit
+        * @type Number
+        */
+       minorUnit: NaN,
+       
+       /**
+        * The time unit used by the minorUnit.
+        *
+        * @property majorTimeUnit
+        * @type String
+        */
+       minorTimeUnit: null,
+
+       /**
+        * If true, the labels, ticks, gridlines, and other objects will snap to
+        * the nearest major or minor unit. If false, their position will be based
+        * on the minimum value.
+        *
+        * @property snapToUnits
+        * @type Boolean
+        */
+       snapToUnits: true
+});
+
+/**
+ * A type of axis that displays items in categories.
+ *
+ * @namespace YAHOO.widget
+ * @class CategoryAxis
+ * @constructor
+ */
+YAHOO.widget.CategoryAxis = function()
+{
+       YAHOO.widget.CategoryAxis.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CategoryAxis, YAHOO.widget.Axis,
+{
+       type: "category",
+       
+       /**
+        * A list of category names to display along this axis.
+        *
+        * @property categoryNames
+        * @type Array
+        */
+       categoryNames: null
+});
+
+/**
+ * Series class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class Series
+ * @constructor
+ */
+YAHOO.widget.Series = function() {};
+
+YAHOO.widget.Series.prototype = 
+{
+       /**
+        * The type of series.
+        *
+        * @property type
+        * @type String
+        */
+       type: null,
+       
+       /**
+        * The human-readable name of the series.
+        *
+        * @property displayName
+        * @type String
+        */
+       displayName: null
+};
+
+/**
+ * CartesianSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class CartesianSeries
+ * @constructor
+ */
+YAHOO.widget.CartesianSeries = function() 
+{
+       YAHOO.widget.CartesianSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.CartesianSeries, YAHOO.widget.Series,
+{
+       /**
+        * The field used to access the x-axis value from the items from the data source.
+        *
+        * @property xField
+        * @type String
+        */
+       xField: null,
+       
+       /**
+        * The field used to access the y-axis value from the items from the data source.
+        *
+        * @property yField
+        * @type String
+        */
+       yField: null
+});
+
+/**
+ * ColumnSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSeries
+ * @constructor
+ */
+YAHOO.widget.ColumnSeries = function() 
+{
+       YAHOO.widget.ColumnSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.ColumnSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "column"
+});
+
+/**
+ * LineSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class LineSeries
+ * @constructor
+ */
+YAHOO.widget.LineSeries = function() 
+{
+       YAHOO.widget.LineSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.LineSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "line"
+});
+
+
+/**
+ * BarSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class BarSeries
+ * @constructor
+ */
+YAHOO.widget.BarSeries = function() 
+{
+       YAHOO.widget.BarSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.BarSeries, YAHOO.widget.CartesianSeries,
+{
+       type: "bar"
+});
+
+
+/**
+ * PieSeries class for the YUI Charts widget.
+ *
+ * @namespace YAHOO.widget
+ * @class PieSeries
+ * @constructor
+ */
+YAHOO.widget.PieSeries = function() 
+{
+       YAHOO.widget.PieSeries.superclass.constructor.call(this);
+};
+
+YAHOO.lang.extend(YAHOO.widget.PieSeries, YAHOO.widget.Series,
+{
+       type: "pie",
+       dataField: null,
+       categoryField: null
+});
+
+YAHOO.register("charts", YAHOO.widget.Chart, {version: "2.5.0", build: "895"});
index 330b53182b2b88f26d9b256507d36791939ab72d..cfc38709ce65a5536ff5813a095bd62d0c45057f 100755 (executable)
@@ -1,4 +1,15 @@
 ColorPicker - Release Notes
 
+2.5.0
+   * No change
+
+2.4.0
+   * Initialization values assigned to showcontrols, showrgbcontrols,
+     showwebsafe, showhexsummary, animate, red, green, and blue in the
+     constructor configuration are now honored. 
+
+2.3.1
+   * No change (bug fixes were inherited from slider)
+
 2.3.0
    * Initial release
index 5aa3015efec53e0f6343b326a6d0a85cb47c12f3..a6742cc627c962cfe028f92be8d8c12a65fb174b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
index 811d9ae5b66f28d1c6c20add57231e085149ce10..113aa68d9748a848463de153fd77f934717dd397 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
 .yui-picker-panel {
@@ -81,8 +81,8 @@ left: -2px;
 .yui-picker-controls { position:absolute; top: 72px; left:226px; font:1em monospace;}
 .yui-picker-controls .hd { background: transparent; border-width: 0px !important;}
 .yui-picker-controls .bd { height: 100px; border-width: 0px !important;}
-.yui-picker-controls ul {float:left;list-style:none;padding:0 2px 0 0;margin:0}
-.yui-picker-controls li {padding:2px;margin:0}
+.yui-picker-controls ul {float:left;padding:0 2px 0 0;margin:0}
+.yui-picker-controls li {padding:2px;list-style:none;margin:0}
 .yui-picker-controls input { 
     font-size: 0.85em;
     width: 2.4em;
index f07aa5140bf36f31e706fb87ec2cd6fe1c9bc73e..b4a18d7eaa2fbc4fde9b52aca289d2ff9e2a3f13 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;list-style:none;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
diff --git a/lib/yui/colorpicker/colorpicker-debug.js b/lib/yui/colorpicker/colorpicker-debug.js
new file mode 100644 (file)
index 0000000..1895925
--- /dev/null
@@ -0,0 +1,1755 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Provides color conversion and validation utils
+ * @class YAHOO.util.Color
+ * @namespace YAHOO.util
+ */
+YAHOO.util.Color = function() {
+
+    var HCHARS="0123456789ABCDEF", lang=YAHOO.lang;
+
+    return {
+
+        /**
+         * Converts 0-1 to 0-255
+         * @method real2dec
+         * @param n {float} the number to convert
+         * @return {int} a number 0-255
+         */
+        real2dec: function(n) {
+            return Math.min(255, Math.round(n*256));
+        },
+
+        /**
+         * Converts HSV (h[0-360], s[0-1]), v[0-1] to RGB [255,255,255]
+         * @method hsv2rgb
+         * @param h {int|[int, float, float]} the hue, or an
+         *        array containing all three parameters
+         * @param s {float} the saturation
+         * @param v {float} the value/brightness
+         * @return {[int, int, int]} the red, green, blue values in
+         *          decimal.
+         */
+        hsv2rgb: function(h, s, v) { 
+
+            if (lang.isArray(h)) {
+                return this.hsv2rgb.call(this, h[0], h[1], h[2]);
+            }
+
+            var r, g, b, i, f, p, q, t;
+            i = Math.floor((h/60)%6);
+            f = (h/60)-i;
+            p = v*(1-s);
+            q = v*(1-f*s);
+            t = v*(1-(1-f)*s);
+            switch(i) {
+                case 0: r=v; g=t; b=p; break;
+                case 1: r=q; g=v; b=p; break;
+                case 2: r=p; g=v; b=t; break;
+                case 3: r=p; g=q; b=v; break;
+                case 4: r=t; g=p; b=v; break;
+                case 5: r=v; g=p; b=q; break;
+            }
+
+            var fn=this.real2dec;
+
+            return [fn(r), fn(g), fn(b)];
+        },
+
+        /**
+         * Converts to RGB [255,255,255] to HSV (h[0-360], s[0-1]), v[0-1]
+         * @method rgb2hsv
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, float, float]} the value converted to hsv
+         */
+        rgb2hsv: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.rgb2hsv.call(this, r[0], r[1], r[2]);
+            }
+
+            r=r/255;
+            g=g/255;
+            b=b/255;
+
+            var min,max,delta,h,s,v;
+            min = Math.min(Math.min(r,g),b);
+            max = Math.max(Math.max(r,g),b);
+            delta = max-min;
+
+            switch (max) {
+                case min: h=0; break;
+                case r:   h=60*(g-b)/delta; 
+                          if (g<b) {
+                              h+=360;
+                          }
+                          break;
+                case g:   h=(60*(b-r)/delta)+120; break;
+                case b:   h=(60*(r-g)/delta)+240; break;
+            }
+            
+            s = (max === 0) ? 0 : 1-(min/max);
+
+            var hsv = [Math.round(h), s, max];
+
+            return hsv;
+
+        },
+
+        /**
+         * Converts decimal rgb values into a hex string
+         * 255,255,255 -> FFFFFF
+         * @method rgb2hex
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {string} the hex string
+         */
+        rgb2hex: function(r, g, b) {
+            if (lang.isArray(r)) {
+                return this.rgb2hex.call(this, r[0], r[1], r[2]);
+            }
+
+            var f=this.dec2hex;
+            return f(r) + f(g) + f(b);
+        },
+     
+        /**
+         * Converts an int 0...255 to hex pair 00...FF
+         * @method dec2hex
+         * @param n {int} the number to convert
+         * @return {string} the hex equivalent
+         */
+        dec2hex: function(n) {
+            n = parseInt(n, 10);
+            n = (lang.isNumber(n)) ? n : 0;
+            n = (n > 255 || n < 0) ? 0 : n;
+
+            return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
+        },
+
+        /**
+         * Converts a hex pair 00...FF to an int 0...255 
+         * @method hex2dec
+         * @param str {string} the hex pair to convert
+         * @return {int} the decimal
+         */
+        hex2dec: function(str) {
+            var f = function(c) {
+                return HCHARS.indexOf(c.toUpperCase());
+            };
+
+            var s=str.split('');
+            
+            return ((f(s[0]) * 16) + f(s[1]));
+        },
+
+        /**
+         * Converts a hex string to rgb
+         * @method hex2rgb
+         * @param str {string} the hex string
+         * @return {[int, int, int]} an array containing the rgb values
+         */
+        hex2rgb: function(s) { 
+            var f = this.hex2dec;
+            return [f(s.substr(0, 2)), f(s.substr(2, 2)), f(s.substr(4, 2))];
+        },
+
+        /**
+         * Returns the closest websafe color to the supplied rgb value.
+         * @method websafe
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, int, int]} an array containing the closes
+         *                           websafe rgb colors.
+         */
+        websafe: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.websafe.call(this, r[0], r[1], r[2]);
+            }
+
+            // returns the closest match [0, 51, 102, 153, 204, 255]
+            var f = function(v) {
+                if (lang.isNumber(v)) {
+                    v = Math.min(Math.max(0, v), 255);
+                    var i, next;
+                    for (i=0; i<256; i=i+51) {
+                        next = i+51;
+                        if (v >= i && v <= next) {
+                            return (v-i > 25) ? next : i;
+                        }
+                    }
+ YAHOO.log("Error calculating the websafe value for " + v, "warn");
+                }
+
+                return v;
+            };
+
+            return [f(r), f(g), f(b)];
+        }
+    };
+}();
+
+
+(function() {
+
+    var _pickercount = 0;
+
+    /**
+     * The colorpicker module provides a widget for selecting colors
+     * @module colorpicker
+     * @requires yahoo, dom, event, element, slider
+     */
+
+
+    /**
+     * Creates the host element if it doesn't exist
+     * @method _createHostElement
+     * @private
+     */
+    var _createHostElement = function() {
+        var el = document.createElement('div');
+
+        if (this.CSS.BASE) {
+            el.className = this.CSS.BASE;
+        }
+        
+        return el;
+    };
+
+    /**
+     * A widget to select colors
+     * @namespace YAHOO.widget
+     * @class YAHOO.widget.ColorPicker
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the colorpicker, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the colorpicker's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.ColorPicker = function(el, attr) {
+        _pickercount = _pickercount + 1;
+        this.logger = new YAHOO.widget.LogWriter("ColorPicker");
+        attr = attr || {};
+        if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
+        }
+        
+        if (!el && !attr.element) { // create if we dont have one
+            this.logger.log("creating host element");
+            el = _createHostElement.call(this, attr);
+        }
+
+       YAHOO.widget.ColorPicker.superclass.constructor.call(this, el, attr); 
+    };
+
+    YAHOO.extend(YAHOO.widget.ColorPicker, YAHOO.util.Element);
+    
+    var proto = YAHOO.widget.ColorPicker.prototype,
+        Slider=YAHOO.widget.Slider,
+        Color=YAHOO.util.Color,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        lang = YAHOO.lang,
+        sub = lang.substitute;
+    
+
+    var b = "yui-picker";
+
+    /**
+     * The element ids used by this control
+     * @property ID
+     * @final
+     */
+    proto.ID = {
+
+        /**
+         * The id for the "red" form field
+         * @property ID.R
+         * @type String
+         * @final
+         * @default yui-picker-r
+         */
+        R: b + "-r",
+
+        /**
+         * The id for the "red" hex pair output
+         * @property ID.R_HEX
+         * @type String
+         * @final
+         * @default yui-picker-rhex
+         */
+        R_HEX: b + "-rhex",
+
+        /**
+         * The id for the "green" form field
+         * @property ID.G
+         * @type String
+         * @final
+         * @default yui-picker-g
+         */
+        G: b + "-g",
+
+        /**
+         * The id for the "green" hex pair output
+         * @property ID.G_HEX
+         * @type String
+         * @final
+         * @default yui-picker-ghex
+         */
+        G_HEX: b + "-ghex",
+
+
+        /**
+         * The id for the "blue" form field
+         * @property ID.B
+         * @type String
+         * @final
+         * @default yui-picker-b
+         */
+        B: b + "-b",
+
+        /**
+         * The id for the "blue" hex pair output
+         * @property ID.B_HEX
+         * @type String
+         * @final
+         * @default yui-picker-bhex
+         */
+        B_HEX: b + "-bhex",
+
+        /**
+         * The id for the "hue" form field
+         * @property ID.H
+         * @type String
+         * @final
+         * @default yui-picker-h
+         */
+        H: b + "-h",
+
+        /**
+         * The id for the "saturation" form field
+         * @property ID.S
+         * @type String
+         * @final
+         * @default yui-picker-s
+         */
+        S: b + "-s",
+
+        /**
+         * The id for the "value" form field
+         * @property ID.V
+         * @type String
+         * @final
+         * @default yui-picker-v
+         */
+        V: b + "-v",
+
+        /**
+         * The id for the picker region slider
+         * @property ID.PICKER_BG
+         * @type String
+         * @final
+         * @default yui-picker-bg
+         */
+        PICKER_BG:      b + "-bg",
+
+        /**
+         * The id for the picker region thumb
+         * @property ID.PICKER_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-thumb
+         */
+        PICKER_THUMB:   b + "-thumb",
+
+        /**
+         * The id for the hue slider
+         * @property ID.HUE_BG
+         * @type String
+         * @final
+         * @default yui-picker-hue-bg
+         */
+        HUE_BG:         b + "-hue-bg",
+
+        /**
+         * The id for the hue thumb
+         * @property ID.HUE_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-hue-thumb
+         */
+        HUE_THUMB:      b + "-hue-thumb",
+
+        /**
+         * The id for the hex value form field
+         * @property ID.HEX
+         * @type String
+         * @final
+         * @default yui-picker-hex
+         */
+        HEX:            b + "-hex",
+
+        /**
+         * The id for the color swatch
+         * @property ID.SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-swatch
+         */
+        SWATCH:         b + "-swatch",
+
+        /**
+         * The id for the websafe color swatch
+         * @property ID.WEBSAFE_SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-websafe-swatch
+         */
+        WEBSAFE_SWATCH: b + "-websafe-swatch",
+
+        /**
+         * The id for the control details
+         * @property ID.CONTROLS
+         * @final
+         * @default yui-picker-controls
+         */
+        CONTROLS: b + "-controls",
+
+        /**
+         * The id for the rgb controls
+         * @property ID.RGB_CONTROLS
+         * @final
+         * @default yui-picker-rgb-controls
+         */
+        RGB_CONTROLS: b + "-rgb-controls",
+
+        /**
+         * The id for the hsv controls
+         * @property ID.HSV_CONTROLS
+         * @final
+         * @default yui-picker-hsv-controls
+         */
+        HSV_CONTROLS: b + "-hsv-controls",
+        
+        /**
+         * The id for the hsv controls
+         * @property ID.HEX_CONTROLS
+         * @final
+         * @default yui-picker-hex-controls
+         */
+        HEX_CONTROLS: b + "-hex-controls",
+
+        /**
+         * The id for the hex summary
+         * @property ID.HEX_SUMMARY
+         * @final
+         * @default yui-picker-hex-summary
+         */
+        HEX_SUMMARY: b + "-hex-summary",
+
+        /**
+         * The id for the controls section header
+         * @property ID.CONTROLS_LABEL
+         * @final
+         * @default yui-picker-controls-label
+         */
+        CONTROLS_LABEL: b + "-controls-label"
+    };
+
+    /**
+     * Constants for any script-generated messages.  The values here
+     * are the default messages.  They can be updated by providing
+     * the complete list to the constructor for the "txt" attribute.
+     * @property TXT
+     * @final
+     */
+    proto.TXT = {
+        ILLEGAL_HEX: "Illegal hex value entered",
+        SHOW_CONTROLS: "Show color details",
+        HIDE_CONTROLS: "Hide color details",
+        CURRENT_COLOR: "Currently selected color: {rgb}",
+        CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.",
+        R: "R",
+        G: "G",
+        B: "B",
+        H: "H",
+        S: "S",
+        V: "V",
+        HEX: "#",
+        DEG: "\u00B0",
+        PERCENT: "%"
+    };
+
+    /**
+     * Constants for the default image locations for img tags that are
+     * generated by the control.  They can be modified by passing the
+     * complete list to the contructor for the "images" attribute
+     * @property IMAGE
+     * @final
+     */
+    proto.IMAGE = {
+        PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png",
+        HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png"
+    };
+
+    /*
+     * Constants for the control's custom event names.  subscribe
+     * to the rgbChange event instead.
+     * @property EVENT
+     * @final
+     */
+    //proto.EVENT = {
+        //CHANGE: "change"
+    //};
+
+    //proto.CSS = { };
+
+    /**
+     * Constants for the control's default default values
+     * @property DEFAULT
+     * @final
+     */
+    proto.DEFAULT = {
+        PICKER_SIZE: 180
+    };
+
+    /**
+     * Constants for the control's configuration attributes
+     * @property OPT
+     * @final
+     */
+    proto.OPT = {
+        HUE: "hue",
+        SATURATION: "saturation",
+        VALUE: "value",
+        RED: "red",
+        GREEN: "green",
+        BLUE: "blue",
+        HSV: "hsv",
+        RGB: "rgb",
+        WEBSAFE: "websafe",
+        HEX: "hex",
+        PICKER_SIZE: "pickersize",
+        SHOW_CONTROLS: "showcontrols",
+        SHOW_RGB_CONTROLS: "showrgbcontrols",
+        SHOW_HSV_CONTROLS: "showhsvcontrols",
+        SHOW_HEX_CONTROLS: "showhexcontrols",
+        SHOW_HEX_SUMMARY: "showhexsummary",
+        SHOW_WEBSAFE: "showwebsafe",
+        //SHOW_SUBMIT: "showsubmit",
+        CONTAINER: "container",
+        IDS: "ids",
+        ELEMENTS: "elements",
+        TXT: "txt",
+        IMAGES: "images",
+        ANIMATE: "animate"
+    };
+
+    /**
+     * Moves the hue slider into the position dictated by the current state
+     * of the control
+     * @method _updateHueSlider
+     * @private
+     */
+    var _updateHueSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = this.get(this.OPT.HUE);
+
+        h = size - Math.round(h / 360 * size);
+        
+        // 0 is at the top and bottom of the hue slider.  Always go to
+        // the top so we don't end up sending the thumb to the bottom
+        // when the value didn't actually change (e.g., a conversion
+        // produced 360 instead of 0 and the value was already 0).
+        if (h === size) {
+            h = 0;
+        }
+        this.logger.log("Hue slider is being set to " + h);
+
+        this.hueSlider.setValue(h);
+    };
+
+    /**
+     * Moves the picker slider into the position dictated by the current state
+     * of the control
+     * @method _updatePickerSlider
+     * @private
+     */
+    var _updatePickerSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            s = this.get(this.OPT.SATURATION),
+            v = this.get(this.OPT.VALUE);
+
+        s = Math.round(s * size / 100);
+        v = Math.round(size - (v * size / 100));
+
+        this.logger.log("Setting picker slider to " + [s, v]);
+
+        this.pickerSlider.setRegionValue(s, v);
+    };
+
+    /**
+     * Moves the sliders into the position dictated by the current state
+     * of the control
+     * @method _updateSliders
+     * @private
+     */
+    var _updateSliders = function() {
+        _updateHueSlider.call(this);
+        _updatePickerSlider.call(this);
+    };
+
+    /**
+     * Sets the control to the specified rgb value and
+     * moves the sliders to the proper positions
+     * @method setValue
+     * @param rgb {[int, int, int]} the rgb value
+     * @param silent {boolean} whether or not to fire the change event
+     */
+    proto.setValue = function(rgb, silent) {
+        silent = (silent) || false;
+        this.set(this.OPT.RGB, rgb, silent);
+        _updateSliders.call(this);
+    };
+
+    /**
+     * The hue slider
+     * @property hueSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.hueSlider = null; 
+    
+    /**
+     * The picker region
+     * @property pickerSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.pickerSlider = null;
+
+    /**
+     * Translates the slider value into hue, int[0,359]
+     * @method _getH
+     * @private
+     * @return {int} the hue from 0 to 359
+     */
+    var _getH = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = (size - this.hueSlider.getValue()) / size;
+        h = Math.round(h*360);
+        return (h === 360) ? 0 : h;
+    };
+
+    /**
+     * Translates the slider value into saturation, int[0,1], left to right
+     * @method _getS
+     * @private
+     * @return {int} the saturation from 0 to 1
+     */
+    var _getS = function() {
+        return this.pickerSlider.getXValue() / this.get(this.OPT.PICKER_SIZE);
+    };
+
+    /**
+     * Translates the slider value into value/brightness, int[0,1], top
+     * to bottom
+     * @method _getV
+     * @private
+     * @return {int} the value from 0 to 1
+     */
+    var _getV = function() {
+        var size = this.get(this.OPT.PICKER_SIZE);
+        return (size - this.pickerSlider.getYValue()) / size;
+    };
+
+    /**
+     * Updates the background of the swatch with the current rbg value.
+     * Also updates the websafe swatch to the closest websafe color
+     * @method _updateSwatch
+     * @private
+     */
+    var _updateSwatch = function() {
+        var rgb = this.get(this.OPT.RGB),
+            websafe = this.get(this.OPT.WEBSAFE),
+            el = this.getElement(this.ID.SWATCH),
+            color = rgb.join(","),
+            txt = this.get(this.OPT.TXT);
+
+        Dom.setStyle(el, "background-color", "rgb(" + color  + ")");
+        el.title = lang.substitute(txt.CURRENT_COLOR, {
+                "rgb": "#" + this.get(this.OPT.HEX)
+            });
+
+
+        el = this.getElement(this.ID.WEBSAFE_SWATCH);
+        color = websafe.join(",");
+
+        Dom.setStyle(el, "background-color", "rgb(" + color + ")");
+        el.title = lang.substitute(txt.CLOSEST_WEBSAFE, {
+                "rgb": "#" + Color.rgb2hex(websafe)
+            });
+
+    };
+
+    /**
+     * Reads the sliders and converts the values to RGB, updating the
+     * internal state for all the individual form fields
+     * @method _getValuesFromSliders
+     * @private
+     */
+    var _getValuesFromSliders = function() {
+        var h=_getH.call(this), s=_getS.call(this), v=_getV.call(this);
+        YAHOO.log("hsv " + [h, s, v]);
+
+        var rgb = Color.hsv2rgb(h, s, v);
+        //var websafe = Color.websafe(rgb);
+        //var hex = Color.rgb2hex(rgb[0], rgb[1], rgb[2]);
+
+        this.set(this.OPT.RGB, rgb);
+    };
+
+    /**
+     * Updates the form field controls with the state data contained
+     * in the control.
+     * @method _updateFormFields
+     * @private
+     */
+    var _updateFormFields = function() {
+        this.getElement(this.ID.H).value = this.get(this.OPT.HUE);
+        this.getElement(this.ID.S).value = this.get(this.OPT.SATURATION);
+        this.getElement(this.ID.V).value = this.get(this.OPT.VALUE);
+        this.getElement(this.ID.R).value = this.get(this.OPT.RED);
+        this.getElement(this.ID.R_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.RED));
+        this.getElement(this.ID.G).value = this.get(this.OPT.GREEN);
+        this.getElement(this.ID.G_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.GREEN));
+        this.getElement(this.ID.B).value = this.get(this.OPT.BLUE);
+        this.getElement(this.ID.B_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.BLUE));
+        this.getElement(this.ID.HEX).value = this.get(this.OPT.HEX);
+    };
+
+    /**
+     * Event handler for the hue slider.
+     * @method _onHueSliderChange
+     * @param newOffset {int} pixels from the start position
+     * @private
+     */
+    var _onHueSliderChange = function(newOffset) {
+        this.logger.log("hue update: " + newOffset , "warn");
+
+        var h = _getH.call(this);
+        this.set(this.OPT.HUE, h, true);
+
+        // set picker background to the hue
+        var rgb = Color.hsv2rgb(h, 1, 1);
+        var styleDef = "rgb(" + rgb.join(",") + ")";
+
+        Dom.setStyle(this.getElement(this.ID.PICKER_BG), "background-color", styleDef);
+
+        if (this.hueSlider.valueChangeSource === this.hueSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+    /**
+     * Event handler for the picker slider, which controls the
+     * saturation and value/brightness.
+     * @method _onPickerSliderChange
+     * @param newOffset {{x: int, y: int}} x/y pixels from the start position
+     * @private
+     */
+    var _onPickerSliderChange = function(newOffset) {
+        this.logger.log(sub("picker update [{x}, {y}]", newOffset));
+
+        var s=_getS.call(this), v=_getV.call(this);
+        this.set(this.OPT.SATURATION, Math.round(s*100), true);
+        this.set(this.OPT.VALUE, Math.round(v*100), true);
+
+        if (this.pickerSlider.valueChangeSource === this.pickerSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+
+    /**
+     * Key map to well-known commands for txt field input
+     * @method _getCommand
+     * @param e {Event} the keypress or keydown event
+     * @return {int} a command code
+     * <ul>
+     * <li>0 = not a number, letter in range, or special key</li>
+     * <li>1 = number</li>
+     * <li>2 = a-fA-F</li>
+     * <li>3 = increment (up arrow)</li>
+     * <li>4 = decrement (down arrow)</li>
+     * <li>5 = special key (tab, delete, return, escape, left, right)</li> 
+     * <li>6 = return</li>
+     * </ul>
+     * @private
+     */
+    var _getCommand = function(e) {
+        var c = Event.getCharCode(e);
+
+        //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
+
+        // special keys
+        if (c === 38) { // up arrow
+            return 3;
+        } else if (c === 13) { // return
+            return 6;
+        } else if (c === 40) { // down array
+            return 4;
+        } else if (c >= 48 && c<=57) { // 0-9
+            return 1;
+        } else if (c >= 97 && c<=102) { // a-f
+            return 2;
+        } else if (c >= 65 && c<=70) { // A-F
+            return 2;
+        //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
+        //              (c >= 112 && c <=123)) { // including F-keys
+        // tab, delete, return, escape, left, right
+        } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1) { // special chars
+            return 5;
+        } else { // something we probably don't want
+            return 0;
+        }
+    };
+
+    /**
+     * Use the value of the text field to update the control
+     * @method _hexFieldKeypress
+     * @param e {Event} an event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _useFieldValue = function(e, el, prop) {
+        var val = el.value;
+
+        if (prop !== this.OPT.HEX) {
+            val = parseInt(val, 10);
+        }
+
+        if (val !== this.get(prop)) {
+            this.set(prop, val);
+        }
+    };
+
+    /**
+     * Handle keypress on one of the rgb or hsv fields.
+     * @method _rgbFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _rgbFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        var inc = (e.shiftKey) ? 10 : 1;
+        switch (command) {
+            case 6: // return, update the value
+                _useFieldValue.apply(this, arguments);
+                break;
+                        
+            case 3: // up arrow, increment
+                this.set(prop, Math.min(this.get(prop)+inc, 255));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+            case 4: // down arrow, decrement
+                this.set(prop, Math.max(this.get(prop)-inc, 0));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+
+            default:
+        }
+
+    };
+
+    /**
+     * Handle keydown on the hex field
+     * @method _hexFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _hexFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        if (command === 6) { // return, update the value
+            _useFieldValue.apply(this, arguments);
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars, and by default allows a-f.  
+     * Used for the hex field keypress handler.
+     * @method _hexOnly
+     * @param e {Event} the event
+     * @param numbersOnly omits a-f if set to true
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _hexOnly = function(e, numbersOnly) {
+        var command = _getCommand(e);
+        switch (command) {
+            case 6: // return
+            case 5: // special char
+            case 1: // number
+                break;
+            case 2: // hex char (a-f)
+                if (numbersOnly !== true) {
+                    break;
+                }
+
+                // fallthrough is intentional
+
+            default: // prevent alpha and punctuation
+                Event.stopEvent(e);
+                return false;
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars only.  Used for the
+     * rgb and hsv fields keypress handler.
+     * @method _numbersOnly
+     * @param e {Event} the event
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _numbersOnly = function(e) {
+        return _hexOnly(e, true);
+    };
+
+    /**
+     * Returns the element reference that is saved.  The id can be either
+     * the element id, or the key for this id in the "id" config attribute.
+     * For instance, the host element id can be obtained by passing its
+     * id (default: "yui_picker") or by its key "YUI_PICKER".
+     * @param id {string} the element id, or key 
+     * @return {HTMLElement} a reference to the element
+     */
+    proto.getElement = function(id) { 
+        return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]]; 
+    };
+
+    var _createElements = function() {
+        this.logger.log("Building markup");
+        var el, child, img, fld, i, 
+            ids = this.get(this.OPT.IDS),
+            txt = this.get(this.OPT.TXT),
+            images = this.get(this.OPT.IMAGES),
+            Elem = function(type, o) {
+                var n = document.createElement(type);
+                if (o) {
+                    lang.augmentObject(n, o, true);
+                }
+                return n;
+            },
+            RGBElem = function(type, obj) {
+                var o = lang.merge({
+                        //type: "txt",
+                        autocomplete: "off",
+                        value: "0",
+                        size: 3,
+                        maxlength: 3
+                    }, obj);
+
+                o.name = o.id;
+                return new Elem(type, o);
+            };
+
+        var p = this.get("element");
+
+        // Picker slider (S and V) ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.PICKER_BG],
+            className: "yui-picker-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.PICKER_THUMB],
+            className: "yui-picker-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.PICKER_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+        
+        // Hue slider ---------------------------------------------
+        el = new Elem("div", {
+            id: ids[this.ID.HUE_BG],
+            className: "yui-picker-hue-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.HUE_THUMB],
+            className: "yui-picker-hue-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.HUE_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+
+
+        // controls ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.CONTROLS],
+            className: "yui-picker-controls"
+        });
+
+        p.appendChild(el);
+        p = el;
+
+            // controls header
+            el = new Elem("div", {
+                className: "hd"
+            });
+
+            child = new Elem("a", {
+                id: ids[this.ID.CONTROLS_LABEL],
+                //className: "yui-picker-controls-label",
+                href: "#"
+            });
+            el.appendChild(child);
+            p.appendChild(el);
+
+            // bd
+            el = new Elem("div", {
+                className: "bd"
+            });
+
+            p.appendChild(el);
+            p = el;
+
+                // rgb
+                el = new Elem("ul", {
+                    id: ids[this.ID.RGB_CONTROLS],
+                    className: "yui-picker-rgb-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.R + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.R],
+                    className: "yui-picker-r"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.G + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.G],
+                    className: "yui-picker-g"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.B + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.B],
+                    className: "yui-picker-b"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                p.appendChild(el);
+
+                // hsv
+                el = new Elem("ul", {
+                    id: ids[this.ID.HSV_CONTROLS],
+                    className: "yui-picker-hsv-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.H + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.H],
+                    className: "yui-picker-h"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.DEG));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.S + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.S],
+                    className: "yui-picker-s"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.V + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.V],
+                    className: "yui-picker-v"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+
+                // hex summary
+
+                el = new Elem("ul", {
+                    id: ids[this.ID.HEX_SUMMARY],
+                    className: "yui-picker-hex_summary"
+                });
+
+                child = new Elem("li", {
+                    id: ids[this.ID.R_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.G_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.B_HEX]
+                });
+                el.appendChild(child);
+                p.appendChild(el);
+
+                // hex field
+                el = new Elem("div", {
+                    id: ids[this.ID.HEX_CONTROLS],
+                    className: "yui-picker-hex-controls"
+                });
+                el.appendChild(document.createTextNode(txt.HEX + " "));
+
+                child = new RGBElem("input", {
+                    id: ids[this.ID.HEX],
+                    className: "yui-picker-hex",
+                    size: 6,
+                    maxlength: 6
+                });
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+                p = this.get("element");
+
+                // swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.SWATCH],
+                    className: "yui-picker-swatch"
+                });
+
+                p.appendChild(el);
+
+                // websafe swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.WEBSAFE_SWATCH],
+                    className: "yui-picker-websafe-swatch"
+                });
+
+                p.appendChild(el);
+
+    };
+
+    var _attachRGBHSV = function(id, config) {
+        Event.on(this.getElement(id), "keydown", function(e, me) {
+                _rgbFieldKeypress.call(me, e, this, config);
+            }, this);
+        Event.on(this.getElement(id), "keypress", _numbersOnly, this);
+        Event.on(this.getElement(id), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, config);
+            }, this);
+    };
+
+
+    /**
+     * Updates the rgb attribute with the current state of the r,g,b
+     * fields.  This is invoked from change listeners on these
+     * attributes to facilitate updating these values from the
+     * individual form fields
+     * @method _updateRGB
+     * @private
+     */
+    var _updateRGB = function() {
+        var rgb = [this.get(this.OPT.RED), 
+                   this.get(this.OPT.GREEN),
+                   this.get(this.OPT.BLUE)];
+
+        this.logger.log("RGB value set to " + rgb);
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Sets the initial state of the sliders
+     * @method initPicker
+     */
+    proto.initPicker = function () {
+
+        // bind all of our elements
+        var o=this.OPT, 
+            ids = this.get(o.IDS), 
+            els = this.get(o.ELEMENTS), 
+                  i, el, id;
+
+        // Add the default value as a key for each element for easier lookup
+        for (i in this.ID) {
+            if (lang.hasOwnProperty(this.ID, i)) {
+                ids[this.ID[i]] = ids[i];
+            }
+        }
+
+        // Check for picker element, if not there, create all of them
+        el = Dom.get(ids[this.ID.PICKER_BG]);
+        if (!el) {
+            _createElements.call(this);
+        } else {
+            this.logger.log("Using pre-existing markup");
+        }
+
+        for (i in ids) {
+            if (lang.hasOwnProperty(ids, i)) {
+                // look for element
+                el = Dom.get(ids[i]);
+
+                // generate an id if the implementer passed in an element reference,
+                // and the element did not have an id already
+                id = Dom.generateId(el);
+
+                // update the id in case we generated the id
+                ids[i] = id; // key is WEBSAFE_SWATCH
+                ids[ids[i]] = id; // key is websafe_swatch
+
+                // store the dom ref
+                els[id] = el;
+            }
+        }
+
+        // set the initial visibility state of our controls
+            els = [o.SHOW_CONTROLS, 
+                   o.SHOW_RGB_CONTROLS,
+                   o.SHOW_HSV_CONTROLS,
+                   o.SHOW_HEX_CONTROLS,
+                   o.SHOW_HEX_SUMMARY,
+                   o.SHOW_WEBSAFE
+                   ];
+
+        for (i=0; i<els.length; i=i+1) {
+            this.set(els[i], this.get(els[i]));
+        }
+
+        var s = this.get(o.PICKER_SIZE);
+        this.logger.log("picker size" + s);
+
+        this.hueSlider = Slider.getVertSlider(this.getElement(this.ID.HUE_BG), 
+                                              this.getElement(this.ID.HUE_THUMB), 0, s);
+        this.hueSlider.subscribe("change", _onHueSliderChange, this, true);
+
+        this.pickerSlider = Slider.getSliderRegion(this.getElement(this.ID.PICKER_BG), 
+                                                   this.getElement(this.ID.PICKER_THUMB), 0, s, 0, s);
+        this.pickerSlider.subscribe("change", _onPickerSliderChange, this, true);
+
+        // Set the animate state
+        this.set(o.ANIMATE,this.get(o.ANIMATE));
+
+        //_onHueSliderChange.call(this, 0);
+
+        Event.on(this.getElement(this.ID.WEBSAFE_SWATCH), "click", function(e) {
+               this.setValue(this.get(o.WEBSAFE));
+               //_updateSliders
+           }, this, true);
+
+        Event.on(this.getElement(this.ID.CONTROLS_LABEL), "click", function(e) {
+               this.set(o.SHOW_CONTROLS, !this.get(o.SHOW_CONTROLS));
+               Event.preventDefault(e);
+           }, this, true);
+
+        _attachRGBHSV.call(this, this.ID.R, this.OPT.RED); 
+        _attachRGBHSV.call(this, this.ID.G, this.OPT.GREEN); 
+        _attachRGBHSV.call(this, this.ID.B, this.OPT.BLUE); 
+        _attachRGBHSV.call(this, this.ID.H, this.OPT.HUE); 
+        _attachRGBHSV.call(this, this.ID.S, this.OPT.SATURATION); 
+        _attachRGBHSV.call(this, this.ID.V, this.OPT.VALUE); 
+
+        Event.on(this.getElement(this.ID.HEX), "keydown", function(e, me) {
+                _hexFieldKeypress.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        Event.on(this.getElement(this.ID.HEX), "keypress", _hexOnly, this);
+        Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        _updateRGB.call(this);
+    };
+
+
+    /**
+     * Updates the RGB values from the current state of the HSV
+     * values.  Executed when the one of the HSV form fields are
+     * updated
+     * _updateRGBFromHSV
+     * @private
+     */
+    var _updateRGBFromHSV = function() {
+        var hsv = [this.get(this.OPT.HUE), 
+                   this.get(this.OPT.SATURATION)/100,
+                   this.get(this.OPT.VALUE)/100];
+
+        var rgb = Color.hsv2rgb(hsv);
+
+        this.logger.log("HSV converted to RGB " + hsv + " : " + rgb);
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Parses the hex string to normalize shorthand values, converts
+     * the hex value to rgb and updates the rgb attribute (which
+     * updates the state for all of the other values)
+     * method _updateHex
+     * @private
+     */
+    var _updateHex = function() {
+       
+        var hex = this.get(this.OPT.HEX), l=hex.length;
+
+        // support #369 -> #336699 shorthand
+        if (l === 3) {
+            var c = hex.split(""), i;
+            for (i=0; i<l; i=i+1) {
+                c[i] = c[i] + c[i];
+            }
+
+            hex = c.join("");
+        }
+
+        if (hex.length !== 6) {
+            this.logger.log(this.get(this.TXT.ILLEGAL_HEX), "error");
+            return false;
+        }
+
+        var rgb = Color.hex2rgb(hex);
+
+        this.logger.log(sub("Hex value set to {hex} ({rgb})", {
+                hex: hex, rgb: rgb
+            }));
+
+        this.setValue(rgb);
+
+        //_updateSliders.call(this);
+
+    };
+
+
+
+    /**
+     * Sets up the config attributes and the change listeners for this
+     * properties
+     * @method initAttributes
+     * @param attr An object containing default attribute values
+     */
+    proto.initAttributes = function(attr) {
+
+        attr = attr || {};
+        YAHOO.widget.ColorPicker.superclass.initAttributes.call(this, attr);
+        
+        /**
+         * The size of the picker. Trying to change this is not recommended.
+         * @attribute pickersize
+         * @default 180
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.PICKER_SIZE, {
+                value: attr.size || this.DEFAULT.PICKER_SIZE
+            });
+
+        /**
+         * The current hue value 0-360
+         * @attribute hue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.HUE, {
+                value: attr.hue || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current saturation value 0-100
+         * @attribute saturation
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.SATURATION, {
+                value: attr.saturation || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current value/brightness value 0-100
+         * @attribute value
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.VALUE, {
+                value: lang.isNumber(attr.value) ? attr.value : 100,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current red value 0-255
+         * @attribute red
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.RED, {
+                value: lang.isNumber(attr.red) ? attr.red : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current green value 0-255
+         * @attribute green 
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.GREEN, {
+                value: lang.isNumber(attr.green) ? attr.green : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current blue value 0-255
+         * @attribute blue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.BLUE, {
+                value: lang.isNumber(attr.blue) ? attr.blue : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current hex value #000000-#FFFFFF, without the #
+         * @attribute hex
+         * @type string
+         */
+        this.setAttributeConfig(this.OPT.HEX, {
+                value: attr.hex || "FFFFFF",
+                validator: lang.isString
+            });
+
+        /**
+         * The current rgb value.  Updates the state of all of the
+         * other value fields.  Read-only: use setValue to set the
+         * controls rgb value.
+         * @attribute hex
+         * @type [int, int, int]
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.RGB, {
+                value: attr.rgb || [255,255,255],
+                method: function(rgb) {
+
+                    this.set(this.OPT.RED, rgb[0], true);
+                    this.set(this.OPT.GREEN, rgb[1], true);
+                    this.set(this.OPT.BLUE, rgb[2], true);
+
+                    var websafe = Color.websafe(rgb);
+                    this.set(this.OPT.WEBSAFE, websafe, true);
+
+                    var hex = Color.rgb2hex(rgb);
+                    this.set(this.OPT.HEX, hex, true);
+
+                    var hsv = Color.rgb2hsv(rgb);
+
+                    this.logger.log(sub("RGB value set to {rgb} (hsv: {hsv})", {
+                            "hsv": hsv, "rgb": rgb
+                        }));
+
+                    this.set(this.OPT.HUE, hsv[0], true);
+                    this.set(this.OPT.SATURATION, Math.round(hsv[1]*100), true);
+                    this.set(this.OPT.VALUE, Math.round(hsv[2]*100), true);
+                },
+                readonly: true
+            });
+
+        /**
+         * If the color picker will live inside of a container object,
+         * set, provide a reference to it so the control can use the
+         * container's events.
+         * @attribute container
+         * @type YAHOO.widget.Panel
+         */
+        this.setAttributeConfig(this.OPT.CONTAINER, {
+                    value: null,
+                    method: function(container) {
+                        if (container) {
+                            // Position can get out of sync when the
+                            // control is manipulated while display is
+                            // none.  Resetting the slider constraints
+                            // when it is visible gets the state back in
+                            // order.
+                            container.showEvent.subscribe(function() {
+                                // this.pickerSlider.thumb.resetConstraints();
+                                // this.hueSlider.thumb.resetConstraints();
+                                this.pickerSlider.focus();
+                            }, this, true);
+                        }
+                    }
+                });
+        /**
+         * The closest current websafe value
+         * @attribute websafe
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.WEBSAFE, {
+                value: attr.websafe || [255,255,255]
+            });
+
+
+        var ids = attr.ids || lang.merge({}, this.ID);
+
+        if (!attr.ids && _pickercount > 1) {
+            for (var i in ids) {
+                if (lang.hasOwnProperty(ids, i)) {
+                    ids[i] = ids[i] + _pickercount;
+                }
+            }
+        }
+
+
+        /**
+         * A list of element ids and/or element references used by the 
+         * control.  The default is the this.ID list, and can be customized
+         * by passing a list in the contructor
+         * @attribute ids
+         * @type {referenceid: realid}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IDS, {
+                value: ids,
+                writeonce: true
+            });
+
+        /**
+         * A list of txt strings for internationalization.  Default
+         * is this.TXT
+         * @attribute txt
+         * @type {key: txt}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.TXT, {
+                value: attr.txt || this.TXT,
+                writeonce: true
+            });
+
+        /**
+         * The img src default list
+         * is this.IMAGES
+         * @attribute images
+         * @type {key: image}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IMAGES, {
+                value: attr.images || this.IMAGE,
+                writeonce: true
+            });
+        /**
+         * The element refs used by this control.  Set at initialization
+         * @attribute elements
+         * @type {id: HTMLElement}
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.ELEMENTS, {
+                value: {},
+                readonly: true
+            });
+
+        /**
+         * Returns the cached element reference.  If the id is not a string, it
+         * is assumed that it is an element and this is returned.
+         * @param id {string|HTMLElement} the element key, id, or ref
+         * @param on {boolean} hide or show.  If true, show
+         * @private */
+        var _hideShowEl = function(id, on) {
+            var el = (lang.isString(id) ? this.getElement(id) : id);
+            //Dom.setStyle(id, "visibility", (on) ? "" : "hidden");
+            Dom.setStyle(el, "display", (on) ? "" : "none");
+        };
+
+        /**
+         * Hide/show the entire set of controls
+         * @attribute showcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_CONTROLS, {
+                value: lang.isBoolean(attr.showcontrols) ? attr.showcontrols : true,
+                method: function(on) {
+
+                    var el = Dom.getElementsByClassName("bd", "div", 
+                            this.getElement(this.ID.CONTROLS))[0];
+
+                    _hideShowEl.call(this, el, on);
+
+                    this.getElement(this.ID.CONTROLS_LABEL).innerHTML = 
+                        (on) ? this.get(this.OPT.TXT).HIDE_CONTROLS :
+                               this.get(this.OPT.TXT).SHOW_CONTROLS;
+
+                }
+            });
+
+        /**
+         * Hide/show the rgb controls
+         * @attribute showrgbcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS, {
+                value: lang.isBoolean(attr.showrgbcontrols) ? attr.showrgbcontrols : true,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.RBG_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.RGB_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the hsv controls
+         * @attribute showhsvcontrols
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS, {
+                value: lang.isBoolean(attr.showhsvcontrols) ?
+                                      attr.showhsvcontrols : false,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.HSV_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.HSV_CONTROLS, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HEX_SUMMARY)) {
+                        this.set(this.OPT.SHOW_HEX_SUMMARY, false);
+                    }
+                }
+            });
+
+        /**
+         * Hide/show the hex controls
+         * @attribute showhexcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS, {
+                value: lang.isBoolean(attr.showhexcontrols) ?
+                                      attr.showhexcontrols : false,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the websafe swatch
+         * @attribute showwebsafe
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_WEBSAFE, {
+                value: lang.isBoolean(attr.showwebsafe) ? attr.showwebsafe : true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.WEBSAFE_SWATCH, on);
+                }
+            });
+
+        /**
+         * Hide/show the hex summary
+         * @attribute showhexsummary
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY, {
+                value: lang.isBoolean(attr.showhexsummary) ? attr.showhexsummary : true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_SUMMARY, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HSV_CONTROLS)) {
+                        this.set(this.OPT.SHOW_HSV_CONTROLS, false);
+                    }
+                }
+            });
+        this.setAttributeConfig(this.OPT.ANIMATE, {
+                value: lang.isBoolean(attr.animate) ? attr.animate : true,
+                method: function(on) {
+                    this.pickerSlider.animate = on;
+                    this.hueSlider.animate = on;
+                }
+            });
+
+        this.on(this.OPT.HUE + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.SATURATION + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.VALUE + "Change", _updatePickerSlider, this, true);
+
+        this.on(this.OPT.RED + "Change", _updateRGB, this, true);
+        this.on(this.OPT.GREEN + "Change", _updateRGB, this, true);
+        this.on(this.OPT.BLUE + "Change", _updateRGB, this, true);
+
+        this.on(this.OPT.HEX + "Change", _updateHex, this, true);
+
+        this.initPicker();
+    };
+
+})();
+YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/colorpicker/colorpicker-min.js b/lib/yui/colorpicker/colorpicker-min.js
new file mode 100644 (file)
index 0000000..7e47fe4
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.util.Color=function(){var A="0123456789ABCDEF",B=YAHOO.lang;return{real2dec:function(C){return Math.min(255,Math.round(C*256));},hsv2rgb:function(G,N,L){if(B.isArray(G)){return this.hsv2rgb.call(this,G[0],G[1],G[2]);}var C,H,K,F,I,E,D,M;F=Math.floor((G/60)%6);I=(G/60)-F;E=L*(1-N);D=L*(1-I*N);M=L*(1-(1-I)*N);switch(F){case 0:C=L;H=M;K=E;break;case 1:C=D;H=L;K=E;break;case 2:C=E;H=L;K=M;break;case 3:C=E;H=D;K=L;break;case 4:C=M;H=E;K=L;break;case 5:C=L;H=E;K=D;break;}var J=this.real2dec;return[J(C),J(H),J(K)];},rgb2hsv:function(C,G,H){if(B.isArray(C)){return this.rgb2hsv.call(this,C[0],C[1],C[2]);}C=C/255;G=G/255;H=H/255;var D,I,K,F,L,J;D=Math.min(Math.min(C,G),H);I=Math.max(Math.max(C,G),H);K=I-D;switch(I){case D:F=0;break;case C:F=60*(G-H)/K;if(G<H){F+=360;}break;case G:F=(60*(H-C)/K)+120;break;case H:F=(60*(C-G)/K)+240;break;}L=(I===0)?0:1-(D/I);var E=[Math.round(F),L,I];return E;},rgb2hex:function(E,D,C){if(B.isArray(E)){return this.rgb2hex.call(this,E[0],E[1],E[2]);}var F=this.dec2hex;return F(E)+F(D)+F(C);},dec2hex:function(C){C=parseInt(C,10);C=(B.isNumber(C))?C:0;C=(C>255||C<0)?0:C;return A.charAt((C-C%16)/16)+A.charAt(C%16);},hex2dec:function(E){var D=function(F){return A.indexOf(F.toUpperCase());};var C=E.split("");return((D(C[0])*16)+D(C[1]));},hex2rgb:function(C){var D=this.hex2dec;return[D(C.substr(0,2)),D(C.substr(2,2)),D(C.substr(4,2))];},websafe:function(E,D,C){if(B.isArray(E)){return this.websafe.call(this,E[0],E[1],E[2]);}var F=function(G){if(B.isNumber(G)){G=Math.min(Math.max(0,G),255);var H,I;for(H=0;H<256;H=H+51){I=H+51;if(G>=H&&G<=I){return(G-H>25)?I:H;}}}return G;};return[F(E),F(D),F(C)];}};}();(function(){var E=0;var R=function(){var b=document.createElement("div");if(this.CSS.BASE){b.className=this.CSS.BASE;}return b;};YAHOO.widget.ColorPicker=function(h,b){E=E+1;b=b||{};if(arguments.length===1&&!YAHOO.lang.isString(h)&&!h.nodeName){b=h;h=b.element||null;}if(!h&&!b.element){h=R.call(this,b);}YAHOO.widget.ColorPicker.superclass.constructor.call(this,h,b);};YAHOO.extend(YAHOO.widget.ColorPicker,YAHOO.util.Element);var Q=YAHOO.widget.ColorPicker.prototype,P=YAHOO.widget.Slider,e=YAHOO.util.Color,C=YAHOO.util.Dom,f=YAHOO.util.Event,g=YAHOO.lang,J=g.substitute;var a="yui-picker";Q.ID={R:a+"-r",R_HEX:a+"-rhex",G:a+"-g",G_HEX:a+"-ghex",B:a+"-b",B_HEX:a+"-bhex",H:a+"-h",S:a+"-s",V:a+"-v",PICKER_BG:a+"-bg",PICKER_THUMB:a+"-thumb",HUE_BG:a+"-hue-bg",HUE_THUMB:a+"-hue-thumb",HEX:a+"-hex",SWATCH:a+"-swatch",WEBSAFE_SWATCH:a+"-websafe-swatch",CONTROLS:a+"-controls",RGB_CONTROLS:a+"-rgb-controls",HSV_CONTROLS:a+"-hsv-controls",HEX_CONTROLS:a+"-hex-controls",HEX_SUMMARY:a+"-hex-summary",CONTROLS_LABEL:a+"-controls-label"};Q.TXT={ILLEGAL_HEX:"Illegal hex value entered",SHOW_CONTROLS:"Show color details",HIDE_CONTROLS:"Hide color details",CURRENT_COLOR:"Currently selected color: {rgb}",CLOSEST_WEBSAFE:"Closest websafe color: {rgb}. Click to select.",R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"};Q.IMAGE={PICKER_THUMB:"../../build/colorpicker/assets/picker_thumb.png",HUE_THUMB:"../../build/colorpicker/assets/hue_thumb.png"};Q.DEFAULT={PICKER_SIZE:180};Q.OPT={HUE:"hue",SATURATION:"saturation",VALUE:"value",RED:"red",GREEN:"green",BLUE:"blue",HSV:"hsv",RGB:"rgb",WEBSAFE:"websafe",HEX:"hex",PICKER_SIZE:"pickersize",SHOW_CONTROLS:"showcontrols",SHOW_RGB_CONTROLS:"showrgbcontrols",SHOW_HSV_CONTROLS:"showhsvcontrols",SHOW_HEX_CONTROLS:"showhexcontrols",SHOW_HEX_SUMMARY:"showhexsummary",SHOW_WEBSAFE:"showwebsafe",CONTAINER:"container",IDS:"ids",ELEMENTS:"elements",TXT:"txt",IMAGES:"images",ANIMATE:"animate"};var S=function(){var b=this.get(this.OPT.PICKER_SIZE),i=this.get(this.OPT.HUE);i=b-Math.round(i/360*b);if(i===b){i=0;}this.hueSlider.setValue(i);};var d=function(){var h=this.get(this.OPT.PICKER_SIZE),i=this.get(this.OPT.SATURATION),b=this.get(this.OPT.VALUE);i=Math.round(i*h/100);b=Math.round(h-(b*h/100));this.pickerSlider.setRegionValue(i,b);};var T=function(){S.call(this);d.call(this);};Q.setValue=function(h,b){b=(b)||false;this.set(this.OPT.RGB,h,b);T.call(this);};Q.hueSlider=null;Q.pickerSlider=null;var X=function(){var b=this.get(this.OPT.PICKER_SIZE),i=(b-this.hueSlider.getValue())/b;i=Math.round(i*360);return(i===360)?0:i;};var O=function(){return this.pickerSlider.getXValue()/this.get(this.OPT.PICKER_SIZE);};var N=function(){var b=this.get(this.OPT.PICKER_SIZE);return(b-this.pickerSlider.getYValue())/b;};var M=function(){var i=this.get(this.OPT.RGB),k=this.get(this.OPT.WEBSAFE),j=this.getElement(this.ID.SWATCH),h=i.join(","),b=this.get(this.OPT.TXT);C.setStyle(j,"background-color","rgb("+h+")");j.title=g.substitute(b.CURRENT_COLOR,{"rgb":"#"+this.get(this.OPT.HEX)});j=this.getElement(this.ID.WEBSAFE_SWATCH);h=k.join(",");C.setStyle(j,"background-color","rgb("+h+")");j.title=g.substitute(b.CLOSEST_WEBSAFE,{"rgb":"#"+e.rgb2hex(k)});};var Z=function(){var k=X.call(this),j=O.call(this),b=N.call(this);var i=e.hsv2rgb(k,j,b);this.set(this.OPT.RGB,i);};var B=function(){this.getElement(this.ID.H).value=this.get(this.OPT.HUE);this.getElement(this.ID.S).value=this.get(this.OPT.SATURATION);this.getElement(this.ID.V).value=this.get(this.OPT.VALUE);this.getElement(this.ID.R).value=this.get(this.OPT.RED);this.getElement(this.ID.R_HEX).innerHTML=e.dec2hex(this.get(this.OPT.RED));this.getElement(this.ID.G).value=this.get(this.OPT.GREEN);this.getElement(this.ID.G_HEX).innerHTML=e.dec2hex(this.get(this.OPT.GREEN));this.getElement(this.ID.B).value=this.get(this.OPT.BLUE);this.getElement(this.ID.B_HEX).innerHTML=e.dec2hex(this.get(this.OPT.BLUE));this.getElement(this.ID.HEX).value=this.get(this.OPT.HEX);};var Y=function(k){var i=X.call(this);this.set(this.OPT.HUE,i,true);var b=e.hsv2rgb(i,1,1);var j="rgb("+b.join(",")+")";C.setStyle(this.getElement(this.ID.PICKER_BG),"background-color",j);if(this.hueSlider.valueChangeSource===this.hueSlider.SOURCE_UI_EVENT){Z.call(this);}B.call(this);M.call(this);};var H=function(i){var h=O.call(this),b=N.call(this);this.set(this.OPT.SATURATION,Math.round(h*100),true);
+this.set(this.OPT.VALUE,Math.round(b*100),true);if(this.pickerSlider.valueChangeSource===this.pickerSlider.SOURCE_UI_EVENT){Z.call(this);}B.call(this);M.call(this);};var W=function(b){var h=f.getCharCode(b);if(h===38){return 3;}else{if(h===13){return 6;}else{if(h===40){return 4;}else{if(h>=48&&h<=57){return 1;}else{if(h>=97&&h<=102){return 2;}else{if(h>=65&&h<=70){return 2;}else{if("8, 9, 13, 27, 37, 39".indexOf(h)>-1){return 5;}else{return 0;}}}}}}}};var I=function(h,b,j){var i=b.value;if(j!==this.OPT.HEX){i=parseInt(i,10);}if(i!==this.get(j)){this.set(j,i);}};var G=function(i,b,k){var j=W(i);var h=(i.shiftKey)?10:1;switch(j){case 6:I.apply(this,arguments);break;case 3:this.set(k,Math.min(this.get(k)+h,255));B.call(this);break;case 4:this.set(k,Math.max(this.get(k)-h,0));B.call(this);break;default:}};var A=function(h,b,j){var i=W(h);if(i===6){I.apply(this,arguments);}};var L=function(h,b){var i=W(h);switch(i){case 6:case 5:case 1:break;case 2:if(b!==true){break;}default:f.stopEvent(h);return false;}};var K=function(b){return L(b,true);};Q.getElement=function(b){return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[b]];};var D=function(){var k,j,n,l,m,b=this.get(this.OPT.IDS),o=this.get(this.OPT.TXT),r=this.get(this.OPT.IMAGES),q=function(i,p){var t=document.createElement(i);if(p){g.augmentObject(t,p,true);}return t;},s=function(i,p){var t=g.merge({autocomplete:"off",value:"0",size:3,maxlength:3},p);t.name=t.id;return new q(i,t);};var h=this.get("element");k=new q("div",{id:b[this.ID.PICKER_BG],className:"yui-picker-bg",tabIndex:-1,hideFocus:true});j=new q("div",{id:b[this.ID.PICKER_THUMB],className:"yui-picker-thumb"});n=new q("img",{src:r.PICKER_THUMB});j.appendChild(n);k.appendChild(j);h.appendChild(k);k=new q("div",{id:b[this.ID.HUE_BG],className:"yui-picker-hue-bg",tabIndex:-1,hideFocus:true});j=new q("div",{id:b[this.ID.HUE_THUMB],className:"yui-picker-hue-thumb"});n=new q("img",{src:r.HUE_THUMB});j.appendChild(n);k.appendChild(j);h.appendChild(k);k=new q("div",{id:b[this.ID.CONTROLS],className:"yui-picker-controls"});h.appendChild(k);h=k;k=new q("div",{className:"hd"});j=new q("a",{id:b[this.ID.CONTROLS_LABEL],href:"#"});k.appendChild(j);h.appendChild(k);k=new q("div",{className:"bd"});h.appendChild(k);h=k;k=new q("ul",{id:b[this.ID.RGB_CONTROLS],className:"yui-picker-rgb-controls"});j=new q("li");j.appendChild(document.createTextNode(o.R+" "));l=new s("input",{id:b[this.ID.R],className:"yui-picker-r"});j.appendChild(l);k.appendChild(j);j=new q("li");j.appendChild(document.createTextNode(o.G+" "));l=new s("input",{id:b[this.ID.G],className:"yui-picker-g"});j.appendChild(l);k.appendChild(j);j=new q("li");j.appendChild(document.createTextNode(o.B+" "));l=new s("input",{id:b[this.ID.B],className:"yui-picker-b"});j.appendChild(l);k.appendChild(j);h.appendChild(k);k=new q("ul",{id:b[this.ID.HSV_CONTROLS],className:"yui-picker-hsv-controls"});j=new q("li");j.appendChild(document.createTextNode(o.H+" "));l=new s("input",{id:b[this.ID.H],className:"yui-picker-h"});j.appendChild(l);j.appendChild(document.createTextNode(" "+o.DEG));k.appendChild(j);j=new q("li");j.appendChild(document.createTextNode(o.S+" "));l=new s("input",{id:b[this.ID.S],className:"yui-picker-s"});j.appendChild(l);j.appendChild(document.createTextNode(" "+o.PERCENT));k.appendChild(j);j=new q("li");j.appendChild(document.createTextNode(o.V+" "));l=new s("input",{id:b[this.ID.V],className:"yui-picker-v"});j.appendChild(l);j.appendChild(document.createTextNode(" "+o.PERCENT));k.appendChild(j);h.appendChild(k);k=new q("ul",{id:b[this.ID.HEX_SUMMARY],className:"yui-picker-hex_summary"});j=new q("li",{id:b[this.ID.R_HEX]});k.appendChild(j);j=new q("li",{id:b[this.ID.G_HEX]});k.appendChild(j);j=new q("li",{id:b[this.ID.B_HEX]});k.appendChild(j);h.appendChild(k);k=new q("div",{id:b[this.ID.HEX_CONTROLS],className:"yui-picker-hex-controls"});k.appendChild(document.createTextNode(o.HEX+" "));j=new s("input",{id:b[this.ID.HEX],className:"yui-picker-hex",size:6,maxlength:6});k.appendChild(j);h.appendChild(k);h=this.get("element");k=new q("div",{id:b[this.ID.SWATCH],className:"yui-picker-swatch"});h.appendChild(k);k=new q("div",{id:b[this.ID.WEBSAFE_SWATCH],className:"yui-picker-websafe-swatch"});h.appendChild(k);};var c=function(h,b){f.on(this.getElement(h),"keydown",function(j,i){G.call(i,j,this,b);},this);f.on(this.getElement(h),"keypress",K,this);f.on(this.getElement(h),"blur",function(j,i){I.call(i,j,this,b);},this);};var F=function(){var b=[this.get(this.OPT.RED),this.get(this.OPT.GREEN),this.get(this.OPT.BLUE)];this.set(this.OPT.RGB,b);T.call(this);};Q.initPicker=function(){var m=this.OPT,l=this.get(m.IDS),h=this.get(m.ELEMENTS),b,k,n;for(b in this.ID){if(g.hasOwnProperty(this.ID,b)){l[this.ID[b]]=l[b];}}k=C.get(l[this.ID.PICKER_BG]);if(!k){D.call(this);}else{}for(b in l){if(g.hasOwnProperty(l,b)){k=C.get(l[b]);n=C.generateId(k);l[b]=n;l[l[b]]=n;h[n]=k;}}h=[m.SHOW_CONTROLS,m.SHOW_RGB_CONTROLS,m.SHOW_HSV_CONTROLS,m.SHOW_HEX_CONTROLS,m.SHOW_HEX_SUMMARY,m.SHOW_WEBSAFE];for(b=0;b<h.length;b=b+1){this.set(h[b],this.get(h[b]));}var j=this.get(m.PICKER_SIZE);this.hueSlider=P.getVertSlider(this.getElement(this.ID.HUE_BG),this.getElement(this.ID.HUE_THUMB),0,j);this.hueSlider.subscribe("change",Y,this,true);this.pickerSlider=P.getSliderRegion(this.getElement(this.ID.PICKER_BG),this.getElement(this.ID.PICKER_THUMB),0,j,0,j);this.pickerSlider.subscribe("change",H,this,true);this.set(m.ANIMATE,this.get(m.ANIMATE));f.on(this.getElement(this.ID.WEBSAFE_SWATCH),"click",function(i){this.setValue(this.get(m.WEBSAFE));},this,true);f.on(this.getElement(this.ID.CONTROLS_LABEL),"click",function(i){this.set(m.SHOW_CONTROLS,!this.get(m.SHOW_CONTROLS));f.preventDefault(i);},this,true);c.call(this,this.ID.R,this.OPT.RED);c.call(this,this.ID.G,this.OPT.GREEN);c.call(this,this.ID.B,this.OPT.BLUE);c.call(this,this.ID.H,this.OPT.HUE);c.call(this,this.ID.S,this.OPT.SATURATION);c.call(this,this.ID.V,this.OPT.VALUE);f.on(this.getElement(this.ID.HEX),"keydown",function(o,i){A.call(i,o,this,i.OPT.HEX);
+},this);f.on(this.getElement(this.ID.HEX),"keypress",L,this);f.on(this.getElement(this.ID.HEX),"blur",function(o,i){I.call(i,o,this,i.OPT.HEX);},this);F.call(this);};var U=function(){var h=[this.get(this.OPT.HUE),this.get(this.OPT.SATURATION)/100,this.get(this.OPT.VALUE)/100];var b=e.hsv2rgb(h);this.set(this.OPT.RGB,b);T.call(this);};var V=function(){var k=this.get(this.OPT.HEX),b=k.length;if(b===3){var m=k.split(""),j;for(j=0;j<b;j=j+1){m[j]=m[j]+m[j];}k=m.join("");}if(k.length!==6){return false;}var h=e.hex2rgb(k);this.setValue(h);};Q.initAttributes=function(b){b=b||{};YAHOO.widget.ColorPicker.superclass.initAttributes.call(this,b);this.setAttributeConfig(this.OPT.PICKER_SIZE,{value:b.size||this.DEFAULT.PICKER_SIZE});this.setAttributeConfig(this.OPT.HUE,{value:b.hue||0,validator:g.isNumber});this.setAttributeConfig(this.OPT.SATURATION,{value:b.saturation||0,validator:g.isNumber});this.setAttributeConfig(this.OPT.VALUE,{value:g.isNumber(b.value)?b.value:100,validator:g.isNumber});this.setAttributeConfig(this.OPT.RED,{value:g.isNumber(b.red)?b.red:255,validator:g.isNumber});this.setAttributeConfig(this.OPT.GREEN,{value:g.isNumber(b.green)?b.green:255,validator:g.isNumber});this.setAttributeConfig(this.OPT.BLUE,{value:g.isNumber(b.blue)?b.blue:255,validator:g.isNumber});this.setAttributeConfig(this.OPT.HEX,{value:b.hex||"FFFFFF",validator:g.isString});this.setAttributeConfig(this.OPT.RGB,{value:b.rgb||[255,255,255],method:function(l){this.set(this.OPT.RED,l[0],true);this.set(this.OPT.GREEN,l[1],true);this.set(this.OPT.BLUE,l[2],true);var n=e.websafe(l);this.set(this.OPT.WEBSAFE,n,true);var m=e.rgb2hex(l);this.set(this.OPT.HEX,m,true);var i=e.rgb2hsv(l);this.set(this.OPT.HUE,i[0],true);this.set(this.OPT.SATURATION,Math.round(i[1]*100),true);this.set(this.OPT.VALUE,Math.round(i[2]*100),true);},readonly:true});this.setAttributeConfig(this.OPT.CONTAINER,{value:null,method:function(i){if(i){i.showEvent.subscribe(function(){this.pickerSlider.focus();},this,true);}}});this.setAttributeConfig(this.OPT.WEBSAFE,{value:b.websafe||[255,255,255]});var j=b.ids||g.merge({},this.ID);if(!b.ids&&E>1){for(var h in j){if(g.hasOwnProperty(j,h)){j[h]=j[h]+E;}}}this.setAttributeConfig(this.OPT.IDS,{value:j,writeonce:true});this.setAttributeConfig(this.OPT.TXT,{value:b.txt||this.TXT,writeonce:true});this.setAttributeConfig(this.OPT.IMAGES,{value:b.images||this.IMAGE,writeonce:true});this.setAttributeConfig(this.OPT.ELEMENTS,{value:{},readonly:true});var k=function(m,i){var l=(g.isString(m)?this.getElement(m):m);C.setStyle(l,"display",(i)?"":"none");};this.setAttributeConfig(this.OPT.SHOW_CONTROLS,{value:g.isBoolean(b.showcontrols)?b.showcontrols:true,method:function(i){var l=C.getElementsByClassName("bd","div",this.getElement(this.ID.CONTROLS))[0];k.call(this,l,i);this.getElement(this.ID.CONTROLS_LABEL).innerHTML=(i)?this.get(this.OPT.TXT).HIDE_CONTROLS:this.get(this.OPT.TXT).SHOW_CONTROLS;}});this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS,{value:g.isBoolean(b.showrgbcontrols)?b.showrgbcontrols:true,method:function(i){k.call(this,this.ID.RGB_CONTROLS,i);}});this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS,{value:g.isBoolean(b.showhsvcontrols)?b.showhsvcontrols:false,method:function(i){k.call(this,this.ID.HSV_CONTROLS,i);if(i&&this.get(this.OPT.SHOW_HEX_SUMMARY)){this.set(this.OPT.SHOW_HEX_SUMMARY,false);}}});this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS,{value:g.isBoolean(b.showhexcontrols)?b.showhexcontrols:false,method:function(i){k.call(this,this.ID.HEX_CONTROLS,i);}});this.setAttributeConfig(this.OPT.SHOW_WEBSAFE,{value:g.isBoolean(b.showwebsafe)?b.showwebsafe:true,method:function(i){k.call(this,this.ID.WEBSAFE_SWATCH,i);}});this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY,{value:g.isBoolean(b.showhexsummary)?b.showhexsummary:true,method:function(i){k.call(this,this.ID.HEX_SUMMARY,i);if(i&&this.get(this.OPT.SHOW_HSV_CONTROLS)){this.set(this.OPT.SHOW_HSV_CONTROLS,false);}}});this.setAttributeConfig(this.OPT.ANIMATE,{value:g.isBoolean(b.animate)?b.animate:true,method:function(i){this.pickerSlider.animate=i;this.hueSlider.animate=i;}});this.on(this.OPT.HUE+"Change",U,this,true);this.on(this.OPT.SATURATION+"Change",U,this,true);this.on(this.OPT.VALUE+"Change",d,this,true);this.on(this.OPT.RED+"Change",F,this,true);this.on(this.OPT.GREEN+"Change",F,this,true);this.on(this.OPT.BLUE+"Change",F,this,true);this.on(this.OPT.HEX+"Change",V,this,true);this.initPicker();};})();YAHOO.register("colorpicker",YAHOO.widget.ColorPicker,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/colorpicker/colorpicker.js b/lib/yui/colorpicker/colorpicker.js
new file mode 100644 (file)
index 0000000..2afd347
--- /dev/null
@@ -0,0 +1,1735 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Provides color conversion and validation utils
+ * @class YAHOO.util.Color
+ * @namespace YAHOO.util
+ */
+YAHOO.util.Color = function() {
+
+    var HCHARS="0123456789ABCDEF", lang=YAHOO.lang;
+
+    return {
+
+        /**
+         * Converts 0-1 to 0-255
+         * @method real2dec
+         * @param n {float} the number to convert
+         * @return {int} a number 0-255
+         */
+        real2dec: function(n) {
+            return Math.min(255, Math.round(n*256));
+        },
+
+        /**
+         * Converts HSV (h[0-360], s[0-1]), v[0-1] to RGB [255,255,255]
+         * @method hsv2rgb
+         * @param h {int|[int, float, float]} the hue, or an
+         *        array containing all three parameters
+         * @param s {float} the saturation
+         * @param v {float} the value/brightness
+         * @return {[int, int, int]} the red, green, blue values in
+         *          decimal.
+         */
+        hsv2rgb: function(h, s, v) { 
+
+            if (lang.isArray(h)) {
+                return this.hsv2rgb.call(this, h[0], h[1], h[2]);
+            }
+
+            var r, g, b, i, f, p, q, t;
+            i = Math.floor((h/60)%6);
+            f = (h/60)-i;
+            p = v*(1-s);
+            q = v*(1-f*s);
+            t = v*(1-(1-f)*s);
+            switch(i) {
+                case 0: r=v; g=t; b=p; break;
+                case 1: r=q; g=v; b=p; break;
+                case 2: r=p; g=v; b=t; break;
+                case 3: r=p; g=q; b=v; break;
+                case 4: r=t; g=p; b=v; break;
+                case 5: r=v; g=p; b=q; break;
+            }
+
+            var fn=this.real2dec;
+
+            return [fn(r), fn(g), fn(b)];
+        },
+
+        /**
+         * Converts to RGB [255,255,255] to HSV (h[0-360], s[0-1]), v[0-1]
+         * @method rgb2hsv
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, float, float]} the value converted to hsv
+         */
+        rgb2hsv: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.rgb2hsv.call(this, r[0], r[1], r[2]);
+            }
+
+            r=r/255;
+            g=g/255;
+            b=b/255;
+
+            var min,max,delta,h,s,v;
+            min = Math.min(Math.min(r,g),b);
+            max = Math.max(Math.max(r,g),b);
+            delta = max-min;
+
+            switch (max) {
+                case min: h=0; break;
+                case r:   h=60*(g-b)/delta; 
+                          if (g<b) {
+                              h+=360;
+                          }
+                          break;
+                case g:   h=(60*(b-r)/delta)+120; break;
+                case b:   h=(60*(r-g)/delta)+240; break;
+            }
+            
+            s = (max === 0) ? 0 : 1-(min/max);
+
+            var hsv = [Math.round(h), s, max];
+
+            return hsv;
+
+        },
+
+        /**
+         * Converts decimal rgb values into a hex string
+         * 255,255,255 -> FFFFFF
+         * @method rgb2hex
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {string} the hex string
+         */
+        rgb2hex: function(r, g, b) {
+            if (lang.isArray(r)) {
+                return this.rgb2hex.call(this, r[0], r[1], r[2]);
+            }
+
+            var f=this.dec2hex;
+            return f(r) + f(g) + f(b);
+        },
+     
+        /**
+         * Converts an int 0...255 to hex pair 00...FF
+         * @method dec2hex
+         * @param n {int} the number to convert
+         * @return {string} the hex equivalent
+         */
+        dec2hex: function(n) {
+            n = parseInt(n, 10);
+            n = (lang.isNumber(n)) ? n : 0;
+            n = (n > 255 || n < 0) ? 0 : n;
+
+            return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
+        },
+
+        /**
+         * Converts a hex pair 00...FF to an int 0...255 
+         * @method hex2dec
+         * @param str {string} the hex pair to convert
+         * @return {int} the decimal
+         */
+        hex2dec: function(str) {
+            var f = function(c) {
+                return HCHARS.indexOf(c.toUpperCase());
+            };
+
+            var s=str.split('');
+            
+            return ((f(s[0]) * 16) + f(s[1]));
+        },
+
+        /**
+         * Converts a hex string to rgb
+         * @method hex2rgb
+         * @param str {string} the hex string
+         * @return {[int, int, int]} an array containing the rgb values
+         */
+        hex2rgb: function(s) { 
+            var f = this.hex2dec;
+            return [f(s.substr(0, 2)), f(s.substr(2, 2)), f(s.substr(4, 2))];
+        },
+
+        /**
+         * Returns the closest websafe color to the supplied rgb value.
+         * @method websafe
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, int, int]} an array containing the closes
+         *                           websafe rgb colors.
+         */
+        websafe: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.websafe.call(this, r[0], r[1], r[2]);
+            }
+
+            // returns the closest match [0, 51, 102, 153, 204, 255]
+            var f = function(v) {
+                if (lang.isNumber(v)) {
+                    v = Math.min(Math.max(0, v), 255);
+                    var i, next;
+                    for (i=0; i<256; i=i+51) {
+                        next = i+51;
+                        if (v >= i && v <= next) {
+                            return (v-i > 25) ? next : i;
+                        }
+                    }
+                }
+
+                return v;
+            };
+
+            return [f(r), f(g), f(b)];
+        }
+    };
+}();
+
+
+(function() {
+
+    var _pickercount = 0;
+
+    /**
+     * The colorpicker module provides a widget for selecting colors
+     * @module colorpicker
+     * @requires yahoo, dom, event, element, slider
+     */
+
+
+    /**
+     * Creates the host element if it doesn't exist
+     * @method _createHostElement
+     * @private
+     */
+    var _createHostElement = function() {
+        var el = document.createElement('div');
+
+        if (this.CSS.BASE) {
+            el.className = this.CSS.BASE;
+        }
+        
+        return el;
+    };
+
+    /**
+     * A widget to select colors
+     * @namespace YAHOO.widget
+     * @class YAHOO.widget.ColorPicker
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the colorpicker, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the colorpicker's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.ColorPicker = function(el, attr) {
+        _pickercount = _pickercount + 1;
+        attr = attr || {};
+        if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
+        }
+        
+        if (!el && !attr.element) { // create if we dont have one
+            el = _createHostElement.call(this, attr);
+        }
+
+       YAHOO.widget.ColorPicker.superclass.constructor.call(this, el, attr); 
+    };
+
+    YAHOO.extend(YAHOO.widget.ColorPicker, YAHOO.util.Element);
+    
+    var proto = YAHOO.widget.ColorPicker.prototype,
+        Slider=YAHOO.widget.Slider,
+        Color=YAHOO.util.Color,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        lang = YAHOO.lang,
+        sub = lang.substitute;
+    
+
+    var b = "yui-picker";
+
+    /**
+     * The element ids used by this control
+     * @property ID
+     * @final
+     */
+    proto.ID = {
+
+        /**
+         * The id for the "red" form field
+         * @property ID.R
+         * @type String
+         * @final
+         * @default yui-picker-r
+         */
+        R: b + "-r",
+
+        /**
+         * The id for the "red" hex pair output
+         * @property ID.R_HEX
+         * @type String
+         * @final
+         * @default yui-picker-rhex
+         */
+        R_HEX: b + "-rhex",
+
+        /**
+         * The id for the "green" form field
+         * @property ID.G
+         * @type String
+         * @final
+         * @default yui-picker-g
+         */
+        G: b + "-g",
+
+        /**
+         * The id for the "green" hex pair output
+         * @property ID.G_HEX
+         * @type String
+         * @final
+         * @default yui-picker-ghex
+         */
+        G_HEX: b + "-ghex",
+
+
+        /**
+         * The id for the "blue" form field
+         * @property ID.B
+         * @type String
+         * @final
+         * @default yui-picker-b
+         */
+        B: b + "-b",
+
+        /**
+         * The id for the "blue" hex pair output
+         * @property ID.B_HEX
+         * @type String
+         * @final
+         * @default yui-picker-bhex
+         */
+        B_HEX: b + "-bhex",
+
+        /**
+         * The id for the "hue" form field
+         * @property ID.H
+         * @type String
+         * @final
+         * @default yui-picker-h
+         */
+        H: b + "-h",
+
+        /**
+         * The id for the "saturation" form field
+         * @property ID.S
+         * @type String
+         * @final
+         * @default yui-picker-s
+         */
+        S: b + "-s",
+
+        /**
+         * The id for the "value" form field
+         * @property ID.V
+         * @type String
+         * @final
+         * @default yui-picker-v
+         */
+        V: b + "-v",
+
+        /**
+         * The id for the picker region slider
+         * @property ID.PICKER_BG
+         * @type String
+         * @final
+         * @default yui-picker-bg
+         */
+        PICKER_BG:      b + "-bg",
+
+        /**
+         * The id for the picker region thumb
+         * @property ID.PICKER_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-thumb
+         */
+        PICKER_THUMB:   b + "-thumb",
+
+        /**
+         * The id for the hue slider
+         * @property ID.HUE_BG
+         * @type String
+         * @final
+         * @default yui-picker-hue-bg
+         */
+        HUE_BG:         b + "-hue-bg",
+
+        /**
+         * The id for the hue thumb
+         * @property ID.HUE_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-hue-thumb
+         */
+        HUE_THUMB:      b + "-hue-thumb",
+
+        /**
+         * The id for the hex value form field
+         * @property ID.HEX
+         * @type String
+         * @final
+         * @default yui-picker-hex
+         */
+        HEX:            b + "-hex",
+
+        /**
+         * The id for the color swatch
+         * @property ID.SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-swatch
+         */
+        SWATCH:         b + "-swatch",
+
+        /**
+         * The id for the websafe color swatch
+         * @property ID.WEBSAFE_SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-websafe-swatch
+         */
+        WEBSAFE_SWATCH: b + "-websafe-swatch",
+
+        /**
+         * The id for the control details
+         * @property ID.CONTROLS
+         * @final
+         * @default yui-picker-controls
+         */
+        CONTROLS: b + "-controls",
+
+        /**
+         * The id for the rgb controls
+         * @property ID.RGB_CONTROLS
+         * @final
+         * @default yui-picker-rgb-controls
+         */
+        RGB_CONTROLS: b + "-rgb-controls",
+
+        /**
+         * The id for the hsv controls
+         * @property ID.HSV_CONTROLS
+         * @final
+         * @default yui-picker-hsv-controls
+         */
+        HSV_CONTROLS: b + "-hsv-controls",
+        
+        /**
+         * The id for the hsv controls
+         * @property ID.HEX_CONTROLS
+         * @final
+         * @default yui-picker-hex-controls
+         */
+        HEX_CONTROLS: b + "-hex-controls",
+
+        /**
+         * The id for the hex summary
+         * @property ID.HEX_SUMMARY
+         * @final
+         * @default yui-picker-hex-summary
+         */
+        HEX_SUMMARY: b + "-hex-summary",
+
+        /**
+         * The id for the controls section header
+         * @property ID.CONTROLS_LABEL
+         * @final
+         * @default yui-picker-controls-label
+         */
+        CONTROLS_LABEL: b + "-controls-label"
+    };
+
+    /**
+     * Constants for any script-generated messages.  The values here
+     * are the default messages.  They can be updated by providing
+     * the complete list to the constructor for the "txt" attribute.
+     * @property TXT
+     * @final
+     */
+    proto.TXT = {
+        ILLEGAL_HEX: "Illegal hex value entered",
+        SHOW_CONTROLS: "Show color details",
+        HIDE_CONTROLS: "Hide color details",
+        CURRENT_COLOR: "Currently selected color: {rgb}",
+        CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.",
+        R: "R",
+        G: "G",
+        B: "B",
+        H: "H",
+        S: "S",
+        V: "V",
+        HEX: "#",
+        DEG: "\u00B0",
+        PERCENT: "%"
+    };
+
+    /**
+     * Constants for the default image locations for img tags that are
+     * generated by the control.  They can be modified by passing the
+     * complete list to the contructor for the "images" attribute
+     * @property IMAGE
+     * @final
+     */
+    proto.IMAGE = {
+        PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png",
+        HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png"
+    };
+
+    /*
+     * Constants for the control's custom event names.  subscribe
+     * to the rgbChange event instead.
+     * @property EVENT
+     * @final
+     */
+    //proto.EVENT = {
+        //CHANGE: "change"
+    //};
+
+    //proto.CSS = { };
+
+    /**
+     * Constants for the control's default default values
+     * @property DEFAULT
+     * @final
+     */
+    proto.DEFAULT = {
+        PICKER_SIZE: 180
+    };
+
+    /**
+     * Constants for the control's configuration attributes
+     * @property OPT
+     * @final
+     */
+    proto.OPT = {
+        HUE: "hue",
+        SATURATION: "saturation",
+        VALUE: "value",
+        RED: "red",
+        GREEN: "green",
+        BLUE: "blue",
+        HSV: "hsv",
+        RGB: "rgb",
+        WEBSAFE: "websafe",
+        HEX: "hex",
+        PICKER_SIZE: "pickersize",
+        SHOW_CONTROLS: "showcontrols",
+        SHOW_RGB_CONTROLS: "showrgbcontrols",
+        SHOW_HSV_CONTROLS: "showhsvcontrols",
+        SHOW_HEX_CONTROLS: "showhexcontrols",
+        SHOW_HEX_SUMMARY: "showhexsummary",
+        SHOW_WEBSAFE: "showwebsafe",
+        //SHOW_SUBMIT: "showsubmit",
+        CONTAINER: "container",
+        IDS: "ids",
+        ELEMENTS: "elements",
+        TXT: "txt",
+        IMAGES: "images",
+        ANIMATE: "animate"
+    };
+
+    /**
+     * Moves the hue slider into the position dictated by the current state
+     * of the control
+     * @method _updateHueSlider
+     * @private
+     */
+    var _updateHueSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = this.get(this.OPT.HUE);
+
+        h = size - Math.round(h / 360 * size);
+        
+        // 0 is at the top and bottom of the hue slider.  Always go to
+        // the top so we don't end up sending the thumb to the bottom
+        // when the value didn't actually change (e.g., a conversion
+        // produced 360 instead of 0 and the value was already 0).
+        if (h === size) {
+            h = 0;
+        }
+
+        this.hueSlider.setValue(h);
+    };
+
+    /**
+     * Moves the picker slider into the position dictated by the current state
+     * of the control
+     * @method _updatePickerSlider
+     * @private
+     */
+    var _updatePickerSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            s = this.get(this.OPT.SATURATION),
+            v = this.get(this.OPT.VALUE);
+
+        s = Math.round(s * size / 100);
+        v = Math.round(size - (v * size / 100));
+
+
+        this.pickerSlider.setRegionValue(s, v);
+    };
+
+    /**
+     * Moves the sliders into the position dictated by the current state
+     * of the control
+     * @method _updateSliders
+     * @private
+     */
+    var _updateSliders = function() {
+        _updateHueSlider.call(this);
+        _updatePickerSlider.call(this);
+    };
+
+    /**
+     * Sets the control to the specified rgb value and
+     * moves the sliders to the proper positions
+     * @method setValue
+     * @param rgb {[int, int, int]} the rgb value
+     * @param silent {boolean} whether or not to fire the change event
+     */
+    proto.setValue = function(rgb, silent) {
+        silent = (silent) || false;
+        this.set(this.OPT.RGB, rgb, silent);
+        _updateSliders.call(this);
+    };
+
+    /**
+     * The hue slider
+     * @property hueSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.hueSlider = null; 
+    
+    /**
+     * The picker region
+     * @property pickerSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.pickerSlider = null;
+
+    /**
+     * Translates the slider value into hue, int[0,359]
+     * @method _getH
+     * @private
+     * @return {int} the hue from 0 to 359
+     */
+    var _getH = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = (size - this.hueSlider.getValue()) / size;
+        h = Math.round(h*360);
+        return (h === 360) ? 0 : h;
+    };
+
+    /**
+     * Translates the slider value into saturation, int[0,1], left to right
+     * @method _getS
+     * @private
+     * @return {int} the saturation from 0 to 1
+     */
+    var _getS = function() {
+        return this.pickerSlider.getXValue() / this.get(this.OPT.PICKER_SIZE);
+    };
+
+    /**
+     * Translates the slider value into value/brightness, int[0,1], top
+     * to bottom
+     * @method _getV
+     * @private
+     * @return {int} the value from 0 to 1
+     */
+    var _getV = function() {
+        var size = this.get(this.OPT.PICKER_SIZE);
+        return (size - this.pickerSlider.getYValue()) / size;
+    };
+
+    /**
+     * Updates the background of the swatch with the current rbg value.
+     * Also updates the websafe swatch to the closest websafe color
+     * @method _updateSwatch
+     * @private
+     */
+    var _updateSwatch = function() {
+        var rgb = this.get(this.OPT.RGB),
+            websafe = this.get(this.OPT.WEBSAFE),
+            el = this.getElement(this.ID.SWATCH),
+            color = rgb.join(","),
+            txt = this.get(this.OPT.TXT);
+
+        Dom.setStyle(el, "background-color", "rgb(" + color  + ")");
+        el.title = lang.substitute(txt.CURRENT_COLOR, {
+                "rgb": "#" + this.get(this.OPT.HEX)
+            });
+
+
+        el = this.getElement(this.ID.WEBSAFE_SWATCH);
+        color = websafe.join(",");
+
+        Dom.setStyle(el, "background-color", "rgb(" + color + ")");
+        el.title = lang.substitute(txt.CLOSEST_WEBSAFE, {
+                "rgb": "#" + Color.rgb2hex(websafe)
+            });
+
+    };
+
+    /**
+     * Reads the sliders and converts the values to RGB, updating the
+     * internal state for all the individual form fields
+     * @method _getValuesFromSliders
+     * @private
+     */
+    var _getValuesFromSliders = function() {
+        var h=_getH.call(this), s=_getS.call(this), v=_getV.call(this);
+
+        var rgb = Color.hsv2rgb(h, s, v);
+        //var websafe = Color.websafe(rgb);
+        //var hex = Color.rgb2hex(rgb[0], rgb[1], rgb[2]);
+
+        this.set(this.OPT.RGB, rgb);
+    };
+
+    /**
+     * Updates the form field controls with the state data contained
+     * in the control.
+     * @method _updateFormFields
+     * @private
+     */
+    var _updateFormFields = function() {
+        this.getElement(this.ID.H).value = this.get(this.OPT.HUE);
+        this.getElement(this.ID.S).value = this.get(this.OPT.SATURATION);
+        this.getElement(this.ID.V).value = this.get(this.OPT.VALUE);
+        this.getElement(this.ID.R).value = this.get(this.OPT.RED);
+        this.getElement(this.ID.R_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.RED));
+        this.getElement(this.ID.G).value = this.get(this.OPT.GREEN);
+        this.getElement(this.ID.G_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.GREEN));
+        this.getElement(this.ID.B).value = this.get(this.OPT.BLUE);
+        this.getElement(this.ID.B_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.BLUE));
+        this.getElement(this.ID.HEX).value = this.get(this.OPT.HEX);
+    };
+
+    /**
+     * Event handler for the hue slider.
+     * @method _onHueSliderChange
+     * @param newOffset {int} pixels from the start position
+     * @private
+     */
+    var _onHueSliderChange = function(newOffset) {
+
+        var h = _getH.call(this);
+        this.set(this.OPT.HUE, h, true);
+
+        // set picker background to the hue
+        var rgb = Color.hsv2rgb(h, 1, 1);
+        var styleDef = "rgb(" + rgb.join(",") + ")";
+
+        Dom.setStyle(this.getElement(this.ID.PICKER_BG), "background-color", styleDef);
+
+        if (this.hueSlider.valueChangeSource === this.hueSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+    /**
+     * Event handler for the picker slider, which controls the
+     * saturation and value/brightness.
+     * @method _onPickerSliderChange
+     * @param newOffset {{x: int, y: int}} x/y pixels from the start position
+     * @private
+     */
+    var _onPickerSliderChange = function(newOffset) {
+
+        var s=_getS.call(this), v=_getV.call(this);
+        this.set(this.OPT.SATURATION, Math.round(s*100), true);
+        this.set(this.OPT.VALUE, Math.round(v*100), true);
+
+        if (this.pickerSlider.valueChangeSource === this.pickerSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+
+    /**
+     * Key map to well-known commands for txt field input
+     * @method _getCommand
+     * @param e {Event} the keypress or keydown event
+     * @return {int} a command code
+     * <ul>
+     * <li>0 = not a number, letter in range, or special key</li>
+     * <li>1 = number</li>
+     * <li>2 = a-fA-F</li>
+     * <li>3 = increment (up arrow)</li>
+     * <li>4 = decrement (down arrow)</li>
+     * <li>5 = special key (tab, delete, return, escape, left, right)</li> 
+     * <li>6 = return</li>
+     * </ul>
+     * @private
+     */
+    var _getCommand = function(e) {
+        var c = Event.getCharCode(e);
+
+        //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
+
+        // special keys
+        if (c === 38) { // up arrow
+            return 3;
+        } else if (c === 13) { // return
+            return 6;
+        } else if (c === 40) { // down array
+            return 4;
+        } else if (c >= 48 && c<=57) { // 0-9
+            return 1;
+        } else if (c >= 97 && c<=102) { // a-f
+            return 2;
+        } else if (c >= 65 && c<=70) { // A-F
+            return 2;
+        //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
+        //              (c >= 112 && c <=123)) { // including F-keys
+        // tab, delete, return, escape, left, right
+        } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1) { // special chars
+            return 5;
+        } else { // something we probably don't want
+            return 0;
+        }
+    };
+
+    /**
+     * Use the value of the text field to update the control
+     * @method _hexFieldKeypress
+     * @param e {Event} an event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _useFieldValue = function(e, el, prop) {
+        var val = el.value;
+
+        if (prop !== this.OPT.HEX) {
+            val = parseInt(val, 10);
+        }
+
+        if (val !== this.get(prop)) {
+            this.set(prop, val);
+        }
+    };
+
+    /**
+     * Handle keypress on one of the rgb or hsv fields.
+     * @method _rgbFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _rgbFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        var inc = (e.shiftKey) ? 10 : 1;
+        switch (command) {
+            case 6: // return, update the value
+                _useFieldValue.apply(this, arguments);
+                break;
+                        
+            case 3: // up arrow, increment
+                this.set(prop, Math.min(this.get(prop)+inc, 255));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+            case 4: // down arrow, decrement
+                this.set(prop, Math.max(this.get(prop)-inc, 0));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+
+            default:
+        }
+
+    };
+
+    /**
+     * Handle keydown on the hex field
+     * @method _hexFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _hexFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        if (command === 6) { // return, update the value
+            _useFieldValue.apply(this, arguments);
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars, and by default allows a-f.  
+     * Used for the hex field keypress handler.
+     * @method _hexOnly
+     * @param e {Event} the event
+     * @param numbersOnly omits a-f if set to true
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _hexOnly = function(e, numbersOnly) {
+        var command = _getCommand(e);
+        switch (command) {
+            case 6: // return
+            case 5: // special char
+            case 1: // number
+                break;
+            case 2: // hex char (a-f)
+                if (numbersOnly !== true) {
+                    break;
+                }
+
+                // fallthrough is intentional
+
+            default: // prevent alpha and punctuation
+                Event.stopEvent(e);
+                return false;
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars only.  Used for the
+     * rgb and hsv fields keypress handler.
+     * @method _numbersOnly
+     * @param e {Event} the event
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _numbersOnly = function(e) {
+        return _hexOnly(e, true);
+    };
+
+    /**
+     * Returns the element reference that is saved.  The id can be either
+     * the element id, or the key for this id in the "id" config attribute.
+     * For instance, the host element id can be obtained by passing its
+     * id (default: "yui_picker") or by its key "YUI_PICKER".
+     * @param id {string} the element id, or key 
+     * @return {HTMLElement} a reference to the element
+     */
+    proto.getElement = function(id) { 
+        return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]]; 
+    };
+
+    var _createElements = function() {
+        var el, child, img, fld, i, 
+            ids = this.get(this.OPT.IDS),
+            txt = this.get(this.OPT.TXT),
+            images = this.get(this.OPT.IMAGES),
+            Elem = function(type, o) {
+                var n = document.createElement(type);
+                if (o) {
+                    lang.augmentObject(n, o, true);
+                }
+                return n;
+            },
+            RGBElem = function(type, obj) {
+                var o = lang.merge({
+                        //type: "txt",
+                        autocomplete: "off",
+                        value: "0",
+                        size: 3,
+                        maxlength: 3
+                    }, obj);
+
+                o.name = o.id;
+                return new Elem(type, o);
+            };
+
+        var p = this.get("element");
+
+        // Picker slider (S and V) ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.PICKER_BG],
+            className: "yui-picker-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.PICKER_THUMB],
+            className: "yui-picker-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.PICKER_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+        
+        // Hue slider ---------------------------------------------
+        el = new Elem("div", {
+            id: ids[this.ID.HUE_BG],
+            className: "yui-picker-hue-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.HUE_THUMB],
+            className: "yui-picker-hue-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.HUE_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+
+
+        // controls ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.CONTROLS],
+            className: "yui-picker-controls"
+        });
+
+        p.appendChild(el);
+        p = el;
+
+            // controls header
+            el = new Elem("div", {
+                className: "hd"
+            });
+
+            child = new Elem("a", {
+                id: ids[this.ID.CONTROLS_LABEL],
+                //className: "yui-picker-controls-label",
+                href: "#"
+            });
+            el.appendChild(child);
+            p.appendChild(el);
+
+            // bd
+            el = new Elem("div", {
+                className: "bd"
+            });
+
+            p.appendChild(el);
+            p = el;
+
+                // rgb
+                el = new Elem("ul", {
+                    id: ids[this.ID.RGB_CONTROLS],
+                    className: "yui-picker-rgb-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.R + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.R],
+                    className: "yui-picker-r"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.G + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.G],
+                    className: "yui-picker-g"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.B + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.B],
+                    className: "yui-picker-b"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                p.appendChild(el);
+
+                // hsv
+                el = new Elem("ul", {
+                    id: ids[this.ID.HSV_CONTROLS],
+                    className: "yui-picker-hsv-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.H + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.H],
+                    className: "yui-picker-h"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.DEG));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.S + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.S],
+                    className: "yui-picker-s"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.V + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.V],
+                    className: "yui-picker-v"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+
+                // hex summary
+
+                el = new Elem("ul", {
+                    id: ids[this.ID.HEX_SUMMARY],
+                    className: "yui-picker-hex_summary"
+                });
+
+                child = new Elem("li", {
+                    id: ids[this.ID.R_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.G_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.B_HEX]
+                });
+                el.appendChild(child);
+                p.appendChild(el);
+
+                // hex field
+                el = new Elem("div", {
+                    id: ids[this.ID.HEX_CONTROLS],
+                    className: "yui-picker-hex-controls"
+                });
+                el.appendChild(document.createTextNode(txt.HEX + " "));
+
+                child = new RGBElem("input", {
+                    id: ids[this.ID.HEX],
+                    className: "yui-picker-hex",
+                    size: 6,
+                    maxlength: 6
+                });
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+                p = this.get("element");
+
+                // swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.SWATCH],
+                    className: "yui-picker-swatch"
+                });
+
+                p.appendChild(el);
+
+                // websafe swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.WEBSAFE_SWATCH],
+                    className: "yui-picker-websafe-swatch"
+                });
+
+                p.appendChild(el);
+
+    };
+
+    var _attachRGBHSV = function(id, config) {
+        Event.on(this.getElement(id), "keydown", function(e, me) {
+                _rgbFieldKeypress.call(me, e, this, config);
+            }, this);
+        Event.on(this.getElement(id), "keypress", _numbersOnly, this);
+        Event.on(this.getElement(id), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, config);
+            }, this);
+    };
+
+
+    /**
+     * Updates the rgb attribute with the current state of the r,g,b
+     * fields.  This is invoked from change listeners on these
+     * attributes to facilitate updating these values from the
+     * individual form fields
+     * @method _updateRGB
+     * @private
+     */
+    var _updateRGB = function() {
+        var rgb = [this.get(this.OPT.RED), 
+                   this.get(this.OPT.GREEN),
+                   this.get(this.OPT.BLUE)];
+
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Sets the initial state of the sliders
+     * @method initPicker
+     */
+    proto.initPicker = function () {
+
+        // bind all of our elements
+        var o=this.OPT, 
+            ids = this.get(o.IDS), 
+            els = this.get(o.ELEMENTS), 
+                  i, el, id;
+
+        // Add the default value as a key for each element for easier lookup
+        for (i in this.ID) {
+            if (lang.hasOwnProperty(this.ID, i)) {
+                ids[this.ID[i]] = ids[i];
+            }
+        }
+
+        // Check for picker element, if not there, create all of them
+        el = Dom.get(ids[this.ID.PICKER_BG]);
+        if (!el) {
+            _createElements.call(this);
+        } else {
+        }
+
+        for (i in ids) {
+            if (lang.hasOwnProperty(ids, i)) {
+                // look for element
+                el = Dom.get(ids[i]);
+
+                // generate an id if the implementer passed in an element reference,
+                // and the element did not have an id already
+                id = Dom.generateId(el);
+
+                // update the id in case we generated the id
+                ids[i] = id; // key is WEBSAFE_SWATCH
+                ids[ids[i]] = id; // key is websafe_swatch
+
+                // store the dom ref
+                els[id] = el;
+            }
+        }
+
+        // set the initial visibility state of our controls
+            els = [o.SHOW_CONTROLS, 
+                   o.SHOW_RGB_CONTROLS,
+                   o.SHOW_HSV_CONTROLS,
+                   o.SHOW_HEX_CONTROLS,
+                   o.SHOW_HEX_SUMMARY,
+                   o.SHOW_WEBSAFE
+                   ];
+
+        for (i=0; i<els.length; i=i+1) {
+            this.set(els[i], this.get(els[i]));
+        }
+
+        var s = this.get(o.PICKER_SIZE);
+
+        this.hueSlider = Slider.getVertSlider(this.getElement(this.ID.HUE_BG), 
+                                              this.getElement(this.ID.HUE_THUMB), 0, s);
+        this.hueSlider.subscribe("change", _onHueSliderChange, this, true);
+
+        this.pickerSlider = Slider.getSliderRegion(this.getElement(this.ID.PICKER_BG), 
+                                                   this.getElement(this.ID.PICKER_THUMB), 0, s, 0, s);
+        this.pickerSlider.subscribe("change", _onPickerSliderChange, this, true);
+
+        // Set the animate state
+        this.set(o.ANIMATE,this.get(o.ANIMATE));
+
+        //_onHueSliderChange.call(this, 0);
+
+        Event.on(this.getElement(this.ID.WEBSAFE_SWATCH), "click", function(e) {
+               this.setValue(this.get(o.WEBSAFE));
+               //_updateSliders
+           }, this, true);
+
+        Event.on(this.getElement(this.ID.CONTROLS_LABEL), "click", function(e) {
+               this.set(o.SHOW_CONTROLS, !this.get(o.SHOW_CONTROLS));
+               Event.preventDefault(e);
+           }, this, true);
+
+        _attachRGBHSV.call(this, this.ID.R, this.OPT.RED); 
+        _attachRGBHSV.call(this, this.ID.G, this.OPT.GREEN); 
+        _attachRGBHSV.call(this, this.ID.B, this.OPT.BLUE); 
+        _attachRGBHSV.call(this, this.ID.H, this.OPT.HUE); 
+        _attachRGBHSV.call(this, this.ID.S, this.OPT.SATURATION); 
+        _attachRGBHSV.call(this, this.ID.V, this.OPT.VALUE); 
+
+        Event.on(this.getElement(this.ID.HEX), "keydown", function(e, me) {
+                _hexFieldKeypress.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        Event.on(this.getElement(this.ID.HEX), "keypress", _hexOnly, this);
+        Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        _updateRGB.call(this);
+    };
+
+
+    /**
+     * Updates the RGB values from the current state of the HSV
+     * values.  Executed when the one of the HSV form fields are
+     * updated
+     * _updateRGBFromHSV
+     * @private
+     */
+    var _updateRGBFromHSV = function() {
+        var hsv = [this.get(this.OPT.HUE), 
+                   this.get(this.OPT.SATURATION)/100,
+                   this.get(this.OPT.VALUE)/100];
+
+        var rgb = Color.hsv2rgb(hsv);
+
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Parses the hex string to normalize shorthand values, converts
+     * the hex value to rgb and updates the rgb attribute (which
+     * updates the state for all of the other values)
+     * method _updateHex
+     * @private
+     */
+    var _updateHex = function() {
+       
+        var hex = this.get(this.OPT.HEX), l=hex.length;
+
+        // support #369 -> #336699 shorthand
+        if (l === 3) {
+            var c = hex.split(""), i;
+            for (i=0; i<l; i=i+1) {
+                c[i] = c[i] + c[i];
+            }
+
+            hex = c.join("");
+        }
+
+        if (hex.length !== 6) {
+            return false;
+        }
+
+        var rgb = Color.hex2rgb(hex);
+
+
+        this.setValue(rgb);
+
+        //_updateSliders.call(this);
+
+    };
+
+
+
+    /**
+     * Sets up the config attributes and the change listeners for this
+     * properties
+     * @method initAttributes
+     * @param attr An object containing default attribute values
+     */
+    proto.initAttributes = function(attr) {
+
+        attr = attr || {};
+        YAHOO.widget.ColorPicker.superclass.initAttributes.call(this, attr);
+        
+        /**
+         * The size of the picker. Trying to change this is not recommended.
+         * @attribute pickersize
+         * @default 180
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.PICKER_SIZE, {
+                value: attr.size || this.DEFAULT.PICKER_SIZE
+            });
+
+        /**
+         * The current hue value 0-360
+         * @attribute hue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.HUE, {
+                value: attr.hue || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current saturation value 0-100
+         * @attribute saturation
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.SATURATION, {
+                value: attr.saturation || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current value/brightness value 0-100
+         * @attribute value
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.VALUE, {
+                value: lang.isNumber(attr.value) ? attr.value : 100,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current red value 0-255
+         * @attribute red
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.RED, {
+                value: lang.isNumber(attr.red) ? attr.red : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current green value 0-255
+         * @attribute green 
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.GREEN, {
+                value: lang.isNumber(attr.green) ? attr.green : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current blue value 0-255
+         * @attribute blue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.BLUE, {
+                value: lang.isNumber(attr.blue) ? attr.blue : 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current hex value #000000-#FFFFFF, without the #
+         * @attribute hex
+         * @type string
+         */
+        this.setAttributeConfig(this.OPT.HEX, {
+                value: attr.hex || "FFFFFF",
+                validator: lang.isString
+            });
+
+        /**
+         * The current rgb value.  Updates the state of all of the
+         * other value fields.  Read-only: use setValue to set the
+         * controls rgb value.
+         * @attribute hex
+         * @type [int, int, int]
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.RGB, {
+                value: attr.rgb || [255,255,255],
+                method: function(rgb) {
+
+                    this.set(this.OPT.RED, rgb[0], true);
+                    this.set(this.OPT.GREEN, rgb[1], true);
+                    this.set(this.OPT.BLUE, rgb[2], true);
+
+                    var websafe = Color.websafe(rgb);
+                    this.set(this.OPT.WEBSAFE, websafe, true);
+
+                    var hex = Color.rgb2hex(rgb);
+                    this.set(this.OPT.HEX, hex, true);
+
+                    var hsv = Color.rgb2hsv(rgb);
+
+
+                    this.set(this.OPT.HUE, hsv[0], true);
+                    this.set(this.OPT.SATURATION, Math.round(hsv[1]*100), true);
+                    this.set(this.OPT.VALUE, Math.round(hsv[2]*100), true);
+                },
+                readonly: true
+            });
+
+        /**
+         * If the color picker will live inside of a container object,
+         * set, provide a reference to it so the control can use the
+         * container's events.
+         * @attribute container
+         * @type YAHOO.widget.Panel
+         */
+        this.setAttributeConfig(this.OPT.CONTAINER, {
+                    value: null,
+                    method: function(container) {
+                        if (container) {
+                            // Position can get out of sync when the
+                            // control is manipulated while display is
+                            // none.  Resetting the slider constraints
+                            // when it is visible gets the state back in
+                            // order.
+                            container.showEvent.subscribe(function() {
+                                // this.pickerSlider.thumb.resetConstraints();
+                                // this.hueSlider.thumb.resetConstraints();
+                                this.pickerSlider.focus();
+                            }, this, true);
+                        }
+                    }
+                });
+        /**
+         * The closest current websafe value
+         * @attribute websafe
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.WEBSAFE, {
+                value: attr.websafe || [255,255,255]
+            });
+
+
+        var ids = attr.ids || lang.merge({}, this.ID);
+
+        if (!attr.ids && _pickercount > 1) {
+            for (var i in ids) {
+                if (lang.hasOwnProperty(ids, i)) {
+                    ids[i] = ids[i] + _pickercount;
+                }
+            }
+        }
+
+
+        /**
+         * A list of element ids and/or element references used by the 
+         * control.  The default is the this.ID list, and can be customized
+         * by passing a list in the contructor
+         * @attribute ids
+         * @type {referenceid: realid}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IDS, {
+                value: ids,
+                writeonce: true
+            });
+
+        /**
+         * A list of txt strings for internationalization.  Default
+         * is this.TXT
+         * @attribute txt
+         * @type {key: txt}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.TXT, {
+                value: attr.txt || this.TXT,
+                writeonce: true
+            });
+
+        /**
+         * The img src default list
+         * is this.IMAGES
+         * @attribute images
+         * @type {key: image}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IMAGES, {
+                value: attr.images || this.IMAGE,
+                writeonce: true
+            });
+        /**
+         * The element refs used by this control.  Set at initialization
+         * @attribute elements
+         * @type {id: HTMLElement}
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.ELEMENTS, {
+                value: {},
+                readonly: true
+            });
+
+        /**
+         * Returns the cached element reference.  If the id is not a string, it
+         * is assumed that it is an element and this is returned.
+         * @param id {string|HTMLElement} the element key, id, or ref
+         * @param on {boolean} hide or show.  If true, show
+         * @private */
+        var _hideShowEl = function(id, on) {
+            var el = (lang.isString(id) ? this.getElement(id) : id);
+            //Dom.setStyle(id, "visibility", (on) ? "" : "hidden");
+            Dom.setStyle(el, "display", (on) ? "" : "none");
+        };
+
+        /**
+         * Hide/show the entire set of controls
+         * @attribute showcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_CONTROLS, {
+                value: lang.isBoolean(attr.showcontrols) ? attr.showcontrols : true,
+                method: function(on) {
+
+                    var el = Dom.getElementsByClassName("bd", "div", 
+                            this.getElement(this.ID.CONTROLS))[0];
+
+                    _hideShowEl.call(this, el, on);
+
+                    this.getElement(this.ID.CONTROLS_LABEL).innerHTML = 
+                        (on) ? this.get(this.OPT.TXT).HIDE_CONTROLS :
+                               this.get(this.OPT.TXT).SHOW_CONTROLS;
+
+                }
+            });
+
+        /**
+         * Hide/show the rgb controls
+         * @attribute showrgbcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS, {
+                value: lang.isBoolean(attr.showrgbcontrols) ? attr.showrgbcontrols : true,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.RBG_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.RGB_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the hsv controls
+         * @attribute showhsvcontrols
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS, {
+                value: lang.isBoolean(attr.showhsvcontrols) ?
+                                      attr.showhsvcontrols : false,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.HSV_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.HSV_CONTROLS, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HEX_SUMMARY)) {
+                        this.set(this.OPT.SHOW_HEX_SUMMARY, false);
+                    }
+                }
+            });
+
+        /**
+         * Hide/show the hex controls
+         * @attribute showhexcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS, {
+                value: lang.isBoolean(attr.showhexcontrols) ?
+                                      attr.showhexcontrols : false,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the websafe swatch
+         * @attribute showwebsafe
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_WEBSAFE, {
+                value: lang.isBoolean(attr.showwebsafe) ? attr.showwebsafe : true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.WEBSAFE_SWATCH, on);
+                }
+            });
+
+        /**
+         * Hide/show the hex summary
+         * @attribute showhexsummary
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY, {
+                value: lang.isBoolean(attr.showhexsummary) ? attr.showhexsummary : true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_SUMMARY, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HSV_CONTROLS)) {
+                        this.set(this.OPT.SHOW_HSV_CONTROLS, false);
+                    }
+                }
+            });
+        this.setAttributeConfig(this.OPT.ANIMATE, {
+                value: lang.isBoolean(attr.animate) ? attr.animate : true,
+                method: function(on) {
+                    this.pickerSlider.animate = on;
+                    this.hueSlider.animate = on;
+                }
+            });
+
+        this.on(this.OPT.HUE + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.SATURATION + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.VALUE + "Change", _updatePickerSlider, this, true);
+
+        this.on(this.OPT.RED + "Change", _updateRGB, this, true);
+        this.on(this.OPT.GREEN + "Change", _updateRGB, this, true);
+        this.on(this.OPT.BLUE + "Change", _updateRGB, this, true);
+
+        this.on(this.OPT.HEX + "Change", _updateHex, this, true);
+
+        this.initPicker();
+    };
+
+})();
+YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.5.0", build: "895"});
index 62d9e978c879a1978e9c285aed33965b55c4f858..a4116f0ac3a035d2dfa0ffd49920560b96ef978c 100755 (executable)
@@ -1,5 +1,54 @@
 Connection Manager Release Notes
 
+*** version 2.5.0 ***
+
+* setForm() can now detects HTTPS in the URI for file upload transactions.  The
+third, boolean argument for HTTPS when using IE is no longer necessary.
+
+* [FIXED] SF1882101.  POST transactions without a message will now have a
+Content-Length value set to 0 for FF 2.x.  This is accomplished by passing a
+value of empty string instead of null to XHR's send().  All other A-Grade
+browsers remain unaffected and perform correctly.
+
+*** version 2.4.0 ***
+
+* [FIXED] SF1804153.  Transactions initialized with setForm() now properly clear
+the POST data field after each transaction.
+
+* The callback object can accept a new member, cache, defined with a boolean
+value.  If set to false (e.g., var callback = { cache:false };), a timestamp
+will be appended to the URI to override HTTP GET caching.  This timestamp value
+will appear as rnd=timestamp in the request querystring.
+
+* Custom Events startEvent, completeEvent, and abortEvent now receive
+callback.argument, if defined, in addition to the transaction ID.  Each Custom
+Event's function handler receives two arguments -- the event type as the first
+argument, and an array as the second argument.  The first element in the array
+is the transaction ID, and the second element are any arguments defined in the
+callback object.
+
+*** version 2.3.1 ***
+
+* setDefaultPostHeader() can now be overloaded with a boolean, string, or
+number.  By default, POST transactions send the following Content-Type header:
+'application/x-www-form-urlencoded; charset=UTF-8'.
+
+A custom Content-Type header can now be set by passing its value to
+setDefaultPostHeader().
+
+* HTML form submissions now send a Content-Type header of "application/x-www-
+form-urlencoded", omitting the charset=UTF-8 value.
+
+* setDefaultXhrHeader() can now be overloaded with a boolean, string, or number.
+By default, all transactions send a custom header of "X-Requested-
+With:XMLHttpRequest".
+
+This default header value can be overridden by passing the desired value as an
+argument to setDefaultPostHeader().
+
+* The file upload iframe's event listener is now explicitly removed before the
+iframe is destroyed.
+
 *** version 2.3.0 ***
 
 * Custom Events are introduced in Connection Manager.  These events -- for a
@@ -23,7 +72,7 @@ For transactions involving file upload with an HTML form, the events are:
 * abort() and isCallInProgress() are now functional for file upload
 transactions.
 
-* NOTE: The XHR implementation in Safari 2.0.4 has been confirmed to leak
+* NOTE: The native XHR implementation in Safari 2.0.4 has been confirmed to leak
 memory.
 
 * UPDATE: The XHR implementation in Safari 3.0 beta(and WebKit builds) now
@@ -216,25 +265,3 @@ and returns false if the connection object is no longer available.
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index 08e0f80893aab45610c50ab294d2627b5a30db21..999a0414522f666418619ac08a5e108dc6824ee5 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -33,9 +33,9 @@ YAHOO.util.Connect =
    * @type array
    */
        _msxml_progid:[
+               'Microsoft.XMLHTTP',
                'MSXML2.XMLHTTP.3.0',
-               'MSXML2.XMLHTTP',
-               'Microsoft.XMLHTTP'
+               'MSXML2.XMLHTTP'
                ],
 
   /**
@@ -69,10 +69,7 @@ YAHOO.util.Connect =
     _use_default_post_header:true,
 
  /**
-  * @description Determines if a default header of
-  * Content-Type of 'application/x-www-form-urlencoded'
-  * will be added to client HTTP headers sent for POST
-  * transactions.
+  * @description The default header used for POST transactions.
   * @property _default_post_header
   * @private
   * @static
@@ -80,6 +77,16 @@ YAHOO.util.Connect =
   */
     _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
 
+ /**
+  * @description The default header used for transactions involving the
+  * use of HTML forms.
+  * @property _default_form_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_form_header:'application/x-www-form-urlencoded',
+
  /**
   * @description Determines if a default header of
   * 'X-Requested-With: XMLHttpRequest'
@@ -228,7 +235,7 @@ YAHOO.util.Connect =
                                'click',
                                function(e){
                                        var obj = YAHOO.util.Event.getTarget(e);
-                                       if(obj.type == 'submit'){
+                                       if(obj.nodeName.toLowerCase() == 'input' && (obj.type && obj.type.toLowerCase() == 'submit')){
                                                YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
                                        }
                                });
@@ -329,7 +336,7 @@ YAHOO.util.Connect =
        },
 
   /**
-   * @description Member to enable or disable the default POST header.
+   * @description Member to override the default POST header.
    * @method setDefaultPostHeader
    * @public
    * @static
@@ -338,12 +345,17 @@ YAHOO.util.Connect =
    */
        setDefaultPostHeader:function(b)
        {
-               this._use_default_post_header = b;
-               YAHOO.log('Use default POST header set to  ' + b, 'info', 'Connection');
+               if(typeof b == 'string'){
+                       this._default_post_header = b;
+                       YAHOO.log('Default POST header set to  ' + b, 'info', 'Connection');
+               }
+               else if(typeof b == 'boolean'){
+                       this._use_default_post_header = b;
+               }
        },
 
   /**
-   * @description Member to enable or disable the default POST header.
+   * @description Member to override the default transaction header..
    * @method setDefaultXhrHeader
    * @public
    * @static
@@ -352,8 +364,13 @@ YAHOO.util.Connect =
    */
        setDefaultXhrHeader:function(b)
        {
-               this._use_default_xhr_header = b;
-               YAHOO.log('Use default transaction header set to  ' + b, 'info', 'Connection');
+               if(typeof b == 'string'){
+                       this._default_xhr_header = b;
+                       YAHOO.log('Default XHR header set to  ' + b, 'info', 'Connection');
+               }
+               else{
+                       this._use_default_xhr_header = b;
+               }
        },
 
   /**
@@ -397,7 +414,7 @@ YAHOO.util.Connect =
                        for(var i=0; i<this._msxml_progid.length; ++i){
                                try
                                {
-                                       // Instantiates XMLHttpRequest for IE and assign to http.
+                                       // Instantiates XMLHttpRequest for IE and assign to http
                                        http = new ActiveXObject(this._msxml_progid[i]);
                                        //  Object literal with conn and tId properties
                                        obj = { conn:http, tId:transactionId };
@@ -463,6 +480,7 @@ YAHOO.util.Connect =
        asyncRequest:function(method, uri, callback, postData)
        {
                var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
+               var args = (callback && callback.argument)?callback.argument:null;
 
                if(!o){
                        YAHOO.log('Unable to create connection object.', 'error', 'Connection');
@@ -490,9 +508,6 @@ YAHOO.util.Connect =
                                                // and then concatenate _sFormData to the URI.
                                                uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
                                        }
-                                       else{
-                                               uri += "?" + this._sFormData;
-                                       }
                                }
                                else if(method.toUpperCase() == 'POST'){
                                        // If POST data exist in addition to the HTML form data,
@@ -501,8 +516,13 @@ YAHOO.util.Connect =
                                }
                        }
 
+                       if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
+                               // If callback.cache is defined and set to false, a
+                               // timestamp value will be added to the querystring.
+                               uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
+                       }
+
                        o.conn.open(method, uri, true);
-                       //this.processTransactionHeaders(o);
 
                        // Each transaction will automatically include a custom header of
                        // "X-Requested-With: XMLHttpRequest" to identify the request as
@@ -514,27 +534,35 @@ YAHOO.util.Connect =
                                }
                        }
 
-                       if(this._isFormSubmit || (postData && this._use_default_post_header)){
+                       //If the transaction method is POST and the POST header value is set to true
+                       //or a custom value, initalize the Content-Type header to this value.
+                       if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
                                this.initHeader('Content-Type', this._default_post_header);
-                               YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded for POST transaction.', 'info', 'Connection');
-                               if(this._isFormSubmit){
-                                       this.resetFormState();
-                               }
+                               YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
                        }
 
+                       //Initialize all default and custom HTTP headers,
                        if(this._has_default_headers || this._has_http_headers){
                                this.setHeader(o);
                        }
 
                        this.handleReadyState(o, callback);
-                       o.conn.send(postData || null);
+                       o.conn.send(postData || '');
+                       YAHOO.log('Transaction ' + o.tId + ' sent.', 'info', 'Connection');
+
+
+                       // Reset the HTML form data and state properties as
+                       // soon as the data are submitted.
+                       if(this._isFormSubmit === true){
+                               this.resetFormState();
+                       }
 
                        // Fire global custom event -- startEvent
-                       this.startEvent.fire(o);
+                       this.startEvent.fire(o, args);
 
                        if(o.startEvent){
                                // Fire transaction custom event -- startEvent
-                               o.startEvent.fire(o);
+                               o.startEvent.fire(o, args);
                        }
 
                        return o;
@@ -585,6 +613,7 @@ YAHOO.util.Connect =
 
     {
                var oConn = this;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                if(callback && callback.timeout){
                        this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
@@ -605,11 +634,11 @@ YAHOO.util.Connect =
                                        }
 
                                        // Fire global custom event -- completeEvent
-                                       oConn.completeEvent.fire(o);
+                                       oConn.completeEvent.fire(o, args);
 
                                        if(o.completeEvent){
                                                // Fire transaction custom event -- completeEvent
-                                               o.completeEvent.fire(o);
+                                               o.completeEvent.fire(o, args);
                                        }
 
                                        oConn.handleTransactionResponse(o, callback);
@@ -632,14 +661,8 @@ YAHOO.util.Connect =
    */
     handleTransactionResponse:function(o, callback, isAbort)
     {
-               // If no valid callback is provided, then do not process any callback handling.
-               if(!callback){
-                       this.releaseObject(o);
-                       YAHOO.log('No callback object to process. Transaction complete.', 'info', 'Connection');
-                       return;
-               }
-
                var httpStatus, responseObject;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                try
                {
@@ -652,15 +675,15 @@ YAHOO.util.Connect =
                }
                catch(e){
 
-                        // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                        // when the o object's status and statusText properties are
+                        // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
+                        // when the XHR object's status and statusText properties are
                         // unavailable, and a query attempt throws an exception.
                        httpStatus = 13030;
                }
 
                if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
-                       responseObject = this.createResponseObject(o, callback.argument);
-                       if(callback.success){
+                       responseObject = this.createResponseObject(o, args);
+                       if(callback && callback.success){
                                if(!callback.scope){
                                        callback.success(responseObject);
                                        YAHOO.log('Success callback. HTTP code is ' + httpStatus, 'info', 'Connection');
@@ -690,8 +713,8 @@ YAHOO.util.Connect =
                                case 12031:
                                case 12152: // Connection closed by server.
                                case 13030: // See above comments for variable status.
-                                       responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
-                                       if(callback.failure){
+                                       responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
+                                       if(callback && callback.failure){
                                                if(!callback.scope){
                                                        callback.failure(responseObject);
                                                        YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
@@ -701,10 +724,11 @@ YAHOO.util.Connect =
                                                        YAHOO.log('Failure callback with scope. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
                                                }
                                        }
+
                                        break;
                                default:
-                                       responseObject = this.createResponseObject(o, callback.argument);
-                                       if(callback.failure){
+                                       responseObject = this.createResponseObject(o, args);
+                                       if(callback && callback.failure){
                                                if(!callback.scope){
                                                        callback.failure(responseObject);
                                                        YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');
@@ -769,7 +793,7 @@ YAHOO.util.Connect =
                obj.responseText = o.conn.responseText;
                obj.responseXML = o.conn.responseXML;
 
-               if(typeof callbackArg !== undefined){
+               if(callbackArg){
                        obj.argument = callbackArg;
                }
 
@@ -829,18 +853,10 @@ YAHOO.util.Connect =
    * automatically sent with each transaction.
    * @return {void}
    */
-       initHeader:function(label,value,isDefault)
+       initHeader:function(label, value, isDefault)
        {
                var headerObj = (isDefault)?this._default_headers:this._http_headers;
-
-               if(headerObj[label] === undefined){
-                       headerObj[label] = value;
-               }
-               else{
-                       // Concatenate multiple values, comma-delimited,
-                       // for the same header label,
-                       headerObj[label] =  value + "," + headerObj[label];
-               }
+               headerObj[label] = value;
 
                if(isDefault){
                        this._has_default_headers = true;
@@ -912,12 +928,14 @@ YAHOO.util.Connect =
    */
        setForm:function(formId, isUpload, secureUri)
        {
+               // reset the HTML form data and state properties
                this.resetFormState();
+
                var oForm;
                if(typeof formId == 'string'){
                        // Determine if the argument is a form id or a form name.
-                       // Note form name usage is deprecated by supported
-                       // here for legacy reasons.
+                       // Note form name usage is deprecated, but supported
+                       // here for backward compatibility.
                        oForm = (document.getElementById(formId) || document.forms[formId]);
                }
                else if(typeof formId == 'object'){
@@ -938,7 +956,7 @@ YAHOO.util.Connect =
                if(isUpload){
 
                        // Create iframe in preparation for file upload.
-                       var io = this.createFrame(secureUri?secureUri:null);
+                       var io = this.createFrame((window.location.href.toLowerCase().indexOf("https") === 0 || secureUri)?true:false);
                        // Set form reference and file upload properties to true.
                        this._isFormSubmit = true;
                        this._isFileUpload = true;
@@ -955,9 +973,9 @@ YAHOO.util.Connect =
                // label-value pairs.
                for (var i=0; i<oForm.elements.length; i++){
                        oElement = oForm.elements[i];
-                       oDisabled = oForm.elements[i].disabled;
-                       oName = oForm.elements[i].name;
-                       oValue = oForm.elements[i].value;
+                       oDisabled = oElement.disabled;
+                       oName = oElement.name;
+                       oValue = oElement.value;
 
                        // Do not submit fields that are disabled or
                        // do not have a name attribute value.
@@ -1016,6 +1034,9 @@ YAHOO.util.Connect =
 
                YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');
 
+               this.initHeader('Content-Type', this._default_form_header);
+               YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.', 'info', 'Connection');
+
                return this._sFormData;
        },
 
@@ -1058,10 +1079,6 @@ YAHOO.util.Connect =
                        if(typeof secureUri == 'boolean'){
                                io.src = 'javascript:false';
                        }
-                       else if(typeof secureURI == 'string'){
-                               // Deprecated
-                               io.src = secureUri;
-                       }
                }
                else{
                        io = document.createElement('iframe');
@@ -1120,10 +1137,11 @@ YAHOO.util.Connect =
 
                // Each iframe has an id prefix of "yuiIO" followed
                // by the unique transaction id.
+               var oConn = this;
                var frameId = 'yuiIO' + o.tId;
                var uploadEncoding = 'multipart/form-data';
                var io = document.getElementById(frameId);
-               var oConn = this;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                // Track original HTML form attribute values.
                var rawFormAttributes =
@@ -1156,11 +1174,11 @@ YAHOO.util.Connect =
                this._formNode.submit();
 
                // Fire global custom event -- startEvent
-               this.startEvent.fire(o);
+               this.startEvent.fire(o, args);
 
                if(o.startEvent){
                        // Fire transaction custom event -- startEvent
-                       o.startEvent.fire(o);
+                       o.startEvent.fire(o, args);
                }
 
                // Start polling if a callback is present and the timeout
@@ -1203,11 +1221,11 @@ YAHOO.util.Connect =
                        }
 
                        // Fire global custom event -- completeEvent
-                       oConn.completeEvent.fire(o);
+                       oConn.completeEvent.fire(o, args);
 
                        if(o.completeEvent){
                                // Fire transaction custom event -- completeEvent
-                               o.completeEvent.fire(o);
+                               o.completeEvent.fire(o, args);
                        }
 
                        var obj = {};
@@ -1234,23 +1252,16 @@ YAHOO.util.Connect =
                                }
                        }
 
-                       // Fire global custom event -- completeEvent
+                       // Fire global custom event -- uploadEvent
                        oConn.uploadEvent.fire(obj);
 
                        if(o.uploadEvent){
-                               // Fire transaction custom event -- completeEvent
+                               // Fire transaction custom event -- uploadEvent
                                o.uploadEvent.fire(obj);
                        }
 
-                       if(YAHOO.util.Event){
-                               YAHOO.util.Event.removeListener(io, "load", uploadCallback);
-                       }
-                       else if(window.detachEvent){
-                               io.detachEvent('onload', uploadCallback);
-                       }
-                       else{
-                               io.removeEventListener('load', uploadCallback, false);
-                       }
+                       YAHOO.util.Event.removeListener(io, "load", uploadCallback);
+
                        setTimeout(
                                function(){
                                        document.body.removeChild(io);
@@ -1260,15 +1271,7 @@ YAHOO.util.Connect =
                };
 
                // Bind the onload handler to the iframe to detect the file upload response.
-               if(YAHOO.util.Event){
-                       YAHOO.util.Event.addListener(io, "load", uploadCallback);
-               }
-               else if(window.attachEvent){
-                       io.attachEvent('onload', uploadCallback);
-               }
-               else{
-                       io.addEventListener('load', uploadCallback, false);
-               }
+               YAHOO.util.Event.addListener(io, "load", uploadCallback);
        },
 
   /**
@@ -1284,8 +1287,10 @@ YAHOO.util.Connect =
        abort:function(o, callback, isTimeout)
        {
                var abortStatus;
+               var args = (callback && callback.argument)?callback.argument:null;
+
 
-               if(o.conn){
+               if(o && o.conn){
                        if(this.isCallInProgress(o)){
                                // Issue abort request
                                o.conn.abort();
@@ -1301,11 +1306,14 @@ YAHOO.util.Connect =
                                abortStatus = true;
                        }
                }
-               else if(o.isUpload === true){
+               else if(o && o.isUpload === true){
                        var frameId = 'yuiIO' + o.tId;
                        var io = document.getElementById(frameId);
 
                        if(io){
+                               // Remove all listeners on the iframe prior to
+                               // its destruction.
+                               YAHOO.util.Event.removeListener(io, "load");
                                // Destroy the iframe facilitating the transaction.
                                document.body.removeChild(io);
                                YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
@@ -1324,26 +1332,22 @@ YAHOO.util.Connect =
 
                if(abortStatus === true){
                        // Fire global custom event -- abortEvent
-                       this.abortEvent.fire(o);
+                       this.abortEvent.fire(o, args);
 
                        if(o.abortEvent){
                                // Fire transaction custom event -- abortEvent
-                               o.abortEvent.fire(o);
+                               o.abortEvent.fire(o, args);
                        }
 
                        this.handleTransactionResponse(o, callback, true);
                        YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
                }
-               else{
-                       YAHOO.log('Transaction ' + o.tId + ' abort call failed.  Connection object no longer exists.', 'warn', 'Connection');
-               }
 
                return abortStatus;
        },
 
   /**
-   * Public method to check if the transaction is still being processed.
-   *
+   * @description Determines if the transaction is still being processed.
    * @method isCallInProgress
    * @public
    * @static
@@ -1376,14 +1380,16 @@ YAHOO.util.Connect =
    */
        releaseObject:function(o)
        {
-               //dereference the XHR instance.
-               if(o.conn){
+               if(o && o.conn){
+                       //dereference the XHR instance.
                        o.conn = null;
+
+                       YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
+
+                       //dereference the connection object.
+                       o = null;
                }
-               YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
-               //dereference the connection object.
-               o = null;
        }
 };
 
-YAHOO.register("connection", YAHOO.util.Connect, {version: "2.3.0", build: "442"});
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.5.0", build: "895"});
index 1da8cb5d3e0209d342648329d709e01780ce0e00..e411a588ccdc743480a9ec83531d7c2068cd47be 100755 (executable)
@@ -1,130 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
-{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
-return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
-{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
-{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
-{this._use_default_xhr_header=b;},setPollingInterval:function(i)
-{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
-{var obj,http;try
-{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
-catch(e)
-{for(var i=0;i<this._msxml_progid.length;++i){try
-{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
-catch(e){}}}
-finally
-{return obj;}},getConnectionObject:function(isFileUpload)
-{var o;var tId=this._transaction_id;try
-{if(!isFileUpload){o=this.createXhrObject(tId);}
-else{o={};o.tId=tId;o.isUpload=true;}
-if(o){this._transaction_id++;}}
-catch(e){}
-finally
-{return o;}},asyncRequest:function(method,uri,callback,postData)
-{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!o){return null;}
-else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
-if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
-if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
-else{uri+="?"+this._sFormData;}}
-else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
-o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
-if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
-if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
-this.handleReadyState(o,callback);o.conn.send(postData||null);this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
-return o;}},initCustomEvents:function(o,callback)
-{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
-{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
-oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
-oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
-{if(!callback){this.releaseObject(o);return;}
-var httpStatus,responseObject;try
-{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
-else{httpStatus=13030;}}
-catch(e){httpStatus=13030;}
-if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
-else{callback.success.apply(callback.scope,[responseObject]);}}
-this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
-else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}
-break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}}
-this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
-this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
-{var obj={};var headerObj={};try
-{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
-catch(e){}
-obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
-return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
-{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
-else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
-if(callbackArg){obj.argument=callbackArg;}
-return obj;},initHeader:function(label,value,isDefault)
-{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
-else{headerObj[label]=value+","+headerObj[label];}
-if(isDefault){this._has_default_headers=true;}
-else{this._has_http_headers=true;}},setHeader:function(o)
-{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
-if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
-delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
-{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
-else if(typeof formId=='object'){oForm=formId;}
-else{return;}
-if(isUpload){var io=this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
-var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
-{switch(oElement.type)
-{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
-else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
-break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
-else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-hasSubmit=true;}
-break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
-this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
-else if(typeof secureURI=='string'){io.src=secureUri;}}
-else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
-io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
-{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
-return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);var oConn=this;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(this._formNode.encoding){this._formNode.setAttribute('encoding',uploadEncoding);}
-else{this._formNode.setAttribute('enctype',uploadEncoding);}
-if(postData){var oElements=this.appendPostData(postData);}
-this._formNode.submit();this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
-if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
-for(var prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
-else{this._formNode.removeAttribute(prop);}}}
-this.resetFormState();var uploadCallback=function()
-{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
-oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
-var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
-{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
-catch(e){}
-if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
-else{callback.upload.apply(callback.scope,[obj]);}}
-oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
-if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
-else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
-else{io.removeEventListener('load',uploadCallback,false);}
-setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
-else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
-else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
-{var abortStatus;if(o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
-abortStatus=true;}}
-else if(o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
-abortStatus=true;}}
-else{abortStatus=false;}
-if(abortStatus===true){this.abortEvent.fire(o);if(o.abortEvent){o.abortEvent.fire(o);}
-this.handleTransactionResponse(o,callback,true);}
-else{}
-return abortStatus;},isCallInProgress:function(o)
-{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
-else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
-else{return false;}},releaseObject:function(o)
-{if(o.conn){o.conn=null;}
-o=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;
+}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement("<iframe id=\""+B+"\" name=\""+B+"\" />");if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(this._formNode.encoding){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);}else{M.upload.apply(M.scope,[P]);}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.0",build:"895"});
\ No newline at end of file
index a7035ed203eaae322033168eaff188cd7e12d2c2..7506f37dd7204c8ed04fbd8d15ce6757958ecb43 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -33,9 +33,9 @@ YAHOO.util.Connect =
    * @type array
    */
        _msxml_progid:[
+               'Microsoft.XMLHTTP',
                'MSXML2.XMLHTTP.3.0',
-               'MSXML2.XMLHTTP',
-               'Microsoft.XMLHTTP'
+               'MSXML2.XMLHTTP'
                ],
 
   /**
@@ -69,10 +69,7 @@ YAHOO.util.Connect =
     _use_default_post_header:true,
 
  /**
-  * @description Determines if a default header of
-  * Content-Type of 'application/x-www-form-urlencoded'
-  * will be added to client HTTP headers sent for POST
-  * transactions.
+  * @description The default header used for POST transactions.
   * @property _default_post_header
   * @private
   * @static
@@ -80,6 +77,16 @@ YAHOO.util.Connect =
   */
     _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
 
+ /**
+  * @description The default header used for transactions involving the
+  * use of HTML forms.
+  * @property _default_form_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_form_header:'application/x-www-form-urlencoded',
+
  /**
   * @description Determines if a default header of
   * 'X-Requested-With: XMLHttpRequest'
@@ -228,7 +235,7 @@ YAHOO.util.Connect =
                                'click',
                                function(e){
                                        var obj = YAHOO.util.Event.getTarget(e);
-                                       if(obj.type == 'submit'){
+                                       if(obj.nodeName.toLowerCase() == 'input' && (obj.type && obj.type.toLowerCase() == 'submit')){
                                                YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
                                        }
                                });
@@ -328,7 +335,7 @@ YAHOO.util.Connect =
        },
 
   /**
-   * @description Member to enable or disable the default POST header.
+   * @description Member to override the default POST header.
    * @method setDefaultPostHeader
    * @public
    * @static
@@ -337,11 +344,16 @@ YAHOO.util.Connect =
    */
        setDefaultPostHeader:function(b)
        {
-               this._use_default_post_header = b;
+               if(typeof b == 'string'){
+                       this._default_post_header = b;
+               }
+               else if(typeof b == 'boolean'){
+                       this._use_default_post_header = b;
+               }
        },
 
   /**
-   * @description Member to enable or disable the default POST header.
+   * @description Member to override the default transaction header..
    * @method setDefaultXhrHeader
    * @public
    * @static
@@ -350,7 +362,12 @@ YAHOO.util.Connect =
    */
        setDefaultXhrHeader:function(b)
        {
-               this._use_default_xhr_header = b;
+               if(typeof b == 'string'){
+                       this._default_xhr_header = b;
+               }
+               else{
+                       this._use_default_xhr_header = b;
+               }
        },
 
   /**
@@ -392,7 +409,7 @@ YAHOO.util.Connect =
                        for(var i=0; i<this._msxml_progid.length; ++i){
                                try
                                {
-                                       // Instantiates XMLHttpRequest for IE and assign to http.
+                                       // Instantiates XMLHttpRequest for IE and assign to http
                                        http = new ActiveXObject(this._msxml_progid[i]);
                                        //  Object literal with conn and tId properties
                                        obj = { conn:http, tId:transactionId };
@@ -457,6 +474,7 @@ YAHOO.util.Connect =
        asyncRequest:function(method, uri, callback, postData)
        {
                var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
+               var args = (callback && callback.argument)?callback.argument:null;
 
                if(!o){
                        return null;
@@ -483,9 +501,6 @@ YAHOO.util.Connect =
                                                // and then concatenate _sFormData to the URI.
                                                uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
                                        }
-                                       else{
-                                               uri += "?" + this._sFormData;
-                                       }
                                }
                                else if(method.toUpperCase() == 'POST'){
                                        // If POST data exist in addition to the HTML form data,
@@ -494,8 +509,13 @@ YAHOO.util.Connect =
                                }
                        }
 
+                       if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
+                               // If callback.cache is defined and set to false, a
+                               // timestamp value will be added to the querystring.
+                               uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
+                       }
+
                        o.conn.open(method, uri, true);
-                       //this.processTransactionHeaders(o);
 
                        // Each transaction will automatically include a custom header of
                        // "X-Requested-With: XMLHttpRequest" to identify the request as
@@ -506,26 +526,33 @@ YAHOO.util.Connect =
                                }
                        }
 
-                       if(this._isFormSubmit || (postData && this._use_default_post_header)){
+                       //If the transaction method is POST and the POST header value is set to true
+                       //or a custom value, initalize the Content-Type header to this value.
+                       if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
                                this.initHeader('Content-Type', this._default_post_header);
-                               if(this._isFormSubmit){
-                                       this.resetFormState();
-                               }
                        }
 
+                       //Initialize all default and custom HTTP headers,
                        if(this._has_default_headers || this._has_http_headers){
                                this.setHeader(o);
                        }
 
                        this.handleReadyState(o, callback);
-                       o.conn.send(postData || null);
+                       o.conn.send(postData || '');
+
+
+                       // Reset the HTML form data and state properties as
+                       // soon as the data are submitted.
+                       if(this._isFormSubmit === true){
+                               this.resetFormState();
+                       }
 
                        // Fire global custom event -- startEvent
-                       this.startEvent.fire(o);
+                       this.startEvent.fire(o, args);
 
                        if(o.startEvent){
                                // Fire transaction custom event -- startEvent
-                               o.startEvent.fire(o);
+                               o.startEvent.fire(o, args);
                        }
 
                        return o;
@@ -574,6 +601,7 @@ YAHOO.util.Connect =
 
     {
                var oConn = this;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                if(callback && callback.timeout){
                        this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
@@ -594,11 +622,11 @@ YAHOO.util.Connect =
                                        }
 
                                        // Fire global custom event -- completeEvent
-                                       oConn.completeEvent.fire(o);
+                                       oConn.completeEvent.fire(o, args);
 
                                        if(o.completeEvent){
                                                // Fire transaction custom event -- completeEvent
-                                               o.completeEvent.fire(o);
+                                               o.completeEvent.fire(o, args);
                                        }
 
                                        oConn.handleTransactionResponse(o, callback);
@@ -621,13 +649,8 @@ YAHOO.util.Connect =
    */
     handleTransactionResponse:function(o, callback, isAbort)
     {
-               // If no valid callback is provided, then do not process any callback handling.
-               if(!callback){
-                       this.releaseObject(o);
-                       return;
-               }
-
                var httpStatus, responseObject;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                try
                {
@@ -640,15 +663,15 @@ YAHOO.util.Connect =
                }
                catch(e){
 
-                        // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                        // when the o object's status and statusText properties are
+                        // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
+                        // when the XHR object's status and statusText properties are
                         // unavailable, and a query attempt throws an exception.
                        httpStatus = 13030;
                }
 
                if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
-                       responseObject = this.createResponseObject(o, callback.argument);
-                       if(callback.success){
+                       responseObject = this.createResponseObject(o, args);
+                       if(callback && callback.success){
                                if(!callback.scope){
                                        callback.success(responseObject);
                                }
@@ -676,8 +699,8 @@ YAHOO.util.Connect =
                                case 12031:
                                case 12152: // Connection closed by server.
                                case 13030: // See above comments for variable status.
-                                       responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
-                                       if(callback.failure){
+                                       responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
+                                       if(callback && callback.failure){
                                                if(!callback.scope){
                                                        callback.failure(responseObject);
                                                }
@@ -685,10 +708,11 @@ YAHOO.util.Connect =
                                                        callback.failure.apply(callback.scope, [responseObject]);
                                                }
                                        }
+
                                        break;
                                default:
-                                       responseObject = this.createResponseObject(o, callback.argument);
-                                       if(callback.failure){
+                                       responseObject = this.createResponseObject(o, args);
+                                       if(callback && callback.failure){
                                                if(!callback.scope){
                                                        callback.failure(responseObject);
                                                }
@@ -751,7 +775,7 @@ YAHOO.util.Connect =
                obj.responseText = o.conn.responseText;
                obj.responseXML = o.conn.responseXML;
 
-               if(typeof callbackArg !== undefined){
+               if(callbackArg){
                        obj.argument = callbackArg;
                }
 
@@ -811,18 +835,10 @@ YAHOO.util.Connect =
    * automatically sent with each transaction.
    * @return {void}
    */
-       initHeader:function(label,value,isDefault)
+       initHeader:function(label, value, isDefault)
        {
                var headerObj = (isDefault)?this._default_headers:this._http_headers;
-
-               if(headerObj[label] === undefined){
-                       headerObj[label] = value;
-               }
-               else{
-                       // Concatenate multiple values, comma-delimited,
-                       // for the same header label,
-                       headerObj[label] =  value + "," + headerObj[label];
-               }
+               headerObj[label] = value;
 
                if(isDefault){
                        this._has_default_headers = true;
@@ -892,12 +908,14 @@ YAHOO.util.Connect =
    */
        setForm:function(formId, isUpload, secureUri)
        {
+               // reset the HTML form data and state properties
                this.resetFormState();
+
                var oForm;
                if(typeof formId == 'string'){
                        // Determine if the argument is a form id or a form name.
-                       // Note form name usage is deprecated by supported
-                       // here for legacy reasons.
+                       // Note form name usage is deprecated, but supported
+                       // here for backward compatibility.
                        oForm = (document.getElementById(formId) || document.forms[formId]);
                }
                else if(typeof formId == 'object'){
@@ -917,7 +935,7 @@ YAHOO.util.Connect =
                if(isUpload){
 
                        // Create iframe in preparation for file upload.
-                       var io = this.createFrame(secureUri?secureUri:null);
+                       var io = this.createFrame((window.location.href.toLowerCase().indexOf("https") === 0 || secureUri)?true:false);
                        // Set form reference and file upload properties to true.
                        this._isFormSubmit = true;
                        this._isFileUpload = true;
@@ -934,9 +952,9 @@ YAHOO.util.Connect =
                // label-value pairs.
                for (var i=0; i<oForm.elements.length; i++){
                        oElement = oForm.elements[i];
-                       oDisabled = oForm.elements[i].disabled;
-                       oName = oForm.elements[i].name;
-                       oValue = oForm.elements[i].value;
+                       oDisabled = oElement.disabled;
+                       oName = oElement.name;
+                       oValue = oElement.value;
 
                        // Do not submit fields that are disabled or
                        // do not have a name attribute value.
@@ -994,6 +1012,8 @@ YAHOO.util.Connect =
                this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
 
 
+               this.initHeader('Content-Type', this._default_form_header);
+
                return this._sFormData;
        },
 
@@ -1036,10 +1056,6 @@ YAHOO.util.Connect =
                        if(typeof secureUri == 'boolean'){
                                io.src = 'javascript:false';
                        }
-                       else if(typeof secureURI == 'string'){
-                               // Deprecated
-                               io.src = secureUri;
-                       }
                }
                else{
                        io = document.createElement('iframe');
@@ -1097,10 +1113,11 @@ YAHOO.util.Connect =
 
                // Each iframe has an id prefix of "yuiIO" followed
                // by the unique transaction id.
+               var oConn = this;
                var frameId = 'yuiIO' + o.tId;
                var uploadEncoding = 'multipart/form-data';
                var io = document.getElementById(frameId);
-               var oConn = this;
+               var args = (callback && callback.argument)?callback.argument:null;
 
                // Track original HTML form attribute values.
                var rawFormAttributes =
@@ -1133,11 +1150,11 @@ YAHOO.util.Connect =
                this._formNode.submit();
 
                // Fire global custom event -- startEvent
-               this.startEvent.fire(o);
+               this.startEvent.fire(o, args);
 
                if(o.startEvent){
                        // Fire transaction custom event -- startEvent
-                       o.startEvent.fire(o);
+                       o.startEvent.fire(o, args);
                }
 
                // Start polling if a callback is present and the timeout
@@ -1180,11 +1197,11 @@ YAHOO.util.Connect =
                        }
 
                        // Fire global custom event -- completeEvent
-                       oConn.completeEvent.fire(o);
+                       oConn.completeEvent.fire(o, args);
 
                        if(o.completeEvent){
                                // Fire transaction custom event -- completeEvent
-                               o.completeEvent.fire(o);
+                               o.completeEvent.fire(o, args);
                        }
 
                        var obj = {};
@@ -1209,23 +1226,16 @@ YAHOO.util.Connect =
                                }
                        }
 
-                       // Fire global custom event -- completeEvent
+                       // Fire global custom event -- uploadEvent
                        oConn.uploadEvent.fire(obj);
 
                        if(o.uploadEvent){
-                               // Fire transaction custom event -- completeEvent
+                               // Fire transaction custom event -- uploadEvent
                                o.uploadEvent.fire(obj);
                        }
 
-                       if(YAHOO.util.Event){
-                               YAHOO.util.Event.removeListener(io, "load", uploadCallback);
-                       }
-                       else if(window.detachEvent){
-                               io.detachEvent('onload', uploadCallback);
-                       }
-                       else{
-                               io.removeEventListener('load', uploadCallback, false);
-                       }
+                       YAHOO.util.Event.removeListener(io, "load", uploadCallback);
+
                        setTimeout(
                                function(){
                                        document.body.removeChild(io);
@@ -1234,15 +1244,7 @@ YAHOO.util.Connect =
                };
 
                // Bind the onload handler to the iframe to detect the file upload response.
-               if(YAHOO.util.Event){
-                       YAHOO.util.Event.addListener(io, "load", uploadCallback);
-               }
-               else if(window.attachEvent){
-                       io.attachEvent('onload', uploadCallback);
-               }
-               else{
-                       io.addEventListener('load', uploadCallback, false);
-               }
+               YAHOO.util.Event.addListener(io, "load", uploadCallback);
        },
 
   /**
@@ -1258,8 +1260,10 @@ YAHOO.util.Connect =
        abort:function(o, callback, isTimeout)
        {
                var abortStatus;
+               var args = (callback && callback.argument)?callback.argument:null;
+
 
-               if(o.conn){
+               if(o && o.conn){
                        if(this.isCallInProgress(o)){
                                // Issue abort request
                                o.conn.abort();
@@ -1275,11 +1279,14 @@ YAHOO.util.Connect =
                                abortStatus = true;
                        }
                }
-               else if(o.isUpload === true){
+               else if(o && o.isUpload === true){
                        var frameId = 'yuiIO' + o.tId;
                        var io = document.getElementById(frameId);
 
                        if(io){
+                               // Remove all listeners on the iframe prior to
+                               // its destruction.
+                               YAHOO.util.Event.removeListener(io, "load");
                                // Destroy the iframe facilitating the transaction.
                                document.body.removeChild(io);
 
@@ -1297,24 +1304,21 @@ YAHOO.util.Connect =
 
                if(abortStatus === true){
                        // Fire global custom event -- abortEvent
-                       this.abortEvent.fire(o);
+                       this.abortEvent.fire(o, args);
 
                        if(o.abortEvent){
                                // Fire transaction custom event -- abortEvent
-                               o.abortEvent.fire(o);
+                               o.abortEvent.fire(o, args);
                        }
 
                        this.handleTransactionResponse(o, callback, true);
                }
-               else{
-               }
 
                return abortStatus;
        },
 
   /**
-   * Public method to check if the transaction is still being processed.
-   *
+   * @description Determines if the transaction is still being processed.
    * @method isCallInProgress
    * @public
    * @static
@@ -1347,13 +1351,15 @@ YAHOO.util.Connect =
    */
        releaseObject:function(o)
        {
-               //dereference the XHR instance.
-               if(o.conn){
+               if(o && o.conn){
+                       //dereference the XHR instance.
                        o.conn = null;
+
+
+                       //dereference the connection object.
+                       o = null;
                }
-               //dereference the connection object.
-               o = null;
        }
 };
 
-YAHOO.register("connection", YAHOO.util.Connect, {version: "2.3.0", build: "442"});
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.5.0", build: "895"});
index 4cf23257e77573ca28acb8a72d4ab98cf408cd53..d760476ab85c95175766661d0b00c71f75836f75 100755 (executable)
@@ -1,5 +1,281 @@
 Container Release Notes
 
+*** version 2.5.0 ***
+
+Fixed the following bugs:
+-------------------------
+
++ We now add the text resize monitor iframe to the DOM in a timeout,
+  to help alleviate the perpetual loading indicator seen in 
+  Firefox 2.0.0.8 (Gecko 1.8.1.8) and above on Windows.
+
++ Changed the closing script tag string used in the resize monitor, to 
+  allow container-min.js, container_core-min.js content to be used inline.
+
++ Fixed problem with underlay size being too short in IE6 when setting up
+  an initially visible Dialog with buttons.
+  
++ Removed overflow:auto applied to the modal mask for all browsers other 
+  than gecko/MacOS to help avoid the "missing text cursor" Gecko bug. 
+  Overflow:auto is still applied to for Gecko/MacOS to help avoid 
+  scrollbar bleedthrough, another Gecko bug (discussed in Container's 
+  known issues section).
+  
+Added the following features:
+-----------------------------
+
++ Added a "hideaftersubmit" config property to Dialog, to allow the end
+  user to configure whether or not the Dialog should be hidden after
+  it has been submitted. By default it is set to false, to provide 
+  backwards compatibility.
+  
++ Added contextMouseOverEvent, contextMouseOutEvent and 
+  contextTriggerEvent events to Tooltip, which provide access to the 
+  context element when the user mouses over a context element, mouses 
+  out of a context element, and before a tooltip is about to be 
+  triggered (displayed) for a context element. See the API docs for
+  these events for futher details.
+  
++ Added a "disabled" config property to Tooltip, to allow the user
+  to dynamically disable a tooltip.
+  
+Changes:
+--------
+
++ Optimized constraintoviewport handling for Overlays which haven't
+  been specifically positioned, so that the constraint checks aren't
+  made before every show.
+
+*** version 2.4.0 ***
+
+Fixed the following bugs:
+-------------------------
+
++ constraintoviewport and fixedcenter now handle Overlays which are 
+  larger than the viewport. The Overlay will be positioned such that
+  it's top, left corner is in the viewport. Panel's draggable 
+  behavior now also honors constraintoviewport, if the panel is 
+  larger than the viewport.
+
++ constrainToViewport will now correctly constrain Overlays which 
+  haven't been specifically positioned (don't have an XY value set).
+
++ Overlay/OverlayManager bringToTop methods will bring Overlays to 
+  the top of the stack, even if their current zindex is the same as 
+  other Overlays on the page.
+
++ Fixed double textResizeEvents fired on gecko based browsers (e.g
+  Firefox 2.x).
+
++ Panel underlay now resizes correctly in Safari 2.x, when the 
+  content of the Panel is modified (e.g. when setBody() is called).
+  
++ Tooltip "text" configuration property is no longer overridden by
+  the "title" attribute value on the context element if both are
+  set. The "text" configuration property takes precedence 
+  (as indicated in the Tooltip documentation).
+
++ Transparent shadows no longer become opaque (black) in IE6/IE7 
+  when a Panel with ContainerEffect.FADE is hidden and then 
+  shown again. Also on IE6/IE7 transparent shadows no longer 
+  appear opaque while animation is in progress.
+
++ An empty header is no longer created for non-draggable 
+  Dialogs/SimpleDialogs which don't provide their own headers.
+  By design, an empty header is still created for draggable 
+  Dialogs/SimpleDialogs which don't provide a header, in order 
+  to provide a drag handle.
+  
++ Select boxes inside Modal Panels on IE6 are no longer hidden.
+
++ In Sam Skin, Dialog/SimpleDialog default and non-default HTML 
+  buttons (used when YUI Button is not included on the page) now 
+  have a consistent look. Previously style properties intended 
+  for default YUI Buttons, were being incorrectly applied to 
+  default HTML buttons, giving them a look inconsistent with 
+  non-default buttons.
+
+Added the following features:
+-----------------------------
+
++ Added "dragOnly" configuration property to Panel, to leverage
+  the "dragOnly" configuration property added to the DragDrop 
+  utility for 2.4.0.
+
+  When the "dragOnly" configuration property is set to true,
+  the DD instance created for the Panel will not check for drop 
+  targets on the page, improving performance during drag operations 
+  which don't require drop target interaction.
+
+  The property is set to "false" by default to maintain backwards
+  compatibility with older 2.x releases, but should be set to "true"
+  if no drop targets for the Panel exist on the page.
+
+  See the DragDrop utilities 2.4.0 README for additional information.
+
+*** version 2.3.1 ***
+
+Fixed the following bugs:
+-------------------------
+
++ To help reduce the occurrence of "Operation Aborted" errors in IE, 
+  containers which are rendered to the document's BODY element (e.g. 
+  myOverlay.render(document.body)) are now inserted before the first
+  child of the BODY element. This applies to both the container 
+  element as well as the iframe shim if enabled.
+
+  Prior to 2.3.1, these two elements were appended as the last 
+  children of the BODY element.
+
+  When rendering to any other element on the page, the behavior is 
+  unchanged and both the container and shim are appended as the last 
+  children of the element.
+
+  Upgrade Impact For Containers Rendered To Document.Body
+  -------------------------------------------------------
+  If you have an xy coordinate and non-zero z-index specified for 
+  your container there should be no negative impact.
+  
+  If you haven't specified an xy position, the fix could result
+  in a shift in your container position, depending on other elements
+  on the page.
+
+  If you haven't specified a z-index and are relying on DOM order to 
+  stack the container, you may see a change in stacking order of 
+  the container or iframe shim.
+
+  Both these changes can be resolved by setting a specific z-index
+  and position based on the layout of other elements on your page.
+  
+  If you do need to revert to 2.3.0 behavior, a configuration property
+  "appendtodocumentbody" has been added to Module, which can be set to
+  true.
+
+  The change to stacking order is discussed in detail below in 
+  relation to other z-index fixes made for 2.3.1.
+
++ Z-index is now applied correctly for Overlay/Panel elements, their 
+  corresponding iframe shims, and modal masks (for Panels).
+  This fix applies to both the default z-index based on the CSS 
+  for the Overlay/Panel and specific z-indices set using the 
+  "zindex" configuration parameter.
+
+  Default z-index values are:
+
+     Overlay/Panel element: 2
+     Iframe shim: 1
+     Mask: 1
+  
+  The iframe shim and modal mask z-index will always be set to one less
+  than the Overlay/Panel z-index.
+
+  PLEASE NOTE:
+  
+  As a result of the fix to reduce "Operation Aborted" errors,
+  setting a z-index of 1 on an Overlay/Panel rendered to document.body 
+  will result in its iframe shim and modal mask (which will have a 
+  z-index of 0) being rendered behind other positioned elements in the 
+  document.
+
+  This is because the Overlay/Panel, iframe shim and mask are 
+  inserted as the first children of the BODY element and hence any 
+  positioned elements with a z-index of 0 or auto which occur after 
+  them in the document will be stacked on top of them as per W3C spec.
+
+  If you need to keep the Overlay/Panel above positioned elements on your 
+  page, it's z-index needs to be set to 2 or more.
+
+  In general it's advisable to manage the z-index of positioned elements 
+  on your page deliberately by setting a z-index, to avoid having their 
+  order in the document define their stacking order.
+  
+  For detailed stacking order information see:
+  - http://www.w3.org/TR/CSS21/visuren.html#layers
+  - http://developer.mozilla.org/en/docs/Understanding_CSS_z-index:The_st
+    acking_context
+
++ Module now correctly recognizes standard module header, body and footer 
+  DIVs when they have extra CSS classes applied in addition to the 
+  required hd, bd, and ft classes. e.g. <div class="bd news"></div>.
+
++ An empty header (set to $#160;) is created for draggable Panels which
+  don't have a header specified, to provide a drag handle. This fixes a
+  regression introduced in 2.3.0 so that 2.2.2 behavior is restored.
+  
++ Dialog.destroy has been fixed to account for Dialog form elements which 
+  may not be direct children of the standard module body ("bd") element.
+
++ SimpleDialog.destory now completes successfully if the optional 
+  button-beta.js dependancy is not included on the page.
+  
++ Destroying Overlays registered with the OverlayManager no longer results in a 
+  JavaScript error. The Overlay is destroyed and removed from the 
+  OverlayManager correctly.
+  
++ Submitting a Dialog form directly (e.g. using a "submit" button, hitting
+  enter on a single text field form) no longer throws a JavaScript error.
+
+Known Issues
+------------
+
++ IE: Borders for tables with border-collapse:collapse remain visible
+  -------------------------------------------------------------------
+  If an Overlay, or any of its subclasses, contains a table with its
+  border-collapse CSS property set to "collapse" instead of the default 
+  value of "separate", the borders of the table will remain visible, when 
+  the Overlay is configured to be hidden initially. The table contents 
+  will be hidden correctly.
+  
+  This is due to an IE bug, reproducible by the basic test case below:
+  
+     <style type="text/css">
+        .box  {visibility:hidden;}
+        td    {border:1px solid red;}
+        table {border-collapse:collapse;}
+     </style>
+
+     <div class="box">
+        <table>
+           <tr>
+               <td>1</td>
+               <td>2</td>
+           </tr>
+        </table>
+     </div>
+
+  Setting the DIV elements "style.visibility" JS property fixes the 
+  problem with the simple test case. NOTE: Setting the style in markup 
+  using the DIV's style attribute does not.
+
+  Extending this to Container, the simplest workaround if you're not 
+  using effects, is to use Overlay's hide() method to setup visibility. 
+  This will set the Overlay's element "style.visibility" property. e.g.
+
+      // Start visible, then hide.
+      var ovr = YAHOO.widget.Overlay("ovr");
+      ovr.render();
+      ovr.hide();
+      
+  You can also apply this workaround if you want to use effects by 
+  setting the effect up after you hide. e.g.
+  
+      // Start visible, but don't apply effects, 
+      // to avoid initial animation.
+      var ovr = YAHOO.widget.Overlay("ovr");
+      ovr.render();
+      ovr.hide();
+      ovr.cfg.setProperty("effect", {effect:.....});
+
+  If initial flicker is a problem with the above, you can set the 
+  visibility directly on the Overlay element after rendering e.g.
+
+      var ovr = YAHOO.widget.Overlay("ovr", {visible:false});
+      ovr.render();
+      YAHOO.util.Dom.setStyle(ovr.element, "visibility", "hidden");
+
+  but if possible one of the previous methods should be used since 
+  they use the public API as opposed to manipulating the DOM directly.
+
 *** version 2.3.0 ***
 
 Fixed the following bugs:
@@ -495,204 +771,204 @@ Known Issues
 
 *** version 2.2.0 ***
 
-       Module
-          - Removed hardcoded file paths for image roots.  Affected properties
-          include:
-               - YAHOO.widget.Module.IMG_ROOT
-               - YAHOO.widget.Module.IMG_ROOT_SSL
-          - HTML elements, created via createElement, now use lowercase.
-
-       Panel
-          - To shield against CSS class collision, the following references now
-          have a "yui-" prefix:
-             - YAHOO.widget.Panel.CSS_PANEL now references CSS class "yui-
-             panel".
-             - YAHOO.widget.Panel.CSS_PANEL_CONTAINER now references CSS class
-             "yui-panel-container".
-          -  Close button can now be configured via the CSS class "container-
-          close".
-          - HTML elements, created via createElement, now use lowercase.
-
-       Dialog
-          - To shield against CSS class collision, the following references now
-          have a "yui-" prefix:
-               - YAHOO.widget.Dialog.CSS_DIALOG now references CSS class "yui-
-               dialog".
-          - HTML elements, created via createElement, now use lowercase.
-
-       SimpleDialog
-          - Removed hardcoded file paths for SimpleDialog icons, which are now
-          configurable in CSS:
-             - YAHOO.widget.SimpleDialog.ICON_BLOCK now references CSS class
-             "blckicon".
-             - YAHOO.widget.SimpleDialog.ICON_ALARM now references CSS class
-             "alrticon".
-             - YAHOO.widget.SimpleDialog.ICON_HELP now references CSS class
-             "hlpicon".
-             - YAHOO.widget.SimpleDialog.ICON_INFO now references CSS class
-             "infoicon".
-             - YAHOO.widget.SimpleDialog.ICON_WARN now references CSS class
-             "warnicon".
-             - YAHOO.widget.SimpleDialog.ICON_TIP now references CSS class
-             "tipicon".
-          - To provide shield against CSS class collision the following
-          references now have a "yui-" prefix:
-             - YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG now references CSS
-             class "yui-simple-dialog";
-
-       Tooltip
-          - To shield against CSS class collision, the following references now
-          have a "yui-" prefix:
-             - YAHOO.widget.Tooltip.CSS_TOOLTIP now references CSS class "yui-
-             tipicon" "yui-tt";
+    Module
+       - Removed hardcoded file paths for image roots.  Affected properties
+       include:
+        - YAHOO.widget.Module.IMG_ROOT
+        - YAHOO.widget.Module.IMG_ROOT_SSL
+       - HTML elements, created via createElement, now use lowercase.
+
+    Panel
+       - To shield against CSS class collision, the following references now
+       have a "yui-" prefix:
+          - YAHOO.widget.Panel.CSS_PANEL now references CSS class "yui-
+          panel".
+          - YAHOO.widget.Panel.CSS_PANEL_CONTAINER now references CSS class
+          "yui-panel-container".
+       -  Close button can now be configured via the CSS class "container-
+       close".
+       - HTML elements, created via createElement, now use lowercase.
+
+    Dialog
+       - To shield against CSS class collision, the following references now
+       have a "yui-" prefix:
+        - YAHOO.widget.Dialog.CSS_DIALOG now references CSS class "yui-
+        dialog".
+       - HTML elements, created via createElement, now use lowercase.
+
+    SimpleDialog
+       - Removed hardcoded file paths for SimpleDialog icons, which are now
+       configurable in CSS:
+          - YAHOO.widget.SimpleDialog.ICON_BLOCK now references CSS class
+          "blckicon".
+          - YAHOO.widget.SimpleDialog.ICON_ALARM now references CSS class
+          "alrticon".
+          - YAHOO.widget.SimpleDialog.ICON_HELP now references CSS class
+          "hlpicon".
+          - YAHOO.widget.SimpleDialog.ICON_INFO now references CSS class
+          "infoicon".
+          - YAHOO.widget.SimpleDialog.ICON_WARN now references CSS class
+          "warnicon".
+          - YAHOO.widget.SimpleDialog.ICON_TIP now references CSS class
+          "tipicon".
+       - To provide shield against CSS class collision the following
+       references now have a "yui-" prefix:
+          - YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG now references CSS
+          class "yui-simple-dialog";
+
+    Tooltip
+       - To shield against CSS class collision, the following references now
+       have a "yui-" prefix:
+          - YAHOO.widget.Tooltip.CSS_TOOLTIP now references CSS class "yui-
+          tipicon" "yui-tt";
 
 *** version 0.12.2 ***
 
-       Module
-          - Corrected issue where listener was not properly removed from resize
-          monitor element when "monitorresize" is disabled
+    Module
+       - Corrected issue where listener was not properly removed from resize
+       monitor element when "monitorresize" is disabled
 
-       Panel
-          - Fixed issue that would sometimes prevent select lists from working
-          properly in Firefox
+    Panel
+       - Fixed issue that would sometimes prevent select lists from working
+       properly in Firefox
 
-       Dialog
-          - Fixed error that would occur when trying to create a Dialog where
-          the first form element is set to "disabled"
-          - Modified "close" property handler for Dialog/SimpleDialog to call
-          "cancel" instead of "hide"
+    Dialog
+       - Fixed error that would occur when trying to create a Dialog where
+       the first form element is set to "disabled"
+       - Modified "close" property handler for Dialog/SimpleDialog to call
+       "cancel" instead of "hide"
 
 *** version 0.12.1 ***
 
-       All Classes
-          - "monitorresize" property now functions in situations where
-          document.domain has been modified.
-          - YAHOO.widget.Module.textResizeEvent now fires when the font size is
-          changed (except for Opera, which uses "zoom" functionality that
-          prevents this)
-          - Event listeners attached to container elements are now properly
-          purged on destroy using YAHOO.util.Event.purgeElement
-
-       Panel
-          - Fixed issue where focus events were broken on the page when a modal
-          Panel was created
-
-       Dialog
-          - Fixed bug where hitting "enter" on a Dialog was forcing the default
-          submission behavior of the form's action to execute
-          - Dialog no longer tries to give focus to hidden form elements.
-          - Replaced &nbsp; references in Panel with &#160; for XHTML
-          compliance.
-          - Fixed issue that was preventing Safari from successfully using the
-          getData() function
+    All Classes
+       - "monitorresize" property now functions in situations where
+       document.domain has been modified.
+       - YAHOO.widget.Module.textResizeEvent now fires when the font size is
+       changed (except for Opera, which uses "zoom" functionality that
+       prevents this)
+       - Event listeners attached to container elements are now properly
+       purged on destroy using YAHOO.util.Event.purgeElement
+
+    Panel
+       - Fixed issue where focus events were broken on the page when a modal
+       Panel was created
+
+    Dialog
+       - Fixed bug where hitting "enter" on a Dialog was forcing the default
+       submission behavior of the form's action to execute
+       - Dialog no longer tries to give focus to hidden form elements.
+       - Replaced &nbsp; references in Panel with &#160; for XHTML
+       compliance.
+       - Fixed issue that was preventing Safari from successfully using the
+       getData() function
 
 *** version 0.12 ***
 
-       All Classes
-          - New documentation format implemented, and removed unnecessary
-          prototype null references previously used for generating
-          documentation
-
-       Config
-          - Added 'undefined' check when reading initial properties for
-          .reset()
-          - Fixed Firefox warning on .resetProperty()
-          - Fixed issue preventing resetProperty() from resetting values
-          correctly
-
-       Module
-          - Removed unused "childNodesInDom" property
-
-       Overlay
-          - Converted center() to use Dom utility
-          - Fixed configVisible() to properly detect actual visible/hidden
-          status in Internet Explorer, which reports "inherit" for all elements
-          by default.
-          - Updated onDomResize to properly reapply "context" property
-          - Unified scroll/resize handlers so that they fire properly (when the
-          event has completed) as opposed to constantly (as seen in Mozilla-
-          based browsers)
-
-       Panel
-          - Modified modality mask to show before Panel is shown (prior to any
-          animation)
-          - Modified buildWrapper to eliminate cloning of the initial markup
-          module, which fixes issues with select options not maintaining their
-          default selections in IE
-          - Modality mask is now z-indexed properly so that the mask z-index is
-          always one less than the Panel z-index
-
-       Dialog
-          - Fixed Connection to get "action" attribute using getAttribute, to
-          allow for form fields named "action"
-          - Added support for "GET" by retrieving the form "method" rather than
-          always defaulting to "POST"
-
-       KeyListener
-          - Fixed to work properly with Safari 2.0 by matching against keyCode
-          or charCode
+    All Classes
+       - New documentation format implemented, and removed unnecessary
+       prototype null references previously used for generating
+       documentation
+
+    Config
+       - Added 'undefined' check when reading initial properties for
+       .reset()
+       - Fixed Firefox warning on .resetProperty()
+       - Fixed issue preventing resetProperty() from resetting values
+       correctly
+
+    Module
+       - Removed unused "childNodesInDom" property
+
+    Overlay
+       - Converted center() to use Dom utility
+       - Fixed configVisible() to properly detect actual visible/hidden
+       status in Internet Explorer, which reports "inherit" for all elements
+       by default.
+       - Updated onDomResize to properly reapply "context" property
+       - Unified scroll/resize handlers so that they fire properly (when the
+       event has completed) as opposed to constantly (as seen in Mozilla-
+       based browsers)
+
+    Panel
+       - Modified modality mask to show before Panel is shown (prior to any
+       animation)
+       - Modified buildWrapper to eliminate cloning of the initial markup
+       module, which fixes issues with select options not maintaining their
+       default selections in IE
+       - Modality mask is now z-indexed properly so that the mask z-index is
+       always one less than the Panel z-index
+
+    Dialog
+       - Fixed Connection to get "action" attribute using getAttribute, to
+       allow for form fields named "action"
+       - Added support for "GET" by retrieving the form "method" rather than
+       always defaulting to "POST"
+
+    KeyListener
+       - Fixed to work properly with Safari 2.0 by matching against keyCode
+       or charCode
 
 *** version 0.11.4 ***
 
-       - Panel: Modality mask is now properly removed from DOM on Panel
-       destroy.
+    - Panel: Modality mask is now properly removed from DOM on Panel
+    destroy.
 
 *** version 0.11.3 ***
 
-       - Module: Fixed SSL warning issue in IE
-       - Overlay: Fixed memory leak related to iframe shim in IE
-       - Panel: No focusable elements under the mask can now be tabbed to
-       - Panel: Set Panel container overflow to hidden to fix scrolling issue
-       in Opera 9
+    - Module: Fixed SSL warning issue in IE
+    - Overlay: Fixed memory leak related to iframe shim in IE
+    - Panel: No focusable elements under the mask can now be tabbed to
+    - Panel: Set Panel container overflow to hidden to fix scrolling issue
+    in Opera 9
 
 *** version 0.11.2 ***
 
-       - All: JsLint optimization
-       - Overlay: Fixed SSL issues with monitorresize property
-       - OverlayManager: Fixed z-index incrementing issues
-       - Dialog: Form elements called "name" will now function properly
-       - Dialog: Removed unnecessary scope:this reference
+    - All: JsLint optimization
+    - Overlay: Fixed SSL issues with monitorresize property
+    - OverlayManager: Fixed z-index incrementing issues
+    - Dialog: Form elements called "name" will now function properly
+    - Dialog: Removed unnecessary scope:this reference
 
 *** version 0.11.1 ***
 
-       - Tooltip: Removed incorrect logger statement
-       - Dialog: Corrected logic that was causing browser lockup in IE for
-       SimpleDialog
-       - Dialog: Fixed "firstButtom" typo
+    - Tooltip: Removed incorrect logger statement
+    - Dialog: Corrected logic that was causing browser lockup in IE for
+    SimpleDialog
+    - Dialog: Fixed "firstButtom" typo
 
 *** version 0.11.0 ***
 
-       - toString function added to all classes for easy logging
-       - YAHOO.extend is now being used for inheritance on all container
-       classes
-       - Module: monitorresize feature now works on all browsers
-       - Module: Fixed bug with image root and isSecure
-       - Overlay: Fixed bugs related to IFRAME shim positioning
-       - Overlay: center() now works in quirks mode
-       - Overlay: Overlay now has a custom destroy() method that also removes
-       the IFRAME shim
-       - OverlayManager: Fixed bug in the prototype that was preventing
-       multiple Managers on one page
-       - OverlayManager: focusEvent now fires at all appropriate times
-       - Tooltip: context can now be specified as an array, so Tooltips can be
-       reused across multiple context elements
-       - Tooltip: preventoverlap now functions properly for large context
-       elements (i.e, images)
-       - Tooltip: fixed bugs regarding setTimeout
-       - Tooltip: added mousemove event to allow for more accurate Tooltip
-       positioning
-       - Panel: added dragEvent for monitoring all event handlers for drag and
-       drop
-       - Panel: modality mask is now resized on scroll
-       - Panel: KeyListeners are now properly destroyed when the Panel is
-       destroyed
-       - Panel: Header is now sized properly in quirks mode
-       - Dialog: Blinking cursor issue is fixed for Firefox
-       - Dialog: callback object for Connection is now public (this.callback)
-       - Dialog: onsuccess/onfailure properties removed (as a result of the
-       public callback object)
-       - Dialog: Dialog is now invisible by default
-       - Dialog: Buttons are now properly cleaned up on destroy
+    - toString function added to all classes for easy logging
+    - YAHOO.extend is now being used for inheritance on all container
+    classes
+    - Module: monitorresize feature now works on all browsers
+    - Module: Fixed bug with image root and isSecure
+    - Overlay: Fixed bugs related to IFRAME shim positioning
+    - Overlay: center() now works in quirks mode
+    - Overlay: Overlay now has a custom destroy() method that also removes
+    the IFRAME shim
+    - OverlayManager: Fixed bug in the prototype that was preventing
+    multiple Managers on one page
+    - OverlayManager: focusEvent now fires at all appropriate times
+    - Tooltip: context can now be specified as an array, so Tooltips can be
+    reused across multiple context elements
+    - Tooltip: preventoverlap now functions properly for large context
+    elements (i.e, images)
+    - Tooltip: fixed bugs regarding setTimeout
+    - Tooltip: added mousemove event to allow for more accurate Tooltip
+    positioning
+    - Panel: added dragEvent for monitoring all event handlers for drag and
+    drop
+    - Panel: modality mask is now resized on scroll
+    - Panel: KeyListeners are now properly destroyed when the Panel is
+    destroyed
+    - Panel: Header is now sized properly in quirks mode
+    - Dialog: Blinking cursor issue is fixed for Firefox
+    - Dialog: callback object for Connection is now public (this.callback)
+    - Dialog: onsuccess/onfailure properties removed (as a result of the
+    public callback object)
+    - Dialog: Dialog is now invisible by default
+    - Dialog: Buttons are now properly cleaned up on destroy
 
 *** version 0.10.0 ***
 
index 01cd7e58b0aee830a435e5b83e062d05444218e6..de70bddf82bc3887c245071d90cfa716ae75dfba 100755 (executable)
@@ -1,60 +1,39 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-overlay,
 .yui-panel-container {
-
     visibility: hidden;
-       position: absolute;
-       z-index: 1;
-
+    position: absolute;
+    z-index: 2;
 }
 
-yui-panel-container form {
-
-       margin: 0;
-
-}
-
-.masked .yui-panel-container {
-
-    /*
-        Default to a z-index 1 higher than default if the Panel is modal
-        to make sure the panel is above its modality mask.
-    */
-
-   z-index: 2;
-
+.yui-panel-container form {
+    margin: 0;
 }
 
 .mask {
-
-    /*
-        Default to a z-index of 1 less than the default defined 
-        by ".masked .yui-panel-container"
-    */
-
-    z-index: 1; 
+    z-index: 1;
     display: none;
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
+}
 
+.mask.block-scrollbars {
     /*
         Application of "overflow:auto" prevents Mac scrollbars from bleeding
-        through the modality mask in Gecko.
+        through the modality mask in Gecko. The block-scollbars class is only 
+        added for Gecko on MacOS
     */
-
     overflow: auto;
-
 }
 
-
 /* 
     PLEASE NOTE:
 
@@ -62,28 +41,26 @@ yui-panel-container form {
        the modality mask in IE 6. 
 
     2) ".drag select" is used to hide <SELECT> elements when dragging a 
-       Panel in IE 6. 
+       Panel in IE 6.  This is necessary to prevent some redraw problems with 
+       the <SELECT> elements when a Panel instance is dragged.
     
-    3) "hide-select select" is appended to an Overlay instance's root HTML 
-       element when it is being annimated by YAHOO.widget.ContainerEffect 
+    3) ".hide-select select" is appended to an Overlay instance's root HTML 
+       element when it is being annimated by YAHOO.widget.ContainerEffect.  
+       This is necessary because <SELECT> elements don't inherit their parent
+       element's opacity in IE 6.
 
 */
 
-.masked select, 
-.drag select, 
+.masked select,
+.drag select,
 .hide-select select {
-
-       _visibility: hidden;   
-
+    _visibility: hidden;
 }
 
 .yui-panel-container select {
-
-       _visibility: inherit;
-
+    _visibility: inherit;
 }
 
-
 /*
 
 There are two known issues with YAHOO.widget.Overlay (and its subclasses) that 
@@ -129,27 +106,21 @@ PLEASE NOTE:
 .hide-scrollbars,
 .hide-scrollbars * {
 
-       overflow: hidden;
+    overflow: hidden;
 
 }
 
 .hide-scrollbars select {
-
-       display: none;
-
+    display: none;
 }
 
 .show-scrollbars {
-
     overflow: auto;
-
 }
 
 .yui-panel-container.show-scrollbars,
 .yui-tt.show-scrollbars {
-
     overflow: visible;
-
 }
 
 .yui-panel-container.show-scrollbars .underlay,
@@ -159,6 +130,19 @@ PLEASE NOTE:
 
 }
 
+/* 
+   Workaround for Safari 2.x - the yui-force-redraw class is applied, and then removed when
+   the Panel's content changes, to force Safari 2.x to redraw the underlay.
+   We attempt to choose a CSS property which has no visual impact when added,
+   removed.
+*/
+.yui-panel-container.shadow .underlay.yui-force-redraw {
+    padding-bottom: 1px;
+}
+
+.yui-effect-fade .underlay {
+    display:none;
+}
 
 /*
     PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended 
index 711f0f4a000ceff30b9b9f9c456f3281be9f2be5..b38b6857655927b90e5ab342ffcc23022b0115d3 100755 (executable)
@@ -1,37 +1,26 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-overlay,
 .yui-panel-container {
     visibility:hidden;
-       position:absolute;
-       z-index: 1;
-}
-
-.masked .yui-panel-container {
-
-    /*
-        Default to a z-index 1 higher than default if the Panel is modal
-        to make sure the panel is above its modality mask.
-    */
-
-   z-index: 2;
-
+    position:absolute;
+    z-index: 2;
 }
 
 .yui-tt {
-       visibility:hidden;
-       position:absolute;
-       color:#333;
-       background-color:#FDFFB4;
-       font-family:arial,helvetica,verdana,sans-serif;
-       padding:2px;
-       border:1px solid #FCC90D;
-       font:100% sans-serif;
-       width:auto;
+    visibility:hidden;
+    position:absolute;
+    color:#333;
+    background-color:#FDFFB4;
+    font-family:arial,helvetica,verdana,sans-serif;
+    padding:2px;
+    border:1px solid #FCC90D;
+    font:100% sans-serif;
+    width:auto;
 }
 
 /*
@@ -44,33 +33,26 @@ version: 2.3.0
 */
 
 .yui-tt-shadow {
-
     display: none;
-
 }
 
 * html body.masked select {
-       visibility:hidden;
+    visibility:hidden;
 }
 
 * html div.yui-panel-container select {
-       visibility:inherit;
+    visibility:inherit;
 }
 
 * html div.drag select {
-       visibility:hidden;
+    visibility:hidden;
 }
 
 * html div.hide-select select {
-       visibility:hidden;
+    visibility:hidden;
 }
 
 .mask {
-    /*
-        Default to a z-index of 1 less than the default defined 
-        by ".masked .yui-panel-container"
-    */
-
     z-index: 1; 
     display:none;
     position:absolute;
@@ -127,13 +109,13 @@ PLEASE NOTE:
 .hide-scrollbars,
 .hide-scrollbars * {
 
-       overflow: hidden;
+    overflow: hidden;
 
 }
 
 .hide-scrollbars select {
 
-       display: none;
+    display: none;
 
 }
 
@@ -174,8 +156,8 @@ PLEASE NOTE:
 
 .yui-panel-container.matte {
 
-       padding: 3px;
-       background-color: #fff;
+    padding: 3px;
+    background-color: #fff;
 
 }
 
@@ -191,132 +173,146 @@ PLEASE NOTE:
 
 }
 
+/* 
+   Workaround for Safari 2.x - the yui-force-redraw class is applied, and then removed when
+   the Panel's content changes, to force Safari 2.x to redraw the underlay.
+   We attempt to choose a CSS property which has no visual impact when added,
+   removed, but still causes Safari to redraw
+*/
+.yui-panel-container.shadow .underlay.yui-force-redraw {
+    padding-bottom: 1px;
+}
+
+.yui-effect-fade .underlay {
+    display:none;
+}
+
 .yui-panel {
-       visibility:hidden;
-       border-collapse:separate;
-       position:relative;
-       left:0;
-       top:0;
-       font:1em Arial;
-       background-color:#FFF;
-       border:1px solid #000;
-       z-index:1;
-       overflow:hidden;
+    visibility:hidden;
+    border-collapse:separate;
+    position:relative;
+    left:0;
+    top:0;
+    font:1em Arial;
+    background-color:#FFF;
+    border:1px solid #000;
+    z-index:1;
+    overflow:hidden;
 }
 
 .yui-panel .hd {
-       background-color:#3d77cb;
-       color:#FFF;
-       font-size:100%;
-       line-height:100%;
-       border:1px solid #FFF;
-       border-bottom:1px solid #000;
-       font-weight:bold;
-       padding:4px;
+    background-color:#3d77cb;
+    color:#FFF;
+    font-size:100%;
+    line-height:100%;
+    border:1px solid #FFF;
+    border-bottom:1px solid #000;
+    font-weight:bold;
+    padding:4px;
     white-space:nowrap;
 }
 
 .yui-panel .bd {
-       overflow:hidden;
-       padding:4px;
+    overflow:hidden;
+    padding:4px;
 }
 
 .yui-panel .bd p {
-       margin:0 0 1em;
+    margin:0 0 1em;
 }
 
 .yui-panel .container-close {
-       position:absolute;
-       top:5px;
-       right:4px;
-       z-index:6;
-       height:12px;
-       width:12px;
-       margin:0px;
-       padding:0px;
-       background:url(close12_1.gif) no-repeat;
-       cursor:pointer;
-       visibility:inherit;
+    position:absolute;
+    top:5px;
+    right:4px;
+    z-index:6;
+    height:12px;
+    width:12px;
+    margin:0px;
+    padding:0px;
+    background:url(close12_1.gif) no-repeat;
+    cursor:pointer;
+    visibility:inherit;
 }
 
 .yui-panel .ft {
-       padding:4px;
-       overflow:hidden;
+    padding:4px;
+    overflow:hidden;
 }
 
 .yui-simple-dialog .bd .yui-icon {
-       background-repeat:no-repeat;
-       width:16px;
-       height:16px;
-       margin-right:10px;
-       float:left;
+    background-repeat:no-repeat;
+    width:16px;
+    height:16px;
+    margin-right:10px;
+    float:left;
 }
 
 .yui-simple-dialog .bd span.blckicon {
-       background: url("blck16_1.gif") no-repeat;
+    background: url("blck16_1.gif") no-repeat;
 }
 
 .yui-simple-dialog .bd span.alrticon {
-       background: url("alrt16_1.gif") no-repeat;
+    background: url("alrt16_1.gif") no-repeat;
 }
 
 .yui-simple-dialog .bd span.hlpicon {
-       background: url("hlp16_1.gif") no-repeat;
+    background: url("hlp16_1.gif") no-repeat;
 }
 
 .yui-simple-dialog .bd span.infoicon {
-       background: url("info16_1.gif") no-repeat;
+    background: url("info16_1.gif") no-repeat;
 }
 
 .yui-simple-dialog .bd span.warnicon {
-       background: url("warn16_1.gif") no-repeat;
+    background: url("warn16_1.gif") no-repeat;
 }
 
 .yui-simple-dialog .bd span.tipicon {
-       background: url("tip16_1.gif") no-repeat;
+    background: url("tip16_1.gif") no-repeat;
 }
 
 .yui-dialog .ft, 
 .yui-simple-dialog .ft {
-       padding-bottom:5px;
-       padding-right:5px;
-       text-align:right;
+    padding-bottom:5px;
+    padding-right:5px;
+    text-align:right;
 }
 
 .yui-dialog form, 
 .yui-simple-dialog form {
-       margin:0;
+    margin:0;
 }
 
 .button-group button {
-       font:100 76% verdana;
-       text-decoration:none;
-       background-color: #E4E4E4;
-       color: #333;
-       cursor: hand;
-       vertical-align: middle;
-       border: 2px solid #797979;
-       border-top-color:#FFF;
-       border-left-color:#FFF;
-       margin:2px;
-       padding:2px;
+    font:100 76% verdana;
+    text-decoration:none;
+    background-color: #E4E4E4;
+    color: #333;
+    cursor: hand;
+    vertical-align: middle;
+    border: 2px solid #797979;
+    border-top-color:#FFF;
+    border-left-color:#FFF;
+    margin:2px;
+    padding:2px;
 }
 
 .button-group button.default {
-       font-weight:bold;
+    font-weight:bold;
 }
 
 .button-group button:hover, 
 .button-group button.hover {
-       border:2px solid #90A029;
-       background-color:#EBF09E;
-       border-top-color:#FFF;
-       border-left-color:#FFF;
+    border:2px solid #90A029;
+    background-color:#EBF09E;
+    border-top-color:#FFF;
+    border-left-color:#FFF;
 }
 
 .button-group button:active {
-       border:2px solid #E4E4E4;
-       background-color:#BBB;
-       border-top-color:#333;
-       border-left-color:#333;
+    border:2px solid #E4E4E4;
+    background-color:#BBB;
+    border-top-color:#333;
+    border-left-color:#333;
 }
\ No newline at end of file
index b1721ae53660a8aa78db20ff801386a9f68d164e..dfca1db8856449f404f67f2c05c557f548febe71 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* Panel modality mask styles */
 
@@ -113,6 +113,7 @@ version: 2.3.0
     width: 25px;
     height: 15px;
     background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;
+    cursor:pointer;
 
 }
 
@@ -189,29 +190,25 @@ version: 2.3.0
 
 }
 
+/* Dialog default button style */
+.yui-skin-sam .yui-dialog .ft button.default {
+    font-weight:bold;
+}
 
-/* Dialog default button styles */
-
-.yui-skin-sam .yui-dialog .ft .default {
-
+/* Dialog default YUI Button style */
+.yui-skin-sam .yui-dialog .ft span.default {
     border-color: #304369;
     background-position: 0 -1400px;
-
 }
 
-.yui-skin-sam .yui-dialog .ft .default .first-child {
-
+.yui-skin-sam .yui-dialog .ft span.default .first-child {
     border-color: #304369;
-
 }
 
-.yui-skin-sam .yui-dialog .ft .default button {
-
+.yui-skin-sam .yui-dialog .ft span.default button {
     color: #fff;
-
 }
 
-
 /* SimpleDialog icon styles */
 
 .yui-skin-sam .yui-simple-dialog .bd .yui-icon {
@@ -285,18 +282,16 @@ version: 2.3.0
 }
 
 .yui-skin-sam .yui-tt-shadow {
-
     top: 2px;
     right: -3px;
     left: -3px;
     bottom: -3px;
     background-color: #000;
-
 }
 
 .yui-skin-sam .yui-tt-shadow-visible {
 
     opacity: .12;
-    *filter: alpha(opacity=12);  /* For IE */    
+    *filter: alpha(opacity=12);  /* For IE */
 
 }
\ No newline at end of file
index 7ce451c5b43eaa5bb68c3dbc5b42754d22f00589..0a1ae666ece30fd315f6488758788654a2cfab91 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay{display:none;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
index 97b029927731bdd39d04ab5872b0a218f1515756..59a61b5652e899e07fbd34172e94d77134c59754 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,26 +18,20 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-            YAHOO.log("No owner specified for Config object", "error"); 
-    
         }
-    
+
+        if (!owner) {  YAHOO.log("No owner specified for Config object", "error", "Config"); }
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -157,7 +151,7 @@ version: 2.3.0
         * @param {value} Object The value of the correct type for the property
         */ 
         fireEvent: function ( key, value ) {
-            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config");
             var property = this.config[key];
         
             if (property && property.event) {
@@ -174,7 +168,7 @@ version: 2.3.0
         */
         addProperty: function ( key, propertyObject ) {
             key = key.toLowerCase();
-            YAHOO.log("Added property: " + key, "info");
+            YAHOO.log("Added property: " + key, "info", "Config");
         
             this.config[key] = propertyObject;
         
@@ -279,7 +273,7 @@ version: 2.3.0
             var property;
         
             key = key.toLowerCase();
-            YAHOO.log("setProperty: " + key + "=" + value, "info");
+            YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
         
             if (this.queueInProgress && ! silent) {
                 // Currently running through a queue... 
@@ -318,7 +312,7 @@ version: 2.3.0
         queueProperty: function (key, value) {
         
             key = key.toLowerCase();
-            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+            YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
         
             var property = this.config[key],
                 foundDuplicate = false,
@@ -358,7 +352,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -386,38 +380,38 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-        
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config");
+
                 return true;
             } else {
                 return false;
@@ -466,37 +460,23 @@ version: 2.3.0
         applyConfig: function (userConfig, init) {
         
             var sKey,
-                oValue,
                 oConfig;
 
             if (init) {
-
                 oConfig = {};
-
                 for (sKey in userConfig) {
-                
                     if (Lang.hasOwnProperty(userConfig, sKey)) {
-
                         oConfig[sKey.toLowerCase()] = userConfig[sKey];
-
                     }
-                
                 }
-
                 this.initialConfig = oConfig;
-
             }
 
             for (sKey in userConfig) {
-            
                 if (Lang.hasOwnProperty(userConfig, sKey)) {
-            
                     this.queueProperty(sKey, userConfig[sKey]);
-                
                 }
-
             }
-
         },
         
         /**
@@ -563,19 +543,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -695,31 +668,24 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -752,27 +718,20 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Module = function (el, userConfig) {
-    
         if (el) {
-    
             this.init(el, userConfig);
-    
         } else {
-    
             YAHOO.log("No element or element ID specified" + 
                 " for Module instantiation", "error");
-    
         }
-    
     };
 
-
     var Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
-        
+
         m_oModuleTemplate,
         m_oHeaderTemplate,
         m_oBodyTemplate,
@@ -824,14 +783,17 @@ version: 2.3.0
                 suppressEvent: true, 
                 supercedes: ["visible"] 
             },
-        
+
             "MONITOR_RESIZE": { 
                 key: "monitorresize", 
                 value: true  
+            },
+
+            "APPEND_TO_DOCUMENT_BODY": { 
+                key: "appendtodocumentbody", 
+                value: false
             }
-        
         };
-
     
     /**
     * Constant representing the prefix path to use for non-secure images
@@ -905,11 +867,9 @@ version: 2.3.0
     */
     Module.textResizeEvent = new CustomEvent("textResize");
 
-
     function createModuleTemplate() {
 
         if (!m_oModuleTemplate) {
-
             m_oModuleTemplate = document.createElement("div");
             
             m_oModuleTemplate.innerHTML = ("<div class=\"" + 
@@ -920,55 +880,34 @@ version: 2.3.0
             m_oHeaderTemplate = m_oModuleTemplate.firstChild;
             m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
             m_oFooterTemplate = m_oBodyTemplate.nextSibling;
-
         }
 
         return m_oModuleTemplate;
-
     }
 
-
     function createHeader() {
-
         if (!m_oHeaderTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oHeaderTemplate.cloneNode(false));
-
     }
-    
 
     function createBody() {
-
         if (!m_oBodyTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oBodyTemplate.cloneNode(false));
-    
     }
-    
 
     function createFooter() {
-
         if (!m_oFooterTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oFooterTemplate.cloneNode(false));
-
     }
-    
 
     Module.prototype = {
-    
+
         /**
         * The class's constructor function
         * @property contructor
@@ -982,35 +921,35 @@ version: 2.3.0
         * @type HTMLElement
         */
         element: null,
-        
+
         /**
         * The header element, denoted with CSS class "hd"
         * @property header
         * @type HTMLElement
         */
         header: null,
-        
+
         /**
         * The body element, denoted with CSS class "bd"
         * @property body
         * @type HTMLElement
         */
         body: null,
-        
+
         /**
         * The footer element, denoted with CSS class "ft"
         * @property footer
         * @type HTMLElement
         */
         footer: null,
-        
+
         /**
         * The id of the element
         * @property id
         * @type String
         */
         id: null,
-        
+
         /**
         * A string representing the root path for all images created by
         * a Module instance.
@@ -1020,16 +959,16 @@ version: 2.3.0
         * @type String
         */
         imageRoot: Module.IMG_ROOT,
-    
+
         /**
         * Initializes the custom events for Module which are fired 
         * automatically at appropriate times by the Module class.
         * @method initEvents
         */
         initEvents: function () {
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to class initalization.
             * @event beforeInitEvent
@@ -1038,7 +977,7 @@ version: 2.3.0
             */
             this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
             this.beforeInitEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after class initalization.
             * @event initEvent
@@ -1047,20 +986,19 @@ version: 2.3.0
             */  
             this.initEvent = this.createEvent(EVENT_TYPES.INIT);
             this.initEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is appended to the DOM
             * @event appendEvent
             */
             this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
             this.appendEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is rendered
             * @event beforeRenderEvent
             */
-            this.beforeRenderEvent = 
-                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER);
             this.beforeRenderEvent.signature = SIGNATURE;
         
             /**
@@ -1077,8 +1015,7 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new header content
             */
-            this.changeHeaderEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER);
             this.changeHeaderEvent.signature = SIGNATURE;
             
             /**
@@ -1097,46 +1034,44 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new footer content
             */
-            this.changeFooterEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
             this.changeFooterEvent.signature = SIGNATURE;
         
             /**
             * CustomEvent fired when the content of the Module is modified
             * @event changeContentEvent
             */
-            this.changeContentEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
             this.changeContentEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is destroyed
             * @event destroyEvent
             */
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
             this.destroyEvent.signature = SIGNATURE;
-            
+
             /**
             * CustomEvent fired before the Module is shown
             * @event beforeShowEvent
             */
             this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
             this.beforeShowEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is shown
             * @event showEvent
             */
             this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
             this.showEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is hidden
             * @event beforeHideEvent
             */
             this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
             this.beforeHideEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is hidden
             * @event hideEvent
@@ -1144,30 +1079,22 @@ version: 2.3.0
             this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
             this.hideEvent.signature = SIGNATURE;
         }, 
-        
+
         /**
         * String representing the current user-agent platform
         * @property platform
         * @type String
         */
         platform: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-        
+
             if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-        
                 return "windows";
-        
             } else if (ua.indexOf("macintosh") != -1) {
-        
                 return "mac";
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1177,40 +1104,24 @@ version: 2.3.0
         * @type String
         */
         browser: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-            
             /*
                  Check Opera first in case of spoof and check Safari before
                  Gecko since Safari's user agent string includes "like Gecko"
             */
-
             if (ua.indexOf('opera') != -1) { 
-            
                 return 'opera';
-            
             } else if (ua.indexOf('msie 7') != -1) {
-            
                 return 'ie7';
-            
             } else if (ua.indexOf('msie') != -1) {
-            
                 return 'ie';
-            
             } else if (ua.indexOf('safari') != -1) { 
-            
                 return 'safari';
-            
             } else if (ua.indexOf('gecko') != -1) {
-            
                 return 'gecko';
-            
             } else {
-            
                 return false;
-            
             }
-        
         }(),
         
         /**
@@ -1220,17 +1131,11 @@ version: 2.3.0
         * @type Boolean
         */
         isSecure: function () {
-        
             if (window.location.href.toLowerCase().indexOf("https") === 0) {
-        
                 return true;
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1238,9 +1143,7 @@ version: 2.3.0
         * automatically at appropriate times by the Module class.
         */
         initDefaultConfig: function () {
-    
             // Add properties //
-        
             /**
             * Specifies whether the Module is visible on the page.
             * @config visible
@@ -1252,7 +1155,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.VISIBLE.value, 
                 validator: DEFAULT_CONFIG.VISIBLE.validator
             });
-            
+
             /**
             * Object or array of objects representing the ContainerEffect 
             * classes that are active for animating the container.
@@ -1264,7 +1167,7 @@ version: 2.3.0
                 suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.EFFECT.supercedes
             });
-            
+
             /**
             * Specifies whether to create a special proxy iframe to monitor 
             * for user font resizing in the document
@@ -1276,9 +1179,26 @@ version: 2.3.0
                 handler: this.configMonitorResize,
                 value: DEFAULT_CONFIG.MONITOR_RESIZE.value
             });
-            
+
+            /**
+            * Specifies if the module should be rendered as the first child 
+            * of document.body or appended as the last child when render is called
+            * with document.body as the "appendToNode".
+            * <p>
+            * Appending to the body while the DOM is still being constructed can 
+            * lead to Operation Aborted errors in IE hence this flag is set to 
+            * false by default.
+            * </p>
+            * 
+            * @config appendtodocumentbody
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, {
+                value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value
+            });
         },
-        
+
         /**
         * The Module class's initialization method, which is executed for
         * Module and all of its subclasses. This method is automatically 
@@ -1293,13 +1213,12 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-        
-            var elId, i, child;
-        
+
+            var elId, child;
+
             this.initEvents();
-        
             this.beforeInitEvent.fire(Module);
-        
+
             /**
             * The Module's Config object used for monitoring 
             * configuration properties.
@@ -1307,208 +1226,217 @@ version: 2.3.0
             * @type YAHOO.util.Config
             */
             this.cfg = new Config(this);
-        
+
             if (this.isSecure) {
                 this.imageRoot = Module.IMG_ROOT_SSL;
             }
-        
-            if (typeof el == "string") {
 
+            if (typeof el == "string") {
                 elId = el;
-        
                 el = document.getElementById(el);
-
                 if (! el) {
-
                     el = (createModuleTemplate()).cloneNode(false);
-
                     el.id = elId;
-
                 }
-
             }
-        
+
             this.element = el;
-        
+
             if (el.id) {
                 this.id = el.id;
             }
-        
+
             child = this.element.firstChild;
-            
-            if (child) {
 
+            if (child) {
+                var fndHd = false, fndBd = false, fndFt = false;
                 do {
-
-                    switch (child.className) {
-    
-                    case Module.CSS_HEADER:
-    
-                        this.header = child;
-    
-                        break;
-    
-                    case Module.CSS_BODY:
-    
-                        this.body = child;
-    
-                        break;
-    
-                    case Module.CSS_FOOTER:
-    
-                        this.footer = child;
-    
-                        break;
-    
+                    // We're looking for elements
+                    if (1 == child.nodeType) {
+                        if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) {
+                            this.header = child;
+                            fndHd = true;
+                        } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) {
+                            this.body = child;
+                            fndBd = true;
+                        } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){
+                            this.footer = child;
+                            fndFt = true;
+                        }
                     }
-                    
                 } while ((child = child.nextSibling));
-            
             }
 
-        
             this.initDefaultConfig();
-        
+
             Dom.addClass(this.element, Module.CSS_MODULE);
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
-        
+
             /*
                 Subscribe to the fireQueue() method of Config so that any 
                 queued configuration changes are excecuted upon render of 
                 the Module
             */ 
-            
-            if (!Config.alreadySubscribed(this.renderEvent, 
-                this.cfg.fireQueue, this.cfg)) {
 
+            if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
                 this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-
             }
-        
+
             this.initEvent.fire(Module);
         },
-        
+
         /**
-        * Initialized an empty IFRAME that is placed out of the visible area 
+        * Initialize an empty IFRAME that is placed out of the visible area 
         * that can be used to detect text resize.
         * @method initResizeMonitor
         */
         initResizeMonitor: function () {
-        
-            var oDoc, 
-                oIFrame, 
-                sHTML;
-        
-            function fireTextResize() {
-        
+
+            var isGeckoWin = (YAHOO.env.ua.gecko && this.platform == "windows");
+            if (isGeckoWin) {
+                // Help prevent spinning loading icon which 
+                // started with FireFox 2.0.0.8/Win
+                var self = this;
+                setTimeout(function(){self._initResizeMonitor();}, 0);
+            } else {
+                this._initResizeMonitor();
+            }
+        },
+
+        /**
+         * Create and initialize the text resize monitoring iframe.
+         * 
+         * @protected
+         * @method _initResizeMonitor
+         */
+        _initResizeMonitor : function() {
+
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+
+            function fireTextResize() {
                 Module.textResizeEvent.fire();
-        
             }
-        
+
             if (!YAHOO.env.ua.opera) {
-        
                 oIFrame = Dom.get("_yuiResizeMonitor");
-        
+
+                var supportsCWResize = this._supportsCWResize();
+
                 if (!oIFrame) {
-        
                     oIFrame = document.createElement("iframe");
-        
-                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
-                        YAHOO.env.ua.ie) {
-    
+
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && YAHOO.env.ua.ie) {
                         oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
-    
                     }
 
-
-                    /*
-                        Need to set "src" attribute of the iframe to 
-                        prevent the browser from reporting duplicate 
-                        cookies. (See SourceForge bug #1721755)
-                    */
-        
-                    if (YAHOO.env.ua.gecko) {
-
-                        sHTML = "<html><head><script " +
-                                "type=\"text/javascript\">" + 
-                                "window.onresize=function(){window.parent." +
-                                "YAHOO.widget.Module.textResizeEvent." +
-                                "fire();};window.parent.YAHOO.widget.Module." +
-                                "textResizeEvent.fire();</script></head>" + 
-                                "<body></body></html>";
-
-                        oIFrame.src = "data:text/html;charset=utf-8," + 
-                            encodeURIComponent(sHTML);
-
+                    if (!supportsCWResize) {
+                        // Can't monitor on contentWindow, so fire from inside iframe
+                        sHTML = ["<html><head><script ",
+                                 "type=\"text/javascript\">",
+                                 "window.onresize=function(){window.parent.",
+                                 "YAHOO.widget.Module.textResizeEvent.",
+                                 "fire();};<",
+                                 "\/script></head>",
+                                 "<body></body></html>"].join('');
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML);
                     }
 
                     oIFrame.id = "_yuiResizeMonitor";
-                    
                     /*
                         Need to set "position" property before inserting the 
                         iframe into the document or Safari's status bar will 
                         forever indicate the iframe is loading 
                         (See SourceForge bug #1723064)
                     */
-                    
                     oIFrame.style.position = "absolute";
                     oIFrame.style.visibility = "hidden";
-        
-                    document.body.appendChild(oIFrame);
-        
+
+                    var db = document.body,
+                        fc = db.firstChild;
+                    if (fc) {
+                        db.insertBefore(oIFrame, fc);
+                    } else {
+                        db.appendChild(oIFrame);
+                    }
+
                     oIFrame.style.width = "10em";
                     oIFrame.style.height = "10em";
                     oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
                     oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
                     oIFrame.style.borderWidth = "0";
                     oIFrame.style.visibility = "visible";
-        
+
+                    /*
+                       Don't open/close the document for Gecko like we used to, since it
+                       leads to duplicate cookies. (See SourceForge bug #1721755)
+                    */
                     if (YAHOO.env.ua.webkit) {
-        
                         oDoc = oIFrame.contentWindow.document;
-        
                         oDoc.open();
                         oDoc.close();
-        
                     }
-
                 }
-        
+
                 if (oIFrame && oIFrame.contentWindow) {
+                    Module.textResizeEvent.subscribe(this.onDomResize, this, true);
 
-                    Module.textResizeEvent.subscribe(this.onDomResize, 
-                        this, true);
-        
                     if (!Module.textResizeInitialized) {
-
-                        if (!Event.on(oIFrame.contentWindow, "resize", 
-                            fireTextResize)) {
-
-                            /*
-                                 This will fail in IE if document.domain has 
-                                 changed, so we must change the listener to 
-                                 use the oIFrame element instead
-                            */
-
-                            Event.on(oIFrame, "resize", fireTextResize);
-
+                        if (supportsCWResize) {
+                            if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) {
+                                /*
+                                     This will fail in IE if document.domain has 
+                                     changed, so we must change the listener to 
+                                     use the oIFrame element instead
+                                */
+                                Event.on(oIFrame, "resize", fireTextResize);
+                            }
                         }
-
                         Module.textResizeInitialized = true;
-
                     }
-
                     this.resizeMonitor = oIFrame;
+                }
+            }
+        },
 
+        /**
+         * Text resize monitor helper method.
+         * Determines if the browser supports resize events on iframe content windows.
+         * 
+         * @private
+         * @method _supportsCWResize
+         */
+        _supportsCWResize : function() {
+            /*
+                Gecko 1.8.0 (FF1.5), 1.8.1.0-5 (FF2) won't fire resize on contentWindow.
+                Gecko 1.8.1.6+ (FF2.0.0.6+) and all other browsers will fire resize on contentWindow.
+
+                We don't want to start sniffing for patch versions, so fire textResize the same
+                way on all FF, until 1.9 (3.x) is out
+             */
+            var bSupported = true;
+            if (YAHOO.env.ua.gecko && YAHOO.env.ua.gecko <= 1.8) {
+                bSupported = false;
+                /*
+                var v = navigator.userAgent.match(/rv:([^\s\)]*)/); // From YAHOO.env.ua
+                if (v && v[0]) {
+                    var sv = v[0].match(/\d\.\d\.(\d)/);
+                    if (sv && sv[1]) {
+                        if (parseInt(sv[1], 10) > 0) {
+                            bSupported = true;
+                        }
+                    }
                 }
-        
+                */
             }
-        
+            return bSupported;
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -1516,45 +1444,45 @@ version: 2.3.0
         * @param {Object} obj The scope object passed to the handler
         */
         onDomResize: function (e, obj) {
-        
+
             var nLeft = -1 * this.resizeMonitor.offsetWidth,
                 nTop = -1 * this.resizeMonitor.offsetHeight;
         
             this.resizeMonitor.style.top = nTop + "px";
             this.resizeMonitor.style.left =  nLeft + "px";
-        
+
         },
-        
+
         /**
-        * Sets the Module's header content to the HTML specified, or appends 
+        * Sets the Module's header content to the string specified, or appends 
         * the passed element to the header. If no header is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the header.
+        * 
         * @method setHeader
-        * @param {String} headerContent The HTML used to set the header 
+        * @param {String} headerContent The string used to set the header.
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the header innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} headerContent The HTMLElement to append to 
         * the header
         */
         setHeader: function (headerContent) {
-
             var oHeader = this.header || (this.header = createHeader());
-        
-            if (typeof headerContent == "string") {
-
-                oHeader.innerHTML = headerContent;
-
-            } else {
 
+            if (headerContent.tagName) {
                 oHeader.innerHTML = "";
                 oHeader.appendChild(headerContent);
-
+            } else {
+                oHeader.innerHTML = headerContent;
             }
-        
+
             this.changeHeaderEvent.fire(headerContent);
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Appends the passed element to the header. If no header is present, 
         * one will be automatically created.
@@ -1562,7 +1490,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the header
         */
         appendToHeader: function (element) {
-
             var oHeader = this.header || (this.header = createHeader());
         
             oHeader.appendChild(element);
@@ -1571,35 +1498,34 @@ version: 2.3.0
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Sets the Module's body content to the HTML specified, or appends the
         * passed element to the body. If no body is present, one will be 
-        * automatically created.
+        * automatically created. An empty string can be passed to the method
+        * to clear the contents of the body.
         * @method setBody
-        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {String} bodyContent The HTML used to set the body. 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the body innerHTML
+        * set to their default toString implementations.
+        * <em>OR</em>
         * @param {HTMLElement} bodyContent The HTMLElement to append to the body
         */
         setBody: function (bodyContent) {
-
             var oBody = this.body || (this.body = createBody());
-        
-            if (typeof bodyContent == "string") {
-
-                oBody.innerHTML = bodyContent;
-
-            } else {
 
+            if (bodyContent.tagName) {
                 oBody.innerHTML = "";
                 oBody.appendChild(bodyContent);
-
+            } else {
+                oBody.innerHTML = bodyContent;
             }
-        
+
             this.changeBodyEvent.fire(bodyContent);
             this.changeContentEvent.fire();
-
         },
-        
+
         /**
         * Appends the passed element to the body. If no body is present, one 
         * will be automatically created.
@@ -1607,7 +1533,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the body
         */
         appendToBody: function (element) {
-
             var oBody = this.body || (this.body = createBody());
         
             oBody.appendChild(element);
@@ -1620,9 +1545,13 @@ version: 2.3.0
         /**
         * Sets the Module's footer content to the HTML specified, or appends 
         * the passed element to the footer. If no footer is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the footer.
         * @method setFooter
         * @param {String} footerContent The HTML used to set the footer 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the footer innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} footerContent The HTMLElement to append to 
         * the footer
@@ -1630,18 +1559,14 @@ version: 2.3.0
         setFooter: function (footerContent) {
 
             var oFooter = this.footer || (this.footer = createFooter());
-        
-            if (typeof footerContent == "string") {
-
-                oFooter.innerHTML = footerContent;
-
-            } else {
 
+            if (footerContent.tagName) {
                 oFooter.innerHTML = "";
                 oFooter.appendChild(footerContent);
-
+            } else {
+                oFooter.innerHTML = footerContent;
             }
-        
+
             this.changeFooterEvent.fire(footerContent);
             this.changeContentEvent.fire();
 
@@ -1668,10 +1593,20 @@ version: 2.3.0
         * Renders the Module by inserting the elements that are not already 
         * in the main Module into their correct places. Optionally appends 
         * the Module to the specified node prior to the render's execution. 
-        * NOTE: For Modules without existing markup, the appendToNode argument 
+        * <p>
+        * For Modules without existing markup, the appendToNode argument 
         * is REQUIRED. If this argument is ommitted and the current element is 
         * not present in the document, the function will return false, 
         * indicating that the render was a failure.
+        * </p>
+        * <p>
+        * NOTE: As of 2.3.1, if the appendToNode is the document's body element
+        * then the module is rendered as the first child of the body element, 
+        * and not appended to it, to avoid Operation Aborted errors in IE when 
+        * rendering the module before window's load event is fired. You can 
+        * use the appendtodocumentbody configuration property to change this 
+        * to append to document.body if required.
+        * </p>
         * @method render
         * @param {String} appendToNode The element id to which the Module 
         * should be appended to prior to rendering <em>OR</em>
@@ -1682,120 +1617,76 @@ version: 2.3.0
         * @return {Boolean} Success or failure of the render
         */
         render: function (appendToNode, moduleElement) {
-        
+
             var me = this,
                 firstChild;
-        
-            function appendTo(element) {
-                if (typeof element == "string") {
-                    element = document.getElementById(element);
+
+            function appendTo(parentNode) {
+                if (typeof parentNode == "string") {
+                    parentNode = document.getElementById(parentNode);
                 }
-        
-                if (element) {
-                    element.appendChild(me.element);
+
+                if (parentNode) {
+                    me._addToParent(parentNode, me.element);
                     me.appendEvent.fire();
                 }
             }
-        
+
             this.beforeRenderEvent.fire();
-        
+
             if (! moduleElement) {
                 moduleElement = this.element;
             }
-        
-            if (appendToNode) {
 
+            if (appendToNode) {
                 appendTo(appendToNode);
-
             } else { 
-
-                /*
-                     No node was passed in. If the element is not already in 
-                     the Dom, this fails
-                */
-
+                // No node was passed in. If the element is not already in the Dom, this fails
                 if (! Dom.inDocument(this.element)) {
-
-                    YAHOO.log("Render failed. Must specify appendTo node if " + 
-                        " Module isn't already in the DOM.", "error");
-
+                    YAHOO.log("Render failed. Must specify appendTo node if " + " Module isn't already in the DOM.", "error");
                     return false;
-
                 }
-
             }
-        
+
             // Need to get everything into the DOM if it isn't already
-        
             if (this.header && ! Dom.inDocument(this.header)) {
-
-                /*
-                    There is a header, but it's not in the DOM yet... 
-                    need to add it
-                */
-
+                // There is a header, but it's not in the DOM yet. Need to add it.
                 firstChild = moduleElement.firstChild;
-
-                if (firstChild) { // Insert before first child if exists
-
+                if (firstChild) {
                     moduleElement.insertBefore(this.header, firstChild);
-
-                } else { // Append to empty body because there are no children
-
+                } else {
                     moduleElement.appendChild(this.header);
-
                 }
-
             }
-        
-            if (this.body && ! Dom.inDocument(this.body)) {
-
-                /*
-                     There is a body, but it's not in the DOM yet... 
-                     need to add it
-                */
-
-
-                // Insert before footer if exists in DOM
-
-                if (this.footer && Dom.isAncestor(
-                    this.moduleElement, this.footer)) { 
 
+            if (this.body && ! Dom.inDocument(this.body)) {
+                // There is a body, but it's not in the DOM yet. Need to add it.               
+                if (this.footer && Dom.isAncestor(this.moduleElement, this.footer)) {
                     moduleElement.insertBefore(this.body, this.footer);
-
-                } else { // Append to element because there is no footer
-
+                } else {
                     moduleElement.appendChild(this.body);
-
                 }
-
             }
-        
-            if (this.footer && ! Dom.inDocument(this.footer)) {
-
-                /*
-                     There is a footer, but it's not in the DOM yet... 
-                     need to add it
-                */
 
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+                // There is a footer, but it's not in the DOM yet. Need to add it.
                 moduleElement.appendChild(this.footer);
-
             }
-        
+
             this.renderEvent.fire();
             return true;
         },
-        
+
         /**
         * Removes the Module element from the DOM and sets all child elements 
         * to null.
         * @method destroy
         */
         destroy: function () {
-        
+
             var parent,
                 e;
-        
+
             if (this.element) {
                 Event.purgeElement(this.element, true);
                 parent = this.element.parentNode;
@@ -1846,7 +1737,6 @@ version: 2.3.0
         },
         
         // BUILT-IN EVENT HANDLERS FOR MODULE //
-        
         /**
         * Default event handler for changing the visibility property of a 
         * Module. By default, this is achieved by switching the "display" style 
@@ -1882,23 +1772,40 @@ version: 2.3.0
         * @method configMonitorResize
         */
         configMonitorResize: function (type, args, obj) {
-
             var monitor = args[0];
-
             if (monitor) {
-
                 this.initResizeMonitor();
-
             } else {
-
-                Module.textResizeEvent.unsubscribe(
-                    this.onDomResize, this, true);
-
+                Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
                 this.resizeMonitor = null;
             }
+        },
 
+        /**
+         * This method is a protected helper, used when constructing the DOM structure for the module 
+         * to account for situations which may cause Operation Aborted errors in IE. It should not 
+         * be used for general DOM construction.
+         * <p>
+         * If the parentNode is not document.body, the element is appended as the last element.
+         * </p>
+         * <p>
+         * If the parentNode is document.body the element is added as the first child to help
+         * prevent Operation Aborted errors in IE.
+         * </p>
+         *
+         * @param {parentNode} The HTML element to which the element will be added
+         * @param {element} The HTML element to be added to parentNode's children
+         * @method _addToParent
+         * @protected
+         */
+        _addToParent: function(parentNode, element) {
+            if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) {
+                parentNode.insertBefore(element, parentNode.firstChild);
+            } else {
+                parentNode.appendChild(element);
+            }
         },
-        
+
         /**
         * Returns a String representation of the Object.
         * @method toString
@@ -1907,12 +1814,12 @@ version: 2.3.0
         toString: function () {
             return "Module " + this.id;
         }
-        
     };
-    
+
     YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -1924,7 +1831,7 @@ version: 2.3.0
     * properly rendered above SELECT elements.
     * @namespace YAHOO.widget
     * @class Overlay
-    * @extends Module
+    * @extends YAHOO.widget.Module
     * @param {String} el The element ID representing the Overlay <em>OR</em>
     * @param {HTMLElement} el The element representing the Overlay
     * @param {Object} userConfig The configuration object literal containing 
@@ -1933,12 +1840,9 @@ version: 2.3.0
     * @constructor
     */
     YAHOO.widget.Overlay = function (el, userConfig) {
-    
         YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
@@ -1946,7 +1850,7 @@ version: 2.3.0
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Overlay = YAHOO.widget.Overlay,
-        
+
         m_oIFrameTemplate,
 
         /**
@@ -1957,12 +1861,10 @@ version: 2.3.0
         * @type Object
         */
         EVENT_TYPES = {
-        
             "BEFORE_MOVE": "beforeMove",
             "MOVE": "move"
-        
         },
-        
+
         /**
         * Constant representing the Overlay's configuration properties
         * @property DEFAULT_CONFIG
@@ -1971,74 +1873,72 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "X": { 
                 key: "x", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "Y": { 
                 key: "y", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "XY": { 
                 key: "xy", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "CONTEXT": { 
                 key: "context", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "FIXED_CENTER": { 
                 key: "fixedcenter", 
                 value: false, 
                 validator: Lang.isBoolean, 
                 supercedes: ["iframe", "visible"] 
             },
-        
+
             "WIDTH": { 
                 key: "width", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
             }, 
-        
+
             "HEIGHT": { 
                 key: "height", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
-            }, 
-        
+            },
+
             "ZINDEX": { 
                 key: "zindex", 
                 value: null 
-            }, 
-        
+            },
+
             "CONSTRAIN_TO_VIEWPORT": { 
                 key: "constraintoviewport", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["iframe", "x", "y", "xy"] 
+                supercedes: ["iframe", "x", "y", "xy"]
             }, 
-        
+
             "IFRAME": { 
                 key: "iframe", 
                 value: (YAHOO.env.ua.ie == 6 ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["zindex"] 
             }
-        
         };
 
-
     /**
     * The URL that will be placed in the iframe
     * @property YAHOO.widget.Overlay.IFRAME_SRC
@@ -2050,7 +1950,7 @@ version: 2.3.0
 
     /**
     * Number representing how much the iframe shim should be offset from each 
-    * side of an Overlay instance.
+    * side of an Overlay instance, in pixels.
     * @property YAHOO.widget.Overlay.IFRAME_SRC
     * @default 3
     * @static
@@ -2058,7 +1958,18 @@ version: 2.3.0
     * @type Number
     */
     Overlay.IFRAME_OFFSET = 3;
-    
+
+    /**
+    * Number representing the minimum distance an Overlay instance should be 
+    * positioned relative to the boundaries of the browser's viewport, in pixels.
+    * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET
+    * @default 10
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.VIEWPORT_OFFSET = 10;
+
     /**
     * Constant representing the top left corner of an element, used for 
     * configuring the context element alignment
@@ -2068,7 +1979,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_LEFT = "tl";
-    
+
     /**
     * Constant representing the top right corner of an element, used for 
     * configuring the context element alignment
@@ -2078,7 +1989,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_RIGHT = "tr";
-    
+
     /**
     * Constant representing the top bottom left corner of an element, used for 
     * configuring the context element alignment
@@ -2088,7 +1999,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_LEFT = "bl";
-    
+
     /**
     * Constant representing the bottom right corner of an element, used for 
     * configuring the context element alignment
@@ -2098,7 +2009,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_RIGHT = "br";
-    
+
     /**
     * Constant representing the default CSS class used for an Overlay
     * @property YAHOO.widget.Overlay.CSS_OVERLAY
@@ -2107,22 +2018,21 @@ version: 2.3.0
     * @type String
     */
     Overlay.CSS_OVERLAY = "yui-overlay";
-    
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for 
     * window scroll
     * @event YAHOO.widget.Overlay.windowScrollEvent
     */
     Overlay.windowScrollEvent = new CustomEvent("windowScroll");
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for
     * window resize
     * @event YAHOO.widget.Overlay.windowResizeEvent
     */
     Overlay.windowResizeEvent = new CustomEvent("windowResize");
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window scroll
     * @method YAHOO.widget.Overlay.windowScrollHandler
@@ -2130,31 +2040,24 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM scroll event
     */
     Overlay.windowScrollHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
+
             if (! window.scrollEnd) {
-    
                 window.scrollEnd = -1;
-    
             }
-    
+
             clearTimeout(window.scrollEnd);
     
             window.scrollEnd = setTimeout(function () { 
-            
                 Overlay.windowScrollEvent.fire(); 
-    
             }, 1);
     
         } else {
-    
             Overlay.windowScrollEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window resize
     * @method YAHOO.widget.Overlay.windowResizeHandler
@@ -2162,29 +2065,22 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM resize event
     */
     Overlay.windowResizeHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
             if (! window.resizeEnd) {
                 window.resizeEnd = -1;
             }
-    
+
             clearTimeout(window.resizeEnd);
-    
+
             window.resizeEnd = setTimeout(function () {
-    
                 Overlay.windowResizeEvent.fire(); 
-    
             }, 100);
-    
         } else {
-    
             Overlay.windowResizeEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * A boolean that indicated whether the window resize and scroll events have 
     * already been subscribed to.
@@ -2193,18 +2089,16 @@ version: 2.3.0
     * @type Boolean
     */
     Overlay._initialized = null;
-    
+
     if (Overlay._initialized === null) {
-    
         Event.on(window, "scroll", Overlay.windowScrollHandler);
         Event.on(window, "resize", Overlay.windowResizeHandler);
     
         Overlay._initialized = true;
-    
     }
-    
+
     YAHOO.extend(Overlay, Module, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and  
         * all of its subclasses. This method is automatically called by the 
@@ -2225,39 +2119,35 @@ version: 2.3.0
             */
     
             Overlay.superclass.init.call(this, el/*, userConfig*/);  
-            
+
             this.beforeInitEvent.fire(Overlay);
             
             Dom.addClass(this.element, Overlay.CSS_OVERLAY);
             
             if (userConfig) {
-    
                 this.cfg.applyConfig(userConfig, true);
-    
             }
-            
+
             if (this.platform == "mac" && YAHOO.env.ua.gecko) {
-    
+
                 if (! Config.alreadySubscribed(this.showEvent,
                     this.showMacGeckoScrollbars, this)) {
-    
+
                     this.showEvent.subscribe(this.showMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
+
                 if (! Config.alreadySubscribed(this.hideEvent, 
                     this.hideMacGeckoScrollbars, this)) {
-    
+
                     this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
             }
-            
+
             this.initEvent.fire(Overlay);
-        
         },
         
         /**
@@ -2317,8 +2207,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.X.supercedes
     
             });
-        
-    
+
             /**
             * The absolute y-coordinate position of the Overlay
             * @config y
@@ -2326,14 +2215,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
-    
+
                 handler: this.configY, 
                 validator: DEFAULT_CONFIG.Y.validator, 
                 suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.Y.supercedes
-    
+
             });
-        
     
             /**
             * An array with the absolute x and y positions of the Overlay
@@ -2348,7 +2236,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.XY.supercedes
             
             });
-        
     
             /**
             * The array of context arguments for context-sensitive positioning.  
@@ -2367,8 +2254,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
             
             });
-        
-    
+
             /**
             * True if the Overlay should be anchored to the center of 
             * the viewport.
@@ -2384,7 +2270,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
             
             });
-        
     
             /**
             * CSS width of the Overlay.
@@ -2393,13 +2278,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
-            
+
                 handler: this.configWidth, 
                 suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.WIDTH.supercedes
-            
+
             });
-            
+
             /**
             * CSS height of the Overlay.
             * @config height
@@ -2407,7 +2292,7 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
-            
+
                 handler: this.configHeight, 
                 suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
@@ -2421,12 +2306,12 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
-    
+
                 handler: this.configzIndex,
                 value: DEFAULT_CONFIG.ZINDEX.value
-    
+
             });
-            
+
             /**
             * True if the Overlay should be prevented from being positioned 
             * out of the viewport.
@@ -2435,18 +2320,18 @@ version: 2.3.0
             * @default false
             */
             this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
-            
+
                 handler: this.configConstrainToViewport, 
                 value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
                 validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
                 supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
-            
+
             });
-            
+
             /**
             * @config iframe
             * @description Boolean indicating whether or not the Overlay should 
-            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * have an IFRAME shim; used to prevent SELECT elements from 
             * poking through an Overlay instance in IE6.  When set to "true", 
             * the iframe shim is created when the Overlay instance is intially
             * made visible.
@@ -2454,16 +2339,15 @@ version: 2.3.0
             * @default true for IE6 and below, false for all other browsers.
             */
             this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
-            
+
                 handler: this.configIframe, 
                 value: DEFAULT_CONFIG.IFRAME.value, 
                 validator: DEFAULT_CONFIG.IFRAME.validator, 
                 supercedes: DEFAULT_CONFIG.IFRAME.supercedes
-            
+
             });
-        
         },
-        
+
         /**
         * Moves the Overlay to the specified position. This function is  
         * identical to calling this.cfg.setProperty("xy", [x,y]);
@@ -2472,11 +2356,9 @@ version: 2.3.0
         * @param {Number} y The Overlay's new y position
         */
         moveTo: function (x, y) {
-    
             this.cfg.setProperty("xy", [x, y]);
-    
         },
-        
+
         /**
         * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
         * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2489,7 +2371,7 @@ version: 2.3.0
             Dom.addClass(this.element, "hide-scrollbars");
     
         },
-        
+
         /**
         * Adds a CSS class ("show-scrollbars") and removes a CSS class 
         * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2502,9 +2384,8 @@ version: 2.3.0
             Dom.addClass(this.element, "show-scrollbars");
     
         },
-        
+
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * The default event handler fired when the "visible" property is 
         * changed.  This method is responsible for firing showEvent
@@ -2517,7 +2398,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configVisible: function (type, args, obj) {
-    
+
             var visible = args[0],
                 currentVis = Dom.getStyle(this.element, "visibility"),
                 effect = this.cfg.getProperty("effect"),
@@ -2527,140 +2408,93 @@ version: 2.3.0
                 eff, ei, e, i, j, k, h,
                 nEffects,
                 nEffectInstances;
-    
-    
+
             if (currentVis == "inherit") {
-    
                 e = this.element.parentNode;
-    
+
                 while (e.nodeType != 9 && e.nodeType != 11) {
-    
                     currentVis = Dom.getStyle(e, "visibility");
-    
+
                     if (currentVis != "inherit") { 
-    
                         break; 
-    
                     }
-    
+
                     e = e.parentNode;
-    
                 }
-    
+
                 if (currentVis == "inherit") {
-    
                     currentVis = "visible";
-                
                 }
-    
             }
-        
-    
+
             if (effect) {
-    
                 if (effect instanceof Array) {
-
                     nEffects = effect.length;
-    
+
                     for (i = 0; i < nEffects; i++) {
-    
                         eff = effect[i];
-    
                         effectInstances[effectInstances.length] = 
                             eff.effect(this, eff.duration);
-    
+
                     }
-    
                 } else {
-    
                     effectInstances[effectInstances.length] = 
                         effect.effect(this, effect.duration);
-    
                 }
-    
             }
-    
-        
+
+
             if (visible) { // Show
-    
                 if (isMacGecko) {
-    
                     this.showMacGeckoScrollbars();
-    
                 }
-                
-    
+
                 if (effect) { // Animate in
-    
-    
                     if (visible) { // Animate in if not showing
-    
-    
                         if (currentVis != "visible" || currentVis === "") {
-    
                             this.beforeShowEvent.fire();
-
                             nEffectInstances = effectInstances.length;
-    
+
                             for (j = 0; j < nEffectInstances; j++) {
-    
                                 ei = effectInstances[j];
-    
                                 if (j === 0 && !alreadySubscribed(
                                         ei.animateInCompleteEvent, 
                                         this.showEvent.fire, this.showEvent)) {
-    
+
                                     /*
                                          Delegate showEvent until end 
                                          of animateInComplete
                                     */
-    
+
                                     ei.animateInCompleteEvent.subscribe(
                                      this.showEvent.fire, this.showEvent, true);
-    
                                 }
-    
                                 ei.animateIn();
-    
                             }
-    
                         }
-    
                     }
-    
                 } else { // Show
-    
                     if (currentVis != "visible" || currentVis === "") {
-    
                         this.beforeShowEvent.fire();
-    
+
                         Dom.setStyle(this.element, "visibility", "visible");
-    
+
                         this.cfg.refireEvent("iframe");
                         this.showEvent.fire();
-    
                     }
-        
                 }
-        
             } else { // Hide
-    
+
                 if (isMacGecko) {
-    
                     this.hideMacGeckoScrollbars();
-    
                 }
                     
                 if (effect) { // Animate out if showing
-    
                     if (currentVis == "visible") {
-    
                         this.beforeHideEvent.fire();
 
                         nEffectInstances = effectInstances.length;
-    
                         for (k = 0; k < nEffectInstances; k++) {
-    
                             h = effectInstances[k];
     
                             if (k === 0 && !alreadySubscribed(
@@ -2676,50 +2510,35 @@ version: 2.3.0
                                     this.hideEvent.fire, this.hideEvent, true);
     
                             }
-    
                             h.animateOut();
-    
                         }
-    
+
                     } else if (currentVis === "") {
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-    
                     }
-    
+
                 } else { // Simple hide
-    
+
                     if (currentVis == "visible" || currentVis === "") {
-    
                         this.beforeHideEvent.fire();
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-
                         this.hideEvent.fire();
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
+
         /**
         * Center event handler used for centering on scroll/resize, but only if 
         * the Overlay is visible
         * @method doCenterOnDOMEvent
         */
         doCenterOnDOMEvent: function () {
-    
             if (this.cfg.getProperty("visible")) {
-    
                 this.center();
-    
             }
-    
         },
-        
+
         /**
         * The default event handler fired when the "fixedcenter" property 
         * is changed.
@@ -2731,48 +2550,33 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configFixedCenter: function (type, args, obj) {
-    
+
             var val = args[0],
                 alreadySubscribed = Config.alreadySubscribed,
                 windowResizeEvent = Overlay.windowResizeEvent,
                 windowScrollEvent = Overlay.windowScrollEvent;
-            
+
             if (val) {
-    
                 this.center();
-            
-                if (!alreadySubscribed(this.beforeShowEvent, 
-                    this.center, this)) {
-    
+
+                if (!alreadySubscribed(this.beforeShowEvent, this.center, this)) {
                     this.beforeShowEvent.subscribe(this.center);
-    
                 }
-            
-                if (!alreadySubscribed(windowResizeEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-    
-                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) {
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-            
-                if (!alreadySubscribed(windowScrollEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-        
-                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) {
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-    
+
             } else {
-    
                 this.beforeShowEvent.unsubscribe(this.center);
-    
+
                 windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
                 windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-    
             }
-    
         },
         
         /**
@@ -2785,15 +2589,14 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configHeight: function (type, args, obj) {
-    
+
             var height = args[0],
                 el = this.element;
-    
+
             Dom.setStyle(el, "height", height);
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * The default event handler fired when the "width" property is changed.
         * @method configWidth
@@ -2804,13 +2607,12 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configWidth: function (type, args, obj) {
-    
+
             var width = args[0],
                 el = this.element;
     
             Dom.setStyle(el, "width", width);
             this.cfg.refireEvent("iframe");
-    
         },
         
         /**
@@ -2823,38 +2625,31 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
+
             var zIndex = args[0],
                 el = this.element;
-        
+
             if (! zIndex) {
-    
                 zIndex = Dom.getStyle(el, "zIndex");
-        
                 if (! zIndex || isNaN(zIndex)) {
-    
                     zIndex = 0;
-    
                 }
-    
             }
-            
-            if (this.iframe) {
-    
+
+            if (this.iframe || this.cfg.getProperty("iframe") === true) {
                 if (zIndex <= 0) {
-    
                     zIndex = 1;
-    
                 }
-    
-                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
             }
-            
+
             Dom.setStyle(el, "zIndex", zIndex);
             this.cfg.setProperty("zIndex", zIndex, true);
-    
+
+            if (this.iframe) {
+                this.stackIframe();
+            }
         },
-        
+
         /**
         * The default event handler fired when the "xy" property is changed.
         * @method configXY
@@ -2865,26 +2660,25 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configXY: function (type, args, obj) {
-    
+
             var pos = args[0],
                 x = pos[0],
                 y = pos[1];
-            
+
             this.cfg.setProperty("x", x);
             this.cfg.setProperty("y", y);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             YAHOO.log(("xy: " + [x, y]), "iframe");
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "x" property is changed.
         * @method configX
@@ -2895,27 +2689,26 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configX: function (type, args, obj) {
-    
+
             var x = args[0],
                 y = this.cfg.getProperty("y");
-            
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
             
             Dom.setX(this.element, x, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-           
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "y" property is changed.
         * @method configY
@@ -2926,25 +2719,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configY: function (type, args, obj) {
-    
+
             var x = this.cfg.getProperty("x"),
                 y = args[0];
-        
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             Dom.setY(this.element, y, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
         
         /**
@@ -2957,33 +2749,23 @@ version: 2.3.0
                 oParentNode;
 
             if (oIFrame) {
-    
                 oParentNode = this.element.parentNode;
 
                 if (oParentNode != oIFrame.parentNode) {
-
-                    oParentNode.appendChild(oIFrame);
-                
+                    this._addToParent(oParentNode, oIFrame);
                 }
-
                 oIFrame.style.display = "block";
-    
             }
-    
         },
-        
+
         /**
         * Hides the iframe shim, if it has been enabled.
         * @method hideIframe
         */
         hideIframe: function () {
-    
             if (this.iframe) {
-    
                 this.iframe.style.display = "none";
-    
             }
-    
         },
 
         /**
@@ -2999,37 +2781,44 @@ version: 2.3.0
                 nDimensionOffset = (nOffset * 2),
                 aXY;
 
-
             if (oIFrame) {
-
                 // Size <iframe>
-
-                oIFrame.style.width = 
-                    (oElement.offsetWidth + nDimensionOffset + "px");
-
-                oIFrame.style.height = 
-                    (oElement.offsetHeight + nDimensionOffset + "px");
-
+                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
+                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");
 
                 // Position <iframe>
-
                 aXY = this.cfg.getProperty("xy");
 
                 if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
-
                     this.syncPosition();
-
                     aXY = this.cfg.getProperty("xy");
-
                 }
-
                 Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+            }
+        },
 
+        /**
+         * Sets the zindex of the iframe shim, if it exists, based on the zindex of
+         * the Overlay element. The zindex of the iframe is set to be one less 
+         * than the Overlay element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Overlay element
+         * to ensure that the iframe shim has a non-negative zindex.
+         * If you require the iframe zindex to be 0 or higher, the zindex of 
+         * the Overlay element should be set to a value greater than 0, before 
+         * this method is called.
+         * </p>
+         * @method stackIframe
+         */
+        stackIframe: function () {
+            if (this.iframe) {
+                var overlayZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) {
+                    Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1));
+                }
             }
-        
         },
 
-        
         /**
         * The default event handler fired when the "iframe" property is changed.
         * @method configIframe
@@ -3047,20 +2836,14 @@ version: 2.3.0
 
                 var oIFrame = this.iframe,
                     oElement = this.element,
-                    oParent,
-                    aXY;
-
+                    oParent;
 
                 if (!oIFrame) {
-
                     if (!m_oIFrameTemplate) {
-    
                         m_oIFrameTemplate = document.createElement("iframe");
 
                         if (this.isSecure) {
-        
                             m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
-        
                         }
 
                         /*
@@ -3068,25 +2851,19 @@ version: 2.3.0
                             doesn't modify the opacity of any transparent 
                             elements that may be on top of it (like a shadow).
                         */
-        
+
                         if (YAHOO.env.ua.ie) {
-        
                             m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
-        
                             /*
                                  Need to set the "frameBorder" property to 0 
                                  supress the default <iframe> border in IE.  
                                  Setting the CSS "border" property alone 
                                  doesn't supress it.
                             */
-        
                             m_oIFrameTemplate.frameBorder = 0;
-        
                         }
                         else {
-        
                             m_oIFrameTemplate.style.opacity = "0";
-                        
                         }
 
                         m_oIFrameTemplate.style.position = "absolute";
@@ -3094,109 +2871,91 @@ version: 2.3.0
                         m_oIFrameTemplate.style.margin = "0";
                         m_oIFrameTemplate.style.padding = "0";
                         m_oIFrameTemplate.style.display = "none";
-    
                     }
 
                     oIFrame = m_oIFrameTemplate.cloneNode(false);
-
                     oParent = oElement.parentNode;
 
-                    if (oParent) {
-
-                        oParent.appendChild(oIFrame);
-
-                    } else {
-
-                        document.body.appendChild(oIFrame);
+                    var parentNode = oParent || document.body;
 
-                    }
-                    
+                    this._addToParent(parentNode, oIFrame);
                     this.iframe = oIFrame;
-
                 }
 
-
                 /*
                      Show the <iframe> before positioning it since the "setXY" 
                      method of DOM requires the element be in the document 
                      and visible.
                 */
-
                 this.showIframe();
 
-
                 /*
                      Syncronize the size and position of the <iframe> to that 
                      of the Overlay.
                 */
-                
                 this.syncIframe();
-
+                this.stackIframe();
 
                 // Add event listeners to update the <iframe> when necessary
-
                 if (!this._hasIframeEventListeners) {
-
                     this.showEvent.subscribe(this.showIframe);
                     this.hideEvent.subscribe(this.hideIframe);
                     this.changeContentEvent.subscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = true;
-                    
                 }
-                
             }
 
-
             function onBeforeShow() {
-            
                 createIFrame.call(this);
-        
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                 this._iframeDeferred = false;
-            
             }
-            
 
             if (bIFrame) { // <iframe> shim is enabled
-                
-                if (this.cfg.getProperty("visible")) {
 
+                if (this.cfg.getProperty("visible")) {
                     createIFrame.call(this);
-                
-                }
-                else {
-
+                } else {
                     if (!this._iframeDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-
                         this._iframeDeferred = true;
-                    
                     }
-                
                 }
-    
+
             } else {    // <iframe> shim is disabled
-    
                 this.hideIframe();
 
                 if (this._hasIframeEventListeners) {
-
                     this.showEvent.unsubscribe(this.showIframe);
                     this.hideEvent.unsubscribe(this.hideIframe);
                     this.changeContentEvent.unsubscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = false;
-
                 }
-                
             }
-    
         },
-        
-        
+
+        /**
+         * Set's the container's XY value from DOM if not already set.
+         * 
+         * Differs from syncPosition, in that the XY value is only sync'd with DOM if 
+         * not already set. The method also refire's the XY config property event, so any
+         * beforeMove, Move event listeners are invoked.
+         * 
+         * @method _primeXYFromDOM
+         * @protected
+         */
+        _primeXYFromDOM : function() {
+            if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) {
+                // Set CFG XY based on DOM XY
+                this.syncPosition();
+                // Account for XY being set silently in syncPosition (no moveTo fired/called)
+                this.cfg.refireEvent("xy");
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
+            }
+        },
+
         /**
         * The default event handler fired when the "constraintoviewport" 
         * property is changed.
@@ -3209,28 +2968,22 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configConstrainToViewport: function (type, args, obj) {
-    
             var val = args[0];
-    
+
             if (val) {
-    
-                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
-                    this.enforceConstraints, this)) {
-    
-                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
-                        this, true);
-    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
+                }
+                if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) {
+                    this.beforeShowEvent.subscribe(this._primeXYFromDOM);
                 }
-    
             } else {
-    
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
                 this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
-    
             }
-    
         },
-        
-        /**
+
+         /**
         * The default event handler fired when the "context" property 
         * is changed.
         * @method configContext
@@ -3246,39 +2999,28 @@ version: 2.3.0
                 contextEl,
                 elementMagnetCorner,
                 contextMagnetCorner;
-            
+
             if (contextArgs) {
-            
                 contextEl = contextArgs[0];
                 elementMagnetCorner = contextArgs[1];
                 contextMagnetCorner = contextArgs[2];
                 
                 if (contextEl) {
-    
                     if (typeof contextEl == "string") {
-    
                         this.cfg.setProperty("context", 
                             [document.getElementById(contextEl), 
                                 elementMagnetCorner, contextMagnetCorner], 
                                 true);
-    
                     }
                     
                     if (elementMagnetCorner && contextMagnetCorner) {
-    
                         this.align(elementMagnetCorner, contextMagnetCorner);
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * Aligns the Overlay to its context element using the specified corner 
         * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
@@ -3290,45 +3032,34 @@ version: 2.3.0
         * that the elementAlign corner should stick to.
         */
         align: function (elementAlign, contextAlign) {
-    
+
             var contextArgs = this.cfg.getProperty("context"),
                 me = this,
                 context,
                 element,
                 contextRegion;
-    
-    
+
             function doAlign(v, h) {
     
                 switch (elementAlign) {
     
                 case Overlay.TOP_LEFT:
-    
                     me.moveTo(h, v);
-    
                     break;
     
                 case Overlay.TOP_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), v);
-    
                     break;
     
                 case Overlay.BOTTOM_LEFT:
-    
                     me.moveTo(h, (v - element.offsetHeight));
-    
                     break;
     
                 case Overlay.BOTTOM_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), 
                         (v - element.offsetHeight));
-    
                     break;
-    
                 }
-    
             }
     
     
@@ -3339,47 +3070,33 @@ version: 2.3.0
                 me = this;
                 
                 if (! elementAlign) {
-    
                     elementAlign = contextArgs[1];
-    
                 }
                 
                 if (! contextAlign) {
-    
                     contextAlign = contextArgs[2];
-    
                 }
                 
                 if (element && context) {
-    
                     contextRegion = Dom.getRegion(context);
-                    
+
                     switch (contextAlign) {
     
                     case Overlay.TOP_LEFT:
-    
                         doAlign(contextRegion.top, contextRegion.left);
-    
                         break;
     
                     case Overlay.TOP_RIGHT:
-    
                         doAlign(contextRegion.top, contextRegion.right);
-    
                         break;
     
                     case Overlay.BOTTOM_LEFT:
-    
                         doAlign(contextRegion.bottom, contextRegion.left);
-    
                         break;
     
                     case Overlay.BOTTOM_RIGHT:
-    
                         doAlign(contextRegion.bottom, contextRegion.right);
-    
                         break;
-    
                     }
     
                 }
@@ -3387,7 +3104,7 @@ version: 2.3.0
             }
             
         },
-        
+
         /**
         * The default event handler executed when the moveEvent is fired, if the 
         * "constraintoviewport" is set to true.
@@ -3399,70 +3116,96 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         enforceConstraints: function (type, args, obj) {
-    
-            var pos = args[0],
-                x = pos[0],
-                y = pos[1],
-                offsetHeight = this.element.offsetHeight,
-                offsetWidth = this.element.offsetWidth,
+            var pos = args[0];
+            var cXY = this.getConstrainedXY(pos[0], pos[1]);
+            this.cfg.setProperty("x", cXY[0], true);
+            this.cfg.setProperty("y", cXY[1], true);
+            this.cfg.setProperty("xy", cXY, true);
+        },
+
+        /**
+         * Given x, y coordinate values, returns the calculated coordinates required to 
+         * position the Overlay if it is to be constrained to the viewport, based on the 
+         * current element size, viewport dimensions and scroll values.
+         *
+         * @param {Number} x The X coordinate value to be constrained
+         * @param {Number} y The Y coordinate value to be constrained
+         * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively;
+         */
+        getConstrainedXY: function(x, y) {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 viewPortWidth = Dom.getViewportWidth(),
                 viewPortHeight = Dom.getViewportHeight(),
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
                 scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-                topConstraint = scrollY + 10,
-                leftConstraint = scrollX + 10,
-                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
-                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-        
-    
-            if (x < leftConstraint) {
-    
-                x = leftConstraint;
-    
-            } else if (x > rightConstraint) {
-    
-                x = rightConstraint;
-    
+                scrollY = Dom.getDocumentScrollTop();
+
+            var xNew = x;
+            var yNew = y;
+
+            if (offsetWidth + nViewportOffset < viewPortWidth) {
+
+                var leftConstraint = scrollX + nViewportOffset;
+                var rightConstraint = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+
+                if (x < leftConstraint) {
+                    xNew = leftConstraint;
+                } else if (x > rightConstraint) {
+                    xNew = rightConstraint;
+                }
+            } else {
+                xNew = nViewportOffset + scrollX;
             }
-            
-            if (y < topConstraint) {
-    
-                y = topConstraint;
-    
-            } else if (y > bottomConstraint) {
-    
-                y = bottomConstraint;
-    
+
+            if (offsetHeight + nViewportOffset < viewPortHeight) {
+
+                var topConstraint = scrollY + nViewportOffset;
+                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+
+                if (y < topConstraint) {
+                    yNew  = topConstraint;
+                } else if (y  > bottomConstraint) {
+                    yNew  = bottomConstraint;
+                }
+            } else {
+                yNew = nViewportOffset + scrollY;
             }
-            
-            this.cfg.setProperty("x", x, true);
-            this.cfg.setProperty("y", y, true);
-            this.cfg.setProperty("xy", [x, y], true);
-    
+
+            return [xNew, yNew];
         },
-        
+
         /**
         * Centers the container in the viewport.
         * @method center
         */
         center: function () {
-    
-            var scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-    
-                viewPortWidth = Dom.getClientWidth(),
-                viewPortHeight = Dom.getClientHeight(),
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 elementWidth = this.element.offsetWidth,
                 elementHeight = this.element.offsetHeight,
-                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
-                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-            
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                x,
+                y;
+
+            if (elementWidth < viewPortWidth) {
+                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
+            } else {
+                x = nViewportOffset + Dom.getDocumentScrollLeft();
+            }
+
+            if (elementHeight < viewPortHeight) {
+                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
+            } else {
+                y = nViewportOffset + Dom.getDocumentScrollTop();
+            }
+
             this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
-            
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * Synchronizes the Panel's "xy", "x", and "y" properties with the 
         * Panel's position in the DOM. This is primarily used to update  
@@ -3470,15 +3213,15 @@ version: 2.3.0
         * @method syncPosition
         */
         syncPosition: function () {
-    
+
             var pos = Dom.getXY(this.element);
-    
+
             this.cfg.setProperty("x", pos[0], true);
             this.cfg.setProperty("y", pos[1], true);
             this.cfg.setProperty("xy", pos, true);
-    
+
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -3486,11 +3229,11 @@ version: 2.3.0
         * @param {Object} obj The scope object
         */
         onDomResize: function (e, obj) {
-    
+
             var me = this;
-    
+
             Overlay.superclass.onDomResize.call(this, e, obj);
-    
+
             setTimeout(function () {
                 me.syncPosition();
                 me.cfg.refireEvent("iframe");
@@ -3504,96 +3247,82 @@ version: 2.3.0
         * YAHOO.widget.Overlay.
         * @method bringToTop
         */
-        bringToTop: function() {
-    
+        bringToTop: function () {
+
             var aOverlays = [],
                 oElement = this.element;
-    
+
             function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
-        
+
                 var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
-        
                     sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
-        
-                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
-                        0 : parseInt(sZIndex1, 10),
-        
-                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
-                        0 : parseInt(sZIndex2, 10);
-        
+
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
+
                 if (nZIndex1 > nZIndex2) {
-        
                     return -1;
-        
                 } else if (nZIndex1 < nZIndex2) {
-        
                     return 1;
-        
                 } else {
-        
                     return 0;
-        
                 }
-        
             }
-        
+
             function isOverlayElement(p_oElement) {
-        
+
                 var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                     Panel = YAHOO.widget.Panel;
-            
+
                 if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
-                
                     if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
-        
                         aOverlays[aOverlays.length] = p_oElement.parentNode;
-                    
-                    }
-                    else {
-        
+                    } else {
                         aOverlays[aOverlays.length] = p_oElement;
-        
                     }
-                
                 }
-            
             }
-            
+
             Dom.getElementsBy(isOverlayElement, "DIV", document.body);
-    
+
             aOverlays.sort(compareZIndexDesc);
-            
+
             var oTopOverlay = aOverlays[0],
                 nTopZIndex;
-            
+
             if (oTopOverlay) {
-    
                 nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
-    
-                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
-    
-                    this.cfg.setProperty("zindex", 
-                        (parseInt(nTopZIndex, 10) + 2));
-    
+
+                if (!isNaN(nTopZIndex)) {
+                    var bRequiresBump = false;
+
+                    if (oTopOverlay != oElement) {
+                        bRequiresBump = true;
+                    } else if (aOverlays.length > 1) {
+                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
+                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                            bRequiresBump = true;
+                        }
+                    }
+                    if (bRequiresBump) {
+                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                    }
                 }
-            
             }
-        
         },
-        
+
         /**
         * Removes the Overlay element from the DOM and sets all child 
         * elements to null.
         * @method destroy
         */
         destroy: function () {
-    
+
             if (this.iframe) {
-    
                 this.iframe.parentNode.removeChild(this.iframe);
-    
             }
-        
+
             this.iframe = null;
         
             Overlay.windowResizeEvent.unsubscribe(
@@ -3611,14 +3340,12 @@ version: 2.3.0
         * @return {String} The string representation of the Overlay.
         */
         toString: function () {
-    
             return "Overlay " + this.id;
-    
         }
-    
+
     });
-    
 }());
+
 (function () {
     
     /**
@@ -3634,19 +3361,15 @@ version: 2.3.0
     * configuration of the OverlayManager
     */
     YAHOO.widget.OverlayManager = function (userConfig) {
-    
         this.init(userConfig);
-    
     };
 
-
     var Overlay = YAHOO.widget.Overlay,
         Event = YAHOO.util.Event,
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         CustomEvent = YAHOO.util.CustomEvent,
         OverlayManager = YAHOO.widget.OverlayManager;
-
     
     /**
     * The CSS class representing a focused Overlay
@@ -3695,9 +3418,9 @@ version: 2.3.0
             * @default "mousedown"
             */
             this.cfg.addProperty("focusevent", { value: "mousedown" } );
-        
+
         },
-        
+
         /**
         * Initializes the OverlayManager
         * @method init
@@ -3715,14 +3438,14 @@ version: 2.3.0
             * @type Config
             */
             this.cfg = new Config(this);
-        
+
             this.initDefaultConfig();
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
             this.cfg.fireQueue();
-        
+
             /**
             * The currently activated Overlay
             * @property activeOverlay
@@ -3730,7 +3453,7 @@ version: 2.3.0
             * @type YAHOO.widget.Overlay
             */
             var activeOverlay = null;
-        
+
             /**
             * Returns the currently focused Overlay
             * @method getActive
@@ -3739,7 +3462,7 @@ version: 2.3.0
             this.getActive = function () {
                 return activeOverlay;
             };
-        
+
             /**
             * Focuses the specified Overlay
             * @method focus
@@ -3747,32 +3470,22 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to focus
             */
             this.focus = function (overlay) {
-        
                 var o = this.find(overlay);
-        
                 if (o) {
-        
                     if (activeOverlay != o) {
-        
                         if (activeOverlay) {
-        
                             activeOverlay.blur();
-        
                         }
-        
                         this.bringToTop(o);
-                        
+
                         activeOverlay = o;
-        
+
                         Dom.addClass(activeOverlay.element, 
                             OverlayManager.CSS_FOCUSED);
 
                         o.focusEvent.fire();
-                        
                     }
-        
                 }
-        
             };
         
             /**
@@ -3782,53 +3495,47 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to remove
             */
             this.remove = function (overlay) {
-    
-                var o = this.find(overlay),
-                    originalZ;
-        
+                var o = this.find(overlay), 
+                        originalZ;
                 if (o) {
-
                     if (activeOverlay == o) {
-                    
                         activeOverlay = null;
-                    
                     }
 
-                    originalZ = Dom.getStyle(o.element, "zIndex");
+                    var bDestroyed = (o.element === null && o.cfg === null) ? true : false;
 
-                    o.cfg.setProperty("zIndex", -1000, true);
+                    if (!bDestroyed) {
+                        // Set it's zindex so that it's sorted to the end.
+                        originalZ = Dom.getStyle(o.element, "zIndex");
+                        o.cfg.setProperty("zIndex", -1000, true);
+                    }
 
                     this.overlays.sort(this.compareZIndexDesc);
+                    this.overlays = this.overlays.slice(0, (this.overlays.length - 1));
 
-                    this.overlays = 
-                        this.overlays.slice(0, (this.overlays.length - 1));
-        
                     o.hideEvent.unsubscribe(o.blur);
                     o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
-        
-                    if (o.element) {
-        
+
+                    if (!bDestroyed) {
                         Event.removeListener(o.element, 
-                            this.cfg.getProperty("focusevent"), 
-                            this._onOverlayElementFocus);
-        
+                                    this.cfg.getProperty("focusevent"), 
+                                    this._onOverlayElementFocus);
+
+                        o.cfg.setProperty("zIndex", originalZ, true);
+                        o.cfg.setProperty("manager", null);
                     }
-        
-                    o.cfg.setProperty("zIndex", originalZ, true);
-                    o.cfg.setProperty("manager", null);
-        
+
                     o.focusEvent.unsubscribeAll();
                     o.blurEvent.unsubscribeAll();
-        
+
                     o.focusEvent = null;
                     o.blurEvent = null;
-        
+
                     o.focus = null;
                     o.blur = null;
                 }
-
             };
-        
+
             /**
             * Removes focus from all registered Overlays in the manager
             * @method blurAll
@@ -3839,28 +3546,19 @@ version: 2.3.0
                     i;
 
                 if (nOverlays > 0) {
-
                     i = nOverlays - 1;
-                    
-                    do {
 
-                        this.overlays[i].blur();                    
-                    
+                    do {
+                        this.overlays[i].blur();
                     }
                     while(i--);
-                
                 }
-    
             };
         
-        
             this._onOverlayBlur = function (p_sType, p_aArgs) {
-
                 activeOverlay = null;
-
             };
         
-        
             var overlays = this.cfg.getProperty("overlays");
         
             if (! this.overlays) {
@@ -3887,20 +3585,12 @@ version: 2.3.0
         
             var oTarget = Event.getTarget(p_oEvent),
                 oClose = this.close;
-        
-            
-            if (oClose && (oTarget == oClose || 
-                    Dom.isAncestor(oClose, oTarget))) {
             
+            if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) {
                 this.blur();
-            
-            }
-            else {
-            
+            } else {
                 this.focus();
-            
             }
-        
         },
         
         
@@ -3916,9 +3606,7 @@ version: 2.3.0
         * fired the event.
         */
         _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
-        
             this.remove(p_oOverlay);
-        
         },
         
         /**
@@ -3942,10 +3630,10 @@ version: 2.3.0
             if (overlay instanceof Overlay) {
 
                 overlay.cfg.addProperty("manager", { value: this } );
-        
+
                 overlay.focusEvent = overlay.createEvent("focus");
                 overlay.focusEvent.signature = CustomEvent.LIST;
-        
+
                 overlay.blurEvent = overlay.createEvent("blur");
                 overlay.blurEvent.signature = CustomEvent.LIST;
         
@@ -3954,43 +3642,29 @@ version: 2.3.0
                 };
         
                 overlay.blur = function () {
-    
                     if (mgr.getActive() == this) {
-
-                        Dom.removeClass(this.element, 
-                            OverlayManager.CSS_FOCUSED);
-
+                        Dom.removeClass(this.element, OverlayManager.CSS_FOCUSED);
                         this.blurEvent.fire();
-
                     }
-
                 };
         
                 overlay.blurEvent.subscribe(mgr._onOverlayBlur);
-        
                 overlay.hideEvent.subscribe(overlay.blur);
                 
-                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
-                    overlay, this);
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, overlay, this);
         
                 Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
-                    this._onOverlayElementFocus, null, overlay);
+                            this._onOverlayElementFocus, null, overlay);
         
                 zIndex = Dom.getStyle(overlay.element, "zIndex");
 
                 if (!isNaN(zIndex)) {
-
                     overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
-
                 } else {
-
                     overlay.cfg.setProperty("zIndex", 0);
-
                 }
-        
 
                 this.overlays.push(overlay);
-
                 this.bringToTop(overlay);
 
                 return true;
@@ -4001,26 +3675,17 @@ version: 2.3.0
                 nOverlays = overlay.length;
 
                 for (i = 0; i < nOverlays; i++) {
-
                     if (this.register(overlay[i])) {
-
                         regcount++;
-
                     }
                 }
 
                 if (regcount > 0) {
-
                     return true;
-
                 }
-
             } else {
-
                 return false;
-
             }
-
         },
 
         /**
@@ -4042,30 +3707,36 @@ version: 2.3.0
             if (oOverlay) {
 
                 aOverlays = this.overlays;
-
                 aOverlays.sort(this.compareZIndexDesc);
-                
+
                 oTopOverlay = aOverlays[0];
-                
-                if (oTopOverlay) {
 
+                if (oTopOverlay) {
                     nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
-    
-                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
-    
-                        oOverlay.cfg.setProperty("zIndex", 
-                            (parseInt(nTopZIndex, 10) + 2));
-    
+
+                    if (!isNaN(nTopZIndex)) {
+
+                        var bRequiresBump = false;
+
+                        if (oTopOverlay !== oOverlay) {
+                            bRequiresBump = true;
+                        } else if (aOverlays.length > 1) {
+                            var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex");
+                            // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                            if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                                bRequiresBump = true;
+                            }
+                        }
+
+                        if (bRequiresBump) {
+                            oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                        }
                     }
-    
                     aOverlays.sort(this.compareZIndexDesc);
-                
                 }
-
             }
-        
         },
-        
+
         /**
         * Attempts to locate an Overlay by instance or ID.
         * @method find
@@ -4075,47 +3746,32 @@ version: 2.3.0
         * cannot be located.
         */
         find: function (overlay) {
-        
+
             var aOverlays = this.overlays,
                 nOverlays = aOverlays.length,
                 i;
 
             if (nOverlays > 0) {
-
                 i = nOverlays - 1;
 
                 if (overlay instanceof Overlay) {
-
                     do {
-
                         if (aOverlays[i] == overlay) {
-
                             return aOverlays[i];
-
                         }
-                    
                     }
                     while(i--);
 
                 } else if (typeof overlay == "string") {
-
                     do {
-
                         if (aOverlays[i].id == overlay) {
-
                             return aOverlays[i];
-
                         }
-
                     }
                     while(i--);
-
                 }
-
                 return null;
-            
             }
-
         },
         
         /**
@@ -4126,11 +3782,17 @@ version: 2.3.0
         * fall in the stacking order.
         */
         compareZIndexDesc: function (o1, o2) {
-    
-            var zIndex1 = o1.cfg.getProperty("zIndex"),
-                zIndex2 = o2.cfg.getProperty("zIndex");
-        
-            if (zIndex1 > zIndex2) {
+
+            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
+                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.
+
+            if (zIndex1 === null && zIndex2 === null) {
+                return 0;
+            } else if (zIndex1 === null){
+                return 1;
+            } else if (zIndex2 === null) {
+                return -1;
+            } else if (zIndex1 > zIndex2) {
                 return -1;
             } else if (zIndex1 < zIndex2) {
                 return 1;
@@ -4150,20 +3812,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].show();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Hides all Overlays in the manager.
         * @method hideAll
@@ -4175,20 +3831,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].hide();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Returns a string representation of the object.
         * @method toString
@@ -4197,10 +3847,10 @@ version: 2.3.0
         toString: function () {
             return "OverlayManager";
         }
-    
     };
 
 }());
+
 (function () {
 
     /**
@@ -4218,19 +3868,17 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Tooltip = function (el, userConfig) {
-    
         YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
         Dom = YAHOO.util.Dom,
         Tooltip = YAHOO.widget.Tooltip,
-    
+
         m_oShadowTemplate,
-        
+
         /**
         * Constant representing the Tooltip's configuration properties
         * @property DEFAULT_CONFIG
@@ -4239,44 +3887,61 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "PREVENT_OVERLAP": { 
                 key: "preventoverlap", 
                 value: true, 
                 validator: Lang.isBoolean, 
                 supercedes: ["x", "y", "xy"] 
             },
-        
+
             "SHOW_DELAY": { 
                 key: "showdelay", 
                 value: 200, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "AUTO_DISMISS_DELAY": { 
                 key: "autodismissdelay", 
                 value: 5000, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "HIDE_DELAY": { 
                 key: "hidedelay", 
                 value: 250, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "TEXT": { 
                 key: "text", 
                 suppressEvent: true 
             }, 
-        
+
             "CONTAINER": { 
                 key: "container"
+            },
+
+            "DISABLED": {
+                key: "disabled",
+                value: false,
+                suppressEvent: true
             }
-        
+        },
+
+        /**
+        * Constant representing the name of the Tooltip's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+            "CONTEXT_MOUSE_OVER": "contextMouseOver",
+            "CONTEXT_MOUSE_OUT": "contextMouseOut",
+            "CONTEXT_TRIGGER": "contextTrigger"
         };
 
-    
     /**
     * Constant representing the Tooltip CSS class
     * @property YAHOO.widget.Tooltip.CSS_TOOLTIP
@@ -4286,13 +3951,11 @@ version: 2.3.0
     */
     Tooltip.CSS_TOOLTIP = "yui-tt";
 
-
     /* 
         "hide" event handler that sets a Tooltip instance's "width"
         configuration property back to its original value before 
         "setWidthToOffsetWidth" was called.
     */
-    
     function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
 
         var sOriginalWidth = p_oObject[0],
@@ -4301,13 +3964,10 @@ version: 2.3.0
             sCurrentWidth = oConfig.getProperty("width");
 
         if (sCurrentWidth == sNewWidth) {
-            
             oConfig.setProperty("width", sOriginalWidth);
-        
         }
 
         this.unsubscribe("hide", this._onHide, p_oObject);
-    
     }
 
     /* 
@@ -4324,7 +3984,6 @@ version: 2.3.0
             sNewWidth,
             oClone;
 
-        
         if ((!sOriginalWidth || sOriginalWidth == "auto") && 
             (oConfig.getProperty("container") != oBody || 
             oConfig.getProperty("x") >= Dom.getViewportWidth() || 
@@ -4334,47 +3993,35 @@ version: 2.3.0
             oClone.style.visibility = "hidden";
             oClone.style.top = "0px";
             oClone.style.left = "0px";
-            
+
             oBody.appendChild(oClone);
 
             sNewWidth = (oClone.offsetWidth + "px");
-            
+
             oBody.removeChild(oClone);
-            
             oClone = null;
 
             oConfig.setProperty("width", sNewWidth);
-            
             oConfig.refireEvent("xy");
-            
-            this.subscribe("hide", restoreOriginalWidth, 
-                [(sOriginalWidth || ""), sNewWidth]);
-        
-        }
 
+            this.subscribe("hide", restoreOriginalWidth, [(sOriginalWidth || ""), sNewWidth]);
+        }
     }
 
-
     // "onDOMReady" that renders the ToolTip
 
     function onDOMReady(p_sType, p_aArgs, p_oObject) {
-    
         this.render(p_oObject);
-    
     }
 
-
     //  "init" event handler that automatically renders the Tooltip
 
     function onInit() {
-
         Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this);
-
     }
 
-    
     YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { 
-    
+
         /**
         * The Tooltip initialization method. This method is automatically 
         * called by the constructor. A Tooltip is automatically rendered by 
@@ -4388,34 +4035,95 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-    
+
             this.logger = new YAHOO.widget.LogWriter(this.toString());
-    
+
             Tooltip.superclass.init.call(this, el);
-    
+
             this.beforeInitEvent.fire(Tooltip);
-    
+
             Dom.addClass(this.element, Tooltip.CSS_TOOLTIP);
-    
-            if (userConfig) {
 
+            if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
-
             }
-    
+
             this.cfg.queueProperty("visible", false);
             this.cfg.queueProperty("constraintoviewport", true);
-    
+
             this.setBody("");
 
             this.subscribe("beforeShow", setWidthToOffsetWidth);
             this.subscribe("init", onInit);
             this.subscribe("render", this.onRender);
-    
+
             this.initEvent.fire(Tooltip);
+        },
+
+        /**
+        * Initializes the custom events for Tooltip
+        * @method initEvents
+        */
+        initEvents: function () {
+
+            Tooltip.superclass.initEvents.call(this);
+            var SIGNATURE = CustomEvent.LIST;
+
+            /**
+            * CustomEvent fired when user mouses over a context element. Returning false from
+            * a subscriber to this event will prevent the tooltip from being displayed for
+            * the current context element.
+            * 
+            * @event contextMouseOverEvent
+            * @param {HTMLElement} context The context element which the user just moused over
+            * @param {DOMEvent} e The DOM event object, associated with the mouse over
+            */
+            this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER);
+            this.contextMouseOverEvent.signature = SIGNATURE;
 
+            /**
+            * CustomEvent fired when the user mouses out of a context element.
+            * 
+            * @event contextMouseOutEvent
+            * @param {HTMLElement} context The context element which the user just moused out of
+            * @param {DOMEvent} e The DOM event object, associated with the mouse out
+            */
+            this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT);
+            this.contextMouseOutEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired just before the tooltip is displayed for the current context.
+            * <p>
+            *  You can subscribe to this event if you need to set up the text for the 
+            *  tooltip based on the context element for which it is about to be displayed.
+            * </p>
+            * <p>This event differs from the beforeShow event in following respects:</p>
+            * <ol>
+            *   <li>
+            *    When moving from one context element to another, if the tooltip is not
+            *    hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not
+            *    be fired when the tooltip is displayed for the new context since it is already visible.
+            *    However the contextTrigger event is always fired before displaying the tooltip for
+            *    a new context.
+            *   </li>
+            *   <li>
+            *    The trigger event provides access to the context element, allowing you to 
+            *    set the text of the tooltip based on context element for which the tooltip is
+            *    triggered.
+            *   </li>
+            * </ol>
+            * <p>
+            *  It is not possible to prevent the tooltip from being displayed
+            *  using this event. You can use the contextMouseOverEvent if you need to prevent
+            *  the tooltip from being displayed.
+            * </p>
+            * @event contextTriggerEvent
+            * @param {HTMLElement} context The context element for which the tooltip is triggered
+            */
+            this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER);
+            this.contextTriggerEvent.signature = SIGNATURE;
         },
-        
+
         /**
         * Initializes the class's configurable properties which can be 
         * changed using the Overlay's Config object (cfg).
@@ -4424,7 +4132,7 @@ version: 2.3.0
         initDefaultConfig: function () {
 
             Tooltip.superclass.initDefaultConfig.call(this);
-        
+
             /**
             * Specifies whether the Tooltip should be kept from overlapping 
             * its context element.
@@ -4437,7 +4145,7 @@ version: 2.3.0
                 validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
                 supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
             });
-        
+
             /**
             * The number of milliseconds to wait before showing a Tooltip 
             * on mouseover.
@@ -4450,7 +4158,7 @@ version: 2.3.0
                 value: 200, 
                 validator: DEFAULT_CONFIG.SHOW_DELAY.validator
             });
-        
+
             /**
             * The number of milliseconds to wait before automatically 
             * dismissing a Tooltip after the mouse has been resting on the 
@@ -4464,7 +4172,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
                 validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
             });
-        
+
             /**
             * The number of milliseconds to wait before hiding a Tooltip 
             * on mouseover.
@@ -4477,9 +4185,9 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.HIDE_DELAY.value, 
                 validator: DEFAULT_CONFIG.HIDE_DELAY.validator
             });
-        
+
             /**
-            * Specifies the Tooltip's text.
+            * Specifies the Tooltip's text. 
             * @config text
             * @type String
             * @default null
@@ -4500,7 +4208,23 @@ version: 2.3.0
                 handler: this.configContainer,
                 value: document.body
             });
-        
+
+            /**
+            * Specifies whether or not the tooltip is disabled. Disabled tooltips
+            * will not be displayed. If the tooltip is driven by the title attribute
+            * of the context element, the title attribute will still be removed for 
+            * disabled tooltips, to prevent default tooltip behavior.
+            * 
+            * @config disabled
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DISABLED.key, {
+                handler: this.configContainer,
+                value: DEFAULT_CONFIG.DISABLED.value,
+                supressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
+            });
+
             /**
             * Specifies the element or elements that the Tooltip should be 
             * anchored to on mouseover.
@@ -4559,16 +4283,11 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configContainer: function (type, args, obj) {
-
             var container = args[0];
 
             if (typeof container == 'string') {
-
-                this.cfg.setProperty("container", 
-                    document.getElementById(container), true);
-
+                this.cfg.setProperty("container", document.getElementById(container), true);
             }
-
         },
         
         /**
@@ -4583,36 +4302,20 @@ version: 2.3.0
                 nElements,
                 oElement,
                 i;
-        
-            
+
             if (aElements) {
-        
                 nElements = aElements.length;
-                
                 if (nElements > 0) {
-                
                     i = nElements - 1;
-                    
                     do {
-        
                         oElement = aElements[i];
-        
-                        Event.removeListener(oElement, "mouseover", 
-                            this.onContextMouseOver);
-
-                        Event.removeListener(oElement, "mousemove", 
-                            this.onContextMouseMove);
-
-                        Event.removeListener(oElement, "mouseout", 
-                            this.onContextMouseOut);
-                    
+                        Event.removeListener(oElement, "mouseover", this.onContextMouseOver);
+                        Event.removeListener(oElement, "mousemove", this.onContextMouseMove);
+                        Event.removeListener(oElement, "mouseout", this.onContextMouseOut);
                     }
                     while (i--);
-                
                 }
-        
             }
-        
         },
         
         /**
@@ -4632,72 +4335,47 @@ version: 2.3.0
                 nElements,
                 oElement,
                 i;
-            
-        
+
             if (context) {
-        
+
                 // Normalize parameter into an array
                 if (! (context instanceof Array)) {
-
                     if (typeof context == "string") {
-
-                        this.cfg.setProperty("context", 
-                            [document.getElementById(context)], true);
-
+                        this.cfg.setProperty("context", [document.getElementById(context)], true);
                     } else { // Assuming this is an element
-
                         this.cfg.setProperty("context", [context], true);
-
                     }
-
                     context = this.cfg.getProperty("context");
-
                 }
-        
-        
+
                 // Remove any existing mouseover/mouseout listeners
                 this._removeEventListeners();
-        
+
                 // Add mouseover/mouseout listeners to context elements
                 this._context = context;
-        
+
                 aElements = this._context;
-                
+
                 if (aElements) {
-            
                     nElements = aElements.length;
-                    
                     if (nElements > 0) {
-                    
                         i = nElements - 1;
-                        
                         do {
-            
                             oElement = aElements[i];
-            
-                            Event.on(oElement, "mouseover", 
-                                this.onContextMouseOver, this);
-
-                            Event.on(oElement, "mousemove", 
-                                this.onContextMouseMove, this);
-
-                            Event.on(oElement, "mouseout", 
-                                this.onContextMouseOut, this);
-                        
+                            Event.on(oElement, "mouseover", this.onContextMouseOver, this);
+                            Event.on(oElement, "mousemove", this.onContextMouseMove, this);
+                            Event.on(oElement, "mouseout", this.onContextMouseOut, this);
                         }
                         while (i--);
-                    
                     }
-            
                 }
-        
             }
         },
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
+
         // BEGIN BUILT-IN DOM EVENT HANDLERS //
-        
+
         /**
         * The default event handler fired when the user moves the mouse while 
         * over the context element.
@@ -4708,9 +4386,8 @@ version: 2.3.0
         onContextMouseMove: function (e, obj) {
             obj.pageX = Event.getPageX(e);
             obj.pageY = Event.getPageY(e);
-        
         },
-        
+
         /**
         * The default event handler fired when the user mouses over the 
         * context element.
@@ -4719,38 +4396,36 @@ version: 2.3.0
         * @param {Object} obj The object argument
         */
         onContextMouseOver: function (e, obj) {
-        
             var context = this;
-        
-            if (obj.hideProcId) {
-
-                clearTimeout(obj.hideProcId);
-
-                obj.logger.log("Clearing hide timer: " + 
-                    obj.hideProcId, "time");
-
-                obj.hideProcId = null;
 
-            }
-        
-            Event.on(context, "mousemove", obj.onContextMouseMove, obj);
-        
             if (context.title) {
                 obj._tempTitle = context.title;
                 context.title = "";
             }
-        
-            /**
-            * The unique process ID associated with the thread responsible 
-            * for showing the Tooltip.
-            * @type int
-            */
-            obj.showProcId = obj.doShow(e, context);
-            obj.logger.log("Setting show tooltip timeout: " + 
-                obj.showProcId, "time");
 
+            // Fire first, to honor disabled set in the listner
+            if (obj.fireEvent("contextMouseOver", context, e) !== false 
+                    && !obj.cfg.getProperty("disabled")) {
+
+                // Stop the tooltip from being hidden (set on last mouseout)
+                if (obj.hideProcId) {
+                    clearTimeout(obj.hideProcId);
+                    obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time");
+                    obj.hideProcId = null;
+                }
+
+                Event.on(context, "mousemove", obj.onContextMouseMove, obj);
+
+                /**
+                * The unique process ID associated with the thread responsible 
+                * for showing the Tooltip.
+                * @type int
+                */
+                obj.showProcId = obj.doShow(e, context);
+                obj.logger.log("Setting show tooltip timeout: " + obj.showProcId, "time");
+            }
         },
-        
+
         /**
         * The default event handler fired when the user mouses out of 
         * the context element.
@@ -4760,36 +4435,33 @@ version: 2.3.0
         */
         onContextMouseOut: function (e, obj) {
             var el = this;
-        
+
             if (obj._tempTitle) {
                 el.title = obj._tempTitle;
                 obj._tempTitle = null;
             }
-        
+
             if (obj.showProcId) {
                 clearTimeout(obj.showProcId);
-                obj.logger.log("Clearing show timer: " + 
-                    obj.showProcId, "time");
+                obj.logger.log("Clearing show timer: " + obj.showProcId, "time");
                 obj.showProcId = null;
             }
-        
+
             if (obj.hideProcId) {
                 clearTimeout(obj.hideProcId);
-                obj.logger.log("Clearing hide timer: " + 
-                    obj.hideProcId, "time");
+                obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time");
                 obj.hideProcId = null;
             }
-        
-        
+
+            obj.fireEvent("contextMouseOut", el, e);
+
             obj.hideProcId = setTimeout(function () {
                 obj.hide();
-    
             }, obj.cfg.getProperty("hidedelay"));
-    
         },
-        
+
         // END BUILT-IN DOM EVENT HANDLERS //
-        
+
         /**
         * Processes the showing of the Tooltip by setting the timeout delay 
         * and offset of the Tooltip.
@@ -4799,45 +4471,45 @@ version: 2.3.0
         * with doShow
         */
         doShow: function (e, context) {
-        
+
             var yOffset = 25,
                 me = this;
-        
+
             if (YAHOO.env.ua.opera && context.tagName && 
                 context.tagName.toUpperCase() == "A") {
-
                 yOffset += 12;
-
             }
-        
+
             return setTimeout(function () {
-        
-                if (me._tempTitle) {
+
+                var txt = me.cfg.getProperty("text");
+
+                // title does not over-ride text
+                if (me._tempTitle && (txt === "" || YAHOO.lang.isUndefined(txt) || YAHOO.lang.isNull(txt))) {
                     me.setBody(me._tempTitle);
                 } else {
                     me.cfg.refireEvent("text");
                 }
-        
+
                 me.logger.log("Show tooltip", "time");
                 me.moveTo(me.pageX, me.pageY + yOffset);
 
                 if (me.cfg.getProperty("preventoverlap")) {
                     me.preventOverlap(me.pageX, me.pageY);
                 }
-        
-                Event.removeListener(context, "mousemove", 
-                    me.onContextMouseMove);
-        
+
+                Event.removeListener(context, "mousemove", me.onContextMouseMove);
+
+                me.contextTriggerEvent.fire(context);
+
                 me.show();
-                me.hideProcId = me.doHide();
 
-                me.logger.log("Hide tooltip time active: " +
-                    me.hideProcId, "time");
+                me.hideProcId = me.doHide();
+                me.logger.log("Hide tooltip time active: " + me.hideProcId, "time");
 
             }, this.cfg.getProperty("showdelay"));
-        
         },
-        
+
         /**
         * Sets the timeout for the auto-dismiss delay, which by default is 5 
         * seconds, meaning that a tooltip will automatically dismiss itself 
@@ -4845,18 +4517,18 @@ version: 2.3.0
         * @method doHide
         */
         doHide: function () {
-        
+
             var me = this;
-        
+
             me.logger.log("Setting hide tooltip timeout", "time");
-        
+
             return setTimeout(function () {
-        
+
                 me.logger.log("Hide tooltip", "time");
                 me.hide();
-        
+
             }, this.cfg.getProperty("autodismissdelay"));
-        
+
         },
         
         /**
@@ -4903,29 +4575,21 @@ version: 2.3.0
                     oShadow = this._shadow;
             
                 if (oShadow) {
-            
                     oShadow.style.width = (oElement.offsetWidth + 6) + "px";
                     oShadow.style.height = (oElement.offsetHeight + 1) + "px"; 
-            
                 }
             
             }
 
-
             function addShadowVisibleClass() {
-            
                 Dom.addClass(this._shadow, "yui-tt-shadow-visible");
-            
             }
             
 
             function removeShadowVisibleClass() {
-        
                 Dom.removeClass(this._shadow, "yui-tt-shadow-visible");
-            
             }
-    
-    
+
             function createShadow() {
     
                 var oShadow = this._shadow,
@@ -4940,73 +4604,49 @@ version: 2.3.0
                     Module = YAHOO.widget.Module;
                     nIE = YAHOO.env.ua.ie;
                     me = this;
-    
+
                     if (!m_oShadowTemplate) {
-        
                         m_oShadowTemplate = document.createElement("div");
                         m_oShadowTemplate.className = "yui-tt-shadow";
-                    
                     }
-        
+
                     oShadow = m_oShadowTemplate.cloneNode(false);
-        
+
                     oElement.appendChild(oShadow);
-                    
+
                     this._shadow = oShadow;
-    
+
                     addShadowVisibleClass.call(this);
-        
+
                     this.subscribe("beforeShow", addShadowVisibleClass);
                     this.subscribe("beforeHide", removeShadowVisibleClass);
 
-                    if (nIE == 6 || 
-                        (nIE == 7 && document.compatMode == "BackCompat")) {
-                
+                    if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
                         window.setTimeout(function () { 
-        
                             sizeShadow.call(me); 
-        
                         }, 0);
     
                         this.cfg.subscribeToConfigEvent("width", sizeShadow);
                         this.cfg.subscribeToConfigEvent("height", sizeShadow);
                         this.subscribe("changeContent", sizeShadow);
-    
-                        Module.textResizeEvent.subscribe(sizeShadow, 
-                                                            this, true);
-                        
+
+                        Module.textResizeEvent.subscribe(sizeShadow, this, true);
                         this.subscribe("destroy", function () {
-                        
-                            Module.textResizeEvent.unsubscribe(sizeShadow, 
-                                                                    this);
-                        
+                            Module.textResizeEvent.unsubscribe(sizeShadow, this);
                         });
-                
                     }
-                
                 }
-    
             }
-    
-    
+
             function onBeforeShow() {
-            
                 createShadow.call(this);
-    
                 this.unsubscribe("beforeShow", onBeforeShow);
-            
             }
-    
-    
+
             if (this.cfg.getProperty("visible")) {
-    
                 createShadow.call(this);
-            
-            }
-            else {
-    
+            } else {
                 this.subscribe("beforeShow", onBeforeShow);
-            
             }
         
         },
@@ -5020,7 +4660,7 @@ version: 2.3.0
         
             // Remove any existing mouseover/mouseout listeners
             this._removeEventListeners();
-        
+
             Tooltip.superclass.destroy.call(this);  
         
         },
@@ -5037,6 +4677,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -5044,7 +4685,7 @@ version: 2.3.0
     * with a draggable header and an optional close icon at the top right.
     * @namespace YAHOO.widget
     * @class Panel
-    * @extends Overlay
+    * @extends YAHOO.widget.Overlay
     * @constructor
     * @param {String} el The element ID representing the Panel <em>OR</em>
     * @param {HTMLElement} el The element representing the Panel
@@ -5053,12 +4694,9 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Panel = function (el, userConfig) {
-    
         YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         DD = YAHOO.util.DD,
         Dom = YAHOO.util.Dom,
@@ -5086,7 +4724,7 @@ version: 2.3.0
             "DRAG": "drag"
         
         },
-        
+
         /**
         * Constant representing the Panel's configuration properties
         * @property DEFAULT_CONFIG
@@ -5095,43 +4733,48 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "CLOSE": { 
                 key: "close", 
                 value: true, 
                 validator: Lang.isBoolean, 
                 supercedes: ["visible"] 
             },
-            
+
             "DRAGGABLE": { 
                 key: "draggable", 
                 value: (DD ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["visible"]  
             },
-            
+
+            "DRAG_ONLY" : {
+                key: "dragonly",
+                value: false,
+                validator: Lang.isBoolean,
+                supercedes: ["draggable"]
+            },
+
             "UNDERLAY": { 
                 key: "underlay", 
                 value: "shadow", 
                 supercedes: ["visible"] 
             },
-            
+
             "MODAL": { 
                 key: "modal", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["visible"
+                supercedes: ["visible", "zindex"]
             },
-            
-            "KEY_LISTENERS": { 
-                key: "keylisteners", 
-                suppressEvent: true, 
-                supercedes: ["visible"] 
+
+            "KEY_LISTENERS": {
+                key: "keylisteners",
+                suppressEvent: true,
+                supercedes: ["visible"]
             }
-        
         };
 
-
     /**
     * Constant representing the default CSS class used for a Panel
     * @property YAHOO.widget.Panel.CSS_PANEL
@@ -5151,7 +4794,6 @@ version: 2.3.0
     */
     Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
 
-
     // Private CustomEvent listeners
 
     /* 
@@ -5161,16 +4803,11 @@ version: 2.3.0
     */
 
     function createHeader(p_sType, p_aArgs) {
-
-        if (!this.header) {
-
+        if (!this.header && this.cfg.getProperty("draggable")) {
             this.setHeader("&#160;");
-
         }
-
     }
 
-
     /* 
         "hide" event handler that sets a Panel instance's "width"
         configuration property back to its original value before 
@@ -5185,16 +4822,12 @@ version: 2.3.0
             sCurrentWidth = oConfig.getProperty("width");
 
         if (sCurrentWidth == sNewWidth) {
-            
             oConfig.setProperty("width", sOriginalWidth);
-        
         }
 
         this.unsubscribe("hide", restoreOriginalWidth, p_oObject);
-    
     }
 
-
     /* 
         "beforeShow" event handler that sets a Panel instance's "width"
         configuration property to the value of its root HTML 
@@ -5223,9 +4856,7 @@ version: 2.3.0
                     [(sOriginalWidth || ""), sNewWidth]);
             
             }
-        
         }
-
     }
 
     /* 
@@ -5235,9 +4866,7 @@ version: 2.3.0
     */
 
     function onElementFocus() {
-
         this.blur();
-
     }
 
     /* 
@@ -5310,9 +4939,8 @@ version: 2.3.0
 
     }
 
-    
     YAHOO.extend(Panel, Overlay, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and 
         * all of its subclasses. This method is automatically called by the 
@@ -5333,24 +4961,22 @@ version: 2.3.0
             */
 
             Panel.superclass.init.call(this, el/*, userConfig*/);  
-        
+
             this.beforeInitEvent.fire(Panel);
-        
+
             Dom.addClass(this.element, Panel.CSS_PANEL);
-        
+
             this.buildWrapper();
-        
-            if (userConfig) {
 
+            if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
-
             }
-        
+
             this.subscribe("showMask", addFocusEventHandlers);
             this.subscribe("hideMask", removeFocusEventHandlers);
+            this.subscribe("beforeRender", createHeader);
 
             this.initEvent.fire(Panel);
-            
         },
         
         /**
@@ -5436,7 +5062,34 @@ version: 2.3.0
                 validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
                 supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
             });
-        
+
+            /**
+            * Boolean specifying if the draggable Panel should be drag only, not interacting with drop 
+            * targets on the page.
+            * <p>
+            * When set to true, draggable Panels will not check to see if they are over drop targets,
+            * or fire the DragDrop events required to support drop target interaction (onDragEnter, 
+            * onDragOver, onDragOut, onDragDrop etc.).
+            * If the Panel is not designed to be dropped on any target elements on the page, then this 
+            * flag can be set to true to improve performance.
+            * </p>
+            * <p>
+            * When set to false, all drop target related events will be fired.
+            * </p>
+            * <p>
+            * The property is set to false by default to maintain backwards compatibility but should be 
+            * set to true if drop target interaction is not required for the Panel, to improve performance.</p>
+            * 
+            * @config dragOnly
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAG_ONLY.key, { 
+                value: DEFAULT_CONFIG.DRAG_ONLY.value, 
+                validator: DEFAULT_CONFIG.DRAG_ONLY.validator, 
+                supercedes: DEFAULT_CONFIG.DRAG_ONLY.supercedes 
+            });
+
             /**
             * Sets the type of underlay to display for the Panel. Valid values 
             * are "shadow," "matte," and "none".  <strong>PLEASE NOTE:</strong> 
@@ -5504,52 +5157,35 @@ version: 2.3.0
                 oClose = this.close;
         
             function doHide(e, obj) {
-
                 obj.hide();
-
             }
         
             if (val) {
-
                 if (!oClose) {
-
                     if (!m_oCloseIconTemplate) {
-
                         m_oCloseIconTemplate = document.createElement("span");
                         m_oCloseIconTemplate.innerHTML = "&#160;";
                         m_oCloseIconTemplate.className = "container-close";
-
                     }
 
                     oClose = m_oCloseIconTemplate.cloneNode(true);
-
                     this.innerElement.appendChild(oClose);
-
                     Event.on(oClose, "click", doHide, this);
                     
                     this.close = oClose;
-                    
 
                 } else {
-
                     oClose.style.display = "block";
-
                 }
 
             } else {
-
                 if (oClose) {
-
                     oClose.style.display = "none";
-
                 }
-
             }
 
         },
 
-
-
         /**
         * The default event handler fired when the "draggable" property 
         * is changed.
@@ -5561,54 +5197,36 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configDraggable: function (type, args, obj) {
-        
             var val = args[0];
 
             if (val) {
-        
                 if (!DD) {
-            
                     YAHOO.log("DD dependency not met.", "error");
-        
                     this.cfg.setProperty("draggable", false);
-            
                     return;
-                
                 }
-        
-                if (this.header) {
 
+                if (this.header) {
                     Dom.setStyle(this.header, "cursor", "move");
-
                     this.registerDragDrop();
-
                 }
 
-                this.subscribe("beforeRender", createHeader);
                 this.subscribe("beforeShow", setWidthToOffsetWidth);
 
             } else {
 
                 if (this.dd) {
-
                     this.dd.unreg();
-
                 }
 
                 if (this.header) {
-
                     Dom.setStyle(this.header,"cursor","auto");
-
                 }
 
-                this.unsubscribe("beforeRender", createHeader);
                 this.unsubscribe("beforeShow", setWidthToOffsetWidth);
-
             }
-
         },
       
-
         /**
         * The default event handler fired when the "underlay" property 
         * is changed.
@@ -5620,159 +5238,118 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configUnderlay: function (type, args, obj) {
-    
+
             var UA = YAHOO.env.ua,
                 bMacGecko = (this.platform == "mac" && UA.gecko),
+                bIEQuirks = (UA.ie == 6 || (UA.ie == 7 && document.compatMode == "BackCompat")),
                 sUnderlay = args[0].toLowerCase(),
                 oUnderlay = this.underlay,
                 oElement = this.element;
+                
+            function fixWebkitUnderlay() {
+                // Webkit 419.3 (Safari 2.x) does not update
+                // it's Render Tree for the Container when content changes. 
+                // We need to force it to update using this contentChange 
+                // listener
 
+                // Webkit 523.6 doesn't have this problem and doesn't 
+                // need the fix
+                var u = this.underlay;
+                Dom.addClass(u, "yui-force-redraw");
+                window.setTimeout(function(){Dom.removeClass(u, "yui-force-redraw");}, 0);
+            }
 
             function createUnderlay() {
-
-                var nIE;
-
+                var bNew = false;
                 if (!oUnderlay) { // create if not already in DOM
 
                     if (!m_oUnderlayTemplate) {
-
                         m_oUnderlayTemplate = document.createElement("div");
                         m_oUnderlayTemplate.className = "underlay";
-                    
                     }
 
                     oUnderlay = m_oUnderlayTemplate.cloneNode(false);
                     this.element.appendChild(oUnderlay);
-                    
-                    this.underlay = oUnderlay;
 
-                    nIE = UA.ie;
+                    this.underlay = oUnderlay;
 
-                    if (nIE == 6 || 
-                        (nIE == 7 && document.compatMode == "BackCompat")) {
-                            
+                    if (bIEQuirks) {
                         this.sizeUnderlay();
-
-                        this.cfg.subscribeToConfigEvent("width", 
-                            this.sizeUnderlay);
-
-                        this.cfg.subscribeToConfigEvent("height", 
-                            this.sizeUnderlay);
-
+                        this.cfg.subscribeToConfigEvent("width", this.sizeUnderlay);
+                        this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);
                         this.changeContentEvent.subscribe(this.sizeUnderlay);
-
-                        YAHOO.widget.Module.textResizeEvent.subscribe(
-                            this.sizeUnderlay, this, true);
-                    
+                        YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay, this, true);
                     }
 
+                    if (UA.webkit && UA.webkit < 420) {
+                        this.changeContentEvent.subscribe(fixWebkitUnderlay);
+                    }
+                    bNew = true;
                 }
-
             }
 
-
             function onBeforeShow() {
-            
-                createUnderlay.call(this);
-    
+                var bNew = createUnderlay.call(this);
+                if (!bNew && bIEQuirks) {
+                    this.sizeUnderlay();
+                }
                 this._underlayDeferred = false;
-    
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-            
             }
 
-            
             function destroyUnderlay() {
-
                 if (this._underlayDeferred) {
-
                     this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                     this._underlayDeferred = false;
-
                 }
-            
+
                 if (oUnderlay) {
-            
-                    this.cfg.unsubscribeFromConfigEvent("width", 
-                        this.sizeUnderlay);
-    
-                    this.cfg.unsubscribeFromConfigEvent("height", 
-                        this.sizeUnderlay);
-    
+                    this.cfg.unsubscribeFromConfigEvent("width", this.sizeUnderlay);
+                    this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);
                     this.changeContentEvent.unsubscribe(this.sizeUnderlay);
-    
-                    YAHOO.widget.Module.textResizeEvent.unsubscribe(
-                        this.sizeUnderlay, this, true);
-    
+                    this.changeContentEvent.unsubscribe(fixWebkitUnderlay);
+                    YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay, this, true);
+
                     this.element.removeChild(oUnderlay);
-                    
-                    this.underlay = null;
 
+                    this.underlay = null;
                 }
-                    
             }
-        
 
             switch (sUnderlay) {
-    
-            case "shadow":
-
-                Dom.removeClass(oElement, "matte");
-                Dom.addClass(oElement, "shadow");
-
-                break;
-
-            case "matte":
-
-                if (!bMacGecko) {
-
-                    destroyUnderlay.call(this);
-
-                }
-            
-                Dom.removeClass(oElement, "shadow");
-                Dom.addClass(oElement, "matte");
-
-                break;
-
-            default:
-
-                if (!bMacGecko) {
-
-                    destroyUnderlay.call(this);
-
-                }
-            
-                Dom.removeClass(oElement, "shadow");
-                Dom.removeClass(oElement, "matte");
-
-                break;
-
+                case "shadow":
+                    Dom.removeClass(oElement, "matte");
+                    Dom.addClass(oElement, "shadow");
+                    break;
+                case "matte":
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
+                    }
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.addClass(oElement, "matte");
+                    break;
+                default:
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
+                    }
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.removeClass(oElement, "matte");
+                    break;
             }
 
-
             if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) {
-                
                 if (this.cfg.getProperty("visible")) {
-                
-                    createUnderlay.call(this);
-                
-                }
-                else {
-
+                    var bNew = createUnderlay.call(this);
+                    if (!bNew && bIEQuirks) {
+                        this.sizeUnderlay();
+                    }
+                } else {
                     if (!this._underlayDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-                    
                         this._underlayDeferred = true;
-
                     }
-                
                 }
-
             }
-    
         },
         
         /**
@@ -5789,9 +5366,7 @@ version: 2.3.0
         configModal: function (type, args, obj) {
 
             var modal = args[0];
-
             if (modal) {
-
                 if (!this._hasModalityEventListeners) {
 
                     this.subscribe("beforeShow", this.buildMask);
@@ -5803,18 +5378,13 @@ version: 2.3.0
                         this, true);
 
                     this._hasModalityEventListeners = true;
-
                 }
-
             } else {
-
                 if (this._hasModalityEventListeners) {
 
                     if (this.cfg.getProperty("visible")) {
-                    
                         this.hideMask();
                         this.removeMask();
-                    
                     }
 
                     this.unsubscribe("beforeShow", this.buildMask);
@@ -5825,11 +5395,8 @@ version: 2.3.0
                     Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
                     
                     this._hasModalityEventListeners = false;
-                
                 }
-
             }
-
         },
         
         /**
@@ -5842,25 +5409,19 @@ version: 2.3.0
                 oParentNode;
         
             if (oMask) {
-            
                 /*
                     Hide the mask before destroying it to ensure that DOM
                     event handlers on focusable elements get removed.
                 */
-        
                 this.hideMask();
-            
+                
                 oParentNode = oMask.parentNode;
-        
                 if (oParentNode) {
-        
                     oParentNode.removeChild(oMask);
-        
                 }
-        
+
                 this.mask = null;
             }
-            
         },
         
         /**
@@ -5984,35 +5545,25 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
             Panel.superclass.configzIndex.call(this, type, args, obj);
-        
-            var maskZ = 0,
-                currentZ = Dom.getStyle(this.element, "zIndex");
-        
-            if (this.mask) {
 
-                if (!currentZ || isNaN(currentZ)) {
-                    currentZ = 0;
+            if (this.mask || this.cfg.getProperty("modal") === true) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!panelZ || isNaN(panelZ)) {
+                    panelZ = 0;
                 }
-        
-                if (currentZ === 0) {
 
+                if (panelZ === 0) {
+                    // Recursive call to configzindex (which should be stopped
+                    // from going further because panelZ should no longer === 0)
                     this.cfg.setProperty("zIndex", 1);
-
                 } else {
-
-                    maskZ = currentZ - 1;
-                    Dom.setStyle(this.mask, "zIndex", maskZ);
-
+                    this.stackMask();
                 }
-        
             }
         },
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
-        
         /**
         * Builds the wrapping container around the Panel that is used for 
         * positioning the shadow and matte underlays. The container element is 
@@ -6021,44 +5572,39 @@ version: 2.3.0
         * @method buildWrapper
         */
         buildWrapper: function () {
-    
+
             var elementParent = this.element.parentNode,
                 originalElement = this.element,
                 wrapper = document.createElement("div");
-    
+
             wrapper.className = Panel.CSS_PANEL_CONTAINER;
             wrapper.id = originalElement.id + "_c";
-        
+
             if (elementParent) {
                 elementParent.insertBefore(wrapper, originalElement);
             }
-        
+
             wrapper.appendChild(originalElement);
-        
+
             this.element = wrapper;
             this.innerElement = originalElement;
-        
+
             Dom.setStyle(this.innerElement, "visibility", "inherit");
         },
-        
+
         /**
         * Adjusts the size of the shadow based on the size of the element.
         * @method sizeUnderlay
         */
         sizeUnderlay: function () {
-
             var oUnderlay = this.underlay,
                 oElement;
 
             if (oUnderlay) {
-
                 oElement = this.element;
-
                 oUnderlay.style.width = oElement.offsetWidth + "px";
                 oUnderlay.style.height = oElement.offsetHeight + "px";
-
             }
-
         },
 
         
@@ -6067,102 +5613,96 @@ version: 2.3.0
         * @method registerDragDrop
         */
         registerDragDrop: function () {
-    
+
             var me = this;
-    
+
             if (this.header) {
-        
+
                 if (!DD) {
-        
                     YAHOO.log("DD dependency not met.", "error");
-        
                     return;
-                
                 }
-        
-                this.dd = new DD(this.element.id, this.id);
-        
+
+                var bDragOnly = (this.cfg.getProperty("dragonly") === true);
+                this.dd = new DD(this.element.id, this.id, {dragOnly: bDragOnly});
+
                 if (!this.header.id) {
                     this.header.id = this.id + "_h";
                 }
-        
-    
+
                 this.dd.startDrag = function () {
-        
+
                     var offsetHeight,
                         offsetWidth,
                         viewPortWidth,
                         viewPortHeight,
                         scrollX,
-                        scrollY,
-                        topConstraint,
-                        leftConstraint,
-                        bottomConstraint,
-                        rightConstraint;
-    
+                        scrollY;
+
                     if (YAHOO.env.ua.ie == 6) {
                         Dom.addClass(me.element,"drag");
                     }
-        
+
                     if (me.cfg.getProperty("constraintoviewport")) {
-    
+
+                        var nViewportOffset = Overlay.VIEWPORT_OFFSET;
+
                         offsetHeight = me.element.offsetHeight;
                         offsetWidth = me.element.offsetWidth;
-                        
+
                         viewPortWidth = Dom.getViewportWidth();
                         viewPortHeight = Dom.getViewportHeight();
-                        
+
                         scrollX = Dom.getDocumentScrollLeft();
                         scrollY = Dom.getDocumentScrollTop();
-                        
-                        topConstraint = scrollY + 10;
-                        leftConstraint = scrollX + 10;
 
-                        bottomConstraint = 
-                            scrollY + viewPortHeight - offsetHeight - 10;
+                        if (offsetHeight + nViewportOffset < viewPortHeight) {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+                        } else {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + nViewportOffset;
+                        }
+
+                        if (offsetWidth + nViewportOffset < viewPortWidth) {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+                        } else {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + nViewportOffset;
+                        }
 
-                        rightConstraint = 
-                            scrollX + viewPortWidth - offsetWidth - 10;
-        
-                        this.minX = leftConstraint;
-                        this.maxX = rightConstraint;
                         this.constrainX = true;
-        
-                        this.minY = topConstraint;
-                        this.maxY = bottomConstraint;
                         this.constrainY = true;
-    
                     } else {
-    
                         this.constrainX = false;
                         this.constrainY = false;
-    
                     }
-        
+
                     me.dragEvent.fire("startDrag", arguments);
                 };
-        
+
                 this.dd.onDrag = function () {
                     me.syncPosition();
                     me.cfg.refireEvent("iframe");
                     if (this.platform == "mac" && YAHOO.env.ua.gecko) {
                         this.showMacGeckoScrollbars();
                     }
-        
+
                     me.dragEvent.fire("onDrag", arguments);
                 };
-        
+
                 this.dd.endDrag = function () {
 
                     if (YAHOO.env.ua.ie == 6) {
                         Dom.removeClass(me.element,"drag");
                     }
-        
+
                     me.dragEvent.fire("endDrag", arguments);
                     me.moveEvent.fire(me.cfg.getProperty("xy"));
-                    
+
                 };
-        
+
                 this.dd.setHandleElId(this.header.id);
                 this.dd.addInvalidHandleType("INPUT");
                 this.dd.addInvalidHandleType("SELECT");
@@ -6176,30 +5716,29 @@ version: 2.3.0
         * @method buildMask
         */
         buildMask: function () {
-    
             var oMask = this.mask;
-    
             if (!oMask) {
-
                 if (!m_oMaskTemplate) {
-                
                     m_oMaskTemplate = document.createElement("div");
                     m_oMaskTemplate.className = "mask";
                     m_oMaskTemplate.innerHTML = "&#160;";
-                
                 }
-
                 oMask = m_oMaskTemplate.cloneNode(true);
                 oMask.id = this.id + "_mask";
 
                 document.body.insertBefore(oMask, document.body.firstChild);
-                
+
                 this.mask = oMask;
 
-            }
+                if (YAHOO.env.ua.gecko && this.platform == "mac") {
+                    Dom.addClass(this.mask, "block-scrollbars");
+                }
 
+                // Stack mask based on the element zindex
+                this.stackMask();
+            }
         },
-        
+
         /**
         * Hides the modality mask.
         * @method hideMask
@@ -6211,7 +5750,7 @@ version: 2.3.0
                 Dom.removeClass(document.body, "masked");
             }
         },
-        
+
         /**
         * Shows the modality mask.
         * @method showMask
@@ -6224,24 +5763,40 @@ version: 2.3.0
                 this.showMaskEvent.fire();
             }
         },
-        
+
         /**
         * Sets the size of the modality mask to cover the entire scrollable 
         * area of the document
         * @method sizeMask
         */
         sizeMask: function () {
-
             if (this.mask) {
-
                 this.mask.style.height = Dom.getDocumentHeight() + "px";
                 this.mask.style.width = Dom.getDocumentWidth() + "px";
-
             }
+        },
 
+        /**
+         * Sets the zindex of the mask, if it exists, based on the zindex of 
+         * the Panel element. The zindex of the mask is set to be one less 
+         * than the Panel element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Panel
+         * to ensure that the mask has a non-negative zindex. If you require the
+         * mask zindex to be 0 or higher, the zindex of the Panel 
+         * should be set to a value higher than 0, before this method is called.
+         * </p>
+         * @method stackMask
+         */
+        stackMask: function() {
+            if (this.mask) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(panelZ) && !isNaN(panelZ)) {
+                    Dom.setStyle(this.mask, "zIndex", panelZ - 1);
+                }
+            }
         },
 
-        
         /**
         * Renders the Panel by inserting the elements that are not already in 
         * the main Panel into their correct places. Optionally appends the 
@@ -6297,15 +5852,26 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
+    * <p>
     * Dialog is an implementation of Panel that can be used to submit form 
-    * data. Built-in functionality for buttons with event handlers is included, 
-    * and button sets can be build dynamically, or the preincluded ones for 
-    * Submit/Cancel and OK/Cancel can be utilized. Forms can be processed in 3
-    * ways -- via an asynchronous Connection utility call, a simple form 
-    * POST or GET, or manually.
+    * data.
+    * </p>
+    * <p>
+    * Built-in functionality for buttons with event handlers is included. 
+    * If the optional YUI Button dependancy is included on the page, the buttons
+    * created will be instances of YAHOO.widget.Button, otherwise regular HTML buttons
+    * will be created.
+    * </p>
+    * <p>
+    * Forms can be processed in 3 ways -- via an asynchronous Connection utility call, 
+    * a simple form POST or GET, or manually. The YUI Connection utility should be
+    * included if you're using the default "async" postmethod, but is not required if
+    * you're using any of the other postmethod values.
+    * </p>
     * @namespace YAHOO.widget
     * @class Dialog
     * @extends YAHOO.widget.Panel
@@ -6317,12 +5883,9 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Dialog = function (el, userConfig) {
-    
         YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Dom = YAHOO.util.Dom,
@@ -6348,7 +5911,7 @@ version: 2.3.0
             "CANCEL": "cancel"
         
         },
-        
+
         /**
         * Constant representing the Dialog's configuration properties
         * @property DEFAULT_CONFIG
@@ -6357,19 +5920,22 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "POST_METHOD": { 
                 key: "postmethod", 
                 value: "async" 
             },
-            
+
             "BUTTONS": { 
                 key: "buttons", 
                 value: "none" 
-            }
-        
-        };    
+            },
 
+            "HIDEAFTERSUBMIT" : {
+                key: "hideaftersubmit",
+                value: true
+            }
+        };
 
     /**
     * Constant representing the default CSS class used for a Dialog
@@ -6380,7 +5946,6 @@ version: 2.3.0
     */
     Dialog.CSS_DIALOG = "yui-dialog";
 
-
     function removeButtonEventHandlers() {
 
         var aButtons = this._aButtons,
@@ -6389,42 +5954,28 @@ version: 2.3.0
             i;
 
         if (Lang.isArray(aButtons)) {
-
             nButtons = aButtons.length;
 
             if (nButtons > 0) {
-
                 i = nButtons - 1;
-
                 do {
-
                     oButton = aButtons[i];
-                    
-                    if (oButton instanceof YAHOO.widget.Button) {
-                        
+
+                    if (YAHOO.widget.Button && oButton instanceof YAHOO.widget.Button) {
                         oButton.destroy();
-                        
                     }
                     else if (oButton.tagName.toUpperCase() == "BUTTON") {
-
                         Event.purgeElement(oButton);
                         Event.purgeElement(oButton, false);
-
                     }
-
                 }
                 while (i--);
-            
             }
-        
         }
-
     }
     
-    
     YAHOO.extend(Dialog, YAHOO.widget.Panel, { 
 
-        
         /**
         * @property form
         * @description Object reference to the Dialog's 
@@ -6442,23 +5993,28 @@ version: 2.3.0
         */
         initDefaultConfig: function () {
             Dialog.superclass.initDefaultConfig.call(this);
-        
+
             /**
             * The internally maintained callback object for use with the 
-            * Connection utility
+            * Connection utility. The format of the callback object is 
+            * similar to Connection Manager's callback object and is 
+            * simply passed through to Connection Manager when the async 
+            * request is made.
             * @property callback
             * @type Object
             */
             this.callback = {
-    
+
                 /**
                 * The function to execute upon success of the 
-                * Connection submission
+                * Connection submission (when the form does not
+                * contain a file input element).
+                * 
                 * @property callback.success
                 * @type Function
                 */
                 success: null,
-    
+
                 /**
                 * The function to execute upon failure of the 
                 * Connection submission
@@ -6466,7 +6022,27 @@ version: 2.3.0
                 * @type Function
                 */
                 failure: null,
-    
+
+                /**
+                 *<p>
+                * The function to execute upon success of the 
+                * Connection submission, when the form contains
+                * a file input element.
+                * </p>
+                * <p>
+                * <em>NOTE:</em> Connection manager will not
+                * invoke the success or failure handlers for the file
+                * upload use case. This will be the only callback
+                * handler invoked.
+                * </p>
+                * <p>
+                * For more information, see the <a href="http://developer.yahoo.com/yui/connection/#file">
+                * Connection Manager documenation on file uploads</a>.
+                * </p>
+                * @property callback.upload
+                * @type Function
+                */
+
                 /**
                 * The arbitraty argument or arguments to pass to the Connection 
                 * callback functions
@@ -6474,12 +6050,10 @@ version: 2.3.0
                 * @type Object
                 */
                 argument: null
-    
+
             };
-        
 
             // Add form dialog config properties //
-            
             /**
             * The method to use for posting the Dialog's form. Possible values 
             * are "async", "form", and "manual".
@@ -6499,15 +6073,28 @@ version: 2.3.0
                     }
                 }
             });
-            
+
+            /**
+            * This property is used to configure whether or not the 
+            * dialog should be automatically hidden after submit.
+            * 
+            * @config hideaftersubmit
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HIDEAFTERSUBMIT.key, {
+                value: DEFAULT_CONFIG.HIDEAFTERSUBMIT.value
+            }); 
+
             /**
             * Array of object literals, each containing a set of properties 
             * defining a button to be appended into the Dialog's footer.
+            * 
             * Each button object in the buttons array can have three properties:
             * <dt>text:</dt>
-            * <dd>The text that will display on the face of the button.  <em>
-            * Please note:</em> As of version 2.3, the text can include 
-            * HTML.</dd>
+            * <dd>The text that will display on the face of the button. The text can 
+            * include HTML, as long as it is compliant with HTML Button specifications.
+            * </dd>
             * <dt>handler:</dt>
             * <dd>Can be either:
             *     <ol>
@@ -6515,18 +6102,23 @@ version: 2.3.0
             * button is clicked.  (In this case scope of this function is 
             * always its Dialog instance.)</li>
             *         <li>An object literal representing the code to be 
-            * executed when the button is clicked.  Format:<br> <code> {<br>  
+            * executed when the button is clicked.  Format:<br> <code> {<br>
             * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
-            * when  the event fires.<br> <strong>obj:</strong> Object, 
+            * when  the event fires.<br> <strong>obj:</strong> Object,
             * &#47;&#47; An  object to pass back to the handler.<br> <strong>
             * scope:</strong>  Object &#47;&#47; The object to use for the 
-            * scope of the handler. <br> } </code> <br><em>Please note: this 
-            * functionality was added in version 2.3.</em></li>
+            * scope of the handler. <br> } </code> <br></li>
             *     </ol>
             * </dd>
             * <dt>isDefault:</dt>
             * <dd>An optional boolean value that specifies that a button 
             * should be highlighted and focused by default.</dd>
+            * 
+            * <em>NOTE:</em>If the YUI Button Widget is included on the page, 
+            * the buttons created will be instances of YAHOO.widget.Button. 
+            * Otherwise, HTML Buttons (<code>&#60;BUTTON&#62;</code>) will be 
+            * created.
+            * 
             * @config buttons
             * @type {Array|String}
             * @default "none"
@@ -6535,9 +6127,9 @@ version: 2.3.0
                 handler: this.configButtons,
                 value: DEFAULT_CONFIG.BUTTONS.value
             }); 
-            
+
         },
-        
+
         /**
         * Initializes the custom events for Dialog which are fired 
         * automatically at appropriate times by the Dialog class.
@@ -6545,9 +6137,9 @@ version: 2.3.0
         */
         initEvents: function () {
             Dialog.superclass.initEvents.call(this);
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to submission
             * @event beforeSubmitEvent
@@ -6657,7 +6249,6 @@ version: 2.3.0
                 i,
                 sMethod;
 
-
             switch (this.cfg.getProperty("postmethod")) {
     
             case "async":
@@ -6666,36 +6257,24 @@ version: 2.3.0
                 nElements = aElements.length;
 
                 if (nElements > 0) {
-                
                     i = nElements - 1;
-                
                     do {
-                    
                         if (aElements[i].type == "file") {
-                        
                             bUseFileUpload = true;
                             break;
-                        
                         }
-                    
                     }
                     while(i--);
-                
                 }
 
                 if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) {
-
                     bUseSecureFileUpload = true;
-                
                 }
 
-                sMethod = 
-                    (oForm.getAttribute("method") || "POST").toUpperCase();
+                sMethod = (oForm.getAttribute("method") || "POST").toUpperCase();
 
                 Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload);
-
-                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), 
-                    this.callback);
+                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), this.callback);
 
                 this.asyncSubmitEvent.fire();
 
@@ -6734,94 +6313,59 @@ version: 2.3.0
 
 
             if (this.form) {
-
                 if (this.form == form && 
                     Dom.isAncestor(this.element, this.form)) {
     
                     return;
-    
-                }
-                else {
-
+                } else {
                     Event.purgeElement(this.form);
-                    
                     this.form = null;                
-                
                 }
-            
             }
-        
 
             if (!form) {
-
                 form = document.createElement("form");
                 form.name = "frm_" + this.id;
 
                 this.body.appendChild(form);
-
             }
 
-
             if (form) {
-
                 this.form = form;
 
                 Event.on(form, "submit", function (e) {
-
                     Event.stopEvent(e);
-
                     this.submit();
                     this.form.blur();
-        
-                });
-
+                }, this, true);
 
                 this.firstFormElement = function () {
-        
                     var f, el, nElements = form.elements.length;
-        
+
                     for (f = 0; f < nElements; f++) {
-    
                         el = form.elements[f];
-    
                         if (el.focus && !el.disabled && el.type != "hidden") {
-    
                             return el;
-    
                         }
-    
                     }
-    
                     return null;
-                    
                 }();
             
                 this.lastFormElement = function () {
-        
                     var f, el, nElements = form.elements.length;
-        
+                    
                     for (f = nElements - 1; f >= 0; f--) {
-    
                         el = form.elements[f];
-    
                         if (el.focus && !el.disabled && el.type != "hidden") {
-    
                             return el;
-    
                         }
-    
                     }
-    
                     return null;
-    
                 }();
             
                 if (this.cfg.getProperty("modal")) {
-            
                     firstElement = this.firstFormElement || this.firstButton;
-        
                     if (firstElement) {
-    
                         this.preventBackTab = new KeyListener(firstElement, 
                             { shift: true, keys: 9 }, 
                             { fn: me.focusLast, scope: me, 
@@ -6837,7 +6381,6 @@ version: 2.3.0
                     lastElement = this.lastButton || this.lastFormElement;
     
                     if (lastElement) {
-    
                         this.preventTabOut = new KeyListener(lastElement, 
                             { shift: false, keys: 9 }, 
                             { fn: me.focusFirst, scope: me, 
@@ -6848,12 +6391,9 @@ version: 2.3.0
     
                         this.hideEvent.subscribe(this.preventTabOut.disable, 
                             this.preventTabOut, true);
-    
                     }
                 }
-            
             }
-
         },
         
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
@@ -7047,14 +6587,12 @@ version: 2.3.0
 
             this.cfg.refireEvent("iframe");
             this.cfg.refireEvent("underlay");
-
         },
 
-
         /**
         * @method getButtons
         * @description Returns an array containing each of the Dialog's 
-        * buttons, by default an array of HTML <code>&#60;BUTTON&#60;</code> 
+        * buttons, by default an array of HTML <code>&#60;BUTTON&#62;</code> 
         * elements.  If the Dialog's buttons were created using the 
         * YAHOO.widget.Button class (via the inclusion of the optional Button 
         * dependancy on the page), an array of YAHOO.widget.Button instances 
@@ -7062,17 +6600,11 @@ version: 2.3.0
         * @return {Array}
         */
         getButtons: function () {
-        
             var aButtons = this._aButtons;
-            
             if (aButtons) {
-            
                 return aButtons;
-            
             }
-        
         },
-
         
         /**
         * Sets focus to the first element in the Dialog's form or the first 
@@ -7086,41 +6618,27 @@ version: 2.3.0
                 oEvent;
 
             if (args) {
-
                 oEvent = args[1];
-
                 if (oEvent) {
-
                     Event.stopEvent(oEvent);
-
                 }
-
             }
-        
 
             if (oElement) {
-
                 /*
                     Place the call to the "focus" method inside a try/catch
                     block to prevent IE from throwing JavaScript errors if
                     the element is disabled or hidden.
                 */
-
                 try {
-
                     oElement.focus();
-
                 }
                 catch(oException) {
-
                 }
 
             } else {
-
                 this.focusDefaultButton();
-
             }
-
         },
         
         /**
@@ -7135,25 +6653,16 @@ version: 2.3.0
                 oEvent;
     
             if (args) {
-
                 oEvent = args[1];
-
                 if (oEvent) {
-
                     Event.stopEvent(oEvent);
-
                 }
-
             }
             
             if (aButtons && Lang.isArray(aButtons)) {
-
                 this.focusLastButton();
-
             } else {
-
                 if (oElement) {
-
                     /*
                         Place the call to the "focus" method inside a try/catch
                         block to prevent IE from throwing JavaScript errors if
@@ -7161,18 +6670,11 @@ version: 2.3.0
                     */
     
                     try {
-    
                         oElement.focus();
-    
-                    }
-                    catch(oException) {
-    
+                    } catch(oException) {
                     }
-
                 }
-
             }
-
         },
         
         /**
@@ -7192,14 +6694,9 @@ version: 2.3.0
                     block to prevent IE from throwing JavaScript errors if
                     the element is disabled or hidden.
                 */
-
                 try {
-
                     oElement.focus();
-                
-                }
-                catch(oException) {
-                
+                } catch(oException) {
                 }
 
             }
@@ -7227,7 +6724,6 @@ version: 2.3.0
                     i = (nButtons - 1);
                     
                     do {
-                    
                         oButton = aButtons[i];
                         
                         if (oButton) {
@@ -7235,35 +6731,22 @@ version: 2.3.0
                             oElement = oButton.htmlButton;
 
                             if (oElement) {
-
                                 /*
                                     Place the call to the "blur" method inside  
                                     a try/catch block to prevent IE from  
                                     throwing JavaScript errors if the element 
                                     is disabled or hidden.
                                 */
-    
                                 try {
-            
                                     oElement.blur();
-                                
-                                }
-                                catch(oException) {
-                                
-                                
+                                } catch(oException) {
                                 }
-                            
                             }
-
                         }
                     
-                    }
-                    while(i--);
-                
+                    } while(i--);
                 }
-            
             }
-
         },
         
         /**
@@ -7295,19 +6778,12 @@ version: 2.3.0
                         */
     
                         try {
-    
                             oElement.focus();
-                        
                         }
                         catch(oException) {
-                        
-                        
                         }
-                    
                     }
-
                 }
-
             }
         },
         
@@ -7328,15 +6804,11 @@ version: 2.3.0
                 nButtons = aButtons.length;
                 
                 if (nButtons > 0) {
-
                     oButton = aButtons[(nButtons - 1)];
                     
                     if (oButton) {
-                    
                         oElement = oButton.htmlButton;
-
                         if (oElement) {
-
                             /*
                                 Place the call to the "focus" method inside a 
                                 try/catch block to prevent IE from throwing 
@@ -7345,23 +6817,13 @@ version: 2.3.0
                             */
         
                             try {
-        
                                 oElement.focus();
-                            
+                            } catch(oException) {
                             }
-                            catch(oException) {
-                            
-                            
-                            }
-                        
                         }
-                    
                     }
-                
                 }
-            
             }
-
         },
         
         /**
@@ -7375,11 +6837,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configPostMethod: function (type, args, obj) {
-    
-            var postmethod = args[0];
-        
             this.registerForm();
-    
         },
         
         // END BUILT-IN PROPERTY EVENT HANDLERS //
@@ -7396,8 +6854,12 @@ version: 2.3.0
         },
         
         /**
-        * Executes a submit of the Dialog followed by a hide, if validation 
-        * is successful.
+        * Executes a submit of the Dialog if validation 
+        * is successful. By default the Dialog is hidden
+        * after submission, but you can set the "hideaftersubmit"
+        * configuration property to false, to prevent the Dialog
+        * from being hidden.
+        * 
         * @method submit
         */
         submit: function () {
@@ -7405,13 +6867,17 @@ version: 2.3.0
                 this.beforeSubmitEvent.fire();
                 this.doSubmit();
                 this.submitEvent.fire();
-                this.hide();
+
+                if (this.cfg.getProperty("hideaftersubmit")) {
+                    this.hide();
+                }
+
                 return true;
             } else {
                 return false;
             }
         },
-        
+
         /**
         * Executes the cancel of the Dialog followed by a hide.
         * @method cancel
@@ -7628,15 +7094,12 @@ version: 2.3.0
                 oForm = aForms[0];
 
                 if (oForm) {
-                   
                     Event.purgeElement(oForm);
-            
-                    this.body.removeChild(oForm);
-                    
+                    if (oForm.parentNode) {
+                        oForm.parentNode.removeChild(oForm);
+                    }
                     this.form = null;
-            
                 }
-            
             }
         
             Dialog.superclass.destroy.call(this);  
@@ -7655,6 +7118,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -7973,6 +7437,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -8058,67 +7523,69 @@ version: 2.3.0
     * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
     */
     ContainerEffect.FADE = function (overlay, dur) {
-    
-        var fade = new ContainerEffect(overlay, 
-        
-            { attributes: { opacity: { from: 0, to: 1 } }, 
-                duration: dur, 
-                method: Easing.easeIn }, 
-            
-            { attributes: { opacity: { to: 0 } },
-                duration: dur, 
-                method: Easing.easeOut }, 
-            
-            overlay.element);
-        
-    
+
+        var fin = {
+            attributes: {opacity:{from:0, to:1}},
+            duration: dur,
+            method: Easing.easeIn
+        };
+
+        var fout = {
+            attributes: {opacity:{to:0}},
+            duration: dur,
+            method: Easing.easeOut
+        };
+
+        var fade = new ContainerEffect(overlay, fin, fout, overlay.element);
+
+        fade.handleUnderlayStart = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                var hasFilters = (underlay.filters && underlay.filters.length > 0);
+                if(hasFilters) {
+                    Dom.addClass(overlay.element, "yui-effect-fade");
+                }
+            }
+        };
+
+        fade.handleUnderlayComplete = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                Dom.removeClass(overlay.element, "yui-effect-fade");
+            }
+        };
+
         fade.handleStartAnimateIn = function (type,args,obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (! obj.overlay.underlay) {
+
+            if (!obj.overlay.underlay) {
                 obj.overlay.cfg.refireEvent("underlay");
             }
-        
-            if (obj.overlay.underlay) {
-    
-                obj.initialUnderlayOpacity = 
-                    Dom.getStyle(obj.overlay.underlay, "opacity");
-    
-                obj.overlay.underlay.style.filter = null;
-    
-            }
-        
+
+            obj.handleUnderlayStart();
+
             Dom.setStyle(obj.overlay.element, "visibility", "visible");
             Dom.setStyle(obj.overlay.element, "opacity", 0);
         };
-        
-    
+
         fade.handleCompleteAnimateIn = function (type,args,obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
-        
+
             if (obj.overlay.element.style.filter) {
                 obj.overlay.element.style.filter = null;
             }
-        
-            if (obj.overlay.underlay) {
-                Dom.setStyle(obj.overlay.underlay, "opacity", 
-                    obj.initialUnderlayOpacity);
-            }
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
             obj.animateInCompleteEvent.fire();
         };
-        
-    
+
         fade.handleStartAnimateOut = function (type, args, obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (obj.overlay.underlay) {
-                obj.overlay.underlay.style.filter = null;
-            }
+            obj.handleUnderlayStart();
         };
-        
-    
+
         fade.handleCompleteAnimateOut =  function (type, args, obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
             if (obj.overlay.element.style.filter) {
@@ -8126,12 +7593,13 @@ version: 2.3.0
             }
             Dom.setStyle(obj.overlay.element, "visibility", "hidden");
             Dom.setStyle(obj.overlay.element, "opacity", 1);
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
-        
             obj.animateOutCompleteEvent.fire();
         };
-        
+
         fade.init();
         return fade;
     };
@@ -8203,11 +7671,9 @@ version: 2.3.0
     
             var vw = Dom.getViewportWidth(),
                 pos = Dom.getXY(obj.overlay.element),
-                yso = pos[1],
-                currentTo = obj.animOut.attributes.points.to;
+                yso = pos[1];
     
             obj.animOut.attributes.points.to = [(vw + 25), yso];
-    
         };
         
         slide.handleTweenAnimateOut = function (type, args, obj) {
@@ -8363,4 +7829,5 @@ version: 2.3.0
     YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
 
 })();
-YAHOO.register("container", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
+
+YAHOO.register("container", YAHOO.widget.Module, {version: "2.5.0", build: "895"});
index d39a82b219709acfe8a427d23d45a8d6fc352393..9649160350ebd629736a98bf23cb053672cae723 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
-if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
-this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
-return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
-return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
-foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
-if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
-if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
-return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oValue,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}
-this.initialConfig=oConfig;}
-for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
-this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
-return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
-return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
-return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
-this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
-while(i--);}
-return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.textResizeEvent=new CustomEvent("textResize");function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=("<div class=\""+
-Module.CSS_HEADER+"\"></div>"+"<div class=\""+
-Module.CSS_BODY+"\"></div><div class=\""+
-Module.CSS_FOOTER+"\"></div>");m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}
-return m_oModuleTemplate;}
-function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}
-return(m_oHeaderTemplate.cloneNode(false));}
-function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}
-return(m_oBodyTemplate.cloneNode(false));}
-function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}
-return(m_oFooterTemplate.cloneNode(false));}
-Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTORY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});},init:function(el,userConfig){var elId,i,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}
-if(typeof el=="string"){elId=el;el=document.getElementById(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}
-this.element=el;if(el.id){this.id=el.id;}
-child=this.element.firstChild;if(child){do{switch(child.className){case Module.CSS_HEADER:this.header=child;break;case Module.CSS_BODY:this.body=child;break;case Module.CSS_FOOTER:this.footer=child;break;}}while((child=child.nextSibling));}
-this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
-this.initEvent.fire(Module);},initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}
-if(!YAHOO.env.ua.opera){oIFrame=Dom.get("_yuiResizeMonitor");if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}
-if(YAHOO.env.ua.gecko){sHTML="<html><head><script "+"type=\"text/javascript\">"+"window.onresize=function(){window.parent."+"YAHOO.widget.Module.textResizeEvent."+"fire();};window.parent.YAHOO.widget.Module."+"textResizeEvent.fire();</script></head>"+"<body></body></html>";oIFrame.src="data:text/html;charset=utf-8,"+
-encodeURIComponent(sHTML);}
-oIFrame.id="_yuiResizeMonitor";oIFrame.style.position="absolute";oIFrame.style.visibility="hidden";document.body.appendChild(oIFrame);oIFrame.style.width="10em";oIFrame.style.height="10em";oIFrame.style.top=(-1*oIFrame.offsetHeight)+"px";oIFrame.style.left=(-1*oIFrame.offsetWidth)+"px";oIFrame.style.borderWidth="0";oIFrame.style.visibility="visible";if(YAHOO.env.ua.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}
-if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}
-Module.textResizeInitialized=true;}
-this.resizeMonitor=oIFrame;}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(typeof headerContent=="string"){oHeader.innerHTML=headerContent;}else{oHeader.innerHTML="";oHeader.appendChild(headerContent);}
-this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(typeof bodyContent=="string"){oBody.innerHTML=bodyContent;}else{oBody.innerHTML="";oBody.appendChild(bodyContent);}
-this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(typeof footerContent=="string"){oFooter.innerHTML=footerContent;}else{oFooter.innerHTML="";oFooter.appendChild(footerContent);}
-this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this,firstChild;function appendTo(element){if(typeof element=="string"){element=document.getElementById(element);}
-if(element){element.appendChild(me.element);me.appendEvent.fire();}}
-this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
-if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}
-if(this.header&&!Dom.inDocument(this.header)){firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
-if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
-if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
-this.renderEvent.fire();return true;},destroy:function(){var parent,e;if(this.element){Event.purgeElement(this.element,true);parent=this.element.parentNode;}
-if(parent){parent.removeChild(this.element);}
-this.element=null;this.header=null;this.body=null;this.footer=null;Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(e in this){if(e instanceof CustomEvent){e.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Overlay=YAHOO.widget.Overlay,m_oIFrameTemplate,EVENT_TYPES={"BEFORE_MOVE":"beforeMove","MOVE":"move"},DEFAULT_CONFIG={"X":{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:Lang.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.CSS_OVERLAY="yui-overlay";Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
-clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}};Overlay.windowResizeHandler=function(e){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
-clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}
-YAHOO.extend(Overlay,Module,{init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
-if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
-this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.removeClass(this.element,"show-scrollbars");Dom.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.removeClass(this.element,"hide-scrollbars");Dom.addClass(this.element,"show-scrollbars");},configVisible:function(type,args,obj){var visible=args[0],currentVis=Dom.getStyle(this.element,"visibility"),effect=this.cfg.getProperty("effect"),effectInstances=[],isMacGecko=(this.platform=="mac"&&YAHOO.env.ua.gecko),alreadySubscribed=Config.alreadySubscribed,eff,ei,e,i,j,k,h,nEffects,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
-e=e.parentNode;}
-if(currentVis=="inherit"){currentVis="visible";}}
-if(effect){if(effect instanceof Array){nEffects=effect.length;for(i=0;i<nEffects;i++){eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
-if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
-if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();nEffectInstances=effectInstances.length;for(j=0;j<nEffectInstances;j++){ei=effectInstances[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
-ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
-if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();nEffectInstances=effectInstances.length;for(k=0;k<nEffectInstances;k++){h=effectInstances[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
-h.animateOut();}}else if(currentVis===""){Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();Dom.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
-if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
-if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.element;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
-if(this.iframe){if(zIndex<=0){zIndex=1;}
-Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
-Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){oParentNode.appendChild(oIFrame);}
-oIFrame.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){oIFrame.style.width=(oElement.offsetWidth+nDimensionOffset+"px");oIFrame.style.height=(oElement.offsetHeight+nDimensionOffset+"px");aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}
-Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent,aXY;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}
-if(YAHOO.env.ua.ie){m_oIFrameTemplate.style.filter="alpha(opacity=0)";m_oIFrameTemplate.frameBorder=0;}
-else{m_oIFrameTemplate.style.opacity="0";}
-m_oIFrameTemplate.style.position="absolute";m_oIFrameTemplate.style.border="none";m_oIFrameTemplate.style.margin="0";m_oIFrameTemplate.style.padding="0";m_oIFrameTemplate.style.display="none";}
-oIFrame=m_oIFrameTemplate.cloneNode(false);oParent=oElement.parentNode;if(oParent){oParent.appendChild(oIFrame);}else{document.body.appendChild(oIFrame);}
-this.iframe=oIFrame;}
-this.showIframe();this.syncIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
-function onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}
-if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}
-else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
-if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}},align:function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){switch(elementAlign){case Overlay.TOP_LEFT:me.moveTo(h,v);break;case Overlay.TOP_RIGHT:me.moveTo((h-element.offsetWidth),v);break;case Overlay.BOTTOM_LEFT:me.moveTo(h,(v-element.offsetHeight));break;case Overlay.BOTTOM_RIGHT:me.moveTo((h-element.offsetWidth),(v-element.offsetHeight));break;}}
-if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}
-if(!contextAlign){contextAlign=contextArgs[2];}
-if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
-if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);},center:function(){var scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),viewPortWidth=Dom.getClientWidth(),viewPortHeight=Dom.getClientHeight(),elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,x=(viewPortWidth/2)-(elementWidth/2)+scrollX,y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=Dom.getStyle(p_oOverlay1,"zIndex"),sZIndex2=Dom.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return-1;}else if(nZIndex1<nZIndex2){return 1;}else{return 0;}}
-function isOverlayElement(p_oElement){var oOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(oOverlay&&!Dom.isAncestor(oElement,oOverlay)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}
-else{aOverlays[aOverlays.length]=p_oElement;}}}
-Dom.getElementsBy(isOverlayElement,"DIV",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oElement){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
-this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();}
-this.bringToTop(o);activeOverlay=o;Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}
-originalZ=Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);}
-o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}
-while(i--);}};this._onOverlayBlur=function(p_sType,p_aArgs){activeOverlay=null;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
-if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}
-else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},register:function(overlay){var mgr=this,zIndex,regcount,i,nOverlays;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focus=function(){mgr.focus(this);};overlay.blur=function(){if(mgr.getActive()==this){Dom.removeClass(this.element,OverlayManager.CSS_FOCUSED);this.blurEvent.fire();}};overlay.blurEvent.subscribe(mgr._onOverlayBlur);overlay.hideEvent.subscribe(overlay.blur);overlay.destroyEvent.subscribe(this._onOverlayDestroy,overlay,this);Event.on(overlay.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,overlay);zIndex=Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
-this.overlays.push(overlay);this.bringToTop(overlay);return true;}else if(overlay instanceof Array){regcount=0;nOverlays=overlay.length;for(i=0;i<nOverlays;i++){if(this.register(overlay[i])){regcount++;}}
-if(regcount>0){return true;}}else{return false;}},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oOverlay){oOverlay.cfg.setProperty("zIndex",(parseInt(nTopZIndex,10)+2));}
-aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;if(overlay instanceof Overlay){do{if(aOverlays[i]==overlay){return aOverlays[i];}}
-while(i--);}else if(typeof overlay=="string"){do{if(aOverlays[i].id==overlay){return aOverlays[i];}}
-while(i--);}
-return null;}},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex"),zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].show();}
-while(i--);}},hideAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].hide();}
-while(i--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Tooltip=YAHOO.widget.Tooltip,m_oShadowTemplate,DEFAULT_CONFIG={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:Lang.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:Lang.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:Lang.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:Lang.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"}};Tooltip.CSS_TOOLTIP="yui-tt";function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
-this.unsubscribe("hide",this._onHide,p_oObject);}
-function setWidthToOffsetWidth(p_sType,p_aArgs){var oBody=document.body,oConfig=this.cfg,sOriginalWidth=oConfig.getProperty("width"),sNewWidth,oClone;if((!sOriginalWidth||sOriginalWidth=="auto")&&(oConfig.getProperty("container")!=oBody||oConfig.getProperty("x")>=Dom.getViewportWidth()||oConfig.getProperty("y")>=Dom.getViewportHeight())){oClone=this.element.cloneNode(true);oClone.style.visibility="hidden";oClone.style.top="0px";oClone.style.left="0px";oBody.appendChild(oClone);sNewWidth=(oClone.offsetWidth+"px");oBody.removeChild(oClone);oClone=null;oConfig.setProperty("width",sNewWidth);oConfig.refireEvent("xy");this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}
-function onDOMReady(p_sType,p_aArgs,p_oObject){this.render(p_oObject);}
-function onInit(){Event.onDOMReady(onDOMReady,this.cfg.getProperty("container"),this);}
-YAHOO.extend(Tooltip,YAHOO.widget.Overlay,{init:function(el,userConfig){Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(Tooltip);Dom.addClass(this.element,Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",setWidthToOffsetWidth);this.subscribe("init",onInit);this.subscribe("render",this.onRender);this.initEvent.fire(Tooltip);},initDefaultConfig:function(){Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key,{value:DEFAULT_CONFIG.PREVENT_OVERLAP.value,validator:DEFAULT_CONFIG.PREVENT_OVERLAP.validator,supercedes:DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,validator:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);}},configContainer:function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}},_removeEventListeners:function(){var aElements=this._context,nElements,oElement,i;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.removeListener(oElement,"mouseover",this.onContextMouseOver);Event.removeListener(oElement,"mousemove",this.onContextMouseMove);Event.removeListener(oElement,"mouseout",this.onContextMouseOut);}
-while(i--);}}},configContext:function(type,args,obj){var context=args[0],aElements,nElements,oElement,i;if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
-context=this.cfg.getProperty("context");}
-this._removeEventListeners();this._context=context;aElements=this._context;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.on(oElement,"mouseover",this.onContextMouseOver,this);Event.on(oElement,"mousemove",this.onContextMouseMove,this);Event.on(oElement,"mouseout",this.onContextMouseOut,this);}
-while(i--);}}}},onContextMouseMove:function(e,obj){obj.pageX=Event.getPageX(e);obj.pageY=Event.getPageY(e);},onContextMouseOver:function(e,obj){var context=this;if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
-Event.on(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
-obj.showProcId=obj.doShow(e,context);},onContextMouseOut:function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
-if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
-if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
-obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));},doShow:function(e,context){var yOffset=25,me=this;if(YAHOO.env.ua.opera&&context.tagName&&context.tagName.toUpperCase()=="A"){yOffset+=12;}
-return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
-me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
-Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(pageX,pageY){var height=this.element.offsetHeight,mousePoint=new YAHOO.util.Point(pageX,pageY),elementRegion=Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this._shadow;if(oShadow){oShadow.style.width=(oElement.offsetWidth+6)+"px";oShadow.style.height=(oElement.offsetHeight+1)+"px";}}
-function addShadowVisibleClass(){Dom.addClass(this._shadow,"yui-tt-shadow-visible");}
-function removeShadowVisibleClass(){Dom.removeClass(this._shadow,"yui-tt-shadow-visible");}
-function createShadow(){var oShadow=this._shadow,oElement,Module,nIE,me;if(!oShadow){oElement=this.element;Module=YAHOO.widget.Module;nIE=YAHOO.env.ua.ie;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-tt-shadow";}
-oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;addShadowVisibleClass.call(this);this.subscribe("beforeShow",addShadowVisibleClass);this.subscribe("beforeHide",removeShadowVisibleClass);if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){sizeShadow.call(me);},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.subscribe("changeContent",sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,this,true);this.subscribe("destroy",function(){Module.textResizeEvent.unsubscribe(sizeShadow,this);});}}}
-function onBeforeShow(){createShadow.call(this);this.unsubscribe("beforeShow",onBeforeShow);}
-if(this.cfg.getProperty("visible")){createShadow.call(this);}
-else{this.subscribe("beforeShow",onBeforeShow);}},destroy:function(){this._removeEventListeners();Tooltip.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,DD=YAHOO.util.DD,Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Overlay=YAHOO.widget.Overlay,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config,Panel=YAHOO.widget.Panel,m_oMaskTemplate,m_oUnderlayTemplate,m_oCloseIconTemplate,EVENT_TYPES={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},DEFAULT_CONFIG={"CLOSE":{key:"close",value:true,validator:Lang.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(DD?true:false),validator:Lang.isBoolean,supercedes:["visible"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:Lang.isBoolean,supercedes:["visible"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};Panel.CSS_PANEL="yui-panel";Panel.CSS_PANEL_CONTAINER="yui-panel-container";function createHeader(p_sType,p_aArgs){if(!this.header){this.setHeader("&#160;");}}
-function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
-this.unsubscribe("hide",restoreOriginalWidth,p_oObject);}
-function setWidthToOffsetWidth(p_sType,p_aArgs){var nIE=YAHOO.env.ua.ie,oConfig,sOriginalWidth,sNewWidth;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){oConfig=this.cfg;sOriginalWidth=oConfig.getProperty("width");if(!sOriginalWidth||sOriginalWidth=="auto"){sNewWidth=(this.element.offsetWidth+"px");oConfig.setProperty("width",sNewWidth);this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}}
-function onElementFocus(){this.blur();}
-function addFocusEventHandlers(p_sType,p_aArgs){var me=this;function isFocusable(el){var sTagName=el.tagName.toUpperCase(),bFocusable=false;switch(sTagName){case"A":case"BUTTON":case"SELECT":case"TEXTAREA":if(!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
-break;case"INPUT":if(el.type!="hidden"&&!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
-break;}
-return bFocusable;}
-this.focusableElements=Dom.getElementsBy(isFocusable);}
-function removeFocusEventHandlers(p_sType,p_aArgs){var aElements=this.focusableElements,nElements=aElements.length,el2,i;for(i=0;i<nElements;i++){el2=aElements[i];Event.removeListener(el2,"focus",onElementFocus);}}
-YAHOO.extend(Panel,Overlay,{init:function(el,userConfig){Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(Panel);Dom.addClass(this.element,Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.subscribe("showMask",addFocusEventHandlers);this.subscribe("hideMask",removeFocusEventHandlers);this.initEvent.fire(Panel);},initEvents:function(){Panel.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.showMaskEvent=this.createEvent(EVENT_TYPES.SHOW_MASK);this.showMaskEvent.signature=SIGNATURE;this.hideMaskEvent=this.createEvent(EVENT_TYPES.HIDE_MASK);this.hideMaskEvent.signature=SIGNATURE;this.dragEvent=this.createEvent(EVENT_TYPES.DRAG);this.dragEvent.signature=SIGNATURE;},initDefaultConfig:function(){Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key,{handler:this.configClose,value:DEFAULT_CONFIG.CLOSE.value,validator:DEFAULT_CONFIG.CLOSE.validator,supercedes:DEFAULT_CONFIG.CLOSE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key,{handler:this.configDraggable,value:DEFAULT_CONFIG.DRAGGABLE.value,validator:DEFAULT_CONFIG.DRAGGABLE.validator,supercedes:DEFAULT_CONFIG.DRAGGABLE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key,{handler:this.configUnderlay,value:DEFAULT_CONFIG.UNDERLAY.value,supercedes:DEFAULT_CONFIG.UNDERLAY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key,{handler:this.configModal,value:DEFAULT_CONFIG.MODAL.value,validator:DEFAULT_CONFIG.MODAL.validator,supercedes:DEFAULT_CONFIG.MODAL.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent,supercedes:DEFAULT_CONFIG.KEY_LISTENERS.supercedes});},configClose:function(type,args,obj){var val=args[0],oClose=this.close;function doHide(e,obj){obj.hide();}
-if(val){if(!oClose){if(!m_oCloseIconTemplate){m_oCloseIconTemplate=document.createElement("span");m_oCloseIconTemplate.innerHTML="&#160;";m_oCloseIconTemplate.className="container-close";}
-oClose=m_oCloseIconTemplate.cloneNode(true);this.innerElement.appendChild(oClose);Event.on(oClose,"click",doHide,this);this.close=oClose;}else{oClose.style.display="block";}}else{if(oClose){oClose.style.display="none";}}},configDraggable:function(type,args,obj){var val=args[0];if(val){if(!DD){this.cfg.setProperty("draggable",false);return;}
-if(this.header){Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}
-this.subscribe("beforeRender",createHeader);this.subscribe("beforeShow",setWidthToOffsetWidth);}else{if(this.dd){this.dd.unreg();}
-if(this.header){Dom.setStyle(this.header,"cursor","auto");}
-this.unsubscribe("beforeRender",createHeader);this.unsubscribe("beforeShow",setWidthToOffsetWidth);}},configUnderlay:function(type,args,obj){var UA=YAHOO.env.ua,bMacGecko=(this.platform=="mac"&&UA.gecko),sUnderlay=args[0].toLowerCase(),oUnderlay=this.underlay,oElement=this.element;function createUnderlay(){var nIE;if(!oUnderlay){if(!m_oUnderlayTemplate){m_oUnderlayTemplate=document.createElement("div");m_oUnderlayTemplate.className="underlay";}
-oUnderlay=m_oUnderlayTemplate.cloneNode(false);this.element.appendChild(oUnderlay);this.underlay=oUnderlay;nIE=UA.ie;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}}}
-function onBeforeShow(){createUnderlay.call(this);this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(onBeforeShow);}
-function destroyUnderlay(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(onBeforeShow);this._underlayDeferred=false;}
-if(oUnderlay){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(oUnderlay);this.underlay=null;}}
-switch(sUnderlay){case"shadow":Dom.removeClass(oElement,"matte");Dom.addClass(oElement,"shadow");break;case"matte":if(!bMacGecko){destroyUnderlay.call(this);}
-Dom.removeClass(oElement,"shadow");Dom.addClass(oElement,"matte");break;default:if(!bMacGecko){destroyUnderlay.call(this);}
-Dom.removeClass(oElement,"shadow");Dom.removeClass(oElement,"matte");break;}
-if((sUnderlay=="shadow")||(bMacGecko&&!oUnderlay)){if(this.cfg.getProperty("visible")){createUnderlay.call(this);}
-else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._underlayDeferred=true;}}}},configModal:function(type,args,obj){var modal=args[0];if(modal){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}
-this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var oMask=this.mask,oParentNode;if(oMask){this.hideMask();oParentNode=oMask.parentNode;if(oParentNode){oParentNode.removeChild(oMask);}
-this.mask=null;}},configKeyListeners:function(type,args,obj){var listeners=args[0],listener,nListeners,i;if(listeners){if(listeners instanceof Array){nListeners=listeners.length;for(i=0;i<nListeners;i++){listener=listeners[i];if(!Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
-if(!Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
-if(!Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}},configHeight:function(type,args,obj){var height=args[0],el=this.innerElement;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.innerElement;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0,currentZ=Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
-if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;Dom.setStyle(this.mask,"zIndex",maskZ);}}},buildWrapper:function(){var elementParent=this.element.parentNode,originalElement=this.element,wrapper=document.createElement("div");wrapper.className=Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
-wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;Dom.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var oUnderlay=this.underlay,oElement;if(oUnderlay){oElement=this.element;oUnderlay.style.width=oElement.offsetWidth+"px";oUnderlay.style.height=oElement.offsetHeight+"px";}},registerDragDrop:function(){var me=this;if(this.header){if(!DD){return;}
-this.dd=new DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
-this.dd.startDrag=function(){var offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY,topConstraint,leftConstraint,bottomConstraint,rightConstraint;if(YAHOO.env.ua.ie==6){Dom.addClass(me.element,"drag");}
-if(me.cfg.getProperty("constraintoviewport")){offsetHeight=me.element.offsetHeight;offsetWidth=me.element.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();topConstraint=scrollY+10;leftConstraint=scrollX+10;bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
-me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}
-me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){Dom.removeClass(me.element,"drag");}
-me.dragEvent.fire("endDrag",arguments);me.moveEvent.fire(me.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var oMask=this.mask;if(!oMask){if(!m_oMaskTemplate){m_oMaskTemplate=document.createElement("div");m_oMaskTemplate.className="mask";m_oMaskTemplate.innerHTML="&#160;";}
-oMask=m_oMaskTemplate.cloneNode(true);oMask.id=this.id+"_mask";document.body.insertBefore(oMask,document.body.firstChild);this.mask=oMask;}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();Dom.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=Dom.getDocumentHeight()+"px";this.mask.style.width=Dom.getDocumentWidth()+"px";}},render:function(appendToNode){return Panel.superclass.render.call(this,appendToNode,this.innerElement);},destroy:function(){Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){Event.purgeElement(this.close);}
-Panel.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};var Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Dom=YAHOO.util.Dom,KeyListener=YAHOO.util.KeyListener,Connect=YAHOO.util.Connect,Dialog=YAHOO.widget.Dialog,Lang=YAHOO.lang,EVENT_TYPES={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},DEFAULT_CONFIG={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"}};Dialog.CSS_DIALOG="yui-dialog";function removeButtonEventHandlers(){var aButtons=this._aButtons,nButtons,oButton,i;if(Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=nButtons-1;do{oButton=aButtons[i];if(oButton instanceof YAHOO.widget.Button){oButton.destroy();}
-else if(oButton.tagName.toUpperCase()=="BUTTON"){Event.purgeElement(oButton);Event.purgeElement(oButton,false);}}
-while(i--);}}}
-YAHOO.extend(Dialog,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key,{handler:this.configPostMethod,value:DEFAULT_CONFIG.POST_METHOD.value,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key,{handler:this.configButtons,value:DEFAULT_CONFIG.BUTTONS.value});},initEvents:function(){Dialog.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeSubmitEvent=this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=SIGNATURE;this.submitEvent=this.createEvent(EVENT_TYPES.SUBMIT);this.submitEvent.signature=SIGNATURE;this.manualSubmitEvent=this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);this.manualSubmitEvent.signature=SIGNATURE;this.asyncSubmitEvent=this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=SIGNATURE;this.formSubmitEvent=this.createEvent(EVENT_TYPES.FORM_SUBMIT);this.formSubmitEvent.signature=SIGNATURE;this.cancelEvent=this.createEvent(EVENT_TYPES.CANCEL);this.cancelEvent.signature=SIGNATURE;},init:function(el,userConfig){Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(Dialog);Dom.addClass(this.element,Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(Dialog);},doSubmit:function(){var oForm=this.form,bUseFileUpload=false,bUseSecureFileUpload=false,aElements,nElements,i,sMethod;switch(this.cfg.getProperty("postmethod")){case"async":aElements=oForm.elements;nElements=aElements.length;if(nElements>0){i=nElements-1;do{if(aElements[i].type=="file"){bUseFileUpload=true;break;}}
-while(i--);}
-if(bUseFileUpload&&YAHOO.env.ua.ie&&this.isSecure){bUseSecureFileUpload=true;}
-sMethod=(oForm.getAttribute("method")||"POST").toUpperCase();Connect.setForm(oForm,bUseFileUpload,bUseSecureFileUpload);Connect.asyncRequest(sMethod,oForm.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":oForm.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var form=this.element.getElementsByTagName("form")[0],me=this,firstElement,lastElement;if(this.form){if(this.form==form&&Dom.isAncestor(this.element,this.form)){return;}
-else{Event.purgeElement(this.form);this.form=null;}}
-if(!form){form=document.createElement("form");form.name="frm_"+this.id;this.body.appendChild(form);}
-if(form){this.form=form;Event.on(form,"submit",function(e){Event.stopEvent(e);this.submit();this.form.blur();});this.firstFormElement=function(){var f,el,nElements=form.elements.length;for(f=0;f<nElements;f++){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
-return null;}();this.lastFormElement=function(){var f,el,nElements=form.elements.length;for(f=nElements-1;f>=0;f--){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
-return null;}();if(this.cfg.getProperty("modal")){firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
-lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(type,args,obj){var val=args[0];function doCancel(e,obj){obj.cancel();}
-if(val){if(!this.close){this.close=document.createElement("div");Dom.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);Event.on(this.close,"click",doCancel,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(type,args,obj){var Button=YAHOO.widget.Button,aButtons=args[0],oInnerElement=this.innerElement,oButton,oButtonEl,oYUIButton,nButtons,oSpan,oFooter,i;removeButtonEventHandlers.call(this);this._aButtons=null;if(Lang.isArray(aButtons)){oSpan=document.createElement("span");oSpan.className="button-group";nButtons=aButtons.length;this._aButtons=[];for(i=0;i<nButtons;i++){oButton=aButtons[i];if(Button){oYUIButton=new Button({label:oButton.text,container:oSpan});oButtonEl=oYUIButton.get("element");if(oButton.isDefault){oYUIButton.addClass("default");this.defaultHtmlButton=oButtonEl;}
-if(Lang.isFunction(oButton.handler)){oYUIButton.set("onclick",{fn:oButton.handler,obj:this,scope:this});}
-else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){oYUIButton.set("onclick",{fn:oButton.handler.fn,obj:((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),scope:(oButton.handler.scope||this)});}
-this._aButtons[this._aButtons.length]=oYUIButton;}
-else{oButtonEl=document.createElement("button");oButtonEl.setAttribute("type","button");if(oButton.isDefault){oButtonEl.className="default";this.defaultHtmlButton=oButtonEl;}
-oButtonEl.innerHTML=oButton.text;if(Lang.isFunction(oButton.handler)){Event.on(oButtonEl,"click",oButton.handler,this,true);}
-else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){Event.on(oButtonEl,"click",oButton.handler.fn,((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),(oButton.handler.scope||this));}
-oSpan.appendChild(oButtonEl);this._aButtons[this._aButtons.length]=oButtonEl;}
-oButton.htmlButton=oButtonEl;if(i===0){this.firstButton=oButtonEl;}
-if(i==(nButtons-1)){this.lastButton=oButtonEl;}}
-this.setFooter(oSpan);oFooter=this.footer;if(Dom.inDocument(this.element)&&!Dom.isAncestor(oInnerElement,oFooter)){oInnerElement.appendChild(oFooter);}
-this.buttonSpan=oSpan;}else{oSpan=this.buttonSpan;oFooter=this.footer;if(oSpan&&oFooter){oFooter.removeChild(oSpan);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}
-this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var aButtons=this._aButtons;if(aButtons){return aButtons;}},focusFirst:function(type,args,obj){var oElement=this.firstFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
-if(oElement){try{oElement.focus();}
-catch(oException){}}else{this.focusDefaultButton();}},focusLast:function(type,args,obj){var aButtons=this.cfg.getProperty("buttons"),oElement=this.lastFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
-if(aButtons&&Lang.isArray(aButtons)){this.focusLastButton();}else{if(oElement){try{oElement.focus();}
-catch(oException){}}}},focusDefaultButton:function(){var oElement=this.defaultHtmlButton;if(oElement){try{oElement.focus();}
-catch(oException){}}},blurButtons:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement,i;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=(nButtons-1);do{oButton=aButtons[i];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.blur();}
-catch(oException){}}}}
-while(i--);}}},focusFirstButton:function(){var aButtons=this.cfg.getProperty("buttons"),oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){oButton=aButtons[0];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
-catch(oException){}}}}},focusLastButton:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){oButton=aButtons[(nButtons-1)];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
-catch(oException){}}}}}},configPostMethod:function(type,args,obj){var postmethod=args[0];this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var oForm=this.form,aElements,nTotalElements,oData,sName,oElement,nElements,sType,sTagName,aOptions,nOptions,aValues,oOption,sValue,oRadio,oCheckbox,i,n;function isFormElement(p_oElement){var sTag=p_oElement.tagName.toUpperCase();return((sTag=="INPUT"||sTag=="TEXTAREA"||sTag=="SELECT")&&p_oElement.name==sName);}
-if(oForm){aElements=oForm.elements;nTotalElements=aElements.length;oData={};for(i=0;i<nTotalElements;i++){sName=aElements[i].name;oElement=Dom.getElementsBy(isFormElement,"*",oForm);nElements=oElement.length;if(nElements>0){if(nElements==1){oElement=oElement[0];sType=oElement.type;sTagName=oElement.tagName.toUpperCase();switch(sTagName){case"INPUT":if(sType=="checkbox"){oData[sName]=oElement.checked;}
-else if(sType!="radio"){oData[sName]=oElement.value;}
-break;case"TEXTAREA":oData[sName]=oElement.value;break;case"SELECT":aOptions=oElement.options;nOptions=aOptions.length;aValues=[];for(n=0;n<nOptions;n++){oOption=aOptions[n];if(oOption.selected){sValue=oOption.value;if(!sValue||sValue===""){sValue=oOption.text;}
-aValues[aValues.length]=sValue;}}
-oData[sName]=aValues;break;}}
-else{sType=oElement[0].type;switch(sType){case"radio":for(n=0;n<nElements;n++){oRadio=oElement[n];if(oRadio.checked){oData[sName]=oRadio.value;break;}}
-break;case"checkbox":aValues=[];for(n=0;n<nElements;n++){oCheckbox=oElement[n];if(oCheckbox.checked){aValues[aValues.length]=oCheckbox.value;}}
-oData[sName]=aValues;break;}}}}}
-return oData;},destroy:function(){removeButtonEventHandlers.call(this);this._aButtons=null;var aForms=this.element.getElementsByTagName("form"),oForm;if(aForms.length>0){oForm=aForms[0];if(oForm){Event.purgeElement(oForm);this.body.removeChild(oForm);this.form=null;}}
-Dialog.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};var Dom=YAHOO.util.Dom,SimpleDialog=YAHOO.widget.SimpleDialog,DEFAULT_CONFIG={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};SimpleDialog.ICON_BLOCK="blckicon";SimpleDialog.ICON_ALARM="alrticon";SimpleDialog.ICON_HELP="hlpicon";SimpleDialog.ICON_INFO="infoicon";SimpleDialog.ICON_WARN="warnicon";SimpleDialog.ICON_TIP="tipicon";SimpleDialog.ICON_CSS_CLASSNAME="yui-icon";SimpleDialog.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(SimpleDialog,YAHOO.widget.Dialog,{initDefaultConfig:function(){SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.ICON.key,{handler:this.configIcon,value:DEFAULT_CONFIG.ICON.value,suppressEvent:DEFAULT_CONFIG.ICON.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent,supercedes:DEFAULT_CONFIG.TEXT.supercedes});},init:function(el,userConfig){SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(SimpleDialog);Dom.addClass(this.element,SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(SimpleDialog);},registerForm:function(){SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+
-this.id+"\" value=\"\"/>";},configIcon:function(type,args,obj){var sIcon=args[0],oBody=this.body,sCSSClass=SimpleDialog.ICON_CSS_CLASSNAME,oIcon,oIconParent;if(sIcon&&sIcon!="none"){oIcon=Dom.getElementsByClassName(sCSSClass,"*",oBody);if(oIcon){oIconParent=oIcon.parentNode;if(oIconParent){oIconParent.removeChild(oIcon);oIcon=null;}}
-if(sIcon.indexOf(".")==-1){oIcon=document.createElement("span");oIcon.className=(sCSSClass+" "+sIcon);oIcon.innerHTML="&#160;";}else{oIcon=document.createElement("img");oIcon.src=(this.imageRoot+sIcon);oIcon.className=sCSSClass;}
-if(oIcon){oBody.insertBefore(oIcon,oBody.firstChild);}}},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
-this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,Easing=YAHOO.util.Easing,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var fade=new ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
-if(obj.overlay.underlay){obj.initialUnderlayOpacity=Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
-Dom.setStyle(obj.overlay.element,"visibility","visible");Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
-if(obj.overlay.underlay){Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
-obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
-Dom.setStyle(obj.overlay.element,"visibility","hidden");Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,slide=new ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=((-25)-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if(Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){Dom.setStyle(obj.overlay.element,"visibility","visible");}
-obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1],currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
-return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=("<div class=\""+G.CSS_HEADER+"\"></div><div class=\""+G.CSS_BODY+"\"></div><div class=\""+G.CSS_FOOTER+"\"></div>");O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);
+this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}this.element=U;if(U.id){this.id=U.id;}V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}if(!U){T=["<html><head><script ","type=\"text/javascript\">","window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}R.id="_yuiResizeMonitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}G.textResizeInitialized=true;}this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);
+}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;
+if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);T=S.parentNode;var Q=T||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];
+K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(L,K,M){var O=K[0];var N=this.getConstrainedXY(O[0],O[1]);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},getConstrainedXY:function(V,T){var N=B.VIEWPORT_OFFSET,U=D.getViewportWidth(),Q=D.getViewportHeight(),M=this.element.offsetHeight,S=this.element.offsetWidth,Y=D.getDocumentScrollLeft(),W=D.getDocumentScrollTop();var P=V;var L=T;if(S+N<U){var R=Y+N;var X=Y+U-S-N;if(V<R){P=R;}else{if(V>X){P=X;}}}else{P=N+Y;}if(M+N<Q){var O=W+N;var K=W+Q-M-N;if(T<O){L=O;}else{if(T>K){L=K;}}}else{L=N+W;}return[P,L];},center:function(){var N=B.VIEWPORT_OFFSET,O=this.element.offsetWidth,M=this.element.offsetHeight,L=D.getViewportWidth(),P=D.getViewportHeight(),K,Q;if(O<L){K=(L/2)-(O/2)+D.getDocumentScrollLeft();}else{K=N+D.getDocumentScrollLeft();}if(M<P){Q=(P/2)-(M/2)+D.getDocumentScrollTop();}else{Q=N+D.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(K,10),parseInt(Q,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var O=[],N=this.element;function R(V,U){var X=D.getStyle(V,"zIndex"),W=D.getStyle(U,"zIndex"),T=(!X||isNaN(X))?0:parseInt(X,10),S=(!W||isNaN(W))?0:parseInt(W,10);if(T>S){return -1;}else{if(T<S){return 1;}else{return 0;}}}function M(U){var S=D.hasClass(U,B.CSS_OVERLAY),T=YAHOO.widget.Panel;if(S&&!D.isAncestor(N,S)){if(T&&D.hasClass(U,T.CSS_PANEL)){O[O.length]=U.parentNode;}else{O[O.length]=U;}}}D.getElementsBy(M,"DIV",document.body);O.sort(R);var K=O[0],Q;if(K){Q=D.getStyle(K,"zIndex");if(!isNaN(Q)){var P=false;if(K!=N){P=true;}else{if(O.length>1){var L=D.getStyle(O[1],"zIndex");if(!isNaN(L)&&(Q==L)){P=true;}}}if(P){this.cfg.setProperty("zindex",(parseInt(Q,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");
+if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(N,M){YAHOO.widget.Tooltip.superclass.constructor.call(this,N,M);};var E=YAHOO.lang,L=YAHOO.util.Event,K=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,G=YAHOO.widget.Tooltip,F,H={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};G.CSS_TOOLTIP="yui-tt";function I(N,M,O){var R=O[0],P=O[1],Q=this.cfg,S=Q.getProperty("width");if(S==P){Q.setProperty("width",R);}this.unsubscribe("hide",this._onHide,O);}function D(N,M){var O=document.body,S=this.cfg,R=S.getProperty("width"),P,Q;if((!R||R=="auto")&&(S.getProperty("container")!=O||S.getProperty("x")>=C.getViewportWidth()||S.getProperty("y")>=C.getViewportHeight())){Q=this.element.cloneNode(true);Q.style.visibility="hidden";Q.style.top="0px";Q.style.left="0px";O.appendChild(Q);P=(Q.offsetWidth+"px");O.removeChild(Q);Q=null;S.setProperty("width",P);S.refireEvent("xy");this.subscribe("hide",I,[(R||""),P]);}}function B(N,M,O){this.render(O);}function J(){L.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(G,YAHOO.widget.Overlay,{init:function(N,M){G.superclass.init.call(this,N);this.beforeInitEvent.fire(G);C.addClass(this.element,G.CSS_TOOLTIP);if(M){this.cfg.applyConfig(M,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",D);this.subscribe("init",J);this.subscribe("render",this.onRender);this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);var M=K.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=M;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=M;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=M;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.PREVENT_OVERLAP.key,{value:H.PREVENT_OVERLAP.value,validator:H.PREVENT_OVERLAP.validator,supercedes:H.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(H.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:H.SHOW_DELAY.validator});this.cfg.addProperty(H.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:H.AUTO_DISMISS_DELAY.value,validator:H.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(H.HIDE_DELAY.key,{handler:this.configHideDelay,value:H.HIDE_DELAY.value,validator:H.HIDE_DELAY.validator});this.cfg.addProperty(H.TEXT.key,{handler:this.configText,suppressEvent:H.TEXT.suppressEvent});this.cfg.addProperty(H.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(H.DISABLED.key,{handler:this.configContainer,value:H.DISABLED.value,supressEvent:H.DISABLED.suppressEvent});},configText:function(N,M,O){var P=M[0];if(P){this.setBody(P);}},configContainer:function(O,N,P){var M=N[0];if(typeof M=="string"){this.cfg.setProperty("container",document.getElementById(M),true);}},_removeEventListeners:function(){var P=this._context,M,O,N;if(P){M=P.length;if(M>0){N=M-1;do{O=P[N];L.removeListener(O,"mouseover",this.onContextMouseOver);L.removeListener(O,"mousemove",this.onContextMouseMove);L.removeListener(O,"mouseout",this.onContextMouseOut);}while(N--);}}},configContext:function(R,N,S){var Q=N[0],T,M,P,O;if(Q){if(!(Q instanceof Array)){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q)],true);}else{this.cfg.setProperty("context",[Q],true);}Q=this.cfg.getProperty("context");}this._removeEventListeners();this._context=Q;T=this._context;if(T){M=T.length;if(M>0){O=M-1;do{P=T[O];L.on(P,"mouseover",this.onContextMouseOver,this);L.on(P,"mousemove",this.onContextMouseMove,this);L.on(P,"mouseout",this.onContextMouseOut,this);}while(O--);}}}},onContextMouseMove:function(N,M){M.pageX=L.getPageX(N);M.pageY=L.getPageY(N);},onContextMouseOver:function(O,N){var M=this;if(M.title){N._tempTitle=M.title;M.title="";}if(N.fireEvent("contextMouseOver",M,O)!==false&&!N.cfg.getProperty("disabled")){if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}L.on(M,"mousemove",N.onContextMouseMove,N);N.showProcId=N.doShow(O,M);}},onContextMouseOut:function(O,N){var M=this;if(N._tempTitle){M.title=N._tempTitle;N._tempTitle=null;}if(N.showProcId){clearTimeout(N.showProcId);N.showProcId=null;}if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}N.fireEvent("contextMouseOut",M,O);N.hideProcId=setTimeout(function(){N.hide();},N.cfg.getProperty("hidedelay"));},doShow:function(O,M){var P=25,N=this;if(YAHOO.env.ua.opera&&M.tagName&&M.tagName.toUpperCase()=="A"){P+=12;
+}return setTimeout(function(){var Q=N.cfg.getProperty("text");if(N._tempTitle&&(Q===""||YAHOO.lang.isUndefined(Q)||YAHOO.lang.isNull(Q))){N.setBody(N._tempTitle);}else{N.cfg.refireEvent("text");}N.moveTo(N.pageX,N.pageY+P);if(N.cfg.getProperty("preventoverlap")){N.preventOverlap(N.pageX,N.pageY);}L.removeListener(M,"mousemove",N.onContextMouseMove);N.contextTriggerEvent.fire(M);N.show();N.hideProcId=N.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var M=this;return setTimeout(function(){M.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(Q,P){var M=this.element.offsetHeight,O=new YAHOO.util.Point(Q,P),N=C.getRegion(this.element);N.top-=5;N.left-=5;N.right+=5;N.bottom+=5;if(N.contains(O)){this.cfg.setProperty("y",(P-M-5));}},onRender:function(Q,P){function R(){var U=this.element,T=this._shadow;if(T){T.style.width=(U.offsetWidth+6)+"px";T.style.height=(U.offsetHeight+1)+"px";}}function N(){C.addClass(this._shadow,"yui-tt-shadow-visible");}function M(){C.removeClass(this._shadow,"yui-tt-shadow-visible");}function S(){var V=this._shadow,U,T,X,W;if(!V){U=this.element;T=YAHOO.widget.Module;X=YAHOO.env.ua.ie;W=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}V=F.cloneNode(false);U.appendChild(V);this._shadow=V;N.call(this);this.subscribe("beforeShow",N);this.subscribe("beforeHide",M);if(X==6||(X==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){R.call(W);},0);this.cfg.subscribeToConfigEvent("width",R);this.cfg.subscribeToConfigEvent("height",R);this.subscribe("changeContent",R);T.textResizeEvent.subscribe(R,this,true);this.subscribe("destroy",function(){T.textResizeEvent.unsubscribe(R,this);});}}}function O(){S.call(this);this.unsubscribe("beforeShow",O);}if(this.cfg.getProperty("visible")){S.call(this);}else{this.subscribe("beforeShow",O);}},destroy:function(){this._removeEventListeners();G.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(U,T){YAHOO.widget.Panel.superclass.constructor.call(this,U,T);};var G=YAHOO.lang,N=YAHOO.util.DD,A=YAHOO.util.Dom,S=YAHOO.util.Event,I=YAHOO.widget.Overlay,L=YAHOO.util.CustomEvent,J=YAHOO.util.Config,O=YAHOO.widget.Panel,H,Q,D,E={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},M={"CLOSE":{key:"close",value:true,validator:G.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(N?true:false),validator:G.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:G.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:G.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";function K(U,T){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function R(U,T,V){var Y=V[0],W=V[1],X=this.cfg,Z=X.getProperty("width");if(Z==W){X.setProperty("width",Y);}this.unsubscribe("hide",R,V);}function C(U,T){var Y=YAHOO.env.ua.ie,X,W,V;if(Y==6||(Y==7&&document.compatMode=="BackCompat")){X=this.cfg;W=X.getProperty("width");if(!W||W=="auto"){V=(this.element.offsetWidth+"px");X.setProperty("width",V);this.subscribe("hide",R,[(W||""),V]);}}}function F(){this.blur();}function P(V,U){var W=this;function T(Z){var Y=Z.tagName.toUpperCase(),X=false;switch(Y){case"A":case"BUTTON":case"SELECT":case"TEXTAREA":if(!A.isAncestor(W.element,Z)){S.on(Z,"focus",F,Z,true);X=true;}break;case"INPUT":if(Z.type!="hidden"&&!A.isAncestor(W.element,Z)){S.on(Z,"focus",F,Z,true);X=true;}break;}return X;}this.focusableElements=A.getElementsBy(T);}function B(V,U){var Y=this.focusableElements,T=Y.length,W,X;for(X=0;X<T;X++){W=Y[X];S.removeListener(W,"focus",F);}}YAHOO.extend(O,I,{init:function(U,T){O.superclass.init.call(this,U);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(T){this.cfg.applyConfig(T,true);}this.subscribe("showMask",P);this.subscribe("hideMask",B);this.subscribe("beforeRender",K);this.initEvent.fire(O);},initEvents:function(){O.superclass.initEvents.call(this);var T=L.LIST;this.showMaskEvent=this.createEvent(E.SHOW_MASK);this.showMaskEvent.signature=T;this.hideMaskEvent=this.createEvent(E.HIDE_MASK);this.hideMaskEvent.signature=T;this.dragEvent=this.createEvent(E.DRAG);this.dragEvent.signature=T;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(M.CLOSE.key,{handler:this.configClose,value:M.CLOSE.value,validator:M.CLOSE.validator,supercedes:M.CLOSE.supercedes});this.cfg.addProperty(M.DRAGGABLE.key,{handler:this.configDraggable,value:M.DRAGGABLE.value,validator:M.DRAGGABLE.validator,supercedes:M.DRAGGABLE.supercedes});this.cfg.addProperty(M.DRAG_ONLY.key,{value:M.DRAG_ONLY.value,validator:M.DRAG_ONLY.validator,supercedes:M.DRAG_ONLY.supercedes});this.cfg.addProperty(M.UNDERLAY.key,{handler:this.configUnderlay,value:M.UNDERLAY.value,supercedes:M.UNDERLAY.supercedes});this.cfg.addProperty(M.MODAL.key,{handler:this.configModal,value:M.MODAL.value,validator:M.MODAL.validator,supercedes:M.MODAL.supercedes});this.cfg.addProperty(M.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:M.KEY_LISTENERS.suppressEvent,supercedes:M.KEY_LISTENERS.supercedes});},configClose:function(V,T,X){var Y=T[0],U=this.close;function W(a,Z){Z.hide();}if(Y){if(!U){if(!D){D=document.createElement("span");D.innerHTML="&#160;";D.className="container-close";}U=D.cloneNode(true);this.innerElement.appendChild(U);S.on(U,"click",W,this);this.close=U;}else{U.style.display="block";}}else{if(U){U.style.display="none";}}},configDraggable:function(U,T,V){var W=T[0];if(W){if(!N){this.cfg.setProperty("draggable",false);return ;}if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",C);}else{if(this.dd){this.dd.unreg();}if(this.header){A.setStyle(this.header,"cursor","auto");
+}this.unsubscribe("beforeShow",C);}},configUnderlay:function(e,d,Y){var c=YAHOO.env.ua,a=(this.platform=="mac"&&c.gecko),b=(c.ie==6||(c.ie==7&&document.compatMode=="BackCompat")),f=d[0].toLowerCase(),U=this.underlay,V=this.element;function g(){var h=this.underlay;A.addClass(h,"yui-force-redraw");window.setTimeout(function(){A.removeClass(h,"yui-force-redraw");},0);}function W(){var h=false;if(!U){if(!Q){Q=document.createElement("div");Q.className="underlay";}U=Q.cloneNode(false);this.element.appendChild(U);this.underlay=U;if(b){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(c.webkit&&c.webkit<420){this.changeContentEvent.subscribe(g);}h=true;}}function Z(){var h=W.call(this);if(!h&&b){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(Z);}function X(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(Z);this._underlayDeferred=false;}if(U){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(g);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(U);this.underlay=null;}}switch(f){case"shadow":A.removeClass(V,"matte");A.addClass(V,"shadow");break;case"matte":if(!a){X.call(this);}A.removeClass(V,"shadow");A.addClass(V,"matte");break;default:if(!a){X.call(this);}A.removeClass(V,"shadow");A.removeClass(V,"matte");break;}if((f=="shadow")||(a&&!U)){if(this.cfg.getProperty("visible")){var T=W.call(this);if(!T&&b){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(Z);this._underlayDeferred=true;}}}},configModal:function(U,T,W){var V=T[0];if(V){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);I.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);I.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var U=this.mask,T;if(U){this.hideMask();T=U.parentNode;if(T){T.removeChild(U);}this.mask=null;}},configKeyListeners:function(W,T,Z){var V=T[0],Y,X,U;if(V){if(V instanceof Array){X=V.length;for(U=0;U<X;U++){Y=V[U];if(!J.alreadySubscribed(this.showEvent,Y.enable,Y)){this.showEvent.subscribe(Y.enable,Y,true);}if(!J.alreadySubscribed(this.hideEvent,Y.disable,Y)){this.hideEvent.subscribe(Y.disable,Y,true);this.destroyEvent.subscribe(Y.disable,Y,true);}}}else{if(!J.alreadySubscribed(this.showEvent,V.enable,V)){this.showEvent.subscribe(V.enable,V,true);}if(!J.alreadySubscribed(this.hideEvent,V.disable,V)){this.hideEvent.subscribe(V.disable,V,true);this.destroyEvent.subscribe(V.disable,V,true);}}}},configHeight:function(W,U,X){var T=U[0],V=this.innerElement;A.setStyle(V,"height",T);this.cfg.refireEvent("iframe");},configWidth:function(W,T,X){var V=T[0],U=this.innerElement;A.setStyle(U,"width",V);this.cfg.refireEvent("iframe");},configzIndex:function(U,T,W){O.superclass.configzIndex.call(this,U,T,W);if(this.mask||this.cfg.getProperty("modal")===true){var V=A.getStyle(this.element,"zIndex");if(!V||isNaN(V)){V=0;}if(V===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var V=this.element.parentNode,T=this.element,U=document.createElement("div");U.className=O.CSS_PANEL_CONTAINER;U.id=T.id+"_c";if(V){V.insertBefore(U,T);}U.appendChild(T);this.element=U;this.innerElement=T;A.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var U=this.underlay,T;if(U){T=this.element;U.style.width=T.offsetWidth+"px";U.style.height=T.offsetHeight+"px";}},registerDragDrop:function(){var U=this;if(this.header){if(!N){return ;}var T=(this.cfg.getProperty("dragonly")===true);this.dd=new N(this.element.id,this.id,{dragOnly:T});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var W,Y,V,b,a,Z;if(YAHOO.env.ua.ie==6){A.addClass(U.element,"drag");}if(U.cfg.getProperty("constraintoviewport")){var X=I.VIEWPORT_OFFSET;W=U.element.offsetHeight;Y=U.element.offsetWidth;V=A.getViewportWidth();b=A.getViewportHeight();a=A.getDocumentScrollLeft();Z=A.getDocumentScrollTop();if(W+X<b){this.minY=Z+X;this.maxY=Z+b-W-X;}else{this.minY=Z+X;this.maxY=Z+X;}if(Y+X<V){this.minX=a+X;this.maxX=a+V-Y-X;}else{this.minX=a+X;this.maxX=a+X;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}U.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){U.syncPosition();U.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}U.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){A.removeClass(U.element,"drag");}U.dragEvent.fire("endDrag",arguments);U.moveEvent.fire(U.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var T=this.mask;if(!T){if(!H){H=document.createElement("div");H.className="mask";H.innerHTML="&#160;";}T=H.cloneNode(true);T.id=this.id+"_mask";document.body.insertBefore(T,document.body.firstChild);this.mask=T;if(YAHOO.env.ua.gecko&&this.platform=="mac"){A.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";
+this.hideMaskEvent.fire();A.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){A.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=A.getDocumentHeight()+"px";this.mask.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var T=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(T)&&!isNaN(T)){A.setStyle(this.mask,"zIndex",T-1);}}},render:function(T){return O.superclass.render.call(this,T,this.innerElement);},destroy:function(){I.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){S.purgeElement(this.close);}O.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(L,K){YAHOO.widget.Dialog.superclass.constructor.call(this,L,K);};var J=YAHOO.util.Event,I=YAHOO.util.CustomEvent,D=YAHOO.util.Dom,B=YAHOO.util.KeyListener,H=YAHOO.util.Connect,F=YAHOO.widget.Dialog,E=YAHOO.lang,A={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},G={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};F.CSS_DIALOG="yui-dialog";function C(){var N=this._aButtons,L,M,K;if(E.isArray(N)){L=N.length;if(L>0){K=L-1;do{M=N[K];if(YAHOO.widget.Button&&M instanceof YAHOO.widget.Button){M.destroy();}else{if(M.tagName.toUpperCase()=="BUTTON"){J.purgeElement(M);J.purgeElement(M,false);}}}while(K--);}}}YAHOO.extend(F,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(G.POST_METHOD.key,{handler:this.configPostMethod,value:G.POST_METHOD.value,validator:function(K){if(K!="form"&&K!="async"&&K!="none"&&K!="manual"){return false;}else{return true;}}});this.cfg.addProperty(G.HIDEAFTERSUBMIT.key,{value:G.HIDEAFTERSUBMIT.value});this.cfg.addProperty(G.BUTTONS.key,{handler:this.configButtons,value:G.BUTTONS.value});},initEvents:function(){F.superclass.initEvents.call(this);var K=I.LIST;this.beforeSubmitEvent=this.createEvent(A.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=K;this.submitEvent=this.createEvent(A.SUBMIT);this.submitEvent.signature=K;this.manualSubmitEvent=this.createEvent(A.MANUAL_SUBMIT);this.manualSubmitEvent.signature=K;this.asyncSubmitEvent=this.createEvent(A.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=K;this.formSubmitEvent=this.createEvent(A.FORM_SUBMIT);this.formSubmitEvent.signature=K;this.cancelEvent=this.createEvent(A.CANCEL);this.cancelEvent.signature=K;},init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);D.addClass(this.element,F.CSS_DIALOG);this.cfg.setProperty("visible",false);if(K){this.cfg.applyConfig(K,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(F);},doSubmit:function(){var Q=this.form,O=false,N=false,P,K,M,L;switch(this.cfg.getProperty("postmethod")){case"async":P=Q.elements;K=P.length;if(K>0){M=K-1;do{if(P[M].type=="file"){O=true;break;}}while(M--);}if(O&&YAHOO.env.ua.ie&&this.isSecure){N=true;}L=(Q.getAttribute("method")||"POST").toUpperCase();H.setForm(Q,O,N);H.asyncRequest(L,Q.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var M=this.element.getElementsByTagName("form")[0],L=this,K,N;if(this.form){if(this.form==M&&D.isAncestor(this.element,this.form)){return ;}else{J.purgeElement(this.form);this.form=null;}}if(!M){M=document.createElement("form");M.name="frm_"+this.id;this.body.appendChild(M);}if(M){this.form=M;J.on(M,"submit",function(O){J.stopEvent(O);this.submit();this.form.blur();},this,true);this.firstFormElement=function(){var Q,P,O=M.elements.length;for(Q=0;Q<O;Q++){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();this.lastFormElement=function(){var Q,P,O=M.elements.length;for(Q=O-1;Q>=0;Q--){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();if(this.cfg.getProperty("modal")){K=this.firstFormElement||this.firstButton;if(K){this.preventBackTab=new B(K,{shift:true,keys:9},{fn:L.focusLast,scope:L,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}N=this.lastButton||this.lastFormElement;if(N){this.preventTabOut=new B(N,{shift:false,keys:9},{fn:L.focusFirst,scope:L,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(M,K,N){var O=K[0];function L(Q,P){P.cancel();}if(O){if(!this.close){this.close=document.createElement("div");D.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);J.on(this.close,"click",L,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(U,T,O){var P=YAHOO.widget.Button,W=T[0],M=this.innerElement,V,R,L,S,Q,K,N;C.call(this);this._aButtons=null;if(E.isArray(W)){Q=document.createElement("span");Q.className="button-group";S=W.length;this._aButtons=[];for(N=0;N<S;N++){V=W[N];if(P){L=new P({label:V.text,container:Q});R=L.get("element");if(V.isDefault){L.addClass("default");this.defaultHtmlButton=R;}if(E.isFunction(V.handler)){L.set("onclick",{fn:V.handler,obj:this,scope:this});}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){L.set("onclick",{fn:V.handler.fn,obj:((!E.isUndefined(V.handler.obj))?V.handler.obj:this),scope:(V.handler.scope||this)});
+}}this._aButtons[this._aButtons.length]=L;}else{R=document.createElement("button");R.setAttribute("type","button");if(V.isDefault){R.className="default";this.defaultHtmlButton=R;}R.innerHTML=V.text;if(E.isFunction(V.handler)){J.on(R,"click",V.handler,this,true);}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){J.on(R,"click",V.handler.fn,((!E.isUndefined(V.handler.obj))?V.handler.obj:this),(V.handler.scope||this));}}Q.appendChild(R);this._aButtons[this._aButtons.length]=R;}V.htmlButton=R;if(N===0){this.firstButton=R;}if(N==(S-1)){this.lastButton=R;}}this.setFooter(Q);K=this.footer;if(D.inDocument(this.element)&&!D.isAncestor(M,K)){M.appendChild(K);}this.buttonSpan=Q;}else{Q=this.buttonSpan;K=this.footer;if(Q&&K){K.removeChild(Q);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var K=this._aButtons;if(K){return K;}},focusFirst:function(N,L,P){var M=this.firstFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(M){try{M.focus();}catch(O){}}else{this.focusDefaultButton();}},focusLast:function(N,L,P){var Q=this.cfg.getProperty("buttons"),M=this.lastFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(Q&&E.isArray(Q)){this.focusLastButton();}else{if(M){try{M.focus();}catch(O){}}}},focusDefaultButton:function(){var K=this.defaultHtmlButton;if(K){try{K.focus();}catch(L){}}},blurButtons:function(){var P=this.cfg.getProperty("buttons"),M,O,L,K;if(P&&E.isArray(P)){M=P.length;if(M>0){K=(M-1);do{O=P[K];if(O){L=O.htmlButton;if(L){try{L.blur();}catch(N){}}}}while(K--);}}},focusFirstButton:function(){var N=this.cfg.getProperty("buttons"),M,K;if(N&&E.isArray(N)){M=N[0];if(M){K=M.htmlButton;if(K){try{K.focus();}catch(L){}}}}},focusLastButton:function(){var O=this.cfg.getProperty("buttons"),L,N,K;if(O&&E.isArray(O)){L=O.length;if(L>0){N=O[(L-1)];if(N){K=N.htmlButton;if(K){try{K.focus();}catch(M){}}}}}},configPostMethod:function(L,K,M){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var a=this.form,M,T,W,O,U,R,Q,L,X,N,Y,b,K,P,c,Z,V;function S(e){var d=e.tagName.toUpperCase();return((d=="INPUT"||d=="TEXTAREA"||d=="SELECT")&&e.name==O);}if(a){M=a.elements;T=M.length;W={};for(Z=0;Z<T;Z++){O=M[Z].name;U=D.getElementsBy(S,"*",a);R=U.length;if(R>0){if(R==1){U=U[0];Q=U.type;L=U.tagName.toUpperCase();switch(L){case"INPUT":if(Q=="checkbox"){W[O]=U.checked;}else{if(Q!="radio"){W[O]=U.value;}}break;case"TEXTAREA":W[O]=U.value;break;case"SELECT":X=U.options;N=X.length;Y=[];for(V=0;V<N;V++){b=X[V];if(b.selected){K=b.value;if(!K||K===""){K=b.text;}Y[Y.length]=K;}}W[O]=Y;break;}}else{Q=U[0].type;switch(Q){case"radio":for(V=0;V<R;V++){P=U[V];if(P.checked){W[O]=P.value;break;}}break;case"checkbox":Y=[];for(V=0;V<R;V++){c=U[V];if(c.checked){Y[Y.length]=c.value;}}W[O]=Y;break;}}}}}return W;},destroy:function(){C.call(this);this._aButtons=null;var K=this.element.getElementsByTagName("form"),L;if(K.length>0){L=K[0];if(L){J.purgeElement(L);if(L.parentNode){L.parentNode.removeChild(L);}this.form=null;}}F.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML="&#160;";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,G){var I={attributes:{opacity:{from:0,to:1}},duration:G,method:C.easeIn};var F={attributes:{opacity:{to:0}},duration:G,method:C.easeOut};var H=new A(E,I,F,E.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(E.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;
+if(J&&YAHOO.env.ua.ie){B.removeClass(E.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(M,L,P){var N=B.getViewportWidth(),Q=B.getXY(P.overlay.element),O=Q[1];P.animOut.attributes.points.to=[(N+25),O];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 10b1a692de4eab146d265a8d5e54e164eb96edc0..cdeada0b23e2558e89764b61a3dc860234a45708 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,25 +18,19 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-    
         }
-    
+
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -353,7 +347,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -381,37 +375,37 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-        
+
                 return true;
             } else {
                 return false;
@@ -460,37 +454,23 @@ version: 2.3.0
         applyConfig: function (userConfig, init) {
         
             var sKey,
-                oValue,
                 oConfig;
 
             if (init) {
-
                 oConfig = {};
-
                 for (sKey in userConfig) {
-                
                     if (Lang.hasOwnProperty(userConfig, sKey)) {
-
                         oConfig[sKey.toLowerCase()] = userConfig[sKey];
-
                     }
-                
                 }
-
                 this.initialConfig = oConfig;
-
             }
 
             for (sKey in userConfig) {
-            
                 if (Lang.hasOwnProperty(userConfig, sKey)) {
-            
                     this.queueProperty(sKey, userConfig[sKey]);
-                
                 }
-
             }
-
         },
         
         /**
@@ -557,19 +537,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -689,31 +662,24 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -746,25 +712,18 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Module = function (el, userConfig) {
-    
         if (el) {
-    
             this.init(el, userConfig);
-    
         } else {
-    
-    
         }
-    
     };
 
-
     var Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
-        
+
         m_oModuleTemplate,
         m_oHeaderTemplate,
         m_oBodyTemplate,
@@ -816,14 +775,17 @@ version: 2.3.0
                 suppressEvent: true, 
                 supercedes: ["visible"] 
             },
-        
+
             "MONITOR_RESIZE": { 
                 key: "monitorresize", 
                 value: true  
+            },
+
+            "APPEND_TO_DOCUMENT_BODY": { 
+                key: "appendtodocumentbody", 
+                value: false
             }
-        
         };
-
     
     /**
     * Constant representing the prefix path to use for non-secure images
@@ -897,11 +859,9 @@ version: 2.3.0
     */
     Module.textResizeEvent = new CustomEvent("textResize");
 
-
     function createModuleTemplate() {
 
         if (!m_oModuleTemplate) {
-
             m_oModuleTemplate = document.createElement("div");
             
             m_oModuleTemplate.innerHTML = ("<div class=\"" + 
@@ -912,55 +872,34 @@ version: 2.3.0
             m_oHeaderTemplate = m_oModuleTemplate.firstChild;
             m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
             m_oFooterTemplate = m_oBodyTemplate.nextSibling;
-
         }
 
         return m_oModuleTemplate;
-
     }
 
-
     function createHeader() {
-
         if (!m_oHeaderTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oHeaderTemplate.cloneNode(false));
-
     }
-    
 
     function createBody() {
-
         if (!m_oBodyTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oBodyTemplate.cloneNode(false));
-    
     }
-    
 
     function createFooter() {
-
         if (!m_oFooterTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oFooterTemplate.cloneNode(false));
-
     }
-    
 
     Module.prototype = {
-    
+
         /**
         * The class's constructor function
         * @property contructor
@@ -974,35 +913,35 @@ version: 2.3.0
         * @type HTMLElement
         */
         element: null,
-        
+
         /**
         * The header element, denoted with CSS class "hd"
         * @property header
         * @type HTMLElement
         */
         header: null,
-        
+
         /**
         * The body element, denoted with CSS class "bd"
         * @property body
         * @type HTMLElement
         */
         body: null,
-        
+
         /**
         * The footer element, denoted with CSS class "ft"
         * @property footer
         * @type HTMLElement
         */
         footer: null,
-        
+
         /**
         * The id of the element
         * @property id
         * @type String
         */
         id: null,
-        
+
         /**
         * A string representing the root path for all images created by
         * a Module instance.
@@ -1012,16 +951,16 @@ version: 2.3.0
         * @type String
         */
         imageRoot: Module.IMG_ROOT,
-    
+
         /**
         * Initializes the custom events for Module which are fired 
         * automatically at appropriate times by the Module class.
         * @method initEvents
         */
         initEvents: function () {
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to class initalization.
             * @event beforeInitEvent
@@ -1030,7 +969,7 @@ version: 2.3.0
             */
             this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
             this.beforeInitEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after class initalization.
             * @event initEvent
@@ -1039,20 +978,19 @@ version: 2.3.0
             */  
             this.initEvent = this.createEvent(EVENT_TYPES.INIT);
             this.initEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is appended to the DOM
             * @event appendEvent
             */
             this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
             this.appendEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is rendered
             * @event beforeRenderEvent
             */
-            this.beforeRenderEvent = 
-                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER);
             this.beforeRenderEvent.signature = SIGNATURE;
         
             /**
@@ -1069,8 +1007,7 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new header content
             */
-            this.changeHeaderEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER);
             this.changeHeaderEvent.signature = SIGNATURE;
             
             /**
@@ -1089,46 +1026,44 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new footer content
             */
-            this.changeFooterEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
             this.changeFooterEvent.signature = SIGNATURE;
         
             /**
             * CustomEvent fired when the content of the Module is modified
             * @event changeContentEvent
             */
-            this.changeContentEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
             this.changeContentEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is destroyed
             * @event destroyEvent
             */
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
             this.destroyEvent.signature = SIGNATURE;
-            
+
             /**
             * CustomEvent fired before the Module is shown
             * @event beforeShowEvent
             */
             this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
             this.beforeShowEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is shown
             * @event showEvent
             */
             this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
             this.showEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is hidden
             * @event beforeHideEvent
             */
             this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
             this.beforeHideEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is hidden
             * @event hideEvent
@@ -1136,30 +1071,22 @@ version: 2.3.0
             this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
             this.hideEvent.signature = SIGNATURE;
         }, 
-        
+
         /**
         * String representing the current user-agent platform
         * @property platform
         * @type String
         */
         platform: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-        
+
             if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-        
                 return "windows";
-        
             } else if (ua.indexOf("macintosh") != -1) {
-        
                 return "mac";
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1169,40 +1096,24 @@ version: 2.3.0
         * @type String
         */
         browser: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-            
             /*
                  Check Opera first in case of spoof and check Safari before
                  Gecko since Safari's user agent string includes "like Gecko"
             */
-
             if (ua.indexOf('opera') != -1) { 
-            
                 return 'opera';
-            
             } else if (ua.indexOf('msie 7') != -1) {
-            
                 return 'ie7';
-            
             } else if (ua.indexOf('msie') != -1) {
-            
                 return 'ie';
-            
             } else if (ua.indexOf('safari') != -1) { 
-            
                 return 'safari';
-            
             } else if (ua.indexOf('gecko') != -1) {
-            
                 return 'gecko';
-            
             } else {
-            
                 return false;
-            
             }
-        
         }(),
         
         /**
@@ -1212,17 +1123,11 @@ version: 2.3.0
         * @type Boolean
         */
         isSecure: function () {
-        
             if (window.location.href.toLowerCase().indexOf("https") === 0) {
-        
                 return true;
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1230,9 +1135,7 @@ version: 2.3.0
         * automatically at appropriate times by the Module class.
         */
         initDefaultConfig: function () {
-    
             // Add properties //
-        
             /**
             * Specifies whether the Module is visible on the page.
             * @config visible
@@ -1244,7 +1147,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.VISIBLE.value, 
                 validator: DEFAULT_CONFIG.VISIBLE.validator
             });
-            
+
             /**
             * Object or array of objects representing the ContainerEffect 
             * classes that are active for animating the container.
@@ -1256,7 +1159,7 @@ version: 2.3.0
                 suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.EFFECT.supercedes
             });
-            
+
             /**
             * Specifies whether to create a special proxy iframe to monitor 
             * for user font resizing in the document
@@ -1268,9 +1171,26 @@ version: 2.3.0
                 handler: this.configMonitorResize,
                 value: DEFAULT_CONFIG.MONITOR_RESIZE.value
             });
-            
+
+            /**
+            * Specifies if the module should be rendered as the first child 
+            * of document.body or appended as the last child when render is called
+            * with document.body as the "appendToNode".
+            * <p>
+            * Appending to the body while the DOM is still being constructed can 
+            * lead to Operation Aborted errors in IE hence this flag is set to 
+            * false by default.
+            * </p>
+            * 
+            * @config appendtodocumentbody
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, {
+                value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value
+            });
         },
-        
+
         /**
         * The Module class's initialization method, which is executed for
         * Module and all of its subclasses. This method is automatically 
@@ -1285,13 +1205,12 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-        
-            var elId, i, child;
-        
+
+            var elId, child;
+
             this.initEvents();
-        
             this.beforeInitEvent.fire(Module);
-        
+
             /**
             * The Module's Config object used for monitoring 
             * configuration properties.
@@ -1299,208 +1218,217 @@ version: 2.3.0
             * @type YAHOO.util.Config
             */
             this.cfg = new Config(this);
-        
+
             if (this.isSecure) {
                 this.imageRoot = Module.IMG_ROOT_SSL;
             }
-        
-            if (typeof el == "string") {
 
+            if (typeof el == "string") {
                 elId = el;
-        
                 el = document.getElementById(el);
-
                 if (! el) {
-
                     el = (createModuleTemplate()).cloneNode(false);
-
                     el.id = elId;
-
                 }
-
             }
-        
+
             this.element = el;
-        
+
             if (el.id) {
                 this.id = el.id;
             }
-        
+
             child = this.element.firstChild;
-            
-            if (child) {
 
+            if (child) {
+                var fndHd = false, fndBd = false, fndFt = false;
                 do {
-
-                    switch (child.className) {
-    
-                    case Module.CSS_HEADER:
-    
-                        this.header = child;
-    
-                        break;
-    
-                    case Module.CSS_BODY:
-    
-                        this.body = child;
-    
-                        break;
-    
-                    case Module.CSS_FOOTER:
-    
-                        this.footer = child;
-    
-                        break;
-    
+                    // We're looking for elements
+                    if (1 == child.nodeType) {
+                        if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) {
+                            this.header = child;
+                            fndHd = true;
+                        } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) {
+                            this.body = child;
+                            fndBd = true;
+                        } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){
+                            this.footer = child;
+                            fndFt = true;
+                        }
                     }
-                    
                 } while ((child = child.nextSibling));
-            
             }
 
-        
             this.initDefaultConfig();
-        
+
             Dom.addClass(this.element, Module.CSS_MODULE);
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
-        
+
             /*
                 Subscribe to the fireQueue() method of Config so that any 
                 queued configuration changes are excecuted upon render of 
                 the Module
             */ 
-            
-            if (!Config.alreadySubscribed(this.renderEvent, 
-                this.cfg.fireQueue, this.cfg)) {
 
+            if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
                 this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-
             }
-        
+
             this.initEvent.fire(Module);
         },
-        
+
         /**
-        * Initialized an empty IFRAME that is placed out of the visible area 
+        * Initialize an empty IFRAME that is placed out of the visible area 
         * that can be used to detect text resize.
         * @method initResizeMonitor
         */
         initResizeMonitor: function () {
-        
-            var oDoc, 
-                oIFrame, 
-                sHTML;
-        
-            function fireTextResize() {
-        
+
+            var isGeckoWin = (YAHOO.env.ua.gecko && this.platform == "windows");
+            if (isGeckoWin) {
+                // Help prevent spinning loading icon which 
+                // started with FireFox 2.0.0.8/Win
+                var self = this;
+                setTimeout(function(){self._initResizeMonitor();}, 0);
+            } else {
+                this._initResizeMonitor();
+            }
+        },
+
+        /**
+         * Create and initialize the text resize monitoring iframe.
+         * 
+         * @protected
+         * @method _initResizeMonitor
+         */
+        _initResizeMonitor : function() {
+
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+
+            function fireTextResize() {
                 Module.textResizeEvent.fire();
-        
             }
-        
+
             if (!YAHOO.env.ua.opera) {
-        
                 oIFrame = Dom.get("_yuiResizeMonitor");
-        
+
+                var supportsCWResize = this._supportsCWResize();
+
                 if (!oIFrame) {
-        
                     oIFrame = document.createElement("iframe");
-        
-                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
-                        YAHOO.env.ua.ie) {
-    
+
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && YAHOO.env.ua.ie) {
                         oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
-    
                     }
 
-
-                    /*
-                        Need to set "src" attribute of the iframe to 
-                        prevent the browser from reporting duplicate 
-                        cookies. (See SourceForge bug #1721755)
-                    */
-        
-                    if (YAHOO.env.ua.gecko) {
-
-                        sHTML = "<html><head><script " +
-                                "type=\"text/javascript\">" + 
-                                "window.onresize=function(){window.parent." +
-                                "YAHOO.widget.Module.textResizeEvent." +
-                                "fire();};window.parent.YAHOO.widget.Module." +
-                                "textResizeEvent.fire();</script></head>" + 
-                                "<body></body></html>";
-
-                        oIFrame.src = "data:text/html;charset=utf-8," + 
-                            encodeURIComponent(sHTML);
-
+                    if (!supportsCWResize) {
+                        // Can't monitor on contentWindow, so fire from inside iframe
+                        sHTML = ["<html><head><script ",
+                                 "type=\"text/javascript\">",
+                                 "window.onresize=function(){window.parent.",
+                                 "YAHOO.widget.Module.textResizeEvent.",
+                                 "fire();};<",
+                                 "\/script></head>",
+                                 "<body></body></html>"].join('');
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML);
                     }
 
                     oIFrame.id = "_yuiResizeMonitor";
-                    
                     /*
                         Need to set "position" property before inserting the 
                         iframe into the document or Safari's status bar will 
                         forever indicate the iframe is loading 
                         (See SourceForge bug #1723064)
                     */
-                    
                     oIFrame.style.position = "absolute";
                     oIFrame.style.visibility = "hidden";
-        
-                    document.body.appendChild(oIFrame);
-        
+
+                    var db = document.body,
+                        fc = db.firstChild;
+                    if (fc) {
+                        db.insertBefore(oIFrame, fc);
+                    } else {
+                        db.appendChild(oIFrame);
+                    }
+
                     oIFrame.style.width = "10em";
                     oIFrame.style.height = "10em";
                     oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
                     oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
                     oIFrame.style.borderWidth = "0";
                     oIFrame.style.visibility = "visible";
-        
+
+                    /*
+                       Don't open/close the document for Gecko like we used to, since it
+                       leads to duplicate cookies. (See SourceForge bug #1721755)
+                    */
                     if (YAHOO.env.ua.webkit) {
-        
                         oDoc = oIFrame.contentWindow.document;
-        
                         oDoc.open();
                         oDoc.close();
-        
                     }
-
                 }
-        
+
                 if (oIFrame && oIFrame.contentWindow) {
+                    Module.textResizeEvent.subscribe(this.onDomResize, this, true);
 
-                    Module.textResizeEvent.subscribe(this.onDomResize, 
-                        this, true);
-        
                     if (!Module.textResizeInitialized) {
-
-                        if (!Event.on(oIFrame.contentWindow, "resize", 
-                            fireTextResize)) {
-
-                            /*
-                                 This will fail in IE if document.domain has 
-                                 changed, so we must change the listener to 
-                                 use the oIFrame element instead
-                            */
-
-                            Event.on(oIFrame, "resize", fireTextResize);
-
+                        if (supportsCWResize) {
+                            if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) {
+                                /*
+                                     This will fail in IE if document.domain has 
+                                     changed, so we must change the listener to 
+                                     use the oIFrame element instead
+                                */
+                                Event.on(oIFrame, "resize", fireTextResize);
+                            }
                         }
-
                         Module.textResizeInitialized = true;
-
                     }
-
                     this.resizeMonitor = oIFrame;
+                }
+            }
+        },
 
+        /**
+         * Text resize monitor helper method.
+         * Determines if the browser supports resize events on iframe content windows.
+         * 
+         * @private
+         * @method _supportsCWResize
+         */
+        _supportsCWResize : function() {
+            /*
+                Gecko 1.8.0 (FF1.5), 1.8.1.0-5 (FF2) won't fire resize on contentWindow.
+                Gecko 1.8.1.6+ (FF2.0.0.6+) and all other browsers will fire resize on contentWindow.
+
+                We don't want to start sniffing for patch versions, so fire textResize the same
+                way on all FF, until 1.9 (3.x) is out
+             */
+            var bSupported = true;
+            if (YAHOO.env.ua.gecko && YAHOO.env.ua.gecko <= 1.8) {
+                bSupported = false;
+                /*
+                var v = navigator.userAgent.match(/rv:([^\s\)]*)/); // From YAHOO.env.ua
+                if (v && v[0]) {
+                    var sv = v[0].match(/\d\.\d\.(\d)/);
+                    if (sv && sv[1]) {
+                        if (parseInt(sv[1], 10) > 0) {
+                            bSupported = true;
+                        }
+                    }
                 }
-        
+                */
             }
-        
+            return bSupported;
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -1508,45 +1436,45 @@ version: 2.3.0
         * @param {Object} obj The scope object passed to the handler
         */
         onDomResize: function (e, obj) {
-        
+
             var nLeft = -1 * this.resizeMonitor.offsetWidth,
                 nTop = -1 * this.resizeMonitor.offsetHeight;
         
             this.resizeMonitor.style.top = nTop + "px";
             this.resizeMonitor.style.left =  nLeft + "px";
-        
+
         },
-        
+
         /**
-        * Sets the Module's header content to the HTML specified, or appends 
+        * Sets the Module's header content to the string specified, or appends 
         * the passed element to the header. If no header is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the header.
+        * 
         * @method setHeader
-        * @param {String} headerContent The HTML used to set the header 
+        * @param {String} headerContent The string used to set the header.
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the header innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} headerContent The HTMLElement to append to 
         * the header
         */
         setHeader: function (headerContent) {
-
             var oHeader = this.header || (this.header = createHeader());
-        
-            if (typeof headerContent == "string") {
-
-                oHeader.innerHTML = headerContent;
-
-            } else {
 
+            if (headerContent.tagName) {
                 oHeader.innerHTML = "";
                 oHeader.appendChild(headerContent);
-
+            } else {
+                oHeader.innerHTML = headerContent;
             }
-        
+
             this.changeHeaderEvent.fire(headerContent);
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Appends the passed element to the header. If no header is present, 
         * one will be automatically created.
@@ -1554,7 +1482,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the header
         */
         appendToHeader: function (element) {
-
             var oHeader = this.header || (this.header = createHeader());
         
             oHeader.appendChild(element);
@@ -1563,35 +1490,34 @@ version: 2.3.0
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Sets the Module's body content to the HTML specified, or appends the
         * passed element to the body. If no body is present, one will be 
-        * automatically created.
+        * automatically created. An empty string can be passed to the method
+        * to clear the contents of the body.
         * @method setBody
-        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {String} bodyContent The HTML used to set the body. 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the body innerHTML
+        * set to their default toString implementations.
+        * <em>OR</em>
         * @param {HTMLElement} bodyContent The HTMLElement to append to the body
         */
         setBody: function (bodyContent) {
-
             var oBody = this.body || (this.body = createBody());
-        
-            if (typeof bodyContent == "string") {
-
-                oBody.innerHTML = bodyContent;
-
-            } else {
 
+            if (bodyContent.tagName) {
                 oBody.innerHTML = "";
                 oBody.appendChild(bodyContent);
-
+            } else {
+                oBody.innerHTML = bodyContent;
             }
-        
+
             this.changeBodyEvent.fire(bodyContent);
             this.changeContentEvent.fire();
-
         },
-        
+
         /**
         * Appends the passed element to the body. If no body is present, one 
         * will be automatically created.
@@ -1599,7 +1525,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the body
         */
         appendToBody: function (element) {
-
             var oBody = this.body || (this.body = createBody());
         
             oBody.appendChild(element);
@@ -1612,9 +1537,13 @@ version: 2.3.0
         /**
         * Sets the Module's footer content to the HTML specified, or appends 
         * the passed element to the footer. If no footer is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the footer.
         * @method setFooter
         * @param {String} footerContent The HTML used to set the footer 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the footer innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} footerContent The HTMLElement to append to 
         * the footer
@@ -1622,18 +1551,14 @@ version: 2.3.0
         setFooter: function (footerContent) {
 
             var oFooter = this.footer || (this.footer = createFooter());
-        
-            if (typeof footerContent == "string") {
-
-                oFooter.innerHTML = footerContent;
-
-            } else {
 
+            if (footerContent.tagName) {
                 oFooter.innerHTML = "";
                 oFooter.appendChild(footerContent);
-
+            } else {
+                oFooter.innerHTML = footerContent;
             }
-        
+
             this.changeFooterEvent.fire(footerContent);
             this.changeContentEvent.fire();
 
@@ -1660,10 +1585,20 @@ version: 2.3.0
         * Renders the Module by inserting the elements that are not already 
         * in the main Module into their correct places. Optionally appends 
         * the Module to the specified node prior to the render's execution. 
-        * NOTE: For Modules without existing markup, the appendToNode argument 
+        * <p>
+        * For Modules without existing markup, the appendToNode argument 
         * is REQUIRED. If this argument is ommitted and the current element is 
         * not present in the document, the function will return false, 
         * indicating that the render was a failure.
+        * </p>
+        * <p>
+        * NOTE: As of 2.3.1, if the appendToNode is the document's body element
+        * then the module is rendered as the first child of the body element, 
+        * and not appended to it, to avoid Operation Aborted errors in IE when 
+        * rendering the module before window's load event is fired. You can 
+        * use the appendtodocumentbody configuration property to change this 
+        * to append to document.body if required.
+        * </p>
         * @method render
         * @param {String} appendToNode The element id to which the Module 
         * should be appended to prior to rendering <em>OR</em>
@@ -1674,118 +1609,75 @@ version: 2.3.0
         * @return {Boolean} Success or failure of the render
         */
         render: function (appendToNode, moduleElement) {
-        
+
             var me = this,
                 firstChild;
-        
-            function appendTo(element) {
-                if (typeof element == "string") {
-                    element = document.getElementById(element);
+
+            function appendTo(parentNode) {
+                if (typeof parentNode == "string") {
+                    parentNode = document.getElementById(parentNode);
                 }
-        
-                if (element) {
-                    element.appendChild(me.element);
+
+                if (parentNode) {
+                    me._addToParent(parentNode, me.element);
                     me.appendEvent.fire();
                 }
             }
-        
+
             this.beforeRenderEvent.fire();
-        
+
             if (! moduleElement) {
                 moduleElement = this.element;
             }
-        
-            if (appendToNode) {
 
+            if (appendToNode) {
                 appendTo(appendToNode);
-
             } else { 
-
-                /*
-                     No node was passed in. If the element is not already in 
-                     the Dom, this fails
-                */
-
+                // No node was passed in. If the element is not already in the Dom, this fails
                 if (! Dom.inDocument(this.element)) {
-
-
                     return false;
-
                 }
-
             }
-        
+
             // Need to get everything into the DOM if it isn't already
-        
             if (this.header && ! Dom.inDocument(this.header)) {
-
-                /*
-                    There is a header, but it's not in the DOM yet... 
-                    need to add it
-                */
-
+                // There is a header, but it's not in the DOM yet. Need to add it.
                 firstChild = moduleElement.firstChild;
-
-                if (firstChild) { // Insert before first child if exists
-
+                if (firstChild) {
                     moduleElement.insertBefore(this.header, firstChild);
-
-                } else { // Append to empty body because there are no children
-
+                } else {
                     moduleElement.appendChild(this.header);
-
                 }
-
             }
-        
-            if (this.body && ! Dom.inDocument(this.body)) {
-
-                /*
-                     There is a body, but it's not in the DOM yet... 
-                     need to add it
-                */
-
-
-                // Insert before footer if exists in DOM
-
-                if (this.footer && Dom.isAncestor(
-                    this.moduleElement, this.footer)) { 
 
+            if (this.body && ! Dom.inDocument(this.body)) {
+                // There is a body, but it's not in the DOM yet. Need to add it.               
+                if (this.footer && Dom.isAncestor(this.moduleElement, this.footer)) {
                     moduleElement.insertBefore(this.body, this.footer);
-
-                } else { // Append to element because there is no footer
-
+                } else {
                     moduleElement.appendChild(this.body);
-
                 }
-
             }
-        
-            if (this.footer && ! Dom.inDocument(this.footer)) {
-
-                /*
-                     There is a footer, but it's not in the DOM yet... 
-                     need to add it
-                */
 
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+                // There is a footer, but it's not in the DOM yet. Need to add it.
                 moduleElement.appendChild(this.footer);
-
             }
-        
+
             this.renderEvent.fire();
             return true;
         },
-        
+
         /**
         * Removes the Module element from the DOM and sets all child elements 
         * to null.
         * @method destroy
         */
         destroy: function () {
-        
+
             var parent,
                 e;
-        
+
             if (this.element) {
                 Event.purgeElement(this.element, true);
                 parent = this.element.parentNode;
@@ -1836,7 +1728,6 @@ version: 2.3.0
         },
         
         // BUILT-IN EVENT HANDLERS FOR MODULE //
-        
         /**
         * Default event handler for changing the visibility property of a 
         * Module. By default, this is achieved by switching the "display" style 
@@ -1872,23 +1763,40 @@ version: 2.3.0
         * @method configMonitorResize
         */
         configMonitorResize: function (type, args, obj) {
-
             var monitor = args[0];
-
             if (monitor) {
-
                 this.initResizeMonitor();
-
             } else {
-
-                Module.textResizeEvent.unsubscribe(
-                    this.onDomResize, this, true);
-
+                Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
                 this.resizeMonitor = null;
             }
+        },
 
+        /**
+         * This method is a protected helper, used when constructing the DOM structure for the module 
+         * to account for situations which may cause Operation Aborted errors in IE. It should not 
+         * be used for general DOM construction.
+         * <p>
+         * If the parentNode is not document.body, the element is appended as the last element.
+         * </p>
+         * <p>
+         * If the parentNode is document.body the element is added as the first child to help
+         * prevent Operation Aborted errors in IE.
+         * </p>
+         *
+         * @param {parentNode} The HTML element to which the element will be added
+         * @param {element} The HTML element to be added to parentNode's children
+         * @method _addToParent
+         * @protected
+         */
+        _addToParent: function(parentNode, element) {
+            if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) {
+                parentNode.insertBefore(element, parentNode.firstChild);
+            } else {
+                parentNode.appendChild(element);
+            }
         },
-        
+
         /**
         * Returns a String representation of the Object.
         * @method toString
@@ -1897,12 +1805,12 @@ version: 2.3.0
         toString: function () {
             return "Module " + this.id;
         }
-        
     };
-    
+
     YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -1914,7 +1822,7 @@ version: 2.3.0
     * properly rendered above SELECT elements.
     * @namespace YAHOO.widget
     * @class Overlay
-    * @extends Module
+    * @extends YAHOO.widget.Module
     * @param {String} el The element ID representing the Overlay <em>OR</em>
     * @param {HTMLElement} el The element representing the Overlay
     * @param {Object} userConfig The configuration object literal containing 
@@ -1923,12 +1831,9 @@ version: 2.3.0
     * @constructor
     */
     YAHOO.widget.Overlay = function (el, userConfig) {
-    
         YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
@@ -1936,7 +1841,7 @@ version: 2.3.0
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Overlay = YAHOO.widget.Overlay,
-        
+
         m_oIFrameTemplate,
 
         /**
@@ -1947,12 +1852,10 @@ version: 2.3.0
         * @type Object
         */
         EVENT_TYPES = {
-        
             "BEFORE_MOVE": "beforeMove",
             "MOVE": "move"
-        
         },
-        
+
         /**
         * Constant representing the Overlay's configuration properties
         * @property DEFAULT_CONFIG
@@ -1961,74 +1864,72 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "X": { 
                 key: "x", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "Y": { 
                 key: "y", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "XY": { 
                 key: "xy", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "CONTEXT": { 
                 key: "context", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "FIXED_CENTER": { 
                 key: "fixedcenter", 
                 value: false, 
                 validator: Lang.isBoolean, 
                 supercedes: ["iframe", "visible"] 
             },
-        
+
             "WIDTH": { 
                 key: "width", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
             }, 
-        
+
             "HEIGHT": { 
                 key: "height", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
-            }, 
-        
+            },
+
             "ZINDEX": { 
                 key: "zindex", 
                 value: null 
-            }, 
-        
+            },
+
             "CONSTRAIN_TO_VIEWPORT": { 
                 key: "constraintoviewport", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["iframe", "x", "y", "xy"] 
+                supercedes: ["iframe", "x", "y", "xy"]
             }, 
-        
+
             "IFRAME": { 
                 key: "iframe", 
                 value: (YAHOO.env.ua.ie == 6 ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["zindex"] 
             }
-        
         };
 
-
     /**
     * The URL that will be placed in the iframe
     * @property YAHOO.widget.Overlay.IFRAME_SRC
@@ -2040,7 +1941,7 @@ version: 2.3.0
 
     /**
     * Number representing how much the iframe shim should be offset from each 
-    * side of an Overlay instance.
+    * side of an Overlay instance, in pixels.
     * @property YAHOO.widget.Overlay.IFRAME_SRC
     * @default 3
     * @static
@@ -2048,7 +1949,18 @@ version: 2.3.0
     * @type Number
     */
     Overlay.IFRAME_OFFSET = 3;
-    
+
+    /**
+    * Number representing the minimum distance an Overlay instance should be 
+    * positioned relative to the boundaries of the browser's viewport, in pixels.
+    * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET
+    * @default 10
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.VIEWPORT_OFFSET = 10;
+
     /**
     * Constant representing the top left corner of an element, used for 
     * configuring the context element alignment
@@ -2058,7 +1970,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_LEFT = "tl";
-    
+
     /**
     * Constant representing the top right corner of an element, used for 
     * configuring the context element alignment
@@ -2068,7 +1980,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_RIGHT = "tr";
-    
+
     /**
     * Constant representing the top bottom left corner of an element, used for 
     * configuring the context element alignment
@@ -2078,7 +1990,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_LEFT = "bl";
-    
+
     /**
     * Constant representing the bottom right corner of an element, used for 
     * configuring the context element alignment
@@ -2088,7 +2000,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_RIGHT = "br";
-    
+
     /**
     * Constant representing the default CSS class used for an Overlay
     * @property YAHOO.widget.Overlay.CSS_OVERLAY
@@ -2097,22 +2009,21 @@ version: 2.3.0
     * @type String
     */
     Overlay.CSS_OVERLAY = "yui-overlay";
-    
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for 
     * window scroll
     * @event YAHOO.widget.Overlay.windowScrollEvent
     */
     Overlay.windowScrollEvent = new CustomEvent("windowScroll");
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for
     * window resize
     * @event YAHOO.widget.Overlay.windowResizeEvent
     */
     Overlay.windowResizeEvent = new CustomEvent("windowResize");
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window scroll
     * @method YAHOO.widget.Overlay.windowScrollHandler
@@ -2120,31 +2031,24 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM scroll event
     */
     Overlay.windowScrollHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
+
             if (! window.scrollEnd) {
-    
                 window.scrollEnd = -1;
-    
             }
-    
+
             clearTimeout(window.scrollEnd);
     
             window.scrollEnd = setTimeout(function () { 
-            
                 Overlay.windowScrollEvent.fire(); 
-    
             }, 1);
     
         } else {
-    
             Overlay.windowScrollEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window resize
     * @method YAHOO.widget.Overlay.windowResizeHandler
@@ -2152,29 +2056,22 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM resize event
     */
     Overlay.windowResizeHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
             if (! window.resizeEnd) {
                 window.resizeEnd = -1;
             }
-    
+
             clearTimeout(window.resizeEnd);
-    
+
             window.resizeEnd = setTimeout(function () {
-    
                 Overlay.windowResizeEvent.fire(); 
-    
             }, 100);
-    
         } else {
-    
             Overlay.windowResizeEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * A boolean that indicated whether the window resize and scroll events have 
     * already been subscribed to.
@@ -2183,18 +2080,16 @@ version: 2.3.0
     * @type Boolean
     */
     Overlay._initialized = null;
-    
+
     if (Overlay._initialized === null) {
-    
         Event.on(window, "scroll", Overlay.windowScrollHandler);
         Event.on(window, "resize", Overlay.windowResizeHandler);
     
         Overlay._initialized = true;
-    
     }
-    
+
     YAHOO.extend(Overlay, Module, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and  
         * all of its subclasses. This method is automatically called by the 
@@ -2215,39 +2110,35 @@ version: 2.3.0
             */
     
             Overlay.superclass.init.call(this, el/*, userConfig*/);  
-            
+
             this.beforeInitEvent.fire(Overlay);
             
             Dom.addClass(this.element, Overlay.CSS_OVERLAY);
             
             if (userConfig) {
-    
                 this.cfg.applyConfig(userConfig, true);
-    
             }
-            
+
             if (this.platform == "mac" && YAHOO.env.ua.gecko) {
-    
+
                 if (! Config.alreadySubscribed(this.showEvent,
                     this.showMacGeckoScrollbars, this)) {
-    
+
                     this.showEvent.subscribe(this.showMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
+
                 if (! Config.alreadySubscribed(this.hideEvent, 
                     this.hideMacGeckoScrollbars, this)) {
-    
+
                     this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
             }
-            
+
             this.initEvent.fire(Overlay);
-        
         },
         
         /**
@@ -2307,8 +2198,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.X.supercedes
     
             });
-        
-    
+
             /**
             * The absolute y-coordinate position of the Overlay
             * @config y
@@ -2316,14 +2206,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
-    
+
                 handler: this.configY, 
                 validator: DEFAULT_CONFIG.Y.validator, 
                 suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.Y.supercedes
-    
+
             });
-        
     
             /**
             * An array with the absolute x and y positions of the Overlay
@@ -2338,7 +2227,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.XY.supercedes
             
             });
-        
     
             /**
             * The array of context arguments for context-sensitive positioning.  
@@ -2357,8 +2245,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
             
             });
-        
-    
+
             /**
             * True if the Overlay should be anchored to the center of 
             * the viewport.
@@ -2374,7 +2261,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
             
             });
-        
     
             /**
             * CSS width of the Overlay.
@@ -2383,13 +2269,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
-            
+
                 handler: this.configWidth, 
                 suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.WIDTH.supercedes
-            
+
             });
-            
+
             /**
             * CSS height of the Overlay.
             * @config height
@@ -2397,7 +2283,7 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
-            
+
                 handler: this.configHeight, 
                 suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
@@ -2411,12 +2297,12 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
-    
+
                 handler: this.configzIndex,
                 value: DEFAULT_CONFIG.ZINDEX.value
-    
+
             });
-            
+
             /**
             * True if the Overlay should be prevented from being positioned 
             * out of the viewport.
@@ -2425,18 +2311,18 @@ version: 2.3.0
             * @default false
             */
             this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
-            
+
                 handler: this.configConstrainToViewport, 
                 value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
                 validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
                 supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
-            
+
             });
-            
+
             /**
             * @config iframe
             * @description Boolean indicating whether or not the Overlay should 
-            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * have an IFRAME shim; used to prevent SELECT elements from 
             * poking through an Overlay instance in IE6.  When set to "true", 
             * the iframe shim is created when the Overlay instance is intially
             * made visible.
@@ -2444,16 +2330,15 @@ version: 2.3.0
             * @default true for IE6 and below, false for all other browsers.
             */
             this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
-            
+
                 handler: this.configIframe, 
                 value: DEFAULT_CONFIG.IFRAME.value, 
                 validator: DEFAULT_CONFIG.IFRAME.validator, 
                 supercedes: DEFAULT_CONFIG.IFRAME.supercedes
-            
+
             });
-        
         },
-        
+
         /**
         * Moves the Overlay to the specified position. This function is  
         * identical to calling this.cfg.setProperty("xy", [x,y]);
@@ -2462,11 +2347,9 @@ version: 2.3.0
         * @param {Number} y The Overlay's new y position
         */
         moveTo: function (x, y) {
-    
             this.cfg.setProperty("xy", [x, y]);
-    
         },
-        
+
         /**
         * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
         * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2479,7 +2362,7 @@ version: 2.3.0
             Dom.addClass(this.element, "hide-scrollbars");
     
         },
-        
+
         /**
         * Adds a CSS class ("show-scrollbars") and removes a CSS class 
         * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2492,9 +2375,8 @@ version: 2.3.0
             Dom.addClass(this.element, "show-scrollbars");
     
         },
-        
+
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * The default event handler fired when the "visible" property is 
         * changed.  This method is responsible for firing showEvent
@@ -2507,7 +2389,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configVisible: function (type, args, obj) {
-    
+
             var visible = args[0],
                 currentVis = Dom.getStyle(this.element, "visibility"),
                 effect = this.cfg.getProperty("effect"),
@@ -2517,140 +2399,93 @@ version: 2.3.0
                 eff, ei, e, i, j, k, h,
                 nEffects,
                 nEffectInstances;
-    
-    
+
             if (currentVis == "inherit") {
-    
                 e = this.element.parentNode;
-    
+
                 while (e.nodeType != 9 && e.nodeType != 11) {
-    
                     currentVis = Dom.getStyle(e, "visibility");
-    
+
                     if (currentVis != "inherit") { 
-    
                         break; 
-    
                     }
-    
+
                     e = e.parentNode;
-    
                 }
-    
+
                 if (currentVis == "inherit") {
-    
                     currentVis = "visible";
-                
                 }
-    
             }
-        
-    
+
             if (effect) {
-    
                 if (effect instanceof Array) {
-
                     nEffects = effect.length;
-    
+
                     for (i = 0; i < nEffects; i++) {
-    
                         eff = effect[i];
-    
                         effectInstances[effectInstances.length] = 
                             eff.effect(this, eff.duration);
-    
+
                     }
-    
                 } else {
-    
                     effectInstances[effectInstances.length] = 
                         effect.effect(this, effect.duration);
-    
                 }
-    
             }
-    
-        
+
+
             if (visible) { // Show
-    
                 if (isMacGecko) {
-    
                     this.showMacGeckoScrollbars();
-    
                 }
-                
-    
+
                 if (effect) { // Animate in
-    
-    
                     if (visible) { // Animate in if not showing
-    
-    
                         if (currentVis != "visible" || currentVis === "") {
-    
                             this.beforeShowEvent.fire();
-
                             nEffectInstances = effectInstances.length;
-    
+
                             for (j = 0; j < nEffectInstances; j++) {
-    
                                 ei = effectInstances[j];
-    
                                 if (j === 0 && !alreadySubscribed(
                                         ei.animateInCompleteEvent, 
                                         this.showEvent.fire, this.showEvent)) {
-    
+
                                     /*
                                          Delegate showEvent until end 
                                          of animateInComplete
                                     */
-    
+
                                     ei.animateInCompleteEvent.subscribe(
                                      this.showEvent.fire, this.showEvent, true);
-    
                                 }
-    
                                 ei.animateIn();
-    
                             }
-    
                         }
-    
                     }
-    
                 } else { // Show
-    
                     if (currentVis != "visible" || currentVis === "") {
-    
                         this.beforeShowEvent.fire();
-    
+
                         Dom.setStyle(this.element, "visibility", "visible");
-    
+
                         this.cfg.refireEvent("iframe");
                         this.showEvent.fire();
-    
                     }
-        
                 }
-        
             } else { // Hide
-    
+
                 if (isMacGecko) {
-    
                     this.hideMacGeckoScrollbars();
-    
                 }
                     
                 if (effect) { // Animate out if showing
-    
                     if (currentVis == "visible") {
-    
                         this.beforeHideEvent.fire();
 
                         nEffectInstances = effectInstances.length;
-    
                         for (k = 0; k < nEffectInstances; k++) {
-    
                             h = effectInstances[k];
     
                             if (k === 0 && !alreadySubscribed(
@@ -2666,50 +2501,35 @@ version: 2.3.0
                                     this.hideEvent.fire, this.hideEvent, true);
     
                             }
-    
                             h.animateOut();
-    
                         }
-    
+
                     } else if (currentVis === "") {
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-    
                     }
-    
+
                 } else { // Simple hide
-    
+
                     if (currentVis == "visible" || currentVis === "") {
-    
                         this.beforeHideEvent.fire();
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-
                         this.hideEvent.fire();
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
+
         /**
         * Center event handler used for centering on scroll/resize, but only if 
         * the Overlay is visible
         * @method doCenterOnDOMEvent
         */
         doCenterOnDOMEvent: function () {
-    
             if (this.cfg.getProperty("visible")) {
-    
                 this.center();
-    
             }
-    
         },
-        
+
         /**
         * The default event handler fired when the "fixedcenter" property 
         * is changed.
@@ -2721,48 +2541,33 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configFixedCenter: function (type, args, obj) {
-    
+
             var val = args[0],
                 alreadySubscribed = Config.alreadySubscribed,
                 windowResizeEvent = Overlay.windowResizeEvent,
                 windowScrollEvent = Overlay.windowScrollEvent;
-            
+
             if (val) {
-    
                 this.center();
-            
-                if (!alreadySubscribed(this.beforeShowEvent, 
-                    this.center, this)) {
-    
+
+                if (!alreadySubscribed(this.beforeShowEvent, this.center, this)) {
                     this.beforeShowEvent.subscribe(this.center);
-    
                 }
-            
-                if (!alreadySubscribed(windowResizeEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-    
-                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) {
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-            
-                if (!alreadySubscribed(windowScrollEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-        
-                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) {
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-    
+
             } else {
-    
                 this.beforeShowEvent.unsubscribe(this.center);
-    
+
                 windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
                 windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-    
             }
-    
         },
         
         /**
@@ -2775,15 +2580,14 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configHeight: function (type, args, obj) {
-    
+
             var height = args[0],
                 el = this.element;
-    
+
             Dom.setStyle(el, "height", height);
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * The default event handler fired when the "width" property is changed.
         * @method configWidth
@@ -2794,13 +2598,12 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configWidth: function (type, args, obj) {
-    
+
             var width = args[0],
                 el = this.element;
     
             Dom.setStyle(el, "width", width);
             this.cfg.refireEvent("iframe");
-    
         },
         
         /**
@@ -2813,38 +2616,31 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
+
             var zIndex = args[0],
                 el = this.element;
-        
+
             if (! zIndex) {
-    
                 zIndex = Dom.getStyle(el, "zIndex");
-        
                 if (! zIndex || isNaN(zIndex)) {
-    
                     zIndex = 0;
-    
                 }
-    
             }
-            
-            if (this.iframe) {
-    
+
+            if (this.iframe || this.cfg.getProperty("iframe") === true) {
                 if (zIndex <= 0) {
-    
                     zIndex = 1;
-    
                 }
-    
-                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
             }
-            
+
             Dom.setStyle(el, "zIndex", zIndex);
             this.cfg.setProperty("zIndex", zIndex, true);
-    
+
+            if (this.iframe) {
+                this.stackIframe();
+            }
         },
-        
+
         /**
         * The default event handler fired when the "xy" property is changed.
         * @method configXY
@@ -2855,25 +2651,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configXY: function (type, args, obj) {
-    
+
             var pos = args[0],
                 x = pos[0],
                 y = pos[1];
-            
+
             this.cfg.setProperty("x", x);
             this.cfg.setProperty("y", y);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
-            
+
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "x" property is changed.
         * @method configX
@@ -2884,27 +2679,26 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configX: function (type, args, obj) {
-    
+
             var x = args[0],
                 y = this.cfg.getProperty("y");
-            
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
             
             Dom.setX(this.element, x, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-           
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "y" property is changed.
         * @method configY
@@ -2915,25 +2709,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configY: function (type, args, obj) {
-    
+
             var x = this.cfg.getProperty("x"),
                 y = args[0];
-        
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             Dom.setY(this.element, y, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
         
         /**
@@ -2946,33 +2739,23 @@ version: 2.3.0
                 oParentNode;
 
             if (oIFrame) {
-    
                 oParentNode = this.element.parentNode;
 
                 if (oParentNode != oIFrame.parentNode) {
-
-                    oParentNode.appendChild(oIFrame);
-                
+                    this._addToParent(oParentNode, oIFrame);
                 }
-
                 oIFrame.style.display = "block";
-    
             }
-    
         },
-        
+
         /**
         * Hides the iframe shim, if it has been enabled.
         * @method hideIframe
         */
         hideIframe: function () {
-    
             if (this.iframe) {
-    
                 this.iframe.style.display = "none";
-    
             }
-    
         },
 
         /**
@@ -2988,37 +2771,44 @@ version: 2.3.0
                 nDimensionOffset = (nOffset * 2),
                 aXY;
 
-
             if (oIFrame) {
-
                 // Size <iframe>
-
-                oIFrame.style.width = 
-                    (oElement.offsetWidth + nDimensionOffset + "px");
-
-                oIFrame.style.height = 
-                    (oElement.offsetHeight + nDimensionOffset + "px");
-
+                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
+                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");
 
                 // Position <iframe>
-
                 aXY = this.cfg.getProperty("xy");
 
                 if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
-
                     this.syncPosition();
-
                     aXY = this.cfg.getProperty("xy");
-
                 }
-
                 Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+            }
+        },
 
+        /**
+         * Sets the zindex of the iframe shim, if it exists, based on the zindex of
+         * the Overlay element. The zindex of the iframe is set to be one less 
+         * than the Overlay element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Overlay element
+         * to ensure that the iframe shim has a non-negative zindex.
+         * If you require the iframe zindex to be 0 or higher, the zindex of 
+         * the Overlay element should be set to a value greater than 0, before 
+         * this method is called.
+         * </p>
+         * @method stackIframe
+         */
+        stackIframe: function () {
+            if (this.iframe) {
+                var overlayZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) {
+                    Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1));
+                }
             }
-        
         },
 
-        
         /**
         * The default event handler fired when the "iframe" property is changed.
         * @method configIframe
@@ -3036,20 +2826,14 @@ version: 2.3.0
 
                 var oIFrame = this.iframe,
                     oElement = this.element,
-                    oParent,
-                    aXY;
-
+                    oParent;
 
                 if (!oIFrame) {
-
                     if (!m_oIFrameTemplate) {
-    
                         m_oIFrameTemplate = document.createElement("iframe");
 
                         if (this.isSecure) {
-        
                             m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
-        
                         }
 
                         /*
@@ -3057,25 +2841,19 @@ version: 2.3.0
                             doesn't modify the opacity of any transparent 
                             elements that may be on top of it (like a shadow).
                         */
-        
+
                         if (YAHOO.env.ua.ie) {
-        
                             m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
-        
                             /*
                                  Need to set the "frameBorder" property to 0 
                                  supress the default <iframe> border in IE.  
                                  Setting the CSS "border" property alone 
                                  doesn't supress it.
                             */
-        
                             m_oIFrameTemplate.frameBorder = 0;
-        
                         }
                         else {
-        
                             m_oIFrameTemplate.style.opacity = "0";
-                        
                         }
 
                         m_oIFrameTemplate.style.position = "absolute";
@@ -3083,109 +2861,91 @@ version: 2.3.0
                         m_oIFrameTemplate.style.margin = "0";
                         m_oIFrameTemplate.style.padding = "0";
                         m_oIFrameTemplate.style.display = "none";
-    
                     }
 
                     oIFrame = m_oIFrameTemplate.cloneNode(false);
-
                     oParent = oElement.parentNode;
 
-                    if (oParent) {
-
-                        oParent.appendChild(oIFrame);
-
-                    } else {
-
-                        document.body.appendChild(oIFrame);
+                    var parentNode = oParent || document.body;
 
-                    }
-                    
+                    this._addToParent(parentNode, oIFrame);
                     this.iframe = oIFrame;
-
                 }
 
-
                 /*
                      Show the <iframe> before positioning it since the "setXY" 
                      method of DOM requires the element be in the document 
                      and visible.
                 */
-
                 this.showIframe();
 
-
                 /*
                      Syncronize the size and position of the <iframe> to that 
                      of the Overlay.
                 */
-                
                 this.syncIframe();
-
+                this.stackIframe();
 
                 // Add event listeners to update the <iframe> when necessary
-
                 if (!this._hasIframeEventListeners) {
-
                     this.showEvent.subscribe(this.showIframe);
                     this.hideEvent.subscribe(this.hideIframe);
                     this.changeContentEvent.subscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = true;
-                    
                 }
-                
             }
 
-
             function onBeforeShow() {
-            
                 createIFrame.call(this);
-        
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                 this._iframeDeferred = false;
-            
             }
-            
 
             if (bIFrame) { // <iframe> shim is enabled
-                
-                if (this.cfg.getProperty("visible")) {
 
+                if (this.cfg.getProperty("visible")) {
                     createIFrame.call(this);
-                
-                }
-                else {
-
+                } else {
                     if (!this._iframeDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-
                         this._iframeDeferred = true;
-                    
                     }
-                
                 }
-    
+
             } else {    // <iframe> shim is disabled
-    
                 this.hideIframe();
 
                 if (this._hasIframeEventListeners) {
-
                     this.showEvent.unsubscribe(this.showIframe);
                     this.hideEvent.unsubscribe(this.hideIframe);
                     this.changeContentEvent.unsubscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = false;
-
                 }
-                
             }
-    
         },
-        
-        
+
+        /**
+         * Set's the container's XY value from DOM if not already set.
+         * 
+         * Differs from syncPosition, in that the XY value is only sync'd with DOM if 
+         * not already set. The method also refire's the XY config property event, so any
+         * beforeMove, Move event listeners are invoked.
+         * 
+         * @method _primeXYFromDOM
+         * @protected
+         */
+        _primeXYFromDOM : function() {
+            if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) {
+                // Set CFG XY based on DOM XY
+                this.syncPosition();
+                // Account for XY being set silently in syncPosition (no moveTo fired/called)
+                this.cfg.refireEvent("xy");
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
+            }
+        },
+
         /**
         * The default event handler fired when the "constraintoviewport" 
         * property is changed.
@@ -3198,28 +2958,22 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configConstrainToViewport: function (type, args, obj) {
-    
             var val = args[0];
-    
+
             if (val) {
-    
-                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
-                    this.enforceConstraints, this)) {
-    
-                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
-                        this, true);
-    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
+                }
+                if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) {
+                    this.beforeShowEvent.subscribe(this._primeXYFromDOM);
                 }
-    
             } else {
-    
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
                 this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
-    
             }
-    
         },
-        
-        /**
+
+         /**
         * The default event handler fired when the "context" property 
         * is changed.
         * @method configContext
@@ -3235,39 +2989,28 @@ version: 2.3.0
                 contextEl,
                 elementMagnetCorner,
                 contextMagnetCorner;
-            
+
             if (contextArgs) {
-            
                 contextEl = contextArgs[0];
                 elementMagnetCorner = contextArgs[1];
                 contextMagnetCorner = contextArgs[2];
                 
                 if (contextEl) {
-    
                     if (typeof contextEl == "string") {
-    
                         this.cfg.setProperty("context", 
                             [document.getElementById(contextEl), 
                                 elementMagnetCorner, contextMagnetCorner], 
                                 true);
-    
                     }
                     
                     if (elementMagnetCorner && contextMagnetCorner) {
-    
                         this.align(elementMagnetCorner, contextMagnetCorner);
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * Aligns the Overlay to its context element using the specified corner 
         * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
@@ -3279,45 +3022,34 @@ version: 2.3.0
         * that the elementAlign corner should stick to.
         */
         align: function (elementAlign, contextAlign) {
-    
+
             var contextArgs = this.cfg.getProperty("context"),
                 me = this,
                 context,
                 element,
                 contextRegion;
-    
-    
+
             function doAlign(v, h) {
     
                 switch (elementAlign) {
     
                 case Overlay.TOP_LEFT:
-    
                     me.moveTo(h, v);
-    
                     break;
     
                 case Overlay.TOP_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), v);
-    
                     break;
     
                 case Overlay.BOTTOM_LEFT:
-    
                     me.moveTo(h, (v - element.offsetHeight));
-    
                     break;
     
                 case Overlay.BOTTOM_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), 
                         (v - element.offsetHeight));
-    
                     break;
-    
                 }
-    
             }
     
     
@@ -3328,47 +3060,33 @@ version: 2.3.0
                 me = this;
                 
                 if (! elementAlign) {
-    
                     elementAlign = contextArgs[1];
-    
                 }
                 
                 if (! contextAlign) {
-    
                     contextAlign = contextArgs[2];
-    
                 }
                 
                 if (element && context) {
-    
                     contextRegion = Dom.getRegion(context);
-                    
+
                     switch (contextAlign) {
     
                     case Overlay.TOP_LEFT:
-    
                         doAlign(contextRegion.top, contextRegion.left);
-    
                         break;
     
                     case Overlay.TOP_RIGHT:
-    
                         doAlign(contextRegion.top, contextRegion.right);
-    
                         break;
     
                     case Overlay.BOTTOM_LEFT:
-    
                         doAlign(contextRegion.bottom, contextRegion.left);
-    
                         break;
     
                     case Overlay.BOTTOM_RIGHT:
-    
                         doAlign(contextRegion.bottom, contextRegion.right);
-    
                         break;
-    
                     }
     
                 }
@@ -3376,7 +3094,7 @@ version: 2.3.0
             }
             
         },
-        
+
         /**
         * The default event handler executed when the moveEvent is fired, if the 
         * "constraintoviewport" is set to true.
@@ -3388,70 +3106,96 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         enforceConstraints: function (type, args, obj) {
-    
-            var pos = args[0],
-                x = pos[0],
-                y = pos[1],
-                offsetHeight = this.element.offsetHeight,
-                offsetWidth = this.element.offsetWidth,
+            var pos = args[0];
+            var cXY = this.getConstrainedXY(pos[0], pos[1]);
+            this.cfg.setProperty("x", cXY[0], true);
+            this.cfg.setProperty("y", cXY[1], true);
+            this.cfg.setProperty("xy", cXY, true);
+        },
+
+        /**
+         * Given x, y coordinate values, returns the calculated coordinates required to 
+         * position the Overlay if it is to be constrained to the viewport, based on the 
+         * current element size, viewport dimensions and scroll values.
+         *
+         * @param {Number} x The X coordinate value to be constrained
+         * @param {Number} y The Y coordinate value to be constrained
+         * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively;
+         */
+        getConstrainedXY: function(x, y) {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 viewPortWidth = Dom.getViewportWidth(),
                 viewPortHeight = Dom.getViewportHeight(),
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
                 scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-                topConstraint = scrollY + 10,
-                leftConstraint = scrollX + 10,
-                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
-                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-        
-    
-            if (x < leftConstraint) {
-    
-                x = leftConstraint;
-    
-            } else if (x > rightConstraint) {
-    
-                x = rightConstraint;
-    
+                scrollY = Dom.getDocumentScrollTop();
+
+            var xNew = x;
+            var yNew = y;
+
+            if (offsetWidth + nViewportOffset < viewPortWidth) {
+
+                var leftConstraint = scrollX + nViewportOffset;
+                var rightConstraint = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+
+                if (x < leftConstraint) {
+                    xNew = leftConstraint;
+                } else if (x > rightConstraint) {
+                    xNew = rightConstraint;
+                }
+            } else {
+                xNew = nViewportOffset + scrollX;
             }
-            
-            if (y < topConstraint) {
-    
-                y = topConstraint;
-    
-            } else if (y > bottomConstraint) {
-    
-                y = bottomConstraint;
-    
+
+            if (offsetHeight + nViewportOffset < viewPortHeight) {
+
+                var topConstraint = scrollY + nViewportOffset;
+                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+
+                if (y < topConstraint) {
+                    yNew  = topConstraint;
+                } else if (y  > bottomConstraint) {
+                    yNew  = bottomConstraint;
+                }
+            } else {
+                yNew = nViewportOffset + scrollY;
             }
-            
-            this.cfg.setProperty("x", x, true);
-            this.cfg.setProperty("y", y, true);
-            this.cfg.setProperty("xy", [x, y], true);
-    
+
+            return [xNew, yNew];
         },
-        
+
         /**
         * Centers the container in the viewport.
         * @method center
         */
         center: function () {
-    
-            var scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-    
-                viewPortWidth = Dom.getClientWidth(),
-                viewPortHeight = Dom.getClientHeight(),
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 elementWidth = this.element.offsetWidth,
                 elementHeight = this.element.offsetHeight,
-                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
-                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-            
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                x,
+                y;
+
+            if (elementWidth < viewPortWidth) {
+                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
+            } else {
+                x = nViewportOffset + Dom.getDocumentScrollLeft();
+            }
+
+            if (elementHeight < viewPortHeight) {
+                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
+            } else {
+                y = nViewportOffset + Dom.getDocumentScrollTop();
+            }
+
             this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
-            
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * Synchronizes the Panel's "xy", "x", and "y" properties with the 
         * Panel's position in the DOM. This is primarily used to update  
@@ -3459,15 +3203,15 @@ version: 2.3.0
         * @method syncPosition
         */
         syncPosition: function () {
-    
+
             var pos = Dom.getXY(this.element);
-    
+
             this.cfg.setProperty("x", pos[0], true);
             this.cfg.setProperty("y", pos[1], true);
             this.cfg.setProperty("xy", pos, true);
-    
+
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -3475,11 +3219,11 @@ version: 2.3.0
         * @param {Object} obj The scope object
         */
         onDomResize: function (e, obj) {
-    
+
             var me = this;
-    
+
             Overlay.superclass.onDomResize.call(this, e, obj);
-    
+
             setTimeout(function () {
                 me.syncPosition();
                 me.cfg.refireEvent("iframe");
@@ -3493,96 +3237,82 @@ version: 2.3.0
         * YAHOO.widget.Overlay.
         * @method bringToTop
         */
-        bringToTop: function() {
-    
+        bringToTop: function () {
+
             var aOverlays = [],
                 oElement = this.element;
-    
+
             function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
-        
+
                 var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
-        
                     sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
-        
-                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
-                        0 : parseInt(sZIndex1, 10),
-        
-                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
-                        0 : parseInt(sZIndex2, 10);
-        
+
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
+
                 if (nZIndex1 > nZIndex2) {
-        
                     return -1;
-        
                 } else if (nZIndex1 < nZIndex2) {
-        
                     return 1;
-        
                 } else {
-        
                     return 0;
-        
                 }
-        
             }
-        
+
             function isOverlayElement(p_oElement) {
-        
+
                 var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                     Panel = YAHOO.widget.Panel;
-            
+
                 if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
-                
                     if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
-        
                         aOverlays[aOverlays.length] = p_oElement.parentNode;
-                    
-                    }
-                    else {
-        
+                    } else {
                         aOverlays[aOverlays.length] = p_oElement;
-        
                     }
-                
                 }
-            
             }
-            
+
             Dom.getElementsBy(isOverlayElement, "DIV", document.body);
-    
+
             aOverlays.sort(compareZIndexDesc);
-            
+
             var oTopOverlay = aOverlays[0],
                 nTopZIndex;
-            
+
             if (oTopOverlay) {
-    
                 nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
-    
-                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
-    
-                    this.cfg.setProperty("zindex", 
-                        (parseInt(nTopZIndex, 10) + 2));
-    
+
+                if (!isNaN(nTopZIndex)) {
+                    var bRequiresBump = false;
+
+                    if (oTopOverlay != oElement) {
+                        bRequiresBump = true;
+                    } else if (aOverlays.length > 1) {
+                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
+                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                            bRequiresBump = true;
+                        }
+                    }
+                    if (bRequiresBump) {
+                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                    }
                 }
-            
             }
-        
         },
-        
+
         /**
         * Removes the Overlay element from the DOM and sets all child 
         * elements to null.
         * @method destroy
         */
         destroy: function () {
-    
+
             if (this.iframe) {
-    
                 this.iframe.parentNode.removeChild(this.iframe);
-    
             }
-        
+
             this.iframe = null;
         
             Overlay.windowResizeEvent.unsubscribe(
@@ -3600,14 +3330,12 @@ version: 2.3.0
         * @return {String} The string representation of the Overlay.
         */
         toString: function () {
-    
             return "Overlay " + this.id;
-    
         }
-    
+
     });
-    
 }());
+
 (function () {
     
     /**
@@ -3623,19 +3351,15 @@ version: 2.3.0
     * configuration of the OverlayManager
     */
     YAHOO.widget.OverlayManager = function (userConfig) {
-    
         this.init(userConfig);
-    
     };
 
-
     var Overlay = YAHOO.widget.Overlay,
         Event = YAHOO.util.Event,
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         CustomEvent = YAHOO.util.CustomEvent,
         OverlayManager = YAHOO.widget.OverlayManager;
-
     
     /**
     * The CSS class representing a focused Overlay
@@ -3684,9 +3408,9 @@ version: 2.3.0
             * @default "mousedown"
             */
             this.cfg.addProperty("focusevent", { value: "mousedown" } );
-        
+
         },
-        
+
         /**
         * Initializes the OverlayManager
         * @method init
@@ -3704,14 +3428,14 @@ version: 2.3.0
             * @type Config
             */
             this.cfg = new Config(this);
-        
+
             this.initDefaultConfig();
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
             this.cfg.fireQueue();
-        
+
             /**
             * The currently activated Overlay
             * @property activeOverlay
@@ -3719,7 +3443,7 @@ version: 2.3.0
             * @type YAHOO.widget.Overlay
             */
             var activeOverlay = null;
-        
+
             /**
             * Returns the currently focused Overlay
             * @method getActive
@@ -3728,7 +3452,7 @@ version: 2.3.0
             this.getActive = function () {
                 return activeOverlay;
             };
-        
+
             /**
             * Focuses the specified Overlay
             * @method focus
@@ -3736,32 +3460,22 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to focus
             */
             this.focus = function (overlay) {
-        
                 var o = this.find(overlay);
-        
                 if (o) {
-        
                     if (activeOverlay != o) {
-        
                         if (activeOverlay) {
-        
                             activeOverlay.blur();
-        
                         }
-        
                         this.bringToTop(o);
-                        
+
                         activeOverlay = o;
-        
+
                         Dom.addClass(activeOverlay.element, 
                             OverlayManager.CSS_FOCUSED);
 
                         o.focusEvent.fire();
-                        
                     }
-        
                 }
-        
             };
         
             /**
@@ -3771,53 +3485,47 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to remove
             */
             this.remove = function (overlay) {
-    
-                var o = this.find(overlay),
-                    originalZ;
-        
+                var o = this.find(overlay), 
+                        originalZ;
                 if (o) {
-
                     if (activeOverlay == o) {
-                    
                         activeOverlay = null;
-                    
                     }
 
-                    originalZ = Dom.getStyle(o.element, "zIndex");
+                    var bDestroyed = (o.element === null && o.cfg === null) ? true : false;
 
-                    o.cfg.setProperty("zIndex", -1000, true);
+                    if (!bDestroyed) {
+                        // Set it's zindex so that it's sorted to the end.
+                        originalZ = Dom.getStyle(o.element, "zIndex");
+                        o.cfg.setProperty("zIndex", -1000, true);
+                    }
 
                     this.overlays.sort(this.compareZIndexDesc);
+                    this.overlays = this.overlays.slice(0, (this.overlays.length - 1));
 
-                    this.overlays = 
-                        this.overlays.slice(0, (this.overlays.length - 1));
-        
                     o.hideEvent.unsubscribe(o.blur);
                     o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
-        
-                    if (o.element) {
-        
+
+                    if (!bDestroyed) {
                         Event.removeListener(o.element, 
-                            this.cfg.getProperty("focusevent"), 
-                            this._onOverlayElementFocus);
-        
+                                    this.cfg.getProperty("focusevent"), 
+                                    this._onOverlayElementFocus);
+
+                        o.cfg.setProperty("zIndex", originalZ, true);
+                        o.cfg.setProperty("manager", null);
                     }
-        
-                    o.cfg.setProperty("zIndex", originalZ, true);
-                    o.cfg.setProperty("manager", null);
-        
+
                     o.focusEvent.unsubscribeAll();
                     o.blurEvent.unsubscribeAll();
-        
+
                     o.focusEvent = null;
                     o.blurEvent = null;
-        
+
                     o.focus = null;
                     o.blur = null;
                 }
-
             };
-        
+
             /**
             * Removes focus from all registered Overlays in the manager
             * @method blurAll
@@ -3828,28 +3536,19 @@ version: 2.3.0
                     i;
 
                 if (nOverlays > 0) {
-
                     i = nOverlays - 1;
-                    
-                    do {
 
-                        this.overlays[i].blur();                    
-                    
+                    do {
+                        this.overlays[i].blur();
                     }
                     while(i--);
-                
                 }
-    
             };
         
-        
             this._onOverlayBlur = function (p_sType, p_aArgs) {
-
                 activeOverlay = null;
-
             };
         
-        
             var overlays = this.cfg.getProperty("overlays");
         
             if (! this.overlays) {
@@ -3876,20 +3575,12 @@ version: 2.3.0
         
             var oTarget = Event.getTarget(p_oEvent),
                 oClose = this.close;
-        
-            
-            if (oClose && (oTarget == oClose || 
-                    Dom.isAncestor(oClose, oTarget))) {
             
+            if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) {
                 this.blur();
-            
-            }
-            else {
-            
+            } else {
                 this.focus();
-            
             }
-        
         },
         
         
@@ -3905,9 +3596,7 @@ version: 2.3.0
         * fired the event.
         */
         _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
-        
             this.remove(p_oOverlay);
-        
         },
         
         /**
@@ -3931,10 +3620,10 @@ version: 2.3.0
             if (overlay instanceof Overlay) {
 
                 overlay.cfg.addProperty("manager", { value: this } );
-        
+
                 overlay.focusEvent = overlay.createEvent("focus");
                 overlay.focusEvent.signature = CustomEvent.LIST;
-        
+
                 overlay.blurEvent = overlay.createEvent("blur");
                 overlay.blurEvent.signature = CustomEvent.LIST;
         
@@ -3943,43 +3632,29 @@ version: 2.3.0
                 };
         
                 overlay.blur = function () {
-    
                     if (mgr.getActive() == this) {
-
-                        Dom.removeClass(this.element, 
-                            OverlayManager.CSS_FOCUSED);
-
+                        Dom.removeClass(this.element, OverlayManager.CSS_FOCUSED);
                         this.blurEvent.fire();
-
                     }
-
                 };
         
                 overlay.blurEvent.subscribe(mgr._onOverlayBlur);
-        
                 overlay.hideEvent.subscribe(overlay.blur);
                 
-                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
-                    overlay, this);
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, overlay, this);
         
                 Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
-                    this._onOverlayElementFocus, null, overlay);
+                            this._onOverlayElementFocus, null, overlay);
         
                 zIndex = Dom.getStyle(overlay.element, "zIndex");
 
                 if (!isNaN(zIndex)) {
-
                     overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
-
                 } else {
-
                     overlay.cfg.setProperty("zIndex", 0);
-
                 }
-        
 
                 this.overlays.push(overlay);
-
                 this.bringToTop(overlay);
 
                 return true;
@@ -3990,26 +3665,17 @@ version: 2.3.0
                 nOverlays = overlay.length;
 
                 for (i = 0; i < nOverlays; i++) {
-
                     if (this.register(overlay[i])) {
-
                         regcount++;
-
                     }
                 }
 
                 if (regcount > 0) {
-
                     return true;
-
                 }
-
             } else {
-
                 return false;
-
             }
-
         },
 
         /**
@@ -4031,30 +3697,36 @@ version: 2.3.0
             if (oOverlay) {
 
                 aOverlays = this.overlays;
-
                 aOverlays.sort(this.compareZIndexDesc);
-                
+
                 oTopOverlay = aOverlays[0];
-                
-                if (oTopOverlay) {
 
+                if (oTopOverlay) {
                     nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
-    
-                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
-    
-                        oOverlay.cfg.setProperty("zIndex", 
-                            (parseInt(nTopZIndex, 10) + 2));
-    
+
+                    if (!isNaN(nTopZIndex)) {
+
+                        var bRequiresBump = false;
+
+                        if (oTopOverlay !== oOverlay) {
+                            bRequiresBump = true;
+                        } else if (aOverlays.length > 1) {
+                            var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex");
+                            // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                            if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                                bRequiresBump = true;
+                            }
+                        }
+
+                        if (bRequiresBump) {
+                            oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                        }
                     }
-    
                     aOverlays.sort(this.compareZIndexDesc);
-                
                 }
-
             }
-        
         },
-        
+
         /**
         * Attempts to locate an Overlay by instance or ID.
         * @method find
@@ -4064,47 +3736,32 @@ version: 2.3.0
         * cannot be located.
         */
         find: function (overlay) {
-        
+
             var aOverlays = this.overlays,
                 nOverlays = aOverlays.length,
                 i;
 
             if (nOverlays > 0) {
-
                 i = nOverlays - 1;
 
                 if (overlay instanceof Overlay) {
-
                     do {
-
                         if (aOverlays[i] == overlay) {
-
                             return aOverlays[i];
-
                         }
-                    
                     }
                     while(i--);
 
                 } else if (typeof overlay == "string") {
-
                     do {
-
                         if (aOverlays[i].id == overlay) {
-
                             return aOverlays[i];
-
                         }
-
                     }
                     while(i--);
-
                 }
-
                 return null;
-            
             }
-
         },
         
         /**
@@ -4115,11 +3772,17 @@ version: 2.3.0
         * fall in the stacking order.
         */
         compareZIndexDesc: function (o1, o2) {
-    
-            var zIndex1 = o1.cfg.getProperty("zIndex"),
-                zIndex2 = o2.cfg.getProperty("zIndex");
-        
-            if (zIndex1 > zIndex2) {
+
+            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
+                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.
+
+            if (zIndex1 === null && zIndex2 === null) {
+                return 0;
+            } else if (zIndex1 === null){
+                return 1;
+            } else if (zIndex2 === null) {
+                return -1;
+            } else if (zIndex1 > zIndex2) {
                 return -1;
             } else if (zIndex1 < zIndex2) {
                 return 1;
@@ -4139,20 +3802,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].show();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Hides all Overlays in the manager.
         * @method hideAll
@@ -4164,20 +3821,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].hide();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Returns a string representation of the object.
         * @method toString
@@ -4186,10 +3837,10 @@ version: 2.3.0
         toString: function () {
             return "OverlayManager";
         }
-    
     };
 
 }());
+
 (function () {
 
     /**
@@ -4207,19 +3858,17 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Tooltip = function (el, userConfig) {
-    
         YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
         Dom = YAHOO.util.Dom,
         Tooltip = YAHOO.widget.Tooltip,
-    
+
         m_oShadowTemplate,
-        
+
         /**
         * Constant representing the Tooltip's configuration properties
         * @property DEFAULT_CONFIG
@@ -4228,44 +3877,61 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "PREVENT_OVERLAP": { 
                 key: "preventoverlap", 
                 value: true, 
                 validator: Lang.isBoolean, 
                 supercedes: ["x", "y", "xy"] 
             },
-        
+
             "SHOW_DELAY": { 
                 key: "showdelay", 
                 value: 200, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "AUTO_DISMISS_DELAY": { 
                 key: "autodismissdelay", 
                 value: 5000, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "HIDE_DELAY": { 
                 key: "hidedelay", 
                 value: 250, 
                 validator: Lang.isNumber 
             }, 
-        
+
             "TEXT": { 
                 key: "text", 
                 suppressEvent: true 
             }, 
-        
+
             "CONTAINER": { 
                 key: "container"
+            },
+
+            "DISABLED": {
+                key: "disabled",
+                value: false,
+                suppressEvent: true
             }
-        
+        },
+
+        /**
+        * Constant representing the name of the Tooltip's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+            "CONTEXT_MOUSE_OVER": "contextMouseOver",
+            "CONTEXT_MOUSE_OUT": "contextMouseOut",
+            "CONTEXT_TRIGGER": "contextTrigger"
         };
 
-    
     /**
     * Constant representing the Tooltip CSS class
     * @property YAHOO.widget.Tooltip.CSS_TOOLTIP
@@ -4275,13 +3941,11 @@ version: 2.3.0
     */
     Tooltip.CSS_TOOLTIP = "yui-tt";
 
-
     /* 
         "hide" event handler that sets a Tooltip instance's "width"
         configuration property back to its original value before 
         "setWidthToOffsetWidth" was called.
     */
-    
     function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
 
         var sOriginalWidth = p_oObject[0],
@@ -4290,13 +3954,10 @@ version: 2.3.0
             sCurrentWidth = oConfig.getProperty("width");
 
         if (sCurrentWidth == sNewWidth) {
-            
             oConfig.setProperty("width", sOriginalWidth);
-        
         }
 
         this.unsubscribe("hide", this._onHide, p_oObject);
-    
     }
 
     /* 
@@ -4313,7 +3974,6 @@ version: 2.3.0
             sNewWidth,
             oClone;
 
-        
         if ((!sOriginalWidth || sOriginalWidth == "auto") && 
             (oConfig.getProperty("container") != oBody || 
             oConfig.getProperty("x") >= Dom.getViewportWidth() || 
@@ -4323,47 +3983,35 @@ version: 2.3.0
             oClone.style.visibility = "hidden";
             oClone.style.top = "0px";
             oClone.style.left = "0px";
-            
+
             oBody.appendChild(oClone);
 
             sNewWidth = (oClone.offsetWidth + "px");
-            
+
             oBody.removeChild(oClone);
-            
             oClone = null;
 
             oConfig.setProperty("width", sNewWidth);
-            
             oConfig.refireEvent("xy");
-            
-            this.subscribe("hide", restoreOriginalWidth, 
-                [(sOriginalWidth || ""), sNewWidth]);
-        
-        }
 
+            this.subscribe("hide", restoreOriginalWidth, [(sOriginalWidth || ""), sNewWidth]);
+        }
     }
 
-
     // "onDOMReady" that renders the ToolTip
 
     function onDOMReady(p_sType, p_aArgs, p_oObject) {
-    
         this.render(p_oObject);
-    
     }
 
-
     //  "init" event handler that automatically renders the Tooltip
 
     function onInit() {
-
         Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this);
-
     }
 
-    
     YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { 
-    
+
         /**
         * The Tooltip initialization method. This method is automatically 
         * called by the constructor. A Tooltip is automatically rendered by 
@@ -4377,33 +4025,94 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-    
-    
+
+
             Tooltip.superclass.init.call(this, el);
-    
+
             this.beforeInitEvent.fire(Tooltip);
-    
+
             Dom.addClass(this.element, Tooltip.CSS_TOOLTIP);
-    
-            if (userConfig) {
 
+            if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
-
             }
-    
+
             this.cfg.queueProperty("visible", false);
             this.cfg.queueProperty("constraintoviewport", true);
-    
+
             this.setBody("");
 
             this.subscribe("beforeShow", setWidthToOffsetWidth);
             this.subscribe("init", onInit);
             this.subscribe("render", this.onRender);
-    
+
             this.initEvent.fire(Tooltip);
+        },
+
+        /**
+        * Initializes the custom events for Tooltip
+        * @method initEvents
+        */
+        initEvents: function () {
+
+            Tooltip.superclass.initEvents.call(this);
+            var SIGNATURE = CustomEvent.LIST;
+
+            /**
+            * CustomEvent fired when user mouses over a context element. Returning false from
+            * a subscriber to this event will prevent the tooltip from being displayed for
+            * the current context element.
+            * 
+            * @event contextMouseOverEvent
+            * @param {HTMLElement} context The context element which the user just moused over
+            * @param {DOMEvent} e The DOM event object, associated with the mouse over
+            */
+            this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER);
+            this.contextMouseOverEvent.signature = SIGNATURE;
 
+            /**
+            * CustomEvent fired when the user mouses out of a context element.
+            * 
+            * @event contextMouseOutEvent
+            * @param {HTMLElement} context The context element which the user just moused out of
+            * @param {DOMEvent} e The DOM event object, associated with the mouse out
+            */
+            this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT);
+            this.contextMouseOutEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired just before the tooltip is displayed for the current context.
+            * <p>
+            *  You can subscribe to this event if you need to set up the text for the 
+            *  tooltip based on the context element for which it is about to be displayed.
+            * </p>
+            * <p>This event differs from the beforeShow event in following respects:</p>
+            * <ol>
+            *   <li>
+            *    When moving from one context element to another, if the tooltip is not
+            *    hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not
+            *    be fired when the tooltip is displayed for the new context since it is already visible.
+            *    However the contextTrigger event is always fired before displaying the tooltip for
+            *    a new context.
+            *   </li>
+            *   <li>
+            *    The trigger event provides access to the context element, allowing you to 
+            *    set the text of the tooltip based on context element for which the tooltip is
+            *    triggered.
+            *   </li>
+            * </ol>
+            * <p>
+            *  It is not possible to prevent the tooltip from being displayed
+            *  using this event. You can use the contextMouseOverEvent if you need to prevent
+            *  the tooltip from being displayed.
+            * </p>
+            * @event contextTriggerEvent
+            * @param {HTMLElement} context The context element for which the tooltip is triggered
+            */
+            this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER);
+            this.contextTriggerEvent.signature = SIGNATURE;
         },
-        
+
         /**
         * Initializes the class's configurable properties which can be 
         * changed using the Overlay's Config object (cfg).
@@ -4412,7 +4121,7 @@ version: 2.3.0
         initDefaultConfig: function () {
 
             Tooltip.superclass.initDefaultConfig.call(this);
-        
+
             /**
             * Specifies whether the Tooltip should be kept from overlapping 
             * its context element.
@@ -4425,7 +4134,7 @@ version: 2.3.0
                 validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
                 supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
             });
-        
+
             /**
             * The number of milliseconds to wait before showing a Tooltip 
             * on mouseover.
@@ -4438,7 +4147,7 @@ version: 2.3.0
                 value: 200, 
                 validator: DEFAULT_CONFIG.SHOW_DELAY.validator
             });
-        
+
             /**
             * The number of milliseconds to wait before automatically 
             * dismissing a Tooltip after the mouse has been resting on the 
@@ -4452,7 +4161,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
                 validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
             });
-        
+
             /**
             * The number of milliseconds to wait before hiding a Tooltip 
             * on mouseover.
@@ -4465,9 +4174,9 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.HIDE_DELAY.value, 
                 validator: DEFAULT_CONFIG.HIDE_DELAY.validator
             });
-        
+
             /**
-            * Specifies the Tooltip's text.
+            * Specifies the Tooltip's text. 
             * @config text
             * @type String
             * @default null
@@ -4488,7 +4197,23 @@ version: 2.3.0
                 handler: this.configContainer,
                 value: document.body
             });
-        
+
+            /**
+            * Specifies whether or not the tooltip is disabled. Disabled tooltips
+            * will not be displayed. If the tooltip is driven by the title attribute
+            * of the context element, the title attribute will still be removed for 
+            * disabled tooltips, to prevent default tooltip behavior.
+            * 
+            * @config disabled
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DISABLED.key, {
+                handler: this.configContainer,
+                value: DEFAULT_CONFIG.DISABLED.value,
+                supressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
+            });
+
             /**
             * Specifies the element or elements that the Tooltip should be 
             * anchored to on mouseover.
@@ -4547,16 +4272,11 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configContainer: function (type, args, obj) {
-
             var container = args[0];
 
             if (typeof container == 'string') {
-
-                this.cfg.setProperty("container", 
-                    document.getElementById(container), true);
-
+                this.cfg.setProperty("container", document.getElementById(container), true);
             }
-
         },
         
         /**
@@ -4571,36 +4291,20 @@ version: 2.3.0
                 nElements,
                 oElement,
                 i;
-        
-            
+
             if (aElements) {
-        
                 nElements = aElements.length;
-                
                 if (nElements > 0) {
-                
                     i = nElements - 1;
-                    
                     do {
-        
                         oElement = aElements[i];
-        
-                        Event.removeListener(oElement, "mouseover", 
-                            this.onContextMouseOver);
-
-                        Event.removeListener(oElement, "mousemove", 
-                            this.onContextMouseMove);
-
-                        Event.removeListener(oElement, "mouseout", 
-                            this.onContextMouseOut);
-                    
+                        Event.removeListener(oElement, "mouseover", this.onContextMouseOver);
+                        Event.removeListener(oElement, "mousemove", this.onContextMouseMove);
+                        Event.removeListener(oElement, "mouseout", this.onContextMouseOut);
                     }
                     while (i--);
-                
                 }
-        
             }
-        
         },
         
         /**
@@ -4620,72 +4324,47 @@ version: 2.3.0
                 nElements,
                 oElement,
                 i;
-            
-        
+
             if (context) {
-        
+
                 // Normalize parameter into an array
                 if (! (context instanceof Array)) {
-
                     if (typeof context == "string") {
-
-                        this.cfg.setProperty("context", 
-                            [document.getElementById(context)], true);
-
+                        this.cfg.setProperty("context", [document.getElementById(context)], true);
                     } else { // Assuming this is an element
-
                         this.cfg.setProperty("context", [context], true);
-
                     }
-
                     context = this.cfg.getProperty("context");
-
                 }
-        
-        
+
                 // Remove any existing mouseover/mouseout listeners
                 this._removeEventListeners();
-        
+
                 // Add mouseover/mouseout listeners to context elements
                 this._context = context;
-        
+
                 aElements = this._context;
-                
+
                 if (aElements) {
-            
                     nElements = aElements.length;
-                    
                     if (nElements > 0) {
-                    
                         i = nElements - 1;
-                        
                         do {
-            
                             oElement = aElements[i];
-            
-                            Event.on(oElement, "mouseover", 
-                                this.onContextMouseOver, this);
-
-                            Event.on(oElement, "mousemove", 
-                                this.onContextMouseMove, this);
-
-                            Event.on(oElement, "mouseout", 
-                                this.onContextMouseOut, this);
-                        
+                            Event.on(oElement, "mouseover", this.onContextMouseOver, this);
+                            Event.on(oElement, "mousemove", this.onContextMouseMove, this);
+                            Event.on(oElement, "mouseout", this.onContextMouseOut, this);
                         }
                         while (i--);
-                    
                     }
-            
                 }
-        
             }
         },
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
+
         // BEGIN BUILT-IN DOM EVENT HANDLERS //
-        
+
         /**
         * The default event handler fired when the user moves the mouse while 
         * over the context element.
@@ -4696,9 +4375,8 @@ version: 2.3.0
         onContextMouseMove: function (e, obj) {
             obj.pageX = Event.getPageX(e);
             obj.pageY = Event.getPageY(e);
-        
         },
-        
+
         /**
         * The default event handler fired when the user mouses over the 
         * context element.
@@ -4707,34 +4385,34 @@ version: 2.3.0
         * @param {Object} obj The object argument
         */
         onContextMouseOver: function (e, obj) {
-        
             var context = this;
-        
-            if (obj.hideProcId) {
-
-                clearTimeout(obj.hideProcId);
-
-
-                obj.hideProcId = null;
 
-            }
-        
-            Event.on(context, "mousemove", obj.onContextMouseMove, obj);
-        
             if (context.title) {
                 obj._tempTitle = context.title;
                 context.title = "";
             }
-        
-            /**
-            * The unique process ID associated with the thread responsible 
-            * for showing the Tooltip.
-            * @type int
-            */
-            obj.showProcId = obj.doShow(e, context);
 
+            // Fire first, to honor disabled set in the listner
+            if (obj.fireEvent("contextMouseOver", context, e) !== false 
+                    && !obj.cfg.getProperty("disabled")) {
+
+                // Stop the tooltip from being hidden (set on last mouseout)
+                if (obj.hideProcId) {
+                    clearTimeout(obj.hideProcId);
+                    obj.hideProcId = null;
+                }
+
+                Event.on(context, "mousemove", obj.onContextMouseMove, obj);
+
+                /**
+                * The unique process ID associated with the thread responsible 
+                * for showing the Tooltip.
+                * @type int
+                */
+                obj.showProcId = obj.doShow(e, context);
+            }
         },
-        
+
         /**
         * The default event handler fired when the user mouses out of 
         * the context element.
@@ -4744,32 +4422,31 @@ version: 2.3.0
         */
         onContextMouseOut: function (e, obj) {
             var el = this;
-        
+
             if (obj._tempTitle) {
                 el.title = obj._tempTitle;
                 obj._tempTitle = null;
             }
-        
+
             if (obj.showProcId) {
                 clearTimeout(obj.showProcId);
                 obj.showProcId = null;
             }
-        
+
             if (obj.hideProcId) {
                 clearTimeout(obj.hideProcId);
                 obj.hideProcId = null;
             }
-        
-        
+
+            obj.fireEvent("contextMouseOut", el, e);
+
             obj.hideProcId = setTimeout(function () {
                 obj.hide();
-    
             }, obj.cfg.getProperty("hidedelay"));
-    
         },
-        
+
         // END BUILT-IN DOM EVENT HANDLERS //
-        
+
         /**
         * Processes the showing of the Tooltip by setting the timeout delay 
         * and offset of the Tooltip.
@@ -4779,42 +4456,43 @@ version: 2.3.0
         * with doShow
         */
         doShow: function (e, context) {
-        
+
             var yOffset = 25,
                 me = this;
-        
+
             if (YAHOO.env.ua.opera && context.tagName && 
                 context.tagName.toUpperCase() == "A") {
-
                 yOffset += 12;
-
             }
-        
+
             return setTimeout(function () {
-        
-                if (me._tempTitle) {
+
+                var txt = me.cfg.getProperty("text");
+
+                // title does not over-ride text
+                if (me._tempTitle && (txt === "" || YAHOO.lang.isUndefined(txt) || YAHOO.lang.isNull(txt))) {
                     me.setBody(me._tempTitle);
                 } else {
                     me.cfg.refireEvent("text");
                 }
-        
+
                 me.moveTo(me.pageX, me.pageY + yOffset);
 
                 if (me.cfg.getProperty("preventoverlap")) {
                     me.preventOverlap(me.pageX, me.pageY);
                 }
-        
-                Event.removeListener(context, "mousemove", 
-                    me.onContextMouseMove);
-        
+
+                Event.removeListener(context, "mousemove", me.onContextMouseMove);
+
+                me.contextTriggerEvent.fire(context);
+
                 me.show();
-                me.hideProcId = me.doHide();
 
+                me.hideProcId = me.doHide();
 
             }, this.cfg.getProperty("showdelay"));
-        
         },
-        
+
         /**
         * Sets the timeout for the auto-dismiss delay, which by default is 5 
         * seconds, meaning that a tooltip will automatically dismiss itself 
@@ -4822,16 +4500,16 @@ version: 2.3.0
         * @method doHide
         */
         doHide: function () {
-        
+
             var me = this;
-        
-        
+
+
             return setTimeout(function () {
-        
+
                 me.hide();
-        
+
             }, this.cfg.getProperty("autodismissdelay"));
-        
+
         },
         
         /**
@@ -4875,29 +4553,21 @@ version: 2.3.0
                     oShadow = this._shadow;
             
                 if (oShadow) {
-            
                     oShadow.style.width = (oElement.offsetWidth + 6) + "px";
                     oShadow.style.height = (oElement.offsetHeight + 1) + "px"; 
-            
                 }
             
             }
 
-
             function addShadowVisibleClass() {
-            
                 Dom.addClass(this._shadow, "yui-tt-shadow-visible");
-            
             }
             
 
             function removeShadowVisibleClass() {
-        
                 Dom.removeClass(this._shadow, "yui-tt-shadow-visible");
-            
             }
-    
-    
+
             function createShadow() {
     
                 var oShadow = this._shadow,
@@ -4912,73 +4582,49 @@ version: 2.3.0
                     Module = YAHOO.widget.Module;
                     nIE = YAHOO.env.ua.ie;
                     me = this;
-    
+
                     if (!m_oShadowTemplate) {
-        
                         m_oShadowTemplate = document.createElement("div");
                         m_oShadowTemplate.className = "yui-tt-shadow";
-                    
                     }
-        
+
                     oShadow = m_oShadowTemplate.cloneNode(false);
-        
+
                     oElement.appendChild(oShadow);
-                    
+
                     this._shadow = oShadow;
-    
+
                     addShadowVisibleClass.call(this);
-        
+
                     this.subscribe("beforeShow", addShadowVisibleClass);
                     this.subscribe("beforeHide", removeShadowVisibleClass);
 
-                    if (nIE == 6 || 
-                        (nIE == 7 && document.compatMode == "BackCompat")) {
-                
+                    if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
                         window.setTimeout(function () { 
-        
                             sizeShadow.call(me); 
-        
                         }, 0);
     
                         this.cfg.subscribeToConfigEvent("width", sizeShadow);
                         this.cfg.subscribeToConfigEvent("height", sizeShadow);
                         this.subscribe("changeContent", sizeShadow);
-    
-                        Module.textResizeEvent.subscribe(sizeShadow, 
-                                                            this, true);
-                        
+
+                        Module.textResizeEvent.subscribe(sizeShadow, this, true);
                         this.subscribe("destroy", function () {
-                        
-                            Module.textResizeEvent.unsubscribe(sizeShadow, 
-                                                                    this);
-                        
+                            Module.textResizeEvent.unsubscribe(sizeShadow, this);
                         });
-                
                     }
-                
                 }
-    
             }
-    
-    
+
             function onBeforeShow() {
-            
                 createShadow.call(this);
-    
                 this.unsubscribe("beforeShow", onBeforeShow);
-            
             }
-    
-    
+
             if (this.cfg.getProperty("visible")) {
-    
                 createShadow.call(this);
-            
-            }
-            else {
-    
+            } else {
                 this.subscribe("beforeShow", onBeforeShow);
-            
             }
         
         },
@@ -4992,7 +4638,7 @@ version: 2.3.0
         
             // Remove any existing mouseover/mouseout listeners
             this._removeEventListeners();
-        
+
             Tooltip.superclass.destroy.call(this);  
         
         },
@@ -5009,6 +4655,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -5016,7 +4663,7 @@ version: 2.3.0
     * with a draggable header and an optional close icon at the top right.
     * @namespace YAHOO.widget
     * @class Panel
-    * @extends Overlay
+    * @extends YAHOO.widget.Overlay
     * @constructor
     * @param {String} el The element ID representing the Panel <em>OR</em>
     * @param {HTMLElement} el The element representing the Panel
@@ -5025,12 +4672,9 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Panel = function (el, userConfig) {
-    
         YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         DD = YAHOO.util.DD,
         Dom = YAHOO.util.Dom,
@@ -5058,7 +4702,7 @@ version: 2.3.0
             "DRAG": "drag"
         
         },
-        
+
         /**
         * Constant representing the Panel's configuration properties
         * @property DEFAULT_CONFIG
@@ -5067,43 +4711,48 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "CLOSE": { 
                 key: "close", 
                 value: true, 
                 validator: Lang.isBoolean, 
                 supercedes: ["visible"] 
             },
-            
+
             "DRAGGABLE": { 
                 key: "draggable", 
                 value: (DD ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["visible"]  
             },
-            
+
+            "DRAG_ONLY" : {
+                key: "dragonly",
+                value: false,
+                validator: Lang.isBoolean,
+                supercedes: ["draggable"]
+            },
+
             "UNDERLAY": { 
                 key: "underlay", 
                 value: "shadow", 
                 supercedes: ["visible"] 
             },
-            
+
             "MODAL": { 
                 key: "modal", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["visible"
+                supercedes: ["visible", "zindex"]
             },
-            
-            "KEY_LISTENERS": { 
-                key: "keylisteners", 
-                suppressEvent: true, 
-                supercedes: ["visible"] 
+
+            "KEY_LISTENERS": {
+                key: "keylisteners",
+                suppressEvent: true,
+                supercedes: ["visible"]
             }
-        
         };
 
-
     /**
     * Constant representing the default CSS class used for a Panel
     * @property YAHOO.widget.Panel.CSS_PANEL
@@ -5123,7 +4772,6 @@ version: 2.3.0
     */
     Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
 
-
     // Private CustomEvent listeners
 
     /* 
@@ -5133,16 +4781,11 @@ version: 2.3.0
     */
 
     function createHeader(p_sType, p_aArgs) {
-
-        if (!this.header) {
-
+        if (!this.header && this.cfg.getProperty("draggable")) {
             this.setHeader("&#160;");
-
         }
-
     }
 
-
     /* 
         "hide" event handler that sets a Panel instance's "width"
         configuration property back to its original value before 
@@ -5157,16 +4800,12 @@ version: 2.3.0
             sCurrentWidth = oConfig.getProperty("width");
 
         if (sCurrentWidth == sNewWidth) {
-            
             oConfig.setProperty("width", sOriginalWidth);
-        
         }
 
         this.unsubscribe("hide", restoreOriginalWidth, p_oObject);
-    
     }
 
-
     /* 
         "beforeShow" event handler that sets a Panel instance's "width"
         configuration property to the value of its root HTML 
@@ -5195,9 +4834,7 @@ version: 2.3.0
                     [(sOriginalWidth || ""), sNewWidth]);
             
             }
-        
         }
-
     }
 
     /* 
@@ -5207,9 +4844,7 @@ version: 2.3.0
     */
 
     function onElementFocus() {
-
         this.blur();
-
     }
 
     /* 
@@ -5282,9 +4917,8 @@ version: 2.3.0
 
     }
 
-    
     YAHOO.extend(Panel, Overlay, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and 
         * all of its subclasses. This method is automatically called by the 
@@ -5305,24 +4939,22 @@ version: 2.3.0
             */
 
             Panel.superclass.init.call(this, el/*, userConfig*/);  
-        
+
             this.beforeInitEvent.fire(Panel);
-        
+
             Dom.addClass(this.element, Panel.CSS_PANEL);
-        
+
             this.buildWrapper();
-        
-            if (userConfig) {
 
+            if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
-
             }
-        
+
             this.subscribe("showMask", addFocusEventHandlers);
             this.subscribe("hideMask", removeFocusEventHandlers);
+            this.subscribe("beforeRender", createHeader);
 
             this.initEvent.fire(Panel);
-            
         },
         
         /**
@@ -5408,7 +5040,34 @@ version: 2.3.0
                 validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
                 supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
             });
-        
+
+            /**
+            * Boolean specifying if the draggable Panel should be drag only, not interacting with drop 
+            * targets on the page.
+            * <p>
+            * When set to true, draggable Panels will not check to see if they are over drop targets,
+            * or fire the DragDrop events required to support drop target interaction (onDragEnter, 
+            * onDragOver, onDragOut, onDragDrop etc.).
+            * If the Panel is not designed to be dropped on any target elements on the page, then this 
+            * flag can be set to true to improve performance.
+            * </p>
+            * <p>
+            * When set to false, all drop target related events will be fired.
+            * </p>
+            * <p>
+            * The property is set to false by default to maintain backwards compatibility but should be 
+            * set to true if drop target interaction is not required for the Panel, to improve performance.</p>
+            * 
+            * @config dragOnly
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAG_ONLY.key, { 
+                value: DEFAULT_CONFIG.DRAG_ONLY.value, 
+                validator: DEFAULT_CONFIG.DRAG_ONLY.validator, 
+                supercedes: DEFAULT_CONFIG.DRAG_ONLY.supercedes 
+            });
+
             /**
             * Sets the type of underlay to display for the Panel. Valid values 
             * are "shadow," "matte," and "none".  <strong>PLEASE NOTE:</strong> 
@@ -5476,52 +5135,35 @@ version: 2.3.0
                 oClose = this.close;
         
             function doHide(e, obj) {
-
                 obj.hide();
-
             }
         
             if (val) {
-
                 if (!oClose) {
-
                     if (!m_oCloseIconTemplate) {
-
                         m_oCloseIconTemplate = document.createElement("span");
                         m_oCloseIconTemplate.innerHTML = "&#160;";
                         m_oCloseIconTemplate.className = "container-close";
-
                     }
 
                     oClose = m_oCloseIconTemplate.cloneNode(true);
-
                     this.innerElement.appendChild(oClose);
-
                     Event.on(oClose, "click", doHide, this);
                     
                     this.close = oClose;
-                    
 
                 } else {
-
                     oClose.style.display = "block";
-
                 }
 
             } else {
-
                 if (oClose) {
-
                     oClose.style.display = "none";
-
                 }
-
             }
 
         },
 
-
-
         /**
         * The default event handler fired when the "draggable" property 
         * is changed.
@@ -5533,53 +5175,35 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configDraggable: function (type, args, obj) {
-        
             var val = args[0];
 
             if (val) {
-        
                 if (!DD) {
-            
-        
                     this.cfg.setProperty("draggable", false);
-            
                     return;
-                
                 }
-        
-                if (this.header) {
 
+                if (this.header) {
                     Dom.setStyle(this.header, "cursor", "move");
-
                     this.registerDragDrop();
-
                 }
 
-                this.subscribe("beforeRender", createHeader);
                 this.subscribe("beforeShow", setWidthToOffsetWidth);
 
             } else {
 
                 if (this.dd) {
-
                     this.dd.unreg();
-
                 }
 
                 if (this.header) {
-
                     Dom.setStyle(this.header,"cursor","auto");
-
                 }
 
-                this.unsubscribe("beforeRender", createHeader);
                 this.unsubscribe("beforeShow", setWidthToOffsetWidth);
-
             }
-
         },
       
-
         /**
         * The default event handler fired when the "underlay" property 
         * is changed.
@@ -5591,159 +5215,118 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configUnderlay: function (type, args, obj) {
-    
+
             var UA = YAHOO.env.ua,
                 bMacGecko = (this.platform == "mac" && UA.gecko),
+                bIEQuirks = (UA.ie == 6 || (UA.ie == 7 && document.compatMode == "BackCompat")),
                 sUnderlay = args[0].toLowerCase(),
                 oUnderlay = this.underlay,
                 oElement = this.element;
+                
+            function fixWebkitUnderlay() {
+                // Webkit 419.3 (Safari 2.x) does not update
+                // it's Render Tree for the Container when content changes. 
+                // We need to force it to update using this contentChange 
+                // listener
 
+                // Webkit 523.6 doesn't have this problem and doesn't 
+                // need the fix
+                var u = this.underlay;
+                Dom.addClass(u, "yui-force-redraw");
+                window.setTimeout(function(){Dom.removeClass(u, "yui-force-redraw");}, 0);
+            }
 
             function createUnderlay() {
-
-                var nIE;
-
+                var bNew = false;
                 if (!oUnderlay) { // create if not already in DOM
 
                     if (!m_oUnderlayTemplate) {
-
                         m_oUnderlayTemplate = document.createElement("div");
                         m_oUnderlayTemplate.className = "underlay";
-                    
                     }
 
                     oUnderlay = m_oUnderlayTemplate.cloneNode(false);
                     this.element.appendChild(oUnderlay);
-                    
-                    this.underlay = oUnderlay;
 
-                    nIE = UA.ie;
+                    this.underlay = oUnderlay;
 
-                    if (nIE == 6 || 
-                        (nIE == 7 && document.compatMode == "BackCompat")) {
-                            
+                    if (bIEQuirks) {
                         this.sizeUnderlay();
-
-                        this.cfg.subscribeToConfigEvent("width", 
-                            this.sizeUnderlay);
-
-                        this.cfg.subscribeToConfigEvent("height", 
-                            this.sizeUnderlay);
-
+                        this.cfg.subscribeToConfigEvent("width", this.sizeUnderlay);
+                        this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);
                         this.changeContentEvent.subscribe(this.sizeUnderlay);
-
-                        YAHOO.widget.Module.textResizeEvent.subscribe(
-                            this.sizeUnderlay, this, true);
-                    
+                        YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay, this, true);
                     }
 
+                    if (UA.webkit && UA.webkit < 420) {
+                        this.changeContentEvent.subscribe(fixWebkitUnderlay);
+                    }
+                    bNew = true;
                 }
-
             }
 
-
             function onBeforeShow() {
-            
-                createUnderlay.call(this);
-    
+                var bNew = createUnderlay.call(this);
+                if (!bNew && bIEQuirks) {
+                    this.sizeUnderlay();
+                }
                 this._underlayDeferred = false;
-    
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-            
             }
 
-            
             function destroyUnderlay() {
-
                 if (this._underlayDeferred) {
-
                     this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                     this._underlayDeferred = false;
-
                 }
-            
+
                 if (oUnderlay) {
-            
-                    this.cfg.unsubscribeFromConfigEvent("width", 
-                        this.sizeUnderlay);
-    
-                    this.cfg.unsubscribeFromConfigEvent("height", 
-                        this.sizeUnderlay);
-    
+                    this.cfg.unsubscribeFromConfigEvent("width", this.sizeUnderlay);
+                    this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);
                     this.changeContentEvent.unsubscribe(this.sizeUnderlay);
-    
-                    YAHOO.widget.Module.textResizeEvent.unsubscribe(
-                        this.sizeUnderlay, this, true);
-    
+                    this.changeContentEvent.unsubscribe(fixWebkitUnderlay);
+                    YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay, this, true);
+
                     this.element.removeChild(oUnderlay);
-                    
-                    this.underlay = null;
 
+                    this.underlay = null;
                 }
-                    
             }
-        
 
             switch (sUnderlay) {
-    
-            case "shadow":
-
-                Dom.removeClass(oElement, "matte");
-                Dom.addClass(oElement, "shadow");
-
-                break;
-
-            case "matte":
-
-                if (!bMacGecko) {
-
-                    destroyUnderlay.call(this);
-
-                }
-            
-                Dom.removeClass(oElement, "shadow");
-                Dom.addClass(oElement, "matte");
-
-                break;
-
-            default:
-
-                if (!bMacGecko) {
-
-                    destroyUnderlay.call(this);
-
-                }
-            
-                Dom.removeClass(oElement, "shadow");
-                Dom.removeClass(oElement, "matte");
-
-                break;
-
+                case "shadow":
+                    Dom.removeClass(oElement, "matte");
+                    Dom.addClass(oElement, "shadow");
+                    break;
+                case "matte":
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
+                    }
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.addClass(oElement, "matte");
+                    break;
+                default:
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
+                    }
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.removeClass(oElement, "matte");
+                    break;
             }
 
-
             if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) {
-                
                 if (this.cfg.getProperty("visible")) {
-                
-                    createUnderlay.call(this);
-                
-                }
-                else {
-
+                    var bNew = createUnderlay.call(this);
+                    if (!bNew && bIEQuirks) {
+                        this.sizeUnderlay();
+                    }
+                } else {
                     if (!this._underlayDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-                    
                         this._underlayDeferred = true;
-
                     }
-                
                 }
-
             }
-    
         },
         
         /**
@@ -5760,9 +5343,7 @@ version: 2.3.0
         configModal: function (type, args, obj) {
 
             var modal = args[0];
-
             if (modal) {
-
                 if (!this._hasModalityEventListeners) {
 
                     this.subscribe("beforeShow", this.buildMask);
@@ -5774,18 +5355,13 @@ version: 2.3.0
                         this, true);
 
                     this._hasModalityEventListeners = true;
-
                 }
-
             } else {
-
                 if (this._hasModalityEventListeners) {
 
                     if (this.cfg.getProperty("visible")) {
-                    
                         this.hideMask();
                         this.removeMask();
-                    
                     }
 
                     this.unsubscribe("beforeShow", this.buildMask);
@@ -5796,11 +5372,8 @@ version: 2.3.0
                     Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
                     
                     this._hasModalityEventListeners = false;
-                
                 }
-
             }
-
         },
         
         /**
@@ -5813,25 +5386,19 @@ version: 2.3.0
                 oParentNode;
         
             if (oMask) {
-            
                 /*
                     Hide the mask before destroying it to ensure that DOM
                     event handlers on focusable elements get removed.
                 */
-        
                 this.hideMask();
-            
+                
                 oParentNode = oMask.parentNode;
-        
                 if (oParentNode) {
-        
                     oParentNode.removeChild(oMask);
-        
                 }
-        
+
                 this.mask = null;
             }
-            
         },
         
         /**
@@ -5955,35 +5522,25 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
             Panel.superclass.configzIndex.call(this, type, args, obj);
-        
-            var maskZ = 0,
-                currentZ = Dom.getStyle(this.element, "zIndex");
-        
-            if (this.mask) {
 
-                if (!currentZ || isNaN(currentZ)) {
-                    currentZ = 0;
+            if (this.mask || this.cfg.getProperty("modal") === true) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!panelZ || isNaN(panelZ)) {
+                    panelZ = 0;
                 }
-        
-                if (currentZ === 0) {
 
+                if (panelZ === 0) {
+                    // Recursive call to configzindex (which should be stopped
+                    // from going further because panelZ should no longer === 0)
                     this.cfg.setProperty("zIndex", 1);
-
                 } else {
-
-                    maskZ = currentZ - 1;
-                    Dom.setStyle(this.mask, "zIndex", maskZ);
-
+                    this.stackMask();
                 }
-        
             }
         },
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
-        
         /**
         * Builds the wrapping container around the Panel that is used for 
         * positioning the shadow and matte underlays. The container element is 
@@ -5992,44 +5549,39 @@ version: 2.3.0
         * @method buildWrapper
         */
         buildWrapper: function () {
-    
+
             var elementParent = this.element.parentNode,
                 originalElement = this.element,
                 wrapper = document.createElement("div");
-    
+
             wrapper.className = Panel.CSS_PANEL_CONTAINER;
             wrapper.id = originalElement.id + "_c";
-        
+
             if (elementParent) {
                 elementParent.insertBefore(wrapper, originalElement);
             }
-        
+
             wrapper.appendChild(originalElement);
-        
+
             this.element = wrapper;
             this.innerElement = originalElement;
-        
+
             Dom.setStyle(this.innerElement, "visibility", "inherit");
         },
-        
+
         /**
         * Adjusts the size of the shadow based on the size of the element.
         * @method sizeUnderlay
         */
         sizeUnderlay: function () {
-
             var oUnderlay = this.underlay,
                 oElement;
 
             if (oUnderlay) {
-
                 oElement = this.element;
-
                 oUnderlay.style.width = oElement.offsetWidth + "px";
                 oUnderlay.style.height = oElement.offsetHeight + "px";
-
             }
-
         },
 
         
@@ -6038,101 +5590,95 @@ version: 2.3.0
         * @method registerDragDrop
         */
         registerDragDrop: function () {
-    
+
             var me = this;
-    
+
             if (this.header) {
-        
+
                 if (!DD) {
-        
-        
                     return;
-                
                 }
-        
-                this.dd = new DD(this.element.id, this.id);
-        
+
+                var bDragOnly = (this.cfg.getProperty("dragonly") === true);
+                this.dd = new DD(this.element.id, this.id, {dragOnly: bDragOnly});
+
                 if (!this.header.id) {
                     this.header.id = this.id + "_h";
                 }
-        
-    
+
                 this.dd.startDrag = function () {
-        
+
                     var offsetHeight,
                         offsetWidth,
                         viewPortWidth,
                         viewPortHeight,
                         scrollX,
-                        scrollY,
-                        topConstraint,
-                        leftConstraint,
-                        bottomConstraint,
-                        rightConstraint;
-    
+                        scrollY;
+
                     if (YAHOO.env.ua.ie == 6) {
                         Dom.addClass(me.element,"drag");
                     }
-        
+
                     if (me.cfg.getProperty("constraintoviewport")) {
-    
+
+                        var nViewportOffset = Overlay.VIEWPORT_OFFSET;
+
                         offsetHeight = me.element.offsetHeight;
                         offsetWidth = me.element.offsetWidth;
-                        
+
                         viewPortWidth = Dom.getViewportWidth();
                         viewPortHeight = Dom.getViewportHeight();
-                        
+
                         scrollX = Dom.getDocumentScrollLeft();
                         scrollY = Dom.getDocumentScrollTop();
-                        
-                        topConstraint = scrollY + 10;
-                        leftConstraint = scrollX + 10;
 
-                        bottomConstraint = 
-                            scrollY + viewPortHeight - offsetHeight - 10;
+                        if (offsetHeight + nViewportOffset < viewPortHeight) {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+                        } else {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + nViewportOffset;
+                        }
+
+                        if (offsetWidth + nViewportOffset < viewPortWidth) {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+                        } else {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + nViewportOffset;
+                        }
 
-                        rightConstraint = 
-                            scrollX + viewPortWidth - offsetWidth - 10;
-        
-                        this.minX = leftConstraint;
-                        this.maxX = rightConstraint;
                         this.constrainX = true;
-        
-                        this.minY = topConstraint;
-                        this.maxY = bottomConstraint;
                         this.constrainY = true;
-    
                     } else {
-    
                         this.constrainX = false;
                         this.constrainY = false;
-    
                     }
-        
+
                     me.dragEvent.fire("startDrag", arguments);
                 };
-        
+
                 this.dd.onDrag = function () {
                     me.syncPosition();
                     me.cfg.refireEvent("iframe");
                     if (this.platform == "mac" && YAHOO.env.ua.gecko) {
                         this.showMacGeckoScrollbars();
                     }
-        
+
                     me.dragEvent.fire("onDrag", arguments);
                 };
-        
+
                 this.dd.endDrag = function () {
 
                     if (YAHOO.env.ua.ie == 6) {
                         Dom.removeClass(me.element,"drag");
                     }
-        
+
                     me.dragEvent.fire("endDrag", arguments);
                     me.moveEvent.fire(me.cfg.getProperty("xy"));
-                    
+
                 };
-        
+
                 this.dd.setHandleElId(this.header.id);
                 this.dd.addInvalidHandleType("INPUT");
                 this.dd.addInvalidHandleType("SELECT");
@@ -6146,30 +5692,29 @@ version: 2.3.0
         * @method buildMask
         */
         buildMask: function () {
-    
             var oMask = this.mask;
-    
             if (!oMask) {
-
                 if (!m_oMaskTemplate) {
-                
                     m_oMaskTemplate = document.createElement("div");
                     m_oMaskTemplate.className = "mask";
                     m_oMaskTemplate.innerHTML = "&#160;";
-                
                 }
-
                 oMask = m_oMaskTemplate.cloneNode(true);
                 oMask.id = this.id + "_mask";
 
                 document.body.insertBefore(oMask, document.body.firstChild);
-                
+
                 this.mask = oMask;
 
-            }
+                if (YAHOO.env.ua.gecko && this.platform == "mac") {
+                    Dom.addClass(this.mask, "block-scrollbars");
+                }
 
+                // Stack mask based on the element zindex
+                this.stackMask();
+            }
         },
-        
+
         /**
         * Hides the modality mask.
         * @method hideMask
@@ -6181,7 +5726,7 @@ version: 2.3.0
                 Dom.removeClass(document.body, "masked");
             }
         },
-        
+
         /**
         * Shows the modality mask.
         * @method showMask
@@ -6194,24 +5739,40 @@ version: 2.3.0
                 this.showMaskEvent.fire();
             }
         },
-        
+
         /**
         * Sets the size of the modality mask to cover the entire scrollable 
         * area of the document
         * @method sizeMask
         */
         sizeMask: function () {
-
             if (this.mask) {
-
                 this.mask.style.height = Dom.getDocumentHeight() + "px";
                 this.mask.style.width = Dom.getDocumentWidth() + "px";
-
             }
+        },
 
+        /**
+         * Sets the zindex of the mask, if it exists, based on the zindex of 
+         * the Panel element. The zindex of the mask is set to be one less 
+         * than the Panel element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Panel
+         * to ensure that the mask has a non-negative zindex. If you require the
+         * mask zindex to be 0 or higher, the zindex of the Panel 
+         * should be set to a value higher than 0, before this method is called.
+         * </p>
+         * @method stackMask
+         */
+        stackMask: function() {
+            if (this.mask) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(panelZ) && !isNaN(panelZ)) {
+                    Dom.setStyle(this.mask, "zIndex", panelZ - 1);
+                }
+            }
         },
 
-        
         /**
         * Renders the Panel by inserting the elements that are not already in 
         * the main Panel into their correct places. Optionally appends the 
@@ -6267,15 +5828,26 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
+    * <p>
     * Dialog is an implementation of Panel that can be used to submit form 
-    * data. Built-in functionality for buttons with event handlers is included, 
-    * and button sets can be build dynamically, or the preincluded ones for 
-    * Submit/Cancel and OK/Cancel can be utilized. Forms can be processed in 3
-    * ways -- via an asynchronous Connection utility call, a simple form 
-    * POST or GET, or manually.
+    * data.
+    * </p>
+    * <p>
+    * Built-in functionality for buttons with event handlers is included. 
+    * If the optional YUI Button dependancy is included on the page, the buttons
+    * created will be instances of YAHOO.widget.Button, otherwise regular HTML buttons
+    * will be created.
+    * </p>
+    * <p>
+    * Forms can be processed in 3 ways -- via an asynchronous Connection utility call, 
+    * a simple form POST or GET, or manually. The YUI Connection utility should be
+    * included if you're using the default "async" postmethod, but is not required if
+    * you're using any of the other postmethod values.
+    * </p>
     * @namespace YAHOO.widget
     * @class Dialog
     * @extends YAHOO.widget.Panel
@@ -6287,12 +5859,9 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Dialog = function (el, userConfig) {
-    
         YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Dom = YAHOO.util.Dom,
@@ -6318,7 +5887,7 @@ version: 2.3.0
             "CANCEL": "cancel"
         
         },
-        
+
         /**
         * Constant representing the Dialog's configuration properties
         * @property DEFAULT_CONFIG
@@ -6327,19 +5896,22 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "POST_METHOD": { 
                 key: "postmethod", 
                 value: "async" 
             },
-            
+
             "BUTTONS": { 
                 key: "buttons", 
                 value: "none" 
-            }
-        
-        };    
+            },
 
+            "HIDEAFTERSUBMIT" : {
+                key: "hideaftersubmit",
+                value: true
+            }
+        };
 
     /**
     * Constant representing the default CSS class used for a Dialog
@@ -6350,7 +5922,6 @@ version: 2.3.0
     */
     Dialog.CSS_DIALOG = "yui-dialog";
 
-
     function removeButtonEventHandlers() {
 
         var aButtons = this._aButtons,
@@ -6359,42 +5930,28 @@ version: 2.3.0
             i;
 
         if (Lang.isArray(aButtons)) {
-
             nButtons = aButtons.length;
 
             if (nButtons > 0) {
-
                 i = nButtons - 1;
-
                 do {
-
                     oButton = aButtons[i];
-                    
-                    if (oButton instanceof YAHOO.widget.Button) {
-                        
+
+                    if (YAHOO.widget.Button && oButton instanceof YAHOO.widget.Button) {
                         oButton.destroy();
-                        
                     }
                     else if (oButton.tagName.toUpperCase() == "BUTTON") {
-
                         Event.purgeElement(oButton);
                         Event.purgeElement(oButton, false);
-
                     }
-
                 }
                 while (i--);
-            
             }
-        
         }
-
     }
     
-    
     YAHOO.extend(Dialog, YAHOO.widget.Panel, { 
 
-        
         /**
         * @property form
         * @description Object reference to the Dialog's 
@@ -6412,23 +5969,28 @@ version: 2.3.0
         */
         initDefaultConfig: function () {
             Dialog.superclass.initDefaultConfig.call(this);
-        
+
             /**
             * The internally maintained callback object for use with the 
-            * Connection utility
+            * Connection utility. The format of the callback object is 
+            * similar to Connection Manager's callback object and is 
+            * simply passed through to Connection Manager when the async 
+            * request is made.
             * @property callback
             * @type Object
             */
             this.callback = {
-    
+
                 /**
                 * The function to execute upon success of the 
-                * Connection submission
+                * Connection submission (when the form does not
+                * contain a file input element).
+                * 
                 * @property callback.success
                 * @type Function
                 */
                 success: null,
-    
+
                 /**
                 * The function to execute upon failure of the 
                 * Connection submission
@@ -6436,7 +5998,27 @@ version: 2.3.0
                 * @type Function
                 */
                 failure: null,
-    
+
+                /**
+                 *<p>
+                * The function to execute upon success of the 
+                * Connection submission, when the form contains
+                * a file input element.
+                * </p>
+                * <p>
+                * <em>NOTE:</em> Connection manager will not
+                * invoke the success or failure handlers for the file
+                * upload use case. This will be the only callback
+                * handler invoked.
+                * </p>
+                * <p>
+                * For more information, see the <a href="http://developer.yahoo.com/yui/connection/#file">
+                * Connection Manager documenation on file uploads</a>.
+                * </p>
+                * @property callback.upload
+                * @type Function
+                */
+
                 /**
                 * The arbitraty argument or arguments to pass to the Connection 
                 * callback functions
@@ -6444,12 +6026,10 @@ version: 2.3.0
                 * @type Object
                 */
                 argument: null
-    
+
             };
-        
 
             // Add form dialog config properties //
-            
             /**
             * The method to use for posting the Dialog's form. Possible values 
             * are "async", "form", and "manual".
@@ -6469,15 +6049,28 @@ version: 2.3.0
                     }
                 }
             });
-            
+
+            /**
+            * This property is used to configure whether or not the 
+            * dialog should be automatically hidden after submit.
+            * 
+            * @config hideaftersubmit
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HIDEAFTERSUBMIT.key, {
+                value: DEFAULT_CONFIG.HIDEAFTERSUBMIT.value
+            }); 
+
             /**
             * Array of object literals, each containing a set of properties 
             * defining a button to be appended into the Dialog's footer.
+            * 
             * Each button object in the buttons array can have three properties:
             * <dt>text:</dt>
-            * <dd>The text that will display on the face of the button.  <em>
-            * Please note:</em> As of version 2.3, the text can include 
-            * HTML.</dd>
+            * <dd>The text that will display on the face of the button. The text can 
+            * include HTML, as long as it is compliant with HTML Button specifications.
+            * </dd>
             * <dt>handler:</dt>
             * <dd>Can be either:
             *     <ol>
@@ -6485,18 +6078,23 @@ version: 2.3.0
             * button is clicked.  (In this case scope of this function is 
             * always its Dialog instance.)</li>
             *         <li>An object literal representing the code to be 
-            * executed when the button is clicked.  Format:<br> <code> {<br>  
+            * executed when the button is clicked.  Format:<br> <code> {<br>
             * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
-            * when  the event fires.<br> <strong>obj:</strong> Object, 
+            * when  the event fires.<br> <strong>obj:</strong> Object,
             * &#47;&#47; An  object to pass back to the handler.<br> <strong>
             * scope:</strong>  Object &#47;&#47; The object to use for the 
-            * scope of the handler. <br> } </code> <br><em>Please note: this 
-            * functionality was added in version 2.3.</em></li>
+            * scope of the handler. <br> } </code> <br></li>
             *     </ol>
             * </dd>
             * <dt>isDefault:</dt>
             * <dd>An optional boolean value that specifies that a button 
             * should be highlighted and focused by default.</dd>
+            * 
+            * <em>NOTE:</em>If the YUI Button Widget is included on the page, 
+            * the buttons created will be instances of YAHOO.widget.Button. 
+            * Otherwise, HTML Buttons (<code>&#60;BUTTON&#62;</code>) will be 
+            * created.
+            * 
             * @config buttons
             * @type {Array|String}
             * @default "none"
@@ -6505,9 +6103,9 @@ version: 2.3.0
                 handler: this.configButtons,
                 value: DEFAULT_CONFIG.BUTTONS.value
             }); 
-            
+
         },
-        
+
         /**
         * Initializes the custom events for Dialog which are fired 
         * automatically at appropriate times by the Dialog class.
@@ -6515,9 +6113,9 @@ version: 2.3.0
         */
         initEvents: function () {
             Dialog.superclass.initEvents.call(this);
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to submission
             * @event beforeSubmitEvent
@@ -6627,7 +6225,6 @@ version: 2.3.0
                 i,
                 sMethod;
 
-
             switch (this.cfg.getProperty("postmethod")) {
     
             case "async":
@@ -6636,36 +6233,24 @@ version: 2.3.0
                 nElements = aElements.length;
 
                 if (nElements > 0) {
-                
                     i = nElements - 1;
-                
                     do {
-                    
                         if (aElements[i].type == "file") {
-                        
                             bUseFileUpload = true;
                             break;
-                        
                         }
-                    
                     }
                     while(i--);
-                
                 }
 
                 if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) {
-
                     bUseSecureFileUpload = true;
-                
                 }
 
-                sMethod = 
-                    (oForm.getAttribute("method") || "POST").toUpperCase();
+                sMethod = (oForm.getAttribute("method") || "POST").toUpperCase();
 
                 Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload);
-
-                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), 
-                    this.callback);
+                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), this.callback);
 
                 this.asyncSubmitEvent.fire();
 
@@ -6704,94 +6289,59 @@ version: 2.3.0
 
 
             if (this.form) {
-
                 if (this.form == form && 
                     Dom.isAncestor(this.element, this.form)) {
     
                     return;
-    
-                }
-                else {
-
+                } else {
                     Event.purgeElement(this.form);
-                    
                     this.form = null;                
-                
                 }
-            
             }
-        
 
             if (!form) {
-
                 form = document.createElement("form");
                 form.name = "frm_" + this.id;
 
                 this.body.appendChild(form);
-
             }
 
-
             if (form) {
-
                 this.form = form;
 
                 Event.on(form, "submit", function (e) {
-
                     Event.stopEvent(e);
-
                     this.submit();
                     this.form.blur();
-        
-                });
-
+                }, this, true);
 
                 this.firstFormElement = function () {
-        
                     var f, el, nElements = form.elements.length;
-        
+
                     for (f = 0; f < nElements; f++) {
-    
                         el = form.elements[f];
-    
                         if (el.focus && !el.disabled && el.type != "hidden") {
-    
                             return el;
-    
                         }
-    
                     }
-    
                     return null;
-                    
                 }();
             
                 this.lastFormElement = function () {
-        
                     var f, el, nElements = form.elements.length;
-        
+                    
                     for (f = nElements - 1; f >= 0; f--) {
-    
                         el = form.elements[f];
-    
                         if (el.focus && !el.disabled && el.type != "hidden") {
-    
                             return el;
-    
                         }
-    
                     }
-    
                     return null;
-    
                 }();
             
                 if (this.cfg.getProperty("modal")) {
-            
                     firstElement = this.firstFormElement || this.firstButton;
-        
                     if (firstElement) {
-    
                         this.preventBackTab = new KeyListener(firstElement, 
                             { shift: true, keys: 9 }, 
                             { fn: me.focusLast, scope: me, 
@@ -6807,7 +6357,6 @@ version: 2.3.0
                     lastElement = this.lastButton || this.lastFormElement;
     
                     if (lastElement) {
-    
                         this.preventTabOut = new KeyListener(lastElement, 
                             { shift: false, keys: 9 }, 
                             { fn: me.focusFirst, scope: me, 
@@ -6818,12 +6367,9 @@ version: 2.3.0
     
                         this.hideEvent.subscribe(this.preventTabOut.disable, 
                             this.preventTabOut, true);
-    
                     }
                 }
-            
             }
-
         },
         
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
@@ -7017,14 +6563,12 @@ version: 2.3.0
 
             this.cfg.refireEvent("iframe");
             this.cfg.refireEvent("underlay");
-
         },
 
-
         /**
         * @method getButtons
         * @description Returns an array containing each of the Dialog's 
-        * buttons, by default an array of HTML <code>&#60;BUTTON&#60;</code> 
+        * buttons, by default an array of HTML <code>&#60;BUTTON&#62;</code> 
         * elements.  If the Dialog's buttons were created using the 
         * YAHOO.widget.Button class (via the inclusion of the optional Button 
         * dependancy on the page), an array of YAHOO.widget.Button instances 
@@ -7032,17 +6576,11 @@ version: 2.3.0
         * @return {Array}
         */
         getButtons: function () {
-        
             var aButtons = this._aButtons;
-            
             if (aButtons) {
-            
                 return aButtons;
-            
             }
-        
         },
-
         
         /**
         * Sets focus to the first element in the Dialog's form or the first 
@@ -7056,41 +6594,27 @@ version: 2.3.0
                 oEvent;
 
             if (args) {
-
                 oEvent = args[1];
-
                 if (oEvent) {
-
                     Event.stopEvent(oEvent);
-
                 }
-
             }
-        
 
             if (oElement) {
-
                 /*
                     Place the call to the "focus" method inside a try/catch
                     block to prevent IE from throwing JavaScript errors if
                     the element is disabled or hidden.
                 */
-
                 try {
-
                     oElement.focus();
-
                 }
                 catch(oException) {
-
                 }
 
             } else {
-
                 this.focusDefaultButton();
-
             }
-
         },
         
         /**
@@ -7105,25 +6629,16 @@ version: 2.3.0
                 oEvent;
     
             if (args) {
-
                 oEvent = args[1];
-
                 if (oEvent) {
-
                     Event.stopEvent(oEvent);
-
                 }
-
             }
             
             if (aButtons && Lang.isArray(aButtons)) {
-
                 this.focusLastButton();
-
             } else {
-
                 if (oElement) {
-
                     /*
                         Place the call to the "focus" method inside a try/catch
                         block to prevent IE from throwing JavaScript errors if
@@ -7131,18 +6646,11 @@ version: 2.3.0
                     */
     
                     try {
-    
                         oElement.focus();
-    
-                    }
-                    catch(oException) {
-    
+                    } catch(oException) {
                     }
-
                 }
-
             }
-
         },
         
         /**
@@ -7162,14 +6670,9 @@ version: 2.3.0
                     block to prevent IE from throwing JavaScript errors if
                     the element is disabled or hidden.
                 */
-
                 try {
-
                     oElement.focus();
-                
-                }
-                catch(oException) {
-                
+                } catch(oException) {
                 }
 
             }
@@ -7197,7 +6700,6 @@ version: 2.3.0
                     i = (nButtons - 1);
                     
                     do {
-                    
                         oButton = aButtons[i];
                         
                         if (oButton) {
@@ -7205,35 +6707,22 @@ version: 2.3.0
                             oElement = oButton.htmlButton;
 
                             if (oElement) {
-
                                 /*
                                     Place the call to the "blur" method inside  
                                     a try/catch block to prevent IE from  
                                     throwing JavaScript errors if the element 
                                     is disabled or hidden.
                                 */
-    
                                 try {
-            
                                     oElement.blur();
-                                
-                                }
-                                catch(oException) {
-                                
-                                
+                                } catch(oException) {
                                 }
-                            
                             }
-
                         }
                     
-                    }
-                    while(i--);
-                
+                    } while(i--);
                 }
-            
             }
-
         },
         
         /**
@@ -7265,19 +6754,12 @@ version: 2.3.0
                         */
     
                         try {
-    
                             oElement.focus();
-                        
                         }
                         catch(oException) {
-                        
-                        
                         }
-                    
                     }
-
                 }
-
             }
         },
         
@@ -7298,15 +6780,11 @@ version: 2.3.0
                 nButtons = aButtons.length;
                 
                 if (nButtons > 0) {
-
                     oButton = aButtons[(nButtons - 1)];
                     
                     if (oButton) {
-                    
                         oElement = oButton.htmlButton;
-
                         if (oElement) {
-
                             /*
                                 Place the call to the "focus" method inside a 
                                 try/catch block to prevent IE from throwing 
@@ -7315,23 +6793,13 @@ version: 2.3.0
                             */
         
                             try {
-        
                                 oElement.focus();
-                            
+                            } catch(oException) {
                             }
-                            catch(oException) {
-                            
-                            
-                            }
-                        
                         }
-                    
                     }
-                
                 }
-            
             }
-
         },
         
         /**
@@ -7345,11 +6813,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configPostMethod: function (type, args, obj) {
-    
-            var postmethod = args[0];
-        
             this.registerForm();
-    
         },
         
         // END BUILT-IN PROPERTY EVENT HANDLERS //
@@ -7366,8 +6830,12 @@ version: 2.3.0
         },
         
         /**
-        * Executes a submit of the Dialog followed by a hide, if validation 
-        * is successful.
+        * Executes a submit of the Dialog if validation 
+        * is successful. By default the Dialog is hidden
+        * after submission, but you can set the "hideaftersubmit"
+        * configuration property to false, to prevent the Dialog
+        * from being hidden.
+        * 
         * @method submit
         */
         submit: function () {
@@ -7375,13 +6843,17 @@ version: 2.3.0
                 this.beforeSubmitEvent.fire();
                 this.doSubmit();
                 this.submitEvent.fire();
-                this.hide();
+
+                if (this.cfg.getProperty("hideaftersubmit")) {
+                    this.hide();
+                }
+
                 return true;
             } else {
                 return false;
             }
         },
-        
+
         /**
         * Executes the cancel of the Dialog followed by a hide.
         * @method cancel
@@ -7598,15 +7070,12 @@ version: 2.3.0
                 oForm = aForms[0];
 
                 if (oForm) {
-                   
                     Event.purgeElement(oForm);
-            
-                    this.body.removeChild(oForm);
-                    
+                    if (oForm.parentNode) {
+                        oForm.parentNode.removeChild(oForm);
+                    }
                     this.form = null;
-            
                 }
-            
             }
         
             Dialog.superclass.destroy.call(this);  
@@ -7625,6 +7094,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -7943,6 +7413,7 @@ version: 2.3.0
     });
 
 }());
+
 (function () {
 
     /**
@@ -8028,67 +7499,69 @@ version: 2.3.0
     * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
     */
     ContainerEffect.FADE = function (overlay, dur) {
-    
-        var fade = new ContainerEffect(overlay, 
-        
-            { attributes: { opacity: { from: 0, to: 1 } }, 
-                duration: dur, 
-                method: Easing.easeIn }, 
-            
-            { attributes: { opacity: { to: 0 } },
-                duration: dur, 
-                method: Easing.easeOut }, 
-            
-            overlay.element);
-        
-    
+
+        var fin = {
+            attributes: {opacity:{from:0, to:1}},
+            duration: dur,
+            method: Easing.easeIn
+        };
+
+        var fout = {
+            attributes: {opacity:{to:0}},
+            duration: dur,
+            method: Easing.easeOut
+        };
+
+        var fade = new ContainerEffect(overlay, fin, fout, overlay.element);
+
+        fade.handleUnderlayStart = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                var hasFilters = (underlay.filters && underlay.filters.length > 0);
+                if(hasFilters) {
+                    Dom.addClass(overlay.element, "yui-effect-fade");
+                }
+            }
+        };
+
+        fade.handleUnderlayComplete = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                Dom.removeClass(overlay.element, "yui-effect-fade");
+            }
+        };
+
         fade.handleStartAnimateIn = function (type,args,obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (! obj.overlay.underlay) {
+
+            if (!obj.overlay.underlay) {
                 obj.overlay.cfg.refireEvent("underlay");
             }
-        
-            if (obj.overlay.underlay) {
-    
-                obj.initialUnderlayOpacity = 
-                    Dom.getStyle(obj.overlay.underlay, "opacity");
-    
-                obj.overlay.underlay.style.filter = null;
-    
-            }
-        
+
+            obj.handleUnderlayStart();
+
             Dom.setStyle(obj.overlay.element, "visibility", "visible");
             Dom.setStyle(obj.overlay.element, "opacity", 0);
         };
-        
-    
+
         fade.handleCompleteAnimateIn = function (type,args,obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
-        
+
             if (obj.overlay.element.style.filter) {
                 obj.overlay.element.style.filter = null;
             }
-        
-            if (obj.overlay.underlay) {
-                Dom.setStyle(obj.overlay.underlay, "opacity", 
-                    obj.initialUnderlayOpacity);
-            }
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
             obj.animateInCompleteEvent.fire();
         };
-        
-    
+
         fade.handleStartAnimateOut = function (type, args, obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (obj.overlay.underlay) {
-                obj.overlay.underlay.style.filter = null;
-            }
+            obj.handleUnderlayStart();
         };
-        
-    
+
         fade.handleCompleteAnimateOut =  function (type, args, obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
             if (obj.overlay.element.style.filter) {
@@ -8096,12 +7569,13 @@ version: 2.3.0
             }
             Dom.setStyle(obj.overlay.element, "visibility", "hidden");
             Dom.setStyle(obj.overlay.element, "opacity", 1);
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
-        
             obj.animateOutCompleteEvent.fire();
         };
-        
+
         fade.init();
         return fade;
     };
@@ -8173,11 +7647,9 @@ version: 2.3.0
     
             var vw = Dom.getViewportWidth(),
                 pos = Dom.getXY(obj.overlay.element),
-                yso = pos[1],
-                currentTo = obj.animOut.attributes.points.to;
+                yso = pos[1];
     
             obj.animOut.attributes.points.to = [(vw + 25), yso];
-    
         };
         
         slide.handleTweenAnimateOut = function (type, args, obj) {
@@ -8333,4 +7805,5 @@ version: 2.3.0
     YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
 
 })();
-YAHOO.register("container", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
+
+YAHOO.register("container", YAHOO.widget.Module, {version: "2.5.0", build: "895"});
index efb6676b52ef8e4854bce2384c0a0aae82cc71a8..42404cb5f242da33c13a67ea0b0476085c7c7c5d 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,26 +18,20 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-            YAHOO.log("No owner specified for Config object", "error"); 
-    
         }
-    
+
+        if (!owner) {  YAHOO.log("No owner specified for Config object", "error", "Config"); }
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -157,7 +151,7 @@ version: 2.3.0
         * @param {value} Object The value of the correct type for the property
         */ 
         fireEvent: function ( key, value ) {
-            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config");
             var property = this.config[key];
         
             if (property && property.event) {
@@ -174,7 +168,7 @@ version: 2.3.0
         */
         addProperty: function ( key, propertyObject ) {
             key = key.toLowerCase();
-            YAHOO.log("Added property: " + key, "info");
+            YAHOO.log("Added property: " + key, "info", "Config");
         
             this.config[key] = propertyObject;
         
@@ -279,7 +273,7 @@ version: 2.3.0
             var property;
         
             key = key.toLowerCase();
-            YAHOO.log("setProperty: " + key + "=" + value, "info");
+            YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
         
             if (this.queueInProgress && ! silent) {
                 // Currently running through a queue... 
@@ -318,7 +312,7 @@ version: 2.3.0
         queueProperty: function (key, value) {
         
             key = key.toLowerCase();
-            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+            YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
         
             var property = this.config[key],
                 foundDuplicate = false,
@@ -358,7 +352,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -386,38 +380,38 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-        
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config");
+
                 return true;
             } else {
                 return false;
@@ -466,37 +460,23 @@ version: 2.3.0
         applyConfig: function (userConfig, init) {
         
             var sKey,
-                oValue,
                 oConfig;
 
             if (init) {
-
                 oConfig = {};
-
                 for (sKey in userConfig) {
-                
                     if (Lang.hasOwnProperty(userConfig, sKey)) {
-
                         oConfig[sKey.toLowerCase()] = userConfig[sKey];
-
                     }
-                
                 }
-
                 this.initialConfig = oConfig;
-
             }
 
             for (sKey in userConfig) {
-            
                 if (Lang.hasOwnProperty(userConfig, sKey)) {
-            
                     this.queueProperty(sKey, userConfig[sKey]);
-                
                 }
-
             }
-
         },
         
         /**
@@ -563,19 +543,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -695,31 +668,24 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -752,27 +718,20 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Module = function (el, userConfig) {
-    
         if (el) {
-    
             this.init(el, userConfig);
-    
         } else {
-    
             YAHOO.log("No element or element ID specified" + 
                 " for Module instantiation", "error");
-    
         }
-    
     };
 
-
     var Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
-        
+
         m_oModuleTemplate,
         m_oHeaderTemplate,
         m_oBodyTemplate,
@@ -824,14 +783,17 @@ version: 2.3.0
                 suppressEvent: true, 
                 supercedes: ["visible"] 
             },
-        
+
             "MONITOR_RESIZE": { 
                 key: "monitorresize", 
                 value: true  
+            },
+
+            "APPEND_TO_DOCUMENT_BODY": { 
+                key: "appendtodocumentbody", 
+                value: false
             }
-        
         };
-
     
     /**
     * Constant representing the prefix path to use for non-secure images
@@ -905,11 +867,9 @@ version: 2.3.0
     */
     Module.textResizeEvent = new CustomEvent("textResize");
 
-
     function createModuleTemplate() {
 
         if (!m_oModuleTemplate) {
-
             m_oModuleTemplate = document.createElement("div");
             
             m_oModuleTemplate.innerHTML = ("<div class=\"" + 
@@ -920,55 +880,34 @@ version: 2.3.0
             m_oHeaderTemplate = m_oModuleTemplate.firstChild;
             m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
             m_oFooterTemplate = m_oBodyTemplate.nextSibling;
-
         }
 
         return m_oModuleTemplate;
-
     }
 
-
     function createHeader() {
-
         if (!m_oHeaderTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oHeaderTemplate.cloneNode(false));
-
     }
-    
 
     function createBody() {
-
         if (!m_oBodyTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oBodyTemplate.cloneNode(false));
-    
     }
-    
 
     function createFooter() {
-
         if (!m_oFooterTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oFooterTemplate.cloneNode(false));
-
     }
-    
 
     Module.prototype = {
-    
+
         /**
         * The class's constructor function
         * @property contructor
@@ -982,35 +921,35 @@ version: 2.3.0
         * @type HTMLElement
         */
         element: null,
-        
+
         /**
         * The header element, denoted with CSS class "hd"
         * @property header
         * @type HTMLElement
         */
         header: null,
-        
+
         /**
         * The body element, denoted with CSS class "bd"
         * @property body
         * @type HTMLElement
         */
         body: null,
-        
+
         /**
         * The footer element, denoted with CSS class "ft"
         * @property footer
         * @type HTMLElement
         */
         footer: null,
-        
+
         /**
         * The id of the element
         * @property id
         * @type String
         */
         id: null,
-        
+
         /**
         * A string representing the root path for all images created by
         * a Module instance.
@@ -1020,16 +959,16 @@ version: 2.3.0
         * @type String
         */
         imageRoot: Module.IMG_ROOT,
-    
+
         /**
         * Initializes the custom events for Module which are fired 
         * automatically at appropriate times by the Module class.
         * @method initEvents
         */
         initEvents: function () {
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to class initalization.
             * @event beforeInitEvent
@@ -1038,7 +977,7 @@ version: 2.3.0
             */
             this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
             this.beforeInitEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after class initalization.
             * @event initEvent
@@ -1047,20 +986,19 @@ version: 2.3.0
             */  
             this.initEvent = this.createEvent(EVENT_TYPES.INIT);
             this.initEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is appended to the DOM
             * @event appendEvent
             */
             this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
             this.appendEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is rendered
             * @event beforeRenderEvent
             */
-            this.beforeRenderEvent = 
-                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER);
             this.beforeRenderEvent.signature = SIGNATURE;
         
             /**
@@ -1077,8 +1015,7 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new header content
             */
-            this.changeHeaderEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER);
             this.changeHeaderEvent.signature = SIGNATURE;
             
             /**
@@ -1097,46 +1034,44 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new footer content
             */
-            this.changeFooterEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
             this.changeFooterEvent.signature = SIGNATURE;
         
             /**
             * CustomEvent fired when the content of the Module is modified
             * @event changeContentEvent
             */
-            this.changeContentEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
             this.changeContentEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is destroyed
             * @event destroyEvent
             */
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
             this.destroyEvent.signature = SIGNATURE;
-            
+
             /**
             * CustomEvent fired before the Module is shown
             * @event beforeShowEvent
             */
             this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
             this.beforeShowEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is shown
             * @event showEvent
             */
             this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
             this.showEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is hidden
             * @event beforeHideEvent
             */
             this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
             this.beforeHideEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is hidden
             * @event hideEvent
@@ -1144,30 +1079,22 @@ version: 2.3.0
             this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
             this.hideEvent.signature = SIGNATURE;
         }, 
-        
+
         /**
         * String representing the current user-agent platform
         * @property platform
         * @type String
         */
         platform: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-        
+
             if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-        
                 return "windows";
-        
             } else if (ua.indexOf("macintosh") != -1) {
-        
                 return "mac";
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1177,40 +1104,24 @@ version: 2.3.0
         * @type String
         */
         browser: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-            
             /*
                  Check Opera first in case of spoof and check Safari before
                  Gecko since Safari's user agent string includes "like Gecko"
             */
-
             if (ua.indexOf('opera') != -1) { 
-            
                 return 'opera';
-            
             } else if (ua.indexOf('msie 7') != -1) {
-            
                 return 'ie7';
-            
             } else if (ua.indexOf('msie') != -1) {
-            
                 return 'ie';
-            
             } else if (ua.indexOf('safari') != -1) { 
-            
                 return 'safari';
-            
             } else if (ua.indexOf('gecko') != -1) {
-            
                 return 'gecko';
-            
             } else {
-            
                 return false;
-            
             }
-        
         }(),
         
         /**
@@ -1220,17 +1131,11 @@ version: 2.3.0
         * @type Boolean
         */
         isSecure: function () {
-        
             if (window.location.href.toLowerCase().indexOf("https") === 0) {
-        
                 return true;
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1238,9 +1143,7 @@ version: 2.3.0
         * automatically at appropriate times by the Module class.
         */
         initDefaultConfig: function () {
-    
             // Add properties //
-        
             /**
             * Specifies whether the Module is visible on the page.
             * @config visible
@@ -1252,7 +1155,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.VISIBLE.value, 
                 validator: DEFAULT_CONFIG.VISIBLE.validator
             });
-            
+
             /**
             * Object or array of objects representing the ContainerEffect 
             * classes that are active for animating the container.
@@ -1264,7 +1167,7 @@ version: 2.3.0
                 suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.EFFECT.supercedes
             });
-            
+
             /**
             * Specifies whether to create a special proxy iframe to monitor 
             * for user font resizing in the document
@@ -1276,9 +1179,26 @@ version: 2.3.0
                 handler: this.configMonitorResize,
                 value: DEFAULT_CONFIG.MONITOR_RESIZE.value
             });
-            
+
+            /**
+            * Specifies if the module should be rendered as the first child 
+            * of document.body or appended as the last child when render is called
+            * with document.body as the "appendToNode".
+            * <p>
+            * Appending to the body while the DOM is still being constructed can 
+            * lead to Operation Aborted errors in IE hence this flag is set to 
+            * false by default.
+            * </p>
+            * 
+            * @config appendtodocumentbody
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, {
+                value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value
+            });
         },
-        
+
         /**
         * The Module class's initialization method, which is executed for
         * Module and all of its subclasses. This method is automatically 
@@ -1293,13 +1213,12 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-        
-            var elId, i, child;
-        
+
+            var elId, child;
+
             this.initEvents();
-        
             this.beforeInitEvent.fire(Module);
-        
+
             /**
             * The Module's Config object used for monitoring 
             * configuration properties.
@@ -1307,208 +1226,217 @@ version: 2.3.0
             * @type YAHOO.util.Config
             */
             this.cfg = new Config(this);
-        
+
             if (this.isSecure) {
                 this.imageRoot = Module.IMG_ROOT_SSL;
             }
-        
-            if (typeof el == "string") {
 
+            if (typeof el == "string") {
                 elId = el;
-        
                 el = document.getElementById(el);
-
                 if (! el) {
-
                     el = (createModuleTemplate()).cloneNode(false);
-
                     el.id = elId;
-
                 }
-
             }
-        
+
             this.element = el;
-        
+
             if (el.id) {
                 this.id = el.id;
             }
-        
+
             child = this.element.firstChild;
-            
-            if (child) {
 
+            if (child) {
+                var fndHd = false, fndBd = false, fndFt = false;
                 do {
-
-                    switch (child.className) {
-    
-                    case Module.CSS_HEADER:
-    
-                        this.header = child;
-    
-                        break;
-    
-                    case Module.CSS_BODY:
-    
-                        this.body = child;
-    
-                        break;
-    
-                    case Module.CSS_FOOTER:
-    
-                        this.footer = child;
-    
-                        break;
-    
+                    // We're looking for elements
+                    if (1 == child.nodeType) {
+                        if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) {
+                            this.header = child;
+                            fndHd = true;
+                        } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) {
+                            this.body = child;
+                            fndBd = true;
+                        } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){
+                            this.footer = child;
+                            fndFt = true;
+                        }
                     }
-                    
                 } while ((child = child.nextSibling));
-            
             }
 
-        
             this.initDefaultConfig();
-        
+
             Dom.addClass(this.element, Module.CSS_MODULE);
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
-        
+
             /*
                 Subscribe to the fireQueue() method of Config so that any 
                 queued configuration changes are excecuted upon render of 
                 the Module
             */ 
-            
-            if (!Config.alreadySubscribed(this.renderEvent, 
-                this.cfg.fireQueue, this.cfg)) {
 
+            if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
                 this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-
             }
-        
+
             this.initEvent.fire(Module);
         },
-        
+
         /**
-        * Initialized an empty IFRAME that is placed out of the visible area 
+        * Initialize an empty IFRAME that is placed out of the visible area 
         * that can be used to detect text resize.
         * @method initResizeMonitor
         */
         initResizeMonitor: function () {
-        
-            var oDoc, 
-                oIFrame, 
-                sHTML;
-        
-            function fireTextResize() {
-        
+
+            var isGeckoWin = (YAHOO.env.ua.gecko && this.platform == "windows");
+            if (isGeckoWin) {
+                // Help prevent spinning loading icon which 
+                // started with FireFox 2.0.0.8/Win
+                var self = this;
+                setTimeout(function(){self._initResizeMonitor();}, 0);
+            } else {
+                this._initResizeMonitor();
+            }
+        },
+
+        /**
+         * Create and initialize the text resize monitoring iframe.
+         * 
+         * @protected
+         * @method _initResizeMonitor
+         */
+        _initResizeMonitor : function() {
+
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+
+            function fireTextResize() {
                 Module.textResizeEvent.fire();
-        
             }
-        
+
             if (!YAHOO.env.ua.opera) {
-        
                 oIFrame = Dom.get("_yuiResizeMonitor");
-        
+
+                var supportsCWResize = this._supportsCWResize();
+
                 if (!oIFrame) {
-        
                     oIFrame = document.createElement("iframe");
-        
-                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
-                        YAHOO.env.ua.ie) {
-    
+
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && YAHOO.env.ua.ie) {
                         oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
-    
                     }
 
-
-                    /*
-                        Need to set "src" attribute of the iframe to 
-                        prevent the browser from reporting duplicate 
-                        cookies. (See SourceForge bug #1721755)
-                    */
-        
-                    if (YAHOO.env.ua.gecko) {
-
-                        sHTML = "<html><head><script " +
-                                "type=\"text/javascript\">" + 
-                                "window.onresize=function(){window.parent." +
-                                "YAHOO.widget.Module.textResizeEvent." +
-                                "fire();};window.parent.YAHOO.widget.Module." +
-                                "textResizeEvent.fire();</script></head>" + 
-                                "<body></body></html>";
-
-                        oIFrame.src = "data:text/html;charset=utf-8," + 
-                            encodeURIComponent(sHTML);
-
+                    if (!supportsCWResize) {
+                        // Can't monitor on contentWindow, so fire from inside iframe
+                        sHTML = ["<html><head><script ",
+                                 "type=\"text/javascript\">",
+                                 "window.onresize=function(){window.parent.",
+                                 "YAHOO.widget.Module.textResizeEvent.",
+                                 "fire();};<",
+                                 "\/script></head>",
+                                 "<body></body></html>"].join('');
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML);
                     }
 
                     oIFrame.id = "_yuiResizeMonitor";
-                    
                     /*
                         Need to set "position" property before inserting the 
                         iframe into the document or Safari's status bar will 
                         forever indicate the iframe is loading 
                         (See SourceForge bug #1723064)
                     */
-                    
                     oIFrame.style.position = "absolute";
                     oIFrame.style.visibility = "hidden";
-        
-                    document.body.appendChild(oIFrame);
-        
+
+                    var db = document.body,
+                        fc = db.firstChild;
+                    if (fc) {
+                        db.insertBefore(oIFrame, fc);
+                    } else {
+                        db.appendChild(oIFrame);
+                    }
+
                     oIFrame.style.width = "10em";
                     oIFrame.style.height = "10em";
                     oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
                     oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
                     oIFrame.style.borderWidth = "0";
                     oIFrame.style.visibility = "visible";
-        
+
+                    /*
+                       Don't open/close the document for Gecko like we used to, since it
+                       leads to duplicate cookies. (See SourceForge bug #1721755)
+                    */
                     if (YAHOO.env.ua.webkit) {
-        
                         oDoc = oIFrame.contentWindow.document;
-        
                         oDoc.open();
                         oDoc.close();
-        
                     }
-
                 }
-        
+
                 if (oIFrame && oIFrame.contentWindow) {
+                    Module.textResizeEvent.subscribe(this.onDomResize, this, true);
 
-                    Module.textResizeEvent.subscribe(this.onDomResize, 
-                        this, true);
-        
                     if (!Module.textResizeInitialized) {
-
-                        if (!Event.on(oIFrame.contentWindow, "resize", 
-                            fireTextResize)) {
-
-                            /*
-                                 This will fail in IE if document.domain has 
-                                 changed, so we must change the listener to 
-                                 use the oIFrame element instead
-                            */
-
-                            Event.on(oIFrame, "resize", fireTextResize);
-
+                        if (supportsCWResize) {
+                            if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) {
+                                /*
+                                     This will fail in IE if document.domain has 
+                                     changed, so we must change the listener to 
+                                     use the oIFrame element instead
+                                */
+                                Event.on(oIFrame, "resize", fireTextResize);
+                            }
                         }
-
                         Module.textResizeInitialized = true;
-
                     }
-
                     this.resizeMonitor = oIFrame;
+                }
+            }
+        },
 
+        /**
+         * Text resize monitor helper method.
+         * Determines if the browser supports resize events on iframe content windows.
+         * 
+         * @private
+         * @method _supportsCWResize
+         */
+        _supportsCWResize : function() {
+            /*
+                Gecko 1.8.0 (FF1.5), 1.8.1.0-5 (FF2) won't fire resize on contentWindow.
+                Gecko 1.8.1.6+ (FF2.0.0.6+) and all other browsers will fire resize on contentWindow.
+
+                We don't want to start sniffing for patch versions, so fire textResize the same
+                way on all FF, until 1.9 (3.x) is out
+             */
+            var bSupported = true;
+            if (YAHOO.env.ua.gecko && YAHOO.env.ua.gecko <= 1.8) {
+                bSupported = false;
+                /*
+                var v = navigator.userAgent.match(/rv:([^\s\)]*)/); // From YAHOO.env.ua
+                if (v && v[0]) {
+                    var sv = v[0].match(/\d\.\d\.(\d)/);
+                    if (sv && sv[1]) {
+                        if (parseInt(sv[1], 10) > 0) {
+                            bSupported = true;
+                        }
+                    }
                 }
-        
+                */
             }
-        
+            return bSupported;
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -1516,45 +1444,45 @@ version: 2.3.0
         * @param {Object} obj The scope object passed to the handler
         */
         onDomResize: function (e, obj) {
-        
+
             var nLeft = -1 * this.resizeMonitor.offsetWidth,
                 nTop = -1 * this.resizeMonitor.offsetHeight;
         
             this.resizeMonitor.style.top = nTop + "px";
             this.resizeMonitor.style.left =  nLeft + "px";
-        
+
         },
-        
+
         /**
-        * Sets the Module's header content to the HTML specified, or appends 
+        * Sets the Module's header content to the string specified, or appends 
         * the passed element to the header. If no header is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the header.
+        * 
         * @method setHeader
-        * @param {String} headerContent The HTML used to set the header 
+        * @param {String} headerContent The string used to set the header.
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the header innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} headerContent The HTMLElement to append to 
         * the header
         */
         setHeader: function (headerContent) {
-
             var oHeader = this.header || (this.header = createHeader());
-        
-            if (typeof headerContent == "string") {
-
-                oHeader.innerHTML = headerContent;
-
-            } else {
 
+            if (headerContent.tagName) {
                 oHeader.innerHTML = "";
                 oHeader.appendChild(headerContent);
-
+            } else {
+                oHeader.innerHTML = headerContent;
             }
-        
+
             this.changeHeaderEvent.fire(headerContent);
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Appends the passed element to the header. If no header is present, 
         * one will be automatically created.
@@ -1562,7 +1490,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the header
         */
         appendToHeader: function (element) {
-
             var oHeader = this.header || (this.header = createHeader());
         
             oHeader.appendChild(element);
@@ -1571,35 +1498,34 @@ version: 2.3.0
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Sets the Module's body content to the HTML specified, or appends the
         * passed element to the body. If no body is present, one will be 
-        * automatically created.
+        * automatically created. An empty string can be passed to the method
+        * to clear the contents of the body.
         * @method setBody
-        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {String} bodyContent The HTML used to set the body. 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the body innerHTML
+        * set to their default toString implementations.
+        * <em>OR</em>
         * @param {HTMLElement} bodyContent The HTMLElement to append to the body
         */
         setBody: function (bodyContent) {
-
             var oBody = this.body || (this.body = createBody());
-        
-            if (typeof bodyContent == "string") {
-
-                oBody.innerHTML = bodyContent;
-
-            } else {
 
+            if (bodyContent.tagName) {
                 oBody.innerHTML = "";
                 oBody.appendChild(bodyContent);
-
+            } else {
+                oBody.innerHTML = bodyContent;
             }
-        
+
             this.changeBodyEvent.fire(bodyContent);
             this.changeContentEvent.fire();
-
         },
-        
+
         /**
         * Appends the passed element to the body. If no body is present, one 
         * will be automatically created.
@@ -1607,7 +1533,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the body
         */
         appendToBody: function (element) {
-
             var oBody = this.body || (this.body = createBody());
         
             oBody.appendChild(element);
@@ -1620,9 +1545,13 @@ version: 2.3.0
         /**
         * Sets the Module's footer content to the HTML specified, or appends 
         * the passed element to the footer. If no footer is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the footer.
         * @method setFooter
         * @param {String} footerContent The HTML used to set the footer 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the footer innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} footerContent The HTMLElement to append to 
         * the footer
@@ -1630,18 +1559,14 @@ version: 2.3.0
         setFooter: function (footerContent) {
 
             var oFooter = this.footer || (this.footer = createFooter());
-        
-            if (typeof footerContent == "string") {
-
-                oFooter.innerHTML = footerContent;
-
-            } else {
 
+            if (footerContent.tagName) {
                 oFooter.innerHTML = "";
                 oFooter.appendChild(footerContent);
-
+            } else {
+                oFooter.innerHTML = footerContent;
             }
-        
+
             this.changeFooterEvent.fire(footerContent);
             this.changeContentEvent.fire();
 
@@ -1668,10 +1593,20 @@ version: 2.3.0
         * Renders the Module by inserting the elements that are not already 
         * in the main Module into their correct places. Optionally appends 
         * the Module to the specified node prior to the render's execution. 
-        * NOTE: For Modules without existing markup, the appendToNode argument 
+        * <p>
+        * For Modules without existing markup, the appendToNode argument 
         * is REQUIRED. If this argument is ommitted and the current element is 
         * not present in the document, the function will return false, 
         * indicating that the render was a failure.
+        * </p>
+        * <p>
+        * NOTE: As of 2.3.1, if the appendToNode is the document's body element
+        * then the module is rendered as the first child of the body element, 
+        * and not appended to it, to avoid Operation Aborted errors in IE when 
+        * rendering the module before window's load event is fired. You can 
+        * use the appendtodocumentbody configuration property to change this 
+        * to append to document.body if required.
+        * </p>
         * @method render
         * @param {String} appendToNode The element id to which the Module 
         * should be appended to prior to rendering <em>OR</em>
@@ -1682,120 +1617,76 @@ version: 2.3.0
         * @return {Boolean} Success or failure of the render
         */
         render: function (appendToNode, moduleElement) {
-        
+
             var me = this,
                 firstChild;
-        
-            function appendTo(element) {
-                if (typeof element == "string") {
-                    element = document.getElementById(element);
+
+            function appendTo(parentNode) {
+                if (typeof parentNode == "string") {
+                    parentNode = document.getElementById(parentNode);
                 }
-        
-                if (element) {
-                    element.appendChild(me.element);
+
+                if (parentNode) {
+                    me._addToParent(parentNode, me.element);
                     me.appendEvent.fire();
                 }
             }
-        
+
             this.beforeRenderEvent.fire();
-        
+
             if (! moduleElement) {
                 moduleElement = this.element;
             }
-        
-            if (appendToNode) {
 
+            if (appendToNode) {
                 appendTo(appendToNode);
-
             } else { 
-
-                /*
-                     No node was passed in. If the element is not already in 
-                     the Dom, this fails
-                */
-
+                // No node was passed in. If the element is not already in the Dom, this fails
                 if (! Dom.inDocument(this.element)) {
-
-                    YAHOO.log("Render failed. Must specify appendTo node if " + 
-                        " Module isn't already in the DOM.", "error");
-
+                    YAHOO.log("Render failed. Must specify appendTo node if " + " Module isn't already in the DOM.", "error");
                     return false;
-
                 }
-
             }
-        
+
             // Need to get everything into the DOM if it isn't already
-        
             if (this.header && ! Dom.inDocument(this.header)) {
-
-                /*
-                    There is a header, but it's not in the DOM yet... 
-                    need to add it
-                */
-
+                // There is a header, but it's not in the DOM yet. Need to add it.
                 firstChild = moduleElement.firstChild;
-
-                if (firstChild) { // Insert before first child if exists
-
+                if (firstChild) {
                     moduleElement.insertBefore(this.header, firstChild);
-
-                } else { // Append to empty body because there are no children
-
+                } else {
                     moduleElement.appendChild(this.header);
-
                 }
-
             }
-        
-            if (this.body && ! Dom.inDocument(this.body)) {
-
-                /*
-                     There is a body, but it's not in the DOM yet... 
-                     need to add it
-                */
-
-
-                // Insert before footer if exists in DOM
-
-                if (this.footer && Dom.isAncestor(
-                    this.moduleElement, this.footer)) { 
 
+            if (this.body && ! Dom.inDocument(this.body)) {
+                // There is a body, but it's not in the DOM yet. Need to add it.               
+                if (this.footer && Dom.isAncestor(this.moduleElement, this.footer)) {
                     moduleElement.insertBefore(this.body, this.footer);
-
-                } else { // Append to element because there is no footer
-
+                } else {
                     moduleElement.appendChild(this.body);
-
                 }
-
             }
-        
-            if (this.footer && ! Dom.inDocument(this.footer)) {
-
-                /*
-                     There is a footer, but it's not in the DOM yet... 
-                     need to add it
-                */
 
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+                // There is a footer, but it's not in the DOM yet. Need to add it.
                 moduleElement.appendChild(this.footer);
-
             }
-        
+
             this.renderEvent.fire();
             return true;
         },
-        
+
         /**
         * Removes the Module element from the DOM and sets all child elements 
         * to null.
         * @method destroy
         */
         destroy: function () {
-        
+
             var parent,
                 e;
-        
+
             if (this.element) {
                 Event.purgeElement(this.element, true);
                 parent = this.element.parentNode;
@@ -1846,7 +1737,6 @@ version: 2.3.0
         },
         
         // BUILT-IN EVENT HANDLERS FOR MODULE //
-        
         /**
         * Default event handler for changing the visibility property of a 
         * Module. By default, this is achieved by switching the "display" style 
@@ -1882,23 +1772,40 @@ version: 2.3.0
         * @method configMonitorResize
         */
         configMonitorResize: function (type, args, obj) {
-
             var monitor = args[0];
-
             if (monitor) {
-
                 this.initResizeMonitor();
-
             } else {
-
-                Module.textResizeEvent.unsubscribe(
-                    this.onDomResize, this, true);
-
+                Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
                 this.resizeMonitor = null;
             }
+        },
 
+        /**
+         * This method is a protected helper, used when constructing the DOM structure for the module 
+         * to account for situations which may cause Operation Aborted errors in IE. It should not 
+         * be used for general DOM construction.
+         * <p>
+         * If the parentNode is not document.body, the element is appended as the last element.
+         * </p>
+         * <p>
+         * If the parentNode is document.body the element is added as the first child to help
+         * prevent Operation Aborted errors in IE.
+         * </p>
+         *
+         * @param {parentNode} The HTML element to which the element will be added
+         * @param {element} The HTML element to be added to parentNode's children
+         * @method _addToParent
+         * @protected
+         */
+        _addToParent: function(parentNode, element) {
+            if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) {
+                parentNode.insertBefore(element, parentNode.firstChild);
+            } else {
+                parentNode.appendChild(element);
+            }
         },
-        
+
         /**
         * Returns a String representation of the Object.
         * @method toString
@@ -1907,12 +1814,12 @@ version: 2.3.0
         toString: function () {
             return "Module " + this.id;
         }
-        
     };
-    
+
     YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -1924,7 +1831,7 @@ version: 2.3.0
     * properly rendered above SELECT elements.
     * @namespace YAHOO.widget
     * @class Overlay
-    * @extends Module
+    * @extends YAHOO.widget.Module
     * @param {String} el The element ID representing the Overlay <em>OR</em>
     * @param {HTMLElement} el The element representing the Overlay
     * @param {Object} userConfig The configuration object literal containing 
@@ -1933,12 +1840,9 @@ version: 2.3.0
     * @constructor
     */
     YAHOO.widget.Overlay = function (el, userConfig) {
-    
         YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
@@ -1946,7 +1850,7 @@ version: 2.3.0
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Overlay = YAHOO.widget.Overlay,
-        
+
         m_oIFrameTemplate,
 
         /**
@@ -1957,12 +1861,10 @@ version: 2.3.0
         * @type Object
         */
         EVENT_TYPES = {
-        
             "BEFORE_MOVE": "beforeMove",
             "MOVE": "move"
-        
         },
-        
+
         /**
         * Constant representing the Overlay's configuration properties
         * @property DEFAULT_CONFIG
@@ -1971,74 +1873,72 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "X": { 
                 key: "x", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "Y": { 
                 key: "y", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "XY": { 
                 key: "xy", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "CONTEXT": { 
                 key: "context", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "FIXED_CENTER": { 
                 key: "fixedcenter", 
                 value: false, 
                 validator: Lang.isBoolean, 
                 supercedes: ["iframe", "visible"] 
             },
-        
+
             "WIDTH": { 
                 key: "width", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
             }, 
-        
+
             "HEIGHT": { 
                 key: "height", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
-            }, 
-        
+            },
+
             "ZINDEX": { 
                 key: "zindex", 
                 value: null 
-            }, 
-        
+            },
+
             "CONSTRAIN_TO_VIEWPORT": { 
                 key: "constraintoviewport", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["iframe", "x", "y", "xy"] 
+                supercedes: ["iframe", "x", "y", "xy"]
             }, 
-        
+
             "IFRAME": { 
                 key: "iframe", 
                 value: (YAHOO.env.ua.ie == 6 ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["zindex"] 
             }
-        
         };
 
-
     /**
     * The URL that will be placed in the iframe
     * @property YAHOO.widget.Overlay.IFRAME_SRC
@@ -2050,7 +1950,7 @@ version: 2.3.0
 
     /**
     * Number representing how much the iframe shim should be offset from each 
-    * side of an Overlay instance.
+    * side of an Overlay instance, in pixels.
     * @property YAHOO.widget.Overlay.IFRAME_SRC
     * @default 3
     * @static
@@ -2058,7 +1958,18 @@ version: 2.3.0
     * @type Number
     */
     Overlay.IFRAME_OFFSET = 3;
-    
+
+    /**
+    * Number representing the minimum distance an Overlay instance should be 
+    * positioned relative to the boundaries of the browser's viewport, in pixels.
+    * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET
+    * @default 10
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.VIEWPORT_OFFSET = 10;
+
     /**
     * Constant representing the top left corner of an element, used for 
     * configuring the context element alignment
@@ -2068,7 +1979,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_LEFT = "tl";
-    
+
     /**
     * Constant representing the top right corner of an element, used for 
     * configuring the context element alignment
@@ -2078,7 +1989,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_RIGHT = "tr";
-    
+
     /**
     * Constant representing the top bottom left corner of an element, used for 
     * configuring the context element alignment
@@ -2088,7 +1999,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_LEFT = "bl";
-    
+
     /**
     * Constant representing the bottom right corner of an element, used for 
     * configuring the context element alignment
@@ -2098,7 +2009,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_RIGHT = "br";
-    
+
     /**
     * Constant representing the default CSS class used for an Overlay
     * @property YAHOO.widget.Overlay.CSS_OVERLAY
@@ -2107,22 +2018,21 @@ version: 2.3.0
     * @type String
     */
     Overlay.CSS_OVERLAY = "yui-overlay";
-    
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for 
     * window scroll
     * @event YAHOO.widget.Overlay.windowScrollEvent
     */
     Overlay.windowScrollEvent = new CustomEvent("windowScroll");
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for
     * window resize
     * @event YAHOO.widget.Overlay.windowResizeEvent
     */
     Overlay.windowResizeEvent = new CustomEvent("windowResize");
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window scroll
     * @method YAHOO.widget.Overlay.windowScrollHandler
@@ -2130,31 +2040,24 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM scroll event
     */
     Overlay.windowScrollHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
+
             if (! window.scrollEnd) {
-    
                 window.scrollEnd = -1;
-    
             }
-    
+
             clearTimeout(window.scrollEnd);
     
             window.scrollEnd = setTimeout(function () { 
-            
                 Overlay.windowScrollEvent.fire(); 
-    
             }, 1);
     
         } else {
-    
             Overlay.windowScrollEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window resize
     * @method YAHOO.widget.Overlay.windowResizeHandler
@@ -2162,29 +2065,22 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM resize event
     */
     Overlay.windowResizeHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
             if (! window.resizeEnd) {
                 window.resizeEnd = -1;
             }
-    
+
             clearTimeout(window.resizeEnd);
-    
+
             window.resizeEnd = setTimeout(function () {
-    
                 Overlay.windowResizeEvent.fire(); 
-    
             }, 100);
-    
         } else {
-    
             Overlay.windowResizeEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * A boolean that indicated whether the window resize and scroll events have 
     * already been subscribed to.
@@ -2193,18 +2089,16 @@ version: 2.3.0
     * @type Boolean
     */
     Overlay._initialized = null;
-    
+
     if (Overlay._initialized === null) {
-    
         Event.on(window, "scroll", Overlay.windowScrollHandler);
         Event.on(window, "resize", Overlay.windowResizeHandler);
     
         Overlay._initialized = true;
-    
     }
-    
+
     YAHOO.extend(Overlay, Module, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and  
         * all of its subclasses. This method is automatically called by the 
@@ -2225,39 +2119,35 @@ version: 2.3.0
             */
     
             Overlay.superclass.init.call(this, el/*, userConfig*/);  
-            
+
             this.beforeInitEvent.fire(Overlay);
             
             Dom.addClass(this.element, Overlay.CSS_OVERLAY);
             
             if (userConfig) {
-    
                 this.cfg.applyConfig(userConfig, true);
-    
             }
-            
+
             if (this.platform == "mac" && YAHOO.env.ua.gecko) {
-    
+
                 if (! Config.alreadySubscribed(this.showEvent,
                     this.showMacGeckoScrollbars, this)) {
-    
+
                     this.showEvent.subscribe(this.showMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
+
                 if (! Config.alreadySubscribed(this.hideEvent, 
                     this.hideMacGeckoScrollbars, this)) {
-    
+
                     this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
             }
-            
+
             this.initEvent.fire(Overlay);
-        
         },
         
         /**
@@ -2317,8 +2207,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.X.supercedes
     
             });
-        
-    
+
             /**
             * The absolute y-coordinate position of the Overlay
             * @config y
@@ -2326,14 +2215,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
-    
+
                 handler: this.configY, 
                 validator: DEFAULT_CONFIG.Y.validator, 
                 suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.Y.supercedes
-    
+
             });
-        
     
             /**
             * An array with the absolute x and y positions of the Overlay
@@ -2348,7 +2236,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.XY.supercedes
             
             });
-        
     
             /**
             * The array of context arguments for context-sensitive positioning.  
@@ -2367,8 +2254,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
             
             });
-        
-    
+
             /**
             * True if the Overlay should be anchored to the center of 
             * the viewport.
@@ -2384,7 +2270,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
             
             });
-        
     
             /**
             * CSS width of the Overlay.
@@ -2393,13 +2278,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
-            
+
                 handler: this.configWidth, 
                 suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.WIDTH.supercedes
-            
+
             });
-            
+
             /**
             * CSS height of the Overlay.
             * @config height
@@ -2407,7 +2292,7 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
-            
+
                 handler: this.configHeight, 
                 suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
@@ -2421,12 +2306,12 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
-    
+
                 handler: this.configzIndex,
                 value: DEFAULT_CONFIG.ZINDEX.value
-    
+
             });
-            
+
             /**
             * True if the Overlay should be prevented from being positioned 
             * out of the viewport.
@@ -2435,18 +2320,18 @@ version: 2.3.0
             * @default false
             */
             this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
-            
+
                 handler: this.configConstrainToViewport, 
                 value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
                 validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
                 supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
-            
+
             });
-            
+
             /**
             * @config iframe
             * @description Boolean indicating whether or not the Overlay should 
-            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * have an IFRAME shim; used to prevent SELECT elements from 
             * poking through an Overlay instance in IE6.  When set to "true", 
             * the iframe shim is created when the Overlay instance is intially
             * made visible.
@@ -2454,16 +2339,15 @@ version: 2.3.0
             * @default true for IE6 and below, false for all other browsers.
             */
             this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
-            
+
                 handler: this.configIframe, 
                 value: DEFAULT_CONFIG.IFRAME.value, 
                 validator: DEFAULT_CONFIG.IFRAME.validator, 
                 supercedes: DEFAULT_CONFIG.IFRAME.supercedes
-            
+
             });
-        
         },
-        
+
         /**
         * Moves the Overlay to the specified position. This function is  
         * identical to calling this.cfg.setProperty("xy", [x,y]);
@@ -2472,11 +2356,9 @@ version: 2.3.0
         * @param {Number} y The Overlay's new y position
         */
         moveTo: function (x, y) {
-    
             this.cfg.setProperty("xy", [x, y]);
-    
         },
-        
+
         /**
         * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
         * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2489,7 +2371,7 @@ version: 2.3.0
             Dom.addClass(this.element, "hide-scrollbars");
     
         },
-        
+
         /**
         * Adds a CSS class ("show-scrollbars") and removes a CSS class 
         * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2502,9 +2384,8 @@ version: 2.3.0
             Dom.addClass(this.element, "show-scrollbars");
     
         },
-        
+
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * The default event handler fired when the "visible" property is 
         * changed.  This method is responsible for firing showEvent
@@ -2517,7 +2398,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configVisible: function (type, args, obj) {
-    
+
             var visible = args[0],
                 currentVis = Dom.getStyle(this.element, "visibility"),
                 effect = this.cfg.getProperty("effect"),
@@ -2527,140 +2408,93 @@ version: 2.3.0
                 eff, ei, e, i, j, k, h,
                 nEffects,
                 nEffectInstances;
-    
-    
+
             if (currentVis == "inherit") {
-    
                 e = this.element.parentNode;
-    
+
                 while (e.nodeType != 9 && e.nodeType != 11) {
-    
                     currentVis = Dom.getStyle(e, "visibility");
-    
+
                     if (currentVis != "inherit") { 
-    
                         break; 
-    
                     }
-    
+
                     e = e.parentNode;
-    
                 }
-    
+
                 if (currentVis == "inherit") {
-    
                     currentVis = "visible";
-                
                 }
-    
             }
-        
-    
+
             if (effect) {
-    
                 if (effect instanceof Array) {
-
                     nEffects = effect.length;
-    
+
                     for (i = 0; i < nEffects; i++) {
-    
                         eff = effect[i];
-    
                         effectInstances[effectInstances.length] = 
                             eff.effect(this, eff.duration);
-    
+
                     }
-    
                 } else {
-    
                     effectInstances[effectInstances.length] = 
                         effect.effect(this, effect.duration);
-    
                 }
-    
             }
-    
-        
+
+
             if (visible) { // Show
-    
                 if (isMacGecko) {
-    
                     this.showMacGeckoScrollbars();
-    
                 }
-                
-    
+
                 if (effect) { // Animate in
-    
-    
                     if (visible) { // Animate in if not showing
-    
-    
                         if (currentVis != "visible" || currentVis === "") {
-    
                             this.beforeShowEvent.fire();
-
                             nEffectInstances = effectInstances.length;
-    
+
                             for (j = 0; j < nEffectInstances; j++) {
-    
                                 ei = effectInstances[j];
-    
                                 if (j === 0 && !alreadySubscribed(
                                         ei.animateInCompleteEvent, 
                                         this.showEvent.fire, this.showEvent)) {
-    
+
                                     /*
                                          Delegate showEvent until end 
                                          of animateInComplete
                                     */
-    
+
                                     ei.animateInCompleteEvent.subscribe(
                                      this.showEvent.fire, this.showEvent, true);
-    
                                 }
-    
                                 ei.animateIn();
-    
                             }
-    
                         }
-    
                     }
-    
                 } else { // Show
-    
                     if (currentVis != "visible" || currentVis === "") {
-    
                         this.beforeShowEvent.fire();
-    
+
                         Dom.setStyle(this.element, "visibility", "visible");
-    
+
                         this.cfg.refireEvent("iframe");
                         this.showEvent.fire();
-    
                     }
-        
                 }
-        
             } else { // Hide
-    
+
                 if (isMacGecko) {
-    
                     this.hideMacGeckoScrollbars();
-    
                 }
                     
                 if (effect) { // Animate out if showing
-    
                     if (currentVis == "visible") {
-    
                         this.beforeHideEvent.fire();
 
                         nEffectInstances = effectInstances.length;
-    
                         for (k = 0; k < nEffectInstances; k++) {
-    
                             h = effectInstances[k];
     
                             if (k === 0 && !alreadySubscribed(
@@ -2676,50 +2510,35 @@ version: 2.3.0
                                     this.hideEvent.fire, this.hideEvent, true);
     
                             }
-    
                             h.animateOut();
-    
                         }
-    
+
                     } else if (currentVis === "") {
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-    
                     }
-    
+
                 } else { // Simple hide
-    
+
                     if (currentVis == "visible" || currentVis === "") {
-    
                         this.beforeHideEvent.fire();
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-
                         this.hideEvent.fire();
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
+
         /**
         * Center event handler used for centering on scroll/resize, but only if 
         * the Overlay is visible
         * @method doCenterOnDOMEvent
         */
         doCenterOnDOMEvent: function () {
-    
             if (this.cfg.getProperty("visible")) {
-    
                 this.center();
-    
             }
-    
         },
-        
+
         /**
         * The default event handler fired when the "fixedcenter" property 
         * is changed.
@@ -2731,48 +2550,33 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configFixedCenter: function (type, args, obj) {
-    
+
             var val = args[0],
                 alreadySubscribed = Config.alreadySubscribed,
                 windowResizeEvent = Overlay.windowResizeEvent,
                 windowScrollEvent = Overlay.windowScrollEvent;
-            
+
             if (val) {
-    
                 this.center();
-            
-                if (!alreadySubscribed(this.beforeShowEvent, 
-                    this.center, this)) {
-    
+
+                if (!alreadySubscribed(this.beforeShowEvent, this.center, this)) {
                     this.beforeShowEvent.subscribe(this.center);
-    
                 }
-            
-                if (!alreadySubscribed(windowResizeEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-    
-                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) {
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-            
-                if (!alreadySubscribed(windowScrollEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-        
-                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) {
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-    
+
             } else {
-    
                 this.beforeShowEvent.unsubscribe(this.center);
-    
+
                 windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
                 windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-    
             }
-    
         },
         
         /**
@@ -2785,15 +2589,14 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configHeight: function (type, args, obj) {
-    
+
             var height = args[0],
                 el = this.element;
-    
+
             Dom.setStyle(el, "height", height);
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * The default event handler fired when the "width" property is changed.
         * @method configWidth
@@ -2804,13 +2607,12 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configWidth: function (type, args, obj) {
-    
+
             var width = args[0],
                 el = this.element;
     
             Dom.setStyle(el, "width", width);
             this.cfg.refireEvent("iframe");
-    
         },
         
         /**
@@ -2823,38 +2625,31 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
+
             var zIndex = args[0],
                 el = this.element;
-        
+
             if (! zIndex) {
-    
                 zIndex = Dom.getStyle(el, "zIndex");
-        
                 if (! zIndex || isNaN(zIndex)) {
-    
                     zIndex = 0;
-    
                 }
-    
             }
-            
-            if (this.iframe) {
-    
+
+            if (this.iframe || this.cfg.getProperty("iframe") === true) {
                 if (zIndex <= 0) {
-    
                     zIndex = 1;
-    
                 }
-    
-                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
             }
-            
+
             Dom.setStyle(el, "zIndex", zIndex);
             this.cfg.setProperty("zIndex", zIndex, true);
-    
+
+            if (this.iframe) {
+                this.stackIframe();
+            }
         },
-        
+
         /**
         * The default event handler fired when the "xy" property is changed.
         * @method configXY
@@ -2865,26 +2660,25 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configXY: function (type, args, obj) {
-    
+
             var pos = args[0],
                 x = pos[0],
                 y = pos[1];
-            
+
             this.cfg.setProperty("x", x);
             this.cfg.setProperty("y", y);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             YAHOO.log(("xy: " + [x, y]), "iframe");
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "x" property is changed.
         * @method configX
@@ -2895,27 +2689,26 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configX: function (type, args, obj) {
-    
+
             var x = args[0],
                 y = this.cfg.getProperty("y");
-            
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
             
             Dom.setX(this.element, x, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-           
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "y" property is changed.
         * @method configY
@@ -2926,25 +2719,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configY: function (type, args, obj) {
-    
+
             var x = this.cfg.getProperty("x"),
                 y = args[0];
-        
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             Dom.setY(this.element, y, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
         
         /**
@@ -2957,33 +2749,23 @@ version: 2.3.0
                 oParentNode;
 
             if (oIFrame) {
-    
                 oParentNode = this.element.parentNode;
 
                 if (oParentNode != oIFrame.parentNode) {
-
-                    oParentNode.appendChild(oIFrame);
-                
+                    this._addToParent(oParentNode, oIFrame);
                 }
-
                 oIFrame.style.display = "block";
-    
             }
-    
         },
-        
+
         /**
         * Hides the iframe shim, if it has been enabled.
         * @method hideIframe
         */
         hideIframe: function () {
-    
             if (this.iframe) {
-    
                 this.iframe.style.display = "none";
-    
             }
-    
         },
 
         /**
@@ -2999,37 +2781,44 @@ version: 2.3.0
                 nDimensionOffset = (nOffset * 2),
                 aXY;
 
-
             if (oIFrame) {
-
                 // Size <iframe>
-
-                oIFrame.style.width = 
-                    (oElement.offsetWidth + nDimensionOffset + "px");
-
-                oIFrame.style.height = 
-                    (oElement.offsetHeight + nDimensionOffset + "px");
-
+                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
+                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");
 
                 // Position <iframe>
-
                 aXY = this.cfg.getProperty("xy");
 
                 if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
-
                     this.syncPosition();
-
                     aXY = this.cfg.getProperty("xy");
-
                 }
-
                 Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+            }
+        },
 
+        /**
+         * Sets the zindex of the iframe shim, if it exists, based on the zindex of
+         * the Overlay element. The zindex of the iframe is set to be one less 
+         * than the Overlay element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Overlay element
+         * to ensure that the iframe shim has a non-negative zindex.
+         * If you require the iframe zindex to be 0 or higher, the zindex of 
+         * the Overlay element should be set to a value greater than 0, before 
+         * this method is called.
+         * </p>
+         * @method stackIframe
+         */
+        stackIframe: function () {
+            if (this.iframe) {
+                var overlayZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) {
+                    Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1));
+                }
             }
-        
         },
 
-        
         /**
         * The default event handler fired when the "iframe" property is changed.
         * @method configIframe
@@ -3047,20 +2836,14 @@ version: 2.3.0
 
                 var oIFrame = this.iframe,
                     oElement = this.element,
-                    oParent,
-                    aXY;
-
+                    oParent;
 
                 if (!oIFrame) {
-
                     if (!m_oIFrameTemplate) {
-    
                         m_oIFrameTemplate = document.createElement("iframe");
 
                         if (this.isSecure) {
-        
                             m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
-        
                         }
 
                         /*
@@ -3068,25 +2851,19 @@ version: 2.3.0
                             doesn't modify the opacity of any transparent 
                             elements that may be on top of it (like a shadow).
                         */
-        
+
                         if (YAHOO.env.ua.ie) {
-        
                             m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
-        
                             /*
                                  Need to set the "frameBorder" property to 0 
                                  supress the default <iframe> border in IE.  
                                  Setting the CSS "border" property alone 
                                  doesn't supress it.
                             */
-        
                             m_oIFrameTemplate.frameBorder = 0;
-        
                         }
                         else {
-        
                             m_oIFrameTemplate.style.opacity = "0";
-                        
                         }
 
                         m_oIFrameTemplate.style.position = "absolute";
@@ -3094,109 +2871,91 @@ version: 2.3.0
                         m_oIFrameTemplate.style.margin = "0";
                         m_oIFrameTemplate.style.padding = "0";
                         m_oIFrameTemplate.style.display = "none";
-    
                     }
 
                     oIFrame = m_oIFrameTemplate.cloneNode(false);
-
                     oParent = oElement.parentNode;
 
-                    if (oParent) {
-
-                        oParent.appendChild(oIFrame);
+                    var parentNode = oParent || document.body;
 
-                    } else {
-
-                        document.body.appendChild(oIFrame);
-
-                    }
-                    
+                    this._addToParent(parentNode, oIFrame);
                     this.iframe = oIFrame;
-
                 }
 
-
                 /*
                      Show the <iframe> before positioning it since the "setXY" 
                      method of DOM requires the element be in the document 
                      and visible.
                 */
-
                 this.showIframe();
 
-
                 /*
                      Syncronize the size and position of the <iframe> to that 
                      of the Overlay.
                 */
-                
                 this.syncIframe();
-
+                this.stackIframe();
 
                 // Add event listeners to update the <iframe> when necessary
-
                 if (!this._hasIframeEventListeners) {
-
                     this.showEvent.subscribe(this.showIframe);
                     this.hideEvent.subscribe(this.hideIframe);
                     this.changeContentEvent.subscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = true;
-                    
                 }
-                
             }
 
-
             function onBeforeShow() {
-            
                 createIFrame.call(this);
-        
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                 this._iframeDeferred = false;
-            
             }
-            
 
             if (bIFrame) { // <iframe> shim is enabled
-                
-                if (this.cfg.getProperty("visible")) {
 
+                if (this.cfg.getProperty("visible")) {
                     createIFrame.call(this);
-                
-                }
-                else {
-
+                } else {
                     if (!this._iframeDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-
                         this._iframeDeferred = true;
-                    
                     }
-                
                 }
-    
+
             } else {    // <iframe> shim is disabled
-    
                 this.hideIframe();
 
                 if (this._hasIframeEventListeners) {
-
                     this.showEvent.unsubscribe(this.showIframe);
                     this.hideEvent.unsubscribe(this.hideIframe);
                     this.changeContentEvent.unsubscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = false;
-
                 }
-                
             }
-    
         },
-        
-        
+
+        /**
+         * Set's the container's XY value from DOM if not already set.
+         * 
+         * Differs from syncPosition, in that the XY value is only sync'd with DOM if 
+         * not already set. The method also refire's the XY config property event, so any
+         * beforeMove, Move event listeners are invoked.
+         * 
+         * @method _primeXYFromDOM
+         * @protected
+         */
+        _primeXYFromDOM : function() {
+            if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) {
+                // Set CFG XY based on DOM XY
+                this.syncPosition();
+                // Account for XY being set silently in syncPosition (no moveTo fired/called)
+                this.cfg.refireEvent("xy");
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
+            }
+        },
+
         /**
         * The default event handler fired when the "constraintoviewport" 
         * property is changed.
@@ -3209,28 +2968,22 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configConstrainToViewport: function (type, args, obj) {
-    
             var val = args[0];
-    
+
             if (val) {
-    
-                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
-                    this.enforceConstraints, this)) {
-    
-                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
-                        this, true);
-    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
+                }
+                if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) {
+                    this.beforeShowEvent.subscribe(this._primeXYFromDOM);
                 }
-    
             } else {
-    
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
                 this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
-    
             }
-    
         },
-        
-        /**
+
+         /**
         * The default event handler fired when the "context" property 
         * is changed.
         * @method configContext
@@ -3246,39 +2999,28 @@ version: 2.3.0
                 contextEl,
                 elementMagnetCorner,
                 contextMagnetCorner;
-            
+
             if (contextArgs) {
-            
                 contextEl = contextArgs[0];
                 elementMagnetCorner = contextArgs[1];
                 contextMagnetCorner = contextArgs[2];
                 
                 if (contextEl) {
-    
                     if (typeof contextEl == "string") {
-    
                         this.cfg.setProperty("context", 
                             [document.getElementById(contextEl), 
                                 elementMagnetCorner, contextMagnetCorner], 
                                 true);
-    
                     }
                     
                     if (elementMagnetCorner && contextMagnetCorner) {
-    
                         this.align(elementMagnetCorner, contextMagnetCorner);
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * Aligns the Overlay to its context element using the specified corner 
         * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
@@ -3290,45 +3032,34 @@ version: 2.3.0
         * that the elementAlign corner should stick to.
         */
         align: function (elementAlign, contextAlign) {
-    
+
             var contextArgs = this.cfg.getProperty("context"),
                 me = this,
                 context,
                 element,
                 contextRegion;
-    
-    
+
             function doAlign(v, h) {
     
                 switch (elementAlign) {
     
                 case Overlay.TOP_LEFT:
-    
                     me.moveTo(h, v);
-    
                     break;
     
                 case Overlay.TOP_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), v);
-    
                     break;
     
                 case Overlay.BOTTOM_LEFT:
-    
                     me.moveTo(h, (v - element.offsetHeight));
-    
                     break;
     
                 case Overlay.BOTTOM_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), 
                         (v - element.offsetHeight));
-    
                     break;
-    
                 }
-    
             }
     
     
@@ -3339,47 +3070,33 @@ version: 2.3.0
                 me = this;
                 
                 if (! elementAlign) {
-    
                     elementAlign = contextArgs[1];
-    
                 }
                 
                 if (! contextAlign) {
-    
                     contextAlign = contextArgs[2];
-    
                 }
                 
                 if (element && context) {
-    
                     contextRegion = Dom.getRegion(context);
-                    
+
                     switch (contextAlign) {
     
                     case Overlay.TOP_LEFT:
-    
                         doAlign(contextRegion.top, contextRegion.left);
-    
                         break;
     
                     case Overlay.TOP_RIGHT:
-    
                         doAlign(contextRegion.top, contextRegion.right);
-    
                         break;
     
                     case Overlay.BOTTOM_LEFT:
-    
                         doAlign(contextRegion.bottom, contextRegion.left);
-    
                         break;
     
                     case Overlay.BOTTOM_RIGHT:
-    
                         doAlign(contextRegion.bottom, contextRegion.right);
-    
                         break;
-    
                     }
     
                 }
@@ -3387,7 +3104,7 @@ version: 2.3.0
             }
             
         },
-        
+
         /**
         * The default event handler executed when the moveEvent is fired, if the 
         * "constraintoviewport" is set to true.
@@ -3399,70 +3116,96 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         enforceConstraints: function (type, args, obj) {
-    
-            var pos = args[0],
-                x = pos[0],
-                y = pos[1],
-                offsetHeight = this.element.offsetHeight,
-                offsetWidth = this.element.offsetWidth,
+            var pos = args[0];
+            var cXY = this.getConstrainedXY(pos[0], pos[1]);
+            this.cfg.setProperty("x", cXY[0], true);
+            this.cfg.setProperty("y", cXY[1], true);
+            this.cfg.setProperty("xy", cXY, true);
+        },
+
+        /**
+         * Given x, y coordinate values, returns the calculated coordinates required to 
+         * position the Overlay if it is to be constrained to the viewport, based on the 
+         * current element size, viewport dimensions and scroll values.
+         *
+         * @param {Number} x The X coordinate value to be constrained
+         * @param {Number} y The Y coordinate value to be constrained
+         * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively;
+         */
+        getConstrainedXY: function(x, y) {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 viewPortWidth = Dom.getViewportWidth(),
                 viewPortHeight = Dom.getViewportHeight(),
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
                 scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-                topConstraint = scrollY + 10,
-                leftConstraint = scrollX + 10,
-                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
-                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-        
-    
-            if (x < leftConstraint) {
-    
-                x = leftConstraint;
-    
-            } else if (x > rightConstraint) {
-    
-                x = rightConstraint;
-    
+                scrollY = Dom.getDocumentScrollTop();
+
+            var xNew = x;
+            var yNew = y;
+
+            if (offsetWidth + nViewportOffset < viewPortWidth) {
+
+                var leftConstraint = scrollX + nViewportOffset;
+                var rightConstraint = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+
+                if (x < leftConstraint) {
+                    xNew = leftConstraint;
+                } else if (x > rightConstraint) {
+                    xNew = rightConstraint;
+                }
+            } else {
+                xNew = nViewportOffset + scrollX;
             }
-            
-            if (y < topConstraint) {
-    
-                y = topConstraint;
-    
-            } else if (y > bottomConstraint) {
-    
-                y = bottomConstraint;
-    
+
+            if (offsetHeight + nViewportOffset < viewPortHeight) {
+
+                var topConstraint = scrollY + nViewportOffset;
+                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+
+                if (y < topConstraint) {
+                    yNew  = topConstraint;
+                } else if (y  > bottomConstraint) {
+                    yNew  = bottomConstraint;
+                }
+            } else {
+                yNew = nViewportOffset + scrollY;
             }
-            
-            this.cfg.setProperty("x", x, true);
-            this.cfg.setProperty("y", y, true);
-            this.cfg.setProperty("xy", [x, y], true);
-    
+
+            return [xNew, yNew];
         },
-        
+
         /**
         * Centers the container in the viewport.
         * @method center
         */
         center: function () {
-    
-            var scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-    
-                viewPortWidth = Dom.getClientWidth(),
-                viewPortHeight = Dom.getClientHeight(),
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 elementWidth = this.element.offsetWidth,
                 elementHeight = this.element.offsetHeight,
-                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
-                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-            
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                x,
+                y;
+
+            if (elementWidth < viewPortWidth) {
+                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
+            } else {
+                x = nViewportOffset + Dom.getDocumentScrollLeft();
+            }
+
+            if (elementHeight < viewPortHeight) {
+                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
+            } else {
+                y = nViewportOffset + Dom.getDocumentScrollTop();
+            }
+
             this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
-            
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * Synchronizes the Panel's "xy", "x", and "y" properties with the 
         * Panel's position in the DOM. This is primarily used to update  
@@ -3470,15 +3213,15 @@ version: 2.3.0
         * @method syncPosition
         */
         syncPosition: function () {
-    
+
             var pos = Dom.getXY(this.element);
-    
+
             this.cfg.setProperty("x", pos[0], true);
             this.cfg.setProperty("y", pos[1], true);
             this.cfg.setProperty("xy", pos, true);
-    
+
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -3486,11 +3229,11 @@ version: 2.3.0
         * @param {Object} obj The scope object
         */
         onDomResize: function (e, obj) {
-    
+
             var me = this;
-    
+
             Overlay.superclass.onDomResize.call(this, e, obj);
-    
+
             setTimeout(function () {
                 me.syncPosition();
                 me.cfg.refireEvent("iframe");
@@ -3504,96 +3247,82 @@ version: 2.3.0
         * YAHOO.widget.Overlay.
         * @method bringToTop
         */
-        bringToTop: function() {
-    
+        bringToTop: function () {
+
             var aOverlays = [],
                 oElement = this.element;
-    
+
             function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
-        
+
                 var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
-        
                     sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
-        
-                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
-                        0 : parseInt(sZIndex1, 10),
-        
-                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
-                        0 : parseInt(sZIndex2, 10);
-        
+
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
+
                 if (nZIndex1 > nZIndex2) {
-        
                     return -1;
-        
                 } else if (nZIndex1 < nZIndex2) {
-        
                     return 1;
-        
                 } else {
-        
                     return 0;
-        
                 }
-        
             }
-        
+
             function isOverlayElement(p_oElement) {
-        
+
                 var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                     Panel = YAHOO.widget.Panel;
-            
+
                 if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
-                
                     if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
-        
-                        aOverlays[aOverlays.length] = p_oElement.parentNode;
-                    
-                    }
-                    else {
-        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    } else {
                         aOverlays[aOverlays.length] = p_oElement;
-        
                     }
-                
                 }
-            
             }
-            
+
             Dom.getElementsBy(isOverlayElement, "DIV", document.body);
-    
+
             aOverlays.sort(compareZIndexDesc);
-            
+
             var oTopOverlay = aOverlays[0],
                 nTopZIndex;
-            
+
             if (oTopOverlay) {
-    
                 nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
-    
-                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
-    
-                    this.cfg.setProperty("zindex", 
-                        (parseInt(nTopZIndex, 10) + 2));
-    
+
+                if (!isNaN(nTopZIndex)) {
+                    var bRequiresBump = false;
+
+                    if (oTopOverlay != oElement) {
+                        bRequiresBump = true;
+                    } else if (aOverlays.length > 1) {
+                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
+                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                            bRequiresBump = true;
+                        }
+                    }
+                    if (bRequiresBump) {
+                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                    }
                 }
-            
             }
-        
         },
-        
+
         /**
         * Removes the Overlay element from the DOM and sets all child 
         * elements to null.
         * @method destroy
         */
         destroy: function () {
-    
+
             if (this.iframe) {
-    
                 this.iframe.parentNode.removeChild(this.iframe);
-    
             }
-        
+
             this.iframe = null;
         
             Overlay.windowResizeEvent.unsubscribe(
@@ -3611,14 +3340,12 @@ version: 2.3.0
         * @return {String} The string representation of the Overlay.
         */
         toString: function () {
-    
             return "Overlay " + this.id;
-    
         }
-    
+
     });
-    
 }());
+
 (function () {
     
     /**
@@ -3634,19 +3361,15 @@ version: 2.3.0
     * configuration of the OverlayManager
     */
     YAHOO.widget.OverlayManager = function (userConfig) {
-    
         this.init(userConfig);
-    
     };
 
-
     var Overlay = YAHOO.widget.Overlay,
         Event = YAHOO.util.Event,
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         CustomEvent = YAHOO.util.CustomEvent,
         OverlayManager = YAHOO.widget.OverlayManager;
-
     
     /**
     * The CSS class representing a focused Overlay
@@ -3695,9 +3418,9 @@ version: 2.3.0
             * @default "mousedown"
             */
             this.cfg.addProperty("focusevent", { value: "mousedown" } );
-        
+
         },
-        
+
         /**
         * Initializes the OverlayManager
         * @method init
@@ -3715,14 +3438,14 @@ version: 2.3.0
             * @type Config
             */
             this.cfg = new Config(this);
-        
+
             this.initDefaultConfig();
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
             this.cfg.fireQueue();
-        
+
             /**
             * The currently activated Overlay
             * @property activeOverlay
@@ -3730,7 +3453,7 @@ version: 2.3.0
             * @type YAHOO.widget.Overlay
             */
             var activeOverlay = null;
-        
+
             /**
             * Returns the currently focused Overlay
             * @method getActive
@@ -3739,7 +3462,7 @@ version: 2.3.0
             this.getActive = function () {
                 return activeOverlay;
             };
-        
+
             /**
             * Focuses the specified Overlay
             * @method focus
@@ -3747,32 +3470,22 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to focus
             */
             this.focus = function (overlay) {
-        
                 var o = this.find(overlay);
-        
                 if (o) {
-        
                     if (activeOverlay != o) {
-        
                         if (activeOverlay) {
-        
                             activeOverlay.blur();
-        
                         }
-        
                         this.bringToTop(o);
-                        
+
                         activeOverlay = o;
-        
+
                         Dom.addClass(activeOverlay.element, 
                             OverlayManager.CSS_FOCUSED);
 
                         o.focusEvent.fire();
-                        
                     }
-        
                 }
-        
             };
         
             /**
@@ -3782,53 +3495,47 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to remove
             */
             this.remove = function (overlay) {
-    
-                var o = this.find(overlay),
-                    originalZ;
-        
+                var o = this.find(overlay), 
+                        originalZ;
                 if (o) {
-
                     if (activeOverlay == o) {
-                    
                         activeOverlay = null;
-                    
                     }
 
-                    originalZ = Dom.getStyle(o.element, "zIndex");
+                    var bDestroyed = (o.element === null && o.cfg === null) ? true : false;
 
-                    o.cfg.setProperty("zIndex", -1000, true);
+                    if (!bDestroyed) {
+                        // Set it's zindex so that it's sorted to the end.
+                        originalZ = Dom.getStyle(o.element, "zIndex");
+                        o.cfg.setProperty("zIndex", -1000, true);
+                    }
 
                     this.overlays.sort(this.compareZIndexDesc);
+                    this.overlays = this.overlays.slice(0, (this.overlays.length - 1));
 
-                    this.overlays = 
-                        this.overlays.slice(0, (this.overlays.length - 1));
-        
                     o.hideEvent.unsubscribe(o.blur);
                     o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
-        
-                    if (o.element) {
-        
+
+                    if (!bDestroyed) {
                         Event.removeListener(o.element, 
-                            this.cfg.getProperty("focusevent"), 
-                            this._onOverlayElementFocus);
-        
+                                    this.cfg.getProperty("focusevent"), 
+                                    this._onOverlayElementFocus);
+
+                        o.cfg.setProperty("zIndex", originalZ, true);
+                        o.cfg.setProperty("manager", null);
                     }
-        
-                    o.cfg.setProperty("zIndex", originalZ, true);
-                    o.cfg.setProperty("manager", null);
-        
+
                     o.focusEvent.unsubscribeAll();
                     o.blurEvent.unsubscribeAll();
-        
+
                     o.focusEvent = null;
                     o.blurEvent = null;
-        
+
                     o.focus = null;
                     o.blur = null;
                 }
-
             };
-        
+
             /**
             * Removes focus from all registered Overlays in the manager
             * @method blurAll
@@ -3839,28 +3546,19 @@ version: 2.3.0
                     i;
 
                 if (nOverlays > 0) {
-
                     i = nOverlays - 1;
-                    
-                    do {
 
-                        this.overlays[i].blur();                    
-                    
+                    do {
+                        this.overlays[i].blur();
                     }
                     while(i--);
-                
                 }
-    
             };
         
-        
             this._onOverlayBlur = function (p_sType, p_aArgs) {
-
                 activeOverlay = null;
-
             };
         
-        
             var overlays = this.cfg.getProperty("overlays");
         
             if (! this.overlays) {
@@ -3887,20 +3585,12 @@ version: 2.3.0
         
             var oTarget = Event.getTarget(p_oEvent),
                 oClose = this.close;
-        
-            
-            if (oClose && (oTarget == oClose || 
-                    Dom.isAncestor(oClose, oTarget))) {
             
+            if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) {
                 this.blur();
-            
-            }
-            else {
-            
+            } else {
                 this.focus();
-            
             }
-        
         },
         
         
@@ -3916,9 +3606,7 @@ version: 2.3.0
         * fired the event.
         */
         _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
-        
             this.remove(p_oOverlay);
-        
         },
         
         /**
@@ -3942,10 +3630,10 @@ version: 2.3.0
             if (overlay instanceof Overlay) {
 
                 overlay.cfg.addProperty("manager", { value: this } );
-        
+
                 overlay.focusEvent = overlay.createEvent("focus");
                 overlay.focusEvent.signature = CustomEvent.LIST;
-        
+
                 overlay.blurEvent = overlay.createEvent("blur");
                 overlay.blurEvent.signature = CustomEvent.LIST;
         
@@ -3954,43 +3642,29 @@ version: 2.3.0
                 };
         
                 overlay.blur = function () {
-    
                     if (mgr.getActive() == this) {
-
-                        Dom.removeClass(this.element, 
-                            OverlayManager.CSS_FOCUSED);
-
+                        Dom.removeClass(this.element, OverlayManager.CSS_FOCUSED);
                         this.blurEvent.fire();
-
                     }
-
                 };
         
                 overlay.blurEvent.subscribe(mgr._onOverlayBlur);
-        
                 overlay.hideEvent.subscribe(overlay.blur);
                 
-                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
-                    overlay, this);
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, overlay, this);
         
                 Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
-                    this._onOverlayElementFocus, null, overlay);
+                            this._onOverlayElementFocus, null, overlay);
         
                 zIndex = Dom.getStyle(overlay.element, "zIndex");
 
                 if (!isNaN(zIndex)) {
-
                     overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
-
                 } else {
-
                     overlay.cfg.setProperty("zIndex", 0);
-
                 }
-        
 
                 this.overlays.push(overlay);
-
                 this.bringToTop(overlay);
 
                 return true;
@@ -4001,26 +3675,17 @@ version: 2.3.0
                 nOverlays = overlay.length;
 
                 for (i = 0; i < nOverlays; i++) {
-
                     if (this.register(overlay[i])) {
-
                         regcount++;
-
                     }
                 }
 
                 if (regcount > 0) {
-
                     return true;
-
                 }
-
             } else {
-
                 return false;
-
             }
-
         },
 
         /**
@@ -4042,30 +3707,36 @@ version: 2.3.0
             if (oOverlay) {
 
                 aOverlays = this.overlays;
-
                 aOverlays.sort(this.compareZIndexDesc);
-                
+
                 oTopOverlay = aOverlays[0];
-                
-                if (oTopOverlay) {
 
+                if (oTopOverlay) {
                     nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
-    
-                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
-    
-                        oOverlay.cfg.setProperty("zIndex", 
-                            (parseInt(nTopZIndex, 10) + 2));
-    
+
+                    if (!isNaN(nTopZIndex)) {
+
+                        var bRequiresBump = false;
+
+                        if (oTopOverlay !== oOverlay) {
+                            bRequiresBump = true;
+                        } else if (aOverlays.length > 1) {
+                            var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex");
+                            // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                            if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                                bRequiresBump = true;
+                            }
+                        }
+
+                        if (bRequiresBump) {
+                            oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                        }
                     }
-    
                     aOverlays.sort(this.compareZIndexDesc);
-                
                 }
-
             }
-        
         },
-        
+
         /**
         * Attempts to locate an Overlay by instance or ID.
         * @method find
@@ -4075,47 +3746,32 @@ version: 2.3.0
         * cannot be located.
         */
         find: function (overlay) {
-        
+
             var aOverlays = this.overlays,
                 nOverlays = aOverlays.length,
                 i;
 
             if (nOverlays > 0) {
-
                 i = nOverlays - 1;
 
                 if (overlay instanceof Overlay) {
-
                     do {
-
                         if (aOverlays[i] == overlay) {
-
                             return aOverlays[i];
-
                         }
-                    
                     }
                     while(i--);
 
                 } else if (typeof overlay == "string") {
-
                     do {
-
                         if (aOverlays[i].id == overlay) {
-
                             return aOverlays[i];
-
                         }
-
                     }
                     while(i--);
-
                 }
-
                 return null;
-            
             }
-
         },
         
         /**
@@ -4126,11 +3782,17 @@ version: 2.3.0
         * fall in the stacking order.
         */
         compareZIndexDesc: function (o1, o2) {
-    
-            var zIndex1 = o1.cfg.getProperty("zIndex"),
-                zIndex2 = o2.cfg.getProperty("zIndex");
-        
-            if (zIndex1 > zIndex2) {
+
+            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
+                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.
+
+            if (zIndex1 === null && zIndex2 === null) {
+                return 0;
+            } else if (zIndex1 === null){
+                return 1;
+            } else if (zIndex2 === null) {
+                return -1;
+            } else if (zIndex1 > zIndex2) {
                 return -1;
             } else if (zIndex1 < zIndex2) {
                 return 1;
@@ -4150,20 +3812,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].show();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Hides all Overlays in the manager.
         * @method hideAll
@@ -4175,20 +3831,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].hide();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Returns a string representation of the object.
         * @method toString
@@ -4197,10 +3847,10 @@ version: 2.3.0
         toString: function () {
             return "OverlayManager";
         }
-    
     };
 
 }());
+
 (function () {
 
     /**
@@ -4286,67 +3936,69 @@ version: 2.3.0
     * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
     */
     ContainerEffect.FADE = function (overlay, dur) {
-    
-        var fade = new ContainerEffect(overlay, 
-        
-            { attributes: { opacity: { from: 0, to: 1 } }, 
-                duration: dur, 
-                method: Easing.easeIn }, 
-            
-            { attributes: { opacity: { to: 0 } },
-                duration: dur, 
-                method: Easing.easeOut }, 
-            
-            overlay.element);
-        
-    
+
+        var fin = {
+            attributes: {opacity:{from:0, to:1}},
+            duration: dur,
+            method: Easing.easeIn
+        };
+
+        var fout = {
+            attributes: {opacity:{to:0}},
+            duration: dur,
+            method: Easing.easeOut
+        };
+
+        var fade = new ContainerEffect(overlay, fin, fout, overlay.element);
+
+        fade.handleUnderlayStart = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                var hasFilters = (underlay.filters && underlay.filters.length > 0);
+                if(hasFilters) {
+                    Dom.addClass(overlay.element, "yui-effect-fade");
+                }
+            }
+        };
+
+        fade.handleUnderlayComplete = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                Dom.removeClass(overlay.element, "yui-effect-fade");
+            }
+        };
+
         fade.handleStartAnimateIn = function (type,args,obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (! obj.overlay.underlay) {
+
+            if (!obj.overlay.underlay) {
                 obj.overlay.cfg.refireEvent("underlay");
             }
-        
-            if (obj.overlay.underlay) {
-    
-                obj.initialUnderlayOpacity = 
-                    Dom.getStyle(obj.overlay.underlay, "opacity");
-    
-                obj.overlay.underlay.style.filter = null;
-    
-            }
-        
+
+            obj.handleUnderlayStart();
+
             Dom.setStyle(obj.overlay.element, "visibility", "visible");
             Dom.setStyle(obj.overlay.element, "opacity", 0);
         };
-        
-    
+
         fade.handleCompleteAnimateIn = function (type,args,obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
-        
+
             if (obj.overlay.element.style.filter) {
                 obj.overlay.element.style.filter = null;
             }
-        
-            if (obj.overlay.underlay) {
-                Dom.setStyle(obj.overlay.underlay, "opacity", 
-                    obj.initialUnderlayOpacity);
-            }
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
             obj.animateInCompleteEvent.fire();
         };
-        
-    
+
         fade.handleStartAnimateOut = function (type, args, obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (obj.overlay.underlay) {
-                obj.overlay.underlay.style.filter = null;
-            }
+            obj.handleUnderlayStart();
         };
-        
-    
+
         fade.handleCompleteAnimateOut =  function (type, args, obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
             if (obj.overlay.element.style.filter) {
@@ -4354,12 +4006,13 @@ version: 2.3.0
             }
             Dom.setStyle(obj.overlay.element, "visibility", "hidden");
             Dom.setStyle(obj.overlay.element, "opacity", 1);
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
-        
             obj.animateOutCompleteEvent.fire();
         };
-        
+
         fade.init();
         return fade;
     };
@@ -4431,11 +4084,9 @@ version: 2.3.0
     
             var vw = Dom.getViewportWidth(),
                 pos = Dom.getXY(obj.overlay.element),
-                yso = pos[1],
-                currentTo = obj.animOut.attributes.points.to;
+                yso = pos[1];
     
             obj.animOut.attributes.points.to = [(vw + 25), yso];
-    
         };
         
         slide.handleTweenAnimateOut = function (type, args, obj) {
@@ -4591,4 +4242,5 @@ version: 2.3.0
     YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
 
 })();
-YAHOO.register("container_core", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
+
+YAHOO.register("containercore", YAHOO.widget.Module, {version: "2.5.0", build: "895"});
index 1151f46b0a74d8658644177d8cf0d790ffcf6586..a4c922b9e4ed9a73f5eedc79b10b0bfbcd921ad4 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
-if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
-this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
-return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
-return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
-foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
-if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
-if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
-return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oValue,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}
-this.initialConfig=oConfig;}
-for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
-this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
-return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
-return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
-return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
-this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
-while(i--);}
-return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.textResizeEvent=new CustomEvent("textResize");function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=("<div class=\""+
-Module.CSS_HEADER+"\"></div>"+"<div class=\""+
-Module.CSS_BODY+"\"></div><div class=\""+
-Module.CSS_FOOTER+"\"></div>");m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}
-return m_oModuleTemplate;}
-function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}
-return(m_oHeaderTemplate.cloneNode(false));}
-function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}
-return(m_oBodyTemplate.cloneNode(false));}
-function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}
-return(m_oFooterTemplate.cloneNode(false));}
-Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTORY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});},init:function(el,userConfig){var elId,i,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}
-if(typeof el=="string"){elId=el;el=document.getElementById(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}
-this.element=el;if(el.id){this.id=el.id;}
-child=this.element.firstChild;if(child){do{switch(child.className){case Module.CSS_HEADER:this.header=child;break;case Module.CSS_BODY:this.body=child;break;case Module.CSS_FOOTER:this.footer=child;break;}}while((child=child.nextSibling));}
-this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
-this.initEvent.fire(Module);},initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}
-if(!YAHOO.env.ua.opera){oIFrame=Dom.get("_yuiResizeMonitor");if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}
-if(YAHOO.env.ua.gecko){sHTML="<html><head><script "+"type=\"text/javascript\">"+"window.onresize=function(){window.parent."+"YAHOO.widget.Module.textResizeEvent."+"fire();};window.parent.YAHOO.widget.Module."+"textResizeEvent.fire();</script></head>"+"<body></body></html>";oIFrame.src="data:text/html;charset=utf-8,"+
-encodeURIComponent(sHTML);}
-oIFrame.id="_yuiResizeMonitor";oIFrame.style.position="absolute";oIFrame.style.visibility="hidden";document.body.appendChild(oIFrame);oIFrame.style.width="10em";oIFrame.style.height="10em";oIFrame.style.top=(-1*oIFrame.offsetHeight)+"px";oIFrame.style.left=(-1*oIFrame.offsetWidth)+"px";oIFrame.style.borderWidth="0";oIFrame.style.visibility="visible";if(YAHOO.env.ua.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}
-if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}
-Module.textResizeInitialized=true;}
-this.resizeMonitor=oIFrame;}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(typeof headerContent=="string"){oHeader.innerHTML=headerContent;}else{oHeader.innerHTML="";oHeader.appendChild(headerContent);}
-this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(typeof bodyContent=="string"){oBody.innerHTML=bodyContent;}else{oBody.innerHTML="";oBody.appendChild(bodyContent);}
-this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(typeof footerContent=="string"){oFooter.innerHTML=footerContent;}else{oFooter.innerHTML="";oFooter.appendChild(footerContent);}
-this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this,firstChild;function appendTo(element){if(typeof element=="string"){element=document.getElementById(element);}
-if(element){element.appendChild(me.element);me.appendEvent.fire();}}
-this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
-if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}
-if(this.header&&!Dom.inDocument(this.header)){firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
-if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
-if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
-this.renderEvent.fire();return true;},destroy:function(){var parent,e;if(this.element){Event.purgeElement(this.element,true);parent=this.element.parentNode;}
-if(parent){parent.removeChild(this.element);}
-this.element=null;this.header=null;this.body=null;this.footer=null;Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(e in this){if(e instanceof CustomEvent){e.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Overlay=YAHOO.widget.Overlay,m_oIFrameTemplate,EVENT_TYPES={"BEFORE_MOVE":"beforeMove","MOVE":"move"},DEFAULT_CONFIG={"X":{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:Lang.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.CSS_OVERLAY="yui-overlay";Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
-clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}};Overlay.windowResizeHandler=function(e){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
-clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}
-YAHOO.extend(Overlay,Module,{init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
-if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
-this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.removeClass(this.element,"show-scrollbars");Dom.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.removeClass(this.element,"hide-scrollbars");Dom.addClass(this.element,"show-scrollbars");},configVisible:function(type,args,obj){var visible=args[0],currentVis=Dom.getStyle(this.element,"visibility"),effect=this.cfg.getProperty("effect"),effectInstances=[],isMacGecko=(this.platform=="mac"&&YAHOO.env.ua.gecko),alreadySubscribed=Config.alreadySubscribed,eff,ei,e,i,j,k,h,nEffects,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
-e=e.parentNode;}
-if(currentVis=="inherit"){currentVis="visible";}}
-if(effect){if(effect instanceof Array){nEffects=effect.length;for(i=0;i<nEffects;i++){eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
-if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
-if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();nEffectInstances=effectInstances.length;for(j=0;j<nEffectInstances;j++){ei=effectInstances[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
-ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
-if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();nEffectInstances=effectInstances.length;for(k=0;k<nEffectInstances;k++){h=effectInstances[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
-h.animateOut();}}else if(currentVis===""){Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();Dom.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
-if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
-if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.element;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
-if(this.iframe){if(zIndex<=0){zIndex=1;}
-Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
-Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){oParentNode.appendChild(oIFrame);}
-oIFrame.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){oIFrame.style.width=(oElement.offsetWidth+nDimensionOffset+"px");oIFrame.style.height=(oElement.offsetHeight+nDimensionOffset+"px");aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}
-Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent,aXY;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}
-if(YAHOO.env.ua.ie){m_oIFrameTemplate.style.filter="alpha(opacity=0)";m_oIFrameTemplate.frameBorder=0;}
-else{m_oIFrameTemplate.style.opacity="0";}
-m_oIFrameTemplate.style.position="absolute";m_oIFrameTemplate.style.border="none";m_oIFrameTemplate.style.margin="0";m_oIFrameTemplate.style.padding="0";m_oIFrameTemplate.style.display="none";}
-oIFrame=m_oIFrameTemplate.cloneNode(false);oParent=oElement.parentNode;if(oParent){oParent.appendChild(oIFrame);}else{document.body.appendChild(oIFrame);}
-this.iframe=oIFrame;}
-this.showIframe();this.syncIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
-function onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}
-if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}
-else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
-if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}},align:function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){switch(elementAlign){case Overlay.TOP_LEFT:me.moveTo(h,v);break;case Overlay.TOP_RIGHT:me.moveTo((h-element.offsetWidth),v);break;case Overlay.BOTTOM_LEFT:me.moveTo(h,(v-element.offsetHeight));break;case Overlay.BOTTOM_RIGHT:me.moveTo((h-element.offsetWidth),(v-element.offsetHeight));break;}}
-if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}
-if(!contextAlign){contextAlign=contextArgs[2];}
-if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
-if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);},center:function(){var scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),viewPortWidth=Dom.getClientWidth(),viewPortHeight=Dom.getClientHeight(),elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,x=(viewPortWidth/2)-(elementWidth/2)+scrollX,y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=Dom.getStyle(p_oOverlay1,"zIndex"),sZIndex2=Dom.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return-1;}else if(nZIndex1<nZIndex2){return 1;}else{return 0;}}
-function isOverlayElement(p_oElement){var oOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(oOverlay&&!Dom.isAncestor(oElement,oOverlay)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}
-else{aOverlays[aOverlays.length]=p_oElement;}}}
-Dom.getElementsBy(isOverlayElement,"DIV",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oElement){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
-this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
-this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();}
-this.bringToTop(o);activeOverlay=o;Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}
-originalZ=Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);}
-o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}
-while(i--);}};this._onOverlayBlur=function(p_sType,p_aArgs){activeOverlay=null;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
-if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}
-else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},register:function(overlay){var mgr=this,zIndex,regcount,i,nOverlays;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focus=function(){mgr.focus(this);};overlay.blur=function(){if(mgr.getActive()==this){Dom.removeClass(this.element,OverlayManager.CSS_FOCUSED);this.blurEvent.fire();}};overlay.blurEvent.subscribe(mgr._onOverlayBlur);overlay.hideEvent.subscribe(overlay.blur);overlay.destroyEvent.subscribe(this._onOverlayDestroy,overlay,this);Event.on(overlay.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,overlay);zIndex=Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
-this.overlays.push(overlay);this.bringToTop(overlay);return true;}else if(overlay instanceof Array){regcount=0;nOverlays=overlay.length;for(i=0;i<nOverlays;i++){if(this.register(overlay[i])){regcount++;}}
-if(regcount>0){return true;}}else{return false;}},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oOverlay){oOverlay.cfg.setProperty("zIndex",(parseInt(nTopZIndex,10)+2));}
-aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;if(overlay instanceof Overlay){do{if(aOverlays[i]==overlay){return aOverlays[i];}}
-while(i--);}else if(typeof overlay=="string"){do{if(aOverlays[i].id==overlay){return aOverlays[i];}}
-while(i--);}
-return null;}},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex"),zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].show();}
-while(i--);}},hideAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].hide();}
-while(i--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
-this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,Easing=YAHOO.util.Easing,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var fade=new ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
-if(obj.overlay.underlay){obj.initialUnderlayOpacity=Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
-Dom.setStyle(obj.overlay.element,"visibility","visible");Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
-if(obj.overlay.underlay){Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
-obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
-Dom.setStyle(obj.overlay.element,"visibility","hidden");Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,slide=new ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=((-25)-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if(Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){Dom.setStyle(obj.overlay.element,"visibility","visible");}
-obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1],currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
-return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container_core",YAHOO.widget.Module,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=("<div class=\""+G.CSS_HEADER+"\"></div><div class=\""+G.CSS_BODY+"\"></div><div class=\""+G.CSS_FOOTER+"\"></div>");O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);
+this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}this.element=U;if(U.id){this.id=U.id;}V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}if(!U){T=["<html><head><script ","type=\"text/javascript\">","window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}R.id="_yuiResizeMonitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}G.textResizeInitialized=true;}this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.tagName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);
+}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;
+if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);T=S.parentNode;var Q=T||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];
+K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(L,K,M){var O=K[0];var N=this.getConstrainedXY(O[0],O[1]);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},getConstrainedXY:function(V,T){var N=B.VIEWPORT_OFFSET,U=D.getViewportWidth(),Q=D.getViewportHeight(),M=this.element.offsetHeight,S=this.element.offsetWidth,Y=D.getDocumentScrollLeft(),W=D.getDocumentScrollTop();var P=V;var L=T;if(S+N<U){var R=Y+N;var X=Y+U-S-N;if(V<R){P=R;}else{if(V>X){P=X;}}}else{P=N+Y;}if(M+N<Q){var O=W+N;var K=W+Q-M-N;if(T<O){L=O;}else{if(T>K){L=K;}}}else{L=N+W;}return[P,L];},center:function(){var N=B.VIEWPORT_OFFSET,O=this.element.offsetWidth,M=this.element.offsetHeight,L=D.getViewportWidth(),P=D.getViewportHeight(),K,Q;if(O<L){K=(L/2)-(O/2)+D.getDocumentScrollLeft();}else{K=N+D.getDocumentScrollLeft();}if(M<P){Q=(P/2)-(M/2)+D.getDocumentScrollTop();}else{Q=N+D.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(K,10),parseInt(Q,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var O=[],N=this.element;function R(V,U){var X=D.getStyle(V,"zIndex"),W=D.getStyle(U,"zIndex"),T=(!X||isNaN(X))?0:parseInt(X,10),S=(!W||isNaN(W))?0:parseInt(W,10);if(T>S){return -1;}else{if(T<S){return 1;}else{return 0;}}}function M(U){var S=D.hasClass(U,B.CSS_OVERLAY),T=YAHOO.widget.Panel;if(S&&!D.isAncestor(N,S)){if(T&&D.hasClass(U,T.CSS_PANEL)){O[O.length]=U.parentNode;}else{O[O.length]=U;}}}D.getElementsBy(M,"DIV",document.body);O.sort(R);var K=O[0],Q;if(K){Q=D.getStyle(K,"zIndex");if(!isNaN(Q)){var P=false;if(K!=N){P=true;}else{if(O.length>1){var L=D.getStyle(O[1],"zIndex");if(!isNaN(L)&&(Q==L)){P=true;}}}if(P){this.cfg.setProperty("zindex",(parseInt(Q,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");
+if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,G){var I={attributes:{opacity:{from:0,to:1}},duration:G,method:C.easeIn};var F={attributes:{opacity:{to:0}},duration:G,method:C.easeOut};var H=new A(E,I,F,E.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(E.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(E.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(M,L,P){var N=B.getViewportWidth(),Q=B.getXY(P.overlay.element),O=Q[1];P.animOut.attributes.points.to=[(N+25),O];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("containercore",YAHOO.widget.Module,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 47d32703adfe8932a535e2a9679aaadd0b9de14d..be4c1bb612752c57fde1f58a35ee7eb542034a61 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function () {
 
@@ -18,25 +18,19 @@ version: 2.3.0
     * @param {Object} owner The owner Object to which this Config Object belongs
     */
     YAHOO.util.Config = function (owner) {
-    
+
         if (owner) {
-    
             this.init(owner);
-    
-        }
-    
-        if (!owner) { 
-        
-    
         }
-    
+
+
     };
 
 
     var Lang = YAHOO.lang,
-        CustomEvent = YAHOO.util.CustomEvent,        
+        CustomEvent = YAHOO.util.CustomEvent,
         Config = YAHOO.util.Config;
-    
+
 
     /**
      * Constant representing the CustomEvent type for the config changed event.
@@ -353,7 +347,7 @@ version: 2.3.0
                         if (queueItem) {
                             queueItemKey = queueItem[0];
                             queueItemValue = queueItem[1];
-                            
+
                             if (queueItemKey == key) {
     
                                 /*
@@ -381,37 +375,37 @@ version: 2.3.0
                 }
         
                 if (property.supercedes) {
-        
+
                     sLen = property.supercedes.length;
-        
+
                     for (s = 0; s < sLen; s++) {
-        
+
                         supercedesCheck = property.supercedes[s];
                         qLen = this.eventQueue.length;
-        
+
                         for (q = 0; q < qLen; q++) {
                             queueItemCheck = this.eventQueue[q];
-        
+
                             if (queueItemCheck) {
                                 queueItemCheckKey = queueItemCheck[0];
                                 queueItemCheckValue = queueItemCheck[1];
-                                
+
                                 if (queueItemCheckKey == 
                                     supercedesCheck.toLowerCase() ) {
-    
+
                                     this.eventQueue.push([queueItemCheckKey, 
                                         queueItemCheckValue]);
-    
+
                                     this.eventQueue[q] = null;
                                     break;
-    
+
                                 }
                             }
                         }
                     }
                 }
 
-        
+
                 return true;
             } else {
                 return false;
@@ -460,37 +454,23 @@ version: 2.3.0
         applyConfig: function (userConfig, init) {
         
             var sKey,
-                oValue,
                 oConfig;
 
             if (init) {
-
                 oConfig = {};
-
                 for (sKey in userConfig) {
-                
                     if (Lang.hasOwnProperty(userConfig, sKey)) {
-
                         oConfig[sKey.toLowerCase()] = userConfig[sKey];
-
                     }
-                
                 }
-
                 this.initialConfig = oConfig;
-
             }
 
             for (sKey in userConfig) {
-            
                 if (Lang.hasOwnProperty(userConfig, sKey)) {
-            
                     this.queueProperty(sKey, userConfig[sKey]);
-                
                 }
-
             }
-
         },
         
         /**
@@ -557,19 +537,12 @@ version: 2.3.0
             var property = this.config[key.toLowerCase()];
     
             if (property && property.event) {
-    
                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
-    
                     property.event.subscribe(handler, obj, override);
-    
                 }
-    
                 return true;
-    
             } else {
-    
                 return false;
-    
             }
     
         },
@@ -689,31 +662,24 @@ version: 2.3.0
             i;
 
         if (nSubscribers > 0) {
-
             i = nSubscribers - 1;
-        
             do {
-
                 subsc = evt.subscribers[i];
-
                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
-        
                     return true;
-        
-                }    
-            
+                }
             }
             while (i--);
-        
         }
-    
+
         return false;
-    
+
     };
-    
+
     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -746,25 +712,18 @@ version: 2.3.0
     * documentation for more details.
     */
     YAHOO.widget.Module = function (el, userConfig) {
-    
         if (el) {
-    
             this.init(el, userConfig);
-    
         } else {
-    
-    
         }
-    
     };
 
-
     var Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Event = YAHOO.util.Event,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
-        
+
         m_oModuleTemplate,
         m_oHeaderTemplate,
         m_oBodyTemplate,
@@ -816,14 +775,17 @@ version: 2.3.0
                 suppressEvent: true, 
                 supercedes: ["visible"] 
             },
-        
+
             "MONITOR_RESIZE": { 
                 key: "monitorresize", 
                 value: true  
+            },
+
+            "APPEND_TO_DOCUMENT_BODY": { 
+                key: "appendtodocumentbody", 
+                value: false
             }
-        
         };
-
     
     /**
     * Constant representing the prefix path to use for non-secure images
@@ -897,11 +859,9 @@ version: 2.3.0
     */
     Module.textResizeEvent = new CustomEvent("textResize");
 
-
     function createModuleTemplate() {
 
         if (!m_oModuleTemplate) {
-
             m_oModuleTemplate = document.createElement("div");
             
             m_oModuleTemplate.innerHTML = ("<div class=\"" + 
@@ -912,55 +872,34 @@ version: 2.3.0
             m_oHeaderTemplate = m_oModuleTemplate.firstChild;
             m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
             m_oFooterTemplate = m_oBodyTemplate.nextSibling;
-
         }
 
         return m_oModuleTemplate;
-
     }
 
-
     function createHeader() {
-
         if (!m_oHeaderTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oHeaderTemplate.cloneNode(false));
-
     }
-    
 
     function createBody() {
-
         if (!m_oBodyTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oBodyTemplate.cloneNode(false));
-    
     }
-    
 
     function createFooter() {
-
         if (!m_oFooterTemplate) {
-        
             createModuleTemplate();
-        
         }
-        
         return (m_oFooterTemplate.cloneNode(false));
-
     }
-    
 
     Module.prototype = {
-    
+
         /**
         * The class's constructor function
         * @property contructor
@@ -974,35 +913,35 @@ version: 2.3.0
         * @type HTMLElement
         */
         element: null,
-        
+
         /**
         * The header element, denoted with CSS class "hd"
         * @property header
         * @type HTMLElement
         */
         header: null,
-        
+
         /**
         * The body element, denoted with CSS class "bd"
         * @property body
         * @type HTMLElement
         */
         body: null,
-        
+
         /**
         * The footer element, denoted with CSS class "ft"
         * @property footer
         * @type HTMLElement
         */
         footer: null,
-        
+
         /**
         * The id of the element
         * @property id
         * @type String
         */
         id: null,
-        
+
         /**
         * A string representing the root path for all images created by
         * a Module instance.
@@ -1012,16 +951,16 @@ version: 2.3.0
         * @type String
         */
         imageRoot: Module.IMG_ROOT,
-    
+
         /**
         * Initializes the custom events for Module which are fired 
         * automatically at appropriate times by the Module class.
         * @method initEvents
         */
         initEvents: function () {
-        
+
             var SIGNATURE = CustomEvent.LIST;
-        
+
             /**
             * CustomEvent fired prior to class initalization.
             * @event beforeInitEvent
@@ -1030,7 +969,7 @@ version: 2.3.0
             */
             this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
             this.beforeInitEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after class initalization.
             * @event initEvent
@@ -1039,20 +978,19 @@ version: 2.3.0
             */  
             this.initEvent = this.createEvent(EVENT_TYPES.INIT);
             this.initEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is appended to the DOM
             * @event appendEvent
             */
             this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
             this.appendEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is rendered
             * @event beforeRenderEvent
             */
-            this.beforeRenderEvent = 
-                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER);
             this.beforeRenderEvent.signature = SIGNATURE;
         
             /**
@@ -1069,8 +1007,7 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new header content
             */
-            this.changeHeaderEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER);
             this.changeHeaderEvent.signature = SIGNATURE;
             
             /**
@@ -1089,46 +1026,44 @@ version: 2.3.0
             * @param {String/HTMLElement} content String/element representing 
             * the new footer content
             */
-            this.changeFooterEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
             this.changeFooterEvent.signature = SIGNATURE;
         
             /**
             * CustomEvent fired when the content of the Module is modified
             * @event changeContentEvent
             */
-            this.changeContentEvent = 
-                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
             this.changeContentEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired when the Module is destroyed
             * @event destroyEvent
             */
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
             this.destroyEvent.signature = SIGNATURE;
-            
+
             /**
             * CustomEvent fired before the Module is shown
             * @event beforeShowEvent
             */
             this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
             this.beforeShowEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is shown
             * @event showEvent
             */
             this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
             this.showEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired before the Module is hidden
             * @event beforeHideEvent
             */
             this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
             this.beforeHideEvent.signature = SIGNATURE;
-        
+
             /**
             * CustomEvent fired after the Module is hidden
             * @event hideEvent
@@ -1136,30 +1071,22 @@ version: 2.3.0
             this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
             this.hideEvent.signature = SIGNATURE;
         }, 
-        
+
         /**
         * String representing the current user-agent platform
         * @property platform
         * @type String
         */
         platform: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-        
+
             if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-        
                 return "windows";
-        
             } else if (ua.indexOf("macintosh") != -1) {
-        
                 return "mac";
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1169,40 +1096,24 @@ version: 2.3.0
         * @type String
         */
         browser: function () {
-        
             var ua = navigator.userAgent.toLowerCase();
-            
             /*
                  Check Opera first in case of spoof and check Safari before
                  Gecko since Safari's user agent string includes "like Gecko"
             */
-
             if (ua.indexOf('opera') != -1) { 
-            
                 return 'opera';
-            
             } else if (ua.indexOf('msie 7') != -1) {
-            
                 return 'ie7';
-            
             } else if (ua.indexOf('msie') != -1) {
-            
                 return 'ie';
-            
             } else if (ua.indexOf('safari') != -1) { 
-            
                 return 'safari';
-            
             } else if (ua.indexOf('gecko') != -1) {
-            
                 return 'gecko';
-            
             } else {
-            
                 return false;
-            
             }
-        
         }(),
         
         /**
@@ -1212,17 +1123,11 @@ version: 2.3.0
         * @type Boolean
         */
         isSecure: function () {
-        
             if (window.location.href.toLowerCase().indexOf("https") === 0) {
-        
                 return true;
-        
             } else {
-        
                 return false;
-        
             }
-        
         }(),
         
         /**
@@ -1230,9 +1135,7 @@ version: 2.3.0
         * automatically at appropriate times by the Module class.
         */
         initDefaultConfig: function () {
-    
             // Add properties //
-        
             /**
             * Specifies whether the Module is visible on the page.
             * @config visible
@@ -1244,7 +1147,7 @@ version: 2.3.0
                 value: DEFAULT_CONFIG.VISIBLE.value, 
                 validator: DEFAULT_CONFIG.VISIBLE.validator
             });
-            
+
             /**
             * Object or array of objects representing the ContainerEffect 
             * classes that are active for animating the container.
@@ -1256,7 +1159,7 @@ version: 2.3.0
                 suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.EFFECT.supercedes
             });
-            
+
             /**
             * Specifies whether to create a special proxy iframe to monitor 
             * for user font resizing in the document
@@ -1268,9 +1171,26 @@ version: 2.3.0
                 handler: this.configMonitorResize,
                 value: DEFAULT_CONFIG.MONITOR_RESIZE.value
             });
-            
+
+            /**
+            * Specifies if the module should be rendered as the first child 
+            * of document.body or appended as the last child when render is called
+            * with document.body as the "appendToNode".
+            * <p>
+            * Appending to the body while the DOM is still being constructed can 
+            * lead to Operation Aborted errors in IE hence this flag is set to 
+            * false by default.
+            * </p>
+            * 
+            * @config appendtodocumentbody
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, {
+                value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value
+            });
         },
-        
+
         /**
         * The Module class's initialization method, which is executed for
         * Module and all of its subclasses. This method is automatically 
@@ -1285,13 +1205,12 @@ version: 2.3.0
         * See configuration documentation for more details.
         */
         init: function (el, userConfig) {
-        
-            var elId, i, child;
-        
+
+            var elId, child;
+
             this.initEvents();
-        
             this.beforeInitEvent.fire(Module);
-        
+
             /**
             * The Module's Config object used for monitoring 
             * configuration properties.
@@ -1299,208 +1218,217 @@ version: 2.3.0
             * @type YAHOO.util.Config
             */
             this.cfg = new Config(this);
-        
+
             if (this.isSecure) {
                 this.imageRoot = Module.IMG_ROOT_SSL;
             }
-        
-            if (typeof el == "string") {
 
+            if (typeof el == "string") {
                 elId = el;
-        
                 el = document.getElementById(el);
-
                 if (! el) {
-
                     el = (createModuleTemplate()).cloneNode(false);
-
                     el.id = elId;
-
                 }
-
             }
-        
+
             this.element = el;
-        
+
             if (el.id) {
                 this.id = el.id;
             }
-        
+
             child = this.element.firstChild;
-            
-            if (child) {
 
+            if (child) {
+                var fndHd = false, fndBd = false, fndFt = false;
                 do {
-
-                    switch (child.className) {
-    
-                    case Module.CSS_HEADER:
-    
-                        this.header = child;
-    
-                        break;
-    
-                    case Module.CSS_BODY:
-    
-                        this.body = child;
-    
-                        break;
-    
-                    case Module.CSS_FOOTER:
-    
-                        this.footer = child;
-    
-                        break;
-    
+                    // We're looking for elements
+                    if (1 == child.nodeType) {
+                        if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) {
+                            this.header = child;
+                            fndHd = true;
+                        } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) {
+                            this.body = child;
+                            fndBd = true;
+                        } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){
+                            this.footer = child;
+                            fndFt = true;
+                        }
                     }
-                    
                 } while ((child = child.nextSibling));
-            
             }
 
-        
             this.initDefaultConfig();
-        
+
             Dom.addClass(this.element, Module.CSS_MODULE);
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
-        
+
             /*
                 Subscribe to the fireQueue() method of Config so that any 
                 queued configuration changes are excecuted upon render of 
                 the Module
             */ 
-            
-            if (!Config.alreadySubscribed(this.renderEvent, 
-                this.cfg.fireQueue, this.cfg)) {
 
+            if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
                 this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-
             }
-        
+
             this.initEvent.fire(Module);
         },
-        
+
         /**
-        * Initialized an empty IFRAME that is placed out of the visible area 
+        * Initialize an empty IFRAME that is placed out of the visible area 
         * that can be used to detect text resize.
         * @method initResizeMonitor
         */
         initResizeMonitor: function () {
-        
-            var oDoc, 
-                oIFrame, 
-                sHTML;
-        
-            function fireTextResize() {
-        
+
+            var isGeckoWin = (YAHOO.env.ua.gecko && this.platform == "windows");
+            if (isGeckoWin) {
+                // Help prevent spinning loading icon which 
+                // started with FireFox 2.0.0.8/Win
+                var self = this;
+                setTimeout(function(){self._initResizeMonitor();}, 0);
+            } else {
+                this._initResizeMonitor();
+            }
+        },
+
+        /**
+         * Create and initialize the text resize monitoring iframe.
+         * 
+         * @protected
+         * @method _initResizeMonitor
+         */
+        _initResizeMonitor : function() {
+
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+
+            function fireTextResize() {
                 Module.textResizeEvent.fire();
-        
             }
-        
+
             if (!YAHOO.env.ua.opera) {
-        
                 oIFrame = Dom.get("_yuiResizeMonitor");
-        
+
+                var supportsCWResize = this._supportsCWResize();
+
                 if (!oIFrame) {
-        
                     oIFrame = document.createElement("iframe");
-        
-                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
-                        YAHOO.env.ua.ie) {
-    
+
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && YAHOO.env.ua.ie) {
                         oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
-    
                     }
 
-
-                    /*
-                        Need to set "src" attribute of the iframe to 
-                        prevent the browser from reporting duplicate 
-                        cookies. (See SourceForge bug #1721755)
-                    */
-        
-                    if (YAHOO.env.ua.gecko) {
-
-                        sHTML = "<html><head><script " +
-                                "type=\"text/javascript\">" + 
-                                "window.onresize=function(){window.parent." +
-                                "YAHOO.widget.Module.textResizeEvent." +
-                                "fire();};window.parent.YAHOO.widget.Module." +
-                                "textResizeEvent.fire();</script></head>" + 
-                                "<body></body></html>";
-
-                        oIFrame.src = "data:text/html;charset=utf-8," + 
-                            encodeURIComponent(sHTML);
-
+                    if (!supportsCWResize) {
+                        // Can't monitor on contentWindow, so fire from inside iframe
+                        sHTML = ["<html><head><script ",
+                                 "type=\"text/javascript\">",
+                                 "window.onresize=function(){window.parent.",
+                                 "YAHOO.widget.Module.textResizeEvent.",
+                                 "fire();};<",
+                                 "\/script></head>",
+                                 "<body></body></html>"].join('');
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML);
                     }
 
                     oIFrame.id = "_yuiResizeMonitor";
-                    
                     /*
                         Need to set "position" property before inserting the 
                         iframe into the document or Safari's status bar will 
                         forever indicate the iframe is loading 
                         (See SourceForge bug #1723064)
                     */
-                    
                     oIFrame.style.position = "absolute";
                     oIFrame.style.visibility = "hidden";
-        
-                    document.body.appendChild(oIFrame);
-        
+
+                    var db = document.body,
+                        fc = db.firstChild;
+                    if (fc) {
+                        db.insertBefore(oIFrame, fc);
+                    } else {
+                        db.appendChild(oIFrame);
+                    }
+
                     oIFrame.style.width = "10em";
                     oIFrame.style.height = "10em";
                     oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
                     oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
                     oIFrame.style.borderWidth = "0";
                     oIFrame.style.visibility = "visible";
-        
+
+                    /*
+                       Don't open/close the document for Gecko like we used to, since it
+                       leads to duplicate cookies. (See SourceForge bug #1721755)
+                    */
                     if (YAHOO.env.ua.webkit) {
-        
                         oDoc = oIFrame.contentWindow.document;
-        
                         oDoc.open();
                         oDoc.close();
-        
                     }
-
                 }
-        
+
                 if (oIFrame && oIFrame.contentWindow) {
+                    Module.textResizeEvent.subscribe(this.onDomResize, this, true);
 
-                    Module.textResizeEvent.subscribe(this.onDomResize, 
-                        this, true);
-        
                     if (!Module.textResizeInitialized) {
-
-                        if (!Event.on(oIFrame.contentWindow, "resize", 
-                            fireTextResize)) {
-
-                            /*
-                                 This will fail in IE if document.domain has 
-                                 changed, so we must change the listener to 
-                                 use the oIFrame element instead
-                            */
-
-                            Event.on(oIFrame, "resize", fireTextResize);
-
+                        if (supportsCWResize) {
+                            if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) {
+                                /*
+                                     This will fail in IE if document.domain has 
+                                     changed, so we must change the listener to 
+                                     use the oIFrame element instead
+                                */
+                                Event.on(oIFrame, "resize", fireTextResize);
+                            }
                         }
-
                         Module.textResizeInitialized = true;
-
                     }
-
                     this.resizeMonitor = oIFrame;
+                }
+            }
+        },
 
+        /**
+         * Text resize monitor helper method.
+         * Determines if the browser supports resize events on iframe content windows.
+         * 
+         * @private
+         * @method _supportsCWResize
+         */
+        _supportsCWResize : function() {
+            /*
+                Gecko 1.8.0 (FF1.5), 1.8.1.0-5 (FF2) won't fire resize on contentWindow.
+                Gecko 1.8.1.6+ (FF2.0.0.6+) and all other browsers will fire resize on contentWindow.
+
+                We don't want to start sniffing for patch versions, so fire textResize the same
+                way on all FF, until 1.9 (3.x) is out
+             */
+            var bSupported = true;
+            if (YAHOO.env.ua.gecko && YAHOO.env.ua.gecko <= 1.8) {
+                bSupported = false;
+                /*
+                var v = navigator.userAgent.match(/rv:([^\s\)]*)/); // From YAHOO.env.ua
+                if (v && v[0]) {
+                    var sv = v[0].match(/\d\.\d\.(\d)/);
+                    if (sv && sv[1]) {
+                        if (parseInt(sv[1], 10) > 0) {
+                            bSupported = true;
+                        }
+                    }
                 }
-        
+                */
             }
-        
+            return bSupported;
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -1508,45 +1436,45 @@ version: 2.3.0
         * @param {Object} obj The scope object passed to the handler
         */
         onDomResize: function (e, obj) {
-        
+
             var nLeft = -1 * this.resizeMonitor.offsetWidth,
                 nTop = -1 * this.resizeMonitor.offsetHeight;
         
             this.resizeMonitor.style.top = nTop + "px";
             this.resizeMonitor.style.left =  nLeft + "px";
-        
+
         },
-        
+
         /**
-        * Sets the Module's header content to the HTML specified, or appends 
+        * Sets the Module's header content to the string specified, or appends 
         * the passed element to the header. If no header is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the header.
+        * 
         * @method setHeader
-        * @param {String} headerContent The HTML used to set the header 
+        * @param {String} headerContent The string used to set the header.
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the header innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} headerContent The HTMLElement to append to 
         * the header
         */
         setHeader: function (headerContent) {
-
             var oHeader = this.header || (this.header = createHeader());
-        
-            if (typeof headerContent == "string") {
-
-                oHeader.innerHTML = headerContent;
-
-            } else {
 
+            if (headerContent.tagName) {
                 oHeader.innerHTML = "";
                 oHeader.appendChild(headerContent);
-
+            } else {
+                oHeader.innerHTML = headerContent;
             }
-        
+
             this.changeHeaderEvent.fire(headerContent);
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Appends the passed element to the header. If no header is present, 
         * one will be automatically created.
@@ -1554,7 +1482,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the header
         */
         appendToHeader: function (element) {
-
             var oHeader = this.header || (this.header = createHeader());
         
             oHeader.appendChild(element);
@@ -1563,35 +1490,34 @@ version: 2.3.0
             this.changeContentEvent.fire();
 
         },
-        
+
         /**
         * Sets the Module's body content to the HTML specified, or appends the
         * passed element to the body. If no body is present, one will be 
-        * automatically created.
+        * automatically created. An empty string can be passed to the method
+        * to clear the contents of the body.
         * @method setBody
-        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {String} bodyContent The HTML used to set the body. 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the body innerHTML
+        * set to their default toString implementations.
+        * <em>OR</em>
         * @param {HTMLElement} bodyContent The HTMLElement to append to the body
         */
         setBody: function (bodyContent) {
-
             var oBody = this.body || (this.body = createBody());
-        
-            if (typeof bodyContent == "string") {
-
-                oBody.innerHTML = bodyContent;
-
-            } else {
 
+            if (bodyContent.tagName) {
                 oBody.innerHTML = "";
                 oBody.appendChild(bodyContent);
-
+            } else {
+                oBody.innerHTML = bodyContent;
             }
-        
+
             this.changeBodyEvent.fire(bodyContent);
             this.changeContentEvent.fire();
-
         },
-        
+
         /**
         * Appends the passed element to the body. If no body is present, one 
         * will be automatically created.
@@ -1599,7 +1525,6 @@ version: 2.3.0
         * @param {HTMLElement} element The element to append to the body
         */
         appendToBody: function (element) {
-
             var oBody = this.body || (this.body = createBody());
         
             oBody.appendChild(element);
@@ -1612,9 +1537,13 @@ version: 2.3.0
         /**
         * Sets the Module's footer content to the HTML specified, or appends 
         * the passed element to the footer. If no footer is present, one will 
-        * be automatically created.
+        * be automatically created. An empty string can be passed to the method
+        * to clear the contents of the footer.
         * @method setFooter
         * @param {String} footerContent The HTML used to set the footer 
+        * As a convenience, non HTMLElement objects can also be passed into 
+        * the method, and will be treated as strings, with the footer innerHTML
+        * set to their default toString implementations.
         * <em>OR</em>
         * @param {HTMLElement} footerContent The HTMLElement to append to 
         * the footer
@@ -1622,18 +1551,14 @@ version: 2.3.0
         setFooter: function (footerContent) {
 
             var oFooter = this.footer || (this.footer = createFooter());
-        
-            if (typeof footerContent == "string") {
-
-                oFooter.innerHTML = footerContent;
-
-            } else {
 
+            if (footerContent.tagName) {
                 oFooter.innerHTML = "";
                 oFooter.appendChild(footerContent);
-
+            } else {
+                oFooter.innerHTML = footerContent;
             }
-        
+
             this.changeFooterEvent.fire(footerContent);
             this.changeContentEvent.fire();
 
@@ -1660,10 +1585,20 @@ version: 2.3.0
         * Renders the Module by inserting the elements that are not already 
         * in the main Module into their correct places. Optionally appends 
         * the Module to the specified node prior to the render's execution. 
-        * NOTE: For Modules without existing markup, the appendToNode argument 
+        * <p>
+        * For Modules without existing markup, the appendToNode argument 
         * is REQUIRED. If this argument is ommitted and the current element is 
         * not present in the document, the function will return false, 
         * indicating that the render was a failure.
+        * </p>
+        * <p>
+        * NOTE: As of 2.3.1, if the appendToNode is the document's body element
+        * then the module is rendered as the first child of the body element, 
+        * and not appended to it, to avoid Operation Aborted errors in IE when 
+        * rendering the module before window's load event is fired. You can 
+        * use the appendtodocumentbody configuration property to change this 
+        * to append to document.body if required.
+        * </p>
         * @method render
         * @param {String} appendToNode The element id to which the Module 
         * should be appended to prior to rendering <em>OR</em>
@@ -1674,118 +1609,75 @@ version: 2.3.0
         * @return {Boolean} Success or failure of the render
         */
         render: function (appendToNode, moduleElement) {
-        
+
             var me = this,
                 firstChild;
-        
-            function appendTo(element) {
-                if (typeof element == "string") {
-                    element = document.getElementById(element);
+
+            function appendTo(parentNode) {
+                if (typeof parentNode == "string") {
+                    parentNode = document.getElementById(parentNode);
                 }
-        
-                if (element) {
-                    element.appendChild(me.element);
+
+                if (parentNode) {
+                    me._addToParent(parentNode, me.element);
                     me.appendEvent.fire();
                 }
             }
-        
+
             this.beforeRenderEvent.fire();
-        
+
             if (! moduleElement) {
                 moduleElement = this.element;
             }
-        
-            if (appendToNode) {
 
+            if (appendToNode) {
                 appendTo(appendToNode);
-
             } else { 
-
-                /*
-                     No node was passed in. If the element is not already in 
-                     the Dom, this fails
-                */
-
+                // No node was passed in. If the element is not already in the Dom, this fails
                 if (! Dom.inDocument(this.element)) {
-
-
                     return false;
-
                 }
-
             }
-        
+
             // Need to get everything into the DOM if it isn't already
-        
             if (this.header && ! Dom.inDocument(this.header)) {
-
-                /*
-                    There is a header, but it's not in the DOM yet... 
-                    need to add it
-                */
-
+                // There is a header, but it's not in the DOM yet. Need to add it.
                 firstChild = moduleElement.firstChild;
-
-                if (firstChild) { // Insert before first child if exists
-
+                if (firstChild) {
                     moduleElement.insertBefore(this.header, firstChild);
-
-                } else { // Append to empty body because there are no children
-
+                } else {
                     moduleElement.appendChild(this.header);
-
                 }
-
             }
-        
-            if (this.body && ! Dom.inDocument(this.body)) {
-
-                /*
-                     There is a body, but it's not in the DOM yet... 
-                     need to add it
-                */
-
-
-                // Insert before footer if exists in DOM
-
-                if (this.footer && Dom.isAncestor(
-                    this.moduleElement, this.footer)) { 
 
+            if (this.body && ! Dom.inDocument(this.body)) {
+                // There is a body, but it's not in the DOM yet. Need to add it.               
+                if (this.footer && Dom.isAncestor(this.moduleElement, this.footer)) {
                     moduleElement.insertBefore(this.body, this.footer);
-
-                } else { // Append to element because there is no footer
-
+                } else {
                     moduleElement.appendChild(this.body);
-
                 }
-
             }
-        
-            if (this.footer && ! Dom.inDocument(this.footer)) {
-
-                /*
-                     There is a footer, but it's not in the DOM yet... 
-                     need to add it
-                */
 
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+                // There is a footer, but it's not in the DOM yet. Need to add it.
                 moduleElement.appendChild(this.footer);
-
             }
-        
+
             this.renderEvent.fire();
             return true;
         },
-        
+
         /**
         * Removes the Module element from the DOM and sets all child elements 
         * to null.
         * @method destroy
         */
         destroy: function () {
-        
+
             var parent,
                 e;
-        
+
             if (this.element) {
                 Event.purgeElement(this.element, true);
                 parent = this.element.parentNode;
@@ -1836,7 +1728,6 @@ version: 2.3.0
         },
         
         // BUILT-IN EVENT HANDLERS FOR MODULE //
-        
         /**
         * Default event handler for changing the visibility property of a 
         * Module. By default, this is achieved by switching the "display" style 
@@ -1872,23 +1763,40 @@ version: 2.3.0
         * @method configMonitorResize
         */
         configMonitorResize: function (type, args, obj) {
-
             var monitor = args[0];
-
             if (monitor) {
-
                 this.initResizeMonitor();
-
             } else {
-
-                Module.textResizeEvent.unsubscribe(
-                    this.onDomResize, this, true);
-
+                Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
                 this.resizeMonitor = null;
             }
+        },
 
+        /**
+         * This method is a protected helper, used when constructing the DOM structure for the module 
+         * to account for situations which may cause Operation Aborted errors in IE. It should not 
+         * be used for general DOM construction.
+         * <p>
+         * If the parentNode is not document.body, the element is appended as the last element.
+         * </p>
+         * <p>
+         * If the parentNode is document.body the element is added as the first child to help
+         * prevent Operation Aborted errors in IE.
+         * </p>
+         *
+         * @param {parentNode} The HTML element to which the element will be added
+         * @param {element} The HTML element to be added to parentNode's children
+         * @method _addToParent
+         * @protected
+         */
+        _addToParent: function(parentNode, element) {
+            if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) {
+                parentNode.insertBefore(element, parentNode.firstChild);
+            } else {
+                parentNode.appendChild(element);
+            }
         },
-        
+
         /**
         * Returns a String representation of the Object.
         * @method toString
@@ -1897,12 +1805,12 @@ version: 2.3.0
         toString: function () {
             return "Module " + this.id;
         }
-        
     };
-    
+
     YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
 
 }());
+
 (function () {
 
     /**
@@ -1914,7 +1822,7 @@ version: 2.3.0
     * properly rendered above SELECT elements.
     * @namespace YAHOO.widget
     * @class Overlay
-    * @extends Module
+    * @extends YAHOO.widget.Module
     * @param {String} el The element ID representing the Overlay <em>OR</em>
     * @param {HTMLElement} el The element representing the Overlay
     * @param {Object} userConfig The configuration object literal containing 
@@ -1923,12 +1831,9 @@ version: 2.3.0
     * @constructor
     */
     YAHOO.widget.Overlay = function (el, userConfig) {
-    
         YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-    
     };
 
-
     var Lang = YAHOO.lang,
         CustomEvent = YAHOO.util.CustomEvent,
         Module = YAHOO.widget.Module,
@@ -1936,7 +1841,7 @@ version: 2.3.0
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         Overlay = YAHOO.widget.Overlay,
-        
+
         m_oIFrameTemplate,
 
         /**
@@ -1947,12 +1852,10 @@ version: 2.3.0
         * @type Object
         */
         EVENT_TYPES = {
-        
             "BEFORE_MOVE": "beforeMove",
             "MOVE": "move"
-        
         },
-        
+
         /**
         * Constant representing the Overlay's configuration properties
         * @property DEFAULT_CONFIG
@@ -1961,74 +1864,72 @@ version: 2.3.0
         * @type Object
         */
         DEFAULT_CONFIG = {
-        
+
             "X": { 
                 key: "x", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "Y": { 
                 key: "y", 
                 validator: Lang.isNumber, 
                 suppressEvent: true, 
-                supercedes: ["iframe"] 
+                supercedes: ["iframe"]
             },
-        
+
             "XY": { 
                 key: "xy", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "CONTEXT": { 
                 key: "context", 
                 suppressEvent: true, 
                 supercedes: ["iframe"] 
             },
-        
+
             "FIXED_CENTER": { 
                 key: "fixedcenter", 
                 value: false, 
                 validator: Lang.isBoolean, 
                 supercedes: ["iframe", "visible"] 
             },
-        
+
             "WIDTH": { 
                 key: "width", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
             }, 
-        
+
             "HEIGHT": { 
                 key: "height", 
                 suppressEvent: true, 
                 supercedes: ["context", "fixedcenter", "iframe"] 
-            }, 
-        
+            },
+
             "ZINDEX": { 
                 key: "zindex", 
                 value: null 
-            }, 
-        
+            },
+
             "CONSTRAIN_TO_VIEWPORT": { 
                 key: "constraintoviewport", 
                 value: false, 
                 validator: Lang.isBoolean, 
-                supercedes: ["iframe", "x", "y", "xy"] 
+                supercedes: ["iframe", "x", "y", "xy"]
             }, 
-        
+
             "IFRAME": { 
                 key: "iframe", 
                 value: (YAHOO.env.ua.ie == 6 ? true : false), 
                 validator: Lang.isBoolean, 
                 supercedes: ["zindex"] 
             }
-        
         };
 
-
     /**
     * The URL that will be placed in the iframe
     * @property YAHOO.widget.Overlay.IFRAME_SRC
@@ -2040,7 +1941,7 @@ version: 2.3.0
 
     /**
     * Number representing how much the iframe shim should be offset from each 
-    * side of an Overlay instance.
+    * side of an Overlay instance, in pixels.
     * @property YAHOO.widget.Overlay.IFRAME_SRC
     * @default 3
     * @static
@@ -2048,7 +1949,18 @@ version: 2.3.0
     * @type Number
     */
     Overlay.IFRAME_OFFSET = 3;
-    
+
+    /**
+    * Number representing the minimum distance an Overlay instance should be 
+    * positioned relative to the boundaries of the browser's viewport, in pixels.
+    * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET
+    * @default 10
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.VIEWPORT_OFFSET = 10;
+
     /**
     * Constant representing the top left corner of an element, used for 
     * configuring the context element alignment
@@ -2058,7 +1970,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_LEFT = "tl";
-    
+
     /**
     * Constant representing the top right corner of an element, used for 
     * configuring the context element alignment
@@ -2068,7 +1980,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.TOP_RIGHT = "tr";
-    
+
     /**
     * Constant representing the top bottom left corner of an element, used for 
     * configuring the context element alignment
@@ -2078,7 +1990,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_LEFT = "bl";
-    
+
     /**
     * Constant representing the bottom right corner of an element, used for 
     * configuring the context element alignment
@@ -2088,7 +2000,7 @@ version: 2.3.0
     * @type String
     */
     Overlay.BOTTOM_RIGHT = "br";
-    
+
     /**
     * Constant representing the default CSS class used for an Overlay
     * @property YAHOO.widget.Overlay.CSS_OVERLAY
@@ -2097,22 +2009,21 @@ version: 2.3.0
     * @type String
     */
     Overlay.CSS_OVERLAY = "yui-overlay";
-    
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for 
     * window scroll
     * @event YAHOO.widget.Overlay.windowScrollEvent
     */
     Overlay.windowScrollEvent = new CustomEvent("windowScroll");
-    
+
     /**
     * A singleton CustomEvent used for reacting to the DOM event for
     * window resize
     * @event YAHOO.widget.Overlay.windowResizeEvent
     */
     Overlay.windowResizeEvent = new CustomEvent("windowResize");
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window scroll
     * @method YAHOO.widget.Overlay.windowScrollHandler
@@ -2120,31 +2031,24 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM scroll event
     */
     Overlay.windowScrollHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
+
             if (! window.scrollEnd) {
-    
                 window.scrollEnd = -1;
-    
             }
-    
+
             clearTimeout(window.scrollEnd);
     
             window.scrollEnd = setTimeout(function () { 
-            
                 Overlay.windowScrollEvent.fire(); 
-    
             }, 1);
     
         } else {
-    
             Overlay.windowScrollEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * The DOM event handler used to fire the CustomEvent for window resize
     * @method YAHOO.widget.Overlay.windowResizeHandler
@@ -2152,29 +2056,22 @@ version: 2.3.0
     * @param {DOMEvent} e The DOM resize event
     */
     Overlay.windowResizeHandler = function (e) {
-    
+
         if (YAHOO.env.ua.ie) {
-    
             if (! window.resizeEnd) {
                 window.resizeEnd = -1;
             }
-    
+
             clearTimeout(window.resizeEnd);
-    
+
             window.resizeEnd = setTimeout(function () {
-    
                 Overlay.windowResizeEvent.fire(); 
-    
             }, 100);
-    
         } else {
-    
             Overlay.windowResizeEvent.fire();
-    
         }
-    
     };
-    
+
     /**
     * A boolean that indicated whether the window resize and scroll events have 
     * already been subscribed to.
@@ -2183,18 +2080,16 @@ version: 2.3.0
     * @type Boolean
     */
     Overlay._initialized = null;
-    
+
     if (Overlay._initialized === null) {
-    
         Event.on(window, "scroll", Overlay.windowScrollHandler);
         Event.on(window, "resize", Overlay.windowResizeHandler);
     
         Overlay._initialized = true;
-    
     }
-    
+
     YAHOO.extend(Overlay, Module, {
-    
+
         /**
         * The Overlay initialization method, which is executed for Overlay and  
         * all of its subclasses. This method is automatically called by the 
@@ -2215,39 +2110,35 @@ version: 2.3.0
             */
     
             Overlay.superclass.init.call(this, el/*, userConfig*/);  
-            
+
             this.beforeInitEvent.fire(Overlay);
             
             Dom.addClass(this.element, Overlay.CSS_OVERLAY);
             
             if (userConfig) {
-    
                 this.cfg.applyConfig(userConfig, true);
-    
             }
-            
+
             if (this.platform == "mac" && YAHOO.env.ua.gecko) {
-    
+
                 if (! Config.alreadySubscribed(this.showEvent,
                     this.showMacGeckoScrollbars, this)) {
-    
+
                     this.showEvent.subscribe(this.showMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
+
                 if (! Config.alreadySubscribed(this.hideEvent, 
                     this.hideMacGeckoScrollbars, this)) {
-    
+
                     this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
                         this, true);
-    
+
                 }
-    
             }
-            
+
             this.initEvent.fire(Overlay);
-        
         },
         
         /**
@@ -2307,8 +2198,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.X.supercedes
     
             });
-        
-    
+
             /**
             * The absolute y-coordinate position of the Overlay
             * @config y
@@ -2316,14 +2206,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
-    
+
                 handler: this.configY, 
                 validator: DEFAULT_CONFIG.Y.validator, 
                 suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.Y.supercedes
-    
+
             });
-        
     
             /**
             * An array with the absolute x and y positions of the Overlay
@@ -2338,7 +2227,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.XY.supercedes
             
             });
-        
     
             /**
             * The array of context arguments for context-sensitive positioning.  
@@ -2357,8 +2245,7 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
             
             });
-        
-    
+
             /**
             * True if the Overlay should be anchored to the center of 
             * the viewport.
@@ -2374,7 +2261,6 @@ version: 2.3.0
                 supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
             
             });
-        
     
             /**
             * CSS width of the Overlay.
@@ -2383,13 +2269,13 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
-            
+
                 handler: this.configWidth, 
                 suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.WIDTH.supercedes
-            
+
             });
-            
+
             /**
             * CSS height of the Overlay.
             * @config height
@@ -2397,7 +2283,7 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
-            
+
                 handler: this.configHeight, 
                 suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
                 supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
@@ -2411,12 +2297,12 @@ version: 2.3.0
             * @default null
             */
             this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
-    
+
                 handler: this.configzIndex,
                 value: DEFAULT_CONFIG.ZINDEX.value
-    
+
             });
-            
+
             /**
             * True if the Overlay should be prevented from being positioned 
             * out of the viewport.
@@ -2425,18 +2311,18 @@ version: 2.3.0
             * @default false
             */
             this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
-            
+
                 handler: this.configConstrainToViewport, 
                 value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
                 validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
                 supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
-            
+
             });
-            
+
             /**
             * @config iframe
             * @description Boolean indicating whether or not the Overlay should 
-            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * have an IFRAME shim; used to prevent SELECT elements from 
             * poking through an Overlay instance in IE6.  When set to "true", 
             * the iframe shim is created when the Overlay instance is intially
             * made visible.
@@ -2444,16 +2330,15 @@ version: 2.3.0
             * @default true for IE6 and below, false for all other browsers.
             */
             this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
-            
+
                 handler: this.configIframe, 
                 value: DEFAULT_CONFIG.IFRAME.value, 
                 validator: DEFAULT_CONFIG.IFRAME.validator, 
                 supercedes: DEFAULT_CONFIG.IFRAME.supercedes
-            
+
             });
-        
         },
-        
+
         /**
         * Moves the Overlay to the specified position. This function is  
         * identical to calling this.cfg.setProperty("xy", [x,y]);
@@ -2462,11 +2347,9 @@ version: 2.3.0
         * @param {Number} y The Overlay's new y position
         */
         moveTo: function (x, y) {
-    
             this.cfg.setProperty("xy", [x, y]);
-    
         },
-        
+
         /**
         * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
         * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2479,7 +2362,7 @@ version: 2.3.0
             Dom.addClass(this.element, "hide-scrollbars");
     
         },
-        
+
         /**
         * Adds a CSS class ("show-scrollbars") and removes a CSS class 
         * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
@@ -2492,9 +2375,8 @@ version: 2.3.0
             Dom.addClass(this.element, "show-scrollbars");
     
         },
-        
+
         // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * The default event handler fired when the "visible" property is 
         * changed.  This method is responsible for firing showEvent
@@ -2507,7 +2389,7 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configVisible: function (type, args, obj) {
-    
+
             var visible = args[0],
                 currentVis = Dom.getStyle(this.element, "visibility"),
                 effect = this.cfg.getProperty("effect"),
@@ -2517,140 +2399,93 @@ version: 2.3.0
                 eff, ei, e, i, j, k, h,
                 nEffects,
                 nEffectInstances;
-    
-    
+
             if (currentVis == "inherit") {
-    
                 e = this.element.parentNode;
-    
+
                 while (e.nodeType != 9 && e.nodeType != 11) {
-    
                     currentVis = Dom.getStyle(e, "visibility");
-    
+
                     if (currentVis != "inherit") { 
-    
                         break; 
-    
                     }
-    
+
                     e = e.parentNode;
-    
                 }
-    
+
                 if (currentVis == "inherit") {
-    
                     currentVis = "visible";
-                
                 }
-    
             }
-        
-    
+
             if (effect) {
-    
                 if (effect instanceof Array) {
-
                     nEffects = effect.length;
-    
+
                     for (i = 0; i < nEffects; i++) {
-    
                         eff = effect[i];
-    
                         effectInstances[effectInstances.length] = 
                             eff.effect(this, eff.duration);
-    
+
                     }
-    
                 } else {
-    
                     effectInstances[effectInstances.length] = 
                         effect.effect(this, effect.duration);
-    
                 }
-    
             }
-    
-        
+
+
             if (visible) { // Show
-    
                 if (isMacGecko) {
-    
                     this.showMacGeckoScrollbars();
-    
                 }
-                
-    
+
                 if (effect) { // Animate in
-    
-    
                     if (visible) { // Animate in if not showing
-    
-    
                         if (currentVis != "visible" || currentVis === "") {
-    
                             this.beforeShowEvent.fire();
-
                             nEffectInstances = effectInstances.length;
-    
+
                             for (j = 0; j < nEffectInstances; j++) {
-    
                                 ei = effectInstances[j];
-    
                                 if (j === 0 && !alreadySubscribed(
                                         ei.animateInCompleteEvent, 
                                         this.showEvent.fire, this.showEvent)) {
-    
+
                                     /*
                                          Delegate showEvent until end 
                                          of animateInComplete
                                     */
-    
+
                                     ei.animateInCompleteEvent.subscribe(
                                      this.showEvent.fire, this.showEvent, true);
-    
                                 }
-    
                                 ei.animateIn();
-    
                             }
-    
                         }
-    
                     }
-    
                 } else { // Show
-    
                     if (currentVis != "visible" || currentVis === "") {
-    
                         this.beforeShowEvent.fire();
-    
+
                         Dom.setStyle(this.element, "visibility", "visible");
-    
+
                         this.cfg.refireEvent("iframe");
                         this.showEvent.fire();
-    
                     }
-        
                 }
-        
             } else { // Hide
-    
+
                 if (isMacGecko) {
-    
                     this.hideMacGeckoScrollbars();
-    
                 }
                     
                 if (effect) { // Animate out if showing
-    
                     if (currentVis == "visible") {
-    
                         this.beforeHideEvent.fire();
 
                         nEffectInstances = effectInstances.length;
-    
                         for (k = 0; k < nEffectInstances; k++) {
-    
                             h = effectInstances[k];
     
                             if (k === 0 && !alreadySubscribed(
@@ -2666,50 +2501,35 @@ version: 2.3.0
                                     this.hideEvent.fire, this.hideEvent, true);
     
                             }
-    
                             h.animateOut();
-    
                         }
-    
+
                     } else if (currentVis === "") {
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-    
                     }
-    
+
                 } else { // Simple hide
-    
+
                     if (currentVis == "visible" || currentVis === "") {
-    
                         this.beforeHideEvent.fire();
-    
                         Dom.setStyle(this.element, "visibility", "hidden");
-
                         this.hideEvent.fire();
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
+
         /**
         * Center event handler used for centering on scroll/resize, but only if 
         * the Overlay is visible
         * @method doCenterOnDOMEvent
         */
         doCenterOnDOMEvent: function () {
-    
             if (this.cfg.getProperty("visible")) {
-    
                 this.center();
-    
             }
-    
         },
-        
+
         /**
         * The default event handler fired when the "fixedcenter" property 
         * is changed.
@@ -2721,48 +2541,33 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configFixedCenter: function (type, args, obj) {
-    
+
             var val = args[0],
                 alreadySubscribed = Config.alreadySubscribed,
                 windowResizeEvent = Overlay.windowResizeEvent,
                 windowScrollEvent = Overlay.windowScrollEvent;
-            
+
             if (val) {
-    
                 this.center();
-            
-                if (!alreadySubscribed(this.beforeShowEvent, 
-                    this.center, this)) {
-    
+
+                if (!alreadySubscribed(this.beforeShowEvent, this.center, this)) {
                     this.beforeShowEvent.subscribe(this.center);
-    
                 }
-            
-                if (!alreadySubscribed(windowResizeEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-    
-                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) {
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-            
-                if (!alreadySubscribed(windowScrollEvent, 
-                    this.doCenterOnDOMEvent, this)) {
-        
-                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
-                        this, true);
-    
+
+                if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) {
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true);
                 }
-    
+
             } else {
-    
                 this.beforeShowEvent.unsubscribe(this.center);
-    
+
                 windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
                 windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-    
             }
-    
         },
         
         /**
@@ -2775,15 +2580,14 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configHeight: function (type, args, obj) {
-    
+
             var height = args[0],
                 el = this.element;
-    
+
             Dom.setStyle(el, "height", height);
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * The default event handler fired when the "width" property is changed.
         * @method configWidth
@@ -2794,13 +2598,12 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configWidth: function (type, args, obj) {
-    
+
             var width = args[0],
                 el = this.element;
     
             Dom.setStyle(el, "width", width);
             this.cfg.refireEvent("iframe");
-    
         },
         
         /**
@@ -2813,38 +2616,31 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configzIndex: function (type, args, obj) {
-    
+
             var zIndex = args[0],
                 el = this.element;
-        
+
             if (! zIndex) {
-    
                 zIndex = Dom.getStyle(el, "zIndex");
-        
                 if (! zIndex || isNaN(zIndex)) {
-    
                     zIndex = 0;
-    
                 }
-    
             }
-            
-            if (this.iframe) {
-    
+
+            if (this.iframe || this.cfg.getProperty("iframe") === true) {
                 if (zIndex <= 0) {
-    
                     zIndex = 1;
-    
                 }
-    
-                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
             }
-            
+
             Dom.setStyle(el, "zIndex", zIndex);
             this.cfg.setProperty("zIndex", zIndex, true);
-    
+
+            if (this.iframe) {
+                this.stackIframe();
+            }
         },
-        
+
         /**
         * The default event handler fired when the "xy" property is changed.
         * @method configXY
@@ -2855,25 +2651,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configXY: function (type, args, obj) {
-    
+
             var pos = args[0],
                 x = pos[0],
                 y = pos[1];
-            
+
             this.cfg.setProperty("x", x);
             this.cfg.setProperty("y", y);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
-            
+
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "x" property is changed.
         * @method configX
@@ -2884,27 +2679,26 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configX: function (type, args, obj) {
-    
+
             var x = args[0],
                 y = this.cfg.getProperty("y");
-            
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
             
             Dom.setX(this.element, x, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-           
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
-        
+
         /**
         * The default event handler fired when the "y" property is changed.
         * @method configY
@@ -2915,25 +2709,24 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configY: function (type, args, obj) {
-    
+
             var x = this.cfg.getProperty("x"),
                 y = args[0];
-        
+
             this.cfg.setProperty("x", x, true);
             this.cfg.setProperty("y", y, true);
-            
+
             this.beforeMoveEvent.fire([x, y]);
-            
+
             x = this.cfg.getProperty("x");
             y = this.cfg.getProperty("y");
-            
+
             Dom.setY(this.element, y, true);
-            
+
             this.cfg.setProperty("xy", [x, y], true);
-            
+
             this.cfg.refireEvent("iframe");
             this.moveEvent.fire([x, y]);
-    
         },
         
         /**
@@ -2946,33 +2739,23 @@ version: 2.3.0
                 oParentNode;
 
             if (oIFrame) {
-    
                 oParentNode = this.element.parentNode;
 
                 if (oParentNode != oIFrame.parentNode) {
-
-                    oParentNode.appendChild(oIFrame);
-                
+                    this._addToParent(oParentNode, oIFrame);
                 }
-
                 oIFrame.style.display = "block";
-    
             }
-    
         },
-        
+
         /**
         * Hides the iframe shim, if it has been enabled.
         * @method hideIframe
         */
         hideIframe: function () {
-    
             if (this.iframe) {
-    
                 this.iframe.style.display = "none";
-    
             }
-    
         },
 
         /**
@@ -2988,37 +2771,44 @@ version: 2.3.0
                 nDimensionOffset = (nOffset * 2),
                 aXY;
 
-
             if (oIFrame) {
-
                 // Size <iframe>
-
-                oIFrame.style.width = 
-                    (oElement.offsetWidth + nDimensionOffset + "px");
-
-                oIFrame.style.height = 
-                    (oElement.offsetHeight + nDimensionOffset + "px");
-
+                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
+                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");
 
                 // Position <iframe>
-
                 aXY = this.cfg.getProperty("xy");
 
                 if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
-
                     this.syncPosition();
-
                     aXY = this.cfg.getProperty("xy");
-
                 }
-
                 Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+            }
+        },
 
+        /**
+         * Sets the zindex of the iframe shim, if it exists, based on the zindex of
+         * the Overlay element. The zindex of the iframe is set to be one less 
+         * than the Overlay element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Overlay element
+         * to ensure that the iframe shim has a non-negative zindex.
+         * If you require the iframe zindex to be 0 or higher, the zindex of 
+         * the Overlay element should be set to a value greater than 0, before 
+         * this method is called.
+         * </p>
+         * @method stackIframe
+         */
+        stackIframe: function () {
+            if (this.iframe) {
+                var overlayZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) {
+                    Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1));
+                }
             }
-        
         },
 
-        
         /**
         * The default event handler fired when the "iframe" property is changed.
         * @method configIframe
@@ -3036,20 +2826,14 @@ version: 2.3.0
 
                 var oIFrame = this.iframe,
                     oElement = this.element,
-                    oParent,
-                    aXY;
-
+                    oParent;
 
                 if (!oIFrame) {
-
                     if (!m_oIFrameTemplate) {
-    
                         m_oIFrameTemplate = document.createElement("iframe");
 
                         if (this.isSecure) {
-        
                             m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
-        
                         }
 
                         /*
@@ -3057,25 +2841,19 @@ version: 2.3.0
                             doesn't modify the opacity of any transparent 
                             elements that may be on top of it (like a shadow).
                         */
-        
+
                         if (YAHOO.env.ua.ie) {
-        
                             m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
-        
                             /*
                                  Need to set the "frameBorder" property to 0 
                                  supress the default <iframe> border in IE.  
                                  Setting the CSS "border" property alone 
                                  doesn't supress it.
                             */
-        
                             m_oIFrameTemplate.frameBorder = 0;
-        
                         }
                         else {
-        
                             m_oIFrameTemplate.style.opacity = "0";
-                        
                         }
 
                         m_oIFrameTemplate.style.position = "absolute";
@@ -3083,109 +2861,91 @@ version: 2.3.0
                         m_oIFrameTemplate.style.margin = "0";
                         m_oIFrameTemplate.style.padding = "0";
                         m_oIFrameTemplate.style.display = "none";
-    
                     }
 
                     oIFrame = m_oIFrameTemplate.cloneNode(false);
-
                     oParent = oElement.parentNode;
 
-                    if (oParent) {
-
-                        oParent.appendChild(oIFrame);
+                    var parentNode = oParent || document.body;
 
-                    } else {
-
-                        document.body.appendChild(oIFrame);
-
-                    }
-                    
+                    this._addToParent(parentNode, oIFrame);
                     this.iframe = oIFrame;
-
                 }
 
-
                 /*
                      Show the <iframe> before positioning it since the "setXY" 
                      method of DOM requires the element be in the document 
                      and visible.
                 */
-
                 this.showIframe();
 
-
                 /*
                      Syncronize the size and position of the <iframe> to that 
                      of the Overlay.
                 */
-                
                 this.syncIframe();
-
+                this.stackIframe();
 
                 // Add event listeners to update the <iframe> when necessary
-
                 if (!this._hasIframeEventListeners) {
-
                     this.showEvent.subscribe(this.showIframe);
                     this.hideEvent.subscribe(this.hideIframe);
                     this.changeContentEvent.subscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = true;
-                    
                 }
-                
             }
 
-
             function onBeforeShow() {
-            
                 createIFrame.call(this);
-        
                 this.beforeShowEvent.unsubscribe(onBeforeShow);
-                
                 this._iframeDeferred = false;
-            
             }
-            
 
             if (bIFrame) { // <iframe> shim is enabled
-                
-                if (this.cfg.getProperty("visible")) {
 
+                if (this.cfg.getProperty("visible")) {
                     createIFrame.call(this);
-                
-                }
-                else {
-
+                } else {
                     if (!this._iframeDeferred) {
-
                         this.beforeShowEvent.subscribe(onBeforeShow);
-
                         this._iframeDeferred = true;
-                    
                     }
-                
                 }
-    
+
             } else {    // <iframe> shim is disabled
-    
                 this.hideIframe();
 
                 if (this._hasIframeEventListeners) {
-
                     this.showEvent.unsubscribe(this.showIframe);
                     this.hideEvent.unsubscribe(this.hideIframe);
                     this.changeContentEvent.unsubscribe(this.syncIframe);
 
                     this._hasIframeEventListeners = false;
-
                 }
-                
             }
-    
         },
-        
-        
+
+        /**
+         * Set's the container's XY value from DOM if not already set.
+         * 
+         * Differs from syncPosition, in that the XY value is only sync'd with DOM if 
+         * not already set. The method also refire's the XY config property event, so any
+         * beforeMove, Move event listeners are invoked.
+         * 
+         * @method _primeXYFromDOM
+         * @protected
+         */
+        _primeXYFromDOM : function() {
+            if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) {
+                // Set CFG XY based on DOM XY
+                this.syncPosition();
+                // Account for XY being set silently in syncPosition (no moveTo fired/called)
+                this.cfg.refireEvent("xy");
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
+            }
+        },
+
         /**
         * The default event handler fired when the "constraintoviewport" 
         * property is changed.
@@ -3198,28 +2958,22 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         configConstrainToViewport: function (type, args, obj) {
-    
             var val = args[0];
-    
+
             if (val) {
-    
-                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
-                    this.enforceConstraints, this)) {
-    
-                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
-                        this, true);
-    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
+                }
+                if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) {
+                    this.beforeShowEvent.subscribe(this._primeXYFromDOM);
                 }
-    
             } else {
-    
+                this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);
                 this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
-    
             }
-    
         },
-        
-        /**
+
+         /**
         * The default event handler fired when the "context" property 
         * is changed.
         * @method configContext
@@ -3235,39 +2989,28 @@ version: 2.3.0
                 contextEl,
                 elementMagnetCorner,
                 contextMagnetCorner;
-            
+
             if (contextArgs) {
-            
                 contextEl = contextArgs[0];
                 elementMagnetCorner = contextArgs[1];
                 contextMagnetCorner = contextArgs[2];
                 
                 if (contextEl) {
-    
                     if (typeof contextEl == "string") {
-    
                         this.cfg.setProperty("context", 
                             [document.getElementById(contextEl), 
                                 elementMagnetCorner, contextMagnetCorner], 
                                 true);
-    
                     }
                     
                     if (elementMagnetCorner && contextMagnetCorner) {
-    
                         this.align(elementMagnetCorner, contextMagnetCorner);
-    
                     }
-    
                 }
-    
             }
-    
         },
-        
-        
+
         // END BUILT-IN PROPERTY EVENT HANDLERS //
-        
         /**
         * Aligns the Overlay to its context element using the specified corner 
         * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
@@ -3279,45 +3022,34 @@ version: 2.3.0
         * that the elementAlign corner should stick to.
         */
         align: function (elementAlign, contextAlign) {
-    
+
             var contextArgs = this.cfg.getProperty("context"),
                 me = this,
                 context,
                 element,
                 contextRegion;
-    
-    
+
             function doAlign(v, h) {
     
                 switch (elementAlign) {
     
                 case Overlay.TOP_LEFT:
-    
                     me.moveTo(h, v);
-    
                     break;
     
                 case Overlay.TOP_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), v);
-    
                     break;
     
                 case Overlay.BOTTOM_LEFT:
-    
                     me.moveTo(h, (v - element.offsetHeight));
-    
                     break;
     
                 case Overlay.BOTTOM_RIGHT:
-    
                     me.moveTo((h - element.offsetWidth), 
                         (v - element.offsetHeight));
-    
                     break;
-    
                 }
-    
             }
     
     
@@ -3328,47 +3060,33 @@ version: 2.3.0
                 me = this;
                 
                 if (! elementAlign) {
-    
                     elementAlign = contextArgs[1];
-    
                 }
                 
                 if (! contextAlign) {
-    
                     contextAlign = contextArgs[2];
-    
                 }
                 
                 if (element && context) {
-    
                     contextRegion = Dom.getRegion(context);
-                    
+
                     switch (contextAlign) {
     
                     case Overlay.TOP_LEFT:
-    
                         doAlign(contextRegion.top, contextRegion.left);
-    
                         break;
     
                     case Overlay.TOP_RIGHT:
-    
                         doAlign(contextRegion.top, contextRegion.right);
-    
                         break;
     
                     case Overlay.BOTTOM_LEFT:
-    
                         doAlign(contextRegion.bottom, contextRegion.left);
-    
                         break;
     
                     case Overlay.BOTTOM_RIGHT:
-    
                         doAlign(contextRegion.bottom, contextRegion.right);
-    
                         break;
-    
                     }
     
                 }
@@ -3376,7 +3094,7 @@ version: 2.3.0
             }
             
         },
-        
+
         /**
         * The default event handler executed when the moveEvent is fired, if the 
         * "constraintoviewport" is set to true.
@@ -3388,70 +3106,96 @@ version: 2.3.0
         * this will usually equal the owner.
         */
         enforceConstraints: function (type, args, obj) {
-    
-            var pos = args[0],
-                x = pos[0],
-                y = pos[1],
-                offsetHeight = this.element.offsetHeight,
-                offsetWidth = this.element.offsetWidth,
+            var pos = args[0];
+            var cXY = this.getConstrainedXY(pos[0], pos[1]);
+            this.cfg.setProperty("x", cXY[0], true);
+            this.cfg.setProperty("y", cXY[1], true);
+            this.cfg.setProperty("xy", cXY, true);
+        },
+
+        /**
+         * Given x, y coordinate values, returns the calculated coordinates required to 
+         * position the Overlay if it is to be constrained to the viewport, based on the 
+         * current element size, viewport dimensions and scroll values.
+         *
+         * @param {Number} x The X coordinate value to be constrained
+         * @param {Number} y The Y coordinate value to be constrained
+         * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively;
+         */
+        getConstrainedXY: function(x, y) {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 viewPortWidth = Dom.getViewportWidth(),
                 viewPortHeight = Dom.getViewportHeight(),
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
                 scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-                topConstraint = scrollY + 10,
-                leftConstraint = scrollX + 10,
-                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
-                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-        
-    
-            if (x < leftConstraint) {
-    
-                x = leftConstraint;
-    
-            } else if (x > rightConstraint) {
-    
-                x = rightConstraint;
-    
+                scrollY = Dom.getDocumentScrollTop();
+
+            var xNew = x;
+            var yNew = y;
+
+            if (offsetWidth + nViewportOffset < viewPortWidth) {
+
+                var leftConstraint = scrollX + nViewportOffset;
+                var rightConstraint = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+
+                if (x < leftConstraint) {
+                    xNew = leftConstraint;
+                } else if (x > rightConstraint) {
+                    xNew = rightConstraint;
+                }
+            } else {
+                xNew = nViewportOffset + scrollX;
             }
-            
-            if (y < topConstraint) {
-    
-                y = topConstraint;
-    
-            } else if (y > bottomConstraint) {
-    
-                y = bottomConstraint;
-    
+
+            if (offsetHeight + nViewportOffset < viewPortHeight) {
+
+                var topConstraint = scrollY + nViewportOffset;
+                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+
+                if (y < topConstraint) {
+                    yNew  = topConstraint;
+                } else if (y  > bottomConstraint) {
+                    yNew  = bottomConstraint;
+                }
+            } else {
+                yNew = nViewportOffset + scrollY;
             }
-            
-            this.cfg.setProperty("x", x, true);
-            this.cfg.setProperty("y", y, true);
-            this.cfg.setProperty("xy", [x, y], true);
-    
+
+            return [xNew, yNew];
         },
-        
+
         /**
         * Centers the container in the viewport.
         * @method center
         */
         center: function () {
-    
-            var scrollX = Dom.getDocumentScrollLeft(),
-                scrollY = Dom.getDocumentScrollTop(),
-    
-                viewPortWidth = Dom.getClientWidth(),
-                viewPortHeight = Dom.getClientHeight(),
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                 elementWidth = this.element.offsetWidth,
                 elementHeight = this.element.offsetHeight,
-                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
-                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-            
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                x,
+                y;
+
+            if (elementWidth < viewPortWidth) {
+                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
+            } else {
+                x = nViewportOffset + Dom.getDocumentScrollLeft();
+            }
+
+            if (elementHeight < viewPortHeight) {
+                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
+            } else {
+                y = nViewportOffset + Dom.getDocumentScrollTop();
+            }
+
             this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
-            
             this.cfg.refireEvent("iframe");
-    
         },
-        
+
         /**
         * Synchronizes the Panel's "xy", "x", and "y" properties with the 
         * Panel's position in the DOM. This is primarily used to update  
@@ -3459,15 +3203,15 @@ version: 2.3.0
         * @method syncPosition
         */
         syncPosition: function () {
-    
+
             var pos = Dom.getXY(this.element);
-    
+
             this.cfg.setProperty("x", pos[0], true);
             this.cfg.setProperty("y", pos[1], true);
             this.cfg.setProperty("xy", pos, true);
-    
+
         },
-        
+
         /**
         * Event handler fired when the resize monitor element is resized.
         * @method onDomResize
@@ -3475,11 +3219,11 @@ version: 2.3.0
         * @param {Object} obj The scope object
         */
         onDomResize: function (e, obj) {
-    
+
             var me = this;
-    
+
             Overlay.superclass.onDomResize.call(this, e, obj);
-    
+
             setTimeout(function () {
                 me.syncPosition();
                 me.cfg.refireEvent("iframe");
@@ -3493,96 +3237,82 @@ version: 2.3.0
         * YAHOO.widget.Overlay.
         * @method bringToTop
         */
-        bringToTop: function() {
-    
+        bringToTop: function () {
+
             var aOverlays = [],
                 oElement = this.element;
-    
+
             function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
-        
+
                 var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
-        
                     sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
-        
-                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
-                        0 : parseInt(sZIndex1, 10),
-        
-                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
-                        0 : parseInt(sZIndex2, 10);
-        
+
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
+
                 if (nZIndex1 > nZIndex2) {
-        
                     return -1;
-        
                 } else if (nZIndex1 < nZIndex2) {
-        
                     return 1;
-        
                 } else {
-        
                     return 0;
-        
                 }
-        
             }
-        
+
             function isOverlayElement(p_oElement) {
-        
+
                 var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                     Panel = YAHOO.widget.Panel;
-            
+
                 if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
-                
                     if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
-        
-                        aOverlays[aOverlays.length] = p_oElement.parentNode;
-                    
-                    }
-                    else {
-        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    } else {
                         aOverlays[aOverlays.length] = p_oElement;
-        
                     }
-                
                 }
-            
             }
-            
+
             Dom.getElementsBy(isOverlayElement, "DIV", document.body);
-    
+
             aOverlays.sort(compareZIndexDesc);
-            
+
             var oTopOverlay = aOverlays[0],
                 nTopZIndex;
-            
+
             if (oTopOverlay) {
-    
                 nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
-    
-                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
-    
-                    this.cfg.setProperty("zindex", 
-                        (parseInt(nTopZIndex, 10) + 2));
-    
+
+                if (!isNaN(nTopZIndex)) {
+                    var bRequiresBump = false;
+
+                    if (oTopOverlay != oElement) {
+                        bRequiresBump = true;
+                    } else if (aOverlays.length > 1) {
+                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
+                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                            bRequiresBump = true;
+                        }
+                    }
+                    if (bRequiresBump) {
+                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                    }
                 }
-            
             }
-        
         },
-        
+
         /**
         * Removes the Overlay element from the DOM and sets all child 
         * elements to null.
         * @method destroy
         */
         destroy: function () {
-    
+
             if (this.iframe) {
-    
                 this.iframe.parentNode.removeChild(this.iframe);
-    
             }
-        
+
             this.iframe = null;
         
             Overlay.windowResizeEvent.unsubscribe(
@@ -3600,14 +3330,12 @@ version: 2.3.0
         * @return {String} The string representation of the Overlay.
         */
         toString: function () {
-    
             return "Overlay " + this.id;
-    
         }
-    
+
     });
-    
 }());
+
 (function () {
     
     /**
@@ -3623,19 +3351,15 @@ version: 2.3.0
     * configuration of the OverlayManager
     */
     YAHOO.widget.OverlayManager = function (userConfig) {
-    
         this.init(userConfig);
-    
     };
 
-
     var Overlay = YAHOO.widget.Overlay,
         Event = YAHOO.util.Event,
         Dom = YAHOO.util.Dom,
         Config = YAHOO.util.Config,
         CustomEvent = YAHOO.util.CustomEvent,
         OverlayManager = YAHOO.widget.OverlayManager;
-
     
     /**
     * The CSS class representing a focused Overlay
@@ -3684,9 +3408,9 @@ version: 2.3.0
             * @default "mousedown"
             */
             this.cfg.addProperty("focusevent", { value: "mousedown" } );
-        
+
         },
-        
+
         /**
         * Initializes the OverlayManager
         * @method init
@@ -3704,14 +3428,14 @@ version: 2.3.0
             * @type Config
             */
             this.cfg = new Config(this);
-        
+
             this.initDefaultConfig();
-        
+
             if (userConfig) {
                 this.cfg.applyConfig(userConfig, true);
             }
             this.cfg.fireQueue();
-        
+
             /**
             * The currently activated Overlay
             * @property activeOverlay
@@ -3719,7 +3443,7 @@ version: 2.3.0
             * @type YAHOO.widget.Overlay
             */
             var activeOverlay = null;
-        
+
             /**
             * Returns the currently focused Overlay
             * @method getActive
@@ -3728,7 +3452,7 @@ version: 2.3.0
             this.getActive = function () {
                 return activeOverlay;
             };
-        
+
             /**
             * Focuses the specified Overlay
             * @method focus
@@ -3736,32 +3460,22 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to focus
             */
             this.focus = function (overlay) {
-        
                 var o = this.find(overlay);
-        
                 if (o) {
-        
                     if (activeOverlay != o) {
-        
                         if (activeOverlay) {
-        
                             activeOverlay.blur();
-        
                         }
-        
                         this.bringToTop(o);
-                        
+
                         activeOverlay = o;
-        
+
                         Dom.addClass(activeOverlay.element, 
                             OverlayManager.CSS_FOCUSED);
 
                         o.focusEvent.fire();
-                        
                     }
-        
                 }
-        
             };
         
             /**
@@ -3771,53 +3485,47 @@ version: 2.3.0
             * @param {String} overlay The id of the Overlay to remove
             */
             this.remove = function (overlay) {
-    
-                var o = this.find(overlay),
-                    originalZ;
-        
+                var o = this.find(overlay), 
+                        originalZ;
                 if (o) {
-
                     if (activeOverlay == o) {
-                    
                         activeOverlay = null;
-                    
                     }
 
-                    originalZ = Dom.getStyle(o.element, "zIndex");
+                    var bDestroyed = (o.element === null && o.cfg === null) ? true : false;
 
-                    o.cfg.setProperty("zIndex", -1000, true);
+                    if (!bDestroyed) {
+                        // Set it's zindex so that it's sorted to the end.
+                        originalZ = Dom.getStyle(o.element, "zIndex");
+                        o.cfg.setProperty("zIndex", -1000, true);
+                    }
 
                     this.overlays.sort(this.compareZIndexDesc);
+                    this.overlays = this.overlays.slice(0, (this.overlays.length - 1));
 
-                    this.overlays = 
-                        this.overlays.slice(0, (this.overlays.length - 1));
-        
                     o.hideEvent.unsubscribe(o.blur);
                     o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
-        
-                    if (o.element) {
-        
+
+                    if (!bDestroyed) {
                         Event.removeListener(o.element, 
-                            this.cfg.getProperty("focusevent"), 
-                            this._onOverlayElementFocus);
-        
+                                    this.cfg.getProperty("focusevent"), 
+                                    this._onOverlayElementFocus);
+
+                        o.cfg.setProperty("zIndex", originalZ, true);
+                        o.cfg.setProperty("manager", null);
                     }
-        
-                    o.cfg.setProperty("zIndex", originalZ, true);
-                    o.cfg.setProperty("manager", null);
-        
+
                     o.focusEvent.unsubscribeAll();
                     o.blurEvent.unsubscribeAll();
-        
+
                     o.focusEvent = null;
                     o.blurEvent = null;
-        
+
                     o.focus = null;
                     o.blur = null;
                 }
-
             };
-        
+
             /**
             * Removes focus from all registered Overlays in the manager
             * @method blurAll
@@ -3828,28 +3536,19 @@ version: 2.3.0
                     i;
 
                 if (nOverlays > 0) {
-
                     i = nOverlays - 1;
-                    
-                    do {
 
-                        this.overlays[i].blur();                    
-                    
+                    do {
+                        this.overlays[i].blur();
                     }
                     while(i--);
-                
                 }
-    
             };
         
-        
             this._onOverlayBlur = function (p_sType, p_aArgs) {
-
                 activeOverlay = null;
-
             };
         
-        
             var overlays = this.cfg.getProperty("overlays");
         
             if (! this.overlays) {
@@ -3876,20 +3575,12 @@ version: 2.3.0
         
             var oTarget = Event.getTarget(p_oEvent),
                 oClose = this.close;
-        
-            
-            if (oClose && (oTarget == oClose || 
-                    Dom.isAncestor(oClose, oTarget))) {
             
+            if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) {
                 this.blur();
-            
-            }
-            else {
-            
+            } else {
                 this.focus();
-            
             }
-        
         },
         
         
@@ -3905,9 +3596,7 @@ version: 2.3.0
         * fired the event.
         */
         _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
-        
             this.remove(p_oOverlay);
-        
         },
         
         /**
@@ -3931,10 +3620,10 @@ version: 2.3.0
             if (overlay instanceof Overlay) {
 
                 overlay.cfg.addProperty("manager", { value: this } );
-        
+
                 overlay.focusEvent = overlay.createEvent("focus");
                 overlay.focusEvent.signature = CustomEvent.LIST;
-        
+
                 overlay.blurEvent = overlay.createEvent("blur");
                 overlay.blurEvent.signature = CustomEvent.LIST;
         
@@ -3943,43 +3632,29 @@ version: 2.3.0
                 };
         
                 overlay.blur = function () {
-    
                     if (mgr.getActive() == this) {
-
-                        Dom.removeClass(this.element, 
-                            OverlayManager.CSS_FOCUSED);
-
+                        Dom.removeClass(this.element, OverlayManager.CSS_FOCUSED);
                         this.blurEvent.fire();
-
                     }
-
                 };
         
                 overlay.blurEvent.subscribe(mgr._onOverlayBlur);
-        
                 overlay.hideEvent.subscribe(overlay.blur);
                 
-                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
-                    overlay, this);
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, overlay, this);
         
                 Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
-                    this._onOverlayElementFocus, null, overlay);
+                            this._onOverlayElementFocus, null, overlay);
         
                 zIndex = Dom.getStyle(overlay.element, "zIndex");
 
                 if (!isNaN(zIndex)) {
-
                     overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
-
                 } else {
-
                     overlay.cfg.setProperty("zIndex", 0);
-
                 }
-        
 
                 this.overlays.push(overlay);
-
                 this.bringToTop(overlay);
 
                 return true;
@@ -3990,26 +3665,17 @@ version: 2.3.0
                 nOverlays = overlay.length;
 
                 for (i = 0; i < nOverlays; i++) {
-
                     if (this.register(overlay[i])) {
-
                         regcount++;
-
                     }
                 }
 
                 if (regcount > 0) {
-
                     return true;
-
                 }
-
             } else {
-
                 return false;
-
             }
-
         },
 
         /**
@@ -4031,30 +3697,36 @@ version: 2.3.0
             if (oOverlay) {
 
                 aOverlays = this.overlays;
-
                 aOverlays.sort(this.compareZIndexDesc);
-                
+
                 oTopOverlay = aOverlays[0];
-                
-                if (oTopOverlay) {
 
+                if (oTopOverlay) {
                     nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
-    
-                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
-    
-                        oOverlay.cfg.setProperty("zIndex", 
-                            (parseInt(nTopZIndex, 10) + 2));
-    
+
+                    if (!isNaN(nTopZIndex)) {
+
+                        var bRequiresBump = false;
+
+                        if (oTopOverlay !== oOverlay) {
+                            bRequiresBump = true;
+                        } else if (aOverlays.length > 1) {
+                            var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex");
+                            // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                            if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                                bRequiresBump = true;
+                            }
+                        }
+
+                        if (bRequiresBump) {
+                            oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                        }
                     }
-    
                     aOverlays.sort(this.compareZIndexDesc);
-                
                 }
-
             }
-        
         },
-        
+
         /**
         * Attempts to locate an Overlay by instance or ID.
         * @method find
@@ -4064,47 +3736,32 @@ version: 2.3.0
         * cannot be located.
         */
         find: function (overlay) {
-        
+
             var aOverlays = this.overlays,
                 nOverlays = aOverlays.length,
                 i;
 
             if (nOverlays > 0) {
-
                 i = nOverlays - 1;
 
                 if (overlay instanceof Overlay) {
-
                     do {
-
                         if (aOverlays[i] == overlay) {
-
                             return aOverlays[i];
-
                         }
-                    
                     }
                     while(i--);
 
                 } else if (typeof overlay == "string") {
-
                     do {
-
                         if (aOverlays[i].id == overlay) {
-
                             return aOverlays[i];
-
                         }
-
                     }
                     while(i--);
-
                 }
-
                 return null;
-            
             }
-
         },
         
         /**
@@ -4115,11 +3772,17 @@ version: 2.3.0
         * fall in the stacking order.
         */
         compareZIndexDesc: function (o1, o2) {
-    
-            var zIndex1 = o1.cfg.getProperty("zIndex"),
-                zIndex2 = o2.cfg.getProperty("zIndex");
-        
-            if (zIndex1 > zIndex2) {
+
+            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
+                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.
+
+            if (zIndex1 === null && zIndex2 === null) {
+                return 0;
+            } else if (zIndex1 === null){
+                return 1;
+            } else if (zIndex2 === null) {
+                return -1;
+            } else if (zIndex1 > zIndex2) {
                 return -1;
             } else if (zIndex1 < zIndex2) {
                 return 1;
@@ -4139,20 +3802,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].show();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Hides all Overlays in the manager.
         * @method hideAll
@@ -4164,20 +3821,14 @@ version: 2.3.0
                 i;
 
             if (nOverlays > 0) {
-            
                 i = nOverlays - 1;
-                
                 do {
-
                     aOverlays[i].hide();
-                
                 }
                 while(i--);
-            
             }
-    
         },
-        
+
         /**
         * Returns a string representation of the object.
         * @method toString
@@ -4186,10 +3837,10 @@ version: 2.3.0
         toString: function () {
             return "OverlayManager";
         }
-    
     };
 
 }());
+
 (function () {
 
     /**
@@ -4275,67 +3926,69 @@ version: 2.3.0
     * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
     */
     ContainerEffect.FADE = function (overlay, dur) {
-    
-        var fade = new ContainerEffect(overlay, 
-        
-            { attributes: { opacity: { from: 0, to: 1 } }, 
-                duration: dur, 
-                method: Easing.easeIn }, 
-            
-            { attributes: { opacity: { to: 0 } },
-                duration: dur, 
-                method: Easing.easeOut }, 
-            
-            overlay.element);
-        
-    
+
+        var fin = {
+            attributes: {opacity:{from:0, to:1}},
+            duration: dur,
+            method: Easing.easeIn
+        };
+
+        var fout = {
+            attributes: {opacity:{to:0}},
+            duration: dur,
+            method: Easing.easeOut
+        };
+
+        var fade = new ContainerEffect(overlay, fin, fout, overlay.element);
+
+        fade.handleUnderlayStart = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                var hasFilters = (underlay.filters && underlay.filters.length > 0);
+                if(hasFilters) {
+                    Dom.addClass(overlay.element, "yui-effect-fade");
+                }
+            }
+        };
+
+        fade.handleUnderlayComplete = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                Dom.removeClass(overlay.element, "yui-effect-fade");
+            }
+        };
+
         fade.handleStartAnimateIn = function (type,args,obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (! obj.overlay.underlay) {
+
+            if (!obj.overlay.underlay) {
                 obj.overlay.cfg.refireEvent("underlay");
             }
-        
-            if (obj.overlay.underlay) {
-    
-                obj.initialUnderlayOpacity = 
-                    Dom.getStyle(obj.overlay.underlay, "opacity");
-    
-                obj.overlay.underlay.style.filter = null;
-    
-            }
-        
+
+            obj.handleUnderlayStart();
+
             Dom.setStyle(obj.overlay.element, "visibility", "visible");
             Dom.setStyle(obj.overlay.element, "opacity", 0);
         };
-        
-    
+
         fade.handleCompleteAnimateIn = function (type,args,obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
-        
+
             if (obj.overlay.element.style.filter) {
                 obj.overlay.element.style.filter = null;
             }
-        
-            if (obj.overlay.underlay) {
-                Dom.setStyle(obj.overlay.underlay, "opacity", 
-                    obj.initialUnderlayOpacity);
-            }
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
             obj.animateInCompleteEvent.fire();
         };
-        
-    
+
         fade.handleStartAnimateOut = function (type, args, obj) {
             Dom.addClass(obj.overlay.element, "hide-select");
-        
-            if (obj.overlay.underlay) {
-                obj.overlay.underlay.style.filter = null;
-            }
+            obj.handleUnderlayStart();
         };
-        
-    
+
         fade.handleCompleteAnimateOut =  function (type, args, obj) {
             Dom.removeClass(obj.overlay.element, "hide-select");
             if (obj.overlay.element.style.filter) {
@@ -4343,12 +3996,13 @@ version: 2.3.0
             }
             Dom.setStyle(obj.overlay.element, "visibility", "hidden");
             Dom.setStyle(obj.overlay.element, "opacity", 1);
-        
+
+            obj.handleUnderlayComplete();
+
             obj.overlay.cfg.refireEvent("iframe");
-        
             obj.animateOutCompleteEvent.fire();
         };
-        
+
         fade.init();
         return fade;
     };
@@ -4420,11 +4074,9 @@ version: 2.3.0
     
             var vw = Dom.getViewportWidth(),
                 pos = Dom.getXY(obj.overlay.element),
-                yso = pos[1],
-                currentTo = obj.animOut.attributes.points.to;
+                yso = pos[1];
     
             obj.animOut.attributes.points.to = [(vw + 25), yso];
-    
         };
         
         slide.handleTweenAnimateOut = function (type, args, obj) {
@@ -4580,4 +4232,5 @@ version: 2.3.0
     YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
 
 })();
-YAHOO.register("container_core", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
+
+YAHOO.register("containercore", YAHOO.widget.Module, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/cookie/README b/lib/yui/cookie/README
new file mode 100644 (file)
index 0000000..11f7b28
--- /dev/null
@@ -0,0 +1,5 @@
+YUI Library - Cookie Utility - Release Notes
+
+2.5.0
+
+  * Beta release
\ No newline at end of file
diff --git a/lib/yui/cookie/cookie-beta-debug.js b/lib/yui/cookie/cookie-beta-debug.js
new file mode 100644 (file)
index 0000000..1dc530f
--- /dev/null
@@ -0,0 +1,361 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Utilities for cookie management
+ * @namespace YAHOO.util
+ * @module cookie
+ * @beta
+ */
+YAHOO.namespace("util");
+
+/**
+ * Cookie utility.
+ * @class Cookie
+ * @static
+ */
+YAHOO.util.Cookie = {
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Creates a cookie string that can be assigned into document.cookie.
+     * @param {String} name The name of the cookie.
+     * @param {String} value The value of the cookie.
+     * @param {encodeValue} encodeValue True to encode the value, false to leave as-is.
+     * @param {Object} options (Optional) Options for the cookie.
+     * @return {String} The formatted cookie string.
+     * @method _createCookieString
+     * @private
+     * @static
+     */
+    _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
+    
+        //shortcut
+        var lang = YAHOO.lang;
+    
+        var text /*:String*/ = encodeURIComponent(name) + "=" + (encodeValue ? encodeURIComponent(value) : value);
+        
+    
+        if (lang.isObject(options)){
+            //expiration date
+            if (options.expires instanceof Date){
+                text += "; expires=" + options.expires.toGMTString();
+            }
+        
+            //path
+            if (lang.isString(options.path) && options.path != ""){
+                text += "; path=" + options.path;
+            }
+    
+            //domain
+            if (lang.isString(options.domain) && options.domain != ""){
+                text += "; domain=" + options.domain;
+            }
+            
+            //secure
+            if (options.secure === true){
+                text += "; secure";
+            }
+        }
+        
+        return text;
+    },
+    
+    /**
+     * Formats a cookie value for an object containing multiple values.
+     * @param {Object} hash An object of key-value pairs to create a string for.
+     * @return {String} A string suitable for use as a cookie value.
+     * @method _createCookieHash
+     * @private
+     * @static
+     */
+    _createCookieHashString : function (hash /*:Object*/) /*:String*/ {
+        
+        //shortcuts
+        var lang = YAHOO.lang;
+        
+        if (!lang.isObject(hash)){
+            throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
+        }
+        
+        var text /*:Array*/ = new Array();
+        
+        for (var key in hash){
+            if (lang.hasOwnProperty(hash, key) && !lang.isFunction(hash[key]) && !lang.isUndefined(hash[key])){
+                text.push(encodeURIComponent(key) + "=" + encodeURIComponent(String(hash[key])));
+            }
+        }
+        
+        return text.join("&");
+    },
+    
+    /**
+     * Parses a cookie hash string into an object.
+     * @param {String} text The cookie hash string to parse. The string should already be URL-decoded.
+     * @return {Object} An object containing entries for each cookie value.
+     * @method _parseCookieHash
+     * @private
+     * @static
+     */
+    _parseCookieHash : function (text /*:String*/) /*:Object*/ {
+    
+        var hashParts /*:Array*/ = text.split("&");
+        var hashPart /*:Array*/ = null;
+        var hash /*:Object*/ = new Object();
+        
+        for (var i=0, len=hashParts.length; i < len; i++){
+            hashPart = hashParts[i].split("=");
+            hash[hashPart[0]] = hashPart[1];
+        }
+        
+        return hash;
+    },    
+    
+    /**
+     * Parses a cookie string into an object representing all accessible cookies.
+     * @param {String} text The cookie string to parse.
+     * @return {Object} An object containing entries for each accessible cookie.
+     * @method _parseCookieString
+     * @private
+     * @static
+     */
+    _parseCookieString : function (text /*:String*/) /*:Object*/ {
+    
+        var cookies /*:Object*/ = new Object();
+        
+        if (YAHOO.lang.isString(text) && text.length > 0) {
+        
+            if (/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(text)){            
+                var cookieParts /*:Array*/ = text.split(/;\s/g);
+                var cookieName /*:String*/ = null;
+                var cookieValue /*:String*/ = null;
+                
+                for (var i=0, len=cookieParts.length; i < len; i++){
+                    cookieName = decodeURIComponent(cookieParts[i].match(/([a-z]+)=/i)[1]);
+                    cookieValue = decodeURIComponent(cookieParts[i].substring(cookieName.length+1));
+                    cookies[cookieName] = cookieValue;
+                }
+            }
+        }
+        
+        return cookies;
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Returns the cookie value for the given name.
+     * @param {String} name The name of the cookie to retrieve.
+     * @param {Function} converter (Optional) A function to run on the value before returning
+     *      it. The function is not used if the cookie doesn't exist.
+     * @return {Variant} If no converter is specified, returns a string or null if
+     *      the cookie doesn't exist. If the converter is specified, returns the value
+     *      returned from the converter or null if the cookie doesn't exist.
+     * @method get
+     * @static
+     */
+    get : function (name /*:String*/, converter /*:Function*/) /*:Variant*/{
+        
+        var lang = YAHOO.lang;
+        var cookies /*:Object*/ = this._parseCookieString(document.cookie);        
+        
+        if (!lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");
+        }
+        
+        if (lang.isUndefined(cookies[name])) {
+            return null;
+        }
+        
+        if (!lang.isFunction(converter)){
+            return cookies[name];
+        } else {
+            return converter(cookies[name]);
+        }
+    },
+    
+    /**
+     * Returns the value of a subcookie.
+     * @param {String} name The name of the cookie to retrieve.
+     * @param {String} subName The name of the subcookie to retrieve.
+     * @param {Function} converter (Optional) A function to run on the value before returning
+     *      it. The function is not used if the cookie doesn't exist.
+     * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie
+     *      doesn't exist, null if also returned. If no converter is specified and the
+     *      subcookie exists, a string is returned. If a converter is specified and the
+     *      subcookie exists, the value returned from the converter is returned.
+     * @method getSub
+     * @static
+     */
+    getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {
+    
+        var lang = YAHOO.lang;    
+        var hash /*:Variant*/ = this.getSubs(name);  
+
+        if (hash !== null) {
+            
+            if (!lang.isString(subName) || subName === ""){
+                throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");
+            }
+            
+            if (lang.isUndefined(hash[subName])){
+                return null;
+            }            
+        
+            if (!lang.isFunction(converter)){
+                return hash[subName];
+            } else {
+                return converter(hash[subName]);
+            }
+        } else {
+            return null;
+        }
+    
+    },
+    
+    /**
+     * Returns an object containing name-value pairs stored in the cookie with the given name.
+     * @param {String} name The name of the cookie to retrieve.
+     * @return {Object} An object of name-value pairs if the cookie with the given name
+     *      exists, null if it does not.
+     * @method getHash
+     * @static
+     */
+    getSubs : function (name /*:String*/) /*:Object*/ {
+        return this.get(name, this._parseCookieHash);    
+    },
+    
+    /**
+     * Removes a cookie from the machine by setting its expiration date to
+     * sometime in the past.
+     * @param {String} name The name of the cookie to remove.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), 
+     *      and secure (true/false). The expires option will be overwritten
+     *      by the method.
+     * @return {String} The created cookie string.
+     * @method remove
+     * @static
+     */
+    remove : function (name /*:String*/, options /*:Object*/) /*:String*/ {
+        
+        //check cookie name
+        if (!YAHOO.lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
+        }
+        
+        //set options
+        options = options || {};
+        options.expires = new Date(0);
+        
+        //set cookie
+        return this.set(name, "", options);
+    },
+
+    /**
+     * Sets a cookie with a given name and value.
+     * @param {String} name The name of the cookie to set.
+     * @param {Variant} value The value to set for the cookie.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method set
+     * @static
+     */
+    set : function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
+    
+        var lang = YAHOO.lang;
+    
+        if (!lang.isString(name)){
+            throw new TypeError("Cookie.set(): Cookie name must be a string.");
+        }
+        
+        if (lang.isUndefined(value)){
+            throw new TypeError("Cookie.set(): Value cannot be undefined.");
+        }
+        
+    
+        var text /*:String*/ = this._createCookieString(name, value, true, options);
+        document.cookie = text;
+        return text;
+    },
+        
+    /**
+     * Sets a sub cookie with a given name to a particular value.
+     * @param {String} name The name of the cookie to set.
+     * @param {String} subName The name of the subcookie to set.
+     * @param {Variant} value The value to set.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method setSub
+     * @static
+     */
+    setSub : function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
+        
+        var lang = YAHOO.lang;
+
+        if (!lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
+        }
+
+        if (!lang.isString(subName) || subName === ""){
+            throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");
+        }
+        
+        if (lang.isUndefined(value)){
+            throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");
+        }
+
+        var hash /*:Object*/ = this.getSubs(name);
+        
+        if (!lang.isObject(hash)){
+            hash = new Object();
+        }
+        
+        hash[subName] = value;        
+        
+        return this.setSubs(name, hash, options);
+        
+    },
+    
+    /**
+     * Sets a cookie with a given name to contain a hash of name-value pairs.
+     * @param {String} name The name of the cookie to set.
+     * @param {Object} value An object containing name-value pairs.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method setSubs
+     * @static
+     */
+    setSubs : function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
+        
+        var lang = YAHOO.lang;
+        
+        if (!lang.isString(name)){
+            throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
+        }
+        
+        if (!lang.isObject(value)){
+            throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");
+        }
+    
+        var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);
+        document.cookie = text;
+        return text;        
+    }    
+
+};
+YAHOO.register("cookie", YAHOO.util.Cookie, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/cookie/cookie-beta-min.js b/lib/yui/cookie/cookie-beta-min.js
new file mode 100644 (file)
index 0000000..094c02b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){var F=YAHOO.lang;var E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expires instanceof Date){E+="; expires="+A.expires.toGMTString();}if(F.isString(A.path)&&A.path!=""){E+="; path="+A.path;}if(F.isString(A.domain)&&A.domain!=""){E+="; domain="+A.domain;}if(A.secure===true){E+="; secure";}}return E;},_createCookieHashString:function(B){var D=YAHOO.lang;if(!D.isObject(B)){throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");}var C=new Array();for(var A in B){if(D.hasOwnProperty(B,A)&&!D.isFunction(B[A])&&!D.isUndefined(B[A])){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String(B[A])));}}return C.join("&");},_parseCookieHash:function(E){var D=E.split("&");var F=null;var C=new Object();for(var B=0,A=D.length;B<A;B++){F=D[B].split("=");C[F[0]]=F[1];}return C;},_parseCookieString:function(E){var C=new Object();if(YAHOO.lang.isString(E)&&E.length>0){if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(E)){var G=E.split(/;\s/g);var F=null;var D=null;for(var B=0,A=G.length;B<A;B++){F=decodeURIComponent(G[B].match(/([a-z]+)=/i)[1]);D=decodeURIComponent(G[B].substring(F.length+1));C[F]=D;}}}return C;},get:function(A,B){var D=YAHOO.lang;var C=this._parseCookieString(document.cookie);if(!D.isString(A)||A===""){throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(D.isUndefined(C[A])){return null;}if(!D.isFunction(B)){return C[A];}else{return B(C[A]);}},getSub:function(A,C,B){var E=YAHOO.lang;var D=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(E.isUndefined(D[C])){return null;}if(!E.isFunction(B)){return D[C];}else{return B(D[C]);}}else{return null;}},getSubs:function(A){return this.get(A,this._parseCookieHash);},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");}A=A||{};A.expires=new Date(0);return this.set(B,"",A);},set:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){throw new TypeError("Cookie.set(): Value cannot be undefined.");}var D=this._createCookieString(B,C,true,A);document.cookie=D;return D;},setSub:function(B,D,C,A){var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!F.isString(D)||D===""){throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(F.isUndefined(C)){throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");}var E=this.getSubs(B);if(!F.isObject(E)){E=new Object();}E[D]=C;return this.setSubs(B,E,A);},setSubs:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");}if(!E.isObject(C)){throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");}var D=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;return D;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/cookie/cookie-beta.js b/lib/yui/cookie/cookie-beta.js
new file mode 100644 (file)
index 0000000..1dc530f
--- /dev/null
@@ -0,0 +1,361 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Utilities for cookie management
+ * @namespace YAHOO.util
+ * @module cookie
+ * @beta
+ */
+YAHOO.namespace("util");
+
+/**
+ * Cookie utility.
+ * @class Cookie
+ * @static
+ */
+YAHOO.util.Cookie = {
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Creates a cookie string that can be assigned into document.cookie.
+     * @param {String} name The name of the cookie.
+     * @param {String} value The value of the cookie.
+     * @param {encodeValue} encodeValue True to encode the value, false to leave as-is.
+     * @param {Object} options (Optional) Options for the cookie.
+     * @return {String} The formatted cookie string.
+     * @method _createCookieString
+     * @private
+     * @static
+     */
+    _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
+    
+        //shortcut
+        var lang = YAHOO.lang;
+    
+        var text /*:String*/ = encodeURIComponent(name) + "=" + (encodeValue ? encodeURIComponent(value) : value);
+        
+    
+        if (lang.isObject(options)){
+            //expiration date
+            if (options.expires instanceof Date){
+                text += "; expires=" + options.expires.toGMTString();
+            }
+        
+            //path
+            if (lang.isString(options.path) && options.path != ""){
+                text += "; path=" + options.path;
+            }
+    
+            //domain
+            if (lang.isString(options.domain) && options.domain != ""){
+                text += "; domain=" + options.domain;
+            }
+            
+            //secure
+            if (options.secure === true){
+                text += "; secure";
+            }
+        }
+        
+        return text;
+    },
+    
+    /**
+     * Formats a cookie value for an object containing multiple values.
+     * @param {Object} hash An object of key-value pairs to create a string for.
+     * @return {String} A string suitable for use as a cookie value.
+     * @method _createCookieHash
+     * @private
+     * @static
+     */
+    _createCookieHashString : function (hash /*:Object*/) /*:String*/ {
+        
+        //shortcuts
+        var lang = YAHOO.lang;
+        
+        if (!lang.isObject(hash)){
+            throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
+        }
+        
+        var text /*:Array*/ = new Array();
+        
+        for (var key in hash){
+            if (lang.hasOwnProperty(hash, key) && !lang.isFunction(hash[key]) && !lang.isUndefined(hash[key])){
+                text.push(encodeURIComponent(key) + "=" + encodeURIComponent(String(hash[key])));
+            }
+        }
+        
+        return text.join("&");
+    },
+    
+    /**
+     * Parses a cookie hash string into an object.
+     * @param {String} text The cookie hash string to parse. The string should already be URL-decoded.
+     * @return {Object} An object containing entries for each cookie value.
+     * @method _parseCookieHash
+     * @private
+     * @static
+     */
+    _parseCookieHash : function (text /*:String*/) /*:Object*/ {
+    
+        var hashParts /*:Array*/ = text.split("&");
+        var hashPart /*:Array*/ = null;
+        var hash /*:Object*/ = new Object();
+        
+        for (var i=0, len=hashParts.length; i < len; i++){
+            hashPart = hashParts[i].split("=");
+            hash[hashPart[0]] = hashPart[1];
+        }
+        
+        return hash;
+    },    
+    
+    /**
+     * Parses a cookie string into an object representing all accessible cookies.
+     * @param {String} text The cookie string to parse.
+     * @return {Object} An object containing entries for each accessible cookie.
+     * @method _parseCookieString
+     * @private
+     * @static
+     */
+    _parseCookieString : function (text /*:String*/) /*:Object*/ {
+    
+        var cookies /*:Object*/ = new Object();
+        
+        if (YAHOO.lang.isString(text) && text.length > 0) {
+        
+            if (/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(text)){            
+                var cookieParts /*:Array*/ = text.split(/;\s/g);
+                var cookieName /*:String*/ = null;
+                var cookieValue /*:String*/ = null;
+                
+                for (var i=0, len=cookieParts.length; i < len; i++){
+                    cookieName = decodeURIComponent(cookieParts[i].match(/([a-z]+)=/i)[1]);
+                    cookieValue = decodeURIComponent(cookieParts[i].substring(cookieName.length+1));
+                    cookies[cookieName] = cookieValue;
+                }
+            }
+        }
+        
+        return cookies;
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Returns the cookie value for the given name.
+     * @param {String} name The name of the cookie to retrieve.
+     * @param {Function} converter (Optional) A function to run on the value before returning
+     *      it. The function is not used if the cookie doesn't exist.
+     * @return {Variant} If no converter is specified, returns a string or null if
+     *      the cookie doesn't exist. If the converter is specified, returns the value
+     *      returned from the converter or null if the cookie doesn't exist.
+     * @method get
+     * @static
+     */
+    get : function (name /*:String*/, converter /*:Function*/) /*:Variant*/{
+        
+        var lang = YAHOO.lang;
+        var cookies /*:Object*/ = this._parseCookieString(document.cookie);        
+        
+        if (!lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");
+        }
+        
+        if (lang.isUndefined(cookies[name])) {
+            return null;
+        }
+        
+        if (!lang.isFunction(converter)){
+            return cookies[name];
+        } else {
+            return converter(cookies[name]);
+        }
+    },
+    
+    /**
+     * Returns the value of a subcookie.
+     * @param {String} name The name of the cookie to retrieve.
+     * @param {String} subName The name of the subcookie to retrieve.
+     * @param {Function} converter (Optional) A function to run on the value before returning
+     *      it. The function is not used if the cookie doesn't exist.
+     * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie
+     *      doesn't exist, null if also returned. If no converter is specified and the
+     *      subcookie exists, a string is returned. If a converter is specified and the
+     *      subcookie exists, the value returned from the converter is returned.
+     * @method getSub
+     * @static
+     */
+    getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {
+    
+        var lang = YAHOO.lang;    
+        var hash /*:Variant*/ = this.getSubs(name);  
+
+        if (hash !== null) {
+            
+            if (!lang.isString(subName) || subName === ""){
+                throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");
+            }
+            
+            if (lang.isUndefined(hash[subName])){
+                return null;
+            }            
+        
+            if (!lang.isFunction(converter)){
+                return hash[subName];
+            } else {
+                return converter(hash[subName]);
+            }
+        } else {
+            return null;
+        }
+    
+    },
+    
+    /**
+     * Returns an object containing name-value pairs stored in the cookie with the given name.
+     * @param {String} name The name of the cookie to retrieve.
+     * @return {Object} An object of name-value pairs if the cookie with the given name
+     *      exists, null if it does not.
+     * @method getHash
+     * @static
+     */
+    getSubs : function (name /*:String*/) /*:Object*/ {
+        return this.get(name, this._parseCookieHash);    
+    },
+    
+    /**
+     * Removes a cookie from the machine by setting its expiration date to
+     * sometime in the past.
+     * @param {String} name The name of the cookie to remove.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), 
+     *      and secure (true/false). The expires option will be overwritten
+     *      by the method.
+     * @return {String} The created cookie string.
+     * @method remove
+     * @static
+     */
+    remove : function (name /*:String*/, options /*:Object*/) /*:String*/ {
+        
+        //check cookie name
+        if (!YAHOO.lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
+        }
+        
+        //set options
+        options = options || {};
+        options.expires = new Date(0);
+        
+        //set cookie
+        return this.set(name, "", options);
+    },
+
+    /**
+     * Sets a cookie with a given name and value.
+     * @param {String} name The name of the cookie to set.
+     * @param {Variant} value The value to set for the cookie.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method set
+     * @static
+     */
+    set : function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
+    
+        var lang = YAHOO.lang;
+    
+        if (!lang.isString(name)){
+            throw new TypeError("Cookie.set(): Cookie name must be a string.");
+        }
+        
+        if (lang.isUndefined(value)){
+            throw new TypeError("Cookie.set(): Value cannot be undefined.");
+        }
+        
+    
+        var text /*:String*/ = this._createCookieString(name, value, true, options);
+        document.cookie = text;
+        return text;
+    },
+        
+    /**
+     * Sets a sub cookie with a given name to a particular value.
+     * @param {String} name The name of the cookie to set.
+     * @param {String} subName The name of the subcookie to set.
+     * @param {Variant} value The value to set.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method setSub
+     * @static
+     */
+    setSub : function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
+        
+        var lang = YAHOO.lang;
+
+        if (!lang.isString(name) || name === ""){
+            throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
+        }
+
+        if (!lang.isString(subName) || subName === ""){
+            throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");
+        }
+        
+        if (lang.isUndefined(value)){
+            throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");
+        }
+
+        var hash /*:Object*/ = this.getSubs(name);
+        
+        if (!lang.isObject(hash)){
+            hash = new Object();
+        }
+        
+        hash[subName] = value;        
+        
+        return this.setSubs(name, hash, options);
+        
+    },
+    
+    /**
+     * Sets a cookie with a given name to contain a hash of name-value pairs.
+     * @param {String} name The name of the cookie to set.
+     * @param {Object} value An object containing name-value pairs.
+     * @param {Object} options (Optional) An object containing one or more
+     *      cookie options: path (a string), domain (a string), expires (a Date object),
+     *      and secure (true/false).
+     * @return {String} The created cookie string.
+     * @method setSubs
+     * @static
+     */
+    setSubs : function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
+        
+        var lang = YAHOO.lang;
+        
+        if (!lang.isString(name)){
+            throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
+        }
+        
+        if (!lang.isObject(value)){
+            throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");
+        }
+    
+        var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);
+        document.cookie = text;
+        return text;        
+    }    
+
+};
+YAHOO.register("cookie", YAHOO.util.Cookie, {version: "2.5.0", build: "895"});
index 570d5011a5598368b105e5a055525c1b0338bb65..2a6e5bba53c5f5c3b64d04783efa0d39d9146514 100755 (executable)
@@ -1,5 +1,61 @@
 DataSource Release Notes
 
+**** version 2.5.0 ****
+
+* doBeforeCallback() - The second argument is now oFullResponse rather than oRawResponse.
+* handleResponse() -
+      o oCallback is now an object literal pointing to success and failure
+      handlers and can contain scope and argument values.
+      o The oCaller argument is now deprecated.
+      o When callback function is passed oRequest and oParsedResponse values,
+      the oParsedResponse object now consistently returns the following values:
+            + tId (Number)
+            + results (Array)
+            + error (Boolean)
+            + totalResults (Number) (when available)
+* makeConnection() -
+      o oCallback is now an object literal pointing to success and failure
+      handlers and can contain scope and argument values.
+      o The oCaller argument is now deprecated.
+* parseArrayData() - The second argument is now oFullResponse rather than oRawResponse.
+* parseHTMLTableData() - The second argument is now oFullResponse rather than oRawResponse.
+* parseJsonData() - The second argument is now oFullResponse rather than oRawResponse.
+* parseTextData() - The second argument is now oFullResponse rather than oRawResponse.
+* parseXMLData() - The second argument is now oFullResponse rather than oRawResponse.
+* sendRequest() -
+      o oCallback is now an object literal pointing to success and failure
+      handlers and can contain scope and argument values.
+      o The oCaller argument is now deprecated.
+* setInterval() -
+      o oCallback is now an object literal pointing to success and failure
+      handlers and can contain scope and argument values.
+      o The oCaller argument is now deprecated.
+* cacheRequestEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* dataErrorEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* getCachedResponseEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* requestEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* responseCacheEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* responseEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+* responseParseEvent - oArgs.caller is now deprecated in favor of oCallback object literal.
+
+
+
+**** version 2.4.0 ****
+
+* Support for YUI JSON Utility.
+
+* Implemented setInterval(), clearInterval(), and clearAllIntervals() for polling.
+
+* Text data parsing algorithm now tolerates newlines within and at the end of data.
+
+
+
+**** version 2.3.1 ****
+
+* No changes.
+
+
+
 **** version 2.3.0 ****
 
 * DataSource requests over XHR no longer automatically insert a "?" in the URIs
@@ -17,6 +73,13 @@ These are executed in the scope of the DataSource instance.
     "cancelStaleRequests"
     "ignoreStaleResponses"
 
+* Added property connMethodPost to support POST requests.
+
+* The parsed response object passed to the callback function now has the
+following properties:
+    tId {Number} Unique transaction ID
+    results {Array} Array of parsed data results
+    error {Boolean} True if there was an error
 
 
 
index b3fe9137ff58d949729ac4fc13f2072f0d1a3a0e..3a9293da9a5379645fa1f243a46651bd33f39d75 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The DataSource utility provides a common configurable interface for widgets
@@ -34,20 +34,14 @@ version: 2.3.0
  * @param oConfigs {Object} (optional) Object literal of configuration values.
  */
 YAHOO.util.DataSource = function(oLiveData, oConfigs) {
-    // Set any config params passed in to override defaults
-    if(oConfigs && (oConfigs.constructor == Object)) {
-        for(var sConfig in oConfigs) {
-            if(sConfig) {
-                this[sConfig] = oConfigs[sConfig];
-            }
-        }
-    }
-    
     if(!oLiveData) {
         YAHOO.log("Could not instantiate DataSource due to invalid live database",
                 "error", this.toString());
         return;
     }
+    
+    this.liveData = oLiveData;
+    this._oQueue = {interval:null, conn:null, requests:[]};
 
     if(oLiveData.nodeType && oLiveData.nodeType == 9) {
         this.dataType = YAHOO.util.DataSource.TYPE_XML;
@@ -63,6 +57,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
     }
     else if(oLiveData.nodeName && (oLiveData.nodeName.toLowerCase() == "table")) {
         this.dataType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+        this.liveData = oLiveData.cloneNode(true);
     }
     else if(YAHOO.lang.isObject(oLiveData)) {
         this.dataType = YAHOO.util.DataSource.TYPE_JSON;
@@ -71,21 +66,23 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
         this.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
     }
 
-    this.liveData = oLiveData;
-    this._oQueue = {interval:null, conn:null, requests:[]};
-
-
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+    
     // Validate and initialize public configs
     var maxCacheEntries = this.maxCacheEntries;
     if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
         maxCacheEntries = 0;
     }
 
-    // Initialize local cache
-    if(maxCacheEntries > 0 && !this._aCache) {
-        this._aCache = [];
-        YAHOO.log("Cache initialized", "info", this.toString());
-    }
+    // Initialize interval tracker
+    this._aIntervals = [];
 
     this._sName = "DataSource instance" + YAHOO.util.DataSource._nIndex;
     YAHOO.util.DataSource._nIndex++;
@@ -104,18 +101,18 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event cacheRequestEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("cacheRequestEvent");
 
     /**
      * Fired when data is retrieved from the local cache.
      *
-     * @event getCachedResponseEvent
+     * @event cacheResponseEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      * @param oArgs.tId {Number} Transaction ID.
      */
     this.createEvent("cacheResponseEvent");
@@ -126,7 +123,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event requestEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("requestEvent");
 
@@ -137,7 +134,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The raw response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseEvent");
 
@@ -148,7 +145,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The parsed response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseParseEvent");
 
@@ -159,7 +156,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The parsed response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseCacheEvent");
     /**
@@ -168,7 +165,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event dataErrorEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      * @param oArgs.message {String} The error message.
      */
     this.createEvent("dataErrorEvent");
@@ -344,6 +341,15 @@ YAHOO.util.DataSource.prototype._aCache = null;
  */
 YAHOO.util.DataSource.prototype._oQueue = null;
 
+/**
+ * Array of polling interval IDs that have been enabled, needed to clear all intervals.
+ *
+ * @property _aIntervals
+ * @type Array
+ * @private
+ */
+YAHOO.util.DataSource.prototype._aIntervals = null;
+
 /////////////////////////////////////////////////////////////////////////////
 //
 // Private methods
@@ -402,6 +408,7 @@ YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOW
  *
  * <dl>
  * <dt>resultsList</dt> <dd>Pointer to array of tabular data</dd>
+ * <dt>totalRecords</dt> <dd>Pointer to number of records (JSON over XHR only)</dd>
  * <dt>resultNode</dt> <dd>Pointer to node name of row data (XML data only)</dd>
  * <dt>recordDelim</dt> <dd>Record delimiter (text data only)</dd>
  * <dt>fieldDelim</dt> <dd>Field delimiter (text data only)</dd>
@@ -415,8 +422,7 @@ YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOW
 YAHOO.util.DataSource.prototype.responseSchema = null;
 
  /**
- * Alias to YUI Connection Manager. Allows implementers to specify their own
- * subclasses of the YUI Connection Manager utility.
+ * Alias to YUI Connection Manager, to allow implementers to customize the utility.
  *
  * @property connMgr
  * @type Object
@@ -602,34 +608,55 @@ YAHOO.util.DataSource.prototype.toString = function() {
  */
 YAHOO.util.DataSource.prototype.getCachedResponse = function(oRequest, oCallback, oCaller) {
     var aCache = this._aCache;
-    var nCacheLength = (aCache) ? aCache.length : 0;
-    var oResponse = null;
 
     // If cache is enabled...
-    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
-        this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
-
-        // Loop through each cached element
-        for(var i = nCacheLength-1; i >= 0; i--) {
-            var oCacheElem = aCache[i];
-
-            // Defer cache hit logic to a public overridable method
-            if(this.isCacheHit(oRequest,oCacheElem.request)) {
-                // Grab the cached response
-                oResponse = oCacheElem.response;
-                // The cache returned a hit!
-                // Remove element from its original location
-                aCache.splice(i,1);
-                // Add as newest
-                this.addToCache(oRequest, oResponse);
-                this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
-                break;
+    if(this.maxCacheEntries > 0) {        
+        // Initialize local cache
+        if(!aCache) {
+            this._aCache = [];
+            YAHOO.log("Cache initialized", "info", this.toString());
+        }
+        // Look in local cache
+        else {
+            var nCacheLength = aCache.length;
+            if(nCacheLength > 0) {
+                var oResponse = null;
+                this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+        
+                // Loop through each cached element
+                for(var i = nCacheLength-1; i >= 0; i--) {
+                    var oCacheElem = aCache[i];
+        
+                    // Defer cache hit logic to a public overridable method
+                    if(this.isCacheHit(oRequest,oCacheElem.request)) {
+                        // The cache returned a hit!
+                        // Grab the cached response
+                        oResponse = oCacheElem.response;
+                        this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
+                        
+                        // Refresh the position of the cache hit
+                        if(i < nCacheLength-1) {
+                            YAHOO.log("Refreshing cache position of the response for \"" +  oRequest + "\"", "info", this.toString());
+                            // Remove element from its original location
+                            aCache.splice(i,1);
+                            YAHOO.log("Cleared from cache the response for \"" +  oRequest + "\"", "info", this.toString());
+                            // Add as newest
+                            this.addToCache(oRequest, oResponse);
+                        }
+                        break;
+                    }
+                }
+                YAHOO.log("The cached response for \"" + YAHOO.lang.dump(oRequest) +
+                        "\" is " + YAHOO.lang.dump(oResponse), "info", this.toString());
+                return oResponse;
             }
         }
     }
-    YAHOO.log("The cached response for \"" + YAHOO.lang.dump(oRequest) +
-            "\" is " + YAHOO.lang.dump(oResponse), "info", this.toString());
-    return oResponse;
+    else if(aCache) {
+        this._aCache = null;
+        YAHOO.log("Cache destroyed", "info", this.toString());
+    }
+    return null;
 };
 
 /**
@@ -660,8 +687,6 @@ YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
         return;
     }
 
-    //TODO: check for duplicate entries
-
     // If the cache is full, make room by removing stalest element (index=0)
     while(aCache.length >= this.maxCacheEntries) {
         aCache.shift();
@@ -669,7 +694,7 @@ YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
 
     // Add to cache in the newest position, at the end of the array
     var oCacheElem = {request:oRequest,response:oResponse};
-    aCache.push(oCacheElem);
+    aCache[aCache.length] = oCacheElem;
     this.fireEvent("responseCacheEvent", {request:oRequest,response:oResponse});
     YAHOO.log("Cached the response for \"" +  oRequest + "\"", "info", this.toString());
 };
@@ -687,20 +712,111 @@ YAHOO.util.DataSource.prototype.flushCache = function() {
     }
 };
 
+/**
+ * Sets up a polling mechanism to send requests at set intervals and forward
+ * responses to given callback.
+ *
+ * @method setInterval
+ * @param nMsec {Number} Length of interval in milliseconds.
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
+ * @return {Number} Interval ID.
+ */
+YAHOO.util.DataSource.prototype.setInterval = function(nMsec, oRequest, oCallback, oCaller) {
+    if(YAHOO.lang.isNumber(nMsec) && (nMsec >= 0)) {
+        YAHOO.log("Enabling polling to live data for \"" + oRequest + "\" at interval " + nMsec, "info", this.toString());
+        var oSelf = this;
+        var nId = setInterval(function() {
+            oSelf.makeConnection(oRequest, oCallback, oCaller);
+        }, nMsec);
+        this._aIntervals.push(nId);
+        return nId;
+    }
+    else {
+        YAHOO.log("Could not enable polling to live data for \"" + oRequest + "\" at interval " + nMsec, "info", this.toString());
+    }
+};
+
+/**
+ * Disables polling mechanism associated with the given interval ID.
+ *
+ * @method clearInterval
+ * @param nId {Number} Interval ID.
+ */
+YAHOO.util.DataSource.prototype.clearInterval = function(nId) {
+    // Remove from tracker if there
+    var tracker = this._aIntervals || [];
+    for(var i=tracker.length-1; i>-1; i--) {
+        if(tracker[i] === nId) {
+            tracker.splice(i,1);
+            clearInterval(nId);
+        }
+    }
+};
+
+/**
+ * Disables all known polling intervals.
+ *
+ * @method clearAllIntervals
+ */
+YAHOO.util.DataSource.prototype.clearAllIntervals = function(nId) {
+    var tracker = this._aIntervals || [];
+    for(var i=tracker.length-1; i>-1; i--) {
+        tracker.splice(i,1);
+        clearInterval(nId);
+    }
+};
+
+/**
+ * Executes a configured callback.  For object literal callbacks, the third
+ * param determines whether to execute the success handler or failure handler.
+ * @method issueCallback
+ * @param callback {Function|Object} the callback to execute
+ * @param params {Array} params to be passed to the callback method
+ * @param error {Boolean} whether an error occurred
+ * @param scope {Object} the scope from which to execute the callback
+ * (deprecated - use an object literal callback)
+ */
+YAHOO.util.DataSource.issueCallback = function (callback,params,error,scope) {
+    if (YAHOO.lang.isFunction(callback)) {
+        callback.apply(scope, params);
+    } else if (YAHOO.lang.isObject(callback)) {
+        scope = callback.scope || scope || window;
+        var callbackFunc = callback.success;
+        if (error) {
+            callbackFunc = callback.failure;
+        }
+        if (callbackFunc) {
+            callbackFunc.apply(scope, params.concat([callback.argument]));
+        }
+    }
+};
+
 /**
  * First looks for cached response, then sends request to live data.
  *
  * @method sendRequest
  * @param oRequest {Object} Request object.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The Calling object that is making the request.
+ * @param oCallback {Object} An object literal with the following properties:
+ *     <dl>
+ *     <dt><code>success</code></dt>
+ *     <dd>The function to call when the data is ready.</dd>
+ *     <dt><code>failure</code></dt>
+ *     <dd>The function to call upon a response failure condition.</dd>
+ *     <dt><code>scope</code></dt>
+ *     <dd>The object to serve as the scope for the success and failure handlers.</dd>
+ *     <dt><code>argument</code></dt>
+ *     <dd>Arbitrary data that will be passed back to the success and failure handlers.</dd>
+ *     </dl> 
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @return {Number} Transaction ID, or null if response found in cache.
  */
 YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCaller) {
     // First look in cache
     var oCachedResponse = this.getCachedResponse(oRequest, oCallback, oCaller);
     if(oCachedResponse) {
-        oCallback.call(oCaller, oRequest, oCachedResponse);
+        YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);
         return null;
     }
 
@@ -717,8 +833,8 @@ YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCal
  *
  * @method makeConnection
  * @param oRequest {Object} Request object.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The Calling object that is making the request.
+ * @param oCallback {Object} Callback object literal.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @return {Number} Transaction ID.
  */
 YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, oCaller) {
@@ -767,7 +883,8 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
                     YAHOO.log(YAHOO.util.DataSource.ERROR_DATANULL, "error", this.toString());
 
                     // Send error response back to the caller with the error flag on
-                    oCallback.call(oCaller, oRequest, oResponse, true);
+                    // TODO: should this send oResponse, considering the fork?
+                    YAHOO.util.DataSource.issueCallback(oCallback,[oRequest, {error:true}], true, oCaller);
 
                     return null;
                 }
@@ -800,7 +917,10 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
                 }
 
                 // Send failure response back to the caller with the error flag on
-                oCallback.call(oCaller, oRequest, oResponse, true);
+                oResponse = oResponse || {};
+                oResponse.error = true;
+                YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oResponse],true, oCaller);
+
                 return null;
             };
 
@@ -891,7 +1011,7 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
             else {
                 YAHOO.log("Could not find Connection Manager asyncRequest() function", "error", this.toString());
                 // Send null response back to the caller with the error flag on
-                oCallback.call(oCaller, oRequest, null, true);
+                YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);
             }
 
             break;
@@ -912,23 +1032,24 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
 };
 
 /**
- * Handles raw data response from live data source. Sends a parsed response object
- * to the callback function in this format:
- *
- * fnCallback(oRequest, oParsedResponse)
- *
- * where the oParsedResponse object literal with the following properties:
- * <ul>
- *     <li>tId {Number} Unique transaction ID</li>
- *     <li>results {Array} Array of parsed data results</li>
- *     <li>error {Boolean} True if there was an error</li>
- * </ul>
+ * Receives raw data response and type converts to XML, JSON, etc as necessary.
+ * Forwards oFullResponse to appropriate parsing function to get turned into
+ * oParsedResponse. Calls doBeforeCallback() and adds oParsedResponse to 
+ * the cache when appropriate before calling issueCallback().
+ * 
+ * The oParsedResponse object literal has the following properties:
+ * <dl>
+ *     <dd><dt>tId {Number}</dt> Unique transaction ID</dd>
+ *     <dd><dt>results {Array}</dt> Array of parsed data results</dd>
+ *     <dd><dt>error {Boolean}</dt> True if there was an error</dd>
+ *     <dd><dt>totalRecords {Number}</dt> Total number of records (if available)</dd> 
+ * </dl>
  *
  * @method handleResponse
  * @param oRequest {Object} Request object
  * @param oRawResponse {Object} The raw response from the live database.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The calling object that is making the request.
+ * @param oCallback {Object} Callback object literal.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @param tId {Number} Transaction ID.
  */
 YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse, oCallback, oCaller, tId) {
@@ -937,88 +1058,131 @@ YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse
     YAHOO.log("Received live data response for \"" + oRequest + "\"", "info", this.toString());
     var xhr = (this.dataType == YAHOO.util.DataSource.TYPE_XHR) ? true : false;
     var oParsedResponse = null;
-    var bError = false;
-
-    // Access to the raw response before it gets parsed
-    oRawResponse = this.doBeforeParseData(oRequest, oRawResponse);
+    var oFullResponse = oRawResponse;
 
     switch(this.responseType) {
         case YAHOO.util.DataSource.TYPE_JSARRAY:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText; 
             }
-            oParsedResponse = this.parseArrayData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseArrayData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_JSON:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
             }
-            oParsedResponse = this.parseJSONData(oRequest, oRawResponse);
+            try {
+                // Convert to JSON object if it's a string
+                if(YAHOO.lang.isString(oFullResponse)) {
+                    // Check for YUI JSON Util
+                    if(YAHOO.lang.JSON) {
+                        oFullResponse = YAHOO.lang.JSON.parse(oFullResponse);
+                    }
+                    // Look for JSON parsers using an API similar to json2.js
+                    else if(window.JSON && JSON.parse) {
+                        oFullResponse = JSON.parse(oFullResponse);
+                    }
+                    // Look for JSON parsers using an API similar to json.js
+                    else if(oFullResponse.parseJSON) {
+                        oFullResponse = oFullResponse.parseJSON();
+                    }
+                    // No JSON lib found so parse the string
+                    else {
+                        // Trim leading spaces
+                        while (oFullResponse.length > 0 &&
+                                (oFullResponse.charAt(0) != "{") &&
+                                (oFullResponse.charAt(0) != "[")) {
+                            oFullResponse = oFullResponse.substring(1, oFullResponse.length);
+                        }
+    
+                        if(oFullResponse.length > 0) {
+                            // Strip extraneous stuff at the end
+                            var objEnd = Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));
+                            oFullResponse = oFullResponse.substring(0,objEnd+1);
+    
+                            // Turn the string into an object literal...
+                            // ...eval is necessary here
+                            oFullResponse = eval("(" + oFullResponse + ")");
+    
+                        }
+                    }
+                }
+            }
+            catch(e) {
+            }
+
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseJSONData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_HTMLTABLE:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
             }
-            oParsedResponse = this.parseHTMLTableData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseHTMLTableData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_XML:
             if(xhr && oRawResponse.responseXML) {
-                oRawResponse = oRawResponse.responseXML;
+                oFullResponse = oRawResponse.responseXML;
             }
-            oParsedResponse = this.parseXMLData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseXMLData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_TEXT:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
             }
-            oParsedResponse = this.parseTextData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseTextData(oRequest, oFullResponse);
             break;
         default:
             //var contentType = oRawResponse.getResponseHeader["Content-Type"];
-            YAHOO.log("Could not parse data for request \"" + oRequest +
-                    "\" due to unknown response type", "error", this.toString());
+            YAHOO.log("Passing along unknown response type", "warn", this.toString());
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.doBeforeParseData(oRequest, oFullResponse);
             break;
     }
 
-
-    if(oParsedResponse) {
+    if(oParsedResponse && !oParsedResponse.error) {
         // Last chance to touch the raw response or the parsed response
-        oParsedResponse.tId = tId;
-        oParsedResponse = this.doBeforeCallback(oRequest, oRawResponse, oParsedResponse);
+        oParsedResponse = this.doBeforeCallback(oRequest, oFullResponse, oParsedResponse);
         this.fireEvent("responseParseEvent", {request:oRequest,
                 response:oParsedResponse, callback:oCallback, caller:oCaller});
         // Cache the response
         this.addToCache(oRequest, oParsedResponse);
     }
     else {
-        this.fireEvent("dataErrorEvent", {request:oRequest, callback:oCallback,
+        this.fireEvent("dataErrorEvent", {request:oRequest, response: oRawResponse, callback:oCallback, 
                 caller:oCaller, message:YAHOO.util.DataSource.ERROR_DATANULL});
         YAHOO.log(YAHOO.util.DataSource.ERROR_DATANULL, "error", this.toString());
         
-        // Send response back to the caller with the error flag on
-        oParsedResponse = {error:true};
+        // Be sure the error flag is on
+        oParsedResponse = oParsedResponse || {};
+        oParsedResponse.error = true;
     }
-    
+
     // Send the response back to the caller
-    oCallback.call(oCaller, oRequest, oParsedResponse);
+    oParsedResponse.tId = tId;
+    YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);
 };
 
 /**
- * Overridable method gives implementers access to the original raw response
+ * Overridable method gives implementers access to the original full response
  * before the data gets parsed. Implementers should take care not to return an
- * unparsable or otherwise invalid raw response.
+ * unparsable or otherwise invalid response.
  *
  * @method doBeforeParseData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Raw response for parsing.
+ * @param oFullResponse {Object} The full response from the live database.
+ * @return {Object} Full response for parsing.
  */
-YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawResponse) {
-    return oRawResponse;
+YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oFullResponse) {
+    return oFullResponse;
 };
 
 /**
- * Overridable method gives implementers access to the original raw response and
+ * Overridable method gives implementers access to the original full response and
  * the parsed response (parsed against the given schema) before the data
  * is added to the cache (if applicable) and then sent back to callback function.
  * This is your chance to access the raw response and/or populate the parsed
@@ -1026,318 +1190,489 @@ YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawRespo
  *
  * @method doBeforeCallback
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
+ * @param oFullResponse {Object} The full response from the live database.
  * @param oParsedResponse {Object} The parsed response to return to calling object.
  * @return {Object} Parsed response object.
  */
-YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oRawResponse, oParsedResponse) {
+YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oFullResponse, oParsedResponse) {
     return oParsedResponse;
 };
 
 /**
- * Overridable method parses raw array data into a response object.
+ * Overridable method parses Array data into a response object.
  *
  * @method parseArrayData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full Array from the live database.
+ * @return {Object} Parsed response object with the following properties:<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oRawResponse) {
-    if(YAHOO.lang.isArray(oRawResponse) && YAHOO.lang.isArray(this.responseSchema.fields)) {
-        var oParsedResponse = {results:[]};
-        var fields = this.responseSchema.fields;
-        for(var i=oRawResponse.length-1; i>-1; i--) {
-            var oResult = {};
-            for(var j=fields.length-1; j>-1; j--) {
-                var field = fields[j];
-                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                var data = (YAHOO.lang.isValue(oRawResponse[i][j])) ? oRawResponse[i][j] : oRawResponse[i][key];
-                // Backward compatibility
-                if(!field.parser && field.converter) {
-                    field.parser = field.converter;
-                    YAHOO.log("The field property converter has been deprecated" +
-                            " in favor of parser", "warn", this.toString());
+YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oFullResponse) {
+    if(YAHOO.lang.isArray(oFullResponse)) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields)) {
+            var results = [],
+                fields = this.responseSchema.fields,
+                i;
+            for (i = fields.length - 1; i >= 0; --i) {
+                if (typeof fields[i] !== 'object') {
+                    fields[i] = { key : fields[i] };
                 }
-                if(field.parser) {
-                    data = field.parser.call(this, data);
+            }
+
+            var parsers = {};
+            for (i = fields.length - 1; i >= 0; --i) {
+                var p = fields[i].parser || fields[i].converter;
+                if (p) {
+                    parsers[fields[i].key] = p;
                 }
-                // Safety measure
-                if(data === undefined) {
-                    data = null;
+            }
+
+            var arrType = YAHOO.lang.isArray(oFullResponse[0]);
+            for(i=oFullResponse.length-1; i>-1; i--) {
+                var oResult = {};
+                var rec = oFullResponse[i];
+                if (typeof rec === 'object') {
+                    for(var j=fields.length-1; j>-1; j--) {
+                        var field = fields[j];
+                        var data = arrType ? rec[j] : rec[field.key];
+
+                        if (parsers[field.key]) {
+                            data = parsers[field.key].call(this,data);
+                        }
+
+                        // Safety measure
+                        if(data === undefined) {
+                            data = null;
+                        }
+
+                        oResult[field.key] = data;
+                    }
                 }
-                oResult[key] = data;
+                results[i] = oResult;
             }
-            oParsedResponse.results.unshift(oResult);
+
+            var oParsedResponse = {results:results};
+            YAHOO.log("Parsed array data is " +
+                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+            return oParsedResponse;
         }
-        YAHOO.log("Parsed array data is " +
-                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
-        return oParsedResponse;
-    }
-    else {
-        YAHOO.log("Array data could not be parsed: " +
-                YAHOO.lang.dump(oRawResponse), "error", this.toString());
-        return null;
     }
+    YAHOO.log("Array data could not be parsed: " + YAHOO.lang.dump(oFullResponse), 
+            "error", this.toString());
+    return null;
 };
 
 /**
- * Overridable method parses raw plain text data into a response object.
+ * Overridable method parses plain text data into a response object.
  *
  * @method parseTextData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full text response from the live database.
+ * @return {Object} Parsed response object with the following properties:<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oRawResponse) {
-    var oParsedResponse = {};
-    if(YAHOO.lang.isString(oRawResponse) &&
-            YAHOO.lang.isArray(this.responseSchema.fields) &&
-            YAHOO.lang.isString(this.responseSchema.recordDelim) &&
-            YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
-        oParsedResponse.results = [];
-        var recDelim = this.responseSchema.recordDelim;
-        var fieldDelim = this.responseSchema.fieldDelim;
-        var fields = this.responseSchema.fields;
-        if(oRawResponse.length > 0) {
-            // Delete the last line delimiter at the end of the data if it exists
-            var newLength = oRawResponse.length-recDelim.length;
-            if(oRawResponse.substr(newLength) == recDelim) {
-                oRawResponse = oRawResponse.substr(0, newLength);
-            }
-            // Split along record delimiter to get an array of strings
-            var recordsarray = oRawResponse.split(recDelim);
-            // Cycle through each record, except the first which contains header info
-            for(var i = recordsarray.length-1; i>-1; i--) {
-                var oResult = {};
-                for(var j=fields.length-1; j>-1; j--) {
-                    // Split along field delimter to get each data value
-                    var fielddataarray = recordsarray[i].split(fieldDelim);
-
-                    // Remove quotation marks from edges, if applicable
-                    var data = fielddataarray[j];
-                    if(data.charAt(0) == "\"") {
-                        data = data.substr(1);
-                    }
-                    if(data.charAt(data.length-1) == "\"") {
-                        data = data.substr(0,data.length-1);
-                    }
-                    var field = fields[j];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
-                        YAHOO.log("The field property converter has been deprecated" +
-                                " in favor of parser", "warn", this.toString());
-                    }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
-                    }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oFullResponse) {
+    if(YAHOO.lang.isString(oFullResponse)) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields) &&
+                YAHOO.lang.isString(this.responseSchema.recordDelim) &&
+                YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
+            var oParsedResponse = {results:[]};
+            var recDelim = this.responseSchema.recordDelim;
+            var fieldDelim = this.responseSchema.fieldDelim;
+            var fields = this.responseSchema.fields;
+            if(oFullResponse.length > 0) {
+                // Delete the last line delimiter at the end of the data if it exists
+                var newLength = oFullResponse.length-recDelim.length;
+                if(oFullResponse.substr(newLength) == recDelim) {
+                    oFullResponse = oFullResponse.substr(0, newLength);
+                }
+                // Split along record delimiter to get an array of strings
+                var recordsarray = oFullResponse.split(recDelim);
+                // Cycle through each record
+                for(var i = 0, len = recordsarray.length, recIdx = 0; i < len; ++i) {
+                    var oResult = {};
+                    var bError = false;
+                    if (YAHOO.lang.isString(recordsarray[i])) {
+                        // Split each record along field delimiter to get data array
+                        var fielddataarray = recordsarray[i].split(fieldDelim);
+                        for(var j=fields.length-1; j>-1; j--) {
+                            try {
+                                // Remove quotation marks from edges, if applicable
+                                var data = fielddataarray[j];
+                                if (YAHOO.lang.isString(data)) {
+                                    if(data.charAt(0) == "\"") {
+                                        data = data.substr(1);
+                                    }
+                                    if(data.charAt(data.length-1) == "\"") {
+                                        data = data.substr(0,data.length-1);
+                                    }
+                                    var field = fields[j];
+                                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                                    // Backward compatibility
+                                    if(!field.parser && field.converter) {
+                                        field.parser = field.converter;
+                                        YAHOO.log("The field property converter has been deprecated" +
+                                                " in favor of parser", "warn", this.toString());
+                                    }
+                                    if(field.parser) {
+                                        data = field.parser.call(this, data);
+                                    }
+                                    // Safety measure
+                                    if(data === undefined) {
+                                        data = null;
+                                    }
+                                    oResult[key] = data;
+                                }
+                                else {
+                                    bError = true;
+                                }
+                            }
+                            catch(e) {
+                                bError = true;
+                            }
+                        }
+                        if(!bError) {
+                            oParsedResponse.results[recIdx++] = oResult;
+                        }
                     }
-                    oResult[key] = data;
                 }
-                oParsedResponse.results.unshift(oResult);
             }
+            YAHOO.log("Parsed text data is " +
+                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+            return oParsedResponse;
         }
-        YAHOO.log("Parsed text data is " +
-                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
-    }
-    else {
-        YAHOO.log("Text data could not be parsed: " +
-                YAHOO.lang.dump(oRawResponse), "error", this.toString());
-        oParsedResponse.error = true;
     }
-    return oParsedResponse;
+    YAHOO.log("Text data could not be parsed: " + YAHOO.lang.dump(oFullResponse), 
+            "error", this.toString());
+    return null;
+            
 };
 
 /**
- * Overridable method parses raw XML data into a response object.
+ * Overridable method parses XML data into a response object.
  *
  * @method parseXMLData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full XML response from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oRawResponse) {
-        var bError = false;
-        var oParsedResponse = {};
-        var xmlList = (this.responseSchema.resultNode) ?
-                oRawResponse.getElementsByTagName(this.responseSchema.resultNode) :
-                null;
-        if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
-            bError = true;
-        }
-        // Loop through each result
-        else {
-            oParsedResponse.results = [];
-            for(var k = xmlList.length-1; k >= 0 ; k--) {
-                var result = xmlList.item(k);
-                var oResult = {};
-                // Loop through each data field in each result using the schema
-                for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
-                    var field = this.responseSchema.fields[m];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    var data = null;
-                    // Values may be held in an attribute...
-                    var xmlAttr = result.attributes.getNamedItem(key);
-                    if(xmlAttr) {
-                        data = xmlAttr.value;
-                    }
-                    // ...or in a node
-                    else {
-                        var xmlNode = result.getElementsByTagName(key);
-                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
-                            data = xmlNode.item(0).firstChild.nodeValue;
-                        }
-                        else {
-                               data = "";
+YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oFullResponse) {
+    var bError = false;
+    var oParsedResponse = {};
+    var xmlList = null;
+    var totRecLocator = this.responseSchema.totalRecords;
+
+    // In case oFullResponse is something funky
+    try {
+        xmlList = (this.responseSchema.resultNode) ?
+            oFullResponse.getElementsByTagName(this.responseSchema.resultNode) :
+            null;
+
+        if (totRecLocator) {
+            // Look for a totalRecords node
+            var totalRecords = null;
+            var totRec = oFullResponse.getElementsByTagName(totRecLocator)[0];
+            if (totRec) {
+                totalRecords = totRec.firstChild.nodeValue;
+            } else {
+                totRec = oFullResponse.firstChild.attributes.getNamedItem(totRecLocator);
+                if (totRec) {
+                    totalRecords = totRec.value;
+                } else if (xmlList && xmlList.length) {
+                    var par = xmlList.item(0).parentNode;
+                    if (par) {
+                        totRec = par.attributes.getNamedItem(totRecLocator);
+                        if (totRec) {
+                            totalRecords = totRec.value;
                         }
                     }
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
-                        YAHOO.log("The field property converter has been deprecated" +
-                                " in favor of parser", "warn", this.toString());
-                    }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
+                }
+            }
+
+            if (YAHOO.lang.isValue(totalRecords)) {
+                oParsedResponse.totalRecords = parseInt(totalRecords,10)|0;
+            }
+        }
+    }
+    catch(e) {
+        YAHOO.log("Error while parsing XML data: " + e.message);
+    }
+    if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
+        bError = true;
+    }
+    // Loop through each result
+    else {
+
+        oParsedResponse.results = [];
+        for(var k = xmlList.length-1; k >= 0 ; k--) {
+            var result = xmlList.item(k);
+            var oResult = {};
+            // Loop through each data field in each result using the schema
+            for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
+                var field = this.responseSchema.fields[m];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                var data = null;
+                // Values may be held in an attribute...
+                var xmlAttr = result.attributes.getNamedItem(key);
+                if(xmlAttr) {
+                    data = xmlAttr.value;
+                }
+                // ...or in a node
+                else {
+                    var xmlNode = result.getElementsByTagName(key);
+                    if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                        data = xmlNode.item(0).firstChild.nodeValue;
                     }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+                    else {
+                           data = "";
                     }
-                    oResult[key] = data;
                 }
-                // Capture each array of values into an array of results
-                oParsedResponse.results.unshift(oResult);
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                    YAHOO.log("The field property converter has been deprecated" +
+                            " in favor of parser", "warn", this.toString());
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
             }
+            // Capture each array of values into an array of results
+            oParsedResponse.results[k] = oResult;
         }
-        if(bError) {
-            YAHOO.log("XML data could not be parsed: " +
-                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
-            oParsedResponse.error = true;
+    }
+    if(bError) {
+        YAHOO.log("XML data could not be parsed: " +
+                YAHOO.lang.dump(oFullResponse), "error", this.toString());
+        oParsedResponse.error = true;
+    }
+    else {
+        YAHOO.log("Parsed XML data is " +
+                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Executes a function created on the fly to parse the response JSON according to 
+ * the defined schema.
+ * @method executeJSONParser
+ * @param oFullResponse {Object} The raw JSON-typed data from the server.
+ * @return {Object}
+ * @private
+ */
+YAHOO.util.DataSource.prototype.executeJSONParser = function (oFullResponse) {
+    // Create the parsing method per the responseSchema only once
+    if (!this.jsonResponseParser) {
+        YAHOO.log("Creating json parsing function","info",this.toString());
+
+        var schema       = this.responseSchema,
+            fields       = schema.fields,
+            resultsList  = schema.resultsList,
+            totalRecords = schema.totalRecords,
+            keys         = [],
+            keyAssign,
+            i;
+
+        if (/\(/.test(resultsList)) {
+            YAHOO.log("Invalid contents in resultsList: '"+resultsList+"'","error",this.toString());
+            throw new SyntaxError("resultsList may only contain valid characters for variable names");
         }
-        else {
-            YAHOO.log("Parsed XML data is " +
-                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+
+        // Commit the atrocity of creating a function on the fly. parserDef
+        // will become the body passed to new Function.  The signature will be
+        // function (oFullResponse)
+        var parserDef = 
+            // grab the results list from the response
+            "var results=oFullResponse";
+        
+        // Default direct assignment of oFullResponse as the resultsList if
+        // the schema was not configured with a resultsList key.  Otherwise
+        // create results=oFullResponse.location['in'].resultsList
+        if (YAHOO.lang.isValue(resultsList)) {
+            parserDef += "." + resultsList;
+        }
+        parserDef += ";";
+
+        // if the list wasn't found at that location, default an empty array
+        parserDef +=
+            "if(!results){" +
+                "results=[];" +
+            "}" +
+
+            // make sure it's an array
+            "if(!YAHOO.lang.isArray(results)){" +
+                "results=[results];" +
+            "}";
+
+        // Check for non-flat field keys.  If no keys need depth greater than
+        // 1 (e.g. {key:"a.b.c"}), the raw data records can be used.
+        for (i = fields.length - 1; i >= 0; --i) {
+            keys[i] = typeof fields[i] === 'object' ? fields[i].key : fields[i];
+        }
+
+        // Test for any key having a '.' or '[' char
+        if (/\[|\./.test(keys.join(''))) {
+            // There are non-flat keys.  Iterate through the results, flattening
+            // the keys -- {key:'a.b.c'} pulls value into result data like
+            // { 'a.b.c': result.a.b.c, ... } (note the key is a flat string)
+            parserDef +=
+            "for(var i=results.length-1;i>=0;--i){" +
+                "var r=results[i];" +
+                "results[i]={";
+
+            keyAssign = [];
+            for (i = keys.length - 1; i >= 0; --i) {
+                // Escape the quotes in 'a["b"]' style notation for the key
+                // portion.
+                keyAssign[i] = '"'+keys[i].replace(/"/g,'\\"')+'":r.'+keys[i];
+            }
+            parserDef += keyAssign.join(',') +
+                "};" +
+            "}";
+        }
+
+        // Generate the oParsedResponse
+        parserDef +=
+            "return {" +
+                "results:results";
+
+        // Include totalRecords if defined in the schema
+        if (totalRecords) {
+            parserDef += "," +
+                "totalRecords:oFullResponse."+totalRecords;
         }
-        return oParsedResponse;
+        
+        parserDef +=
+            "};";
+
+        YAHOO.log("Parser defined as:\n"+parserDef,"info",this.toString());
+
+        this.jsonResponseParser = new Function("oFullResponse",parserDef);
+    }
+
+    return this.jsonResponseParser(oFullResponse);
 };
 
 /**
- * Overridable method parses raw JSON data into a response object.
+ * Overridable method parses JSON data into a response object.
  *
  * @method parseJSONData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full JSON from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse) {
-    var oParsedResponse = {};
-    if(oRawResponse && YAHOO.lang.isArray(this.responseSchema.fields)) {
-        var fields = this.responseSchema.fields;
-        var bError = false;
-        oParsedResponse.results = [];
-        var jsonObj,jsonList;
-
-        // Parse JSON object out if it's a string
-        if(YAHOO.lang.isString(oRawResponse)) {
-            // Check for latest JSON lib but divert KHTML clients
-            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
-            if(oRawResponse.parseJSON && isNotMac) {
-                // Use the new JSON utility if available
-                jsonObj = oRawResponse.parseJSON();
-                if(!jsonObj) {
-                    bError = true;
+YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oFullResponse) {
+    var oParsedResponse = {results:[]};
+    if(oFullResponse && (YAHOO.lang.isObject(oFullResponse))) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields)) {
+            var fields          = this.responseSchema.fields,
+                parserMap       = {},
+                bError          = false,
+                bHasParser      = false,
+                i;
+
+            // Build the parser map
+            for (i = fields.length - 1; i >= 0; --i) {
+                var key    = fields[i].key || fields[i],
+                    parser = fields[i].parser || fields[i].converter;
+
+                if (parser) {
+                    parserMap[key] = parser;
+                    bHasParser = true;
                 }
             }
-            // Check for older JSON lib but divert KHTML clients
-            else if(window.JSON && JSON.parse && isNotMac) {
-                // Use the JSON utility if available
-                jsonObj = JSON.parse(oRawResponse);
-                if(!jsonObj) {
-                    bError = true;
-                }
+
+            // Parse out a jsonList
+            try {
+                oParsedResponse = this.executeJSONParser(oFullResponse);
+            }
+            catch(e) {
+                bError = true;
             }
-            // No JSON lib found so parse the string
-            else {
-                try {
-                    // Trim leading spaces
-                    while (oRawResponse.length > 0 &&
-                            (oRawResponse.charAt(0) != "{") &&
-                            (oRawResponse.charAt(0) != "[")) {
-                        oRawResponse = oRawResponse.substring(1, oRawResponse.length);
-                    }
 
-                    if(oRawResponse.length > 0) {
-                        // Strip extraneous stuff at the end
-                        var objEnd = Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));
-                        oRawResponse = oRawResponse.substring(0,objEnd+1);
+            // Check for errors
+            if(bError || !oParsedResponse || !oParsedResponse.results) {
+                YAHOO.log("JSON data could not be parsed: " +
+                        YAHOO.lang.dump(oFullResponse), "error", this.toString());
+                if (!oParsedResponse) {
+                    oParsedResponse = {results:[]};
+                }
 
-                        // Turn the string into an object literal...
-                        // ...eval is necessary here
-                        jsonObj = eval("(" + oRawResponse + ")");
-                        if(!jsonObj) {
-                            bError = true;
-                        }
+                oParsedResponse.error = true;
+            }
 
-                    }
-                    else {
-                        jsonObj = null;
-                        bError = true;
+            // Loop through the results to parse data if there are parsers
+            if (bHasParser) {
+                for (i = oParsedResponse.results.length - 1; i >= 0; --i) {
+                    var r = oParsedResponse.results[i];
+                    for (var p in parserMap) {
+                        if (YAHOO.lang.hasOwnProperty(parserMap,p)) {
+                            r[p] = parserMap[p].call(this,r[p]);
+                            if (r[p] === undefined) {
+                                r[p] = null;
+                            }
+                        }
                     }
                 }
-                catch(e) {
-                    bError = true;
-               }
-            }
-        }
-        // Response must already be a JSON object
-        else if(oRawResponse.constructor == Object) {
-            jsonObj = oRawResponse;
-        }
-        // Not a string or an object
-        else {
-            bError = true;
-        }
-        // Now that we have a JSON object, parse a jsonList out of it
-        if(jsonObj && jsonObj.constructor == Object) {
-            try {
-                // eval is necessary here since schema can be of unknown depth
-                jsonList = eval("jsonObj." + this.responseSchema.resultsList);
-            }
-            catch(e) {
-                bError = true;
             }
         }
+    }
+    else {
+        YAHOO.log("JSON data could not be parsed: " +
+                YAHOO.lang.dump(oFullResponse), "error", this.toString());
+        oParsedResponse.error = true;
+    }
 
-        if(bError || !jsonList) {
-            YAHOO.log("JSON data could not be parsed: " +
-                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
-            oParsedResponse.error = true;
-        }
-        if(jsonList && !YAHOO.lang.isArray(jsonList)) {
-            jsonList = [jsonList];
-        }
-        else if(!jsonList) {
-            jsonList = [];
-        }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses an HTML TABLE element reference into a response object.
+ *
+ * @method parseHTMLTableData
+ * @param oRequest {Object} Request object.
+ * @param oFullResponse {Object} The full HTML element reference from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
+ */
+YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oFullResponse) {
+    var bError = false;
+    var elTable = oFullResponse;
+    var fields = this.responseSchema.fields;
+    var oParsedResponse = {results:[]};
 
-        // Loop through the array of all responses...
-        for(var i = jsonList.length-1; i >= 0 ; i--) {
+    // Iterate through each TBODY
+    for(var i=0; i<elTable.tBodies.length; i++) {
+        var elTbody = elTable.tBodies[i];
+
+        // Iterate through each TR
+        for(var j=elTbody.rows.length-1; j>-1; j--) {
+            var elRow = elTbody.rows[j];
             var oResult = {};
-            var jsonResult = jsonList[i];
-            // ...and loop through each data field value of each response
-            for(var j = fields.length-1; j >= 0 ; j--) {
-                var field = fields[j];
+            
+            for(var k=fields.length-1; k>-1; k--) {
+                var field = fields[k];
                 var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                // ...and capture data into an array mapped according to the schema...
-                // eval is necessary here since schema can be of unknown depth
-                var data = eval("jsonResult." + key);
-                //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());
-                
+                var data = elRow.cells[k].innerHTML;
+
                 // Backward compatibility
                 if(!field.parser && field.converter) {
                     field.parser = field.converter;
@@ -1353,78 +1688,178 @@ YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse)
                 }
                 oResult[key] = data;
             }
-            // Capture the array of data field values in an array of results
-            oParsedResponse.results.unshift(oResult);
+            oParsedResponse.results[j] = oResult;
         }
-        YAHOO.log("Parsed JSON data is " +
-                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
     }
-    else {
-        YAHOO.log("JSON data could not be parsed: " +
-                YAHOO.lang.dump(oRawResponse), "error", this.toString());
+
+    if(bError) {
+        YAHOO.log("HTML TABLE data could not be parsed: " +
+                YAHOO.lang.dump(oFullResponse), "error", this.toString());
         oParsedResponse.error = true;
     }
+    else {
+        YAHOO.log("Parsed HTML TABLE data is " +
+                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+    }
     return oParsedResponse;
 };
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
 /**
- * Overridable method parses raw HTML TABLE element data into a response object.
+ * The static Number class provides helper functions to deal with data of type
+ * Number.
  *
- * @method parseHTMLTableData
- * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @namespace YAHOO.util
+ * @requires datasource
+ * @class Number
+ * @static
  */
-YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oRawResponse) {
-        var bError = false;
-        var elTable = oRawResponse;
-        var fields = this.responseSchema.fields;
-        var oParsedResponse = {};
-        oParsedResponse.results = [];
-
-        // Iterate through each TBODY
-        for(var i=0; i<elTable.tBodies.length; i++) {
-            var elTbody = elTable.tBodies[i];
+ YAHOO.util.Number = {
+     /**
+     * Takes a native JavaScript Number and formats to string for display to user.
+     *
+     * @method format
+     * @param nData {Number} Number.
+     * @param oConfig {Object} (Optional) Optional configuration values:
+     *  <dl>
+     *   <dt>prefix {String}</dd>
+     *   <dd>String prepended before each number, like a currency designator "$"</dd>
+     *   <dt>decimalPlaces {Number}</dd>
+     *   <dd>Number of decimal places to round.</dd>
+     *   <dt>decimalSeparator {String}</dd>
+     *   <dd>Decimal separator</dd>
+     *   <dt>thousandsSeparator {String}</dd>
+     *   <dd>Thousands separator</dd>
+     *   <dt>suffix {String}</dd>
+     *   <dd>String appended after each number, like " items" (note the space)</dd>
+     *  </dl>
+     * @return {String} Formatted number for display.
+     */
+    format: function(nData, oConfig) {
+        oConfig = oConfig || {};
+        
+        if(!YAHOO.lang.isNumber(nData)) {
+            nData *= 1;
+        }
 
-            // Iterate through each TR
-            for(var j=elTbody.rows.length-1; j>-1; j--) {
-                var elRow = elTbody.rows[j];
-                var oResult = {};
-                
-                for(var k=fields.length-1; k>-1; k--) {
-                    var field = fields[k];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    var data = elRow.cells[k].innerHTML;
-
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
-                        YAHOO.log("The field property converter has been deprecated" +
-                                " in favor of parser", "warn", this.toString());
+        if(YAHOO.lang.isNumber(nData)) {
+            var sOutput = nData + "";
+            var sDecimalSeparator = (oConfig.decimalSeparator) ? oConfig.decimalSeparator : ".";
+            var nDotIndex;
+
+            // Manage decimals
+            if(YAHOO.lang.isNumber(oConfig.decimalPlaces)) {
+                // Round to the correct decimal place
+                var nDecimalPlaces = oConfig.decimalPlaces;
+                var nDecimal = Math.pow(10, nDecimalPlaces);
+                sOutput = Math.round(nData*nDecimal)/nDecimal + "";
+                nDotIndex = sOutput.lastIndexOf(".");
+
+                if(nDecimalPlaces > 0) {
+                    // Add the decimal separator
+                    if(nDotIndex < 0) {
+                        sOutput += sDecimalSeparator;
+                        nDotIndex = sOutput.length-1;
                     }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
+                    // Replace the "."
+                    else if(sDecimalSeparator !== "."){
+                        sOutput = sOutput.replace(".",sDecimalSeparator);
                     }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+                    // Add missing zeros
+                    while((sOutput.length - 1 - nDotIndex) < nDecimalPlaces) {
+                        sOutput += "0";
+                    }
+                }
+            }
+            
+            // Add the thousands separator
+            if(oConfig.thousandsSeparator) {
+                var sThousandsSeparator = oConfig.thousandsSeparator;
+                nDotIndex = sOutput.lastIndexOf(sDecimalSeparator);
+                nDotIndex = (nDotIndex > -1) ? nDotIndex : sOutput.length;
+                var sNewOutput = sOutput.substring(nDotIndex);
+                var nCount = -1;
+                for (var i=nDotIndex; i>0; i--) {
+                    nCount++;
+                    if ((nCount%3 === 0) && (i !== nDotIndex)) {
+                        sNewOutput = sThousandsSeparator + sNewOutput;
                     }
-                    oResult[key] = data;
+                    sNewOutput = sOutput.charAt(i-1) + sNewOutput;
                 }
-                oParsedResponse.results.unshift(oResult);
+                sOutput = sNewOutput;
             }
+
+            // Prepend prefix
+            sOutput = (oConfig.prefix) ? oConfig.prefix + sOutput : sOutput;
+
+            // Append suffix
+            sOutput = (oConfig.suffix) ? sOutput + oConfig.suffix : sOutput;
+
+            return sOutput;
         }
+        // Still not a Number, just return unaltered
+        else {
+            return nData;
+        }
+    }
+ };
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
-        if(bError) {
-            YAHOO.log("HTML TABLE data could not be parsed: " +
-                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
-            oParsedResponse.error = true;
+/**
+ * The static Date class provides helper functions to deal with data of type
+ * Number.
+ *
+ * @namespace YAHOO.util
+ * @requires datasource
+ * @class Date
+ * @static
+ */
+ YAHOO.util.Date = {
+     /**
+     * Takes a native JavaScript Date and formats to string for display to user.
+     *
+     * @method format
+     * @param oDate {Date} Date.
+     * @param oConfig {Object} (Optional) Optional configuration values:
+     *  <dl>
+     *   <dt>format {String}</dd>
+     *   <dd>Currently only the following formats are supported:
+     *   "MM/DD/YYYY", "YYYY/MM/DD", or "DD/MM/YYYY"</dd>
+     *  </dl>
+     * @return {String} Formatted date for display.
+     */
+    format: function(oDate, oConfig) {
+        oConfig = oConfig || {};
+        
+        if(oDate instanceof Date) {
+            var format = oConfig.format || "MM/DD/YYYY";
+            var mm = oDate.getMonth()+1;
+            var dd = oDate.getDate();
+            var yyyy = oDate.getFullYear();
+            
+            switch(format) {
+                case "YYYY/MM/DD":
+                    return yyyy + "/" + mm +"/" + dd;
+                case "DD/MM/YYYY":
+                    return dd + "/" + mm + "/" + yyyy;
+                default: // "MM/DD/YYYY"
+                    return mm + "/" + dd + "/" + yyyy;
+            }
         }
         else {
-            YAHOO.log("Parsed HTML TABLE data is " +
-                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+            return YAHOO.lang.isValue(oDate) ? oDate : "";
         }
-        return oParsedResponse;
-};
+    }
+ };
 
-YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.3.0", build: "442"});
+YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.5.0", build: "895"});
index e248bad22cddf548b20ab6ea9272dd8b0cb385e0..2cda1fc66d279f9dcaf0de9a1b443878d631b32d 100755 (executable)
@@ -1,102 +1,9 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.util.DataSource=function(oLiveData,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
-if(!oLiveData){return;}
-if(oLiveData.nodeType&&oLiveData.nodeType==9){this.dataType=YAHOO.util.DataSource.TYPE_XML;}
-else if(YAHOO.lang.isArray(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSARRAY;}
-else if(YAHOO.lang.isString(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_XHR;}
-else if(YAHOO.lang.isFunction(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSFUNCTION;}
-else if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.dataType=YAHOO.util.DataSource.TYPE_HTMLTABLE;}
-else if(YAHOO.lang.isObject(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSON;}
-else{this.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;}
-this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};var maxCacheEntries=this.maxCacheEntries;if(!YAHOO.lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
-if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
-this._sName="DataSource instance"+YAHOO.util.DataSource._nIndex;YAHOO.util.DataSource._nIndex++;this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");};YAHOO.augment(YAHOO.util.DataSource,YAHOO.util.EventProvider);YAHOO.util.DataSource.TYPE_UNKNOWN=-1;YAHOO.util.DataSource.TYPE_JSARRAY=0;YAHOO.util.DataSource.TYPE_JSFUNCTION=1;YAHOO.util.DataSource.TYPE_XHR=2;YAHOO.util.DataSource.TYPE_JSON=3;YAHOO.util.DataSource.TYPE_XML=4;YAHOO.util.DataSource.TYPE_TEXT=5;YAHOO.util.DataSource.TYPE_HTMLTABLE=6;YAHOO.util.DataSource.ERROR_DATAINVALID="Invalid data";YAHOO.util.DataSource.ERROR_DATANULL="Null data";YAHOO.util.DataSource._nIndex=0;YAHOO.util.DataSource._nTransactionId=0;YAHOO.util.DataSource.prototype._sName=null;YAHOO.util.DataSource.prototype._aCache=null;YAHOO.util.DataSource.prototype._oQueue=null;YAHOO.util.DataSource.prototype.maxCacheEntries=0;YAHOO.util.DataSource.prototype.liveData=null;YAHOO.util.DataSource.prototype.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseSchema=null;YAHOO.util.DataSource.prototype.connMgr=null;YAHOO.util.DataSource.prototype.connXhrMode="allowAll";YAHOO.util.DataSource.prototype.connMethodPost=false;YAHOO.util.DataSource.prototype.connTimeout=0;YAHOO.util.DataSource.parseString=function(oData){if(!YAHOO.lang.isValue(oData)){return null;}
-var string=oData+"";if(YAHOO.lang.isString(string)){return string;}
-else{return null;}};YAHOO.util.DataSource.parseNumber=function(oData){var number=oData*1;if(YAHOO.lang.isNumber(number)){return number;}
-else{return null;}};YAHOO.util.DataSource.convertNumber=function(oData){return YAHOO.util.DataSource.parseNumber(oData);};YAHOO.util.DataSource.parseDate=function(oData){var date=null;if(!(oData instanceof Date)){date=new Date(oData);}
-else{return oData;}
-if(date instanceof Date){return date;}
-else{return null;}};YAHOO.util.DataSource.convertDate=function(oData){return YAHOO.util.DataSource.parseDate(oData);};YAHOO.util.DataSource.prototype.toString=function(){return this._sName;};YAHOO.util.DataSource.prototype.getCachedResponse=function(oRequest,oCallback,oCaller){var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var oResponse=null;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;aCache.splice(i,1);this.addToCache(oRequest,oResponse);this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});break;}}}
-return oResponse;};YAHOO.util.DataSource.prototype.isCacheHit=function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);};YAHOO.util.DataSource.prototype.addToCache=function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}
-while(aCache.length>=this.maxCacheEntries){aCache.shift();}
-var oCacheElem={request:oRequest,response:oResponse};aCache.push(oCacheElem);this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});};YAHOO.util.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}};YAHOO.util.DataSource.prototype.sendRequest=function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){oCallback.call(oCaller,oRequest,oCachedResponse);return null;}
-return this.makeConnection(oRequest,oCallback,oCaller);};YAHOO.util.DataSource.prototype.makeConnection=function(oRequest,oCallback,oCaller){this.fireEvent("requestEvent",{request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=null;var tId=YAHOO.util.DataSource._nTransactionId++;switch(this.dataType){case YAHOO.util.DataSource.TYPE_JSFUNCTION:oRawResponse=this.liveData(oRequest);this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);break;case YAHOO.util.DataSource.TYPE_XHR:var oSelf=this;var oConnMgr=this.connMgr||YAHOO.util.Connect;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}
-else if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATANULL});oCallback.call(oCaller,oRequest,oResponse,true);return null;}
-else{this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATAINVALID});if((this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}
-oCallback.call(oCaller,oRequest,oResponse,true);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(YAHOO.lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}
-if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}
-else{}}}
-if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost)?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}
-else{if(oQueue.conn){oQueue.requests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}
-else{if(oQueue.requests.length>0){sUri=(isPost)?sLiveData:sLiveData+oQueue.requests[0].request;sRequest=(isPost)?oQueue.requests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,oQueue.requests[0].callback,sRequest);oQueue.requests.shift();}
-else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}
-else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}
-else{oCallback.call(oCaller,oRequest,null,true);}
-break;default:oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);break;}
-return tId;};YAHOO.util.DataSource.prototype.handleResponse=function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,tId:tId});var xhr=(this.dataType==YAHOO.util.DataSource.TYPE_XHR)?true:false;var oParsedResponse=null;var bError=false;oRawResponse=this.doBeforeParseData(oRequest,oRawResponse);switch(this.responseType){case YAHOO.util.DataSource.TYPE_JSARRAY:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
-oParsedResponse=this.parseArrayData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_JSON:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
-oParsedResponse=this.parseJSONData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
-oParsedResponse=this.parseHTMLTableData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_XML:if(xhr&&oRawResponse.responseXML){oRawResponse=oRawResponse.responseXML;}
-oParsedResponse=this.parseXMLData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_TEXT:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
-oParsedResponse=this.parseTextData(oRequest,oRawResponse);break;default:break;}
-if(oParsedResponse){oParsedResponse.tId=tId;oParsedResponse=this.doBeforeCallback(oRequest,oRawResponse,oParsedResponse);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}
-else{this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATANULL});oParsedResponse={error:true};}
-oCallback.call(oCaller,oRequest,oParsedResponse);};YAHOO.util.DataSource.prototype.doBeforeParseData=function(oRequest,oRawResponse){return oRawResponse;};YAHOO.util.DataSource.prototype.doBeforeCallback=function(oRequest,oRawResponse,oParsedResponse){return oParsedResponse;};YAHOO.util.DataSource.prototype.parseArrayData=function(oRequest,oRawResponse){if(YAHOO.lang.isArray(oRawResponse)&&YAHOO.lang.isArray(this.responseSchema.fields)){var oParsedResponse={results:[]};var fields=this.responseSchema.fields;for(var i=oRawResponse.length-1;i>-1;i--){var oResult={};for(var j=fields.length-1;j>-1;j--){var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=(YAHOO.lang.isValue(oRawResponse[i][j]))?oRawResponse[i][j]:oRawResponse[i][key];if(!field.parser&&field.converter){field.parser=field.converter;}
-if(field.parser){data=field.parser.call(this,data);}
-if(data===undefined){data=null;}
-oResult[key]=data;}
-oParsedResponse.results.unshift(oResult);}
-return oParsedResponse;}
-else{return null;}};YAHOO.util.DataSource.prototype.parseTextData=function(oRequest,oRawResponse){var oParsedResponse={};if(YAHOO.lang.isString(oRawResponse)&&YAHOO.lang.isArray(this.responseSchema.fields)&&YAHOO.lang.isString(this.responseSchema.recordDelim)&&YAHOO.lang.isString(this.responseSchema.fieldDelim)){oParsedResponse.results=[];var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;var fields=this.responseSchema.fields;if(oRawResponse.length>0){var newLength=oRawResponse.length-recDelim.length;if(oRawResponse.substr(newLength)==recDelim){oRawResponse=oRawResponse.substr(0,newLength);}
-var recordsarray=oRawResponse.split(recDelim);for(var i=recordsarray.length-1;i>-1;i--){var oResult={};for(var j=fields.length-1;j>-1;j--){var fielddataarray=recordsarray[i].split(fieldDelim);var data=fielddataarray[j];if(data.charAt(0)=="\""){data=data.substr(1);}
-if(data.charAt(data.length-1)=="\""){data=data.substr(0,data.length-1);}
-var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}
-if(field.parser){data=field.parser.call(this,data);}
-if(data===undefined){data=null;}
-oResult[key]=data;}
-oParsedResponse.results.unshift(oResult);}}}
-else{oParsedResponse.error=true;}
-return oParsedResponse;};YAHOO.util.DataSource.prototype.parseXMLData=function(oRequest,oRawResponse){var bError=false;var oParsedResponse={};var xmlList=(this.responseSchema.resultNode)?oRawResponse.getElementsByTagName(this.responseSchema.resultNode):null;if(!xmlList||!YAHOO.lang.isArray(this.responseSchema.fields)){bError=true;}
-else{oParsedResponse.results=[];for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var oResult={};for(var m=this.responseSchema.fields.length-1;m>=0;m--){var field=this.responseSchema.fields[m];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}
-else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){data=xmlNode.item(0).firstChild.nodeValue;}
-else{data="";}}
-if(!field.parser&&field.converter){field.parser=field.converter;}
-if(field.parser){data=field.parser.call(this,data);}
-if(data===undefined){data=null;}
-oResult[key]=data;}
-oParsedResponse.results.unshift(oResult);}}
-if(bError){oParsedResponse.error=true;}
-else{}
-return oParsedResponse;};YAHOO.util.DataSource.prototype.parseJSONData=function(oRequest,oRawResponse){var oParsedResponse={};if(oRawResponse&&YAHOO.lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;var bError=false;oParsedResponse.results=[];var jsonObj,jsonList;if(YAHOO.lang.isString(oRawResponse)){var isNotMac=(navigator.userAgent.toLowerCase().indexOf('khtml')==-1);if(oRawResponse.parseJSON&&isNotMac){jsonObj=oRawResponse.parseJSON();if(!jsonObj){bError=true;}}
-else if(window.JSON&&JSON.parse&&isNotMac){jsonObj=JSON.parse(oRawResponse);if(!jsonObj){bError=true;}}
-else{try{while(oRawResponse.length>0&&(oRawResponse.charAt(0)!="{")&&(oRawResponse.charAt(0)!="[")){oRawResponse=oRawResponse.substring(1,oRawResponse.length);}
-if(oRawResponse.length>0){var objEnd=Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));oRawResponse=oRawResponse.substring(0,objEnd+1);jsonObj=eval("("+oRawResponse+")");if(!jsonObj){bError=true;}}
-else{jsonObj=null;bError=true;}}
-catch(e){bError=true;}}}
-else if(oRawResponse.constructor==Object){jsonObj=oRawResponse;}
-else{bError=true;}
-if(jsonObj&&jsonObj.constructor==Object){try{jsonList=eval("jsonObj."+this.responseSchema.resultsList);}
-catch(e){bError=true;}}
-if(bError||!jsonList){oParsedResponse.error=true;}
-if(jsonList&&!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}
-else if(!jsonList){jsonList=[];}
-for(var i=jsonList.length-1;i>=0;i--){var oResult={};var jsonResult=jsonList[i];for(var j=fields.length-1;j>=0;j--){var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=eval("jsonResult."+key);if(!field.parser&&field.converter){field.parser=field.converter;}
-if(field.parser){data=field.parser.call(this,data);}
-if(data===undefined){data=null;}
-oResult[key]=data;}
-oParsedResponse.results.unshift(oResult);}}
-else{oParsedResponse.error=true;}
-return oParsedResponse;};YAHOO.util.DataSource.prototype.parseHTMLTableData=function(oRequest,oRawResponse){var bError=false;var elTable=oRawResponse;var fields=this.responseSchema.fields;var oParsedResponse={};oParsedResponse.results=[];for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}
-if(field.parser){data=field.parser.call(this,data);}
-if(data===undefined){data=null;}
-oResult[key]=data;}
-oParsedResponse.results.unshift(oResult);}}
-if(bError){oParsedResponse.error=true;}
-else{}
-return oParsedResponse;};YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.util.DataSource=function(B,D){if(!B){return ;}this.liveData=B;this._oQueue={interval:null,conn:null,requests:[]};if(B.nodeType&&B.nodeType==9){this.dataType=YAHOO.util.DataSource.TYPE_XML;}else{if(YAHOO.lang.isArray(B)){this.dataType=YAHOO.util.DataSource.TYPE_JSARRAY;}else{if(YAHOO.lang.isString(B)){this.dataType=YAHOO.util.DataSource.TYPE_XHR;}else{if(YAHOO.lang.isFunction(B)){this.dataType=YAHOO.util.DataSource.TYPE_JSFUNCTION;}else{if(B.nodeName&&(B.nodeName.toLowerCase()=="table")){this.dataType=YAHOO.util.DataSource.TYPE_HTMLTABLE;this.liveData=B.cloneNode(true);}else{if(YAHOO.lang.isObject(B)){this.dataType=YAHOO.util.DataSource.TYPE_JSON;}else{this.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;}}}}}}if(D&&(D.constructor==Object)){for(var C in D){if(C){this[C]=D[C];}}}var A=this.maxCacheEntries;if(!YAHOO.lang.isNumber(A)||(A<0)){A=0;}this._aIntervals=[];this._sName="DataSource instance"+YAHOO.util.DataSource._nIndex;YAHOO.util.DataSource._nIndex++;this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");};YAHOO.augment(YAHOO.util.DataSource,YAHOO.util.EventProvider);YAHOO.util.DataSource.TYPE_UNKNOWN=-1;YAHOO.util.DataSource.TYPE_JSARRAY=0;YAHOO.util.DataSource.TYPE_JSFUNCTION=1;YAHOO.util.DataSource.TYPE_XHR=2;YAHOO.util.DataSource.TYPE_JSON=3;YAHOO.util.DataSource.TYPE_XML=4;YAHOO.util.DataSource.TYPE_TEXT=5;YAHOO.util.DataSource.TYPE_HTMLTABLE=6;YAHOO.util.DataSource.ERROR_DATAINVALID="Invalid data";YAHOO.util.DataSource.ERROR_DATANULL="Null data";YAHOO.util.DataSource._nIndex=0;YAHOO.util.DataSource._nTransactionId=0;YAHOO.util.DataSource.prototype._sName=null;YAHOO.util.DataSource.prototype._aCache=null;YAHOO.util.DataSource.prototype._oQueue=null;YAHOO.util.DataSource.prototype._aIntervals=null;YAHOO.util.DataSource.prototype.maxCacheEntries=0;YAHOO.util.DataSource.prototype.liveData=null;YAHOO.util.DataSource.prototype.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseSchema=null;YAHOO.util.DataSource.prototype.connMgr=null;YAHOO.util.DataSource.prototype.connXhrMode="allowAll";YAHOO.util.DataSource.prototype.connMethodPost=false;YAHOO.util.DataSource.prototype.connTimeout=0;YAHOO.util.DataSource.parseString=function(B){if(!YAHOO.lang.isValue(B)){return null;}var A=B+"";if(YAHOO.lang.isString(A)){return A;}else{return null;}};YAHOO.util.DataSource.parseNumber=function(B){var A=B*1;if(YAHOO.lang.isNumber(A)){return A;}else{return null;}};YAHOO.util.DataSource.convertNumber=function(A){return YAHOO.util.DataSource.parseNumber(A);};YAHOO.util.DataSource.parseDate=function(B){var A=null;if(!(B instanceof Date)){A=new Date(B);}else{return B;}if(A instanceof Date){return A;}else{return null;}};YAHOO.util.DataSource.convertDate=function(A){return YAHOO.util.DataSource.parseDate(A);};YAHOO.util.DataSource.prototype.toString=function(){return this._sName;};YAHOO.util.DataSource.prototype.getCachedResponse=function(H,B,G){var A=this._aCache;if(this.maxCacheEntries>0){if(!A){this._aCache=[];}else{var D=A.length;if(D>0){var F=null;this.fireEvent("cacheRequestEvent",{request:H,callback:B,caller:G});for(var E=D-1;E>=0;E--){var C=A[E];if(this.isCacheHit(H,C.request)){F=C.response;this.fireEvent("cacheResponseEvent",{request:H,response:F,callback:B,caller:G});if(E<D-1){A.splice(E,1);this.addToCache(H,F);}break;}}return F;}}}else{if(A){this._aCache=null;}}return null;};YAHOO.util.DataSource.prototype.isCacheHit=function(A,B){return(A===B);};YAHOO.util.DataSource.prototype.addToCache=function(D,C){var A=this._aCache;if(!A){return ;}while(A.length>=this.maxCacheEntries){A.shift();}var B={request:D,response:C};A[A.length]=B;this.fireEvent("responseCacheEvent",{request:D,response:C});};YAHOO.util.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}};YAHOO.util.DataSource.prototype.setInterval=function(D,F,B,E){if(YAHOO.lang.isNumber(D)&&(D>=0)){var C=this;var A=setInterval(function(){C.makeConnection(F,B,E);},D);this._aIntervals.push(A);return A;}else{}};YAHOO.util.DataSource.prototype.clearInterval=function(A){var C=this._aIntervals||[];for(var B=C.length-1;B>-1;B--){if(C[B]===A){C.splice(B,1);clearInterval(A);}}};YAHOO.util.DataSource.prototype.clearAllIntervals=function(A){var C=this._aIntervals||[];for(var B=C.length-1;B>-1;B--){C.splice(B,1);clearInterval(A);}};YAHOO.util.DataSource.issueCallback=function(E,D,B,C){if(YAHOO.lang.isFunction(E)){E.apply(C,D);}else{if(YAHOO.lang.isObject(E)){C=E.scope||C||window;var A=E.success;if(B){A=E.failure;}if(A){A.apply(C,D.concat([E.argument]));}}}};YAHOO.util.DataSource.prototype.sendRequest=function(D,A,C){var B=this.getCachedResponse(D,A,C);if(B){YAHOO.util.DataSource.issueCallback(A,[D,B],false,C);return null;}return this.makeConnection(D,A,C);};YAHOO.util.DataSource.prototype.makeConnection=function(A,P,K){this.fireEvent("requestEvent",{request:A,callback:P,caller:K});var D=null;var L=YAHOO.util.DataSource._nTransactionId++;switch(this.dataType){case YAHOO.util.DataSource.TYPE_JSFUNCTION:D=this.liveData(A);this.handleResponse(A,D,P,K,L);break;case YAHOO.util.DataSource.TYPE_XHR:var N=this;var C=this.connMgr||YAHOO.util.Connect;var G=this._oQueue;var J=function(Q){if(Q&&(this.connXhrMode=="ignoreStaleResponses")&&(Q.tId!=G.conn.tId)){return null;}else{if(!Q){this.fireEvent("dataErrorEvent",{request:A,callback:P,caller:K,message:YAHOO.util.DataSource.ERROR_DATANULL});YAHOO.util.DataSource.issueCallback(P,[A,{error:true}],true,K);return null;}else{this.handleResponse(A,Q,P,K,L);}}};var O=function(Q){this.fireEvent("dataErrorEvent",{request:A,callback:P,caller:K,message:YAHOO.util.DataSource.ERROR_DATAINVALID});if((this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(A.indexOf("?")!==0)){}Q=Q||{};
+Q.error=true;YAHOO.util.DataSource.issueCallback(P,[A,Q],true,K);return null;};var I={success:J,failure:O,scope:this};if(YAHOO.lang.isNumber(this.connTimeout)){I.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(G.conn){if(C.abort){C.abort(G.conn);G.conn=null;}else{}}}if(C&&C.asyncRequest){var B=this.liveData;var H=this.connMethodPost;var M=(H)?"POST":"GET";var E=(H)?B:B+A;var F=(H)?A:null;if(this.connXhrMode!="queueRequests"){G.conn=C.asyncRequest(M,E,I,F);}else{if(G.conn){G.requests.push({request:A,callback:I});if(!G.interval){G.interval=setInterval(function(){if(C.isCallInProgress(G.conn)){return ;}else{if(G.requests.length>0){E=(H)?B:B+G.requests[0].request;F=(H)?G.requests[0].request:null;G.conn=C.asyncRequest(M,E,G.requests[0].callback,F);G.requests.shift();}else{clearInterval(G.interval);G.interval=null;}}},50);}}else{G.conn=C.asyncRequest(M,E,I,F);}}}else{YAHOO.util.DataSource.issueCallback(P,[A,{error:true}],true,K);}break;default:D=this.liveData;this.handleResponse(A,D,P,K,L);break;}return L;};YAHOO.util.DataSource.prototype.handleResponse=function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,tId:tId});var xhr=(this.dataType==YAHOO.util.DataSource.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;switch(this.responseType){case YAHOO.util.DataSource.TYPE_JSARRAY:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case YAHOO.util.DataSource.TYPE_JSON:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(YAHOO.lang.isString(oFullResponse)){if(YAHOO.lang.JSON){oFullResponse=YAHOO.lang.JSON.parse(oFullResponse);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse(oFullResponse);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON();}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case YAHOO.util.DataSource.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case YAHOO.util.DataSource.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case YAHOO.util.DataSource.TYPE_TEXT:if(xhr&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse);oParsedResponse=this.doBeforeParseData(oRequest,oFullResponse);break;}if(oParsedResponse&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATANULL});oParsedResponse=oParsedResponse||{};oParsedResponse.error=true;}oParsedResponse.tId=tId;YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);};YAHOO.util.DataSource.prototype.doBeforeParseData=function(B,A){return A;};YAHOO.util.DataSource.prototype.doBeforeCallback=function(B,A,C){return C;};YAHOO.util.DataSource.prototype.parseArrayData=function(B,L){if(YAHOO.lang.isArray(L)){if(YAHOO.lang.isArray(this.responseSchema.fields)){var F=[],I=this.responseSchema.fields,G;for(G=I.length-1;G>=0;--G){if(typeof I[G]!=="object"){I[G]={key:I[G]};}}var M={};for(G=I.length-1;G>=0;--G){var A=I[G].parser||I[G].converter;if(A){M[I[G].key]=A;}}var J=YAHOO.lang.isArray(L[0]);for(G=L.length-1;G>-1;G--){var H={};var C=L[G];if(typeof C==="object"){for(var D=I.length-1;D>-1;D--){var K=I[D];var E=J?C[D]:C[K.key];if(M[K.key]){E=M[K.key].call(this,E);}if(E===undefined){E=null;}H[K.key]=E;}}F[G]=H;}var N={results:F};return N;}}return null;};YAHOO.util.DataSource.prototype.parseTextData=function(I,O){if(YAHOO.lang.isString(O)){if(YAHOO.lang.isArray(this.responseSchema.fields)&&YAHOO.lang.isString(this.responseSchema.recordDelim)&&YAHOO.lang.isString(this.responseSchema.fieldDelim)){var N={results:[]};var H=this.responseSchema.recordDelim;var F=this.responseSchema.fieldDelim;var G=this.responseSchema.fields;if(O.length>0){var C=O.length-H.length;if(O.substr(C)==H){O=O.substr(0,C);}var D=O.split(H);for(var K=0,L=D.length,Q=0;K<L;++K){var B={};var P=false;if(YAHOO.lang.isString(D[K])){var E=D[K].split(F);for(var J=G.length-1;J>-1;J--){try{var R=E[J];if(YAHOO.lang.isString(R)){if(R.charAt(0)=='"'){R=R.substr(1);}if(R.charAt(R.length-1)=='"'){R=R.substr(0,R.length-1);}var A=G[J];var S=(YAHOO.lang.isValue(A.key))?A.key:A;if(!A.parser&&A.converter){A.parser=A.converter;}if(A.parser){R=A.parser.call(this,R);}if(R===undefined){R=null;}B[S]=R;}else{P=true;}}catch(M){P=true;}}if(!P){N.results[Q++]=B;}}}}return N;}}return null;};YAHOO.util.DataSource.prototype.parseXMLData=function(L,P){var Q=false;var O={};var F=null;var D=this.responseSchema.totalRecords;try{F=(this.responseSchema.resultNode)?P.getElementsByTagName(this.responseSchema.resultNode):null;
+if(D){var H=null;var J=P.getElementsByTagName(D)[0];if(J){H=J.firstChild.nodeValue;}else{J=P.firstChild.attributes.getNamedItem(D);if(J){H=J.value;}else{if(F&&F.length){var I=F.item(0).parentNode;if(I){J=I.attributes.getNamedItem(D);if(J){H=J.value;}}}}}if(YAHOO.lang.isValue(H)){O.totalRecords=parseInt(H,10)|0;}}}catch(N){}if(!F||!YAHOO.lang.isArray(this.responseSchema.fields)){Q=true;}else{O.results=[];for(var M=F.length-1;M>=0;M--){var G=F.item(M);var E={};for(var K=this.responseSchema.fields.length-1;K>=0;K--){var A=this.responseSchema.fields[K];var S=(YAHOO.lang.isValue(A.key))?A.key:A;var R=null;var C=G.attributes.getNamedItem(S);if(C){R=C.value;}else{var B=G.getElementsByTagName(S);if(B&&B.item(0)&&B.item(0).firstChild){R=B.item(0).firstChild.nodeValue;}else{R="";}}if(!A.parser&&A.converter){A.parser=A.converter;}if(A.parser){R=A.parser.call(this,R);}if(R===undefined){R=null;}E[S]=R;}O.results[M]=E;}}if(Q){O.error=true;}else{}return O;};YAHOO.util.DataSource.prototype.executeJSONParser=function(G){if(!this.jsonResponseParser){var A=this.responseSchema,D=A.fields,C=A.resultsList,E=A.totalRecords,I=[],F,B;if(/\(/.test(C)){throw new SyntaxError("resultsList may only contain valid characters for variable names");}var H="var results=oFullResponse";if(YAHOO.lang.isValue(C)){H+="."+C;}H+=";";H+="if(!results){"+"results=[];"+"}"+"if(!YAHOO.lang.isArray(results)){"+"results=[results];"+"}";for(B=D.length-1;B>=0;--B){I[B]=typeof D[B]==="object"?D[B].key:D[B];}if(/\[|\./.test(I.join(""))){H+="for(var i=results.length-1;i>=0;--i){"+"var r=results[i];"+"results[i]={";F=[];for(B=I.length-1;B>=0;--B){F[B]='"'+I[B].replace(/"/g,'\\"')+'":r.'+I[B];}H+=F.join(",")+"};"+"}";}H+="return {"+"results:results";if(E){H+=","+"totalRecords:oFullResponse."+E;}H+="};";this.jsonResponseParser=new Function("oFullResponse",H);}return this.jsonResponseParser(G);};YAHOO.util.DataSource.prototype.parseJSONData=function(D,J){var M={results:[]};if(J&&(YAHOO.lang.isObject(J))){if(YAHOO.lang.isArray(this.responseSchema.fields)){var F=this.responseSchema.fields,L={},H=false,G=false,E;for(E=F.length-1;E>=0;--E){var K=F[E].key||F[E],B=F[E].parser||F[E].converter;if(B){L[K]=B;G=true;}}try{M=this.executeJSONParser(J);}catch(I){H=true;}if(H||!M||!M.results){if(!M){M={results:[]};}M.error=true;}if(G){for(E=M.results.length-1;E>=0;--E){var A=M.results[E];for(var C in L){if(YAHOO.lang.hasOwnProperty(L,C)){A[C]=L[C].call(this,A[C]);if(A[C]===undefined){A[C]=null;}}}}}}}else{M.error=true;}return M;};YAHOO.util.DataSource.prototype.parseHTMLTableData=function(B,M){var J=false;var K=M;var I=this.responseSchema.fields;var O={results:[]};for(var G=0;G<K.tBodies.length;G++){var C=K.tBodies[G];for(var E=C.rows.length-1;E>-1;E--){var A=C.rows[E];var H={};for(var D=I.length-1;D>-1;D--){var L=I[D];var N=(YAHOO.lang.isValue(L.key))?L.key:L;var F=A.cells[D].innerHTML;if(!L.parser&&L.converter){L.parser=L.converter;}if(L.parser){F=L.parser.call(this,F);}if(F===undefined){F=null;}H[N]=F;}O.results[E]=H;}}if(J){O.error=true;}else{}return O;};YAHOO.util.Number={format:function(B,E){E=E||{};if(!YAHOO.lang.isNumber(B)){B*=1;}if(YAHOO.lang.isNumber(B)){var I=B+"";var F=(E.decimalSeparator)?E.decimalSeparator:".";var G;if(YAHOO.lang.isNumber(E.decimalPlaces)){var H=E.decimalPlaces;var C=Math.pow(10,H);I=Math.round(B*C)/C+"";G=I.lastIndexOf(".");if(H>0){if(G<0){I+=F;G=I.length-1;}else{if(F!=="."){I=I.replace(".",F);}}while((I.length-1-G)<H){I+="0";}}}if(E.thousandsSeparator){var K=E.thousandsSeparator;G=I.lastIndexOf(F);G=(G>-1)?G:I.length;var J=I.substring(G);var A=-1;for(var D=G;D>0;D--){A++;if((A%3===0)&&(D!==G)){J=K+J;}J=I.charAt(D-1)+J;}I=J;}I=(E.prefix)?E.prefix+I:I;I=(E.suffix)?I+E.suffix:I;return I;}else{return B;}}};YAHOO.util.Date={format:function(C,B){B=B||{};if(C instanceof Date){var D=B.format||"MM/DD/YYYY";var E=C.getMonth()+1;var A=C.getDate();var F=C.getFullYear();switch(D){case"YYYY/MM/DD":return F+"/"+E+"/"+A;case"DD/MM/YYYY":return A+"/"+E+"/"+F;default:return E+"/"+A+"/"+F;}}else{return YAHOO.lang.isValue(C)?C:"";}}};YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 1061f34310c3dd39d6b9d060564ce9899590661f..54eec734f8d83927329f73eea1abf0969e1fbcee 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The DataSource utility provides a common configurable interface for widgets
@@ -34,18 +34,12 @@ version: 2.3.0
  * @param oConfigs {Object} (optional) Object literal of configuration values.
  */
 YAHOO.util.DataSource = function(oLiveData, oConfigs) {
-    // Set any config params passed in to override defaults
-    if(oConfigs && (oConfigs.constructor == Object)) {
-        for(var sConfig in oConfigs) {
-            if(sConfig) {
-                this[sConfig] = oConfigs[sConfig];
-            }
-        }
-    }
-    
     if(!oLiveData) {
         return;
     }
+    
+    this.liveData = oLiveData;
+    this._oQueue = {interval:null, conn:null, requests:[]};
 
     if(oLiveData.nodeType && oLiveData.nodeType == 9) {
         this.dataType = YAHOO.util.DataSource.TYPE_XML;
@@ -61,6 +55,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
     }
     else if(oLiveData.nodeName && (oLiveData.nodeName.toLowerCase() == "table")) {
         this.dataType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+        this.liveData = oLiveData.cloneNode(true);
     }
     else if(YAHOO.lang.isObject(oLiveData)) {
         this.dataType = YAHOO.util.DataSource.TYPE_JSON;
@@ -69,20 +64,23 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
         this.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
     }
 
-    this.liveData = oLiveData;
-    this._oQueue = {interval:null, conn:null, requests:[]};
-
-
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+    
     // Validate and initialize public configs
     var maxCacheEntries = this.maxCacheEntries;
     if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
         maxCacheEntries = 0;
     }
 
-    // Initialize local cache
-    if(maxCacheEntries > 0 && !this._aCache) {
-        this._aCache = [];
-    }
+    // Initialize interval tracker
+    this._aIntervals = [];
 
     this._sName = "DataSource instance" + YAHOO.util.DataSource._nIndex;
     YAHOO.util.DataSource._nIndex++;
@@ -100,18 +98,18 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event cacheRequestEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("cacheRequestEvent");
 
     /**
      * Fired when data is retrieved from the local cache.
      *
-     * @event getCachedResponseEvent
+     * @event cacheResponseEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      * @param oArgs.tId {Number} Transaction ID.
      */
     this.createEvent("cacheResponseEvent");
@@ -122,7 +120,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event requestEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("requestEvent");
 
@@ -133,7 +131,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The raw response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseEvent");
 
@@ -144,7 +142,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The parsed response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseParseEvent");
 
@@ -155,7 +153,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @param oArgs.request {Object} The request object.
      * @param oArgs.response {Object} The parsed response object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      */
     this.createEvent("responseCacheEvent");
     /**
@@ -164,7 +162,7 @@ YAHOO.util.DataSource = function(oLiveData, oConfigs) {
      * @event dataErrorEvent
      * @param oArgs.request {Object} The request object.
      * @param oArgs.callback {Function} The callback function.
-     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.caller {Object} (deprecated) Use callback.scope.
      * @param oArgs.message {String} The error message.
      */
     this.createEvent("dataErrorEvent");
@@ -340,6 +338,15 @@ YAHOO.util.DataSource.prototype._aCache = null;
  */
 YAHOO.util.DataSource.prototype._oQueue = null;
 
+/**
+ * Array of polling interval IDs that have been enabled, needed to clear all intervals.
+ *
+ * @property _aIntervals
+ * @type Array
+ * @private
+ */
+YAHOO.util.DataSource.prototype._aIntervals = null;
+
 /////////////////////////////////////////////////////////////////////////////
 //
 // Private methods
@@ -398,6 +405,7 @@ YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOW
  *
  * <dl>
  * <dt>resultsList</dt> <dd>Pointer to array of tabular data</dd>
+ * <dt>totalRecords</dt> <dd>Pointer to number of records (JSON over XHR only)</dd>
  * <dt>resultNode</dt> <dd>Pointer to node name of row data (XML data only)</dd>
  * <dt>recordDelim</dt> <dd>Record delimiter (text data only)</dd>
  * <dt>fieldDelim</dt> <dd>Field delimiter (text data only)</dd>
@@ -411,8 +419,7 @@ YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOW
 YAHOO.util.DataSource.prototype.responseSchema = null;
 
  /**
- * Alias to YUI Connection Manager. Allows implementers to specify their own
- * subclasses of the YUI Connection Manager utility.
+ * Alias to YUI Connection Manager, to allow implementers to customize the utility.
  *
  * @property connMgr
  * @type Object
@@ -589,32 +596,49 @@ YAHOO.util.DataSource.prototype.toString = function() {
  */
 YAHOO.util.DataSource.prototype.getCachedResponse = function(oRequest, oCallback, oCaller) {
     var aCache = this._aCache;
-    var nCacheLength = (aCache) ? aCache.length : 0;
-    var oResponse = null;
 
     // If cache is enabled...
-    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
-        this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
-
-        // Loop through each cached element
-        for(var i = nCacheLength-1; i >= 0; i--) {
-            var oCacheElem = aCache[i];
-
-            // Defer cache hit logic to a public overridable method
-            if(this.isCacheHit(oRequest,oCacheElem.request)) {
-                // Grab the cached response
-                oResponse = oCacheElem.response;
-                // The cache returned a hit!
-                // Remove element from its original location
-                aCache.splice(i,1);
-                // Add as newest
-                this.addToCache(oRequest, oResponse);
-                this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
-                break;
+    if(this.maxCacheEntries > 0) {        
+        // Initialize local cache
+        if(!aCache) {
+            this._aCache = [];
+        }
+        // Look in local cache
+        else {
+            var nCacheLength = aCache.length;
+            if(nCacheLength > 0) {
+                var oResponse = null;
+                this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+        
+                // Loop through each cached element
+                for(var i = nCacheLength-1; i >= 0; i--) {
+                    var oCacheElem = aCache[i];
+        
+                    // Defer cache hit logic to a public overridable method
+                    if(this.isCacheHit(oRequest,oCacheElem.request)) {
+                        // The cache returned a hit!
+                        // Grab the cached response
+                        oResponse = oCacheElem.response;
+                        this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
+                        
+                        // Refresh the position of the cache hit
+                        if(i < nCacheLength-1) {
+                            // Remove element from its original location
+                            aCache.splice(i,1);
+                            // Add as newest
+                            this.addToCache(oRequest, oResponse);
+                        }
+                        break;
+                    }
+                }
+                return oResponse;
             }
         }
     }
-    return oResponse;
+    else if(aCache) {
+        this._aCache = null;
+    }
+    return null;
 };
 
 /**
@@ -645,8 +669,6 @@ YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
         return;
     }
 
-    //TODO: check for duplicate entries
-
     // If the cache is full, make room by removing stalest element (index=0)
     while(aCache.length >= this.maxCacheEntries) {
         aCache.shift();
@@ -654,7 +676,7 @@ YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
 
     // Add to cache in the newest position, at the end of the array
     var oCacheElem = {request:oRequest,response:oResponse};
-    aCache.push(oCacheElem);
+    aCache[aCache.length] = oCacheElem;
     this.fireEvent("responseCacheEvent", {request:oRequest,response:oResponse});
 };
 
@@ -670,20 +692,109 @@ YAHOO.util.DataSource.prototype.flushCache = function() {
     }
 };
 
+/**
+ * Sets up a polling mechanism to send requests at set intervals and forward
+ * responses to given callback.
+ *
+ * @method setInterval
+ * @param nMsec {Number} Length of interval in milliseconds.
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
+ * @return {Number} Interval ID.
+ */
+YAHOO.util.DataSource.prototype.setInterval = function(nMsec, oRequest, oCallback, oCaller) {
+    if(YAHOO.lang.isNumber(nMsec) && (nMsec >= 0)) {
+        var oSelf = this;
+        var nId = setInterval(function() {
+            oSelf.makeConnection(oRequest, oCallback, oCaller);
+        }, nMsec);
+        this._aIntervals.push(nId);
+        return nId;
+    }
+    else {
+    }
+};
+
+/**
+ * Disables polling mechanism associated with the given interval ID.
+ *
+ * @method clearInterval
+ * @param nId {Number} Interval ID.
+ */
+YAHOO.util.DataSource.prototype.clearInterval = function(nId) {
+    // Remove from tracker if there
+    var tracker = this._aIntervals || [];
+    for(var i=tracker.length-1; i>-1; i--) {
+        if(tracker[i] === nId) {
+            tracker.splice(i,1);
+            clearInterval(nId);
+        }
+    }
+};
+
+/**
+ * Disables all known polling intervals.
+ *
+ * @method clearAllIntervals
+ */
+YAHOO.util.DataSource.prototype.clearAllIntervals = function(nId) {
+    var tracker = this._aIntervals || [];
+    for(var i=tracker.length-1; i>-1; i--) {
+        tracker.splice(i,1);
+        clearInterval(nId);
+    }
+};
+
+/**
+ * Executes a configured callback.  For object literal callbacks, the third
+ * param determines whether to execute the success handler or failure handler.
+ * @method issueCallback
+ * @param callback {Function|Object} the callback to execute
+ * @param params {Array} params to be passed to the callback method
+ * @param error {Boolean} whether an error occurred
+ * @param scope {Object} the scope from which to execute the callback
+ * (deprecated - use an object literal callback)
+ */
+YAHOO.util.DataSource.issueCallback = function (callback,params,error,scope) {
+    if (YAHOO.lang.isFunction(callback)) {
+        callback.apply(scope, params);
+    } else if (YAHOO.lang.isObject(callback)) {
+        scope = callback.scope || scope || window;
+        var callbackFunc = callback.success;
+        if (error) {
+            callbackFunc = callback.failure;
+        }
+        if (callbackFunc) {
+            callbackFunc.apply(scope, params.concat([callback.argument]));
+        }
+    }
+};
+
 /**
  * First looks for cached response, then sends request to live data.
  *
  * @method sendRequest
  * @param oRequest {Object} Request object.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The Calling object that is making the request.
+ * @param oCallback {Object} An object literal with the following properties:
+ *     <dl>
+ *     <dt><code>success</code></dt>
+ *     <dd>The function to call when the data is ready.</dd>
+ *     <dt><code>failure</code></dt>
+ *     <dd>The function to call upon a response failure condition.</dd>
+ *     <dt><code>scope</code></dt>
+ *     <dd>The object to serve as the scope for the success and failure handlers.</dd>
+ *     <dt><code>argument</code></dt>
+ *     <dd>Arbitrary data that will be passed back to the success and failure handlers.</dd>
+ *     </dl> 
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @return {Number} Transaction ID, or null if response found in cache.
  */
 YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCaller) {
     // First look in cache
     var oCachedResponse = this.getCachedResponse(oRequest, oCallback, oCaller);
     if(oCachedResponse) {
-        oCallback.call(oCaller, oRequest, oCachedResponse);
+        YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);
         return null;
     }
 
@@ -699,8 +810,8 @@ YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCal
  *
  * @method makeConnection
  * @param oRequest {Object} Request object.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The Calling object that is making the request.
+ * @param oCallback {Object} Callback object literal.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @return {Number} Transaction ID.
  */
 YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, oCaller) {
@@ -747,7 +858,8 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
                             message:YAHOO.util.DataSource.ERROR_DATANULL});
 
                     // Send error response back to the caller with the error flag on
-                    oCallback.call(oCaller, oRequest, oResponse, true);
+                    // TODO: should this send oResponse, considering the fork?
+                    YAHOO.util.DataSource.issueCallback(oCallback,[oRequest, {error:true}], true, oCaller);
 
                     return null;
                 }
@@ -775,7 +887,10 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
                 }
 
                 // Send failure response back to the caller with the error flag on
-                oCallback.call(oCaller, oRequest, oResponse, true);
+                oResponse = oResponse || {};
+                oResponse.error = true;
+                YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oResponse],true, oCaller);
+
                 return null;
             };
 
@@ -863,7 +978,7 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
             }
             else {
                 // Send null response back to the caller with the error flag on
-                oCallback.call(oCaller, oRequest, null, true);
+                YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);
             }
 
             break;
@@ -884,23 +999,24 @@ YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, o
 };
 
 /**
- * Handles raw data response from live data source. Sends a parsed response object
- * to the callback function in this format:
- *
- * fnCallback(oRequest, oParsedResponse)
- *
- * where the oParsedResponse object literal with the following properties:
- * <ul>
- *     <li>tId {Number} Unique transaction ID</li>
- *     <li>results {Array} Array of parsed data results</li>
- *     <li>error {Boolean} True if there was an error</li>
- * </ul>
+ * Receives raw data response and type converts to XML, JSON, etc as necessary.
+ * Forwards oFullResponse to appropriate parsing function to get turned into
+ * oParsedResponse. Calls doBeforeCallback() and adds oParsedResponse to 
+ * the cache when appropriate before calling issueCallback().
+ * 
+ * The oParsedResponse object literal has the following properties:
+ * <dl>
+ *     <dd><dt>tId {Number}</dt> Unique transaction ID</dd>
+ *     <dd><dt>results {Array}</dt> Array of parsed data results</dd>
+ *     <dd><dt>error {Boolean}</dt> True if there was an error</dd>
+ *     <dd><dt>totalRecords {Number}</dt> Total number of records (if available)</dd> 
+ * </dl>
  *
  * @method handleResponse
  * @param oRequest {Object} Request object
  * @param oRawResponse {Object} The raw response from the live database.
- * @param oCallback {Function} Handler function to receive the response.
- * @param oCaller {Object} The calling object that is making the request.
+ * @param oCallback {Object} Callback object literal.
+ * @param oCaller {Object} (deprecated) Use oCallback.scope.
  * @param tId {Number} Transaction ID.
  */
 YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse, oCallback, oCaller, tId) {
@@ -908,85 +1024,129 @@ YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse
             callback:oCallback, caller:oCaller, tId: tId});
     var xhr = (this.dataType == YAHOO.util.DataSource.TYPE_XHR) ? true : false;
     var oParsedResponse = null;
-    var bError = false;
-
-    // Access to the raw response before it gets parsed
-    oRawResponse = this.doBeforeParseData(oRequest, oRawResponse);
+    var oFullResponse = oRawResponse;
 
     switch(this.responseType) {
         case YAHOO.util.DataSource.TYPE_JSARRAY:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText; 
             }
-            oParsedResponse = this.parseArrayData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseArrayData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_JSON:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
+            }
+            try {
+                // Convert to JSON object if it's a string
+                if(YAHOO.lang.isString(oFullResponse)) {
+                    // Check for YUI JSON Util
+                    if(YAHOO.lang.JSON) {
+                        oFullResponse = YAHOO.lang.JSON.parse(oFullResponse);
+                    }
+                    // Look for JSON parsers using an API similar to json2.js
+                    else if(window.JSON && JSON.parse) {
+                        oFullResponse = JSON.parse(oFullResponse);
+                    }
+                    // Look for JSON parsers using an API similar to json.js
+                    else if(oFullResponse.parseJSON) {
+                        oFullResponse = oFullResponse.parseJSON();
+                    }
+                    // No JSON lib found so parse the string
+                    else {
+                        // Trim leading spaces
+                        while (oFullResponse.length > 0 &&
+                                (oFullResponse.charAt(0) != "{") &&
+                                (oFullResponse.charAt(0) != "[")) {
+                            oFullResponse = oFullResponse.substring(1, oFullResponse.length);
+                        }
+    
+                        if(oFullResponse.length > 0) {
+                            // Strip extraneous stuff at the end
+                            var objEnd = Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));
+                            oFullResponse = oFullResponse.substring(0,objEnd+1);
+    
+                            // Turn the string into an object literal...
+                            // ...eval is necessary here
+                            oFullResponse = eval("(" + oFullResponse + ")");
+    
+                        }
+                    }
+                }
             }
-            oParsedResponse = this.parseJSONData(oRequest, oRawResponse);
+            catch(e) {
+            }
+
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseJSONData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_HTMLTABLE:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
             }
-            oParsedResponse = this.parseHTMLTableData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseHTMLTableData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_XML:
             if(xhr && oRawResponse.responseXML) {
-                oRawResponse = oRawResponse.responseXML;
+                oFullResponse = oRawResponse.responseXML;
             }
-            oParsedResponse = this.parseXMLData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseXMLData(oRequest, oFullResponse);
             break;
         case YAHOO.util.DataSource.TYPE_TEXT:
             if(xhr && oRawResponse.responseText) {
-                oRawResponse = oRawResponse.responseText;
+                oFullResponse = oRawResponse.responseText;
             }
-            oParsedResponse = this.parseTextData(oRequest, oRawResponse);
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.parseTextData(oRequest, oFullResponse);
             break;
         default:
             //var contentType = oRawResponse.getResponseHeader["Content-Type"];
+            oFullResponse = this.doBeforeParseData(oRequest, oFullResponse);
+            oParsedResponse = this.doBeforeParseData(oRequest, oFullResponse);
             break;
     }
 
-
-    if(oParsedResponse) {
+    if(oParsedResponse && !oParsedResponse.error) {
         // Last chance to touch the raw response or the parsed response
-        oParsedResponse.tId = tId;
-        oParsedResponse = this.doBeforeCallback(oRequest, oRawResponse, oParsedResponse);
+        oParsedResponse = this.doBeforeCallback(oRequest, oFullResponse, oParsedResponse);
         this.fireEvent("responseParseEvent", {request:oRequest,
                 response:oParsedResponse, callback:oCallback, caller:oCaller});
         // Cache the response
         this.addToCache(oRequest, oParsedResponse);
     }
     else {
-        this.fireEvent("dataErrorEvent", {request:oRequest, callback:oCallback,
+        this.fireEvent("dataErrorEvent", {request:oRequest, response: oRawResponse, callback:oCallback, 
                 caller:oCaller, message:YAHOO.util.DataSource.ERROR_DATANULL});
         
-        // Send response back to the caller with the error flag on
-        oParsedResponse = {error:true};
+        // Be sure the error flag is on
+        oParsedResponse = oParsedResponse || {};
+        oParsedResponse.error = true;
     }
-    
+
     // Send the response back to the caller
-    oCallback.call(oCaller, oRequest, oParsedResponse);
+    oParsedResponse.tId = tId;
+    YAHOO.util.DataSource.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);
 };
 
 /**
- * Overridable method gives implementers access to the original raw response
+ * Overridable method gives implementers access to the original full response
  * before the data gets parsed. Implementers should take care not to return an
- * unparsable or otherwise invalid raw response.
+ * unparsable or otherwise invalid response.
  *
  * @method doBeforeParseData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Raw response for parsing.
+ * @param oFullResponse {Object} The full response from the live database.
+ * @return {Object} Full response for parsing.
  */
-YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawResponse) {
-    return oRawResponse;
+YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oFullResponse) {
+    return oFullResponse;
 };
 
 /**
- * Overridable method gives implementers access to the original raw response and
+ * Overridable method gives implementers access to the original full response and
  * the parsed response (parsed against the given schema) before the data
  * is added to the cache (if applicable) and then sent back to callback function.
  * This is your chance to access the raw response and/or populate the parsed
@@ -994,297 +1154,465 @@ YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawRespo
  *
  * @method doBeforeCallback
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
+ * @param oFullResponse {Object} The full response from the live database.
  * @param oParsedResponse {Object} The parsed response to return to calling object.
  * @return {Object} Parsed response object.
  */
-YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oRawResponse, oParsedResponse) {
+YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oFullResponse, oParsedResponse) {
     return oParsedResponse;
 };
 
 /**
- * Overridable method parses raw array data into a response object.
+ * Overridable method parses Array data into a response object.
  *
  * @method parseArrayData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full Array from the live database.
+ * @return {Object} Parsed response object with the following properties:<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oRawResponse) {
-    if(YAHOO.lang.isArray(oRawResponse) && YAHOO.lang.isArray(this.responseSchema.fields)) {
-        var oParsedResponse = {results:[]};
-        var fields = this.responseSchema.fields;
-        for(var i=oRawResponse.length-1; i>-1; i--) {
-            var oResult = {};
-            for(var j=fields.length-1; j>-1; j--) {
-                var field = fields[j];
-                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                var data = (YAHOO.lang.isValue(oRawResponse[i][j])) ? oRawResponse[i][j] : oRawResponse[i][key];
-                // Backward compatibility
-                if(!field.parser && field.converter) {
-                    field.parser = field.converter;
+YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oFullResponse) {
+    if(YAHOO.lang.isArray(oFullResponse)) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields)) {
+            var results = [],
+                fields = this.responseSchema.fields,
+                i;
+            for (i = fields.length - 1; i >= 0; --i) {
+                if (typeof fields[i] !== 'object') {
+                    fields[i] = { key : fields[i] };
                 }
-                if(field.parser) {
-                    data = field.parser.call(this, data);
+            }
+
+            var parsers = {};
+            for (i = fields.length - 1; i >= 0; --i) {
+                var p = fields[i].parser || fields[i].converter;
+                if (p) {
+                    parsers[fields[i].key] = p;
                 }
-                // Safety measure
-                if(data === undefined) {
-                    data = null;
+            }
+
+            var arrType = YAHOO.lang.isArray(oFullResponse[0]);
+            for(i=oFullResponse.length-1; i>-1; i--) {
+                var oResult = {};
+                var rec = oFullResponse[i];
+                if (typeof rec === 'object') {
+                    for(var j=fields.length-1; j>-1; j--) {
+                        var field = fields[j];
+                        var data = arrType ? rec[j] : rec[field.key];
+
+                        if (parsers[field.key]) {
+                            data = parsers[field.key].call(this,data);
+                        }
+
+                        // Safety measure
+                        if(data === undefined) {
+                            data = null;
+                        }
+
+                        oResult[field.key] = data;
+                    }
                 }
-                oResult[key] = data;
+                results[i] = oResult;
             }
-            oParsedResponse.results.unshift(oResult);
+
+            var oParsedResponse = {results:results};
+            return oParsedResponse;
         }
-        return oParsedResponse;
-    }
-    else {
-        return null;
     }
+    return null;
 };
 
 /**
- * Overridable method parses raw plain text data into a response object.
+ * Overridable method parses plain text data into a response object.
  *
  * @method parseTextData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full text response from the live database.
+ * @return {Object} Parsed response object with the following properties:<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oRawResponse) {
-    var oParsedResponse = {};
-    if(YAHOO.lang.isString(oRawResponse) &&
-            YAHOO.lang.isArray(this.responseSchema.fields) &&
-            YAHOO.lang.isString(this.responseSchema.recordDelim) &&
-            YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
-        oParsedResponse.results = [];
-        var recDelim = this.responseSchema.recordDelim;
-        var fieldDelim = this.responseSchema.fieldDelim;
-        var fields = this.responseSchema.fields;
-        if(oRawResponse.length > 0) {
-            // Delete the last line delimiter at the end of the data if it exists
-            var newLength = oRawResponse.length-recDelim.length;
-            if(oRawResponse.substr(newLength) == recDelim) {
-                oRawResponse = oRawResponse.substr(0, newLength);
-            }
-            // Split along record delimiter to get an array of strings
-            var recordsarray = oRawResponse.split(recDelim);
-            // Cycle through each record, except the first which contains header info
-            for(var i = recordsarray.length-1; i>-1; i--) {
-                var oResult = {};
-                for(var j=fields.length-1; j>-1; j--) {
-                    // Split along field delimter to get each data value
-                    var fielddataarray = recordsarray[i].split(fieldDelim);
-
-                    // Remove quotation marks from edges, if applicable
-                    var data = fielddataarray[j];
-                    if(data.charAt(0) == "\"") {
-                        data = data.substr(1);
-                    }
-                    if(data.charAt(data.length-1) == "\"") {
-                        data = data.substr(0,data.length-1);
-                    }
-                    var field = fields[j];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
-                    }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
-                    }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oFullResponse) {
+    if(YAHOO.lang.isString(oFullResponse)) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields) &&
+                YAHOO.lang.isString(this.responseSchema.recordDelim) &&
+                YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
+            var oParsedResponse = {results:[]};
+            var recDelim = this.responseSchema.recordDelim;
+            var fieldDelim = this.responseSchema.fieldDelim;
+            var fields = this.responseSchema.fields;
+            if(oFullResponse.length > 0) {
+                // Delete the last line delimiter at the end of the data if it exists
+                var newLength = oFullResponse.length-recDelim.length;
+                if(oFullResponse.substr(newLength) == recDelim) {
+                    oFullResponse = oFullResponse.substr(0, newLength);
+                }
+                // Split along record delimiter to get an array of strings
+                var recordsarray = oFullResponse.split(recDelim);
+                // Cycle through each record
+                for(var i = 0, len = recordsarray.length, recIdx = 0; i < len; ++i) {
+                    var oResult = {};
+                    var bError = false;
+                    if (YAHOO.lang.isString(recordsarray[i])) {
+                        // Split each record along field delimiter to get data array
+                        var fielddataarray = recordsarray[i].split(fieldDelim);
+                        for(var j=fields.length-1; j>-1; j--) {
+                            try {
+                                // Remove quotation marks from edges, if applicable
+                                var data = fielddataarray[j];
+                                if (YAHOO.lang.isString(data)) {
+                                    if(data.charAt(0) == "\"") {
+                                        data = data.substr(1);
+                                    }
+                                    if(data.charAt(data.length-1) == "\"") {
+                                        data = data.substr(0,data.length-1);
+                                    }
+                                    var field = fields[j];
+                                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                                    // Backward compatibility
+                                    if(!field.parser && field.converter) {
+                                        field.parser = field.converter;
+                                    }
+                                    if(field.parser) {
+                                        data = field.parser.call(this, data);
+                                    }
+                                    // Safety measure
+                                    if(data === undefined) {
+                                        data = null;
+                                    }
+                                    oResult[key] = data;
+                                }
+                                else {
+                                    bError = true;
+                                }
+                            }
+                            catch(e) {
+                                bError = true;
+                            }
+                        }
+                        if(!bError) {
+                            oParsedResponse.results[recIdx++] = oResult;
+                        }
                     }
-                    oResult[key] = data;
                 }
-                oParsedResponse.results.unshift(oResult);
             }
+            return oParsedResponse;
         }
     }
-    else {
-        oParsedResponse.error = true;
-    }
-    return oParsedResponse;
+    return null;
+            
 };
 
 /**
- * Overridable method parses raw XML data into a response object.
+ * Overridable method parses XML data into a response object.
  *
  * @method parseXMLData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full XML response from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oRawResponse) {
-        var bError = false;
-        var oParsedResponse = {};
-        var xmlList = (this.responseSchema.resultNode) ?
-                oRawResponse.getElementsByTagName(this.responseSchema.resultNode) :
-                null;
-        if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
-            bError = true;
-        }
-        // Loop through each result
-        else {
-            oParsedResponse.results = [];
-            for(var k = xmlList.length-1; k >= 0 ; k--) {
-                var result = xmlList.item(k);
-                var oResult = {};
-                // Loop through each data field in each result using the schema
-                for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
-                    var field = this.responseSchema.fields[m];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    var data = null;
-                    // Values may be held in an attribute...
-                    var xmlAttr = result.attributes.getNamedItem(key);
-                    if(xmlAttr) {
-                        data = xmlAttr.value;
-                    }
-                    // ...or in a node
-                    else {
-                        var xmlNode = result.getElementsByTagName(key);
-                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
-                            data = xmlNode.item(0).firstChild.nodeValue;
-                        }
-                        else {
-                               data = "";
+YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oFullResponse) {
+    var bError = false;
+    var oParsedResponse = {};
+    var xmlList = null;
+    var totRecLocator = this.responseSchema.totalRecords;
+
+    // In case oFullResponse is something funky
+    try {
+        xmlList = (this.responseSchema.resultNode) ?
+            oFullResponse.getElementsByTagName(this.responseSchema.resultNode) :
+            null;
+
+        if (totRecLocator) {
+            // Look for a totalRecords node
+            var totalRecords = null;
+            var totRec = oFullResponse.getElementsByTagName(totRecLocator)[0];
+            if (totRec) {
+                totalRecords = totRec.firstChild.nodeValue;
+            } else {
+                totRec = oFullResponse.firstChild.attributes.getNamedItem(totRecLocator);
+                if (totRec) {
+                    totalRecords = totRec.value;
+                } else if (xmlList && xmlList.length) {
+                    var par = xmlList.item(0).parentNode;
+                    if (par) {
+                        totRec = par.attributes.getNamedItem(totRecLocator);
+                        if (totRec) {
+                            totalRecords = totRec.value;
                         }
                     }
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
-                    }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
+                }
+            }
+
+            if (YAHOO.lang.isValue(totalRecords)) {
+                oParsedResponse.totalRecords = parseInt(totalRecords,10)|0;
+            }
+        }
+    }
+    catch(e) {
+    }
+    if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
+        bError = true;
+    }
+    // Loop through each result
+    else {
+
+        oParsedResponse.results = [];
+        for(var k = xmlList.length-1; k >= 0 ; k--) {
+            var result = xmlList.item(k);
+            var oResult = {};
+            // Loop through each data field in each result using the schema
+            for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
+                var field = this.responseSchema.fields[m];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                var data = null;
+                // Values may be held in an attribute...
+                var xmlAttr = result.attributes.getNamedItem(key);
+                if(xmlAttr) {
+                    data = xmlAttr.value;
+                }
+                // ...or in a node
+                else {
+                    var xmlNode = result.getElementsByTagName(key);
+                    if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                        data = xmlNode.item(0).firstChild.nodeValue;
                     }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+                    else {
+                           data = "";
                     }
-                    oResult[key] = data;
                 }
-                // Capture each array of values into an array of results
-                oParsedResponse.results.unshift(oResult);
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
             }
+            // Capture each array of values into an array of results
+            oParsedResponse.results[k] = oResult;
         }
-        if(bError) {
-            oParsedResponse.error = true;
+    }
+    if(bError) {
+        oParsedResponse.error = true;
+    }
+    else {
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Executes a function created on the fly to parse the response JSON according to 
+ * the defined schema.
+ * @method executeJSONParser
+ * @param oFullResponse {Object} The raw JSON-typed data from the server.
+ * @return {Object}
+ * @private
+ */
+YAHOO.util.DataSource.prototype.executeJSONParser = function (oFullResponse) {
+    // Create the parsing method per the responseSchema only once
+    if (!this.jsonResponseParser) {
+
+        var schema       = this.responseSchema,
+            fields       = schema.fields,
+            resultsList  = schema.resultsList,
+            totalRecords = schema.totalRecords,
+            keys         = [],
+            keyAssign,
+            i;
+
+        if (/\(/.test(resultsList)) {
+            throw new SyntaxError("resultsList may only contain valid characters for variable names");
         }
-        else {
+
+        // Commit the atrocity of creating a function on the fly. parserDef
+        // will become the body passed to new Function.  The signature will be
+        // function (oFullResponse)
+        var parserDef = 
+            // grab the results list from the response
+            "var results=oFullResponse";
+        
+        // Default direct assignment of oFullResponse as the resultsList if
+        // the schema was not configured with a resultsList key.  Otherwise
+        // create results=oFullResponse.location['in'].resultsList
+        if (YAHOO.lang.isValue(resultsList)) {
+            parserDef += "." + resultsList;
+        }
+        parserDef += ";";
+
+        // if the list wasn't found at that location, default an empty array
+        parserDef +=
+            "if(!results){" +
+                "results=[];" +
+            "}" +
+
+            // make sure it's an array
+            "if(!YAHOO.lang.isArray(results)){" +
+                "results=[results];" +
+            "}";
+
+        // Check for non-flat field keys.  If no keys need depth greater than
+        // 1 (e.g. {key:"a.b.c"}), the raw data records can be used.
+        for (i = fields.length - 1; i >= 0; --i) {
+            keys[i] = typeof fields[i] === 'object' ? fields[i].key : fields[i];
+        }
+
+        // Test for any key having a '.' or '[' char
+        if (/\[|\./.test(keys.join(''))) {
+            // There are non-flat keys.  Iterate through the results, flattening
+            // the keys -- {key:'a.b.c'} pulls value into result data like
+            // { 'a.b.c': result.a.b.c, ... } (note the key is a flat string)
+            parserDef +=
+            "for(var i=results.length-1;i>=0;--i){" +
+                "var r=results[i];" +
+                "results[i]={";
+
+            keyAssign = [];
+            for (i = keys.length - 1; i >= 0; --i) {
+                // Escape the quotes in 'a["b"]' style notation for the key
+                // portion.
+                keyAssign[i] = '"'+keys[i].replace(/"/g,'\\"')+'":r.'+keys[i];
+            }
+            parserDef += keyAssign.join(',') +
+                "};" +
+            "}";
+        }
+
+        // Generate the oParsedResponse
+        parserDef +=
+            "return {" +
+                "results:results";
+
+        // Include totalRecords if defined in the schema
+        if (totalRecords) {
+            parserDef += "," +
+                "totalRecords:oFullResponse."+totalRecords;
         }
-        return oParsedResponse;
+        
+        parserDef +=
+            "};";
+
+
+        this.jsonResponseParser = new Function("oFullResponse",parserDef);
+    }
+
+    return this.jsonResponseParser(oFullResponse);
 };
 
 /**
- * Overridable method parses raw JSON data into a response object.
+ * Overridable method parses JSON data into a response object.
  *
  * @method parseJSONData
  * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @param oFullResponse {Object} The full JSON from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
  */
-YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse) {
-    var oParsedResponse = {};
-    if(oRawResponse && YAHOO.lang.isArray(this.responseSchema.fields)) {
-        var fields = this.responseSchema.fields;
-        var bError = false;
-        oParsedResponse.results = [];
-        var jsonObj,jsonList;
-
-        // Parse JSON object out if it's a string
-        if(YAHOO.lang.isString(oRawResponse)) {
-            // Check for latest JSON lib but divert KHTML clients
-            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
-            if(oRawResponse.parseJSON && isNotMac) {
-                // Use the new JSON utility if available
-                jsonObj = oRawResponse.parseJSON();
-                if(!jsonObj) {
-                    bError = true;
+YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oFullResponse) {
+    var oParsedResponse = {results:[]};
+    if(oFullResponse && (YAHOO.lang.isObject(oFullResponse))) {
+        if(YAHOO.lang.isArray(this.responseSchema.fields)) {
+            var fields          = this.responseSchema.fields,
+                parserMap       = {},
+                bError          = false,
+                bHasParser      = false,
+                i;
+
+            // Build the parser map
+            for (i = fields.length - 1; i >= 0; --i) {
+                var key    = fields[i].key || fields[i],
+                    parser = fields[i].parser || fields[i].converter;
+
+                if (parser) {
+                    parserMap[key] = parser;
+                    bHasParser = true;
                 }
             }
-            // Check for older JSON lib but divert KHTML clients
-            else if(window.JSON && JSON.parse && isNotMac) {
-                // Use the JSON utility if available
-                jsonObj = JSON.parse(oRawResponse);
-                if(!jsonObj) {
-                    bError = true;
-                }
+
+            // Parse out a jsonList
+            try {
+                oParsedResponse = this.executeJSONParser(oFullResponse);
+            }
+            catch(e) {
+                bError = true;
             }
-            // No JSON lib found so parse the string
-            else {
-                try {
-                    // Trim leading spaces
-                    while (oRawResponse.length > 0 &&
-                            (oRawResponse.charAt(0) != "{") &&
-                            (oRawResponse.charAt(0) != "[")) {
-                        oRawResponse = oRawResponse.substring(1, oRawResponse.length);
-                    }
 
-                    if(oRawResponse.length > 0) {
-                        // Strip extraneous stuff at the end
-                        var objEnd = Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));
-                        oRawResponse = oRawResponse.substring(0,objEnd+1);
+            // Check for errors
+            if(bError || !oParsedResponse || !oParsedResponse.results) {
+                if (!oParsedResponse) {
+                    oParsedResponse = {results:[]};
+                }
 
-                        // Turn the string into an object literal...
-                        // ...eval is necessary here
-                        jsonObj = eval("(" + oRawResponse + ")");
-                        if(!jsonObj) {
-                            bError = true;
-                        }
+                oParsedResponse.error = true;
+            }
 
-                    }
-                    else {
-                        jsonObj = null;
-                        bError = true;
+            // Loop through the results to parse data if there are parsers
+            if (bHasParser) {
+                for (i = oParsedResponse.results.length - 1; i >= 0; --i) {
+                    var r = oParsedResponse.results[i];
+                    for (var p in parserMap) {
+                        if (YAHOO.lang.hasOwnProperty(parserMap,p)) {
+                            r[p] = parserMap[p].call(this,r[p]);
+                            if (r[p] === undefined) {
+                                r[p] = null;
+                            }
+                        }
                     }
                 }
-                catch(e) {
-                    bError = true;
-               }
-            }
-        }
-        // Response must already be a JSON object
-        else if(oRawResponse.constructor == Object) {
-            jsonObj = oRawResponse;
-        }
-        // Not a string or an object
-        else {
-            bError = true;
-        }
-        // Now that we have a JSON object, parse a jsonList out of it
-        if(jsonObj && jsonObj.constructor == Object) {
-            try {
-                // eval is necessary here since schema can be of unknown depth
-                jsonList = eval("jsonObj." + this.responseSchema.resultsList);
-            }
-            catch(e) {
-                bError = true;
             }
         }
+    }
+    else {
+        oParsedResponse.error = true;
+    }
 
-        if(bError || !jsonList) {
-            oParsedResponse.error = true;
-        }
-        if(jsonList && !YAHOO.lang.isArray(jsonList)) {
-            jsonList = [jsonList];
-        }
-        else if(!jsonList) {
-            jsonList = [];
-        }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses an HTML TABLE element reference into a response object.
+ *
+ * @method parseHTMLTableData
+ * @param oRequest {Object} Request object.
+ * @param oFullResponse {Object} The full HTML element reference from the live database.
+ * @return {Object} Parsed response object with the following properties<br>
+ *     - results (Array) Array of parsed data results<br>
+ *     - error (Boolean) True if there was an error<br>
+ *     - totalRecords (Number) Total number of records (if available)
+ */
+YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oFullResponse) {
+    var bError = false;
+    var elTable = oFullResponse;
+    var fields = this.responseSchema.fields;
+    var oParsedResponse = {results:[]};
+
+    // Iterate through each TBODY
+    for(var i=0; i<elTable.tBodies.length; i++) {
+        var elTbody = elTable.tBodies[i];
 
-        // Loop through the array of all responses...
-        for(var i = jsonList.length-1; i >= 0 ; i--) {
+        // Iterate through each TR
+        for(var j=elTbody.rows.length-1; j>-1; j--) {
+            var elRow = elTbody.rows[j];
             var oResult = {};
-            var jsonResult = jsonList[i];
-            // ...and loop through each data field value of each response
-            for(var j = fields.length-1; j >= 0 ; j--) {
-                var field = fields[j];
+            
+            for(var k=fields.length-1; k>-1; k--) {
+                var field = fields[k];
                 var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                // ...and capture data into an array mapped according to the schema...
-                // eval is necessary here since schema can be of unknown depth
-                var data = eval("jsonResult." + key);
-                
+                var data = elRow.cells[k].innerHTML;
+
                 // Backward compatibility
                 if(!field.parser && field.converter) {
                     field.parser = field.converter;
@@ -1298,68 +1626,174 @@ YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse)
                 }
                 oResult[key] = data;
             }
-            // Capture the array of data field values in an array of results
-            oParsedResponse.results.unshift(oResult);
+            oParsedResponse.results[j] = oResult;
         }
     }
-    else {
+
+    if(bError) {
         oParsedResponse.error = true;
     }
+    else {
+    }
     return oParsedResponse;
 };
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
 /**
- * Overridable method parses raw HTML TABLE element data into a response object.
+ * The static Number class provides helper functions to deal with data of type
+ * Number.
  *
- * @method parseHTMLTableData
- * @param oRequest {Object} Request object.
- * @param oRawResponse {Object} The raw response from the live database.
- * @return {Object} Parsed response object.
+ * @namespace YAHOO.util
+ * @requires datasource
+ * @class Number
+ * @static
  */
-YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oRawResponse) {
-        var bError = false;
-        var elTable = oRawResponse;
-        var fields = this.responseSchema.fields;
-        var oParsedResponse = {};
-        oParsedResponse.results = [];
-
-        // Iterate through each TBODY
-        for(var i=0; i<elTable.tBodies.length; i++) {
-            var elTbody = elTable.tBodies[i];
+ YAHOO.util.Number = {
+     /**
+     * Takes a native JavaScript Number and formats to string for display to user.
+     *
+     * @method format
+     * @param nData {Number} Number.
+     * @param oConfig {Object} (Optional) Optional configuration values:
+     *  <dl>
+     *   <dt>prefix {String}</dd>
+     *   <dd>String prepended before each number, like a currency designator "$"</dd>
+     *   <dt>decimalPlaces {Number}</dd>
+     *   <dd>Number of decimal places to round.</dd>
+     *   <dt>decimalSeparator {String}</dd>
+     *   <dd>Decimal separator</dd>
+     *   <dt>thousandsSeparator {String}</dd>
+     *   <dd>Thousands separator</dd>
+     *   <dt>suffix {String}</dd>
+     *   <dd>String appended after each number, like " items" (note the space)</dd>
+     *  </dl>
+     * @return {String} Formatted number for display.
+     */
+    format: function(nData, oConfig) {
+        oConfig = oConfig || {};
+        
+        if(!YAHOO.lang.isNumber(nData)) {
+            nData *= 1;
+        }
 
-            // Iterate through each TR
-            for(var j=elTbody.rows.length-1; j>-1; j--) {
-                var elRow = elTbody.rows[j];
-                var oResult = {};
-                
-                for(var k=fields.length-1; k>-1; k--) {
-                    var field = fields[k];
-                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
-                    var data = elRow.cells[k].innerHTML;
-
-                    // Backward compatibility
-                    if(!field.parser && field.converter) {
-                        field.parser = field.converter;
+        if(YAHOO.lang.isNumber(nData)) {
+            var sOutput = nData + "";
+            var sDecimalSeparator = (oConfig.decimalSeparator) ? oConfig.decimalSeparator : ".";
+            var nDotIndex;
+
+            // Manage decimals
+            if(YAHOO.lang.isNumber(oConfig.decimalPlaces)) {
+                // Round to the correct decimal place
+                var nDecimalPlaces = oConfig.decimalPlaces;
+                var nDecimal = Math.pow(10, nDecimalPlaces);
+                sOutput = Math.round(nData*nDecimal)/nDecimal + "";
+                nDotIndex = sOutput.lastIndexOf(".");
+
+                if(nDecimalPlaces > 0) {
+                    // Add the decimal separator
+                    if(nDotIndex < 0) {
+                        sOutput += sDecimalSeparator;
+                        nDotIndex = sOutput.length-1;
                     }
-                    if(field.parser) {
-                        data = field.parser.call(this, data);
+                    // Replace the "."
+                    else if(sDecimalSeparator !== "."){
+                        sOutput = sOutput.replace(".",sDecimalSeparator);
                     }
-                    // Safety measure
-                    if(data === undefined) {
-                        data = null;
+                    // Add missing zeros
+                    while((sOutput.length - 1 - nDotIndex) < nDecimalPlaces) {
+                        sOutput += "0";
+                    }
+                }
+            }
+            
+            // Add the thousands separator
+            if(oConfig.thousandsSeparator) {
+                var sThousandsSeparator = oConfig.thousandsSeparator;
+                nDotIndex = sOutput.lastIndexOf(sDecimalSeparator);
+                nDotIndex = (nDotIndex > -1) ? nDotIndex : sOutput.length;
+                var sNewOutput = sOutput.substring(nDotIndex);
+                var nCount = -1;
+                for (var i=nDotIndex; i>0; i--) {
+                    nCount++;
+                    if ((nCount%3 === 0) && (i !== nDotIndex)) {
+                        sNewOutput = sThousandsSeparator + sNewOutput;
                     }
-                    oResult[key] = data;
+                    sNewOutput = sOutput.charAt(i-1) + sNewOutput;
                 }
-                oParsedResponse.results.unshift(oResult);
+                sOutput = sNewOutput;
             }
+
+            // Prepend prefix
+            sOutput = (oConfig.prefix) ? oConfig.prefix + sOutput : sOutput;
+
+            // Append suffix
+            sOutput = (oConfig.suffix) ? sOutput + oConfig.suffix : sOutput;
+
+            return sOutput;
         }
+        // Still not a Number, just return unaltered
+        else {
+            return nData;
+        }
+    }
+ };
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
-        if(bError) {
-            oParsedResponse.error = true;
+/**
+ * The static Date class provides helper functions to deal with data of type
+ * Number.
+ *
+ * @namespace YAHOO.util
+ * @requires datasource
+ * @class Date
+ * @static
+ */
+ YAHOO.util.Date = {
+     /**
+     * Takes a native JavaScript Date and formats to string for display to user.
+     *
+     * @method format
+     * @param oDate {Date} Date.
+     * @param oConfig {Object} (Optional) Optional configuration values:
+     *  <dl>
+     *   <dt>format {String}</dd>
+     *   <dd>Currently only the following formats are supported:
+     *   "MM/DD/YYYY", "YYYY/MM/DD", or "DD/MM/YYYY"</dd>
+     *  </dl>
+     * @return {String} Formatted date for display.
+     */
+    format: function(oDate, oConfig) {
+        oConfig = oConfig || {};
+        
+        if(oDate instanceof Date) {
+            var format = oConfig.format || "MM/DD/YYYY";
+            var mm = oDate.getMonth()+1;
+            var dd = oDate.getDate();
+            var yyyy = oDate.getFullYear();
+            
+            switch(format) {
+                case "YYYY/MM/DD":
+                    return yyyy + "/" + mm +"/" + dd;
+                case "DD/MM/YYYY":
+                    return dd + "/" + mm + "/" + yyyy;
+                default: // "MM/DD/YYYY"
+                    return mm + "/" + dd + "/" + yyyy;
+            }
         }
         else {
+            return YAHOO.lang.isValue(oDate) ? oDate : "";
         }
-        return oParsedResponse;
-};
+    }
+ };
 
-YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.3.0", build: "442"});
+YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.5.0", build: "895"});
index ed31cca42fdada41dff7f327fd3cd14c84648af9..e21bbda2c8756d4086d7155cc0b7f1f37802dae5 100755 (executable)
@@ -1,5 +1,101 @@
 DataTable Release Notes
 
+*** version 2.5.0 ***
+
+* Introduced YAHOO.widget.Paginator to manage pagination.
+* Introduced YAHOO.util.Chain to allow for progressive rendering.
+
+Removed APIs
+
+    * CLASS_SCROLLBODY
+    * CLASS_TABLE
+    * getTableEl()
+
+Changed APIs
+
+    * doBeforeLoadData(sRequest, oResponse, oPayload) - oResponse is now the converted full response (typed JSON or XML as appropriate). oPayload is now an optional data payload implementer can pass in to DataSource.sendRequest via the callback object literal.
+    * formatCell() - The first argument, elCell, is now a reference to the cell liner element rather than the TD itself.
+    * onDataReturnAppendRows(sRequest, oResponse, oPayload) - oResponse is now the converted full response (typed JSON or XML as appropriate). oPayload is now an optional data payload implementer can pass in to DataSource.sendRequest via the callback object literal.
+    * onDataReturnInitializeTable(sRequest, oResponse, oPayload) - oResponse is now the converted full response (typed JSON or XML as appropriate). oPayload is now an optional data payload implementer can pass in to DataSource.sendRequest via the callback object literal.
+    * onDataReturnInsertRows(sRequest, oResponse, oPayload) - oResponse is now the converted full response (typed JSON or XML as appropriate). oPayload is now an optional data payload implementer can pass in to DataSource.sendRequest via the callback object literal.
+    * paginator - Should now be an instance of YAHOO.widget.Paginator.
+    * sortedBy.dir - Use CLASS_ASC or CLASS_DESC instead of "asc" and "desc" strings.
+    * Scrolling must be enabled via the configs "scrollable", "width", and "height". CSS should no longer be used to set width or height on scrollable tables.    
+
+Deprecated APIs
+
+    * formatPaginatorDropdown() - Use new Paginator class.
+    * formatPaginatorLinks() - Use new Paginator class.
+    * formatPaginators() - Use new Paginator class.
+    * refreshView() - Use render().
+    * showPage() - Use new Paginator class.
+    * updatePaginator() - Use new Paginator class.
+    * headerCellClickEvent - Use theadCellClickEvent.
+    * headerCellDblclickEvent - Use theadCellDblclickEvent.
+    * headerCellMousedownEvent - Use theadCellMousedownEvent.
+    * headerCellMouseoutEvent - Use theadCellMouseoutEvent.
+    * headerCellMouseoverEvent - Use theadCellMouseoverEvent.
+    * headerLabelClickEvent - Use theadLabelClickEvent.
+    * headerLabelDblclickEvent - Use theadLabelDblclickEvent.
+    * headerLabelMousedownEvent - Use theadLabelMousedownEvent.
+    * headerLabelMouseoutEvent - Use theadLabelMouseoutEvent.
+    * headerLabelMouseoverEvent - Use theadLabelMouseoverEvent.
+    * headerRowClickEvent - Use theadRowClickEvent.
+    * headerRowDblclickEvent - Use theadRowDblclickEvent.
+    * headerRowMousedownEvent - Use theadRowMousedownEvent.
+    * headerRowMouseoutEvent - Use theadRowMouseoutEvent.
+    * headerRowMouseoverEvent - Use theadRowMouseoverEvent.
+    * refreshEvent - Use renderEvent.
+    * paginated - No longer used, as long as "paginator" value is an instance of Paginator class.
+
+
+RecordSet
+
+    * updateKey() - Use updateRecordValue().
+    * keyUpdateEvent - Use recordValueUpdateEvent.
+
+Column
+
+    * width - Must now be a number. Strings will be ignored.
+    * sortOptions.defaultOrder - Use sortOptions.defaultDir, and use CLASS_ASC or CLASS_DESC instead of "asc" and "desc" strings.
+
+
+
+*** version 2.4.0 ***
+
+* No changes.
+
+
+
+*** version 2.3.1 ***
+
+* For better support of resizeable Columns, the following core CSS changes have been
+made:
+
+- applied "table-layout:fixed" to TABLE elements
+- removed "overflow:hidden" from TH and TD elements
+- removed "white-space:nowrap" from TD elements
+
+As a result, implementers may notice a change in the widths of their rendered
+DataTables, which should be resolved by setting widths explicitly via CSS or
+your Column definitions.
+
+* Selection model issues have been addressed by clearing up ambiguous ID and
+index usage. Record instances are now assigned globally unique and immutable ID
+strings (no longer numbers). Record indexes are numbers that are mutable in order
+to represent Record order within a RecordSet instance. TR elements are assigned
+DOM ID strings that are *unrelated* to Record instance IDs and Record indexes. Be
+aware that DOM element IDs will get reused when sorting and paginating. Furthermore,
+Column instances are assigned globally unique and immutable ID strings
+(no longer numbers). Column indexes are numbers that are mutable and represent
+Column order within a ColumnSet instance. Please refer to the API documentation
+for details on when to use Record/Column instance IDs, DOM element IDs, and
+Record/Column index numbers.
+
+* Enabling row or cell selection no longer breaks clicks on links and form elements.
+
+
+
 *** version 2.3.0 ***
 
 * DataSource requests over XHR no longer automatically insert a "?" in the URIs
index aab6e4055d2248228709670cf28a3b81fa3ac7ba..b8c6c0a57ec907e19ae1677cbd069d78a2c17b0f 100755 (executable)
@@ -1,48 +1,77 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/*foundational css*/\r
-.yui-dt-table th, .yui-dt-table td {\r
-    overflow:hidden;\r
-}\r
-\r
-th .yui-dt-header {\r
-    position:relative;\r
-}\r
-\r
-th .yui-dt-label {\r
-    position:relative;\r
-}\r
-\r
-th .yui-dt-resizer {\r
-    position:absolute;\r
-    margin-right:-6px;\r
-    right:0;\r
-    bottom:0;\r
-    width:6px;\r
-    height:100%;\r
-    cursor:w-resize;\r
-    cursor:col-resize;\r
-}\r
-\r
-/* foundational scrolling css */\r
-.yui-dt-scrollable  {\r
-    *overflow-y:auto; /* for ie */\r
-}\r
-.yui-dt-scrollable  thead {\r
-    display:block; /* for safari and opera */\r
-}\r
-.yui-dt-scrollable thead tr {\r
-    position:relative;  /* for ie */\r
-}\r
-.yui-dt-scrollbody {\r
-    display:block; /* for safari and opera */\r
-    overflow:auto; /* for gecko */\r
-}\r
-\r
-.yui-dt-editor {\r
-    position:absolute;z-index:9000;\r
-}\r
+/* foundational CSS */
+.yui-dt {
+    border:1px solid transparent;
+}
+
+.yui-dt-noop {
+    border:none;
+}
+
+.yui-dt-liner {
+    overflow:hidden;
+}
+
+/* a11y headers */
+.yui-dt-bd thead tr, .yui-dt-bd thead th {
+    position:absolute;
+    left:-1500px;
+}
+
+/* draggable columns */
+.yui-dt-draggable {
+    cursor: move;
+}
+.yui-dt-coltarget {
+    position: absolute;
+    z-index: 999;
+}
+
+/* resizeable columns */
+.yui-dt-hd {
+    zoom:1; 
+}
+th.yui-dt-resizeable .yui-dt-liner {
+    position:relative;
+}
+.yui-dt-resizer {
+    position:absolute;
+    right:0;
+    bottom:0;
+    height:100%;
+    cursor:e-resize;
+    cursor:col-resize;
+}
+.yui-dt-resizerproxy {
+    visibility:hidden;
+    position:absolute;
+    z-index:9000;
+}
+
+/* hidden columns */
+.yui-skin-sam th.yui-dt-hidden .yui-dt-liner, 
+.yui-skin-sam td.yui-dt-hidden .yui-dt-liner {
+    margin:0;
+    padding:0;
+    overflow:hidden;
+    white-space:nowrap;
+}
+
+/* vertical and horizontal scrolling */
+.yui-dt-scrollable .yui-dt-bd {
+    overflow:auto;
+}
+.yui-dt-scrollable .yui-dt-hd {
+    overflow:hidden;
+    position:relative; /* for ie overflow bug http://rowanw.com/bugs/overflow_relative.htm */
+} 
+
+/* editing */
+.yui-dt-editor {
+    position:absolute;z-index:9000;
+}
index 4130405cf7d41da601e8d56028b05a683f71e5a9..5d45a833084420b07700cac75c1c0b3aea353c5d 100755 (executable)
@@ -1,49 +1,49 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/*foundational css*/\r
-.yui-dt-table th, .yui-dt-table td {\r
-    overflow:hidden;\r
-}\r
-\r
-th .yui-dt-header {\r
-    position:relative;\r
-}\r
-\r
-th .yui-dt-label {\r
-    position:relative;\r
-    border-right:10px;\r
-}\r
-\r
-th .yui-dt-resizer {\r
-    position:absolute;\r
-    margin-right:-6px;\r
-    right:0;\r
-    bottom:0;\r
-    width:6px;\r
-    height:100%;\r
-    cursor:w-resize;\r
-    cursor:col-resize;\r
-}\r
-\r
-/* foundational scrolling css */\r
-.yui-dt-scrollable  {\r
-    *overflow-y:auto; /* for ie */\r
-}\r
-.yui-dt-scrollable  thead {\r
-    display:block; /* for safari and opera */\r
-}\r
-.yui-dt-scrollable thead tr {\r
-    position:relative;  /* for ie */\r
-}\r
-.yui-dt-scrollbody {\r
-    display:block; /* for safari and opera */\r
-    overflow:auto; /* for gecko */\r
-}\r
-\r
-.yui-dt-editor {\r
-    position:absolute;\r
-}\r
+/*foundational css*/
+.yui-dt-table th, .yui-dt-table td {
+    overflow:hidden;
+}
+
+th .yui-dt-header {
+    position:relative;
+}
+
+th .yui-dt-label {
+    position:relative;
+    border-right:10px;
+}
+
+th .yui-dt-resizer {
+    position:absolute;
+    margin-right:-6px;
+    right:0;
+    bottom:0;
+    width:6px;
+    height:100%;
+    cursor:w-resize;
+    cursor:col-resize;
+}
+
+/* foundational scrolling css */
+.yui-dt-scrollable  {
+    *overflow-y:auto; /* for ie */
+}
+.yui-dt-scrollable  thead {
+    display:block; /* for safari and opera */
+}
+.yui-dt-scrollable thead tr {
+    position:relative;  /* for ie */
+}
+.yui-dt-scrollbody {
+    display:block; /* for safari and opera */
+    overflow:auto; /* for gecko */
+}
+
+.yui-dt-editor {
+    position:absolute;
+}
index bcdd378d6c36fe27b46c2f9cb9e9c04ef35bc752..7ee2a44d4326ffa40a0612c78552a6ef3bc741c8 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* basic skin styles */\r
-.yui-skin-sam .yui-dt-table {margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}\r
-.yui-skin-sam .yui-dt-table caption {padding-bottom:1em;text-align:left;}\r
-.yui-skin-sam .yui-dt-table th {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; /* header gradient */\r
-}\r
-.yui-skin-sam .yui-dt-table th,\r
-.yui-skin-sam .yui-dt-table th a {\r
-    font-weight:normal;text-decoration:none;color:#000; /* header text */\r
-    vertical-align:bottom;\r
-}\r
-.yui-skin-sam .yui-dt-table th,\r
-.yui-skin-sam .yui-dt-table td {\r
-    padding:4px 10px 4px 10px; /* cell padding */\r
-    border-right:1px solid #CBCBCB; /* inner column border */\r
-}\r
-.yui-skin-sam .yui-dt-table td {\r
-    white-space:nowrap;\r
-    text-align:left;\r
-}\r
-.yui-skin-sam .yui-dt-table th.yui-dt-last,\r
-.yui-skin-sam .yui-dt-table td.yui-dt-last {\r
-    border-right:1px solid #7F7F7F; /* outer border */\r
-}\r
-.yui-skin-sam .yui-dt-list td {\r
-    border-right:none; /* disable inner column border in list mode */\r
-}\r
-.yui-skin-sam .yui-dt-table thead {\r
-    border:1px solid #989898; /* outer border */\r
-}\r
-.yui-skin-sam .yui-dt-table tbody {\r
-    border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F; /* outer border */\r
-}\r
-\r
-/* messaging */\r
-.yui-skin-sam .yui-dt-loading {\r
-    background-color:#FFF;\r
-}\r
-\r
-.yui-skin-sam .yui-dt-loading {\r
-    background-color:#FFF;\r
-}\r
-\r
-/* sortable columns */\r
-.yui-skin-sam .yui-dt-sortable {\r
-    cursor:pointer;\r
-}\r
-.yui-skin-sam th.yui-dt-sortable {\r
-    padding-right:5px; /* room for arrow */\r
-}\r
-.yui-skin-sam th.yui-dt-sortable .yui-dt-label {\r
-    margin-right:15px; /* room for arrow */\r
-}\r
-.yui-skin-sam th.yui-dt-asc,\r
-.yui-skin-sam th.yui-dt-desc {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px; /* sorted header gradient */\r
-}\r
-.yui-skin-sam th.yui-dt-asc .yui-dt-header {\r
-    background:url(dt-arrow-up.png) no-repeat right; /* sorted header gradient */\r
-    /*background-image: url('../img/arrow_up.gif'); background-repeat:no-repeat; background-position:right; sorted header icon */\r
-}\r
-.yui-skin-sam th.yui-dt-desc .yui-dt-header {\r
-    background:url(dt-arrow-dn.png) no-repeat right; /* sorted header gradient */\r
-    /*background-image: url('../img/arrow_dn.gif'); background-repeat:no-repeat; background-position:right; /*sorted header icon */\r
-} \r
-\r
-/* editing */\r
-.yui-dt-editable {\r
-    cursor:pointer;\r
-}\r
-.yui-dt-editor {\r
-    text-align:left;\r
-    background-color:#F2F2F2;\r
-    border:1px solid #808080;\r
-    padding:6px;\r
-}\r
-.yui-dt-editor label {\r
-    padding-left:4px;padding-right:6px;\r
-}\r
-.yui-dt-editor .yui-dt-button {\r
-    padding-top:6px;text-align:right;\r
-}\r
-.yui-dt-editor .yui-dt-button button {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;\r
-    border:1px solid #999;\r
-    width:4em;height:1.8em;\r
-    margin-left:6px;\r
-}\r
-.yui-dt-editor .yui-dt-button button.yui-dt-default {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;\r
-    background-color: #5584E0;\r
-    border:1px solid #304369;\r
-    color:#FFF\r
-}\r
-.yui-dt-editor .yui-dt-button button:hover {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;\r
-    color:#000;\r
-}\r
-.yui-dt-editor .yui-dt-button button:active {\r
-    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;\r
-    color:#000;\r
-}\r
-\r
-/* striping */\r
-.yui-skin-sam tr.yui-dt-even { background-color:#FFF; } /* white */\r
-.yui-skin-sam tr.yui-dt-odd { background-color:#EDF5FF; } /* light blue */\r
-.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,\r
-.yui-skin-sam tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
-.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,\r
-.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc { background-color:#DBEAFF; } /* dark blue sorted */\r
-\r
-/* disable striping in list mode */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-even { background-color:#FFF; } /* white */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-odd { background-color:#FFF; } /* white */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
-\r
-/* highlighting */\r
-.yui-skin-sam tr.yui-dt-highlighted,\r
-.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,\r
-.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,\r
-.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,\r
-.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted {\r
-    cursor:pointer;\r
-    background-color:#B2D2FF; /* med blue hover */\r
-}\r
-\r
-/* enable highlighting in list mode */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted {\r
-    cursor:pointer;\r
-    background-color:#B2D2FF; /* med blue  hover */\r
-}\r
-\r
-/* selection */\r
-.yui-skin-sam tr.yui-dt-selected td,\r
-.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,\r
-.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc {\r
-    background-color:#426FD9; /* bright blue selected row */\r
-    color:#FFF;\r
-}\r
-.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,\r
-.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected {\r
-    background-color:#446CD7; /* bright blue selected cell */\r
-    color:#FFF;\r
-}\r
-\r
-/* enable selection in list mode */\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc {\r
-    background-color:#426FD9; /* bright blue selected row */\r
-    color:#FFF;\r
-}\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,\r
-.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected {\r
-    background-color:#446CD7; /* bright blue selected cell */\r
-    color:#FFF;\r
-}\r
-\r
-/* pagination */\r
-.yui-skin-sam .yui-dt-paginator {\r
-    display:block;margin:6px 0;white-space:nowrap;\r
-}\r
-.yui-skin-sam .yui-dt-paginator .yui-dt-first,\r
-.yui-skin-sam .yui-dt-paginator .yui-dt-last,\r
-.yui-skin-sam .yui-dt-paginator .yui-dt-selected {\r
-    padding:2px 6px;\r
-}\r
-.yui-skin-sam .yui-dt-paginator a.yui-dt-first,\r
-.yui-skin-sam .yui-dt-paginator a.yui-dt-last {\r
-    text-decoration:none;\r
-}\r
-.yui-skin-sam .yui-dt-paginator .yui-dt-previous,\r
-.yui-skin-sam .yui-dt-paginator .yui-dt-next {\r
-    display:none;\r
-}\r
-.yui-skin-sam a.yui-dt-page {\r
-    border:1px solid #CBCBCB;\r
-    padding:2px 6px;\r
-    text-decoration:none;\r
-}\r
+/* basic skin styles */
+.yui-skin-sam .yui-dt table {margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border-spacing:0;}
+.yui-skin-sam .yui-dt thead {border-spacing:0;} /* for safari bug */
+.yui-skin-sam .yui-dt caption {padding-bottom:1em;text-align:left;}
+
+/*outer border */
+.yui-skin-sam .yui-dt-hd table {border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}
+.yui-skin-sam .yui-dt-bd table {border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}
+
+.yui-skin-sam .yui-dt-scrollable .yui-dt-hd table {border:0px;}
+.yui-skin-sam .yui-dt-scrollable .yui-dt-bd table {border:0px;}
+.yui-skin-sam .yui-dt-scrollable .yui-dt-hd {border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}
+.yui-skin-sam .yui-dt-scrollable .yui-dt-bd {border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}
+
+.yui-skin-sam .yui-dt th {
+    background:#D8D8DA url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; /* header gradient */
+}
+.yui-skin-sam .yui-dt th,
+.yui-skin-sam .yui-dt th a {
+    font-weight:normal;text-decoration:none;color:#000; /* header text */
+    vertical-align:bottom;
+}
+.yui-skin-sam .yui-dt th {
+    margin:0;padding:0;
+    border:none;
+    border-right:1px solid #CBCBCB;/*  inner column border */
+}
+.yui-skin-sam .yui-dt-liner {
+    margin:0;padding:0;
+    padding:4px 10px 4px 10px; /* cell padding */
+}
+.yui-skin-sam .yui-dt-coltarget {
+    width: 5px;
+    background-color: red;
+}
+.yui-skin-sam .yui-dt td {
+    margin:0;padding:0;
+    border:none;
+    border-right:1px solid #CBCBCB; /* inner column border */
+    text-align:left;
+}
+.yui-skin-sam .yui-dt-list td {
+    border-right:none; /* disable inner column border in list mode */
+}
+.yui-skin-sam .yui-dt-resizer {
+    width:6px;
+}
+
+/* messaging */
+.yui-skin-sam .yui-dt-loading {
+    background-color:#FFF;
+}
+.yui-skin-sam .yui-dt-empty {
+    background-color:#FFF;
+}
+.yui-skin-sam .yui-dt-error {
+    background-color:#FFF;
+}
+
+/* sortable columns */
+.yui-skin-sam thead .yui-dt-sortable {
+    cursor:pointer;
+}
+.yui-skin-sam th.yui-dt-asc,
+.yui-skin-sam th.yui-dt-desc {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px; /* sorted header gradient */
+}
+.yui-skin-sam th.yui-dt-sortable .yui-dt-label {
+    margin-right:10px;
+}
+.yui-skin-sam th.yui-dt-asc .yui-dt-liner {
+    background:url(dt-arrow-up.png) no-repeat right; /* sorted header gradient */
+}
+.yui-skin-sam th.yui-dt-desc .yui-dt-liner {
+    background:url(dt-arrow-dn.png) no-repeat right; /* sorted header gradient */
+}
+
+/* editing */
+.yui-dt-editable {
+    cursor:pointer;
+}
+.yui-dt-editor {
+    text-align:left;
+    background-color:#F2F2F2;
+    border:1px solid #808080;
+    padding:6px;
+}
+.yui-dt-editor label {
+    padding-left:4px;padding-right:6px;
+}
+.yui-dt-editor .yui-dt-button {
+    padding-top:6px;text-align:right;
+}
+.yui-dt-editor .yui-dt-button button {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+    border:1px solid #999;
+    width:4em;height:1.8em;
+    margin-left:6px;
+}
+.yui-dt-editor .yui-dt-button button.yui-dt-default {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;
+    background-color: #5584E0;
+    border:1px solid #304369;
+    color:#FFF
+}
+.yui-dt-editor .yui-dt-button button:hover {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;
+    color:#000;
+}
+.yui-dt-editor .yui-dt-button button:active {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;
+    color:#000;
+}
+
+/* striping */
+.yui-skin-sam tr.yui-dt-even { background-color:#FFF; } /* white */
+.yui-skin-sam tr.yui-dt-odd { background-color:#EDF5FF; } /* light blue */
+.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,
+.yui-skin-sam tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc { background-color:#DBEAFF; } /* dark blue sorted */
+
+/* disable striping in list mode */
+.yui-skin-sam .yui-dt-list tr.yui-dt-even { background-color:#FFF; } /* white */
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd { background-color:#FFF; } /* white */
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */
+
+/* highlighting */
+.yui-skin-sam th.yui-dt-highlighted,
+.yui-skin-sam th.yui-dt-highlighted a {
+    background-color:#B2D2FF; /* med blue hover */
+}
+.yui-skin-sam tr.yui-dt-highlighted,
+.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,
+.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,
+.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted {
+    cursor:pointer;
+    background-color:#B2D2FF; /* med blue hover */
+}
+
+/* enable highlighting in list mode */
+.yui-skin-sam .yui-dt-list th.yui-dt-highlighted,
+.yui-skin-sam .yui-dt-list th.yui-dt-highlighted a {
+    background-color:#B2D2FF; /* med blue hover */
+}
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted {
+    cursor:pointer;
+    background-color:#B2D2FF; /* med blue  hover */
+}
+
+/* selection */
+.yui-skin-sam th.yui-dt-selected,
+.yui-skin-sam th.yui-dt-selected a {
+    background-color:#446CD7; /* bright blue selected cell */
+}
+.yui-skin-sam tr.yui-dt-selected td,
+.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,
+.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc {
+    background-color:#426FD9; /* bright blue selected row */
+    color:#FFF;
+}
+.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected {
+    background-color:#446CD7; /* bright blue selected cell */
+    color:#FFF;
+}
+
+/* enable selection in list mode */
+.yui-skin-sam .yui-dt-list th.yui-dt-selected,
+.yui-skin-sam .yui-dt-list th.yui-dt-selected a {
+    background-color:#446CD7; /* bright blue selected cell */
+}
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc {
+    background-color:#426FD9; /* bright blue selected row */
+    color:#FFF;
+}
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected {
+    background-color:#446CD7; /* bright blue selected cell */
+    color:#FFF;
+}
+
+/* pagination */
+.yui-skin-sam .yui-pg-container,
+.yui-skin-sam .yui-dt-paginator {
+    display:block;margin:6px 0;white-space:nowrap;
+}
+.yui-skin-sam .yui-pg-first,
+.yui-skin-sam .yui-pg-last,
+.yui-skin-sam .yui-pg-current-page,
+.yui-skin-sam .yui-dt-first,
+.yui-skin-sam .yui-dt-paginator .yui-dt-last,
+.yui-skin-sam .yui-dt-paginator .yui-dt-selected {
+    padding:2px 6px;
+}
+.yui-skin-sam a.yui-pg-first,
+.yui-skin-sam a.yui-pg-previous,
+.yui-skin-sam a.yui-pg-next,
+.yui-skin-sam a.yui-pg-last,
+.yui-skin-sam a.yui-pg-page,
+.yui-skin-sam .yui-dt-paginator a.yui-dt-first,
+.yui-skin-sam .yui-dt-paginator a.yui-dt-last {
+    text-decoration:none;
+}
+.yui-skin-sam .yui-dt-paginator .yui-dt-previous,
+.yui-skin-sam .yui-dt-paginator .yui-dt-next {
+    display:none;
+}
+.yui-skin-sam a.yui-pg-page,
+.yui-skin-sam a.yui-dt-page {
+    border:1px solid #CBCBCB;
+    padding:2px 6px;
+    text-decoration:none;
+    background-color:#fff
+}
+.yui-skin-sam .yui-pg-current-page,
+.yui-skin-sam .yui-dt-selected {
+    border:1px solid #fff;
+    background-color:#fff;
+}
+.yui-skin-sam .yui-pg-pages {
+    margin-left:1ex;
+    margin-right:1ex;
+}
+.yui-skin-sam .yui-pg-page {
+    margin-right:1px;
+    margin-left:1px;
+}
+.yui-skin-sam .yui-pg-first,
+.yui-skin-sam .yui-pg-previous {
+    margin-right:3px;
+}
+.yui-skin-sam .yui-pg-next,
+.yui-skin-sam .yui-pg-last {
+    margin-left:3px;
+}
+.yui-skin-sam .yui-pg-current,
+.yui-skin-sam .yui-pg-rpp-options {
+    margin-right:1em;
+    margin-left:1em;
+}
index b3f56e5ad131118bf7bb98f90d54085dcf590642..f863b061f359aef03ceab610b32fad21724dc6f5 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
+.yui-dt{border:1px solid transparent;}.yui-dt-noop{border:none;}.yui-dt-liner{overflow:hidden;}.yui-dt-bd thead tr,.yui-dt-bd thead th{position:absolute;left:-1500px;}.yui-dt-draggable{cursor:move;}.yui-dt-coltarget{position:absolute;z-index:999;}.yui-dt-hd{zoom:1;}th.yui-dt-resizeable .yui-dt-liner{position:relative;}.yui-dt-resizer{position:absolute;right:0;bottom:0;height:100%;cursor:e-resize;cursor:col-resize;}.yui-dt-resizerproxy{visibility:hidden;position:absolute;z-index:9000;}.yui-skin-sam th.yui-dt-hidden .yui-dt-liner,.yui-skin-sam td.yui-dt-hidden .yui-dt-liner{margin:0;padding:0;overflow:hidden;white-space:nowrap;}.yui-dt-scrollable .yui-dt-bd{overflow:auto;}.yui-dt-scrollable .yui-dt-hd{overflow:hidden;position:relative;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border-spacing:0;}.yui-skin-sam .yui-dt thead{border-spacing:0;}.yui-skin-sam .yui-dt caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-hd table{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-bd table{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd table{border:0px;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt th{background:#D8D8DA url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt th,.yui-skin-sam .yui-dt th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt th{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-liner{margin:0;padding:0;padding:4px 10px 4px 10px;}.yui-skin-sam .yui-dt-coltarget{width:5px;background-color:red;}.yui-skin-sam .yui-dt td{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;text-align:left;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-resizer{width:6px;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-empty{background-color:#FFF;}.yui-skin-sam .yui-dt-error{background-color:#FFF;}.yui-skin-sam thead .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:10px;}.yui-skin-sam th.yui-dt-asc .yui-dt-liner{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-liner{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam th.yui-dt-highlighted,.yui-skin-sam th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list th.yui-dt-highlighted,.yui-skin-sam .yui-dt-list th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam th.yui-dt-selected,.yui-skin-sam th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list th.yui-dt-selected,.yui-skin-sam .yui-dt-list th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-pg-container,.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-last,.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam a.yui-pg-first,.yui-skin-sam a.yui-pg-previous,.yui-skin-sam a.yui-pg-next,.yui-skin-sam a.yui-pg-last,.yui-skin-sam a.yui-pg-page,.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-pg-page,.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;background-color:#fff}.yui-skin-sam .yui-pg-current-page,.yui-skin-sam .yui-dt-selected{border:1px solid #fff;background-color:#fff;}.yui-skin-sam .yui-pg-pages{margin-left:1ex;margin-right:1ex;}.yui-skin-sam .yui-pg-page{margin-right:1px;margin-left:1px;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous{margin-right:3px;}.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last{margin-left:3px;}.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-rpp-options{margin-right:1em;margin-left:1em;}
index 2178f11e327167c25acfb35264b03dd87b9486b4..85fda0bbca21cefc6b8cf1726bc83e43bff993c4 100755 (executable)
Binary files a/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png and b/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png differ
index 5a543a573e9a94a27d32d646bd6a62a4d35139f8..1c674316aed41943dae79b01583956db63c8be08 100755 (executable)
Binary files a/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png and b/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png differ
index ba6106a65d9483f86582a925311ffd8730690059..1bca3352f7cfc8b95ba37168fa556ef8523dcf0f 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
- * The DataTable widget provides a progressively enhanced DHTML control for
- * displaying tabular data across A-grade browsers.
+ * Mechanism to execute a series of callbacks in a non-blocking queue.  Each callback is executed via setTimout unless configured with a negative timeout, in which case it is run in blocking mode in the same execution thread as the previous callback.  Callbacks can be function references or object literals with the following keys:
+ * <ul>
+ *    <li><code>method</code> - {Function} REQUIRED the callback function.</li>
+ *    <li><code>scope</code> - {Object} the scope from which to execute the callback.  Default is the global window scope.</li>
+ *    <li><code>argument</code> - {Array} parameters to be passed to method as individual arguments.</li>
+ *    <li><code>timeout</code> - {number} millisecond delay to wait after previous callback completion before executing this callback.  Negative values cause immediate blocking execution.  Default 0.</li>
+ *    <li><code>until</code> - {Function} boolean function executed before each iteration.  Return true to indicate completion and proceed to the next callback.</li>
+ *    <li><code>iterations</code> - {Number} number of times to execute the callback before proceeding to the next callback in the chain. Incompatible with <code>until</code>.</li>
+ * </ul>
  *
- * @module datatable
- * @requires yahoo, dom, event, datasource
- * @optional dragdrop
- * @title DataTable Widget
- * @beta
- */
+ * @namespace YAHOO.util
+ * @class Chain
+ * @constructor
+ * @param callback* {Function|Object} Any number of callbacks to initialize the queue
+*/
+YAHOO.util.Chain = function () {
+    /**
+     * The callback queue
+     * @property q
+     * @type {Array}
+     * @private
+     */
+    this.q = [].slice.call(arguments);
+};
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+YAHOO.util.Chain.prototype = {
+    /**
+     * Timeout id used to pause or stop execution and indicate the execution state of the Chain.  0 indicates paused or stopped, -1 indicates blocking execution, and any positive number indicates non-blocking execution.
+     * @property id
+     * @type {number}
+     * @private
+     */
+    id   : 0,
 
-/**
- * DataTable class for the YUI DataTable widget.
- *
- * @namespace YAHOO.widget
- * @class DataTable
- * @uses YAHOO.util.EventProvider
- * @constructor
- * @param elContainer {HTMLElement} Container element for the TABLE.
- * @param aColumnDefs {Object[]} Array of object literal Column definitions.
- * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
- * @param oConfigs {object} (optional) Object literal of configuration values.
- */
-YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
-    // Internal vars
-    this._nIndex = YAHOO.widget.DataTable._nCount;
-    this._sName = "instance" + this._nIndex;
-    this.id = "yui-dt"+this._nIndex;
+    /**
+     * Begin executing the chain, or resume execution from the last paused position.
+     * @method run
+     * @return {Chain} the Chain instance
+     */
+    run : function () {
+        // Grab the first callback in the queue
+        var c  = this.q[0],
+            fn;
 
-    // Initialize container element
-    this._initContainerEl(elContainer);
-    if(!this._elContainer) {
-        YAHOO.log("Could not instantiate DataTable due to an invalid container element", "error", this.toString());
-        return;
-    }
+        // If there is no callback in the queue or the Chain is currently
+        // in an execution mode, return
+        if (!c || this.id) {
+            return this;
+        }
 
-    // Initialize configs
-    this._initConfigs(oConfigs);
+        fn = c.method || c;
 
-    // Initialize ColumnSet
-    this._initColumnSet(aColumnDefs);
-    if(!this._oColumnSet) {
-        YAHOO.log("Could not instantiate DataTable due to an invalid ColumnSet", "error", this.toString());
-        return;
-    }
-    
-    // Initialize RecordSet
-    this._initRecordSet();
-    if(!this._oRecordSet) {
-        YAHOO.log("Could not instantiate DataTable due to an invalid RecordSet", "error", this.toString());
-        return;
-    }
+        if (typeof fn === 'function') {
+            var o    = c.scope || {},
+                args = c.argument || [],
+                ms   = c.timeout || 0,
+                me   = this;
+                
+            if (!(args instanceof Array)) {
+                args = [args];
+            }
 
-    // Initialize DataSource
-    this._initDataSource(oDataSource);
-    if(!this._oDataSource) {
-        YAHOO.log("Could not instantiate DataTable due to an invalid DataSource", "error", this.toString());
-        return;
-    }
+            // Execute immediately if the callback timeout is negative.
+            if (ms < 0) {
+                this.id = ms;
+                if (c.until) {
+                    for (;!c.until();) {
+                        // Execute the callback from scope, with argument
+                        fn.apply(o,args);
+                    }
+                } else if (c.iterations) {
+                    for (;c.iterations-- > 0;) {
+                        fn.apply(o,args);
+                    }
+                } else {
+                    fn.apply(o,args);
+                }
+                this.q.shift();
+                this.id = 0;
+                return this.run();
+            } else {
+                // If the until condition is set, check if we're done
+                if (c.until) {
+                    if (c.until()) {
+                        // Shift this callback from the queue and execute the next
+                        // callback
+                        this.q.shift();
+                        return this.run();
+                    }
+                // Otherwise if either iterations is not set or we're
+                // executing the last iteration, shift callback from the queue
+                } else if (!c.iterations || !--c.iterations) {
+                    this.q.shift();
+                }
 
-    // Progressive enhancement special case
-    if(this._oDataSource.dataType == YAHOO.util.DataSource.TYPE_HTMLTABLE) {
-        this._oDataSource.sendRequest(this.get("initialRequest"), this._onDataReturnEnhanceTable, this);
-    }
-    else {
-        // Initialize DOM elements
-        this._initTableEl();
-        if(!this._elTable || !this._elThead || !this._elTbody) {
-            YAHOO.log("Could not instantiate DataTable due to an invalid DOM elements", "error", this.toString());
-            return;
+                // Otherwise set to execute after the configured timeout
+                this.id = setTimeout(function () {
+                    // Execute the callback from scope, with argument
+                    fn.apply(o,args);
+                    // Check if the Chain was not paused from inside the callback
+                    if (me.id) {
+                        // Indicate ready to run state
+                        me.id = 0;
+                        // Start the fun all over again
+                        me.run();
+                    }
+                },ms);
+            }
         }
 
-        // Call Element's constructor after DOM elements are created
-        // but *before* table is populated with data
-        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
-        
-        //HACK: Set the Paginator values here via updatePaginator
-        if(this._oConfigs && this._oConfigs.paginator) {
-            this.updatePaginator(this._oConfigs.paginator);
-        }
+        return this;
+    },
+    
+    /**
+     * Add a callback to the end of the queue
+     * @method add
+     * @param c {Function|Object} the callback function ref or object literal
+     * @return {Chain} the Chain instance
+     */
+    add  : function (c) {
+        this.q.push(c);
+        return this;
+    },
+
+    /**
+     * Pause the execution of the Chain after the current execution of the
+     * current callback completes.  If called interstitially, clears the
+     * timeout for the pending callback. Paused Chains can be restarted with
+     * chain.run()
+     * @method pause
+     * @return {Chain} the Chain instance
+     */
+    pause: function () {
+        clearTimeout(this.id);
+        this.id = 0;
+        return this;
+    },
 
-        // Send out for data in an asynchronous request
-        this._oDataSource.sendRequest(this.get("initialRequest"), this.onDataReturnInitializeTable, this);
+    /**
+     * Stop and clear the Chain's queue after the current execution of the
+     * current callback completes.
+     * @method stop
+     * @return {Chain} the Chain instance
+     */
+    stop : function () { 
+        this.pause();
+        this.q = [];
+        return this;
     }
+};
 
-    // Initialize inline Cell editing
-    this._initCellEditorEl();
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
-    // Initialize Column sort
-    this._initColumnSort();
+/**
+ * The ColumnSet class defines and manages a DataTable's Columns,
+ * including nested hierarchies and access to individual Column instances.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSet
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param aDefinitions {Object[]} Array of object literals that define cells in
+ * the THEAD.
+ */
+YAHOO.widget.ColumnSet = function(aDefinitions) {
+    this._sId = "yui-cs" + YAHOO.widget.ColumnSet._nCount;
 
-    // Initialize DOM event listeners
-    this._initDomEvents();
+    // First clone the defs
+    aDefinitions = YAHOO.widget.DataTable._cloneObject(aDefinitions);
+    this._init(aDefinitions);
 
-    YAHOO.widget.DataTable._nCount++;
-    YAHOO.log("DataTable initialized", "info", this.toString());
+    YAHOO.widget.ColumnSet._nCount++;
+    YAHOO.log("ColumnSet initialized", "info", this.toString());
 };
 
-if(YAHOO.util.Element) {
-    YAHOO.lang.extend(YAHOO.widget.DataTable, YAHOO.util.Element);
-}
-else {
-    YAHOO.log("Missing dependency: YAHOO.util.Element","error",this.toString());
-}
-
 /////////////////////////////////////////////////////////////////////////////
 //
-// Superclass methods
+// Private member variables
 //
 /////////////////////////////////////////////////////////////////////////////
 
 /**
- * Implementation of Element's abstract method. Sets up config values.
+ * Internal class variable to index multiple ColumnSet instances.
  *
- * @method initAttributes
- * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @property ColumnSet._nCount
+ * @type Number
  * @private
+ * @static
  */
+YAHOO.widget.ColumnSet._nCount = 0;
 
-YAHOO.widget.DataTable.prototype.initAttributes = function(oConfigs) {
-    oConfigs = oConfigs || {};
-    YAHOO.widget.DataTable.superclass.initAttributes.call(this, oConfigs);
-
+YAHOO.widget.ColumnSet.prototype = {
     /**
-    * @config summary
-    * @description Value for the SUMMARY attribute.
-    * @type String
-    */
-    this.setAttributeConfig("summary", {
-        value: null,
-        validator: YAHOO.lang.isString,
-        method: function(sSummary) {
-            this._elTable.summary = sSummary;
-        }
-    });
+     * Unique instance name.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
     /**
-    * @config selectionMode
-    * @description Specifies row or cell selection mode. Accepts the following strings:
-    *    <dl>
-    *      <dt>"standard"</dt>
-    *      <dd>Standard row selection with support for modifier keys to enable
-    *      multiple selections.</dd>
-    *
-    *      <dt>"single"</dt>
-    *      <dd>Row selection with modifier keys disabled to not allow
-    *      multiple selections.</dd>
-    *
-    *      <dt>"singlecell"</dt>
-    *      <dd>Cell selection with modifier keys disabled to not allow
-    *      multiple selections.</dd>
-    *
-    *      <dt>"cellblock"</dt>
-    *      <dd>Cell selection with support for modifier keys to enable multiple
-    *      selections in a block-fashion, like a spreadsheet.</dd>
-    *
-    *      <dt>"cellrange"</dt>
-    *      <dd>Cell selection with support for modifier keys to enable multiple
-    *      selections in a range-fashion, like a calendar.</dd>
-    *    </dl>
-    *
-    * @default "standard"
-    * @type String
-    */
-    this.setAttributeConfig("selectionMode", {
-        value: "standard",
-        validator: YAHOO.lang.isString
-    });
+     * Array of object literal Column definitions passed to the constructor.
+     *
+     * @property _aDefinitions
+     * @type Object[]
+     * @private
+     */
+    _aDefinitions : null,
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
     /**
-    * @config initialRequest
-    * @description Defines the initial request that gets sent to the DataSource.
-    * @type String
-    */
-    this.setAttributeConfig("initialRequest", {
-        value: "",
-        validator: YAHOO.lang.isString
-    });
+     * Top-down tree representation of Column hierarchy.
+     *
+     * @property tree
+     * @type YAHOO.widget.Column[]
+     */
+    tree : null,
 
     /**
-    * @config sortedBy
-    * @description Object literal provides metadata for initial sort values if
-    * data will arrive pre-sorted:
-    * <dl>
-    *     <dt>sortedBy.key</dt>
-    *     <dd>Key of sorted Column</dd>
-    *     <dt>sortedBy.dir</dt>
-    *     <dd>Initial sort direction, either "asc" or "desc"</dd>
-    * </dl>
-    * @type Object
-    */
-    this.setAttributeConfig("sortedBy", {
-        value: null,
-        // TODO: accepted array for nested sorts
-        validator: function(oNewSortedBy) {
-            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
-        },
-        method: function(oNewSortedBy) {
-            // Remove ASC/DESC from TH
-            var oOldSortedBy = this.get("sortedBy");
-            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
-                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
-                var oldThEl = this.getThEl(oldColumn);
-                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_ASC);
-                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_DESC);
-            }
-            
-            // Set ASC/DESC on TH
-            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
-            if(column) {
-                var newClass = (oNewSortedBy.dir && (oNewSortedBy.dir != "asc")) ?
-                        YAHOO.widget.DataTable.CLASS_DESC :
-                        YAHOO.widget.DataTable.CLASS_ASC;
-                YAHOO.util.Dom.addClass(this.id + "-col" + column.getId(), newClass);
-            }
-        }
-    });
+     * Flattened representation of all Columns.
+     *
+     * @property flat
+     * @type YAHOO.widget.Column[]
+     * @default []
+     */
+    flat : null,
 
     /**
-    * @config paginator
-    * @description Object literal of pagination values.
-    * @default <br>
-    *   { containers:[], // UI container elements <br>
-    *   rowsPerPage:500, // 500 rows <br>
-    *   currentPage:1,  // page one <br>
-    *   pageLinks:0,    // show all links <br>
-    *   pageLinksStart:1, // first link is page 1 <br>
-    *   dropdownOptions:null, // no dropdown <br>
-    *   links: [], // links elements <br>
-    *   dropdowns: [] } //dropdown elements
-    * 
-    * @type Object
-    */
-    this.setAttributeConfig("paginator", {
-        value: {
-            rowsPerPage:500, // 500 rows per page
-            currentPage:1,  // show page one
-            startRecordIndex:0, // start with first Record
-            totalRecords:0, // how many Records total
-            totalPages:0, // how many pages total
-            rowsThisPage:0, // how many rows this page
-            pageLinks:0,    // show all links
-            pageLinksStart:1, // first link is page 1
-            dropdownOptions: null, //no dropdown
-            containers:[], // Paginator container element references
-            dropdowns: [], //dropdown element references,
-            links: [] // links elements
-        },
-        validator: function(oNewPaginator) {
-            if(oNewPaginator && (oNewPaginator.constructor == Object)) {
-                // Check for incomplete set of values
-                if((oNewPaginator.rowsPerPage !== undefined) &&
-                        (oNewPaginator.currentPage !== undefined) &&
-                        (oNewPaginator.startRecordIndex !== undefined) &&
-                        (oNewPaginator.totalRecords !== undefined) &&
-                        (oNewPaginator.totalPages !== undefined) &&
-                        (oNewPaginator.rowsThisPage !== undefined) &&
-                        (oNewPaginator.pageLinks !== undefined) &&
-                        (oNewPaginator.pageLinksStart !== undefined) &&
-                        (oNewPaginator.dropdownOptions !== undefined) &&
-                        (oNewPaginator.containers !== undefined) &&
-                        (oNewPaginator.dropdowns !== undefined) &&
-                        (oNewPaginator.links !== undefined)) {
-
-                    // Validate each value
-                    if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.currentPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.startRecordIndex) &&
-                            YAHOO.lang.isNumber(oNewPaginator.totalRecords) &&
-                            YAHOO.lang.isNumber(oNewPaginator.totalPages) &&
-                            YAHOO.lang.isNumber(oNewPaginator.rowsThisPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.pageLinks) &&
-                            YAHOO.lang.isNumber(oNewPaginator.pageLinksStart) &&
-                            YAHOO.lang.isArray(oNewPaginator.dropdownOptions) &&
-                            YAHOO.lang.isArray(oNewPaginator.containers) &&
-                            YAHOO.lang.isArray(oNewPaginator.dropdowns) &&
-                            YAHOO.lang.isArray(oNewPaginator.links)) {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-    });
+     * Array of Columns that map one-to-one to a table column.
+     *
+     * @property keys
+     * @type YAHOO.widget.Column[]
+     * @default []
+     */
+    keys : null,
 
     /**
-    * @config paginated
-    * @description True if built-in client-side pagination is enabled
-    * @default false
-    * @type Boolean
-    */
-    this.setAttributeConfig("paginated", {
-        value: false,
-        validator: YAHOO.lang.isBoolean,
-        method: function(oParam) {
-            var oPaginator = this.get("paginator");
-            var aContainerEls = oPaginator.containers;
-            
-            // Paginator is enabled
-            if(oParam) {
-                // No containers found, create two from scratch
-                if(aContainerEls.length === 0) {
-                    // One before TABLE
-                    var pag0 = document.createElement("span");
-                    pag0.id = this.id + "-paginator0";
-                    YAHOO.util.Dom.addClass(pag0, YAHOO.widget.DataTable.CLASS_PAGINATOR);
-                    pag0 = this._elContainer.insertBefore(pag0, this._elTable);
-                    aContainerEls.push(pag0);
-
-                    // One after TABLE
-                    var pag1 = document.createElement("span");
-                    pag1.id = this.id + "-paginator1";
-                    YAHOO.util.Dom.addClass(pag1, YAHOO.widget.DataTable.CLASS_PAGINATOR);
-                    pag1 = this._elContainer.insertBefore(pag1, this._elTable.nextSibling);
-                    aContainerEls.push(pag1);
-
-                    // Add containers directly to tracker
-                    this._configs.paginator.value.containers = [pag0, pag1];
+     * ID index of nested parent hierarchies for HEADERS accessibility attribute.
+     *
+     * @property headers
+     * @type String[]
+     * @default []
+     */
+    headers : null,
 
-                }
-                else {
-                    // Show each container
-                    for(var i=0; i<aContainerEls.length; i++) {
-                        aContainerEls[i].style.display = "";
-                    }
-                }
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-                // Links are enabled
-                if(oPaginator.pageLinks > -1) {
-                    var aLinkEls = oPaginator.links;
-                    // No links containers found, create from scratch
-                    if(aLinkEls.length === 0) {
-                        for(i=0; i<aContainerEls.length; i++) {
-                            // Create one links container per Paginator container
-                            var linkEl = document.createElement("span");
-                            linkEl.id = "yui-dt-pagselect"+i;
-                            linkEl = aContainerEls[i].appendChild(linkEl);
+    /**
+     * Initializes ColumnSet instance with data from Column definitions.
+     *
+     * @method _init
+     * @param aDefinitions {Object[]} Array of object literals that define cells in
+     * the THEAD .
+     * @private
+     */
 
-                            // Add event listener
-                            //TODO: anon fnc
-                            YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+    _init : function(aDefinitions) {        
+        // DOM tree representation of all Columns
+        var tree = [];
+        // Flat representation of all Columns
+        var flat = [];
+        // Flat representation of only Columns that are meant to display data
+        var keys = [];
+        // Array of HEADERS attribute values for all keys in the "keys" array
+        var headers = [];
+
+        // Tracks current node list depth being tracked
+        var nodeDepth = -1;
+
+        // Internal recursive function to define Column instances
+        var parseColumns = function(nodeList, parent) {
+            // One level down
+            nodeDepth++;
+
+            // Create corresponding tree node if not already there for this depth
+            if(!tree[nodeDepth]) {
+                tree[nodeDepth] = [];
+            }
 
-                             // Add directly to tracker
-                            this._configs.paginator.value.links.push(linkEl);
-                       }
-                   }
-                }
 
-                // Show these options in the dropdown
-                var dropdownOptions = oPaginator.dropdownOptions || [];
+            // Parse each node at this depth for attributes and any children
+            for(var j=0; j<nodeList.length; j++) {
+                var currentNode = nodeList[j];
 
-                for(i=0; i<aContainerEls.length; i++) {
-                    // Create one SELECT element per Paginator container
-                    var selectEl = document.createElement("select");
-                    YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
-                    selectEl = aContainerEls[i].appendChild(selectEl);
-                    selectEl.id = "yui-dt-pagselect"+i;
+                // Instantiate a new Column for each node
+                var oColumn = new YAHOO.widget.Column(currentNode);
+                
+                // Assign unique ID to Column and cross-reference it back to the
+                // original object literal definition
+                currentNode.yuiColumnId = oColumn._sId = YAHOO.widget.Column._nCount + "";
+                
+                // Assign a key if not found
+                if(!YAHOO.lang.isValue(oColumn.key)) {
+                    oColumn.key = "yui-dt-col" + YAHOO.widget.Column._nCount;
+                }
+                // Increment counter
+                YAHOO.widget.Column._nCount++;
+
+                // Add the new Column to the flat list
+                flat.push(oColumn);
 
-                    // Add event listener
-                    //TODO: anon fnc
-                    YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+                // Assign its parent as an attribute, if applicable
+                if(parent) {
+                    oColumn.parent = parent;
+                }
 
-                    // Add DOM reference directly to tracker
-                   this._configs.paginator.value.dropdowns.push(selectEl);
+                // The Column has descendants
+                if(YAHOO.lang.isArray(currentNode.children)) {
+                    oColumn.children = currentNode.children;
+
+                    // Determine COLSPAN value for this Column
+                    var terminalChildNodes = 0;
+                    var countTerminalChildNodes = function(ancestor) {
+                        var descendants = ancestor.children;
+                        // Drill down each branch and count terminal nodes
+                        for(var k=0; k<descendants.length; k++) {
+                            // Keep drilling down
+                            if(YAHOO.lang.isArray(descendants[k].children)) {
+                                countTerminalChildNodes(descendants[k]);
+                            }
+                            // Reached branch terminus
+                            else {
+                                terminalChildNodes++;
+                            }
+                        }
+                    };
+                    countTerminalChildNodes(currentNode);
+                    oColumn._nColspan = terminalChildNodes;
+
+                    // Cascade certain properties to children if not defined on their own
+                    var currentChildren = currentNode.children;
+                    for(var k=0; k<currentChildren.length; k++) {
+                        var child = currentChildren[k];
+                        if(oColumn.className && (child.className === undefined)) {
+                            child.className = oColumn.className;
+                        }
+                        if(oColumn.editor && (child.editor === undefined)) {
+                            child.editor = oColumn.editor;
+                        }
+                        if(oColumn.editorOptions && (child.editorOptions === undefined)) {
+                            child.editorOptions = oColumn.editorOptions;
+                        }
+                        if(oColumn.formatter && (child.formatter === undefined)) {
+                            child.formatter = oColumn.formatter;
+                        }
+                        if(oColumn.resizeable && (child.resizeable === undefined)) {
+                            child.resizeable = oColumn.resizeable;
+                        }
+                        if(oColumn.sortable && (child.sortable === undefined)) {
+                            child.sortable = oColumn.sortable;
+                        }
+                        if(oColumn.width && (child.width === undefined)) {
+                            child.width = oColumn.width;
+                        }
+                        // Backward compatibility
+                        if(oColumn.type && (child.type === undefined)) {
+                            child.type = oColumn.type;
+                        }
+                        if(oColumn.type && !oColumn.formatter) {
+                            YAHOO.log("The property type has been" +
+                            " deprecated in favor of formatter", "warn", oColumn.toString());
+                            oColumn.formatter = oColumn.type;
+                        }
+                        if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
+                            YAHOO.log("The property text has been" +
+                            " deprecated in favor of label", "warn", oColumn.toString());
+                            oColumn.label = oColumn.text;
+                        }
+                        if(oColumn.parser) {
+                            YAHOO.log("The property parser is no longer supported",
+                            "warn", this.toString());
+                        }
+                        if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
+                                (oColumn.sortOptions.descFunction))) {
+                            YAHOO.log("The properties sortOptions.ascFunction and " +
+                            " sortOptions.descFunction have been deprecated in favor " +
+                            " of sortOptions.sortFunction", "warn", oColumn.toString());
+                        }
+                    }
 
-                    // Hide dropdown
-                    if(!oPaginator.dropdownOptions) {
-                        selectEl.style.display = "none";
+                    // The children themselves must also be parsed for Column instances
+                    if(!tree[nodeDepth+1]) {
+                        tree[nodeDepth+1] = [];
                     }
+                    parseColumns(currentChildren, oColumn);
+                }
+                // This Column does not have any children
+                else {
+                    oColumn._nKeyIndex = keys.length;
+                    oColumn._nColspan = 1;
+                    keys.push(oColumn);
                 }
 
-                //TODO: fire paginatorDisabledEvent & add to api doc
-                YAHOO.log("Paginator enabled", "info", this.toString());
+                // Add the Column to the top-down tree
+                tree[nodeDepth].push(oColumn);
             }
-            // Pagination is disabled
-            else {
-                // Containers found
-                if(aContainerEls.length > 0) {
-                    // Destroy or just hide?
-                    
-                    // Hide each container
-                    for(i=0; i<aContainerEls.length; i++) {
-                        aContainerEls[i].style.display = "none";
+            nodeDepth--;
+        };
+
+        // Parse out Column instances from the array of object literals
+        if(YAHOO.lang.isArray(aDefinitions)) {
+            parseColumns(aDefinitions);
+
+            // Store the array
+            this._aDefinitions = aDefinitions;
+        }
+        else {
+            YAHOO.log("Could not initialize ColumnSet due to invalid definitions","error");
+            return null;
+        }
+
+        var i;
+
+        // Determine ROWSPAN value for each Column in the tree
+        var parseTreeForRowspan = function(tree) {
+            var maxRowDepth = 1;
+            var currentRow;
+            var currentColumn;
+
+            // Calculate the max depth of descendants for this row
+            var countMaxRowDepth = function(row, tmpRowDepth) {
+                tmpRowDepth = tmpRowDepth || 1;
+
+                for(var n=0; n<row.length; n++) {
+                    var col = row[n];
+                    // Column has children, so keep counting
+                    if(YAHOO.lang.isArray(col.children)) {
+                        tmpRowDepth++;
+                        countMaxRowDepth(col.children, tmpRowDepth);
+                        tmpRowDepth--;
+                    }
+                    // No children, is it the max depth?
+                    else {
+                        if(tmpRowDepth > maxRowDepth) {
+                            maxRowDepth = tmpRowDepth;
+                        }
                     }
 
-                    /*TODO?
-                    // Destroy each container
-                    for(i=0; i<aContainerEls.length; i++) {
-                        YAHOO.util.Event.purgeElement(aContainerEls[i], true);
-                        aContainerEls.innerHTML = null;
-                        //TODO: remove container?
-                        // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
+                }
+            };
+
+            // Count max row depth for each row
+            for(var m=0; m<tree.length; m++) {
+                currentRow = tree[m];
+                countMaxRowDepth(currentRow);
+
+                // Assign the right ROWSPAN values to each Column in the row
+                for(var p=0; p<currentRow.length; p++) {
+                    currentColumn = currentRow[p];
+                    if(!YAHOO.lang.isArray(currentColumn.children)) {
+                        currentColumn._nRowspan = maxRowDepth;
+                    }
+                    else {
+                        currentColumn._nRowspan = 1;
                     }
-                    */
                 }
-                //TODO: fire paginatorDisabledEvent & add to api doc
-                YAHOO.log("Paginator disabled", "info", this.toString());
+
+                // Reset counter for next row
+                maxRowDepth = 1;
             }
+        };
+        parseTreeForRowspan(tree);
+
+        // Store tree index values
+        for(i=0; i<tree[0].length; i++) {
+            tree[0][i]._nTreeIndex = i;
         }
-    });
+
+        // Store header relationships in an array for HEADERS attribute
+        var recurseAncestorsForHeaders = function(i, oColumn) {
+            headers[i].push(oColumn._sId);
+            if(oColumn.parent) {
+                recurseAncestorsForHeaders(i, oColumn.parent);
+            }
+        };
+        for(i=0; i<keys.length; i++) {
+            headers[i] = [];
+            recurseAncestorsForHeaders(i, keys[i]);
+            headers[i] = headers[i].reverse();
+        }
+
+        // Save to the ColumnSet instance
+        this.tree = tree;
+        this.flat = flat;
+        this.keys = keys;
+        this.headers = headers;
+    },
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
     /**
-    * @config caption
-    * @description Value for the CAPTION element.
-    * @type String
-    */
-    this.setAttributeConfig("caption", {
-        value: null,
-        validator: YAHOO.lang.isString,
-        method: function(sCaption) {
-            // Create CAPTION element
-            if(!this._elCaption) {
-                if(!this._elTable.firstChild) {
-                    this._elCaption = this._elTable.appendChild(document.createElement("caption"));
+     * Returns unique name of the ColumnSet instance.
+     *
+     * @method getId
+     * @return {String} Unique name of the ColumnSet instance.
+     */
+
+    getId : function() {
+        return this._sId;
+    },
+
+    /**
+     * ColumnSet instance name, for logging.
+     *
+     * @method toString
+     * @return {String} Unique name of the ColumnSet instance.
+     */
+
+    toString : function() {
+        return "ColumnSet instance " + this._sId;
+    },
+
+    /**
+     * Public accessor to the definitions array.
+     *
+     * @method getDefinitions
+     * @return {Object[]} Array of object literal Column definitions.
+     */
+
+    getDefinitions : function() {
+        var aDefinitions = this._aDefinitions;
+        
+        // Internal recursive function to define Column instances
+        var parseColumns = function(nodeList, oSelf) {
+            // Parse each node at this depth for attributes and any children
+            for(var j=0; j<nodeList.length; j++) {
+                var currentNode = nodeList[j];
+                
+                // Get the Column for each node
+                var oColumn = oSelf.getColumnById(currentNode.yuiColumnId);
+                
+                if(oColumn) {    
+                    // Update the definition
+                    currentNode.abbr = oColumn.abbr;
+                    currentNode.className = oColumn.className;
+                    currentNode.editor = oColumn.editor;
+                    currentNode.editorOptions = oColumn.editorOptions;
+                    currentNode.formatter = oColumn.formatter;
+                    currentNode.hidden = oColumn.hidden;
+                    currentNode.key = oColumn.key;
+                    currentNode.label = oColumn.label;
+                    currentNode.minWidth = oColumn.minWidth;
+                    currentNode.resizeable = oColumn.resizeable;
+                    currentNode.selected = oColumn.selected;
+                    currentNode.sortable = oColumn.sortable;
+                    currentNode.sortOptions = oColumn.sortOptions;
+                    currentNode.width = oColumn.width;
                 }
-                else {
-                    this._elCaption = this._elTable.insertBefore(document.createElement("caption"), this._elTable.firstChild);
+                            
+                // The Column has descendants
+                if(YAHOO.lang.isArray(currentNode.children)) {
+                    // The children themselves must also be parsed for Column instances
+                    parseColumns(currentNode.children, oSelf);
+                }
+            }
+        };
+
+        parseColumns(aDefinitions, this);
+        this._aDefinitions = aDefinitions;
+        return aDefinitions;
+    },
+
+    /**
+     * Returns Column instance with given ID.
+     *
+     * @method getColumnById
+     * @param column {String} Column ID.
+     * @return {YAHOO.widget.Column} Column instance.
+     */
+
+    getColumnById : function(column) {
+        if(YAHOO.lang.isString(column)) {
+            var allColumns = this.flat;
+            for(var i=allColumns.length-1; i>-1; i--) {
+                if(allColumns[i]._sId === column) {
+                    return allColumns[i];
                 }
             }
-            // Set CAPTION value
-            this._elCaption.innerHTML = sCaption;
         }
-    });
+        return null;
+    },
 
     /**
-    * @config scrollable
-    * @description True if primary TBODY should scroll while THEAD remains fixed.
-    * When enabling this feature, captions cannot be used, and the following
-    * features are not recommended: inline editing, resizeable columns.
-    * @default false
-    * @type Boolean
-    */
-    this.setAttributeConfig("scrollable", {
-        value: false,
-        validator: function(oParam) {
-            //TODO: validate agnst resizeable
-            return (YAHOO.lang.isBoolean(oParam) &&
-                    // Not compatible with caption
-                    !YAHOO.lang.isString(this.get("caption")));
-        },
-        method: function(oParam) {
-            if(oParam) {
-                //TODO: conf height
-                YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
-                YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+     * Returns Column instance with given key or ColumnSet key index.
+     *
+     * @method getColumn
+     * @param column {String | Number} Column key or ColumnSet key index.
+     * @return {YAHOO.widget.Column} Column instance.
+     */
+
+    getColumn : function(column) {
+        if(YAHOO.lang.isNumber(column) && this.keys[column]) {
+            return this.keys[column];
+        }
+        else if(YAHOO.lang.isString(column)) {
+            var allColumns = this.flat;
+            var aColumns = [];
+            for(var i=0; i<allColumns.length; i++) {
+                if(allColumns[i].key === column) {
+                    aColumns.push(allColumns[i]);
+                }
             }
-            else {
-                YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
-                YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+            if(aColumns.length === 1) {
+                return aColumns[0];
+            }
+            else if(aColumns.length > 1) {
+                return aColumns;
+            }
+        }
+        return null;
+    },
+
+    /**
+     * Public accessor returns array of given Column's desendants (if any), including itself.
+     *
+     * @method getDescendants
+     * @parem {YAHOO.widget.Column} Column instance.
+     * @return {Array} Array including the Column itself and all descendants (if any).
+     */
+    getDescendants : function(oColumn) {
+        var oSelf = this;
+        var allDescendants = [];
+        var i;
+
+        // Recursive function to loop thru all children
+        var parse = function(oParent) {
+            allDescendants.push(oParent);
+            // This Column has children
+            if(oParent.children) {
+                for(i=0; i<oParent.children.length; i++) {
+                    parse(oSelf.getColumn(oParent.children[i].key));
+                }
+            }
+        };
+        parse(oColumn);
+
+        return allDescendants;
+    }
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
+/**
+ * The Column class defines and manages attributes of DataTable Columns
+ *
+ * @namespace YAHOO.widget
+ * @class Column
+ * @constructor
+ * @param oConfigs {Object} Object literal of definitions.
+ */
+YAHOO.widget.Column = function(oConfigs) {
+    // Object literal defines Column attributes
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
             }
         }
-    });
+   }
+    // Backward compatibility
+    if(this.width && !YAHOO.lang.isNumber(this.width)) {
+        this.width = null;
+        YAHOO.log("The Column property width must be a number", "warn", this.toString());
+    }
 };
 
 /////////////////////////////////////////////////////////////////////////////
 //
-// Public constants
+// Private member variables
 //
 /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Class name assigned to TABLE element.
- *
- * @property DataTable.CLASS_TABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-table"
- */
-YAHOO.widget.DataTable.CLASS_TABLE = "yui-dt-table";
-
-/**
- * Class name assigned to header container elements within each TH element.
- *
- * @property DataTable.CLASS_HEADER
- * @type String
- * @static
- * @final
- * @default "yui-dt-header"
- */
-YAHOO.widget.DataTable.CLASS_HEADER = "yui-dt-header";
+YAHOO.lang.augmentObject(YAHOO.widget.Column, {
+    /**
+     * Internal class variable to index multiple Column instances.
+     *
+     * @property Column._nCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCount : 0,
+
+    formatCheckbox : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatCheckbox() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatCheckbox()", "warn",
+        "YAHOO.widget.Column.formatCheckbox");
+        YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
+    },
+
+    formatCurrency : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatCurrency() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatCurrency()", "warn",
+        "YAHOO.widget.Column.formatCurrency");
+        YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
+    },
+
+    formatDate : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatDate() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatDate()", "warn",
+        "YAHOO.widget.Column.formatDate");
+        YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
+    },
+
+    formatEmail : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatEmail() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatEmail()", "warn",
+        "YAHOO.widget.Column.formatEmail");
+        YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
+    },
+
+    formatLink : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatLink() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatLink()", "warn",
+        "YAHOO.widget.Column.formatLink");
+        YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
+    },
+
+    formatNumber : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatNumber() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatNumber()", "warn",
+        "YAHOO.widget.Column.formatNumber");
+        YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
+    },
+
+    formatSelect : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.log("The method YAHOO.widget.Column.formatSelect() has been" +
+        " deprecated in favor of YAHOO.widget.DataTable.formatDropdown()", "warn",
+        "YAHOO.widget.Column.formatSelect");
+        YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
+    }
+});
+
+YAHOO.widget.Column.prototype = {
+    /**
+     * Unique String identifier assigned at instantiation.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
-/**
- * Class name assigned to the primary TBODY element.
- *
- * @property DataTable.CLASS_BODY
- * @type String
- * @static
- * @final
- * @default "yui-dt-body"
- */
-YAHOO.widget.DataTable.CLASS_BODY = "yui-dt-body";
+    /**
+     * Object literal definition
+     *
+     * @property _oDefinition
+     * @type Object
+     * @private
+     */
+    _oDefinition : null,
 
-/**
- * Class name assigned to the scrolling TBODY element of a fixed scrolling DataTable.
- *
- * @property DataTable.CLASS_SCROLLBODY
- * @type String
- * @static
- * @final
- * @default "yui-dt-scrollbody"
- */
-YAHOO.widget.DataTable.CLASS_SCROLLBODY = "yui-dt-scrollbody";
+    /**
+     * Reference to Column's current position index within its ColumnSet's keys
+     * array, if applicable. This property only applies to non-nested and bottom-
+     * level child Columns.
+     *
+     * @property _nKeyIndex
+     * @type Number
+     * @private
    */
+    _nKeyIndex : null,
 
-/**
- * Class name assigned to display label elements.
- *
- * @property DataTable.CLASS_LABEL
- * @type String
- * @static
- * @final
- * @default "yui-dt-label"
- */
-YAHOO.widget.DataTable.CLASS_LABEL = "yui-dt-label";
+    /**
+     * Reference to Column's current position index within its ColumnSet's tree
+     * array, if applicable. This property only applies to non-nested and top-
+     * level parent Columns.
+     *
+     * @property _nTreeIndex
+     * @type Number
+     * @private
    */
+    _nTreeIndex : null,
 
-/**
- * Class name assigned to resizer handle elements.
- *
- * @property DataTable.CLASS_RESIZER
- * @type String
- * @static
- * @final
- * @default "yui-dt-resizer"
- */
-YAHOO.widget.DataTable.CLASS_RESIZER = "yui-dt-resizer";
+    /**
+     * Number of table cells the Column spans.
+     *
+     * @property _nColspan
+     * @type Number
+     * @private
+     */
+    _nColspan : 1,
 
-/**
- * Class name assigned to Editor container elements.
- *
- * @property DataTable.CLASS_EDITOR
- * @type String
- * @static
- * @final
- * @default "yui-dt-editor"
- */
-YAHOO.widget.DataTable.CLASS_EDITOR = "yui-dt-editor";
+    /**
+     * Number of table rows the Column spans.
+     *
+     * @property _nRowspan
+     * @type Number
+     * @private
+     */
+    _nRowspan : 1,
 
-/**
- * Class name assigned to paginator container elements.
- *
- * @property DataTable.CLASS_PAGINATOR
- * @type String
- * @static
- * @final
- * @default "yui-dt-paginator"
- */
-YAHOO.widget.DataTable.CLASS_PAGINATOR = "yui-dt-paginator";
+    /**
+     * Column's parent Column instance, or null.
+     *
+     * @property _oParent
+     * @type YAHOO.widget.Column
+     * @private
+     */
+    _oParent : null,
 
-/**
- * Class name assigned to page number indicators.
- *
- * @property DataTable.CLASS_PAGE
- * @type String
- * @static
- * @final
- * @default "yui-dt-page"
- */
-YAHOO.widget.DataTable.CLASS_PAGE = "yui-dt-page";
+    /*TODO: remove
+     * The DOM reference the associated COL element.
+     *
+     * @property _elCol
+     * @type HTMLElement
+     * @private
+     */
+    //YAHOO.widget.Column.prototype._elCol = null;
 
-/**
- * Class name assigned to default indicators.
- *
- * @property DataTable.CLASS_DEFAULT
- * @type String
- * @static
- * @final
- * @default "yui-dt-default"
- */
-YAHOO.widget.DataTable.CLASS_DEFAULT = "yui-dt-default";
+    /**
+     * The DOM reference to the associated TH element.
+     *
+     * @property _elTh
+     * @type HTMLElement
+     * @private
+     */
+    _elTh : null,
 
-/**
- * Class name assigned to previous indicators.
- *
- * @property DataTable.CLASS_PREVIOUS
- * @type String
- * @static
- * @final
- * @default "yui-dt-previous"
- */
-YAHOO.widget.DataTable.CLASS_PREVIOUS = "yui-dt-previous";
+    /**
+     * The DOM reference to the associated resizerelement (if any).
+     *
+     * @property _elResizer
+     * @type HTMLElement
+     * @private
+     */
+    _elResizer : null,
 
-/**
- * Class name assigned next indicators.
- *
- * @property DataTable.CLASS_NEXT
- * @type String
- * @static
- * @final
- * @default "yui-dt-next"
- */
-YAHOO.widget.DataTable.CLASS_NEXT = "yui-dt-next";
+    /**
+     * For unreg() purposes, a reference to the Column's DragDrop instance.
+     *
+     * @property _dd
+     * @type YAHOO.util.DragDrop
+     * @private
+     */
+    _dd : null,
 
-/**
- * Class name assigned to first elements.
- *
- * @property DataTable.CLASS_FIRST
- * @type String
- * @static
- * @final
- * @default "yui-dt-first"
- */
-YAHOO.widget.DataTable.CLASS_FIRST = "yui-dt-first";
+    /**
+     * For unreg() purposes, a reference to the Column resizer's DragDrop instance.
+     *
+     * @property _ddResizer
+     * @type YAHOO.util.DragDrop
+     * @private
+     */
+    _ddResizer : null,
 
-/**
- * Class name assigned to last elements.
- *
- * @property DataTable.CLASS_LAST
- * @type String
- * @static
- * @final
- * @default "yui-dt-last"
- */
-YAHOO.widget.DataTable.CLASS_LAST = "yui-dt-last";
-
-/**
- * Class name assigned to even elements.
- *
- * @property DataTable.CLASS_EVEN
- * @type String
- * @static
- * @final
- * @default "yui-dt-even"
- */
-YAHOO.widget.DataTable.CLASS_EVEN = "yui-dt-even";
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Class name assigned to odd elements.
- *
- * @property DataTable.CLASS_ODD
- * @type String
- * @static
- * @final
- * @default "yui-dt-odd"
- */
-YAHOO.widget.DataTable.CLASS_ODD = "yui-dt-odd";
+    /**
+     * Associated database field, or null.
+     *
+     * @property key
+     * @type String
+     */
+    key : null,
 
-/**
- * Class name assigned to selected elements.
- *
- * @property DataTable.CLASS_SELECTED
- * @type String
- * @static
- * @final
- * @default "yui-dt-selected"
- */
-YAHOO.widget.DataTable.CLASS_SELECTED = "yui-dt-selected";
+    /**
+     * Text or HTML for display as Column's label in the TH element.
+     *
+     * @property label
+     * @type String
+     */
+    label : null,
 
-/**
- * Class name assigned to highlighted elements.
- *
- * @property DataTable.CLASS_HIGHLIGHTED
- * @type String
- * @static
- * @final
- * @default "yui-dt-highlighted"
- */
-YAHOO.widget.DataTable.CLASS_HIGHLIGHTED = "yui-dt-highlighted";
+    /**
+     * Column head cell ABBR for accessibility.
+     *
+     * @property abbr
+     * @type String
+     */
+    abbr : null,
 
-/**
- * Class name assigned to disabled elements.
- *
- * @property DataTable.CLASS_DISABLED
- * @type String
- * @static
- * @final
- * @default "yui-dt-disabled"
- */
-YAHOO.widget.DataTable.CLASS_DISABLED = "yui-dt-disabled";
+    /**
+     * Array of object literals that define children (nested headers) of a Column.
+     *
+     * @property children
+     * @type Object[]
+     */
+    children : null,
 
-/**
- * Class name assigned to empty indicators.
- *
- * @property DataTable.CLASS_EMPTY
- * @type String
- * @static
- * @final
- * @default "yui-dt-empty"
- */
-YAHOO.widget.DataTable.CLASS_EMPTY = "yui-dt-empty";
+    /**
+     * Column width (in pixels).
+     *
+     * @property width
+     * @type Number
+     */
+    width : null,
 
-/**
- * Class name assigned to loading indicatorx.
- *
- * @property DataTable.CLASS_LOADING
- * @type String
- * @static
- * @final
- * @default "yui-dt-loading"
- */
-YAHOO.widget.DataTable.CLASS_LOADING = "yui-dt-loading";
+    /**
+     * Minimum Column width (in pixels).
+     *
+     * @property minWidth
+     * @type Number
+     * @default 10
+     */
+    minWidth : 10,
 
-/**
- * Class name assigned to error indicators.
- *
- * @property DataTable.CLASS_ERROR
- * @type String
- * @static
- * @final
- * @default "yui-dt-error"
- */
-YAHOO.widget.DataTable.CLASS_ERROR = "yui-dt-error";
+    /**
+     * True if Column is in hidden state.
+     *
+     * @property hidden
+     * @type Boolean
+     * @default false     
+     */
+    hidden : false,
 
-/**
- * Class name assigned to editable elements.
- *
- * @property DataTable.CLASS_EDITABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-editable"
- */
-YAHOO.widget.DataTable.CLASS_EDITABLE = "yui-dt-editable";
+    /**
+     * True if Column is in selected state.
+     *
+     * @property selected
+     * @type Boolean
+     * @default false     
+     */
+    selected : false,
 
-/**
- * Class name assigned to scrollable elements.
- *
- * @property DataTable.CLASS_SCROLLABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-scrollable"
- */
-YAHOO.widget.DataTable.CLASS_SCROLLABLE = "yui-dt-scrollable";
-
-/**
- * Class name assigned to sortable elements.
- *
- * @property DataTable.CLASS_SORTABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-sortable"
- */
-YAHOO.widget.DataTable.CLASS_SORTABLE = "yui-dt-sortable";
-
-/**
- * Class name assigned to ascending elements.
- *
- * @property DataTable.CLASS_ASC
- * @type String
- * @static
- * @final
- * @default "yui-dt-asc"
- */
-YAHOO.widget.DataTable.CLASS_ASC = "yui-dt-asc";
-
-/**
- * Class name assigned to descending elements.
- *
- * @property DataTable.CLASS_DESC
- * @type String
- * @static
- * @final
- * @default "yui-dt-desc"
- */
-YAHOO.widget.DataTable.CLASS_DESC = "yui-dt-desc";
-
-/**
- * Class name assigned to BUTTON container elements.
- *
- * @property DataTable.CLASS_BUTTON
- * @type String
- * @static
- * @final
- * @default "yui-dt-button"
- */
-YAHOO.widget.DataTable.CLASS_BUTTON = "yui-dt-button";
-
-/**
- * Class name assigned to SELECT container elements.
- *
- * @property DataTable.CLASS_DROPDOWN
- * @type String
- * @static
- * @final
- * @default "yui-dt-dropdown"
- */
-YAHOO.widget.DataTable.CLASS_DROPDOWN = "yui-dt-dropdown";
-
-/**
- * Class name assigned to INPUT TYPE=CHECKBOX container elements.
- *
- * @property DataTable.CLASS_CHECKBOX
- * @type String
- * @static
- * @final
- * @default "yui-dt-checkbox"
- */
-YAHOO.widget.DataTable.CLASS_CHECKBOX = "yui-dt-checkbox";
-
-/**
- * Message to display if DataTable has no data.
- *
- * @property DataTable.MSG_EMPTY
- * @type String
- * @static
- * @final
- * @default "No records found."
- */
-YAHOO.widget.DataTable.MSG_EMPTY = "No records found.";
-
-/**
- * Message to display while DataTable is loading data.
- *
- * @property DataTable.MSG_LOADING
- * @type String
- * @static
- * @final
- * @default "Loading data..."
- */
-YAHOO.widget.DataTable.MSG_LOADING = "Loading data...";
-
-/**
- * Message to display while DataTable has data error.
- *
- * @property DataTable.MSG_ERROR
- * @type String
- * @static
- * @final
- * @default "Data error."
- */
-YAHOO.widget.DataTable.MSG_ERROR = "Data error.";
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
-
-/**
- * Internal class variable for indexing multiple DataTable instances.
- *
- * @property DataTable._nCount
- * @type Number
- * @private
- * @static
- */
-YAHOO.widget.DataTable._nCount = 0;
-
-/**
- * Index assigned to instance.
- *
- * @property _nIndex
- * @type Number
- * @private
- */
-YAHOO.widget.DataTable.prototype._nIndex = null;
-
-/**
- * Counter for IDs assigned to TR elements.
- *
- * @property _nTrCount
- * @type Number
- * @private
- */
-YAHOO.widget.DataTable.prototype._nTrCount = 0;
-
-/**
- * Unique name assigned to instance.
- *
- * @property _sName
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sName = null;
-
-/**
- * DOM reference to the container element for the DataTable instance into which
- * the TABLE element gets created.
- *
- * @property _elContainer
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elContainer = null;
-
-/**
- * DOM reference to the CAPTION element for the DataTable instance.
- *
- * @property _elCaption
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elCaption = null;
-
-/**
- * DOM reference to the TABLE element for the DataTable instance.
- *
- * @property _elTable
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elTable = null;
-
-/**
- * DOM reference to the THEAD element for the DataTable instance.
- *
- * @property _elThead
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elThead = null;
-
-/**
- * DOM reference to the primary TBODY element for the DataTable instance.
- *
- * @property _elTbody
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elTbody = null;
-
-/**
- * DOM reference to the secondary TBODY element used to display DataTable messages.
- *
- * @property _elMsgTbody
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbody = null;
-
-/**
- * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
- *
- * @property _elMsgTbodyRow
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbodyRow = null;
-
-/**
- * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
- *
- * @property _elMsgTbodyCell
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbodyCell = null;
-
-/**
- * DataSource instance for the DataTable instance.
- *
- * @property _oDataSource
- * @type YAHOO.util.DataSource
- * @private
- */
-YAHOO.widget.DataTable.prototype._oDataSource = null;
-
-/**
- * ColumnSet instance for the DataTable instance.
- *
- * @property _oColumnSet
- * @type YAHOO.widget.ColumnSet
- * @private
- */
-YAHOO.widget.DataTable.prototype._oColumnSet = null;
-
-/**
- * RecordSet instance for the DataTable instance.
- *
- * @property _oRecordSet
- * @type YAHOO.widget.RecordSet
- * @private
- */
-YAHOO.widget.DataTable.prototype._oRecordSet = null;
-
-/**
- * ID string of first label link element of the current DataTable page, if any.
- * Used for focusing sortable Columns with TAB.
- *
- * @property _sFirstLabelLinkId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sFirstLabelLinkId = null;
-
-/**
- * ID string of first TR element of the current DataTable page.
- *
- * @property _sFirstTrId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sFirstTrId = null;
-
-/**
- * ID string of the last TR element of the current DataTable page.
- *
- * @property _sLastTrId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sLastTrId = null;
+    /**
+     * Custom CSS class or array of classes to be applied to every cell in the Column.
+     *
+     * @property className
+     * @type String || String[]
+     */
+    className : null,
 
+    /**
+     * Defines a format function.
+     *
+     * @property formatter
+     * @type String || HTMLFunction
+     */
+    formatter : null,
 
+    /**
+     * Defines an editor function, otherwise Column is not editable.
+     *
+     * @property editor
+     * @type String || HTMLFunction
+     */
+    editor : null,
 
+    /**
+     * Defines editor options for Column in an object literal of param:value pairs.
+     *
+     * @property editorOptions
+     * @type Object
+     */
+    editorOptions : null,
 
+    /**
+     * True if Column is resizeable, false otherwise. The Drag & Drop Utility is
+     * required to enable this feature. Only bottom-level and non-nested Columns are
+     * resizeble. 
+     *
+     * @property resizeable
+     * @type Boolean
+     * @default false
+     */
+    resizeable : false,
 
+    /**
+     * True if Column is sortable, false otherwise.
+     *
+     * @property sortable
+     * @type Boolean
+     * @default false
+     */
+    sortable : false,
 
+    /**
+     * @property sortOptions.defaultOrder
+     * @deprecated Use sortOptions.defaultDir.
+     */
+    /**
+     * Default sort direction for Column: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.
+     *
+     * @property sortOptions.defaultDir
+     * @type String
+     * @default null
+     */
+    /**
+     * Custom sort handler.
+     *
+     * @property sortOptions.sortFunction
+     * @type Function
+     * @default null
+     */
+    sortOptions : null,
 
 
 
@@ -1023,2781 +1028,5555 @@ YAHOO.widget.DataTable.prototype._sLastTrId = null;
 
 
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Returns unique ID string.
+     *
+     * @method getId
+     * @return {String} Unique ID string.
+     */
+    getId : function() {
+        return this._sId;
+    },
 
+    /**
+     * Column instance name, for logging.
+     *
+     * @method toString
+     * @return {String} Column's unique name.
+     */
+    toString : function() {
+        return "Column instance " + this._sId;
+    },
 
+    /**
+     * Returns object literal definition.
+     *
+     * @method getDefinition
+     * @return {Object} Object literal definition.
+     */
+    getDefinition : function() {
+        var oDefinition = this._oDefinition;
+        
+        // Update the definition
+        oDefinition.abbr = this.abbr;
+        oDefinition.className = this.className;
+        oDefinition.editor = this.editor;
+        oDefinition.editorOptions = this.editorOptions;
+        oDefinition.formatter = this.formatter;
+        oDefinition.key = this.key;
+        oDefinition.label = this.label;
+        oDefinition.minWidth = this.minWidth;
+        oDefinition.resizeable = this.resizeable;
+        oDefinition.sortable = this.sortable;
+        oDefinition.sortOptions = this.sortOptions;
+        oDefinition.width = this.width;
+
+        return oDefinition;
+    },
 
+    /**
+     * Returns unique Column key.
+     *
+     * @method getKey
+     * @return {String} Column key.
+     */
+    getKey : function() {
+        return this.key;
+    },
 
+    /**
+     * Public accessor returns Column's current position index within its
+     * ColumnSet's keys array, if applicable. Only non-nested and bottom-level
+     * child Columns will return a value.
+     *
+     * @method getKeyIndex
+     * @return {Number} Position index, or null.
+     */
+    getKeyIndex : function() {
+        return this._nKeyIndex;
+    },
 
+    /**
+     * Public accessor returns Column's current position index within its
+     * ColumnSet's tree array, if applicable. Only non-nested and top-level parent
+     * Columns will return a value;
+     *
+     * @method getTreeIndex
+     * @return {Number} Position index, or null.
+     */
+    getTreeIndex : function() {
+        return this._nTreeIndex;
+    },
 
+    /**
+     * Public accessor returns Column's parent instance if any, or null otherwise.
+     *
+     * @method getParent
+     * @return {YAHOO.widget.Column} Column's parent instance.
+     */
+    getParent : function() {
+        return this._oParent;
+    },
 
+    /**
+     * Public accessor returns Column's calculated COLSPAN value.
+     *
+     * @method getColspan
+     * @return {Number} Column's COLSPAN value.
+     */
+    getColspan : function() {
+        return this._nColspan;
+    },
+    // Backward compatibility
+    getColSpan : function() {
+        YAHOO.log("The method getColSpan() has been" +
+        " deprecated in favor of getColspan()", "warn", this.toString());
+        return this.getColspan();
+    },
 
+    /**
+     * Public accessor returns Column's calculated ROWSPAN value.
+     *
+     * @method getRowspan
+     * @return {Number} Column's ROWSPAN value.
+     */
+    getRowspan : function() {
+        return this._nRowspan;
+    },
 
+    /**
+     * Returns DOM reference to the key TH element.
+     *
+     * @method getThEl
+     * @return {HTMLElement} TH element.
+     */
+    getThEl : function() {
+        return this._elTh;
+    },
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private methods
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Returns DOM reference to the resizer element, or null.
+     *
+     * @method getResizerEl
+     * @return {HTMLElement} DIV element.
+     */
+    getResizerEl : function() {
+        return this._elResizer;
+    },
 
-/**
- * Sets focus on the given element.
- *
- * @method _focusEl
- * @param el {HTMLElement} Element.
- * @private
- */
-YAHOO.widget.DataTable.prototype._focusEl = function(el) {
-    el = el || this._elTable;
-    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
-    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
-    // strange unexpected things as the user clicks on buttons and other controls.
-    setTimeout(function() { el.focus(); },0);
+    // Backward compatibility
+    /**
+     * @method getColEl
+     * @deprecated Use getThEl
+     */
+    getColEl : function() {
+        YAHOO.log("The method getColEl() has been" +
+        " deprecated in favor of getThEl()", "warn",
+        this.toString());
+        return this.getThEl();
+    },
+    getIndex : function() {
+        YAHOO.log("The method getIndex() has been" +
+        " deprecated in favor of getKeyIndex()", "warn",
+        this.toString());
+        return this.getKeyIndex();
+    },
+    format : function() {
+        YAHOO.log("The method format() has been deprecated in favor of the " +
+        "DataTable method formatCell()", "error", this.toString());
+    }
 };
 
-
-
-
-
-// INIT FUNCTIONS
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Initializes container element.
+ * Sort static utility to support Column sorting.
  *
- * @method _initContainerEl
- * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
- * @private
+ * @namespace YAHOO.util
+ * @class Sort
+ * @static
  */
-YAHOO.widget.DataTable.prototype._initContainerEl = function(elContainer) {
-    this._elContainer = null;
-    elContainer = YAHOO.util.Dom.get(elContainer);
-    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
-        this._elContainer = elContainer;
-    }
-};
+YAHOO.util.Sort = {
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Initializes object literal of config values.
- *
- * @method _initConfigs
- * @param oConfig {Object} Object literal of config values.
- * @private
- */
-YAHOO.widget.DataTable.prototype._initConfigs = function(oConfigs) {
-    if(oConfigs) {
-        if(oConfigs.constructor != Object) {
-            oConfigs = null;
-            YAHOO.log("Invalid configs", "warn", this.toString());
+    /**
+     * Comparator function for simple case-insensitive string sorting.
+     *
+     * @method compare
+     * @param a {Object} First sort argument.
+     * @param b {Object} Second sort argument.
+     * @param desc {Boolean} True if sort direction is descending, false if
+     * sort direction is ascending.
+     */
+    compare: function(a, b, desc) {
+        if((a === null) || (typeof a == "undefined")) {
+            if((b === null) || (typeof b == "undefined")) {
+                return 0;
+            }
+            else {
+                return 1;
+            }
         }
-        // Backward compatibility
-        else if(YAHOO.lang.isBoolean(oConfigs.paginator)) {
-            YAHOO.log("DataTable's paginator model has been revised" +
-            " -- please refer to the documentation for implementation" +
-            " details", "warn", this.toString());
+        else if((b === null) || (typeof b == "undefined")) {
+            return -1;
         }
-        this._oConfigs = oConfigs;
-    }
-};
 
-/**
- * Initializes ColumnSet.
- *
- * @method _initColumnSet
- * @param aColumnDefs {Object[]} Array of object literal Column definitions.
- * @private
- */
-YAHOO.widget.DataTable.prototype._initColumnSet = function(aColumnDefs) {
-    this._oColumnSet = null;
-    if(YAHOO.lang.isArray(aColumnDefs)) {
-        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
-    }
-    // Backward compatibility
-    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
-        this._oColumnSet =  aColumnDefs;
-        YAHOO.log("DataTable's constructor now requires an array" +
-        " of object literal Column definitions instead of a ColumnSet instance",
-        "warn", this.toString());
+        if(a.constructor == String) {
+            a = a.toLowerCase();
+        }
+        if(b.constructor == String) {
+            b = b.toLowerCase();
+        }
+        if(a < b) {
+            return (desc) ? 1 : -1;
+        }
+        else if (a > b) {
+            return (desc) ? -1 : 1;
+        }
+        else {
+            return 0;
+        }
     }
 };
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
 /**
- * Initializes DataSource.
+ * ColumnDD subclasses DragDrop to support rearrangeable Columns.
  *
- * @method _initDataSource
- * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
- * @private
+ * @namespace YAHOO.util
+ * @class ColumnDD
+ * @extends YAHOO.util.DDProxy
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elTh {HTMLElement} TH element reference.
+ * @param elTarget {HTMLElement} Drag target element.
  */
-YAHOO.widget.DataTable.prototype._initDataSource = function(oDataSource) {
-    this._oDataSource = null;
-    if(oDataSource && (oDataSource instanceof YAHOO.util.DataSource)) {
-        this._oDataSource = oDataSource;
+YAHOO.widget.ColumnDD = function(oDataTable, oColumn, elTh, elTarget) {
+    if(oDataTable && oColumn && elTh && elTarget) {
+        this.datatable = oDataTable;
+        this.table = oDataTable.getTheadEl().parentNode;
+        this.column = oColumn;
+        this.headCell = elTh;
+        this.pointer = elTarget;
+        this.newIndex = null;
+        this.init(elTh);
+        this.initFrame(); // Needed for DDProxy
+        this.invalidHandleTypes = {};
+
+        //Set padding to account for children of nested columns
+        this.setPadding(10, 0, (this.datatable.getTheadEl().offsetHeight + 10) , 0);
     }
-    // Backward compatibility
     else {
-        var tmpTable = null;
-        var tmpContainer = this._elContainer;
-        // Peek in container child nodes to see if TABLE already exists
-        if(tmpContainer.hasChildNodes()) {
-            var tmpChildren = tmpContainer.childNodes;
-            for(i=0; i<tmpChildren.length; i++) {
-                if(tmpChildren[i].tagName && tmpChildren[i].tagName.toLowerCase() == "table") {
-                    tmpTable = tmpChildren[i];
-                    break;
-                }
+        YAHOO.log("Column dragdrop could not be created","warn");
+    }
+};
+
+if(YAHOO.util.DDProxy) {
+    YAHOO.extend(YAHOO.widget.ColumnDD, YAHOO.util.DDProxy, {
+        initConstraints: function() {
+            //Get the top, right, bottom and left positions
+            var region = YAHOO.util.Dom.getRegion(this.table),
+                //Get the element we are working on
+                el = this.getEl(),
+                //Get the xy position of it
+                xy = YAHOO.util.Dom.getXY(el),
+                //Get the width and height
+                width = parseInt(YAHOO.util.Dom.getStyle(el, 'width'), 10),
+                height = parseInt(YAHOO.util.Dom.getStyle(el, 'height'), 10),
+                //Set left to x minus left
+                left = ((xy[0] - region.left) + 15), //Buffer of 15px
+                //Set right to right minus x minus width
+                right = ((region.right - xy[0] - width) + 15);
+    
+            //Set the constraints based on the above calculations
+            this.setXConstraint(left, right);
+            this.setYConstraint(10, 10);
+            
+            YAHOO.util.Event.on(window, 'resize', function() {
+                this.initConstraints();
+            }, this, true);
+        },
+        _resizeProxy: function() {
+            this.constructor.superclass._resizeProxy.apply(this, arguments);
+            var dragEl = this.getDragEl(),
+                el = this.getEl();
+
+            YAHOO.util.Dom.setStyle(this.pointer, 'height', (this.table.parentNode.offsetHeight + 10) + 'px');
+            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'block');
+            var xy = YAHOO.util.Dom.getXY(el);
+            YAHOO.util.Dom.setXY(this.pointer, [xy[0], (xy[1] - 5)]);
+            
+            YAHOO.util.Dom.setStyle(dragEl, 'height', this.datatable.getContainerEl().offsetHeight + "px");
+            YAHOO.util.Dom.setStyle(dragEl, 'width', (parseInt(YAHOO.util.Dom.getStyle(dragEl, 'width'),10) + 4) + 'px');
+            YAHOO.util.Dom.setXY(this.dragEl, xy);
+        },
+        onMouseDown: function() {
+                this.initConstraints();
+                this.resetConstraints();
+        },
+        clickValidator: function(e) {
+            if(!this.column.hidden) {
+                var target = YAHOO.util.Event.getTarget(e);
+                return ( this.isValidHandleChild(target) &&
+                            (this.id == this.handleElId ||
+                                this.DDM.handleWasClicked(target, this.id)) );
             }
-            if(tmpTable) {
-                var tmpFieldsArray = [];
-                for(i=0; i<this._oColumnSet.keys.length; i++) {
-                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+        },
+        onDragOver: function(ev, id) {
+            // Validate target
+            var target = this.datatable.getColumn(id);
+            if(target) {
+                var mouseX = YAHOO.util.Event.getPageX(ev),
+                targetX = YAHOO.util.Dom.getX(id),
+                midX = targetX + ((YAHOO.util.Dom.get(id).offsetWidth)/2),
+                currentIndex =  this.column.getTreeIndex(),
+                targetIndex = target.getTreeIndex(),
+                newIndex = targetIndex;
+                
+                
+                if (mouseX < midX) {
+                   YAHOO.util.Dom.setX(this.pointer, targetX);
+                } else {
+                    var thisWidth = parseInt(target.getThEl().offsetWidth, 10);
+                    YAHOO.util.Dom.setX(this.pointer, (targetX + thisWidth));
+                    newIndex++;
                 }
-
-                this._oDataSource = new YAHOO.util.DataSource(tmpTable);
-                this._oDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
-                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
-                YAHOO.log("Null DataSource for progressive enhancement from" +
-                " markup has been deprecated", "warn", this.toString());
+                if (targetIndex > currentIndex) {
+                    newIndex--;
+                }
+                if(newIndex < 0) {
+                    newIndex = 0;
+                }
+                else if(newIndex > this.datatable.getColumnSet().tree[0].length) {
+                    newIndex = this.datatable.getColumnSet().tree[0].length;
+                }
+                this.newIndex = newIndex;
+            }
+        },
+        onDragDrop: function() {
+            if(YAHOO.lang.isNumber(this.newIndex) && (this.newIndex !== this.column.getTreeIndex())) {
+                var oDataTable = this.datatable;
+                oDataTable._oChain.stop();
+                var aColumnDefs = oDataTable._oColumnSet.getDefinitions();
+                var oColumn = aColumnDefs.splice(this.column.getTreeIndex(),1)[0];
+                aColumnDefs.splice(this.newIndex, 0, oColumn);
+                oDataTable._initColumnSet(aColumnDefs);
+                oDataTable._initTheadEls();
+                oDataTable.render();
             }
+        },
+        endDrag: function() {
+            this.newIndex = null;
+            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'none');
         }
-    }
-};
+    });
+}
 
-/**
- * Initializes RecordSet.
- *
- * @method _initRecordSet
- * @private
- */
-YAHOO.widget.DataTable.prototype._initRecordSet = function() {
-    if(this._oRecordSet) {
-        this._oRecordSet.reset();
-    }
-    else {
-        this._oRecordSet = new YAHOO.widget.RecordSet();
-    }
-};
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Creates HTML markup for TABLE, THEAD and TBODY elements.
+ * ColumnResizer subclasses DragDrop to support resizeable Columns.
  *
- * @method _initTableEl
- * @private
+ * @namespace YAHOO.util
+ * @class ColumnResizer
+ * @extends YAHOO.util.DDProxy
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elTh {HTMLElement} TH element reference.
+ * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
+ * @param elProxy {HTMLElement} Resizer proxy element.
  */
-YAHOO.widget.DataTable.prototype._initTableEl = function() {
-    // Clear the container
-    YAHOO.util.Event.purgeElement(this._elContainer, true);
-    this._elContainer.innerHTML = "";
-
-    // Create TABLE
-    this._elTable = this._elContainer.appendChild(document.createElement("table"));
-    var elTable = this._elTable;
-    elTable.tabIndex = 0;
-    elTable.id = this.id + "-table";
-    YAHOO.util.Dom.addClass(elTable, YAHOO.widget.DataTable.CLASS_TABLE);
-
-    // Create THEAD
-    this._initTheadEl(elTable, this._oColumnSet);
-
-
-    // Create TBODY for messages
-    var elMsgTbody = document.createElement("tbody");
-    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
-    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);
-    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);
-    this._elMsgRow = elMsgRow;
-    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
-    elMsgCell.colSpan = this._oColumnSet.keys.length;
-    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);
-    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);
-    this._elMsgTd = elMsgCell;
-    this._elMsgTbody = elTable.appendChild(elMsgTbody);
-    this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING, YAHOO.widget.DataTable.CLASS_LOADING);
-
-    // Create TBODY for data
-    this._elTbody = elTable.appendChild(document.createElement("tbody"));
-    YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);
+YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elTh, sHandleId, elProxy) {
+    if(oDataTable && oColumn && elTh && sHandleId) {
+        this.datatable = oDataTable;
+        this.column = oColumn;
+        this.headCell = elTh;
+        this.headCellLiner = elTh.firstChild;
+        this.init(sHandleId, sHandleId, {dragOnly:true, dragElId: elProxy.id});
+        this.initFrame(); // Needed for proxy
+    }
+    else {
+        YAHOO.log("Column resizer could not be created","warn");
+    }
 };
 
-/**
- * Populates THEAD element with TH cells as defined by ColumnSet.
- *
- * @method _initTheadEl
- * @private
- */
-YAHOO.widget.DataTable.prototype._initTheadEl = function() {
-    var i,oColumn, colId;
-    var oColumnSet = this._oColumnSet;
-    this._sFirstLabelLinkId = null;
+if(YAHOO.util.DD) {
+    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DDProxy, {
+        /////////////////////////////////////////////////////////////////////////////
+        //
+        // Public methods
+        //
+        /////////////////////////////////////////////////////////////////////////////
+        /**
+         * Resets resizer element.
+         *
+         * @method resetResizerEl
+         */
+        resetResizerEl : function() {
+            var resizerStyle = YAHOO.util.Dom.get(this.handleElId).style;
+            resizerStyle.left = "auto";
+            resizerStyle.right = 0;
+            resizerStyle.top = "auto";
+            resizerStyle.bottom = 0;
+        },
     
-    // Create THEAD
-    var elThead = document.createElement("thead");
-
-    // Iterate through each row of Column headers...
-    var colTree = oColumnSet.tree;
-    for(i=0; i<colTree.length; i++) {
-        var elTheadRow = elThead.appendChild(document.createElement("tr"));
-        elTheadRow.id = this.id+"-hdrow"+i;
-
-        var elTheadCell;
-        // ...and create THEAD cells
-        for(var j=0; j<colTree[i].length; j++) {
-            oColumn = colTree[i][j];
-            colId = oColumn.getId();
-            elTheadCell = elTheadRow.appendChild(document.createElement("th"));
-            elTheadCell.id = this.id + "-col" + colId;
-            this._initThEl(elTheadCell,oColumn,i,j);
-        }
-
-        // Set FIRST/LAST on THEAD rows
-        if(i === 0) {
-            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_FIRST);
-        }
-        if(i === (colTree.length-1)) {
-            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_LAST);
-        }
-    }
-
-    this._elThead = this._elTable.appendChild(elThead);
-
-    // Set FIRST/LAST on THEAD cells using the values in ColumnSet headers array
-    var aFirstHeaders = oColumnSet.headers[0].split(" ");
-    var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1].split(" ");
-    for(i=0; i<aFirstHeaders.length; i++) {
-        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]), YAHOO.widget.DataTable.CLASS_FIRST);
-    }
-    for(i=0; i<aLastHeaders.length; i++) {
-        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]), YAHOO.widget.DataTable.CLASS_LAST);
-    }
+        /////////////////////////////////////////////////////////////////////////////
+        //
+        // Public DOM event handlers
+        //
+        /////////////////////////////////////////////////////////////////////////////
     
-    // Add Resizer only after DOM has been updated
-    var foundDD = (YAHOO.util.DD) ? true : false;
-    var needDD = false;
-    for(i=0; i<this._oColumnSet.keys.length; i++) {
-        oColumn = this._oColumnSet.keys[i];
-        colId = oColumn.getId();
-        var elTheadCellId = YAHOO.util.Dom.get(this.id + "-col" + colId);
-        if(oColumn.resizeable) {
-            if(foundDD) {
-                //TODO: fix fixed width tables
-                // Skip the last column for fixed-width tables
-                if(!this.fixedWidth || (this.fixedWidth &&
-                        (oColumn.getKeyIndex() != this._oColumnSet.keys.length-1))) {
-                    // TODO: better way to get elTheadContainer
-                    var elThContainer = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];
-                    var elThResizer = elThContainer.appendChild(document.createElement("span"));
-                    elThResizer.id = this.id + "-resizer" + colId;
-                    YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);
-                    oColumn.ddResizer = new YAHOO.util.ColumnResizer(
-                            this, oColumn, elTheadCellId, elThResizer.id, elThResizer.id);
-                    var cancelClick = function(e) {
-                        YAHOO.util.Event.stopPropagation(e);
-                    };
-                    YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);
-                }
-                if(this.fixedWidth) {
-                    //TODO: fix fixedWidth
-                    //elThContainer.style.overflow = "hidden";
-                    //TODO: better way to get elTheadText
-                    var elThLabel = (YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];
-                    elThLabel.style.overflow = "hidden";
-                }
+        /**
+         * Handles mouseup events on the Column resizer.
+         *
+         * @method onMouseUp
+         * @param e {string} The mouseup event
+         */
+        onMouseUp : function(e) {
+            this.resetResizerEl();
+            this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.headCell});
+        },
+    
+        /**
+         * Handles mousedown events on the Column resizer.
+         *
+         * @method onMouseDown
+         * @param e {string} The mousedown event
+         */
+        onMouseDown : function(e) {
+            this.startWidth = this.headCell.firstChild.offsetWidth;
+            this.startX = YAHOO.util.Event.getXY(e)[0];
+            this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0) +
+                    (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0);
+        },
+    
+        /**
+         * Custom clickValidator to ensure Column is not in hidden state.
+         *
+         * @method clickValidator
+         * @param {Event} e
+         * @private
+         */
+        clickValidator : function(e) {
+            if(!this.column.hidden) {
+                var target = YAHOO.util.Event.getTarget(e);
+                return ( this.isValidHandleChild(target) &&
+                            (this.id == this.handleElId ||
+                                this.DDM.handleWasClicked(target, this.id)) );
             }
-            else {
-                needDD = true;
+        },
+    
+        /**
+         * Handles drag events on the Column resizer.
+         *
+         * @method onDrag
+         * @param e {string} The drag event
+         */
+        onDrag : function(e) {
+            var newX = YAHOO.util.Event.getXY(e)[0];
+            if(newX > YAHOO.util.Dom.getX(this.headCellLiner)) {
+                var offsetX = newX - this.startX;
+                var newWidth = this.startWidth + offsetX - this.nLinerPadding;
+                this.datatable.setColumnWidth(this.column, newWidth);
             }
         }
-    }
-    if(needDD) {
-        YAHOO.log("Could not find DragDrop dependancy for resizeable Columns", "warn", this.toString());
-    }
+    });
+}
 
-    YAHOO.log("Column headers for " + this._oColumnSet.keys.length + " keys created","info",this.toString());
-};
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Populates TH cell as defined by Column.
+ * A RecordSet defines and manages a set of Records.
  *
- * @method _initThEl
- * @param elTheadCell {HTMLElement} TH cell element reference.
- * @param oColumn {YAHOO.widget.Column} Column object.
- * @param row {number} Row index.
- * @param col {number} Column index.
- * @private
+ * @namespace YAHOO.widget
+ * @class RecordSet
+ * @param data {Object || Object[]} An object literal or an array of data.
+ * @constructor
  */
-YAHOO.widget.DataTable.prototype._initThEl = function(elTheadCell,oColumn,row,col) {
-    // Clear out the cell of prior content
-    // TODO: purgeListeners and other validation-related things
-    var index = this._nIndex;
-    var colId = oColumn.getId();
-    elTheadCell.yuiColumnId = colId;
-    if(oColumn.abbr) {
-        elTheadCell.abbr = oColumn.abbr;
-    }
-    if(oColumn.width) {
-        elTheadCell.style.width = oColumn.width;
-    }
+YAHOO.widget.RecordSet = function(data) {
+    // Internal variables
+    this._sId = "yui-rs" + YAHOO.widget.RecordSet._nCount;
+    YAHOO.widget.RecordSet._nCount++;
+    this._records = [];
+    //this._length = 0;
 
-    var aCustomClasses;
-    if(YAHOO.lang.isString(oColumn.className)) {
-        aCustomClasses = [oColumn.className];
-    }
-    else if(YAHOO.lang.isArray(oColumn.className)) {
-        aCustomClasses = oColumn.className;
-    }
-    if(aCustomClasses) {
-        for(var i=0; i<aCustomClasses.length; i++) {
-            YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);
+    if(data) {
+        if(YAHOO.lang.isArray(data)) {
+            this.addRecords(data);
         }
-    }
-    
-    YAHOO.util.Dom.addClass(elTheadCell, "yui-dt-col-"+oColumn.key);
-    
-    elTheadCell.innerHTML = "";
-    elTheadCell.rowSpan = oColumn.getRowspan();
-    elTheadCell.colSpan = oColumn.getColspan();
-
-    var elTheadContainer = elTheadCell.appendChild(document.createElement("div"));
-    elTheadContainer.id = this.id + "-container" + colId;
-    YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);
-    var elTheadLabel = elTheadContainer.appendChild(document.createElement("span"));
-    elTheadLabel.id = this.id + "-label" + colId;
-    YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);
-
-    var sLabel = YAHOO.lang.isValue(oColumn.label) ? oColumn.label : oColumn.key;
-    if(oColumn.sortable) {
-        YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);
-        //TODO: Make sortLink customizeable
-        //TODO: Make title configurable
-        //TODO: Separate label from an accessibility link that says
-        // "Click to sort ascending" and push it offscreen
-        var sLabelLinkId = this.id + "-labellink" + colId;
-        var sortLink = "?key=" + oColumn.key;
-        elTheadLabel.innerHTML = "<a id=\"" + sLabelLinkId + "\" href=\"" + sortLink + "\" title=\"Click to sort\" class=\"" + YAHOO.widget.DataTable.CLASS_SORTABLE + "\">" + sLabel + "</a>";
-        if(!this._sFirstLabelLinkId) {
-            this._sFirstLabelLinkId = sLabelLinkId;
+        else if(data.constructor == Object) {
+            this.addRecord(data);
         }
     }
-    else {
-        elTheadLabel.innerHTML = sLabel;
-    }
-};
 
-/**
- * Creates HTML markup for Cell Editor.
- *
- * @method _initCellEditorEl
- * @private
- */
-YAHOO.widget.DataTable.prototype._initCellEditorEl = function() {
-    // Attach Cell Editor container element to body
-    var elCellEditor = document.createElement("div");
-    elCellEditor.id = this.id + "-celleditor";
-    elCellEditor.style.display = "none";
-    YAHOO.util.Dom.addClass(elCellEditor, YAHOO.widget.DataTable.CLASS_EDITOR);
-    elCellEditor = document.body.appendChild(elCellEditor);
+    /**
+     * Fired when a new Record is added to the RecordSet.
+     *
+     * @event recordAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordAddEvent");
 
-    // Internal tracker of Cell Editor values
-    var oCellEditor = {};
-    oCellEditor.container = elCellEditor;
-    oCellEditor.value = null;
-    oCellEditor.isActive = false;
-    this._oCellEditor = oCellEditor;
+    /**
+     * Fired when multiple Records are added to the RecordSet at once.
+     *
+     * @event recordsAddEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsAddEvent");
 
-    // Handle ESC key
-    this.subscribe("editorKeydownEvent", function(oArgs) {
-        var e = oArgs.event;
-        var elTarget = YAHOO.util.Event.getTarget(e);
+    /**
+     * Fired when a Record is set in the RecordSet.
+     *
+     * @event recordSetEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordSetEvent");
 
-        // ESC hides Cell Editor
-        if((e.keyCode == 27)) {
-            this.cancelCellEditor();
-        }
-    });
-};
+    /**
+     * Fired when multiple Records are set in the RecordSet at once.
+     *
+     * @event recordsSetEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsSetEvent");
 
-/**
- * Initializes Column sorting.
- *
- * @method _initColumnSort
- * @private
- */
-YAHOO.widget.DataTable.prototype._initColumnSort = function() {
-    this.subscribe("headerCellClickEvent", this.onEventSortColumn);
+    /**
+     * Fired when a Record is updated with new data.
+     *
+     * @event recordUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     */
+    this.createEvent("recordUpdateEvent");
+    
+    /**
+     * Fired when a Record is deleted from the RecordSet.
+     *
+     * @event recordDeleteEvent
+     * @param oArgs.data {Object} A copy of the data held by the Record,
+     * or an array of data object literals if multiple Records were deleted at once.
+     * @param oArgs.index {Object} Index of the deleted Record.
+     */
+    this.createEvent("recordDeleteEvent");
+
+    /**
+     * Fired when multiple Records are deleted from the RecordSet at once.
+     *
+     * @event recordsDeleteEvent
+     * @param oArgs.data {Object[]} An array of data object literals copied
+     * from the Records.
+     * @param oArgs.index {Object} Index of the first deleted Record.
+     */
+    this.createEvent("recordsDeleteEvent");
+    
+    /**
+     * Fired when all Records are deleted from the RecordSet at once.
+     *
+     * @event resetEvent
+     */
+    this.createEvent("resetEvent");
+
+    /**
+     * @event keyUpdateEvent    
+     * @deprecated Use recordValueUpdateEvent     
+     */
+    this.createEvent("keyUpdateEvent");
+    /**
+     * Fired when a Record value is updated with new data.
+     *
+     * @event recordValueUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.key {String} The updated key.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     *
+     */
+    this.createEvent("recordValueUpdateEvent");
+
+    YAHOO.log("RecordSet initialized", "info", this.toString());
 };
 
 /**
- * Initializes DOM event listeners.
+ * Internal class variable to name multiple Recordset instances.
  *
- * @method _initDomEvents
+ * @property RecordSet._nCount
+ * @type Number
  * @private
+ * @static
  */
-YAHOO.widget.DataTable.prototype._initDomEvents = function() {
-    var elTable = this._elTable;
-    var elThead = this._elThead;
-    var elTbody = this._elTbody;
-    var elContainer = this._elContainer;
-
-    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
-    YAHOO.util.Event.addListener(document, "keydown", this._onDocumentKeydown, this);
-
-    YAHOO.util.Event.addListener(elTable, "focus", this._onTableFocus, this);
-    YAHOO.util.Event.addListener(elTable, "mouseover", this._onTableMouseover, this);
-    YAHOO.util.Event.addListener(elTable, "mouseout", this._onTableMouseout, this);
-    YAHOO.util.Event.addListener(elTable, "mousedown", this._onTableMousedown, this);
-    YAHOO.util.Event.addListener(elTable, "keydown", this._onTableKeydown, this);
-    YAHOO.util.Event.addListener(elTable, "keypress", this._onTableKeypress, this);
-
-    // Since we can't listen for click and dblclick on the same element...
-    YAHOO.util.Event.addListener(elTable, "dblclick", this._onTableDblclick, this);
-    YAHOO.util.Event.addListener(elThead, "click", this._onTheadClick, this);
-    YAHOO.util.Event.addListener(elTbody, "click", this._onTbodyClick, this);
-
-    YAHOO.util.Event.addListener(elContainer, "scroll", this._onScroll, this); // for IE
-    YAHOO.util.Event.addListener(elTbody, "scroll", this._onScroll, this); // for everyone else
-};
-
-
+YAHOO.widget.RecordSet._nCount = 0;
 
+YAHOO.widget.RecordSet.prototype = {
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Unique String identifier assigned at instantiation.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
+    /**
+     * Internal counter of how many Records are in the RecordSet.
+     *
+     * @property _length
+     * @type Number
+     * @private
+     * @deprecated No longer used
+     */
+    //_length : null,
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Adds one Record to the RecordSet at the given index. If index is null,
+     * then adds the Record to the end of the RecordSet.
+     *
+     * @method _addRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     * @private
+     */
+    _addRecord : function(oData, index) {
+        var oRecord = new YAHOO.widget.Record(oData);
+        
+        if(YAHOO.lang.isNumber(index) && (index > -1)) {
+            this._records.splice(index,0,oRecord);
+        }
+        else {
+            //index = this.getLength();
+            //this._records[index] = oRecord;
+            this._records[this._records.length] = oRecord;
+        }
+        //this._length++;
+        return oRecord;
+    },
 
+    /**
+     * Sets/replaces one Record to the RecordSet at the given index.  Existing
+     * Records with higher indexes are not shifted.  If no index specified, the
+     * Record is added to the end of the RecordSet.
+     *
+     * @method _setRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     * @private
+     */
+    _setRecord : function(oData, index) {
+        if (!YAHOO.lang.isNumber(index) || index < 0) {
+            index = this._records.length;
+        }
+        return (this._records[index] = new YAHOO.widget.Record(oData));
+        /*
+        if(YAHOO.lang.isNumber(index) && (index > -1)) {
+            this._records[index] = oRecord;
+            if((index+1) > this.getLength()) {
+                this._length = index+1;
+            }
+        }
+        else {
+            this._records[this.getLength()] = oRecord;
+            this._length++;
+        }
+        return oRecord;
+        */
+    },
 
+    /**
+     * Deletes Records from the RecordSet at the given index. If range is null,
+     * then only one Record is deleted.
+     *
+     * @method _deleteRecord
+     * @param index {Number} Position index.
+     * @param range {Number} (optional) How many Records to delete
+     * @private
+     */
+    _deleteRecord : function(index, range) {
+        if(!YAHOO.lang.isNumber(range) || (range < 0)) {
+            range = 1;
+        }
+        this._records.splice(index, range);
+        //this._length = this._length - range;
+    },
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Returns unique name of the RecordSet instance.
+     *
+     * @method getId
+     * @return {String} Unique name of the RecordSet instance.
+     */
+    getId : function() {
+        return this._sId;
+    },
 
+    /**
+     * Public accessor to the unique name of the RecordSet instance.
+     *
+     * @method toString
+     * @return {String} Unique name of the RecordSet instance.
+     */
+    toString : function() {
+        return "RecordSet instance " + this._sId;
+    },
 
+    /**
+     * Returns the number of Records held in the RecordSet.
+     *
+     * @method getLength
+     * @return {Number} Number of records in the RecordSet.
+     */
+    getLength : function() {
+            //return this._length;
+            return this._records.length;
+    },
 
+    /**
+     * Returns Record by ID or RecordSet position index.
+     *
+     * @method getRecord
+     * @param record {YAHOO.widget.Record | Number | String} Record instance,
+     * RecordSet position index, or Record ID.
+     * @return {YAHOO.widget.Record} Record object.
+     */
+    getRecord : function(record) {
+        var i;
+        if(record instanceof YAHOO.widget.Record) {
+            for(i=0; i<this._records.length; i++) {
+                if(this._records[i] && (this._records[i]._sId === record._sId)) {
+                    return record;
+                }
+            }
+        }
+        else if(YAHOO.lang.isNumber(record)) {
+            if((record > -1) && (record < this.getLength())) {
+                return this._records[record];
+            }
+        }
+        else if(YAHOO.lang.isString(record)) {
+            for(i=0; i<this._records.length; i++) {
+                if(this._records[i] && (this._records[i]._sId === record)) {
+                    return this._records[i];
+                }
+            }
+        }
+        // Not a valid Record for this RecordSet
+        return null;
 
+    },
 
+    /**
+     * Returns an array of Records from the RecordSet.
+     *
+     * @method getRecords
+     * @param index {Number} (optional) Recordset position index of which Record to
+     * start at.
+     * @param range {Number} (optional) Number of Records to get.
+     * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
+     * length equal to given range. If index is not given, all Records are returned.
+     */
+    getRecords : function(index, range) {
+        if(!YAHOO.lang.isNumber(index)) {
+            return this._records;
+        }
+        if(!YAHOO.lang.isNumber(range)) {
+            return this._records.slice(index);
+        }
+        return this._records.slice(index, index+range);
+    },
 
+    /**
+     * Returns a boolean indicating whether Records exist in the RecordSet at the
+     * specified index range.  Returns true if and only if a Record exists at each
+     * index in the range.
+     * @method hasRecords
+     * @param index
+     * @param range
+     * @return {Boolean} true if all indices are populated in the RecordSet
+     */
+    hasRecords : function (index, range) {
+        var recs = this.getRecords(index,range);
+        for (var i = 0; i < range; ++i) {
+            if (typeof recs[i] === 'undefined') {
+                return false;
+            }
+        }
+        return true;
+    },
 
+    /**
+     * Returns current position index for the given Record.
+     *
+     * @method getRecordIndex
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @return {Number} Record's RecordSet position index.
+     */
 
+    getRecordIndex : function(oRecord) {
+        if(oRecord) {
+            for(var i=this._records.length-1; i>-1; i--) {
+                if(this._records[i] && oRecord.getId() === this._records[i].getId()) {
+                    return i;
+                }
+            }
+        }
+        return null;
 
+    },
 
+    /**
+     * Adds one Record to the RecordSet at the given index. If index is null,
+     * then adds the Record to the end of the RecordSet.
+     *
+     * @method addRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     */
+    addRecord : function(oData, index) {
+        if(oData && (oData.constructor == Object)) {
+            var oRecord = this._addRecord(oData, index);
+            this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
+            YAHOO.log("Added Record at index " + index +
+                    " with data " + YAHOO.lang.dump(oData), "info", this.toString());
+            return oRecord;
+        }
+        else {
+            YAHOO.log("Could not add Record with data" +
+                    YAHOO.lang.dump(oData), "info", this.toString());
+            return null;
+        }
+    },
 
+    /**
+     * Adds multiple Records at once to the RecordSet at the given index with the
+     * given object literal data. If index is null, then the new Records are
+     * added to the end of the RecordSet.
+     *
+     * @method addRecords
+     * @param aData {Object[]} An object literal data or an array of data object literals.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record[]} An array of Record instances.
+     */
+    addRecords : function(aData, index) {
+        if(YAHOO.lang.isArray(aData)) {
+            var newRecords = [];
+            // Can't go backwards bc we need to preserve order
+            for(var i=0; i<aData.length; i++) {
+                if(aData[i] && (aData[i].constructor == Object)) {
+                    var record = this._addRecord(aData[i], index);
+                    newRecords.push(record);
+                }
+           }
+            this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
+            YAHOO.log("Added " + newRecords.length + " Record(s) at index " + index +
+                    " with data " + YAHOO.lang.dump(aData), "info", this.toString());
+           return newRecords;
+        }
+        else if(aData && (aData.constructor == Object)) {
+            var oRecord = this._addRecord(aData);
+            this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
+            YAHOO.log("Added 1 Record at index " + index +
+                    " with data " + YAHOO.lang.dump(aData), "info", this.toString());
+            return oRecord;
+        }
+        else {
+            YAHOO.log("Could not add Records with data " +
+                    YAHOO.lang.dump(aData), "info", this.toString());
+        }
+    },
 
+    /**
+     * Sets or replaces one Record to the RecordSet at the given index. Unlike
+     * addRecord, an existing Record at that index is not shifted to preserve it.
+     * If no index is specified, it adds the Record to the end of the RecordSet.
+     *
+     * @method setRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     */
+    setRecord : function(oData, index) {
+        if(oData && (oData.constructor == Object)) {
+            var oRecord = this._setRecord(oData, index);
+            this.fireEvent("recordSetEvent",{record:oRecord,data:oData});
+            YAHOO.log("Set Record at index " + index +
+                    " with data " + YAHOO.lang.dump(oData), "info", this.toString());
+            return oRecord;
+        }
+        else {
+            YAHOO.log("Could not set Record with data" +
+                    YAHOO.lang.dump(oData), "info", this.toString());
+            return null;
+        }
+    },
 
+    /**
+     * Sets or replaces multiple Records at once to the RecordSet with the given
+     * data, starting at the given index. If index is not specified, then the new
+     * Records are added to the end of the RecordSet.
+     *
+     * @method setRecords
+     * @param aData {Object[]} An array of object literal data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record[]} An array of Record instances.
+     */
+    setRecords : function(aData, index) {
+        if(YAHOO.lang.isArray(aData)) {
+            var Rec = YAHOO.widget.Record,
+                spliceParams = [index,0],
+                i = aData.length - 1,
+                r;
+
+            // build up a parameter array for a single call to splice in
+            // the new records.
+            for(; i >= 0 ; --i) {
+                // If the data in aData isn't valid, use the existing
+                // record to avoid harming valid records
+                r = aData[i] && typeof aData[i] === 'object' ?
+                                new Rec(aData[i]) : this._records[i];
+                if (r) {
+                    spliceParams[i+2] = r;
+                }
+            }
 
+            // We need to explicitly set the last record because splice doesn't
+            // honor start indexes higher than the current length.
+            this._records[index + spliceParams.length - 3] =
+                spliceParams[spliceParams.length - 1];
+
+            // Set the number of records to change (length minus first 2
+            // placeholders).  This must be done here because the end of aData
+            // may have contained invalid record data so we avoid increasing
+            // _records.length incorrectly.  And we do need to set the last
+            // record, although we just did that.
+            spliceParams[1] = spliceParams.length - 2;
+
+            // Call splice.apply to simulate a single update to _records
+            // rather than looping through the new records and setting them
+            // to the index one by one.  Use the spliceParams array to get
+            // the splice method to apply.  A bit convoluted, I know.
+            spliceParams.splice.apply(this._records,spliceParams);
+
+            this.fireEvent("recordsSet",{records:spliceParams,data:aData});
+            YAHOO.log("Set " + spliceParams[1] + " Record(s) at index " +
+                      spliceParams[0] + " through " +
+                      (spliceParams[0] + spliceParams[1])/* + " with data " + YAHOO.lang.dump(aData)*/, "info", this.toString());
+
+            // return the records that were set.  The first two indexes
+            // in spliceParams are the start index and length, so return
+            // everything starting at index 2
+            return spliceParams.slice(2);
+        }
+        else if(aData && (aData.constructor == Object)) {
+            var oRecord = this._setRecord(aData);
+            this.fireEvent("recordsSetEvent",{records:[oRecord],data:aData});
+            YAHOO.log("Set 1 Record at index " + index +
+                    " with data " + YAHOO.lang.dump(aData), "info", this.toString());
+            return oRecord;
+        }
+        else {
+            YAHOO.log("Could not set Records with data " +
+                    YAHOO.lang.dump(aData), "info", this.toString());
+        }
+    },
 
+    /**
+     * Updates given Record with given data.
+     *
+     * @method updateRecord
+     * @param record {YAHOO.widget.Record | Number | String} A Record instance,
+     * a RecordSet position index, or a Record ID.
+     * @param oData {Object} Object literal of new data.
+     * @return {YAHOO.widget.Record} Updated Record, or null.
+     */
+    updateRecord : function(record, oData) {
+        var oRecord = this.getRecord(record);
+        if(oRecord && oData && (oData.constructor == Object)) {
+            // Copy data from the Record for the event that gets fired later
+            var oldData = {};
+            for(var key in oRecord._oData) {
+                oldData[key] = oRecord._oData[key];
+            }
+            oRecord._oData = oData;
+            this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
+            YAHOO.log("Record at index " + this.getRecordIndex(oRecord) +
+                    " updated with data " + YAHOO.lang.dump(oData), "info", this.toString());
+            return oRecord;
+        }
+        else {
+            YAHOO.log("Could not update Record " + record, "error", this.toString());
+            return null;
+        }
+    },
 
+    /**
+     * @method updateKey
+     * @deprecated Use updateRecordValue
+     */
+    updateKey : function(record, sKey, oData) {
+        this.updateRecordValue(record, sKey, oData);
+    },
+    /**
+     * Sets given Record at given key to given data.
+     *
+     * @method updateRecordValue
+     * @param record {YAHOO.widget.Record | Number | String} A Record instance,
+     * a RecordSet position index, or a Record ID.
+     * @param sKey {String} Key name.
+     * @param oData {Object} New data.
+     */
+    updateRecordValue : function(record, sKey, oData) {
+        var oRecord = this.getRecord(record);
+        if(oRecord) {
+            var oldData = null;
+            var keyValue = oRecord._oData[sKey];
+            // Copy data from the Record for the event that gets fired later
+            if(keyValue && keyValue.constructor == Object) {
+                oldData = {};
+                for(var key in keyValue) {
+                    oldData[key] = keyValue[key];
+                }
+            }
+            // Copy by value
+            else {
+                oldData = keyValue;
+            }
 
+            oRecord._oData[sKey] = oData;
+            this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+            this.fireEvent("recordValueUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+            YAHOO.log("Key \"" + sKey +
+                    "\" for Record at index " + this.getRecordIndex(oRecord) +
+                    " updated to \"" + YAHOO.lang.dump(oData) + "\"", "info", this.toString());
+        }
+        else {
+            YAHOO.log("Could not update key " + sKey + " for Record " + record, "error", this.toString());
+        }
+    },
 
+    /**
+     * Replaces all Records in RecordSet with new object literal data.
+     *
+     * @method replaceRecords
+     * @param data {Object || Object[]} An object literal of data or an array of
+     * data object literals.
+     * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
+     * an array of Records.
+     */
+    replaceRecords : function(data) {
+        this.reset();
+        return this.addRecords(data);
+    },
 
+    /**
+     * Sorts all Records by given function. Records keep their unique IDs but will
+     * have new RecordSet position indexes.
+     *
+     * @method sortRecords
+     * @param fnSort {Function} Reference to a sort function.
+     * @param desc {Boolean} True if sort direction is descending, false if sort
+     * direction is ascending.
+     * @return {YAHOO.widget.Record[]} Sorted array of Records.
+     */
+    sortRecords : function(fnSort, desc) {
+        return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
+    },
 
+    /**
+     * Reverses all Records, so ["one", "two", "three"] becomes ["three", "two", "one"].
+     *
+     * @method reverseRecords
+     * @return {YAHOO.widget.Record[]} Reverse-sorted array of Records.
+     */
+    reverseRecords : function() {
+        return this._records.reverse();
+    },
 
+    /**
+     * Removes the Record at the given position index from the RecordSet. If a range
+     * is also provided, removes that many Records, starting from the index. Length
+     * of RecordSet is correspondingly shortened.
+     *
+     * @method deleteRecord
+     * @param index {Number} Record's RecordSet position index.
+     * @param range {Number} (optional) How many Records to delete.
+     * @return {Object} A copy of the data held by the deleted Record.
+     */
+    deleteRecord : function(index) {
+        if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+            // Copy data from the Record for the event that gets fired later
+            var oRecordData = this.getRecord(index).getData();
+            var oData = {};
+            for(var key in oRecordData) {
+                oData[key] = oRecordData[key];
+            }
+            
+            this._deleteRecord(index);
+            this.fireEvent("recordDeleteEvent",{data:oData,index:index});
+            YAHOO.log("Record deleted at index " + index +
+                    " and containing data " + YAHOO.lang.dump(oData), "info", this.toString());
+            return oData;
+        }
+        else {
+            YAHOO.log("Could not delete Record at index " + index, "error", this.toString());
+            return null;
+        }
+    },
 
+    /**
+     * Removes the Record at the given position index from the RecordSet. If a range
+     * is also provided, removes that many Records, starting from the index. Length
+     * of RecordSet is correspondingly shortened.
+     *
+     * @method deleteRecords
+     * @param index {Number} Record's RecordSet position index.
+     * @param range {Number} (optional) How many Records to delete.
+     */
+    deleteRecords : function(index, range) {
+        if(!YAHOO.lang.isNumber(range)) {
+            range = 1;
+        }
+        if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+            var recordsToDelete = this.getRecords(index, range);
+            // Copy data from each Record for the event that gets fired later
+            var deletedData = [];
+            for(var i=0; i<recordsToDelete.length; i++) {
+                var oData = {};
+                for(var key in recordsToDelete[i]) {
+                    oData[key] = recordsToDelete[i][key];
+                }
+                deletedData.push(oData);
+            }
+            this._deleteRecord(index, range);
 
+            this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
+            YAHOO.log(range + "Record(s) deleted at index " + index +
+                    " and containing data " + YAHOO.lang.dump(deletedData), "info", this.toString());
 
+        }
+        else {
+            YAHOO.log("Could not delete Records at index " + index, "error", this.toString());
+        }
+    },
 
+    /**
+     * Deletes all Records from the RecordSet.
+     *
+     * @method reset
+     */
+    reset : function() {
+        this._records = [];
+        //this._length = 0;
+        this.fireEvent("resetEvent");
+        YAHOO.log("All Records deleted from RecordSet", "info", this.toString());
+    }
+};
 
-// DOM MUTATION FUNCTIONS
+YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
+/**
+ * The Record class defines a DataTable record.
+ *
+ * @namespace YAHOO.widget
+ * @class Record
+ * @constructor
+ * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ */
+YAHOO.widget.Record = function(oLiteral) {
+    this._sId = "yui-rec" + YAHOO.widget.Record._nCount;
+    YAHOO.widget.Record._nCount++;
+    this._oData = {};
+    if(oLiteral && (oLiteral.constructor == Object)) {
+        for(var sKey in oLiteral) {
+            this._oData[sKey] = oLiteral[sKey];
+        }
+    }
+};
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Adds a TR element to the primary TBODY at the page row index if given, otherwise
- * at the end of the page. Formats TD elements within the TR element using data
- * from the given Record.
+ * Internal class variable to give unique IDs to Record instances.
  *
- * @method _addTrEl
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param index {Number} (optional) The page row index at which to add the TR
- * element.
- * @return {String} ID of the added TR element, or null.
+ * @property Record._nCount
+ * @type Number
  * @private
  */
-YAHOO.widget.DataTable.prototype._addTrEl = function(oRecord, index) {
-    this.hideTableMessage();
-
-    // It's an append if no index provided, or index is negative or too big
-    var append = (!YAHOO.lang.isNumber(index) || (index < 0) ||
-            (index >= (this._elTbody.rows.length))) ? true : false;
-            
-    var oColumnSet = this._oColumnSet;
-    var oRecordSet = this._oRecordSet;
-    var isSortedBy = this.get("sortedBy");
-    var sortedColKeyIndex  = null;
-    var sortedDir, newClass;
-    if(isSortedBy) {
-        sortedColKeyIndex = (isSortedBy.column) ?
-                isSortedBy.column.getKeyIndex() :
-                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
-        sortedDir = isSortedBy.dir;
-        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
-                YAHOO.widget.DataTable.CLASS_ASC;
-
-    }
+YAHOO.widget.Record._nCount = 0;
 
+YAHOO.widget.Record.prototype = {
+    /**
+     * Immutable unique ID assigned at instantiation. Remains constant while a
+     * Record's position index can change from sorting.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
-    var elRow = (append) ? this._elTbody.appendChild(document.createElement("tr")) :
-        this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);
+    /**
+     * Holds data for the Record in an object literal.
+     *
+     * @property _oData
+     * @type Object
+     * @private
+     */
+    _oData : null,
 
-    elRow.id = this.id+"-bdrow"+this._nTrCount;
-    this._nTrCount++;
-    elRow.yuiRecordId = oRecord.getId();
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-    // Create TD cells
-    for(var j=0; j<oColumnSet.keys.length; j++) {
-        var oColumn = oColumnSet.keys[j];
-        var elCell = elRow.appendChild(document.createElement("td"));
-        elCell.id = elRow.id+"-cell"+j;
-        elCell.yuiColumnId = oColumn.getId();
-        elCell.headers = oColumnSet.headers[j];
-        // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
-        elCell.yuiCellIndex = j;
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-        // Update UI
-        this.formatCell(elCell, oRecord, oColumn);
+    /**
+     * Returns unique ID assigned at instantiation.
+     *
+     * @method getId
+     * @return String
+     */
+    getId : function() {
+        return this._sId;
+    },
 
-        // Set FIRST/LAST on TD
-        if (j === 0) {
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_FIRST);
-        }
-        else if (j === this._oColumnSet.keys.length-1) {
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_LAST);
+    /**
+     * Returns data for the Record for a key if given, or the entire object
+     * literal otherwise.
+     *
+     * @method getData
+     * @param sKey {String} (Optional) The key to retrieve a single data value.
+     * @return Object
+     */
+    getData : function(sKey) {
+        if(YAHOO.lang.isString(sKey)) {
+            return this._oData[sKey];
         }
-        
-        // Remove ASC/DESC
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
-        
-        // Set ASC/DESC on TD
-        if(j === sortedColKeyIndex) {
-            newClass = (sortedDir === "desc") ?
-                    YAHOO.widget.DataTable.CLASS_DESC :
-                    YAHOO.widget.DataTable.CLASS_ASC;
-            YAHOO.util.Dom.addClass(elCell, newClass);
+        else {
+            return this._oData;
         }
+    },
 
-
-        /*p.abx {word-wrap:break-word;}
-ought to solve the problem for Safari (the long words will wrap in your
-tds, instead of overflowing to the next td.
-(this is supported by IE win as well, so hide it if needed).
-
-One thing, though: it doesn't work in combination with
-'white-space:nowrap'.*/
-
-// need a div wrapper for safari?
-        //TODO: fix fixedWidth
-        if(this.fixedWidth) {
-            elCell.style.overflow = "hidden";
-            //elCell.style.width = "20px";
-        }
+    /**
+     * Sets given data at the given key. Use the RecordSet method setValue to trigger
+     * events. 
+     *
+     * @method setData
+     * @param sKey {String} The key of the new value.
+     * @param oData {MIXED} The new value.
+     */
+    setData : function(sKey, oData) {
+        this._oData[sKey] = oData;
     }
-
-    return elRow.id;
 };
 
 /**
- * Formats all TD elements of given TR element with data from the given Record.
+ * The Paginator widget provides a set of controls to navigate through paged
+ * data.
  *
- * @method _updateTrEl
- * @param elRow {HTMLElement} The TR element to update.
- * @param oRecord {YAHOO.widget.Record} The associated Record instance.
- * @return {String} ID of the updated TR element, or null.
- * @private
+ * @namespace YAHOO.widget
+ * @class Paginator
+ * @uses YAHOO.util.EventProvider
+ * @uses YAHOO.util.AttributeProvider
+ *
+ * @constructor
+ * @param config {Object} Object literal to set instance and ui component
+ * configuration.
  */
-YAHOO.widget.DataTable.prototype._updateTrEl = function(elRow, oRecord) {
-    this.hideTableMessage();
+YAHOO.widget.Paginator = function (config) {
+    var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+        lang      = YAHOO.lang,
+        attrib, initialPage, records, perPage;
 
-    var isSortedBy = this.get("sortedBy");
-    var sortedColKeyIndex  = null;
-    var sortedDir, newClass;
-    if(isSortedBy) {
-        sortedColKeyIndex = (isSortedBy.column) ?
-                isSortedBy.column.getKeyIndex() :
-                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
-        sortedDir = isSortedBy.dir;
-        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
-                YAHOO.widget.DataTable.CLASS_ASC;
-    }
+    config = lang.isObject(config) ? config : {};
 
-    // Update TD elements with new data
-    for(var j=0; j<elRow.cells.length; j++) {
-        var oColumn = this._oColumnSet.keys[j];
-        var elCell = elRow.cells[j];
-        this.formatCell(elCell, oRecord, oColumn);
+    this.initConfig();
 
-        // Remove ASC/DESC
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+    this.initEvents();
 
-        // Set ASC/DESC on TD
-        if(j === sortedColKeyIndex) {
-            YAHOO.util.Dom.addClass(elCell, newClass);
-        }
+    // Set the basic config keys first
+    this.set('rowsPerPage',config.rowsPerPage,true);
+    if (lang.isNumber(config.totalRecords)) {
+        this.set('totalRecords',config.totalRecords,true);
     }
-
-    // Update Record ID
-    elRow.yuiRecordId = oRecord.getId();
     
-    return elRow.id;
-};
-
+    this.initUIComponents();
 
-/**
- * Deletes TR element by DOM reference or by DataTable page row index.
- *
- * @method _deleteTrEl
- * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
- * @return {Boolean} Returns true if successful, else returns false.
- * @private
- */
-YAHOO.widget.DataTable.prototype._deleteTrEl = function(row) {
-    var rowIndex;
-    
-    // Get page row index for the element
-    if(!YAHOO.lang.isNumber(row)) {
-        rowIndex = YAHOO.util.Dom.get(row).sectionRowIndex;
-    }
-    else {
-        rowIndex = row;
-    }
-    if(YAHOO.lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
-        this._elTbody.deleteRow(rowIndex);
-        return true;
+    // Update the other config values
+    for (attrib in config) {
+        if (lang.hasOwnProperty(config,attrib)) {
+            this.set(attrib,config[attrib],true);
+        }
     }
-    else {
-        return false;
+
+    // Calculate the initial record offset
+    initialPage = this.get('initialPage');
+    records     = this.get('totalRecords');
+    perPage     = this.get('rowsPerPage');
+    if (initialPage > 1 && perPage !== UNLIMITED) {
+        var startIndex = (initialPage - 1) * perPage;
+        if (records === UNLIMITED || startIndex < records) {
+            this.set('recordOffset',startIndex,true);
+        }
     }
 };
 
 
+// Static members
+YAHOO.lang.augmentObject(YAHOO.widget.Paginator, {
+    /**
+     * Incrementing index used to give instances unique ids.
+     * @static
+     * @property id
+     * @type number
+     * @private
+     */
+    id : 0,
 
+    /**
+     * Base of id strings used for ui components.
+     * @static
+     * @property ID_BASE
+     * @type string
+     * @private
+     */
+    ID_BASE : 'yui-pg',
 
+    /**
+     * Used to identify unset, optional configurations, or used explicitly in
+     * the case of totalRecords to indicate unlimited pagination.
+     * @static
+     * @property VALUE_UNLIMITED
+     * @type number
+     * @final
+     */
+    VALUE_UNLIMITED : -1,
 
+    /**
+     * Default template used by Paginator instances.  Update this if you want
+     * all new Paginators to use a different default template.
+     * @static
+     * @property TEMPLATE_DEFAULT
+     * @type string
+     */
+    TEMPLATE_DEFAULT : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",
 
+    /**
+     * Common alternate pagination format, including page links, links for
+     * previous, next, first and last pages as well as a rows-per-page
+     * dropdown.  Offered as a convenience.
+     * @static
+     * @property TEMPLATE_ROWS_PER_PAGE
+     * @type string
+     */
+    TEMPLATE_ROWS_PER_PAGE : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
 
+},true);
 
 
+// Instance members and methods
+YAHOO.widget.Paginator.prototype = {
 
+    // Instance members
 
+    /**
+     * Array of nodes in which to render pagination controls.  This is set via
+     * the &quot;containers&quot; attribute.
+     * @property _containers
+     * @type Array(HTMLElement)
+     * @private
+     */
+    _containers : [],
 
 
 
 
+    // Instance methods
 
+    /**
+     * Initialize the Paginator's attributes (see YAHOO.util.Element class
+     * AttributeProvider).
+     * @method initConfig
+     * @private
+     */
+    initConfig : function () {
+
+        var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+            l         = YAHOO.lang;
+
+        /**
+         * REQUIRED. Number of records constituting a &quot;page&quot;
+         * @attribute rowsPerPage
+         * @type integer
+         */
+        this.setAttributeConfig('rowsPerPage', {
+            value     : 0,
+            validator : l.isNumber
+        });
 
+        /**
+         * REQUIRED. Node references or ids of nodes in which to render the
+         * pagination controls.
+         * @attribute containers
+         * @type {string|HTMLElement|Array(string|HTMLElement)}
+         */
+        this.setAttributeConfig('containers', {
+            value     : null,
+            writeOnce : true,
+            validator : function (val) {
+                if (!l.isArray(val)) {
+                    val = [val];
+                }
+                for (var i = 0, len = val.length; i < len; ++i) {
+                    if (l.isString(val[i]) || 
+                        (l.isObject(val[i]) && val[i].nodeType === 1)) {
+                        continue;
+                    }
+                    return false;
+                }
+                return true;
+            },
+            method : function (val) {
+                val = YAHOO.util.Dom.get(val);
+                if (!l.isArray(val)) {
+                    val = [val];
+                }
+                this._containers = val;
+            }
+        });
 
+        /**
+         * Total number of records to paginate through
+         * @attribute totalRecords
+         * @type integer
+         * @default Paginator.VALUE_UNLIMITED
+         */
+        this.setAttributeConfig('totalRecords', {
+            value     : UNLIMITED,
+            validator : l.isNumber
+        });
 
+        /**
+         * Zero based index of the record considered first on the current page.
+         * For page based interactions, don't modify this attribute directly;
+         * use setPage(n).
+         * @attribute recordOffset
+         * @type integer
+         * @default 0
+         */
+        this.setAttributeConfig('recordOffset', {
+            value     : 0,
+            validator : function (val) {
+                var total = this.get('totalRecords');
+                if (l.isNumber(val)) {
+                    return total === UNLIMITED || total > val;
+                }
 
+                return false;
+            }
+        });
 
+        /**
+         * Page to display on initial paint
+         * @attribute initialPage
+         * @type integer
+         * @default 1
+         */
+        this.setAttributeConfig('initialPage', {
+            value     : 1,
+            validator : l.isNumber
+        });
 
+        /**
+         * Template used to render controls.  The string will be used as
+         * innerHTML on all specified container nodes.  Bracketed keys
+         * (e.g. {pageLinks}) in the string will be replaced with an instance
+         * of the so named ui component.
+         * @see Paginator.TEMPLATE_DEFAULT
+         * @see Paginator.TEMPLATE_ROWS_PER_PAGE
+         * @attribute template
+         * @type string
+         */
+        this.setAttributeConfig('template', {
+            value : YAHOO.widget.Paginator.TEMPLATE_DEFAULT,
+            validator : l.isString
+        });
 
+        /**
+         * Class assigned to the element(s) containing pagination controls.
+         * @attribute containerClass
+         * @type string
+         * @default 'yui-pg-container'
+         */
+        this.setAttributeConfig('containerClass', {
+            value : 'yui-pg-container',
+            validator : l.isString
+        });
 
+        /**
+         * Display pagination controls even when there is only one page.  Set
+         * to false to forgo rendering and/or hide the containers when there
+         * is only one page of data.  Note if you are using the rowsPerPage
+         * dropdown ui component, visibility will be maintained as long as the
+         * number of records exceeds the smallest page size.
+         * @attribute alwaysVisible
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig('alwaysVisible', {
+            value : true,
+            validator : l.isBoolean
+        });
 
+        /**
+         * Update the UI immediately upon interaction.  If false, changeRequest
+         * subscribers or other external code will need to explicitly set the
+         * new values in the paginator to trigger repaint.
+         * @attribute updateOnChange
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig('updateOnChange', {
+            value     : false,
+            validator : l.isBoolean
+        });
 
-
-// CSS/STATE FUNCTIONS
 
 
+        // Read only attributes
 
+        /**
+         * Unique id assigned to this instance
+         * @attribute id
+         * @type integer
+         * @final
+         */
+        this.setAttributeConfig('id', {
+            value    : YAHOO.widget.Paginator.id++,
+            readOnly : true
+        });
 
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element
- * of the DataTable page and updates internal tracker.
- *
- * @method _setFirstRow
- * @private
- */
-YAHOO.widget.DataTable.prototype._setFirstRow = function() {
-    var rowEl = this.getFirstTrEl();
-    if(rowEl) {
-        // Remove FIRST
-        if(this._sFirstTrId) {
-            YAHOO.util.Dom.removeClass(this._sFirstTrId, YAHOO.widget.DataTable.CLASS_FIRST);
-        }
-        // Set FIRST
-        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_FIRST);
-        this._sFirstTrId = rowEl.id;
-    }
-    else {
-        this._sFirstTrId = null;
-    }
-};
+        /**
+         * Indicator of whether the DOM nodes have been initially created
+         * @attribute rendered
+         * @type boolean
+         * @final
+         */
+        this.setAttributeConfig('rendered', {
+            value    : false,
+            readOnly : true
+        });
 
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element
- * of the DataTable page and updates internal tracker.
- *
- * @method _setLastRow
- * @private
- */
-YAHOO.widget.DataTable.prototype._setLastRow = function() {
-    var rowEl = this.getLastTrEl();
-    if(rowEl) {
-        // Unassign previous class
-        if(this._sLastTrId) {
-            YAHOO.util.Dom.removeClass(this._sLastTrId, YAHOO.widget.DataTable.CLASS_LAST);
-        }
-        // Assign class
-        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_LAST);
-        this._sLastTrId = rowEl.id;
-    }
-    else {
-        this._sLastTrId = null;
-    }
-};
+    },
 
-/**
- * Assigns the classes YAHOO.widget.DataTable.CLASS_EVEN and
- * YAHOO.widget.DataTable.CLASS_ODD to alternating TR elements of the DataTable
- * page. For performance, a subset of rows may be specified.
- *
- * @method _setRowStripes
- * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
- * or string ID, or page row index of where to start striping.
- * @param range {Number} (optional) If given, how many rows to stripe, otherwise
- * stripe all the rows until the end.
- * @private
- */
-YAHOO.widget.DataTable.prototype._setRowStripes = function(row, range) {
-    // Default values stripe all rows
-    var allRows = this._elTbody.rows;
-    var nStartIndex = 0;
-    var nEndIndex = allRows.length;
-    
-    // Stripe a subset
-    if((row !== null) && (row !== undefined)) {
-        // Validate given start row
-        var elStartRow = this.getTrEl(row);
-        if(elStartRow) {
-            nStartIndex = elStartRow.sectionRowIndex;
-            
-            // Validate given range
-            if(YAHOO.lang.isNumber(range) && (range > 1)) {
-                nEndIndex = nStartIndex + range;
+    /**
+     * Initialize registered ui components onto this instance.
+     * @method initUIComponents
+     * @private
+     */
+    initUIComponents : function () {
+        var ui = YAHOO.widget.Paginator.ui;
+        for (var name in ui) {
+            var UIComp = ui[name];
+            if (YAHOO.lang.isObject(UIComp) &&
+                YAHOO.lang.isFunction(UIComp.init)) {
+                UIComp.init(this);
             }
         }
-    }
+    },
 
-    for(var i=nStartIndex; i<nEndIndex; i++) {
-        if(i%2) {
-            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
-            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+    /**
+     * Initialize this instance's CustomEvents.
+     * @method initEvents
+     * @private
+     */
+    initEvents : function () {
+        this.createEvent('recordOffsetChange');
+        this.createEvent('totalRecordsChange');
+        this.createEvent('rowsPerPageChange');
+        this.createEvent('alwaysVisibleChange');
+
+        this.createEvent('rendered');
+        this.createEvent('changeRequest');
+        this.createEvent('beforeDestroy');
+
+        // Listen for changes to totalRecords and alwaysVisible 
+        this.subscribe('totalRecordsChange',this.updateVisibility,this,true);
+        this.subscribe('alwaysVisibleChange',this.updateVisibility,this,true);
+    },
+
+    /**
+     * Render the pagination controls per the format attribute into the
+     * specified container nodes.
+     * @method render
+     */
+    render : function () {
+        if (this.get('rendered')) {
+            return;
         }
-        else {
-            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
-            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+
+        // Forgo rendering if only one page and alwaysVisible is off
+        var totalRecords = this.get('totalRecords');
+        if (totalRecords !== YAHOO.widget.Paginator.VALUE_UNLIMITED &&
+            totalRecords < this.get('rowsPerPage') &&
+            !this.get('alwaysVisible')) {
+            return;
         }
-    }
-};
 
+        var Dom            = YAHOO.util.Dom,
+            template       = this.get('template'),
+            containerClass = this.get('containerClass');
 
+        // add marker spans to the template html to indicate drop zones
+        // for ui components
+        template = template.replace(/\{([a-z0-9_ \-]+)\}/gi,
+            '<span class="yui-pg-ui $1"></span>');
+        for (var i = 0, len = this._containers.length; i < len; ++i) {
+            var c       = this._containers[i],
+                // ex. yui-pg0-1 (first paginator, second container)
+                id_base = YAHOO.widget.Paginator.ID_BASE + this.get('id') +
+                          '-' + i;
 
+            if (!c) {
+                continue;
+            }
+            // Hide the container while its contents are rendered
+            c.style.display = 'none';
+
+            Dom.addClass(c,containerClass);
 
+            // Place the template innerHTML
+            c.innerHTML = template;
 
+            // Replace each marker with the ui component's render() output
+            var markers = Dom.getElementsByClassName('yui-pg-ui','span',c);
 
+            for (var j = 0, jlen = markers.length; j < jlen; ++j) {
+                var m      = markers[j],
+                    mp     = m.parentNode,
+                    name   = m.className.replace(/\s*yui-pg-ui\s+/g,''),
+                    UIComp = YAHOO.widget.Paginator.ui[name];
 
+                if (YAHOO.lang.isFunction(UIComp)) {
+                    var comp = new UIComp(this);
+                    if (YAHOO.lang.isFunction(comp.render)) {
+                        mp.replaceChild(comp.render(id_base),m);
+                    }
+                }
+            }
 
+            // Show the container allowing page reflow
+            c.style.display = '';
+        }
 
+        // Set render attribute manually to support its readOnly contract
+        if (this._containers.length) {
+            this.setAttributeConfig('rendered',{value:true});
 
+            this.fireEvent('rendered',this.getState());
+        }
+    },
 
+    /**
+     * Removes controls from the page and unhooks events.
+     * @method destroy
+     */
+    destroy : function () {
+        this.fireEvent('beforeDestroy');
+        for (var i = 0, len = this._containers.length; i < len; ++i) {
+            this._containers[i].innerHTML = '';
+        }
+        this.setAttributeConfig('rendered',{value:false});
+    },
 
+    /**
+     * Hides the containers if there is only one page of data and attribute
+     * alwaysVisible is false.  Conversely, it displays the containers if either
+     * there is more than one page worth of data or alwaysVisible is turned on.
+     * @method updateVisibility
+     */
+    updateVisibility : function (e) {
+        var alwaysVisible = this.get('alwaysVisible');
+        if (e.type === 'alwaysVisibleChange' || !alwaysVisible) {
+            var totalRecords = this.get('totalRecords'),
+                visible = true,
+                rpp = this.get('rowsPerPage'),
+                rppOptions = this.get('rowsPerPageOptions'),
+                i,len;
+
+            if (YAHOO.lang.isArray(rppOptions)) {
+                for (i = 0, len = rppOptions.length; i < len; ++i) {
+                    rpp = Math.min(rpp,rppOptions[i]);
+                }
+            }
 
+            if (totalRecords !== YAHOO.widget.Paginator.VALUE_UNLIMITED &&
+                totalRecords <= rpp) {
+                visible = false;
+            }
 
+            visible = visible || alwaysVisible;
 
+            for (i = 0, len = this._containers.length; i < len; ++i) {
+                YAHOO.util.Dom.setStyle(this._containers[i],'display',
+                    visible ? '' : 'none');
+            }
+        }
+    },
 
 
 
 
+    /**
+     * Get the configured container nodes
+     * @method getContainerNodes
+     * @return {Array} array of HTMLElement nodes
+     */
+    getContainerNodes : function () {
+        return this._containers;
+    },
 
+    /**
+     * Get the total number of pages in the data set according to the current
+     * rowsPerPage and totalRecords values.  If totalRecords is not set, or
+     * set to YAHOO.widget.Paginator.VALUE_UNLIMITED, returns
+     * YAHOO.widget.Paginator.VALUE_UNLIMITED.
+     * @method getTotalPages
+     * @return {number}
+     */
+    getTotalPages : function () {
+        var records = this.get('totalRecords');
+        var perPage = this.get('rowsPerPage');
 
+        // rowsPerPage not set.  Can't calculate
+        if (!perPage) {
+            return null;
+        }
 
+        if (records === YAHOO.widget.Paginator.VALUE_UNLIMITED) {
+            return YAHOO.widget.Paginator.VALUE_UNLIMITED;
+        }
 
+        return Math.ceil(records/perPage);
+    },
 
+    /**
+     * Does the requested page have any records?
+     * @method hasPage
+     * @param page {number} the page in question
+     * @return {boolean}
+     */
+    hasPage : function (page) {
+        if (!YAHOO.lang.isNumber(page) || page < 1) {
+            return false;
+        }
 
+        var totalPages = this.getTotalPages();
 
+        return (totalPages === YAHOO.widget.Paginator.VALUE_UNLIMITED || totalPages >= page);
+    },
 
+    /**
+     * Get the page number corresponding to the current record offset.
+     * @method getCurrentPage
+     * @return {number}
+     */
+    getCurrentPage : function () {
+        var perPage = this.get('rowsPerPage');
+        if (!perPage) {
+            return null;
+        }
+        return Math.floor(this.get('recordOffset') / perPage) + 1;
+    },
 
+    /**
+     * Are there records on the next page?
+     * @method hasNextPage
+     * @return {boolean}
+     */
+    hasNextPage : function () {
+        var currentPage = this.getCurrentPage(),
+            totalPages  = this.getTotalPages();
 
+        if (currentPage === null) {
+            return false;
+        }
 
+        return (totalPages === YAHOO.widget.Paginator.VALUE_UNLIMITED ? true : currentPage < totalPages);
+    },
 
+    /**
+     * Get the page number of the next page, or null if the current page is the
+     * last page.
+     * @method getNextPage
+     * @return {number}
+     */
+    getNextPage : function () {
+        return this.hasNextPage() ? this.getCurrentPage() + 1 : null;
+    },
 
+    /**
+     * Is there a page before the current page?
+     * @method hasPreviousPage
+     * @return {boolean}
+     */
+    hasPreviousPage : function () {
+        return (this.getCurrentPage() > 1);
+    },
 
+    /**
+     * Get the page number of the previous page, or null if the current page
+     * is the first page.
+     * @method getPreviousPage
+     * @return {number}
+     */
+    getPreviousPage : function () {
+        return (this.hasPreviousPage() ? this.getCurrentPage() - 1 : 1);
+    },
 
+    /**
+     * Get the start and end record indexes of the specified page.
+     * @method getPageRecords
+     * @param page {number} (optional) The page (current page if not specified)
+     * @return {Array} [start_index, end_index]
+     */
+    getPageRecords : function (page) {
+        if (!YAHOO.lang.isNumber(page)) {
+            page = this.getCurrentPage();
+        }
 
+        var perPage = this.get('rowsPerPage'),
+            records = this.get('totalRecords'),
+            start, end;
 
+        if (!perPage) {
+            return null;
+        }
 
+        start = (page - 1) * perPage;
+        if (records !== YAHOO.widget.Paginator.VALUE_UNLIMITED) {
+            if (start >= records) {
+                return null;
+            }
+            end = Math.min(start + perPage, records) - 1;
+        } else {
+            end = start + perPage - 1;
+        }
 
+        return [start,end];
+    },
 
+    /**
+     * Set the current page to the provided page number if possible.
+     * @method setPage
+     * @param newPage {number} the new page number
+     * @param silent {boolean} whether to forcibly avoid firing the
+     * changeRequest event
+     */
+    setPage : function (page,silent) {
+        if (this.hasPage(page) && page !== this.getCurrentPage()) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('recordOffset', (page - 1) * this.get('rowsPerPage'));
+            } else {
+                this.fireEvent('changeRequest',this.getState({'page':page}));
+            }
+        }
+    },
 
+    /**
+     * Get the number of rows per page.
+     * @method getRowsPerPage
+     * @return {number} the current setting of the rowsPerPage attribute
+     */
+    getRowsPerPage : function () {
+        return this.get('rowsPerPage');
+    },
 
+    /**
+     * Set the number of rows per page.
+     * @method setRowsPerPage
+     * @param rpp {number} the new number of rows per page
+     * @param silent {boolean} whether to forcibly avoid firing the
+     * changeRequest event
+     */
+    setRowsPerPage : function (rpp,silent) {
+        if (YAHOO.lang.isNumber(rpp) && rpp > 0 &&
+            rpp !== this.get('rowsPerPage')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('rowsPerPage',rpp);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'rowsPerPage':rpp}));
+            }
+        }
+    },
 
+    /**
+     * Get the total number of records.
+     * @method getTotalRecords
+     * @return {number} the current setting of totalRecords attribute
+     */
+    getTotalRecords : function () {
+        return this.get('totalRecords');
+    },
 
+    /**
+     * Set the total number of records.
+     * @method setTotalRecords
+     * @param total {number} the new total number of records
+     * @param silent {boolean} whether to forcibly avoid firing the changeRequest event
+     */
+    setTotalRecords : function (total,silent) {
+        if (YAHOO.lang.isNumber(total) && total >= 0 &&
+            total !== this.get('totalRecords')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('totalRecords',total);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'totalRecords':total}));
+            }
+        }
+    },
 
+    /**
+     * Get the index of the first record on the current page
+     * @method getStartIndex
+     * @return {number} the index of the first record on the current page
+     */
+    getStartIndex : function () {
+        return this.get('recordOffset');
+    },
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private DOM Event Handlers
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Move the record offset to a new starting index.  This will likely cause
+     * the calculated current page to change.  You should probably use setPage.
+     * @method setStartIndex
+     * @param offset {number} the new record offset
+     * @param silent {boolean} whether to forcibly avoid firing the changeRequest event
+     */
+    setStartIndex : function (offset,silent) {
+        if (YAHOO.lang.isNumber(offset) && offset >= 0 &&
+            offset !== this.get('recordOffset')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('recordOffset',offset);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'recordOffset':offset}));
+            }
+        }
+    },
 
-/**
- * Handles scroll events on the CONTAINER (for IE) and TBODY elements (for everyone else).
- *
- * @method _onScroll
- * @param e {HTMLEvent} The scroll event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onScroll = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
-    
-    if(oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-        oSelf.cancelCellEditor();
-    }
+    /**
+     * Get an object literal describing the current state of the paginator.  If
+     * an object literal of proposed values is passed, the proposed state will
+     * be returned as an object literal with the following keys:
+     * <ul>
+     * <li>paginator - instance of the Paginator</li>
+     * <li>page - number</li>
+     * <li>totalRecords - number</li>
+     * <li>recordOffset - number</li>
+     * <li>rowsPerPage - number</li>
+     * <li>records - [ start_index, end_index ]</li>
+     * <li>before - (OPTIONAL) { state object literal for current state }</li>
+     * </ul>
+     * @method getState
+     * @return {object}
+     * @param changes {object} OPTIONAL object literal with proposed values
+     * Supported change keys include:
+     * <ul>
+     * <li>rowsPerPage</li>
+     * <li>totalRecords</li>
+     * <li>recordOffset OR</li>
+     * <li>page</li>
+     * </ul>
+     */
+    getState : function (changes) {
+        var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+            L         = YAHOO.lang;
+
+        var currentState = {
+            paginator    : this,
+            page         : this.getCurrentPage(),
+            totalRecords : this.get('totalRecords'),
+            recordOffset : this.get('recordOffset'),
+            rowsPerPage  : this.get('rowsPerPage'),
+            records      : this.getPageRecords()
+        };
 
-    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
-};
+        if (!changes) {
+            return currentState;
+        }
 
-/**
- * Handles click events on the DOCUMENT.
- *
- * @method _onDocumentClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onDocumentClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+        var newOffset = currentState.recordOffset;
+        var state = {
+            paginator    : this,
+            before       : currentState,
 
-    if(!YAHOO.util.Dom.isAncestor(oSelf._elTable, elTarget)) {
-        oSelf.fireEvent("tableBlurEvent");
+            rowsPerPage  : changes.rowsPerPage || currentState.rowsPerPage,
+            totalRecords : (L.isNumber(changes.totalRecords) ?
+                                Math.max(changes.totalRecords,UNLIMITED) :
+                                currentState.totalRecords)
+        };
 
-        // Fires editorBlurEvent when click is not within the TABLE.
-        // For cases when click is within the TABLE, due to timing issues,
-        // the editorBlurEvent needs to get fired by the lower-level DOM click
-        // handlers below rather than by the TABLE click handler directly.
-        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-            // Only if the click was not within the Cell Editor container
-            if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
-                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
-                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+        if (state.totalRecords === 0) {
+            newOffset  = 0;
+            state.page = 0;
+        } else {
+            if (!L.isNumber(changes.recordOffset) &&
+                 L.isNumber(changes.page)) {
+                newOffset = (changes.page - 1) * state.rowsPerPage;
+                if (state.totalRecords === UNLIMITED) {
+                    state.page = changes.page;
+                } else {
+                    // Limit values by totalRecords and rowsPerPage
+                    state.page = Math.min(
+                                    changes.page,
+                                    Math.ceil(state.totalRecords / state.rowsPerPage));
+                    newOffset  = Math.min(newOffset, state.totalRecords - 1);
+                }
+            } else {
+                newOffset  = Math.min(newOffset,state.totalRecords - 1);
+                state.page = Math.floor(newOffset/state.rowsPerPage) + 1;
             }
         }
+
+        // Jump offset to top of page
+        state.recordOffset = state.recordOffset ||
+                             newOffset - (newOffset % state.rowsPerPage);
+
+        state.records = [ state.recordOffset,
+                          state.recordOffset + state.rowsPerPage - 1 ];
+
+        if (state.totalRecords !== UNLIMITED &&
+            state.recordOffset < state.totalRecords &&
+            state.records[1] > state.totalRecords - 1) {
+            // limit upper index to totalRecords - 1
+            state.records[1] = state.totalRecords - 1;
+        }
+
+        return state;
     }
 };
 
+YAHOO.lang.augmentProto(YAHOO.widget.Paginator, YAHOO.util.AttributeProvider);
+
+
+
+
+
+
+// UI Components
+
+(function () {
+
+// UI Component namespace
+YAHOO.widget.Paginator.ui = {};
+
+var Paginator = YAHOO.widget.Paginator,
+    ui        = Paginator.ui,
+    l         = YAHOO.lang;
+
 /**
- * Handles keydown events on the DOCUMENT.
+ * ui Component to generate the link to jump to the first page.
  *
- * @method _onDocumentKeydown
- * @param e {HTMLEvent} The keydown event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class FirstPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onDocumentKeydown = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.FirstPageLink = function (p) {
+    this.paginator = p;
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive &&
-            YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget)) {
-        oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
-    }
+    p.createEvent('firstPageLinkLabelChange');
+    p.createEvent('firstPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('firstPageLinkLabelChange',this.update,this,true);
+    p.subscribe('firstPageLinkClassChange',this.update,this,true);
 };
 
 /**
- * Handles focus events on the TABLE element.
- *
- * @method _onTableFocus
- * @param e {HTMLEvent} The focus event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
-    oSelf.fireEvent("tableFocusEvent");
+ui.FirstPageLink.init = function (p) {
+
+    /**
+     * Used as innerHTML for the first page link/span.
+     * @attribute firstPageLinkLabel
+     * @default '&lt;&lt;&nbsp;first'
+     */
+    p.setAttributeConfig('firstPageLinkLabel', {
+        value : '&lt;&lt;&nbsp;first',
+        validator : l.isString
+    });
+
+    /**
+     * CSS class assigned to the link/span
+     * @attribute firstPageLinkClass
+     * @default 'yui-pg-first'
+     */
+    p.setAttributeConfig('firstPageLinkClass', {
+        value : 'yui-pg-first',
+        validator : l.isString
+    });
 };
 
-/**
- * Handles mouseover events on the TABLE element.
- *
- * @method _onTableMouseover
- * @param e {HTMLEvent} The mouseover event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+// Instance members and methods
+ui.FirstPageLink.prototype = {
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                 break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
+    /**
+     * The currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
+
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
+
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('firstPageLinkClass'),
+            label = p.get('firstPageLinkLabel');
+
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
+
+        this.link.id        = id_base + '-first-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-first-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.current = p.get('recordOffset') < 1 ? this.span : this.link;
+        return this.current;
+    },
+
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
         }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
+
+        var par = this.current ? this.current.parentNode : null;
+        if (this.paginator.get('recordOffset') < 1) {
+            if (par && this.current === this.link) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
+            }
+        } else {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
+            }
         }
+    },
+
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Pass new value to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(1);
     }
-    oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elTable),event:e});
 };
 
+
+
 /**
- * Handles mouseout events on the TABLE element.
+ * ui Component to generate the link to jump to the last page.
  *
- * @method _onTableMouseout
- * @param e {HTMLEvent} The mouseout event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class LastPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTableMouseout = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.LastPageLink = function (p) {
+    this.paginator = p;
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-    }
-    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elTable),event:e});
+    p.createEvent('lastPageLinkLabelChange');
+    p.createEvent('lastPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('lastPageLinkLabelChange',this.update,this,true);
+    p.subscribe('lastPageLinkClassChange', this.update,this,true);
 };
 
 /**
- * Handles mousedown events on the TABLE element.
- *
- * @method _onTableMousedown
- * @param e {HTMLEvent} The mousedown event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param paginator {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTableMousedown = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.LastPageLink.init = function (p) {
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
+    /**
+     * Used as innerHTML for the last page link/span.
+     * @attribute lastPageLinkLabel
+     * @default 'last&nbsp;&gt;&gt;'
+     */
+    p.setAttributeConfig('lastPageLinkLabel', {
+        value : 'last&nbsp;&gt;&gt;',
+        validator : l.isString
+    });
+
+    /**
+     * CSS class assigned to the link/span
+     * @attribute lastPageLinkClass
+     * @default 'yui-pg-last'
+     */
+    p.setAttributeConfig('lastPageLinkClass', {
+        value : 'yui-pg-last',
+        validator : l.isString
+    });
+};
+
+ui.LastPageLink.prototype = {
+
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
+
+    /**
+     * Link HTMLElement node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
+
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+    /**
+     * Empty place holder node for when the last page link is inappropriate to
+     * display in any form (unlimited paging).
+     * @property na
+     * @type HTMLElement
+     * @private
+     */
+    na        : null,
+
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('lastPageLinkClass'),
+            label = p.get('lastPageLinkLabel'),
+            last  = p.getTotalPages();
+
+        this.link = document.createElement('a');
+        this.span = document.createElement('span');
+        this.na   = this.span.cloneNode(false);
+
+        this.link.id        = id_base + '-last-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-last-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.na.id = id_base + '-last-na';
+
+        switch (last) {
+            case Paginator.VALUE_UNLIMITED :
+                    this.current = this.na; break;
+            case p.getCurrentPage() :
+                    this.current = this.span; break;
+            default :
+                    this.current = this.link;
         }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
+
+        return this.current;
+    },
+
+    /**
+     * Swap the link, span, and na nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event (ignored)
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
+
+        var par   = this.current ? this.current.parentNode : null,
+            after = this.link;
+
+        if (par) {
+            switch (this.paginator.getTotalPages()) {
+                case Paginator.VALUE_UNLIMITED :
+                        after = this.na; break;
+                case this.paginator.getCurrentPage() :
+                        after = this.span; break;
+            }
+
+            if (this.current !== after) {
+                par.replaceChild(after,this.current);
+                this.current = after;
+            }
         }
+    },
+
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getTotalPages());
     }
-    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elTable),event:e});
 };
 
+
 /**
- * Handles dblclick events on the TABLE element.
+ * ui Component to generate the link to jump to the previous page.
  *
- * @method _onTableDblclick
- * @param e {HTMLEvent} The dblclick event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class PreviousPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTableDblclick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.PreviousPageLink = function (p) {
+    this.paginator = p;
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "td":
-                oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-    }
-    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elTable),event:e});
+    p.createEvent('previousPageLinkLabelChange');
+    p.createEvent('previousPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('previousPageLinkLabelChange',this.update,this,true);
+    p.subscribe('previousPageLinkClassChange',this.update,this,true);
 };
 
 /**
- * Handles keydown events on the TABLE element. Handles arrow selection.
- *
- * @method _onTableKeydown
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTableKeydown = function(e, oSelf) {
-    var bSHIFT = e.shiftKey;
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    
-    // Ignore actions in the THEAD
-    if(YAHOO.util.Dom.isAncestor(oSelf._elThead, elTarget)) {
-        return;
-    }
-    
-    var nKey = YAHOO.util.Event.getCharCode(e);
-    
-    // TAB to first label link if any
-    if(nKey === 9 && !bSHIFT && (elTarget.id === oSelf._elTable.id)) {
-        if(oSelf._sFirstLabelLinkId) {
-            YAHOO.util.Event.stopEvent(e);
-            oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));
-        }
-        return;
-    }
+ui.PreviousPageLink.init = function (p) {
 
-    // Something is currently selected
-    var lastSelectedId = oSelf._sLastSelectedId;
-    var lastSelectedEl = YAHOO.util.Dom.get(lastSelectedId);
-    if(lastSelectedEl && oSelf.isSelected(lastSelectedEl)) {
-        //TODO: handle tab, backspace, delete
-        
-        // Handle arrow selection
-        if((nKey > 36) && (nKey < 41)) {
-            YAHOO.util.Event.stopEvent(e);
-        }
-        else {
-            return;
-        }
+    /**
+     * Used as innerHTML for the previous page link/span.
+     * @attribute previousPageLinkLabel
+     * @default '&lt;&nbsp;prev'
+     */
+    p.setAttributeConfig('previousPageLinkLabel', {
+        value : '&lt;&nbsp;prev',
+        validator : l.isString
+    });
 
-        var sMode = oSelf.get("selectionMode");
-        var allRows = oSelf._elTbody.rows;
-        var anchorId = oSelf._sSelectionAnchorId;
-        var anchorEl = YAHOO.util.Dom.get(anchorId);
-        var newSelectedEl, trIndex, tdIndex, startIndex, endIndex, i, anchorPos;
+    /**
+     * CSS class assigned to the link/span
+     * @attribute previousPageLinkClass
+     * @default 'yui-pg-previous'
+     */
+    p.setAttributeConfig('previousPageLinkClass', {
+        value : 'yui-pg-previous',
+        validator : l.isString
+    });
+};
 
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT cell block selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        if(bSHIFT && (sMode == "cellblock")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
+ui.PreviousPageLink.prototype = {
 
-            // Arrow DOWN
-            if(nKey == 40) {
-                // Is the anchor cell above, below, or same row
-                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
 
-                // Is the anchor cell left or right
-                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
-                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
 
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    // Select the horiz block on the next row
-                    if(trIndex < allRows.length-1) {
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[trIndex+1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the horiz block on this row towards the next row
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                }
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Is the anchor cell above, below, or same row
-                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
 
-                // Is the anchor cell left or right?
-                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
-                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
 
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    // Select the horiz block on the previous row
-                    if(trIndex > 0) {
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[trIndex-1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the horiz block on this row towards the previous row
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                }
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Is the anchor cell left, right, or same column
-                if(anchorEl.yuiCellIndex > tdIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.yuiCellIndex < tdIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('previousPageLinkClass'),
+            label = p.get('previousPageLinkLabel');
 
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    //Select the next vert block to the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[i].cells[tdIndex+1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the vert block on this column towards the right
-                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                }
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Is the anchor cell left, right, or same column
-                if(anchorEl.yuiCellIndex > tdIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.yuiCellIndex < tdIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
 
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    //Select the previous vert block to the left
-                    if(tdIndex > 0) {
-                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[i].cells[tdIndex-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the vert block on this column towards the left
-                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                }
-            }
+        this.link.id        = id_base + '-prev-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-prev-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.current = p.get('recordOffset') < 1 ? this.span : this.link;
+        return this.current;
+    },
+
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
         }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT cell range selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if(bSHIFT && (sMode == "cellrange")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
 
-            // Is the anchor cell above, below, or same row
-            if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                anchorPos = 1;
+        var par = this.current ? this.current.parentNode : null;
+        if (this.paginator.get('recordOffset') < 1) {
+            if (par && this.current === this.link) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
             }
-            else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                anchorPos = -1;
-            }
-            else {
-                anchorPos = 0;
+        } else {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
             }
+        }
+    },
 
-            // Arrow down
-            if(nKey == 40) {
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    // Select all cells to the end of this row
-                    for(i=tdIndex+1; i<allRows[trIndex].cells.length; i++){
-                        newSelectedEl = allRows[trIndex].cells[i];
-                        oSelf.selectCell(newSelectedEl);
-                    }
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
 
-                    // Select some of the cells on the next row down
-                    if(trIndex < allRows.length-1) {
-                        for(i=0; i<=tdIndex; i++){
-                            newSelectedEl = allRows[trIndex+1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect all cells to the end of this row
-                    for(i=tdIndex; i<allRows[trIndex].cells.length; i++){
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getPreviousPage());
+    }
+};
 
-                    // Unselect some of the cells on the next row down
-                    for(i=0; i<tdIndex; i++){
-                        oSelf.unselectCell(allRows[trIndex+1].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                }
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    // Select all the cells to the beginning of this row
-                    for(i=tdIndex-1; i>-1; i--){
-                        newSelectedEl = allRows[trIndex].cells[i];
-                        oSelf.selectCell(newSelectedEl);
-                    }
 
-                    // Select some of the cells from the end of the previous row
-                    if(trIndex > 0) {
-                        for(i=allRows[trIndex].cells.length-1; i>=tdIndex; i--){
-                            newSelectedEl = allRows[trIndex-1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect all the cells to the beginning of this row
-                    for(i=tdIndex; i>-1; i--){
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
 
-                    // Unselect some of the cells from the end of the previous row
-                    for(i=allRows[trIndex].cells.length-1; i>tdIndex; i--){
-                        oSelf.unselectCell(allRows[trIndex-1].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                }
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Selecting away from anchor cell
-                if(anchorPos < 0) {
-                    // Select the next cell to the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        newSelectedEl = allRows[trIndex].cells[tdIndex+1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                    // Select the first cell of the next row
-                    else if(trIndex < allRows.length-1) {
-                        newSelectedEl = allRows[trIndex+1].cells[0];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                }
-                // Unselecting towards anchor cell
-                else if(anchorPos > 0) {
-                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+/**
+ * ui Component to generate the link to jump to the next page.
+ *
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class NextPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
+ */
+ui.NextPageLink = function (p) {
+    this.paginator = p;
 
-                    // Unselect this cell towards the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                    // Unselect this cells towards the first cell of the next row
-                    else {
-                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[0].id;
-                    }
-                }
-                // Anchor is on this row
-                else {
-                    // Selecting away from anchor
-                    if(anchorEl.yuiCellIndex <= tdIndex) {
-                        // Select the next cell to the right
-                        if(tdIndex < allRows[trIndex].cells.length-1) {
-                            newSelectedEl = allRows[trIndex].cells[tdIndex+1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        // Select the first cell on the next row
-                        else if(trIndex < allRows.length-1){
-                            newSelectedEl = allRows[trIndex+1].cells[0];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                    // Unselecting towards anchor
-                    else {
-                        // Unselect this cell towards the right
-                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                }
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Unselecting towards the anchor
-                if(anchorPos < 0) {
-                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+    p.createEvent('nextPageLinkLabelChange');
+    p.createEvent('nextPageLinkClassChange');
 
-                    // Unselect this cell towards the left
-                    if(tdIndex > 0) {
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                    }
-                    // Unselect this cell towards the last cell of the previous row
-                    else {
-                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
-                    }
-                }
-                // Selecting towards the anchor
-                else if(anchorPos > 0) {
-                    // Select the next cell to the left
-                    if(tdIndex > 0) {
-                        newSelectedEl = allRows[trIndex].cells[tdIndex-1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                    // Select the last cell of the previous row
-                    else if(trIndex > 0){
-                        newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                }
-                // Anchor is on this row
-                else {
-                    // Selecting away from anchor cell
-                    if(anchorEl.yuiCellIndex >= tdIndex) {
-                        // Select the next cell to the left
-                        if(tdIndex > 0) {
-                            newSelectedEl = allRows[trIndex].cells[tdIndex-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        // Select the last cell of the previous row
-                        else if(trIndex > 0){
-                            newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                    // Unselecting towards anchor cell
-                    else {
-                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
 
-                        // Unselect this cell towards the left
-                        if(tdIndex > 0) {
-                            oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                        }
-                        // Unselect this cell towards the last cell of the previous row
-                        else {
-                            oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
-                        }
-                    }
-                }
-            }
-        }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // Simple single cell selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
+    // TODO: make this work
+    p.subscribe('nextPageLinkLabelChange', this.update,this,true);
+    p.subscribe('nextPageLinkClassChange', this.update,this,true);
+};
 
-            // Arrow down
-            if(nKey == 40) {
-                oSelf.unselectAllCells();
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.NextPageLink.init = function (p) {
 
-                // Select the next cell down
-                if(trIndex < allRows.length-1) {
-                    newSelectedEl = allRows[trIndex+1].cells[tdIndex];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the bottom cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+    /**
+     * Used as innerHTML for the next page link/span.
+     * @attribute nextPageLinkLabel
+     * @default 'next&nbsp;&gt;'
+     */
+    p.setAttributeConfig('nextPageLinkLabel', {
+        value : 'next&nbsp;&gt;',
+        validator : l.isString
+    });
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                oSelf.unselectAllCells();
+    /**
+     * CSS class assigned to the link/span
+     * @attribute nextPageLinkClass
+     * @default 'yui-pg-next'
+     */
+    p.setAttributeConfig('nextPageLinkClass', {
+        value : 'yui-pg-next',
+        validator : l.isString
+    });
+};
 
-                // Select the next cell up
-                if(trIndex > 0) {
-                    newSelectedEl = allRows[trIndex-1].cells[tdIndex];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the top cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+ui.NextPageLink.prototype = {
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                oSelf.unselectAllCells();
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
 
-                // Select the next cell to the right
-                if(tdIndex < lastSelectedEl.parentNode.cells.length-1) {
-                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex+1];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the right cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                oSelf.unselectAllCells();
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
 
-                // Select the next cell to the left
-                if(tdIndex > 0) {
-                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex-1];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the left cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-        }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT row selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if(bSHIFT && (sMode != "single")) {
-            trIndex = lastSelectedEl.sectionRowIndex;
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('nextPageLinkClass'),
+            label = p.get('nextPageLinkLabel'),
+            last  = p.getTotalPages();
 
-            if(anchorEl.sectionRowIndex > trIndex) {
-                anchorPos = 1;
-            }
-            else if(anchorEl.sectionRowIndex < trIndex) {
-                anchorPos = -1;
-            }
-            else {
-                anchorPos = 0;
-            }
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
 
-            // Arrow down
-            if(nKey == 40) {
-                // Selecting away from anchor row
-                if(anchorPos <= 0) {
-                    // Select the next row down
-                    if(trIndex < allRows.length-1) {
-                        oSelf.selectRow(trIndex+1);
-                    }
-                }
-                // Unselecting toward anchor row
-                else {
-                    // Unselect this row towards the anchor row down
-                    oSelf.unselectRow(lastSelectedEl);
-                    oSelf._sLastSelectedId = allRows[trIndex+1].id;
-                }
+        this.link.id        = id_base + '-next-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
 
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Selecting away from anchor row
-                if(anchorPos >= 0) {
-                    // Select the next row up
-                    if(trIndex > 0) {
-                        oSelf.selectRow(trIndex-1);
-                    }
-                }
-                // Unselect this row towards the anchor row up
-                else {
-                    oSelf.unselectRow(lastSelectedEl);
-                    oSelf._sLastSelectedId = allRows[trIndex-1].id;
-                }
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Do nothing
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Do nothing
-            }
-        }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // Simple single row selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else {
-            trIndex = lastSelectedEl.sectionRowIndex;
+        this.span.id        = id_base + '-next-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
 
-            // Arrow down
-            if(nKey == 40) {
-                oSelf.unselectAllRows();
+        this.current = p.getCurrentPage() === last ? this.span : this.link;
 
-                // Select the next row
-                if(trIndex < allRows.length-1) {
-                    newSelectedEl = allRows[trIndex+1];
-                    oSelf.selectRow(newSelectedEl);
-                }
-                // Select only the last row
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectRow(lastSelectedEl);
-                }
+        return this.current;
+    },
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                oSelf.unselectAllRows();
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
-                // Select the previous row
-                if(trIndex > 0) {
-                    newSelectedEl = allRows[trIndex-1];
-                    oSelf.selectRow(newSelectedEl);
-                }
-                // Select only the first row
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectRow(newSelectedEl);
-                }
+        var last = this.paginator.getTotalPages(),
+            par  = this.current ? this.current.parentNode : null;
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Do nothing
+        if (this.paginator.getCurrentPage() !== last) {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
             }
-            // Arrow left
-            else if(nKey == 37) {
-                // Do nothing
+        } else if (this.current === this.link) {
+            if (par) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
             }
         }
-    }
-};
+    },
 
-/**
- * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
- *
- * @method _onTableKeypress
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onTableKeypress = function(e, oSelf) {
-    var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
-    if(isMac) {
-        var nKey = YAHOO.util.Event.getCharCode(e);
-        // arrow down
-        if(nKey == 40) {
-            YAHOO.util.Event.stopEvent(e);
-        }
-        // arrow up
-        else if(nKey == 38) {
-            YAHOO.util.Event.stopEvent(e);
-        }
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getNextPage());
     }
 };
 
+
 /**
- * Handles click events on the THEAD element.
+ * ui Component to generate the page links
  *
- * @method _onTheadClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class PageLinks
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTheadClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.PageLinks = function (p) {
+    this.paginator = p;
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    p.createEvent('pageLinkClassChange');
+    p.createEvent('currentPageClassChange');
+    p.createEvent('pageLinksContainerClassChange');
+    p.createEvent('pageLinksChange');
 
-    while(elTarget && (elTag != "thead")) {
-            switch(elTag) {
-                case "body":
-                    break;
-                case "span":
-                    if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                        oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
-                    }
-                    break;
-                case "th":
-                    oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
-                    break;
-                case "tr":
-                    oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
-                    break;
-                default:
-                    break;
-            }
-            elTarget = elTarget.parentNode;
-            if(elTarget) {
-                elTag = elTarget.tagName.toLowerCase();
-            }
-    }
-    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('pageLinksChange',   this.rebuild,this,true);
+    p.subscribe('totalRecordsChange',this.rebuild,this,true);
+    p.subscribe('rowsPerPageChange', this.rebuild,this,true);
+    p.subscribe('pageLinkClassChange', this.rebuild,this,true);
+    p.subscribe('currentPageClassChange', this.rebuild,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    //TODO: Make this work
+    p.subscribe('pageLinksContainerClassChange', this.rebuild,this,true);
 };
 
 /**
- * Handles click events on the primary TBODY element.
- *
- * @method _onTbodyClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTbodyClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.PageLinks.init = function (p) {
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    /**
+     * CSS class assigned to each page link/span.
+     * @attribute pageLinkClass
+     * @default 'yui-pg-page'
+     */
+    p.setAttributeConfig('pageLinkClass', {
+        value : 'yui-pg-page',
+        validator : l.isString
+    });
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "input":
-                if(elTarget.type.toLowerCase() == "checkbox") {
-                    oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
-                }
-                else if(elTarget.type.toLowerCase() == "radio") {
-                    oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "a":
-                oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
-                break;
-            case "button":
-                oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
-                break;
-            case "td":
-                oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-    }
-    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
-};
-
-/*TODO: delete
- * Handles keyup events on the TBODY. Executes deletion.
- *
- * @method _onTbodyKeyup
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-/*YAHOO.widget.DataTable.prototype._onTbodyKeyup = function(e, oSelf) {
-   var nKey = YAHOO.util.Event.getCharCode(e);
-    // delete
-    if(nKey == 46) {//TODO: if something is selected
-        //TODO: delete row
-    }
-};*/
+    /**
+     * CSS class assigned to the current page span.
+     * @attribute currentPageClass
+     * @default 'yui-pg-current-page'
+     */
+    p.setAttributeConfig('currentPageClass', {
+        value : 'yui-pg-current-page',
+        validator : l.isString
+    });
 
-/**
- * Handles click events on paginator links.
- *
- * @method _onPaginatorLinkClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onPaginatorLinkClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+    /**
+     * CSS class assigned to the span containing the page links.
+     * @attribute pageLinksContainerClass
+     * @default 'yui-pg-pages'
+     */
+    p.setAttributeConfig('pageLinksContainerClass', {
+        value : 'yui-pg-pages',
+        validator : l.isString
+    });
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    /**
+     * Maximum number of page links to display at one time.
+     * @attribute pageLinks
+     * @default 10
+     */
+    p.setAttributeConfig('pageLinks', {
+        value : 10,
+        validator : l.isNumber
+    });
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                return;
-            case "a":
-                YAHOO.util.Event.stopEvent(e);
-                //TODO: after the showPage call, figure out which link
-                //TODO: was clicked and reset focus to the new version of it
-                switch(elTarget.className) {
-                    case YAHOO.widget.DataTable.CLASS_PAGE:
-                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_FIRST:
-                        oSelf.showPage(1);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_LAST:
-                        oSelf.showPage(oSelf.get("paginator").totalPages);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_PREVIOUS:
-                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_NEXT:
-                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
-                        return;
-                }
-                break;
-            default:
-                return;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-        else {
-            return;
-        }
-    }
+    /**
+     * Function used generate the innerHTML for each page link/span.  The
+     * function receives as parameters the page number and a reference to the
+     * paginator object.
+     * @attribute pageLabelBuilder
+     * @default function (page, paginator) { return page; }
+     */
+    p.setAttributeConfig('pageLabelBuilder', {
+        value : function (page, paginator) { return page; },
+        validator : l.isFunction
+    });
 };
 
 /**
- * Handles change events on paginator SELECT element.
- *
- * @method _onPaginatorDropdownChange
- * @param e {HTMLEvent} The change event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Calculates start and end page numbers given a current page, attempting
+ * to keep the current page in the middle
+ * @static
+ * @method calculateRange
+ * @param {int} currentPage  The current page
+ * @param {int} totalPages   (optional) Maximum number of pages
+ * @param {int} numPages     (optional) Preferred number of pages in range
+ * @return {Array} [start_page_number, end_page_number]
  */
-YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var newValue = elTarget[elTarget.selectedIndex].value;
+ui.PageLinks.calculateRange = function (currentPage,totalPages,numPages) {
+    var UNLIMITED = Paginator.VALUE_UNLIMITED,
+        start, end, delta;
 
-    var newRowsPerPage = YAHOO.lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
-    if(newRowsPerPage !== null) {
-        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
-        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
-        oSelf.refreshView();
+    if (!currentPage) {
+        return null;
     }
-    else {
-        YAHOO.log("Could not paginate with " + newValue + " rows per page", "error", oSelf.toString());
+
+    // Either has no pages, or unlimited pages.  Show none.
+    if (numPages === 0 || totalPages === 0 ||
+        (totalPages === UNLIMITED && numPages === UNLIMITED)) {
+        return [0,-1];
     }
-};
 
-/**
- * Handles change events on SELECT elements within DataTable.
- *
- * @method _onDropdownChange
- * @param e {HTMLEvent} The change event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onDropdownChange = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    //TODO: pass what args?
-    //var value = elTarget[elTarget.selectedIndex].value;
-    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
-};
+    // Limit requested pageLinks if there are fewer totalPages
+    if (totalPages !== UNLIMITED) {
+        numPages = numPages === UNLIMITED ?
+                    totalPages :
+                    Math.min(numPages,totalPages);
+    }
+
+    // Determine start and end, trying to keep current in the middle
+    start = Math.max(1,Math.ceil(currentPage - (numPages/2)));
+    if (totalPages === UNLIMITED) {
+        end = start + numPages - 1;
+    } else {
+        end = Math.min(totalPages, start + numPages - 1);
+    }
 
+    // Adjust the start index when approaching the last page
+    delta = numPages - (end - start + 1);
+    start = Math.max(1, start - delta);
 
+    return [start,end];
+};
 
 
+ui.PageLinks.prototype = {
 
+    /**
+     * Current page
+     * @property current
+     * @type number
+     * @private
+     */
+    current     : null,
 
+    /**
+     * Span node containing the page links
+     * @property container
+     * @type HTMLElement
+     * @private
+     */
+    container   : null,
 
 
+    /**
+     * Generate the nodes and return the container node containing page links
+     * appropriate to the current pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p = this.paginator;
 
+        // Set up container
+        this.container = document.createElement('span');
+        this.container.id        = id_base + '-pages';
+        this.container.className = p.get('pageLinksContainerClass');
+        YAHOO.util.Event.on(this.container,'click',this.onClick,this,true);
 
+        // Call update, flagging a need to rebuild
+        this.update({newValue : null, rebuild : true});
 
+        return this.container;
+    },
 
+    /**
+     * Update the links if appropriate
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
+        var p           = this.paginator,
+            currentPage = p.getCurrentPage();
+
+        // Replace content if there's been a change
+        if (this.current !== currentPage || e.rebuild) {
+            var labelBuilder = p.get('pageLabelBuilder'),
+                range        = ui.PageLinks.calculateRange(
+                                currentPage,
+                                p.getTotalPages(),
+                                p.get('pageLinks')),
+                start        = range[0],
+                end          = range[1],
+                content      = '',
+                linkTemplate,i;
+
+            linkTemplate = '<a href="#" class="' + p.get('pageLinkClass') +
+                           '" page="';
+            for (i = start; i <= end; ++i) {
+                if (i === currentPage) {
+                    content +=
+                        '<span class="' + p.get('currentPageClass') + ' ' +
+                                          p.get('pageLinkClass') + '">' +
+                        labelBuilder(i,p) + '</span>';
+                } else {
+                    content +=
+                        linkTemplate + i + '">' + labelBuilder(i,p) + '</a>';
+                }
+            }
 
+            this.container.innerHTML = content;
+        }
+    },
 
+    /**
+     * Force a rebuild of the page links.
+     * @method rebuild
+     * @param e {CustomEvent} The calling change event
+     */
+    rebuild     : function (e) {
+        e.rebuild = true;
+        this.update(e);
+    },
 
+    /**
+     * Removes the onClick listener from the container in preparation for
+     * content removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.container,true);
+    },
 
+    /**
+     * Listener for the container's onclick event.  Looks for qualifying link
+     * clicks, and pulls the page number from the link's page attribute.
+     * Sends link's page attribute to the Paginator's setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        var t = YAHOO.util.Event.getTarget(e);
+        if (t && YAHOO.util.Dom.hasClass(t,
+                        this.paginator.get('pageLinkClass'))) {
 
+            YAHOO.util.Event.stopEvent(e);
 
+            this.paginator.setPage(parseInt(t.getAttribute('page'),10));
+        }
+    }
 
+};
 
 
+/**
+ * ui Component to generate the rows-per-page dropdown
+ *
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class RowsPerPageDropdown
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
+ */
+ui.RowsPerPageDropdown = function (p) {
+    this.paginator = p;
 
+    p.createEvent('rowsPerPageOptionsChange');
+    p.createEvent('rowsPerPageDropdownClassChange');
 
+    p.subscribe('rowsPerPageChange',this.update,this,true);
+    p.subscribe('rowsPerPageOptionsChange',this.rebuild,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
 
+    // TODO: make this work
+    p.subscribe('rowsPerPageDropdownClassChange',this.rebuild,this,true);
+};
 
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.RowsPerPageDropdown.init = function (p) {
 
+    /**
+     * Array of available rows-per-page sizes.  Converted into select options.
+     * Array values may be positive integers or object literals in the form<br>
+     * { value : NUMBER, text : STRING }
+     * @attribute rowsPerPageOptions
+     * @default []
+     */
+    p.setAttributeConfig('rowsPerPageOptions', {
+        value : [],
+        validator : l.isArray
+    });
 
+    /**
+     * CSS class assigned to the select node
+     * @attribute rowsPerPageDropdownClass
+     * @default 'yui-pg-rpp-options'
+     */
+    p.setAttributeConfig('rowsPerPageDropdownClass', {
+        value : 'yui-pg-rpp-options',
+        validator : l.isString
+    });
+};
 
+ui.RowsPerPageDropdown.prototype = {
 
+    /**
+     * select node
+     * @property select
+     * @type HTMLElement
+     * @private
+     */
+    select  : null,
 
 
+    /**
+     * Generate the select and option nodes and returns the select node.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        this.select = document.createElement('select');
+        this.select.id        = id_base + '-rpp';
+        this.select.className = this.paginator.get('rowsPerPageDropdownClass');
+        this.select.title = 'Rows per page';
 
+        YAHOO.util.Event.on(this.select,'change',this.onChange,this,true);
 
+        this.rebuild();
 
+        return this.select;
+    },
 
+    /**
+     * Select the appropriate option if changed.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
+        var rpp     = this.paginator.get('rowsPerPage'),
+            options = this.select.options,
+            i,len;
 
+        for (i = 0, len = options.length; i < len; ++i) {
+            if (parseInt(options[i].value,10) === rpp) {
+                options[i].selected = true;
+            }
+        }
+    },
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * (Re)generate the select options.
+     * @method rebuild
+     */
+    rebuild : function (e) {
+        var p       = this.paginator,
+            sel     = this.select,
+            options = p.get('rowsPerPageOptions'),
+            opt_tem = document.createElement('option'),
+            i,len;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+        while (sel.firstChild) {
+            sel.removeChild(sel.firstChild);
+        }
 
-// OBJECT ACCESSORS
+        for (i = 0, len = options.length; i < len; ++i) {
+            var node = opt_tem.cloneNode(false),
+                opt  = options[i];
+            node.value = l.isValue(opt.value) ? opt.value : opt;
+            node.innerHTML = l.isValue(opt.text) ? opt.text : opt;
+            sel.appendChild(node);
+        }
 
-/**
- * Public accessor to the unique name of the DataSource instance.
- *
- * @method toString
- * @return {String} Unique name of the DataSource instance.
- */
+        this.update();
+    },
 
-YAHOO.widget.DataTable.prototype.toString = function() {
-    return "DataTable " + this._sName;
-};
+    /**
+     * Removes the onChange listener from the select in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.select);
+    },
 
-/**
- * Returns the DataTable instance's DataSource instance.
- *
- * @method getDataSource
- * @return {YAHOO.util.DataSource} DataSource instance.
- */
-YAHOO.widget.DataTable.prototype.getDataSource = function() {
-    return this._oDataSource;
+    /**
+     * Listener for the select's onchange event.  Sent to setRowsPerPage method.
+     * @method onChange
+     * @param e {DOMEvent} The change event
+     */
+    onChange : function (e) {
+        this.paginator.setRowsPerPage(
+                parseInt(this.select.options[this.select.selectedIndex].value,10));
+    }
 };
 
-/**
- * Returns the DataTable instance's ColumnSet instance.
- *
- * @method getColumnSet
- * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
- */
-YAHOO.widget.DataTable.prototype.getColumnSet = function() {
-    return this._oColumnSet;
-};
 
-/**
- * Returns the DataTable instance's RecordSet instance.
- *
- * @method getRecordSet
- * @return {YAHOO.widget.RecordSet} RecordSet instance.
- */
-YAHOO.widget.DataTable.prototype.getRecordSet = function() {
-    return this._oRecordSet;
-};
 
 /**
- * Returns the DataTable instance's Cell Editor as an object literal with the
- * following properties:
- * <dl>
- * <dt>cell</dt>
- * <dd>Cell element being edited</dd>
- *
- * <dt>column</dt>
- * <dd>Associated Column instance</dd>
- *
- * <dt>container</dt>
- * <dd>Reference to editor's container DIV element</dd>
- *
- * <dt>isActive</dt>
- * <dd>True if cell is currently being edited</dd>
- *
- * <dt>record</dt>
- * <dd>Associated Record instance</dd>
- *
- * <dt>validator</dt>
- * <dd>Associated validator function</dd>
- *
- * <dt>value</dt>
- * <dd>Current input value</dd>
- * </dl>
- *
+ * ui Component to generate the textual report of current pagination status.
+ * E.g. "Now viewing page 1 of 13".
  *
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class CurrentPageReport
+ * @for YAHOO.widget.Paginator
  *
- *
- *
- *
- * @method getCellEditor
- * @return {Object} Cell Editor object literal values.
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype.getCellEditor = function() {
-    return this._oCellEditor;
-};
-
+ui.CurrentPageReport = function (p) {
+    this.paginator = p;
 
+    p.createEvent('pageReportClassChange');
+    p.createEvent('pageReportTemplateChange');
 
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('pageReportTemplateChange', this.update,this,true);
 
+    //TODO: make this work
+    p.subscribe('pageReportClassChange', this.update,this,true);
+};
 
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.CurrentPageReport.init = function (p) {
 
+    /**
+     * CSS class assigned to the span containing the info.
+     * @attribute pageReportClass
+     * @default 'yui-pg-current'
+     */
+    p.setAttributeConfig('pageReportClass', {
+        value : 'yui-pg-current',
+        validator : l.isString
+    });
 
+    /**
+     * Used as innerHTML for the span.  Place holders in the form of {name}
+     * will be replaced with the so named value from the key:value map
+     * generated by the function held in the pageReportValueGenerator attribute.
+     * @attribute pageReportTemplate
+     * @default '({currentPage} of {totalPages})'
+     * @see pageReportValueGenerator attribute
+     */
+    p.setAttributeConfig('pageReportTemplate', {
+        value : '({currentPage} of {totalPages})',
+        validator : l.isString
+    });
 
+    /**
+     * Function to generate the value map used to populate the
+     * pageReportTemplate.  The function is passed the Paginator instance as a
+     * parameter.  The default function returns a map with the following keys:
+     * <ul>
+     * <li>currentPage</li>
+     * <li>totalPages</li>
+     * <li>startIndex</li>
+     * <li>endIndex</li>
+     * <li>startRecord</li>
+     * <li>endRecord</li>
+     * <li>totalRecords</li>
+     * </ul>
+     * @attribute pageReportValueGenarator
+     */
+    p.setAttributeConfig('pageReportValueGenerator', {
+        value : function (paginator) {
+            var curPage = paginator.getCurrentPage(),
+                records = paginator.getPageRecords(curPage);
+
+            return {
+                'currentPage' : curPage,
+                'totalPages'  : paginator.getTotalPages(),
+                'startIndex'  : records[0],
+                'endIndex'    : records[1],
+                'startRecord' : records[0] + 1,
+                'endRecord'   : records[1] + 1,
+                'totalRecords': paginator.get('totalRecords')
+            };
+        },
+        validator : l.isFunction
+    });
+};
 
+/**
+ * Replace place holders in a string with the named values found in an
+ * object literal.
+ * @static
+ * @method sprintf
+ * @param template {string} The content string containing place holders
+ * @param values {object} The key:value pairs used to replace the place holders
+ * @return {string}
+ */
+ui.CurrentPageReport.sprintf = function (template, values) {
+    return template.replace(/{([\w\s\-]+)}/g, function (x,key) {
+            return (key in values) ? values[key] : '';
+        });
+};
 
+ui.CurrentPageReport.prototype = {
 
+    /**
+     * Span node containing the formatted info
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span : null,
 
 
+    /**
+     * Generate the span containing info formatted per the pageReportTemplate
+     * attribute.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        this.span = document.createElement('span');
+        this.span.id        = id_base + '-page-report';
+        this.span.className = this.paginator.get('pageReportClass');
+        this.update();
+        
+        return this.span;
+    },
+    
+    /**
+     * Regenerate the content of the span if appropriate. Calls
+     * CurrentPageReport.sprintf with the value of the pageReportTemplate
+     * attribute and the value map returned from pageReportValueGenerator
+     * function.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
 
+        this.span.innerHTML = ui.CurrentPageReport.sprintf(
+            this.paginator.get('pageReportTemplate'),
+            this.paginator.get('pageReportValueGenerator')(this.paginator));
+    }
+};
 
+})();
 
+/**
+ * The DataTable widget provides a progressively enhanced DHTML control for
+ * displaying tabular data across A-grade browsers.
+ *
+ * @module datatable
+ * @requires yahoo, dom, event, element, datasource
+ * @optional connection, dragdrop
+ * @title DataTable Widget
+ * @beta
+ */
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
+/**
+ * DataTable class for the YUI DataTable widget.
+ *
+ * @namespace YAHOO.widget
+ * @class DataTable
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param elContainer {HTMLElement} Container element for the TABLE.
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param oConfigs {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
+    var DT = YAHOO.widget.DataTable,
+        DS = YAHOO.util.DataSource;
 
+    // Internal vars
+    this._nIndex = DT._nCount;
+    this._sId = "yui-dt"+this._nIndex;
+    this._oChain = new YAHOO.util.Chain();
 
+    // Initialize configs
+    this._initConfigs(oConfigs);
 
+    // Initialize DataSource
+    this._initDataSource(oDataSource);
+    if(!this._oDataSource) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid DataSource", "error", this.toString());
+        return;
+    }
 
+    // Initialize ColumnSet
+    this._initColumnSet(aColumnDefs);
+    if(!this._oColumnSet) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid ColumnSet", "error", this.toString());
+        return;
+    }
 
+    // Initialize RecordSet
+    this._initRecordSet();
+    if(!this._oRecordSet) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid RecordSet", "error", this.toString());
+        return;
+    }
 
+    // Initialize node templates
+    this._initNodeTemplates();
 
+    // Initialize container element
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid container element", "error", this.toString());
+        return;
+    }
 
+    // Initialize the rest of the DOM elements
+    this._initTableEl();
+    if(!this._elContainer || !this._elThead || !this._elTbody) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid DOM elements", "error", this.toString());
+        return;
+    }
 
+    // Call Element's constructor after DOM elements are created
+    // but *before* table is populated with data
+    DT.superclass.constructor.call(this, this._elContainer, this._oConfigs);
 
+    // HACK: Set sortedBy values for backward compatibility
+    var oSortedBy = this.get("sortedBy");
+    if(oSortedBy) {
+        if(oSortedBy.dir == "desc") {
+            this._configs.sortedBy.value.dir = DT.CLASS_DESC;
+        }
+        else if(oSortedBy.dir == "asc") {
+            this._configs.sortedBy.value.dir = DT.CLASS_ASC;
+        }
+    }
 
+    //HACK: Set the paginator values.  Attribute doesn't afford for merging
+    // obj value's keys.  It's all or nothing.  Merge in provided keys.
+    if(this._oConfigs.paginator && !(this._oConfigs.paginator instanceof YAHOO.widget.Paginator)) {
+        // Backward compatibility
+        this.updatePaginator(this._oConfigs.paginator);
+    }
 
+    // Initialize inline Cell editing
+    this._initCellEditorEl();
+    
+    // Initialize Column sort
+    this._initColumnSort();
 
+    // Once per instance
+    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
 
+    DT._nCount++;
+    DT._nCurrentCount++;
+    
+    // Send a simple initial request
+    var oCallback = {
+        success : this.onDataReturnSetRecords,
+        failure : this.onDataReturnSetRecords,
+        scope   : this,
+        argument: {}
+    };
+    if(this.get("initialLoad") === true) {
+        this._oDataSource.sendRequest(this.get("initialRequest"), oCallback);
+    }
+    // Do not send an initial request at all
+    else if(this.get("initialLoad") === false) {
+        this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId && this._bInit) {
+                    this._bInit = false;
+                    this.fireEvent("initEvent");
+                    YAHOO.log("DataTable initialized with no rows", "info", this.toString());
+                }
+            },
+            scope: this
+        });
+        this._oChain.run();
+    }
+    // Send an initial request with a custom payload
+    else {
+        var oCustom = this.get("initialLoad");
+        oCallback.argument = oCustom.argument;
+        this._oDataSource.sendRequest(oCustom.request, oCallback);
+    }
+};
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+(function () {
 
+var lang   = YAHOO.lang,
+    util   = YAHOO.util,
+    widget = YAHOO.widget,
+    ua     = YAHOO.env.ua,
+    
+    Dom    = util.Dom,
+    Ev     = util.Event,
+    DS     = util.DataSource,
+    DT     = widget.DataTable,
+    Pag    = widget.Paginator;
+    
 
+    
 
+lang.augmentObject(DT, {
 
+    /**
+     * Class name assigned to liner DIV elements.
+     *
+     * @property DataTable.CLASS_LINER
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-liner"
+     */
+    CLASS_LINER : "yui-dt-liner",
 
+    /**
+     * Class name assigned to display label elements.
+     *
+     * @property DataTable.CLASS_LABEL
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-label"
+     */
+    CLASS_LABEL : "yui-dt-label",
 
+    /**
+     * Class name assigned to Column drag target.
+     *
+     * @property DataTable.CLASS_COLTARGET
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-coltarget"
+     */
+    CLASS_COLTARGET : "yui-dt-coltarget",
 
+    /**
+     * Class name assigned to resizer handle elements.
+     *
+     * @property DataTable.CLASS_RESIZER
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizer"
+     */
+    CLASS_RESIZER : "yui-dt-resizer",
 
+    /**
+     * Class name assigned to resizer proxy elements.
+     *
+     * @property DataTable.CLASS_RESIZERPROXY
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizerproxy"
+     */
+    CLASS_RESIZERPROXY : "yui-dt-resizerproxy",
 
-// DOM ACCESSORS
+    /**
+     * Class name assigned to Editor container elements.
+     *
+     * @property DataTable.CLASS_EDITOR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-editor"
+     */
+    CLASS_EDITOR : "yui-dt-editor",
 
-/**
- * Returns DOM reference to the DataTable's TABLE element.
- *
- * @method getTableEl
- * @return {HTMLElement} Reference to TABLE element.
- */
-YAHOO.widget.DataTable.prototype.getTableEl = function() {
-    return this._elTable;
-};
+    /**
+     * Class name assigned to paginator container elements.
+     *
+     * @property DataTable.CLASS_PAGINATOR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-paginator"
+     */
+    CLASS_PAGINATOR : "yui-dt-paginator",
 
-/**
- * Returns DOM reference to the DataTable's THEAD element.
- *
- * @method getTheadEl
- * @return {HTMLElement} Reference to THEAD element.
- */
-YAHOO.widget.DataTable.prototype.getTheadEl = function() {
-    return this._elThead;
-};
+    /**
+     * Class name assigned to page number indicators.
+     *
+     * @property DataTable.CLASS_PAGE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-page"
+     */
+    CLASS_PAGE : "yui-dt-page",
 
-/**
- * Returns DOM reference to the DataTable's primary TBODY element.
- *
- * @method getTbodyEl
- * @return {HTMLElement} Reference to TBODY element.
- */
-YAHOO.widget.DataTable.prototype.getTbodyEl = function() {
-    return this._elTbody;
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.getBody = function() {
-    YAHOO.log("The method getBody() has been deprecated" +
-            " in favor of getTbodyEl()", "warn", this.toString());
-    return this.getTbodyEl();
-};
+    /**
+     * Class name assigned to default indicators.
+     *
+     * @property DataTable.CLASS_DEFAULT
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-default"
+     */
+    CLASS_DEFAULT : "yui-dt-default",
 
-/**
- * Returns DOM reference to the DataTable's secondary TBODY element that is
- * used to display messages.
- *
- * @method getMsgTbodyEl
- * @return {HTMLElement} Reference to TBODY element.
- */
-YAHOO.widget.DataTable.prototype.getMsgTbodyEl = function() {
-    return this._elMsgTbody;
-};
+    /**
+     * Class name assigned to previous indicators.
+     *
+     * @property DataTable.CLASS_PREVIOUS
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-previous"
+     */
+    CLASS_PREVIOUS : "yui-dt-previous",
 
-/**
- * Returns DOM reference to the TD element within the secondary TBODY that is
- * used to display messages.
- *
- * @method getMsgTdEl
- * @return {HTMLElement} Reference to TD element.
- */
-YAHOO.widget.DataTable.prototype.getMsgTdEl = function() {
-    return this._elMsgTd;
-};
+    /**
+     * Class name assigned next indicators.
+     *
+     * @property DataTable.CLASS_NEXT
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-next"
+     */
+    CLASS_NEXT : "yui-dt-next",
 
-/**
- * Returns the corresponding TR reference for a given DOM element, ID string or
- * directly page row index. If the given identifier is a child of a TR element,
- * then DOM tree is traversed until a parent TR element is returned, otherwise
- * null.
- *
- * @method getTrEl
- * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
- * get: by element reference, ID string, page row index, or Record.
- * @return {HTMLElement} Reference to TR element, or null.
- */
-YAHOO.widget.DataTable.prototype.getTrEl = function(row) {
-    var allRows = this._elTbody.rows;
-    
-    // By Record
-    if(row instanceof YAHOO.widget.Record) {
-        var nTrIndex = this.getTrIndex(row);
-        return allRows[nTrIndex];
-    }
-    // By page row index
-    else if(YAHOO.lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
-        return allRows[row];
-    }
-    // By ID string or element reference
-    else {
-        var elRow;
-        var el = YAHOO.util.Dom.get(row);
-        
-        // Validate HTML element
-        if(el && (el.ownerDocument == document)) {
-            // Validate TR element
-            if(el.tagName.toLowerCase() != "tr") {
-                // Traverse up the DOM to find the corresponding TR element
-                elRow = YAHOO.util.Dom.getAncestorByTagName(el,"tr");
-            }
-            else {
-                elRow = el;
-            }
+    /**
+     * Class name assigned to first elements.
+     *
+     * @property DataTable.CLASS_FIRST
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-first"
+     */
+    CLASS_FIRST : "yui-dt-first",
 
-            // Make sure the TR is in this TBODY
-            if(elRow && (elRow.parentNode == this._elTbody)) {
-                // Now we can return the TR element
-                return elRow;
-            }
-        }
-    }
-    
-    YAHOO.log("Could not get TR element for row " + row, "warn", this.toString());
-    return null;
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.getRow = function(index) {
-    YAHOO.log("The method getRow() has been deprecated" +
-            " in favor of getTrEl()", "warn", this.toString());
-    return this.getTrEl(index);
-};
+    /**
+     * Class name assigned to last elements.
+     *
+     * @property DataTable.CLASS_LAST
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-last"
+     */
+    CLASS_LAST : "yui-dt-last",
 
-/**
- * Returns DOM reference to the first TR element in the DataTable page, or null.
- *
- * @method getFirstTrEl
- * @return {HTMLElement} Reference to TR element.
- */
-YAHOO.widget.DataTable.prototype.getFirstTrEl = function() {
-    return this._elTbody.rows[0] || null;
-};
+    /**
+     * Class name assigned to even elements.
+     *
+     * @property DataTable.CLASS_EVEN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-even"
+     */
+    CLASS_EVEN : "yui-dt-even",
 
-/**
- * Returns DOM reference to the last TR element in the DataTable page, or null.
- *
- * @method getLastTrEl
- * @return {HTMLElement} Reference to last TR element.
- */
-YAHOO.widget.DataTable.prototype.getLastTrEl = function() {
-    var allRows = this._elTbody.rows;
-        if(allRows.length > 0) {
-            return allRows[allRows.length-1] || null;
-        }
-};
+    /**
+     * Class name assigned to odd elements.
+     *
+     * @property DataTable.CLASS_ODD
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-odd"
+     */
+    CLASS_ODD : "yui-dt-odd",
 
-/**
* Returns DOM reference to the given TD element.
- *
- * @method getTdEl
- * @param cell {HTMLElement | String} DOM element reference or string ID.
- * @return {HTMLElement} Reference to TD element.
- */
-YAHOO.widget.DataTable.prototype.getTdEl = function(cell) {
-    var elCell;
-    var el = YAHOO.util.Dom.get(cell);
+    /**
    * Class name assigned to selected elements.
    *
+     * @property DataTable.CLASS_SELECTED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-selected"
+     */
+    CLASS_SELECTED : "yui-dt-selected",
 
-    // Validate HTML element
-    if(el && (el.ownerDocument == document)) {
-        // Validate TD element
-        if(el.tagName.toLowerCase() != "td") {
-            // Traverse up the DOM to find the corresponding TR element
-            elCell = YAHOO.util.Dom.getAncestorByTagName(el, "td");
-        }
-        else {
-            elCell = el;
-        }
+    /**
+     * Class name assigned to highlighted elements.
+     *
+     * @property DataTable.CLASS_HIGHLIGHTED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-highlighted"
+     */
+    CLASS_HIGHLIGHTED : "yui-dt-highlighted",
 
-        // Make sure the TD is in this TBODY
-        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
-            // Now we can return the TD element
-            return elCell;
-        }
-    }
-    
-    YAHOO.log("Could not get TD element for cell " + cell, "warn", this.toString());
-    return null;
-};
+    /**
+     * Class name assigned to hidden elements.
+     *
+     * @property DataTable.CLASS_HIDDEN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-hidden"
+     */
+    CLASS_HIDDEN : "yui-dt-hidden",
 
-/**
- * Returns DOM reference to the TH element at given DataTable page coordinates, or null.
- *
- * @method getThEl
- * @param header {HTMLElement | String | YAHOO.widget.Column} DOM element
- * reference or string ID, or Column instance.
- * @return {HTMLElement} Reference to TH element.
- */
-YAHOO.widget.DataTable.prototype.getThEl = function(header) {
-    var elHeader;
-        
-    // Validate Column instance
-    if(header instanceof YAHOO.widget.Column) {
-        var oColumn = header;
-        elHeader = YAHOO.util.Dom.get(this.id + "-col" + oColumn.getId());
-        if(elHeader) {
-            return elHeader;
-        }
-    }
-    // Validate HTML element
-    else {
-        var el = YAHOO.util.Dom.get(header);
+    /**
+     * Class name assigned to disabled elements.
+     *
+     * @property DataTable.CLASS_DISABLED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-disabled"
+     */
+    CLASS_DISABLED : "yui-dt-disabled",
 
-        if(el && (el.ownerDocument == document)) {
-            // Validate TH element
-            if(el.tagName.toLowerCase() != "th") {
-                // Traverse up the DOM to find the corresponding TR element
-                elHeader = YAHOO.util.Dom.getAncestorByTagName(el,"th");
-            }
-            else {
-                elHeader = el;
-            }
+    /**
+     * Class name assigned to empty indicators.
+     *
+     * @property DataTable.CLASS_EMPTY
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-empty"
+     */
+    CLASS_EMPTY : "yui-dt-empty",
 
-            // Make sure the TH is in this THEAD
-            if(elHeader && (elHeader.parentNode.parentNode == this._elThead)) {
-                // Now we can return the TD element
-                return elHeader;
-            }
-        }
-    }
+    /**
+     * Class name assigned to loading indicatorx.
+     *
+     * @property DataTable.CLASS_LOADING
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-loading"
+     */
+    CLASS_LOADING : "yui-dt-loading",
 
-    YAHOO.log("Could not get TH element for header " + header, "warn", this.toString());
-    return null;
-};
+    /**
+     * Class name assigned to error indicators.
+     *
+     * @property DataTable.CLASS_ERROR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-error"
+     */
+    CLASS_ERROR : "yui-dt-error",
 
-/**
- * Returns the page row index of given row. Returns null if the row is not in
- * view on the current DataTable page.
- *
- * @method getTrIndex
- * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
- * string reference to an element within the DataTable page, a Record instance,
- * or a Record's RecordSet index.
- * @return {Number} Page row index, or null if row does not exist or is not in view.
- */
-YAHOO.widget.DataTable.prototype.getTrIndex = function(row) {
-    var nRecordIndex;
-    
-    // By Record
-    if(row instanceof YAHOO.widget.Record) {
-        nRecordIndex = this._oRecordSet.getRecordIndex(row);
-    }
-    // Calculate page row index from Record index
-    else if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
-    }
-    if(YAHOO.lang.isNumber(nRecordIndex)) {
-        // DataTable is paginated
-        if(this.get("paginated")) {
-            // Get the first and last Record on this page
-            var startRecordIndex = this.get("paginator").startRecordIndex;
-            var endRecordIndex = startRecordIndex + this.get("paginator").rowsPerPage - 1;
-            // This Record is in view
-            if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
-                return nRecordIndex - startRecordIndex;
-            }
-            // This Record is not in view
-            else {
-                return null;
-            }
-        }
-        // Not paginated, just return the Record index
-        else {
-            return nRecordIndex;
-        }
+    /**
+     * Class name assigned to editable elements.
+     *
+     * @property DataTable.CLASS_EDITABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-editable"
+     */
+    CLASS_EDITABLE : "yui-dt-editable",
 
-    }
-    // By element reference or ID string
-    else {
-        // Validate TR element
-        elRow = this.getTrEl(row);
-        if(elRow && (elRow.ownerDocument == document) &&
-                (elRow.parentNode == this._elTbody)) {
-            return elRow.sectionRowIndex;
-        }
-    }
-    
-    YAHOO.log("Could not get page row index for row " + row, "warn", this.toString());
-    return null;
-};
+    /**
+     * Class name assigned to draggable elements.
+     *
+     * @property DataTable.CLASS_DRAGGABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-draggable"
+     */
+    CLASS_DRAGGABLE : "yui-dt-draggable",
 
+    /**
+     * Class name assigned to resizeable elements.
+     *
+     * @property DataTable.CLASS_RESIZEABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizeable"
+     */
+    CLASS_RESIZEABLE : "yui-dt-resizeable",
 
+    /**
+     * Class name assigned to scrollable elements.
+     *
+     * @property DataTable.CLASS_SCROLLABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-scrollable"
+     */
+    CLASS_SCROLLABLE : "yui-dt-scrollable",
 
+    /**
+     * Class name assigned to sortable elements.
+     *
+     * @property DataTable.CLASS_SORTABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-sortable"
+     */
+    CLASS_SORTABLE : "yui-dt-sortable",
 
+    /**
+     * Class name assigned to ascending elements.
+     *
+     * @property DataTable.CLASS_ASC
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-asc"
+     */
+    CLASS_ASC : "yui-dt-asc",
 
+    /**
+     * Class name assigned to descending elements.
+     *
+     * @property DataTable.CLASS_DESC
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-desc"
+     */
+    CLASS_DESC : "yui-dt-desc",
 
+    /**
+     * Class name assigned to BUTTON elements and/or container elements.
+     *
+     * @property DataTable.CLASS_BUTTON
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-button"
+     */
+    CLASS_BUTTON : "yui-dt-button",
 
+    /**
+     * Class name assigned to INPUT TYPE=CHECKBOX elements and/or container elements.
+     *
+     * @property DataTable.CLASS_CHECKBOX
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-checkbox"
+     */
+    CLASS_CHECKBOX : "yui-dt-checkbox",
 
+    /**
+     * Class name assigned to SELECT elements and/or container elements.
+     *
+     * @property DataTable.CLASS_DROPDOWN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-dropdown"
+     */
+    CLASS_DROPDOWN : "yui-dt-dropdown",
 
+    /**
+     * Class name assigned to INPUT TYPE=RADIO elements and/or container elements.
+     *
+     * @property DataTable.CLASS_RADIO
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-radio"
+     */
+    CLASS_RADIO : "yui-dt-radio",
 
+    /**
+     * Message to display if DataTable has no data.
+     *
+     * @property DataTable.MSG_EMPTY
+     * @type String
+     * @static
+     * @final
+     * @default "No records found."
+     */
+    MSG_EMPTY : "No records found.",
 
+    /**
+     * Message to display while DataTable is loading data.
+     *
+     * @property DataTable.MSG_LOADING
+     * @type String
+     * @static
+     * @final
+     * @default "Loading data..."
+     */
+    MSG_LOADING : "Loading data...",
 
+    /**
+     * Message to display while DataTable has data error.
+     *
+     * @property DataTable.MSG_ERROR
+     * @type String
+     * @static
+     * @final
+     * @default "Data error."
+     */
+    MSG_ERROR : "Data error.",
 
+    /////////////////////////////////////////////////////////////////////////
+    //
+    // Private static variables
+    //
+    /////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Internal class variable for indexing multiple DataTable instances.
+     *
+     * @property DataTable._nCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCount : 0,
 
+    /**
+     * Internal class variable tracking current number of DataTable instances,
+     * so that certain class values can be reset when all instances are destroyed.          
+     *
+     * @property DataTable._nCurrentCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCurrentCount : 0,
 
+    /**
+     * Reference to STYLE node that is dynamically created and written to
+     * in order to manage Column widths.
+     *
+     * @property DataTable._elStylesheet
+     * @type HTMLElement
+     * @private
+     * @static     
+     */
+    _elStylesheet : null,
 
+    /**
+     * Set to true if _elStylesheet cannot be populated due to browser incompatibility.
+     *
+     * @property DataTable._bStylesheetFallback
+     * @type boolean
+     * @private
+     * @static     
+     */
+    _bStylesheetFallback : false,
 
+    /**
+     * Object literal hash of Columns and their dynamically create style rules.
+     *
+     * @property DataTable._oStylesheetRules
+     * @type Object
+     * @private
+     * @static     
+     */
+    _oStylesheetRules : {},
 
+    /**
+     * Element reference to shared Column drag target.
+     *
+     * @property DataTable._elColumnDragTarget
+     * @type HTMLElement
+     * @private
+     * @static 
+     */
+    _elColumnDragTarget : null,
 
+    /**
+     * Element reference to shared Column resizer proxy.
+     *
+     * @property DataTable._elColumnResizerProxy
+     * @type HTMLElement
+     * @private
+     * @static 
+     */
+    _elColumnResizerProxy : null,
 
+    /**
+     * Clones object literal or array of object literals.
+     *
+     * @method DataTable._cloneObject
+     * @param o {Object} Object.
+     * @private
+     * @static     
+     */
+    _cloneObject : function(o) {
+        if(lang.isUndefined(o)) {
+            return o;
+        }
+        
+        var copy = {};
+        
+        if(lang.isArray(o)) {
+            var array = [];
+            for(var i=0,len=o.length;i<len;i++) {
+                array[i] = DT._cloneObject(o[i]);
+            }
+            copy = array;
+        }
+        else if(o.constructor == Object) { 
+            for (var x in o){
+                if(lang.hasOwnProperty(o, x)) {
+                    if(lang.isValue(o[x]) && (o[x].constructor == Object) || lang.isArray(o[x])) {
+                        copy[x] = DT._cloneObject(o[x]);
+                    }
+                    else {
+                        copy[x] = o[x];
+                    }
+                }
+            }
+        }
+        else {
+            copy = o;
+        }
+    
+        return copy;
+    },
 
+    /**
+     * Creates HTML markup for shared Column drag target.
+     *
+     * @method DataTable._initColumnDragTargetEl
+     * @return {HTMLElement} Reference to Column drag target. 
+     * @private
+     * @static 
+     */
+    _initColumnDragTargetEl : function() {
+        if(!DT._elColumnDragTarget) {
+            // Attach Column drag target element as first child of body
+            var elColumnDragTarget = document.createElement('div');
+            elColumnDragTarget.id = "yui-dt-coltarget";
+            elColumnDragTarget.className = DT.CLASS_COLTARGET;
+            elColumnDragTarget.style.display = "none";
+            document.body.insertBefore(elColumnDragTarget, document.body.firstChild);
+
+            // Internal tracker of Column drag target
+            DT._elColumnDragTarget = elColumnDragTarget;
+            
+        }
+        return DT._elColumnDragTarget;
+    },
 
+    /**
+     * Creates HTML markup for shared Column resizer proxy.
+     *
+     * @method DataTable._initColumnResizerProxyEl
+     * @return {HTMLElement} Reference to Column resizer proxy.
+     * @private 
+     * @static 
+     */
+    _initColumnResizerProxyEl : function() {
+        if(!DT._elColumnResizerProxy) {
 
+            // Attach Column resizer element as first child of body
+            var elColumnResizerProxy = document.createElement("div");
+            elColumnResizerProxy.id = "yui-dt-colresizerproxy";
+            Dom.addClass(elColumnResizerProxy, DT.CLASS_RESIZERPROXY);
+            document.body.insertBefore(elColumnResizerProxy, document.body.firstChild);
 
+            // Internal tracker of Column resizer proxy
+            DT._elColumnResizerProxy = elColumnResizerProxy;
+        }
+        return DT._elColumnResizerProxy;
+    },
 
+    /**
+     * Outputs markup into the given TH based on given Column.
+     *
+     * @method DataTable.formatTheadCell
+     * @param elCellLabel {HTMLElement} The label DIV element within the TH liner.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oSelf {DT} DataTable instance.
+     * @static
+     */
+    formatTheadCell : function(elCellLabel, oColumn, oSelf) {
+        var sKey = oColumn.getKey();
+        var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey;
+
+        // Add accessibility link for sortable Columns
+        if(oColumn.sortable) {
+            // Calculate the direction
+            var sSortClass = oSelf.getColumnSortDir(oColumn);
+            var sSortDir = (sSortClass === DT.CLASS_DESC) ? "descending" : "ascending";
+
+            // Generate a unique HREF for visited status
+            var sHref = oSelf.getId() + "-sort" + oColumn.getId() + "-" + sSortDir;
+            
+            // Generate a dynamic TITLE for sort status
+            var sTitle = "Click to sort " + sSortDir;
+            
+            // Format the element
+            elCellLabel.innerHTML = "<a href=\"" + sHref + "\" title=\"" + sTitle + "\" class=\"" + DT.CLASS_SORTABLE + "\">" + sLabel + "</a>";
+        }
+        // Just display the label for non-sortable Columns
+        else {
+            elCellLabel.innerHTML = sLabel;
+        }
+    },
 
+    /**
+     * Formats a BUTTON element.
+     *
+     * @method DataTable.formatButton
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object | Boolean} Data value for the cell. By default, the value
+     * is what gets written to the BUTTON.
+     * @static
+     */
+    formatButton : function(el, oRecord, oColumn, oData) {
+        var sValue = lang.isValue(oData) ? oData : "Click";
+        //TODO: support YAHOO.widget.Button
+        //if(YAHOO.widget.Button) {
+
+        //}
+        //else {
+            el.innerHTML = "<button type=\"button\" class=\""+
+                    DT.CLASS_BUTTON + "\">" + sValue + "</button>";
+        //}
+    },
 
+    /**
+     * Formats a CHECKBOX element.
+     *
+     * @method DataTable.formatCheckbox
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object | Boolean} Data value for the cell. Can be a simple
+     * Boolean to indicate whether checkbox is checked or not. Can be object literal
+     * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
+     * formatter.
+     * @static
+     */
+    formatCheckbox : function(el, oRecord, oColumn, oData) {
+        var bChecked = oData;
+        bChecked = (bChecked) ? " checked" : "";
+        el.innerHTML = "<input type=\"checkbox\"" + bChecked +
+                " class=\"" + DT.CLASS_CHECKBOX + "\">";
+    },
 
+    /**
+     * Formats currency. Default unit is USD.
+     *
+     * @method DataTable.formatCurrency
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Number} Data value for the cell.
+     * @static
+     */
+    formatCurrency : function(el, oRecord, oColumn, oData) {
+        el.innerHTML = util.Number.format(oData, {
+                prefix:"$",
+                decimalPlaces:2,
+                decimalSeparator:".",
+                thousandsSeparator:","
+            });
+    },
 
+    /**
+     * Formats JavaScript Dates.
+     *
+     * @method DataTable.formatDate
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatDate : function(el, oRecord, oColumn, oData) {
+        el.innerHTML = util.Date.format(oData, {format:"MM/DD/YYYY"});
+    },
 
+    /**
+     * Formats SELECT elements.
+     *
+     * @method DataTable.formatDropdown
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatDropdown : function(el, oRecord, oColumn, oData) {
+        var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
+        var options = (lang.isArray(oColumn.dropdownOptions)) ?
+                oColumn.dropdownOptions : null;
+
+        var selectEl;
+        var collection = el.getElementsByTagName("select");
+
+        // Create the form element only once, so we can attach the onChange listener
+        if(collection.length === 0) {
+            // Create SELECT element
+            selectEl = document.createElement("select");
+            Dom.addClass(selectEl, DT.CLASS_DROPDOWN);
+            selectEl = el.appendChild(selectEl);
+
+            // Add event listener
+            Ev.addListener(selectEl,"change",this._onDropdownChange,this);
+        }
+
+        selectEl = collection[0];
+
+        // Update the form element
+        if(selectEl) {
+            // Clear out previous options
+            selectEl.innerHTML = "";
+
+            // We have options to populate
+            if(options) {
+                // Create OPTION elements
+                for(var i=0; i<options.length; i++) {
+                    var option = options[i];
+                    var optionEl = document.createElement("option");
+                    optionEl.value = (lang.isValue(option.value)) ?
+                            option.value : option;
+                    optionEl.innerHTML = (lang.isValue(option.text)) ?
+                            option.text : option;
+                    optionEl = selectEl.appendChild(optionEl);
+                }
+            }
+            // Selected value is our only option
+            else {
+                selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
+            }
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats emails.
+     *
+     * @method DataTable.formatEmail
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatEmail : function(el, oRecord, oColumn, oData) {
+        if(lang.isString(oData)) {
+            el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats links.
+     *
+     * @method DataTable.formatLink
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatLink : function(el, oRecord, oColumn, oData) {
+        if(lang.isString(oData)) {
+            el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats numbers.
+     *
+     * @method DataTable.formatNumber
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatNumber : function(el, oRecord, oColumn, oData) {
+        if(lang.isNumber(oData)) {
+            el.innerHTML = oData;
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats INPUT TYPE=RADIO elements.
+     *
+     * @method DataTable.formatRadio
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatRadio : function(el, oRecord, oColumn, oData) {
+        var bChecked = oData;
+        bChecked = (bChecked) ? " checked" : "";
+        el.innerHTML = "<input type=\"radio\"" + bChecked +
+                " name=\"col" + oColumn.getId() + "-radio\"" +
+                " class=\"" + DT.CLASS_RADIO+ "\">";
+    },
 
+    /**
+     * Formats text strings.
+     *
+     * @method DataTable.formatText
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatText : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        //TODO: move to util function
+        el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+    },
 
+    /**
+     * Formats TEXTAREA elements.
+     *
+     * @method DataTable.formatTextarea
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatTextarea : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        var markup = "<textarea>" + value + "</textarea>";
+        el.innerHTML = markup;
+    },
 
+    /**
+     * Formats INPUT TYPE=TEXT elements.
+     *
+     * @method DataTable.formatTextbox
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatTextbox : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        var markup = "<input type=\"text\" value=\"" + value + "\">";
+        el.innerHTML = markup;
+    },
 
+    /**
+     * Handles Pag changeRequest events for static DataSources
+     * (i.e. DataSources that return all data immediately)
+     * @method DataTable.handleSimplePagination
+     * @param {object} the requested state of the pagination
+     * @param {DataTable} the DataTable instance
+     * @static     
+     */
+    handleSimplePagination : function (oState,self) {
+        // Set the core pagination values silently (the second param)
+        // to avoid looping back through the changeRequest mechanism
+        oState.paginator.setTotalRecords(oState.totalRecords,true);
+        oState.paginator.setStartIndex(oState.recordOffset,true);
+        oState.paginator.setRowsPerPage(oState.rowsPerPage,true);
 
+        self.render();
+    },
 
+    /**
+     * Handles Pag changeRequest events for dynamic DataSources
+     * such as DataSource.TYPE_XHR or DataSource.TYPE_JSFUNCTION.
+     * @method DataTable.handleDataSourcePagination
+     * @param {object} the requested state of the pagination
+     * @param {DataTable} the DataTable instance
+     * @static     
+     */
+    handleDataSourcePagination : function (oState,self) {
+        var requestedRecords = oState.records[1] - oState.recordOffset;
+
+        if (self._oRecordSet.hasRecords(oState.recordOffset, requestedRecords)) {
+            DT.handleSimplePagination(oState,self);
+        } else {
+            // Translate the proposed page state into a DataSource request param
+            var generateRequest = self.get('generateRequest');
+            var request = generateRequest({ pagination : oState }, self);
+
+            var callback = {
+                success : self.onDataReturnSetRecords,
+                failure : self.onDataReturnSetRecords,
+                argument : {
+                    startIndex : oState.recordOffset,
+                    pagination : oState
+                },
+                scope : self
+            };
+
+            self._oDataSource.sendRequest(request, callback);
+        }
+    },
 
+    /**
+     * Enables CHECKBOX Editor.
+     *
+     * @method DataTable.editCheckbox
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    //DT.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) 
+    editCheckbox : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var aCheckedValues = oEditor.value;
+        if(!lang.isArray(aCheckedValues)) {
+            aCheckedValues = [aCheckedValues];
+        }
+
+        // Checkboxes
+        if(oColumn.editorOptions && lang.isArray(oColumn.editorOptions.checkboxOptions)) {
+            var checkboxOptions = oColumn.editorOptions.checkboxOptions;
+            var checkboxValue, checkboxId, elLabel, j, k;
+            // First create the checkbox buttons in an IE-friendly way
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxValue = lang.isValue(checkboxOptions[j].label) ?
+                        checkboxOptions[j].label : checkboxOptions[j];
+                checkboxId =  oSelf.getId() + "-editor-checkbox" + j;
+                elContainer.innerHTML += "<input type=\"checkbox\"" +
+                        " name=\"" + oSelf.getId() + "-editor-checkbox\"" +
+                        " value=\"" + checkboxValue + "\"" +
+                        " id=\"" +  checkboxId + "\">";
+                // Then create the labels in an IE-friendly way
+                elLabel = elContainer.appendChild(document.createElement("label"));
+                elLabel.htmlFor = checkboxId;
+                elLabel.innerHTML = checkboxValue;
+            }
+            var aCheckboxEls = [];
+            var checkboxEl;
+            // Loop through checkboxes to check them
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxEl = Dom.get(oSelf.getId() + "-editor-checkbox" + j);
+                aCheckboxEls.push(checkboxEl);
+                for(k=0; k<aCheckedValues.length; k++) {
+                    if(checkboxEl.value === aCheckedValues[k]) {
+                        checkboxEl.checked = true;
+                    }
+                }
+                // Focus the first checkbox
+                if(j===0) {
+                    oSelf._focusEl(checkboxEl);
+                }
+            }
+            // Loop through checkboxes to assign click handlers
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxEl = Dom.get(oSelf.getId() + "-editor-checkbox" + j);
+                Ev.addListener(checkboxEl, "click", function(){
+                    var aNewValues = [];
+                    for(var m=0; m<aCheckboxEls.length; m++) {
+                        if(aCheckboxEls[m].checked) {
+                            aNewValues.push(aCheckboxEls[m].value);
+                        }
+                    }
+                    oSelf._oCellEditor.value = aNewValues;
+                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+                });
+            }
+        }
+    },
 
+    /**
+     * Enables Date Editor.
+     *
+     * @method DataTable.editDate
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editDate : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+        
+        // Set a default
+        if(!(value instanceof Date)) {
+            value = oEditor.defaultValue || new Date();
+        }
+
+        // Calendar widget
+        if(YAHOO.widget.Calendar) {
+            var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
+            var calContainer = elContainer.appendChild(document.createElement("div"));
+            var calPrefix = oColumn.getColEl();
+            calContainer.id = calPrefix + "-dateContainer";
+            var calendar =
+                    new YAHOO.widget.Calendar(calPrefix + "-date",
+                    calContainer.id,
+                    {selected:selectedValue, pagedate:value});
+            calendar.render();
+            calContainer.style.cssFloat = "none";
+
+            if(ua.ie == 6) {
+                var calFloatClearer = elContainer.appendChild(document.createElement("br"));
+                calFloatClearer.style.clear = "both";
+            }
 
+            calendar.selectEvent.subscribe(function(type, args, obj) {
+                oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+        else {
+            //TODO;
+        }
+    },
 
+    /**
+     * Enables SELECT Editor.
+     *
+     * @method DataTable.editDropdown
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editDropdown : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+        
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue;
+        }
 
-// TABLE FUNCTIONS
-
-/**
- * Resets a RecordSet with the given data and populates the page view
- * with the new data. Any previous data and selection states are cleared.
- * However, sort states are not cleared, so if the given data is in a particular
- * sort order, implementers should take care to reset the sortedBy property. If
- * pagination is enabled, the currentPage is shown and Paginator UI updated,
- * otherwise all rows are displayed as a single page. For performance, existing
- * DOM elements are reused when possible.
- *
- * @method initializeTable
- * @param oData {Object | Object[]} An object literal of data or an array of
- * object literals containing data.
- */
-YAHOO.widget.DataTable.prototype.initializeTable = function(oData) {
-    // Clear the RecordSet
-    this._oRecordSet.reset();
-
-    // Add data to RecordSet
-    var records = this._oRecordSet.addRecords(oData);
 
-    // Clear selections
-    this._unselectAllTrEls();
-    this._unselectAllTdEls();
-    this._aSelections = null;
-    this._sLastSelectedId = null;
-    this._sSelectionAnchorId = null;
+        // Textbox
+        var elDropdown = elContainer.appendChild(document.createElement("select"));
+        var dropdownOptions = (oColumn.editorOptions && lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
+                oColumn.editorOptions.dropdownOptions : [];
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var elOption = document.createElement("option");
+            elOption.value = (lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            elOption.innerHTML = (lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            elOption = elDropdown.appendChild(elOption);
+            if(value === elDropdown.options[j].value) {
+                elDropdown.options[j].selected = true;
+            }
+        }
 
-    // Refresh the view
-    this.refreshView();
-    this.fireEvent("initEvent");
-};
+        // Set up a listener on each check box to track the input value
+        Ev.addListener(elDropdown, "change",
+            function(){
+                oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
-/**
- * Refreshes the view with existing Records from the RecordSet while
- * maintaining sort, pagination, and selection states. For performance, reuses
- * existing DOM elements when possible while deleting extraneous elements.
- *
- * @method refreshView
- */
-YAHOO.widget.DataTable.prototype.refreshView = function() {
-    var i, j, k, l, aRecords;
-    var oPaginator = this.updatePaginator();
+        // Focus the dropdown
+        oSelf._focusEl(elDropdown);
+    },
 
-    // Paginator is enabled, show a subset of Records and update Paginator UI
-    if(this.get("paginated")) {
-        var rowsPerPage = oPaginator.rowsPerPage;
-        var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
-        aRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
-        this.formatPaginators();
-    }
-    // Show all records
-    else {
-        aRecords = this._oRecordSet.getRecords();
-    }
+    /**
+     * Enables INPUT TYPE=RADIO Editor.
+     *
+     * @method DataTable.editRadio
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editRadio : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue;
+        }
+
+        // Radios
+        if(oColumn.editorOptions && lang.isArray(oColumn.editorOptions.radioOptions)) {
+            var radioOptions = oColumn.editorOptions.radioOptions;
+            var radioValue, radioId, elLabel, j;
+            // First create the radio buttons in an IE-friendly way
+            for(j=0; j<radioOptions.length; j++) {
+                radioValue = lang.isValue(radioOptions[j].label) ?
+                        radioOptions[j].label : radioOptions[j];
+                radioId =  oSelf.getId() + "-col" + oColumn.getId() + "-radioeditor" + j;
+                elContainer.innerHTML += "<input type=\"radio\"" +
+                        " name=\"" + oSelf.getId() + "-editor-radio\"" +
+                        " value=\"" + radioValue + "\"" +
+                        " id=\"" +  radioId + "\">";
+                // Then create the labels in an IE-friendly way
+                elLabel = elContainer.appendChild(document.createElement("label"));
+                elLabel.htmlFor = radioId;
+                elLabel.innerHTML = radioValue;
+            }
+            // Then check one, and assign click handlers
+            for(j=0; j<radioOptions.length; j++) {
+                var radioEl = Dom.get(oSelf.getId() + "-col" + oColumn.getId() + "-radioeditor" + j);
+                if(value === radioEl.value) {
+                    radioEl.checked = true;
+                    oSelf._focusEl(radioEl);
+                }
+                Ev.addListener(radioEl, "click",
+                    function(){
+                        oSelf._oCellEditor.value = this.value;
+                        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+                });
+            }
+        }
+    },
 
-    var elTbody = this._elTbody;
-    var elRows = elTbody.rows;
+    /**
+     * Enables TEXTAREA Editor.
+     *
+     * @method DataTable.editTextarea
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editTextarea : function(oEditor, oSelf) {
+       var elCell = oEditor.cell;
+       var oRecord = oEditor.record;
+       var oColumn = oEditor.column;
+       var elContainer = oEditor.container;
+       var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue || "";
+        }
+
+        // Textarea
+        var elTextarea = elContainer.appendChild(document.createElement("textarea"));
+        elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+        elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+        elTextarea.value = value;
+
+        // Set up a listener on each check box to track the input value
+        Ev.addListener(elTextarea, "keyup", function(){
+            //TODO: set on a timeout
+            oSelf._oCellEditor.value = elTextarea.value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
-    // Has rows
-    if(YAHOO.lang.isArray(aRecords) && (aRecords.length > 0)) {
-        this.hideTableMessage();
+        // Select the text
+        elTextarea.focus();
+        elTextarea.select();
+    },
 
-        // Keep track of selected rows
-        var aSelectedRows = this.getSelectedRows();
-        // Keep track of selected cells
-        var aSelectedCells = this.getSelectedCells();
-        // Anything to reinstate?
-        var bReselect = (aSelectedRows.length>0) || (aSelectedCells.length > 0);
+    /**
+     * Enables INPUT TYPE=TEXT Editor.
+     *
+     * @method DataTable.editTextbox
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editTextbox : function(oEditor, oSelf) {
+       var elCell = oEditor.cell;
+       var oRecord = oEditor.record;
+       var oColumn = oEditor.column;
+       var elContainer = oEditor.container;
+       var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue || "";
+        }
+
+        // Textbox
+        var elTextbox = elContainer.appendChild(document.createElement("input"));
+        elTextbox.type = "text";
+        elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+        //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+        elTextbox.value = value;
+
+        // Set up a listener on each textbox to track the input value
+        Ev.addListener(elTextbox, "keyup", function(){
+            //TODO: set on a timeout
+            oSelf._oCellEditor.value = elTextbox.value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
-        // Remove extra rows from the bottom so as to preserve ID order
-        while(elTbody.hasChildNodes() && (elRows.length > aRecords.length)) {
-            elTbody.deleteRow(-1);
-        }
+        // Select the text
+        elTextbox.focus();
+        elTextbox.select();
+    },
 
-        // Unselect all TR and TD elements in the UI
-        if(bReselect) {
-            this._unselectAllTrEls();
-            this._unselectAllTdEls();
-        }
+    /**
+     * Validates Editor input value to type Number, doing type conversion as
+     * necessary. A valid Number value is return, else the previous value is returned
+     * if input value does not validate.
+     *
+     *
+     * @method DataTable.validateNumber
+     * @param oData {Object} Data to validate.
+     * @static
+    */
+    validateNumber : function(oData) {
+        //Convert to number
+        var number = oData * 1;
 
-        // From the top, update in-place existing rows
-        for(i=0; i<elRows.length; i++) {
-            this._updateTrEl(elRows[i], aRecords[i]);
+        // Validate
+        if(lang.isNumber(number)) {
+            return number;
         }
-
-        // Add TR elements as necessary
-        for(i=elRows.length; i<aRecords.length; i++) {
-            this._addTrEl(aRecords[i]);
+        else {
+            YAHOO.log("Could not validate data " + lang.dump(oData) + " to type Number", "warn", this.toString());
+            return null;
         }
+    },
 
-        // Reinstate selected and sorted classes
-        var allRows = elTbody.rows;
-        if(bReselect) {
-            // Loop over each row
-            for(j=0; j<allRows.length; j++) {
-                var thisRow = allRows[j];
-                var sMode = this.get("selectionMode");
-                if ((sMode == "standard") || (sMode == "single")) {
-                    // Set SELECTED
-                    for(k=0; k<aSelectedRows.length; k++) {
-                        if(aSelectedRows[k] === thisRow.yuiRecordId) {
-                            YAHOO.util.Dom.addClass(thisRow, YAHOO.widget.DataTable.CLASS_SELECTED);
-                            if(j === allRows.length-1) {
-                                this._sLastSelectedId = thisRow.id;
-                                this._sSelectionAnchorId = thisRow.id;
-                            }
-                        }
-                    }
-                }
-                else {
-                    // Loop over each cell
-                    for(k=0; k<thisRow.cells.length; k++) {
-                        var thisCell = thisRow.cells[k];
-                        // Set SELECTED
-                        for(l=0; l<aSelectedCells.length; l++) {
-                            if((aSelectedCells[l].recordId === thisRow.yuiRecordId) &&
-                                    (aSelectedCells[l].columnId === thisCell.yuiColumnId)) {
-                                YAHOO.util.Dom.addClass(thisCell, YAHOO.widget.DataTable.CLASS_SELECTED);
-                                if(k === thisRow.cells.length-1) {
-                                    this._sLastSelectedId = thisCell.id;
-                                    this._sSelectionAnchorId = thisCell.id;
-                                }
-                            }
-                        }
-                    }
-                }
+    /**
+     * Translates (proposed) DataTable state data into a form consumable by
+     * DataSource sendRequest as the request parameter.  Use
+     * set('generateParameter', yourFunc) to use a custom function rather than this
+     * one.
+     * @method DataTable._generateRequest
+     * @param oData {Object} Object literal defining the current or proposed state
+     * @param oDataTable {DataTable} Reference to the DataTable instance
+     * @returns {MIXED} Returns appropriate value based on DataSource type
+     * @private
+     * @static     
+     */
+    _generateRequest : function (oData, oDataTable) {
+        var request = oData;
+
+        if (oData.pagination) {
+            if (oDataTable._oDataSource.dataType === DS.TYPE_XHR) {
+                request = '?page=' +         oData.pagination.page +
+                          '&recordOffset=' + oData.pagination.recordOffset +
+                          '&rowsPerPage=' +  oData.pagination.rowsPerPage;
             }
         }
         
-        // Set FIRST/LAST, EVEN/ODD
-        this._setFirstRow();
-        this._setLastRow();
-        this._setRowStripes();
-
-        this.fireEvent("refreshEvent");
-        YAHOO.log("DataTable showing " + aRecords.length + " of " + this._oRecordSet.getLength() + " rows", "info", this.toString());
-    }
-    // Empty
-    else {
-        // Remove all rows
-        while(elTbody.hasChildNodes()) {
-            elTbody.deleteRow(-1);
-        }
-
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+        return request;
     }
-};
+});
 
+// Do in separate step so referenced properties are available
+// TODO: editor shortcuts
 /**
- * Nulls out the entire DataTable instance and related objects, removes attached
- * event listeners, and clears out DOM elements inside the container. After
- * calling this method, the instance reference should be expliclitly nulled by
- * implementer, as in myDataTable = null. Use with caution!
- *
- * @method destroy
+ * Cell formatting functions.
+ * @property DataTable.Formatter
+ * @type Object
+ * @static
  */
-YAHOO.widget.DataTable.prototype.destroy = function() {
-    // Destroy Cell Editor
-    YAHOO.util.Event.purgeElement(this._oCellEditor.container, true);
-    document.body.removeChild(this._oCellEditor.container);
-    
-    var instanceName = this.toString();
-    var elContainer = this._elContainer;
-
-    // Unhook custom events
-    this._oRecordSet.unsubscribeAll();
-    this.unsubscribeAll();
-
-    // Unhook DOM events
-    YAHOO.util.Event.purgeElement(elContainer, true);
-
-    // Remove DOM elements
-    elContainer.innerHTML = "";
-
-    // Null out objects
-    for(var param in this) {
-        if(this.hasOwnProperty(param)) {
-            this[param] = null;
-        }
-    }
-
-    YAHOO.log("DataTable instance destroyed: " + instanceName);
+DT.Formatter = {
+    button   : DT.formatButton,
+    checkbox : DT.formatCheckbox,
+    currency : DT.formatCurrency,
+    "date"   : DT.formatDate,
+    dropdown : DT.formatDropdown,
+    email    : DT.formatEmail,
+    link     : DT.formatLink,
+    "number" : DT.formatNumber,
+    radio    : DT.formatRadio,
+    text     : DT.formatText,
+    textarea : DT.formatTextarea,
+    textbox  : DT.formatTextbox
 };
 
-/**
- * Displays message within secondary TBODY.
- *
- * @method showTableMessage
- * @param sHTML {String} (optional) Value for innerHTML.
- * @param sClassName {String} (optional) Classname.
- */
-YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML, sClassName) {
-    var elCell = this._elMsgTd;
-    if(YAHOO.lang.isString(sHTML)) {
-        elCell.innerHTML = sHTML;
-    }
-    if(YAHOO.lang.isString(sClassName)) {
-        YAHOO.util.Dom.addClass(elCell, sClassName);
-    }
-    this._elMsgTbody.style.display = "";
-    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
-    YAHOO.log("DataTable showing message: " + sHTML, "info", this.toString());
-};
+lang.extend(DT, util.Element, {
 
-/**
- * Hides secondary TBODY.
- *
- * @method hideTableMessage
- */
-YAHOO.widget.DataTable.prototype.hideTableMessage = function() {
-    if(this._elMsgTbody.style.display != "none") {
-        this._elMsgTbody.style.display = "none";
-        this.fireEvent("tableMsgHideEvent");
-        YAHOO.log("DataTable message hidden", "info", this.toString());
-    }
-};
+/////////////////////////////////////////////////////////////////////////////
+//
+// Superclass methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Brings focus to DataTable instance.
+ * Implementation of Element's abstract method. Sets up config values.
  *
- * @method focus
+ * @method initAttributes
+ * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.focus = function() {
-    this._focusEl(this._elTable);
-};
-
-
-
-
-
-
-
-
 
+initAttributes : function(oConfigs) {
+    oConfigs = oConfigs || {};
+    DT.superclass.initAttributes.call(this, oConfigs);
 
+    /**
+    * @attribute summary
+    * @description Value for the SUMMARY attribute.
+    * @type String
+    */
+    this.setAttributeConfig("summary", {
+        value: null,
+        validator: lang.isString,
+        method: function(sSummary) {
+            this._elThead.parentNode.summary = sSummary;
+        }
+    });
 
+    /**
+    * @attribute selectionMode
+    * @description Specifies row or cell selection mode. Accepts the following strings:
+    *    <dl>
+    *      <dt>"standard"</dt>
+    *      <dd>Standard row selection with support for modifier keys to enable
+    *      multiple selections.</dd>
+    *
+    *      <dt>"single"</dt>
+    *      <dd>Row selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"singlecell"</dt>
+    *      <dd>Cell selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"cellblock"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a block-fashion, like a spreadsheet.</dd>
+    *
+    *      <dt>"cellrange"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a range-fashion, like a calendar.</dd>
+    *    </dl>
+    *
+    * @default "standard"
+    * @type String
+    */
+    this.setAttributeConfig("selectionMode", {
+        value: "standard",
+        validator: lang.isString
+    });
 
+    /**
+    * @attribute initialRequest
+    * @description Defines the initial request that gets sent to the DataSource
+    * during initialization. Value is ignored if initialLoad is set to any value
+    * other than true.    
+    * @type MIXED
+    * @default null
+    */
+    this.setAttributeConfig("initialRequest", {
+        value: null
+    });
 
+    /**
+    * @attribute initialLoad
+    * @description Determines whether or not to load data at instantiation. By
+    * default, will trigger a sendRequest() to the DataSource and pass in the
+    * request defined by initialRequest. If set to false, data will not load
+    * at instantiation. Alternatively, implementers who wish to work with a 
+    * custom payload may pass in an object literal with the following values:
+    *     
+    *    <dl>
+    *      <dt>request (MIXED)</dt>
+    *      <dd>Request value.</dd>
+    *
+    *      <dt>argument (MIXED)</dt>
+    *      <dd>Custom data that will be passed through to the callback function.</dd>
+    *    </dl>
+    *
+    *                    
+    * @type Boolean | Object
+    * @default true
+    */
+    this.setAttributeConfig("initialLoad", {
+        value: true
+    });
 
+    /**
+     * @attribute generateRequest
+     * @description A function used to translate proposed DataTable state info
+     * into a value which is then passed to the DataSource's sendRequest method.
+     * This function is called to get the DataTable's initial data as well as
+     * any data changes or requests such as pagination or sorting.  The method
+     * is passed two params, an object literal with the state data and a
+     * reference to the DataTable.
+     * @type function
+     * @default DT._generateRequest
+     */
+    this.setAttributeConfig("generateRequest", {
+        value: DT._generateRequest,
+        validator: lang.isFunction
+    });
 
+    /**
+    * @attribute sortedBy
+    * @description Object literal provides metadata for initial sort values if
+    * data will arrive pre-sorted:
+    * <dl>
+    *     <dt>sortedBy.key</dt>
+    *     <dd>{String} Key of sorted Column</dd>
+    *     <dt>sortedBy.dir</dt>
+    *     <dd>{String} Initial sort direction, either DT.CLASS_ASC or DT.CLASS_DESC</dd>
+    * </dl>
+    * @type Object
+    */
+    this.setAttributeConfig("sortedBy", {
+        value: null,
+        // TODO: accepted array for nested sorts
+        validator: function(oNewSortedBy) {
+            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
+        },
+        method: function(oNewSortedBy) {
+            // Remove ASC/DESC from TH
+            var oOldSortedBy = this.get("sortedBy");
+            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
+                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
+                var oldThEl = this.getThEl(oldColumn);
+                Dom.removeClass(oldThEl, DT.CLASS_ASC);
+                Dom.removeClass(oldThEl, DT.CLASS_DESC);
+            }
 
+            // Set ASC/DESC on TH
+            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
+            if(column) {
+                // Backward compatibility
+                if(oNewSortedBy.dir && ((oNewSortedBy.dir == "asc") ||  (oNewSortedBy.dir == "desc"))) {
+                    var newClass = (oNewSortedBy.dir == "desc") ?
+                            DT.CLASS_DESC :
+                            DT.CLASS_ASC;
+                    Dom.addClass(column.getThEl(), newClass);
+                }
+                else {
+                     var sortClass = oNewSortedBy.dir || DT.CLASS_ASC;
+                     Dom.addClass(column.getThEl(), sortClass);
+                }
+            }
+        }
+    });
+    
+    /**
+    * @attribute paginator
+    * @description Stores an instance of Pag, or (for
+    * backward compatibility), an object literal of pagination values in the
+    * following form:<br>
+    *   { containers:[], // UI container elements <br>
+    *   rowsPerPage:500, // 500 rows <br>
+    *   currentPage:1,  // page one <br>
+    *   pageLinks:0,    // show all links <br>
+    *   pageLinksStart:1, // first link is page 1 <br>
+    *   dropdownOptions:null, // no dropdown <br>
+    *   links: [], // links elements <br>
+    *   dropdowns: [] } //dropdown elements
+    *
+    * @default null
+    * @type {Object|YAHOO.widget.Paginator}
+    */
+    this.setAttributeConfig("paginator", {
+        value : { // Backward compatibility
+            rowsPerPage:500, // 500 rows per page
+            currentPage:1,  // show page one
+            startRecordIndex:0, // start with first Record
+            totalRecords:0, // how many Records total
+            totalPages:0, // how many pages total
+            rowsThisPage:0, // how many rows this page
+            pageLinks:0,    // show all links
+            pageLinksStart:1, // first link is page 1
+            dropdownOptions: null, //no dropdown
+            containers:[], // Paginator container element references
+            dropdowns: [], //dropdown element references,
+            links: [] // links elements
+        },
+        validator : function (oNewPaginator) {
+            if (typeof oNewPaginator === 'object' && oNewPaginator) {
+                if (oNewPaginator instanceof Pag) {
+                    return true;
+                }
+                else {
+                    // Backward compatibility
+                    if(oNewPaginator && (oNewPaginator.constructor == Object)) {
+                        // Check for incomplete set of values
+                        if((oNewPaginator.rowsPerPage !== undefined) &&
+                                (oNewPaginator.currentPage !== undefined) &&
+                                (oNewPaginator.startRecordIndex !== undefined) &&
+                                (oNewPaginator.totalRecords !== undefined) &&
+                                (oNewPaginator.totalPages !== undefined) &&
+                                (oNewPaginator.rowsThisPage !== undefined) &&
+                                (oNewPaginator.pageLinks !== undefined) &&
+                                (oNewPaginator.pageLinksStart !== undefined) &&
+                                (oNewPaginator.dropdownOptions !== undefined) &&
+                                (oNewPaginator.containers !== undefined) &&
+                                (oNewPaginator.dropdowns !== undefined) &&
+                                (oNewPaginator.links !== undefined)) {
+
+                            // Validate each value
+                            if(lang.isNumber(oNewPaginator.rowsPerPage) &&
+                                    lang.isNumber(oNewPaginator.currentPage) &&
+                                    lang.isNumber(oNewPaginator.startRecordIndex) &&
+                                    lang.isNumber(oNewPaginator.totalRecords) &&
+                                    lang.isNumber(oNewPaginator.totalPages) &&
+                                    lang.isNumber(oNewPaginator.rowsThisPage) &&
+                                    lang.isNumber(oNewPaginator.pageLinks) &&
+                                    lang.isNumber(oNewPaginator.pageLinksStart) &&
+                                    lang.isArray(oNewPaginator.dropdownOptions) &&
+                                    lang.isArray(oNewPaginator.containers) &&
+                                    lang.isArray(oNewPaginator.dropdowns) &&
+                                    lang.isArray(oNewPaginator.links)) {
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        method : function (oNewPaginator) {
+            // Hook into the pagintor's change event
+            if (oNewPaginator instanceof Pag) {
+                oNewPaginator.subscribe('changeRequest', this.onPaginatorChange, this, true);
+
+                // If the paginator has no configured containers, add some
+                var containers = oNewPaginator.getContainerNodes();
+                if (!containers.length) {
+                    // Build the container nodes
+                    var c_above = document.createElement('div');
+                    c_above.id = this._sId + "-paginator0";
+                    this._elContainer.insertBefore(c_above,this._elContainer.firstChild);
+
+                    // ...and one below the table
+                    var c_below = document.createElement('div');
+                    c_below.id = this._sId + "-paginator1";
+                    this._elContainer.appendChild(c_below);
+
+                    containers = [c_above, c_below];
+                    Dom.addClass(containers,
+                                DT.CLASS_PAGINATOR);
+
+                    oNewPaginator.set('containers',containers);
+                }
+            }
+        }
+    });
 
+    /**
+    * @attribute paginated
+    * @deprecated No longer used, as long as "paginator" value is an instance of
+    * Paginator class.  
+    */
+    this.setAttributeConfig("paginated", {
+        value: false,
+        validator: lang.isBoolean,
+        method : function (on) {
+            var curVal = this.get('paginated');
+            var i,len;
+            if (on == curVal) {
+                return;
+            }
 
+            var oPaginator  = this.get('paginator');
+            if (!(oPaginator instanceof Pag)) {
+                // Backward compatibility--pagination generated here
+                oPaginator = oPaginator || {
+                    rowsPerPage     : 500,  // 500 rows per page
+                    currentPage     : 1,    // show page one
+                    startRecordIndex: 0,    // start with first Record
+                    totalRecords    : 0,    // how many Records total
+                    totalPages      : 0,    // how many pages total
+                    rowsThisPage    : 0,    // how many rows this page
+                    pageLinks       : 0,    // show all links
+                    pageLinksStart  : 1,    // first link is page 1
+                    dropdownOptions : null, // no dropdown
+                    containers      : [],   // Paginator container element references
+                    dropdowns       : [],   // dropdown element references,
+                    links           : []    // links elements
+                };
+                var aContainerEls = oPaginator.containers;
+
+                // Paginator is enabled
+                if(on) {
+                    // No containers found, create two from scratch
+                    if(aContainerEls.length === 0) {
+                        // One before TABLE
+                        var pag0 = document.createElement("span");
+                        pag0.id = this._sId + "-paginator0";
+                        Dom.addClass(pag0, DT.CLASS_PAGINATOR);
+                        pag0 = this._elContainer.insertBefore(pag0, this._elContainer.firstChild);
+                        aContainerEls.push(pag0);
+
+                        // One after TABLE
+                        var pag1 = document.createElement("span");
+                        pag1.id = this._sId + "-paginator1";
+                        Dom.addClass(pag1, DT.CLASS_PAGINATOR);
+                        pag1 = this._elContainer.appendChild(pag1);
+                        aContainerEls.push(pag1);
+
+                        // (re)set the paginator value directly
+                        oPaginator.containers = aContainerEls;
+                        this._configs.paginator.value= oPaginator;
+                    }
+                    else {
+                        // Show each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            aContainerEls[i].style.display = "";
+                        }
+                    }
 
+                    // Links are enabled
+                    if(oPaginator.pageLinks > -1) {
+                        var aLinkEls = oPaginator.links;
+                        // No links containers found, create from scratch
+                        if(aLinkEls.length === 0) {
+                            for(i=0; i<aContainerEls.length; i++) {
+                                // Create one links container per Paginator container
+                                var linkEl = document.createElement("span");
+                                linkEl.id = "yui-dt-pagselect"+i;
+                                linkEl = aContainerEls[i].appendChild(linkEl);
+
+                                // Add event listener
+                                //TODO: anon fnc
+                                Ev.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+
+                                 // Add directly to tracker
+                                this._configs.paginator.value.links.push(linkEl);
+                           }
+                       }
+                    }
 
+                    for(i=0; i<aContainerEls.length; i++) {
+                        // Create one SELECT element per Paginator container
+                        var selectEl = document.createElement("select");
+                        Dom.addClass(selectEl, DT.CLASS_DROPDOWN);
+                        selectEl = aContainerEls[i].appendChild(selectEl);
+                        selectEl.id = "yui-dt-pagselect"+i;
+
+                        // Add event listener
+                        //TODO: anon fnc
+                        Ev.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+
+                        // Add DOM reference directly to tracker
+                       this._configs.paginator.value.dropdowns.push(selectEl);
+
+                        // Hide dropdown
+                        if(!oPaginator.dropdownOptions) {
+                            selectEl.style.display = "none";
+                        }
+                    }
 
+                    //TODO: fire paginatorDisabledEvent & add to api doc
+                    YAHOO.log("Paginator enabled", "info", this.toString());
+                }
+                // Pagination is disabled
+                else {
+                    // Containers found
+                    if(aContainerEls.length > 0) {
+                        // Destroy or just hide?
 
+                        // Hide each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            aContainerEls[i].style.display = "none";
+                        }
 
+                        /*TODO?
+                        // Destroy each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            Ev.purgeElement(aContainerEls[i], true);
+                            aContainerEls.innerHTML = null;
+                            //TODO: remove container?
+                            // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
+                        }
+                        */
+                    }
+                    //TODO: fire paginatorDisabledEvent & add to api doc
+                    YAHOO.log("Paginator disabled", "info", this.toString());
+                }
+            }
+        }
+    });
 
+    /**
+     * @attribute paginationEventHandler
+     * @description For use with Pag pagination.  A
+     * handler function that receives the requestChange event from the
+     * configured paginator.  The handler method will be passed these
+     * parameters:
+     * <ol>
+     * <li>oState {Object} - an object literal describing the requested
+     * pagination state</li>
+     * <li>oSelf {DataTable} - The DataTable instance.</li>
+     * </ol>
+     * 
+     * For pagination through dynamic or server side data, assign
+     * DT.handleDataSourcePagination or your own custom
+     * handler.
+     * @type {function|Object}
+     * @default DT.handleSimplePagination
+     */
+    this.setAttributeConfig("paginationEventHandler", {
+        value     : DT.handleSimplePagination,
+        validator : lang.isObject
+    });
 
+    /**
+    * @attribute caption
+    * @description Value for the CAPTION element.
+    * @type String
+    */
+    this.setAttributeConfig("caption", {
+        value: null,
+        validator: lang.isString,
+        method: function(sCaption) {
+            // Create CAPTION element
+            if(!this._elCaption) {
+                this._elCaption = this._elThead.parentNode.insertBefore(document.createElement("caption"), this._elThead.parentNode.firstChild);
+            }
+            // Set CAPTION value
+            this._elCaption.innerHTML = sCaption;
+        }
+    });
 
+    /**
+    * @attribute scrollable
+    * @description True if primary TBODY should scroll.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("scrollable", {
+        value: false,
+        validator: function(oParam) {
+            return (lang.isBoolean(oParam));
+        },
+        method: function(oParam) {
+            if(oParam) {
+                Dom.addClass(this._elContainer,DT.CLASS_SCROLLABLE);
+                // Bug 1743176 - Safari 2 shifts the _elTbodyContainer up
+                // when placed in overflow:auto container.  Should only shift
+                // the table inside.  Apply topMargin to _elTbodyContainer
+                // to account for the bug.
+                if (ua.webkit && ua.webkit < 420) {
+                    this._elTbodyContainer.style.marginTop =
+                        this._elTbody.parentNode.style.marginTop.replace('-','');
+                }
+                this._syncScrollPadding();
+            }
+            else {
+                Dom.removeClass(this._elContainer,DT.CLASS_SCROLLABLE);
+                if (ua.webkit && ua.webkit < 420) {
+                    this._elTbodyContainer.style.marginTop = "";
+                }
+                this._syncScrollPadding();
+            }
+        }
+    });
 
+    /**
+    * @attribute width
+    * @description Table width for scrollable tables
+    * @type String
+    */
+    this.setAttributeConfig("width", {
+        value: null,
+        validator: lang.isString,
+        method: function(oParam) {
+            if(this.get("scrollable")) {
+                this._elTheadContainer.style.width = oParam;
+                this._elTbodyContainer.style.width = oParam;            
+            }
+        }
+    });
 
+    /**
+    * @attribute height
+    * @description Table height for scrollable tables
+    * @type String
+    */
+    this.setAttributeConfig("height", {
+        value: null,
+        validator: lang.isString,
+        method: function(oParam) {
+            if(this.get("scrollable")) {
+                this._elTbodyContainer.style.height = oParam;  
+            }          
+        }
+    });
 
+    /**
+    * @attribute draggableColumns
+    * @description True if Columns are draggable to reorder, false otherwise.
+    * The Drag & Drop Utility is required to enable this feature. Only top-level
+    * and non-nested Columns are draggable. Write once.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("draggableColumns", {
+        value: false,
+        validator: lang.isBoolean,
+        writeOnce: true
+    });
 
+    /**
+     * @attribute renderLoopSize        
+     * @description A value greater than 0 enables DOM rendering of rows to be
+     * executed from a non-blocking timeout queue and sets how many rows to be
+     * rendered per timeout. Recommended for very large data sets.     
+     * @type Number     
+     * @default 0       
+     */         
+     this.setAttributeConfig("renderLoopSize", {        
+         value: 0,      
+         validator: lang.isNumber       
+     });        
+},
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
+/**
+ * True if instance is initialized, so as to fire the initEvent rather than
+ * renderEvent.
+ *
+ * @property _bInit
+ * @type Boolean
+ * @default true
+ * @private
+ */
+_bInit : true,
 
+/**
+ * Index assigned to instance.
+ *
+ * @property _nIndex
+ * @type Number
+ * @private
+ */
+_nIndex : null,
 
+/**
+ * Counter for IDs assigned to TR elements.
+ *
+ * @property _nTrCount
+ * @type Number
+ * @private
+ */
+_nTrCount : 0,
 
+/**
+ * Counter for IDs assigned to TD elements.
+ *
+ * @property _nTdCount
+ * @type Number
+ * @private
+ */
+_nTdCount : 0,
 
+/**
+ * Unique id assigned to instance "yui-dtN", useful prefix for generating unique
+ * DOM ID strings and log messages.
+ *
+ * @property _sId
+ * @type String
+ * @private
+ */
+_sId : null,
 
+/**
+ * Render chain.
+ *
+ * @property _oChain
+ * @type YAHOO.util.Chain
+ * @private
+ */
+_oChain : null,
 
+/**
+ * Sparse array of custom functions to set column widths for browsers that don't
+ * support dynamic CSS rules.  Functions are added at the index representing
+ * the number of rows they update.
+ *
+ * @property _aFallbackColResizer
+ * @type Array
+ * @private
+ */
+_aFallbackColResizer : [],
 
+/**
+ * DOM reference to the container element for the DataTable instance into which
+ * all other elements get created.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+_elContainer : null,
 
+/**
+ * DOM reference to the container element for the DataTable's primary THEAD.
+ *
+ * @property _elTheadContainer
+ * @type HTMLElement
+ * @private
+ */
+_elTheadContainer : null,
 
+/**
+ * DOM reference to the container element for the DataTable's primary TBODY.
+ *
+ * @property _elTbodyContainer
+ * @type HTMLElement
+ * @private
+ */
+_elTbodyContainer : null,
 
+/**
+ * DOM reference to the CAPTION element for the DataTable instance.
+ *
+ * @property _elCaption
+ * @type HTMLElement
+ * @private
+ */
+_elCaption : null,
 
+/**
+ * DOM reference to the primary THEAD element for the DataTable instance.
+ *
+ * @property _elThead
+ * @type HTMLElement
+ * @private
+ */
+_elThead : null,
 
+/**
+ * DOM reference to the primary TBODY element for the DataTable instance.
+ *
+ * @property _elTbody
+ * @type HTMLElement
+ * @private
+ */
+_elTbody : null,
 
+/**
+ * DOM reference to the secondary TBODY element used to display DataTable messages.
+ *
+ * @property _elMsgTbody
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbody : null,
 
+/**
+ * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyRow
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbodyRow : null,
 
+/**
+ * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyCell
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbodyCell : null,
 
+/**
+ * DataSource instance for the DataTable instance.
+ *
+ * @property _oDataSource
+ * @type YAHOO.util.DataSource
+ * @private
+ */
+_oDataSource : null,
 
+/**
+ * ColumnSet instance for the DataTable instance.
+ *
+ * @property _oColumnSet
+ * @type YAHOO.widget.ColumnSet
+ * @private
+ */
+_oColumnSet : null,
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// RECORDSET FUNCTIONS
+/**
+ * RecordSet instance for the DataTable instance.
+ *
+ * @property _oRecordSet
+ * @type YAHOO.widget.RecordSet
+ * @private
+ */
+_oRecordSet : null,
 
 /**
- * Returns Record index for given TR element or page row index.
+ * ID string of first TR element of the current DataTable page.
  *
- * @method getRecordIndex
- * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
- * element reference or page row index.
- * @return {Number} Record's RecordSet index, or null.
+ * @property _sFirstTrId
+ * @type String
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getRecordIndex = function(row) {
-    var nTrIndex;
-
-    if(!YAHOO.lang.isNumber(row)) {
-        // By Record
-        if(row instanceof YAHOO.widget.Record) {
-            return this._oRecordSet.getRecordIndex(row);
-        }
-        // By element reference
-        else {
-            // Find the TR element
-            var el = this.getTrEl(row);
-            if(el) {
-                nTrIndex = el.sectionRowIndex;
-            }
-        }
-    }
-    // By page row index
-    else {
-        nTrIndex = row;
-    }
-
-    if(YAHOO.lang.isNumber(nTrIndex)) {
-        if(this.get("paginated")) {
-            return this.get("paginator").startRecordIndex + nTrIndex;
-        }
-        else {
-            return nTrIndex;
-        }
-    }
-
-    YAHOO.log("Could not get Record index for row " + row, "warn", this.toString());
-    return null;
-};
+_sFirstTrId : null,
 
 /**
- * For the given identifier, returns the associated Record instance.
+ * ID string of the last TR element of the current DataTable page.
  *
- * @method getRecord
- * @param row {HTMLElement | String | Number} RecordSet position index, DOM
- * reference or ID string to an element within the DataTable page.
- * @return {YAHOO.widget.Record} Record instance.
+ * @property _sLastTrId
+ * @type String
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getRecord = function(row) {
-    var nRecordIndex = row;
-    
-    // By element reference or ID string
-    if(!YAHOO.lang.isNumber(nRecordIndex)) {
-        // Validate TR element
-        var elRow = this.getTrEl(row);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(row);
-        }
-    }
-    // By Record index
-    if(YAHOO.lang.isNumber(nRecordIndex)) {
-        return this._oRecordSet.getRecord(nRecordIndex);
-    }
-    
-    YAHOO.log("Could not get Record for row at " + row, "warn", this.toString());
-    return null;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+_sLastTrId : null,
 
+/**
+ * Template cell to create all new cells from.
+ * @property _tdElTemplate
+ * @type {HTMLElement}
+ * @private 
+ */
+_tdElTemplate : null,
 
+/**
+ * Template row to create all new rows from.
+ * @property _trElTemplate
+ * @type {HTMLElement}
+ * @private 
+ */
+_trElTemplate : null,
 
+/**
+ * True if x-scrollbar is currently visible.
+ * @property _bScrollbarX
+ * @type {Boolean}
+ * @private 
+ */
+_bScrollbarX : null,
 
 
 
@@ -3825,135 +6604,219 @@ YAHOO.widget.DataTable.prototype.getRecord = function(row) {
 
 
 
-// COLUMN FUNCTIONS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * For the given identifier, returns the associated Column instance.
+ * Clears browser text selection. Useful to call on rowSelectEvent or
+ * cellSelectEvent to prevent clicks or dblclicks from selecting text in the
+ * browser.
  *
- * @method getColumn
- * @param column {HTMLElement | String | Number} ColumnSet.keys position index, DOM
- * reference or ID string to an element within the DataTable page.
- * @return {YAHOO.widget.Column} Column instance.
+ * @method clearTextSelection
  */
- YAHOO.widget.DataTable.prototype.getColumn = function(column) {
-    var nColumnIndex = column;
-
-    // By element reference or ID string
-    if(!YAHOO.lang.isNumber(nColumnIndex)) {
-        // Validate TD element
-        var elCell = this.getTdEl(column);
-        if(elCell) {
-            nColumnIndex = elCell.yuiColumnId;
+clearTextSelection : function() {
+    var sel;
+    if(window.getSelection) {
+       sel = window.getSelection();
+    }
+    else if(document.getSelection) {
+       sel = document.getSelection();
+    }
+    else if(document.selection) {
+       sel = document.selection;
+    }
+    if(sel) {
+        if(sel.empty) {
+            sel.empty();
         }
-        // Validate TH element
-        else {
-            elCell = this.getThEl(column);
-            if(elCell) {
-                nColumnIndex = elCell.yuiColumnId;
-            }
+        else if (sel.removeAllRanges) {
+            sel.removeAllRanges();
+        }
+        else if(sel.collapse) {
+            sel.collapse();
         }
     }
-    
-    // By Column index
-    if(YAHOO.lang.isNumber(nColumnIndex)) {
-        return this._oColumnSet.getColumn(nColumnIndex);
-    }
+},
 
-    YAHOO.log("Could not get Column for column at " + column, "warn", this.toString());
-    return null;
- };
+/**
+ * Sets focus on the given element.
+ *
+ * @method _focusEl
+ * @param el {HTMLElement} Element.
+ * @private
+ */
+_focusEl : function(el) {
+    el = el || this._elTbody;
+    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
+    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
+    // strange unexpected things as the user clicks on buttons and other controls.
+    setTimeout(function() {
+        try {
+            el.focus();
+        }
+        catch(e) {
+        }
+    },0);
+},
 
 /**
- * Sorts given Column.
+ * Syncs up widths of THs and TDs across all those Columns without width values.
+ * Actual adjustment is to the liner DIVs so window resizing will not affect cells. 
  *
- * @method sortColumn
- * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @method _syncColWidths
+ * @private
  */
-YAHOO.widget.DataTable.prototype.sortColumn = function(oColumn) {
-    if(!oColumn) {
-        return;
-    }
-    if(!oColumn instanceof YAHOO.widget.Column) {
-        //TODO: accept the TH or TH.key
-        //TODO: Get the column based on TH.yuiColumnId
-        return;
-    }
-    if(oColumn.sortable) {
-        // What is the default sort direction?
-        var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultOrder) ? oColumn.sortOptions.defaultOrder : "asc";
+_syncColWidths : function() {
+    // Validate there is at least one row with cells and at least one Column
+    var allKeys = this._oColumnSet.keys,
+        elRow = this.getFirstTrEl();
+
+    if(allKeys && elRow && (elRow.cells.length === allKeys.length)) {
+        // Temporarily unsnap container since it causes inaccurate calculations
+        var bUnsnap = false;
+        if((YAHOO.env.ua.gecko || YAHOO.env.ua.opera) && this.get("scrollable") && this.get("width")) {
+            bUnsnap = true;
+            this._elTheadContainer.style.width = "";
+            this._elTbodyContainer.style.width = "";
+        }
+
+        var i,
+            oColumn,
+            cellsLen = elRow.cells.length;
+        // First time through, reset the widths to get an accurate measure of the TD
+        for(i=0; i<cellsLen; i++) {
+            oColumn = allKeys[i];
+            // Only for Columns without widths
+            if(!oColumn.width) {
+                this._setColumnWidth(oColumn, "auto");
+            }
+        }
 
-        // Already sorted?
-        var oSortedBy = this.get("sortedBy");
-        if(oSortedBy && (oSortedBy.key === oColumn.key)) {
-            if(oSortedBy.dir) {
-                sortDir = (oSortedBy.dir == "asc") ? "desc" : "asc";
+        // Calculate width for every Column
+        for(i=0; i<cellsLen; i++) {
+            oColumn = allKeys[i];
+            var newWidth;
+            
+            // Columns without widths
+            if(!oColumn.width) {
+                var elTh = oColumn.getThEl();
+                var elTd = elRow.cells[i];
+                
+                if(elTh.offsetWidth !== elTd.offsetWidth) {
+                    var elWider = (elTh.offsetWidth > elTd.offsetWidth) ? elTh.firstChild : elTd.firstChild;               
+                    // Calculate the final width by comparing liner widths
+                    newWidth = elWider.offsetWidth -
+                            (parseInt(Dom.getStyle(elWider,"paddingLeft"),10)|0) -
+                            (parseInt(Dom.getStyle(elWider,"paddingRight"),10)|0);
+                    
+                    // Validate against minWidth        
+                    newWidth = (oColumn.minWidth && (oColumn.minWidth > newWidth)) ?
+                            oColumn.minWidth : newWidth;
+            
+                }
             }
+            // Columns with widths
             else {
-                sortDir = (sortDir == "asc") ? "desc" : "asc";
+                newWidth = oColumn.width;
+            }
+            
+            // Hidden Columns
+            if(oColumn.hidden) {
+                oColumn._nLastWidth = newWidth;
+                newWidth = 1;
             }
+            
+            // Update to the new width
+            this._setColumnWidth(oColumn, newWidth+"px"); 
         }
-
-        // Is there a custom sort handler function defined?
-        var sortFnc = (oColumn.sortOptions && YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction)) ?
-                oColumn.sortOptions.sortFunction : function(a, b, desc) {
-                    var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
-                    if(sorted === 0) {
-                        return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
-                    }
-                    else {
-                        return sorted;
-                    }
-        };
-
-        // Do the actual sort
-        var desc = (sortDir == "desc") ? true : false;
-        this._oRecordSet.sortRecords(sortFnc, desc);
-
-        // Update sortedBy tracker
-        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
         
-        // Reset to first page
-        //TODO: Keep selection in view
-        this.updatePaginator({currentPage:1});
-
-        // Update the UI
-        this.refreshView();
-
-        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
-        YAHOO.log("Column \"" + oColumn.key + "\" sorted \"" + sortDir + "\"", "info", this.toString());
-    }
-    else {
-        //TODO
-        YAHOO.log("Column is not sortable", "info", this.toString());
+        // Resnap unsnapped containers
+        if(bUnsnap) {
+            var sWidth = this.get("width");
+            this._elTheadContainer.style.width = sWidth;
+            this._elTbodyContainer.style.width = sWidth;     
+        } 
     }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+    
+    this._syncScrollPadding();
+},
 
+/**
+ * Syncs padding around scrollable tables, including Column header right-padding
+ * and container width and height.
+ *
+ * @method _syncScrollPadding
+ * @private
+ */
+_syncScrollPadding : function() {
+    // Proceed only if scrollable is enabled
+    if(this.get("scrollable")) {
+        var elTbody = this._elTbody,
+            elTbodyContainer = this._elTbodyContainer,
+            aLastHeaders, len, prefix, i, elLiner;
+        
+        // IE 6 and 7 only when y-scrolling not enabled
+        if(!this.get("height") && (ua.ie)) {
+            // Snap outer container height to content
+            // but account for x-scrollbar if it is visible
+            elTbodyContainer.style.height = 
+                    (elTbodyContainer.scrollWidth > elTbodyContainer.offsetWidth) ?
+                    (elTbody.offsetHeight + 19) + "px" : 
+                    elTbody.offsetHeight + "px";
+        }
+        
+        // X-scrolling not enabled
+        if(!this.get("width")) {
+            // Snap outer container width to content
+            // but account for y-scrollbar if it is visible
+            this._elContainer.style.width = 
+                    (elTbodyContainer.scrollHeight > elTbodyContainer.offsetHeight) ?
+                    (elTbody.parentNode.offsetWidth + 19) + "px" :
+                    (elTbody.parentNode.offsetWidth) + "px";
+        }
+        // X-scrolling is enabled and x-scrollbar is visible
+        else if(elTbodyContainer.scrollWidth > elTbodyContainer.offsetWidth) {
+            // Perform sync routine
+            if(!this._bScrollbarX) {
+                // Add Column header right-padding
+                aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1];
+                len = aLastHeaders.length;
+                prefix = this._sId+"-th";
+                for(i=0; i<len; i++) {
+                    //TODO: A better way to get th cell
+                    elLiner = Dom.get(prefix+aLastHeaders[i]).firstChild;
+                    elLiner.style.marginRight = 
+                            (parseInt(Dom.getStyle(elLiner,"marginRight"),10) + 
+                            27) + "px";
+                }
+                
+                // Save state   
+                this._bScrollbarX = true;
+            }
+        }
+        // X-scrollbar enabled but x-scrollbar is not visible
+        else {
+            // Perform sync routine
+            if(this._bScrollbarX) {                 
+                // Remove Column header right-padding                   
+                aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1];
+                len = aLastHeaders.length;
+                prefix = this._sId+"-th";
+                for(i=0; i<len; i++) {
+                    //TODO: A better way to get th cell
+                    elLiner = Dom.get(prefix+aLastHeaders[i]).firstChild;
+                    Dom.setStyle(elLiner,"marginRight","");
+                }
+                                        
+                // Save state
+                this._bScrollbarX = false;
+            }
+        }
+    }
+},
 
 
 
@@ -3965,310 +6828,559 @@ YAHOO.widget.DataTable.prototype.sortColumn = function(oColumn) {
 
 
 
+// INIT FUNCTIONS
 
+/**
+ * Initializes the HTMLElement templates used to create various table child
+ * nodes.
+ * @method _initNodeTemplates
+ * @private
+ */
+_initNodeTemplates : function () {
+    var d   = document,
+        tr  = d.createElement('tr'),
+        td  = d.createElement('td'),
+        div = d.createElement('div');
 
+    // Append the liner element
+    td.appendChild(div);
 
+    this._tdElTemplate = td;
+    this._trElTemplate = tr;
+},
 
+/**
+ * Initializes the DataTable container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
+ * @private
+ */
+_initContainerEl : function(elContainer) {
+    // Clear any previous container
+    if(this._elContainer) {
+        Ev.purgeElement(this._elContainer, true);
+        this._elContainer.innerHTML = "";
+    }
 
+    elContainer = Dom.get(elContainer);
+    if(elContainer && elContainer.nodeName && (elContainer.nodeName.toLowerCase() == "div")) {
+        // Esp for progressive enhancement
+        Ev.purgeElement(elContainer, true);
+        elContainer.innerHTML = "";
 
+        Dom.addClass(elContainer,"yui-dt yui-dt-noop");
+        
+        // Container for header TABLE
+        this._elTheadContainer = elContainer.appendChild(document.createElement("div"));
+        Dom.addClass(this._elTheadContainer, "yui-dt-hd");
 
-// ROW FUNCTIONS
+        // Container for body TABLE
+        this._elTbodyContainer = elContainer.appendChild(document.createElement("div"));
+        Dom.addClass(this._elTbodyContainer, "yui-dt-bd");
 
+        this._elContainer = elContainer;
+    }
+},
 
 /**
- * Adds one new Record of data into the RecordSet at the index if given,
- * otherwise at the end. If the new Record is in page view, the
- * corresponding DOM elements are also updated.
+ * Initializes object literal of config values.
  *
- * @method addRow
- * @param oData {Object} Object literal of data for the row.
- * @param index {Number} (optional) RecordSet position index at which to add data.
+ * @method _initConfigs
+ * @param oConfig {Object} Object literal of config values.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.addRow = function(oData, index) {
-    if(oData && (oData.constructor == Object)) {
-        var oRecord = this._oRecordSet.addRecord(oData, index);
-        if(oRecord) {
-            var nTrIndex = this.getTrIndex(oRecord);
+_initConfigs : function(oConfigs) {
+    if(oConfigs) {
+        if(oConfigs.constructor != Object) {
+            oConfigs = null;
+            YAHOO.log("Invalid configs", "warn", this.toString());
+        }
+        // Backward compatibility
+        else if(lang.isBoolean(oConfigs.paginator)) {
+            YAHOO.log("DataTable's paginator model has been revised" +
+            " -- please refer to the documentation for implementation" +
+            " details", "warn", this.toString());
+        }
+        this._oConfigs = oConfigs;
+    }
+    else {
+        this._oConfigs = {};
+    }
+},
 
-            // Row is in view
-            if(YAHOO.lang.isNumber(nTrIndex)) {
-                // Paginated so just refresh the view to keep pagination state
-                if(this.get("paginated")) {
-                    this.refreshView();
-                }
-                // Add the TR element
-                else {
-                    var newTrId = this._addTrEl(oRecord, nTrIndex);
-                    if(newTrId) {
-                        // Is this an insert or an append?
-                        var append = (YAHOO.lang.isNumber(nTrIndex) &&
-                                (nTrIndex == this._elTbody.rows.length-1)) ? true : false;
-
-                        // Stripe the one new row
-                        if(append) {
-                            if((this._elTbody.rows.length-1)%2) {
-                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_ODD);
-                            }
-                            else {
-                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_EVEN);
-                            }
-                        }
-                        // Restripe all the rows after the new one
-                        else {
-                            this._setRowStripes(nTrIndex);
-                        }
-
-                        // If new row is at the bottom
-                        if(append) {
-                            this._setLastRow();
-                        }
-                        // If new row is at the top
-                        else if(YAHOO.lang.isNumber(index) && (nTrIndex === 0)) {
-                            this._setFirstRow();
-                        }
-                    }
-                }
-            }
-            // Record is not in view so just update pagination UI
-            else {
-                this.updatePaginator();
-            }
-
-            // TODO: what args to pass?
-            this.fireEvent("rowAddEvent", {record:oRecord});
-
-            // For log message
-            nTrIndex = (YAHOO.lang.isValue(nTrIndex))? nTrIndex : "n/a";
-
-            YAHOO.log("Added row: Record ID = " + oRecord.getId() +
-                    ", Record index = " + this.getRecordIndex(oRecord) +
-                    ", page row index = " + nTrIndex, "info", this.toString());
-            return;
+/**
+ * Initializes ColumnSet.
+ *
+ * @method _initColumnSet
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @private
+ */
+_initColumnSet : function(aColumnDefs) {
+    if(this._oColumnSet) {
+        // First clear _oStylesheetRules for existing ColumnSet
+        for(var i=0, l=this._oColumnSet.keys.length; i<l; i++) {
+            DT._oStylesheetRules[".yui-dt-col-"+this._oColumnSet.keys[i].getId()] = undefined;
         }
+        
+        this._oColumnSet = null;
     }
-    YAHOO.log("Could not add row with " + YAHOO.lang.dump(oData), "error", this.toString());
-};
+    
+    if(lang.isArray(aColumnDefs)) {
+        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
+    }
+    // Backward compatibility
+    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
+        this._oColumnSet =  aColumnDefs;
+        YAHOO.log("DataTable's constructor now requires an array" +
+        " of object literal Column definitions instead of a ColumnSet instance",
+        "warn", this.toString());
+    }
+},
 
 /**
- * Convenience method to add multiple rows.
+ * Initializes DataSource.
  *
- * @method addRows
- * @param aData {Object[]} Array of object literal data for the rows.
- * @param index {Number} (optional) RecordSet position index at which to add data.
+ * @method _initDataSource
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.addRows = function(aData, index) {
-    if(YAHOO.lang.isArray(aData)) {
+_initDataSource : function(oDataSource) {
+    this._oDataSource = null;
+    if(oDataSource && (oDataSource instanceof DS)) {
+        this._oDataSource = oDataSource;
+    }
+    // Backward compatibility
+    else {
+        var tmpTable = null;
+        var tmpContainer = this._elContainer;
         var i;
-        if(YAHOO.lang.isNumber(index)) {
-            for(i=aData.length-1; i>-1; i--) {
-                this.addRow(aData[i], index);
+        // Peek in container child nodes to see if TABLE already exists
+        if(tmpContainer.hasChildNodes()) {
+            var tmpChildren = tmpContainer.childNodes;
+            for(i=0; i<tmpChildren.length; i++) {
+                if(tmpChildren[i].nodeName && tmpChildren[i].nodeName.toLowerCase() == "table") {
+                    tmpTable = tmpChildren[i];
+                    break;
+                }
             }
-        }
-        else {
-            for(i=0; i<aData.length; i++) {
-                this.addRow(aData[i]);
+            if(tmpTable) {
+                var tmpFieldsArray = [];
+                for(i=0; i<this._oColumnSet.keys.length; i++) {
+                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+                }
+
+                this._oDataSource = new DS(tmpTable);
+                this._oDataSource.responseType = DS.TYPE_HTMLTABLE;
+                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
+                YAHOO.log("Null DataSource for progressive enhancement from" +
+                " markup has been deprecated", "warn", this.toString());
             }
         }
     }
+},
+
+/**
+ * Initializes RecordSet.
+ *
+ * @method _initRecordSet
+ * @private
+ */
+_initRecordSet : function() {
+    if(this._oRecordSet) {
+        this._oRecordSet.reset();
+    }
     else {
-        YAHOO.log("Could not add rows " + YAHOO.lang.dump(aData));
+        this._oRecordSet = new YAHOO.widget.RecordSet();
     }
-};
+},
 
 /**
- * For the given row, updates the associated Record with the given data. If the
- * row is in view, the corresponding DOM elements are also updated.
+ * Creates HTML markup for TABLE, THEAD and TBODY elements.
  *
- * @method updateRow
- * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
- * Which row to update: By Record instance, by Record's RecordSet
- * position index, by HTMLElement reference to the TR element, or by ID string
- * of the TR element.
- * @param oData {Object} Object literal of data for the row.
+ * @method _initTableEl
+ * @private
  */
-YAHOO.widget.DataTable.prototype.updateRow = function(row, oData) {
-    var oldRecord, updatedRecord, elRow;
+_initTableEl : function() {
+    var elTable;
 
-    // Get the Record directly
-    if((row instanceof YAHOO.widget.Record) || (YAHOO.lang.isNumber(row))) {
-            // Get the Record directly
-            oldRecord = this._oRecordSet.getRecord(row);
-            
-            // Is this row in view?
-            elRow = this.getTrEl(oldRecord);
-    }
-    // Get the Record by TR element
-    else {
-        elRow = this.getTrEl(row);
-        if(elRow) {
-            oldRecord = this._oRecordSet.getRecord(this.getRecordIndex(elRow));
+    // Destroy existing
+    if(this._elThead) {
+        var i;
+        // Destroy ColumnDDs
+        var aTree = this._oColumnSet.tree[0];
+        for(i=0; i<aTree.length; i++) {
+            if(aTree[i]._dd) {
+                aTree[i]._dd = aTree[i]._dd.unreg();
+            }
+        }
+    
+        // Destroy ColumnResizers
+        var aKeys = this._oColumnSet.keys;
+        for(i=0; i<aKeys.length; i++) {
+            if(aKeys[i]._ddResizer) {
+                aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg();
+            }
         }
+        elTable = this._elThead.parentNode;
+        Ev.purgeElement(elTable, true);
+        elTable.parentNode.removeChild(elTable);
+        this._elThead = null;
+    }
+    if(this._elTbody) {
+        elTable = this._elTbody.parentNode;
+        Ev.purgeElement(elTable, true);
+        elTable.parentNode.removeChild(elTable);
+        this._elTbody = null;
     }
 
-    // Update the Record
-    if(oldRecord) {
-        // Copy data from the Record for the event that gets fired later
-        var oRecordData = oldRecord.getData();
-        var oldData = {};
-        for(var param in oRecordData) {
-            oldData[param] = oRecordData[param];
-        }
+    // Create elements for header
+    // Create TABLE
+    var elHeadTable = document.createElement("table");
+    elHeadTable.id = this._sId + "-headtable";
+    elHeadTable = this._elTheadContainer.appendChild(elHeadTable);
 
-        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
-    }
-    else {
-        YAHOO.log("Could not update row " + row + " with the data : " +
-                YAHOO.lang.dump(oData), "error", this.toString());
-        return;
+    // Create elements for body
+    // Create TABLE
+    var elBodyTable = document.createElement("table");
+    elBodyTable.id = this._sId + "-bodytable";
+    this._elTbodyContainer.appendChild(elBodyTable);
 
-    }
+    // Create THEAD for display and for a11y
+    this._initTheadEls();
+
+    // Create TBODY for data
+    this._elTbody = elBodyTable.appendChild(document.createElement("tbody"));
+    this._elTbody.tabIndex = 0;
+    Dom.addClass(this._elTbody,DT.CLASS_BODY);
+    // Bug 1716354 - fix gap in Safari 2 and 3 (Also saw small gap in Opera.
+    // this fixes all)
+    this._elTbody.parentNode.style.marginTop = "-"+this._elTbody.offsetTop+"px";
+
+    // Create TBODY for messages
+    var elMsgTbody = document.createElement("tbody");
+    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
+    Dom.addClass(elMsgRow,DT.CLASS_FIRST);
+    Dom.addClass(elMsgRow,DT.CLASS_LAST);
+    this._elMsgRow = elMsgRow;
+    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
+    elMsgCell.colSpan = this._oColumnSet.keys.length;
+    Dom.addClass(elMsgCell,DT.CLASS_FIRST);
+    Dom.addClass(elMsgCell,DT.CLASS_LAST);
+    this._elMsgTd = elMsgCell;
+    this._elMsgTbody = elBodyTable.appendChild(elMsgTbody);
+    var elMsgCellLiner = elMsgCell.appendChild(document.createElement("div"));
+    Dom.addClass(elMsgCellLiner,DT.CLASS_LINER);
+    this.showTableMessage(DT.MSG_LOADING, DT.CLASS_LOADING);
+
+    var elContainer = this._elContainer;
+    var elThead = this._elThead;
+    var elTbody = this._elTbody;
     
-    // Update the TR only if row is in view
-    if(elRow) {
-        this._updateTrEl(elRow, updatedRecord);
+    // IE puts focus outline in the wrong place
+    if(ua.ie) {
+        elTbody.hideFocus=true;
     }
+    var elTbodyContainer = this._elTbodyContainer;
 
-    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
-    YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
-            ", Record index = " + this.getRecordIndex(updatedRecord) +
-            ", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());
-};
+    // Set up DOM events
+    Ev.addListener(elContainer, "focus", this._onTableFocus, this);
+    Ev.addListener(elTbody, "focus", this._onTbodyFocus, this);
+
+    Ev.addListener(elTbody, "mouseover", this._onTableMouseover, this);
+    Ev.addListener(elTbody, "mouseout", this._onTableMouseout, this);
+    Ev.addListener(elTbody, "mousedown", this._onTableMousedown, this);
+
+    Ev.addListener(elTbody, "keydown", this._onTbodyKeydown, this);
+
+    Ev.addListener(elTbody, "keypress", this._onTableKeypress, this);
+
+    // Since we can't listen for click and dblclick on the same element...
+    Ev.addListener(elTbody.parentNode, "dblclick", this._onTableDblclick, this);
+    Ev.addListener(elTbody, "click", this._onTbodyClick, this);
+
+    Ev.addListener(elTbodyContainer, "scroll", this._onScroll, this); // to sync horiz scroll headers
+},
 
 /**
- * Deletes the given row's Record from the RecordSet. If the row is in view, the
- * corresponding DOM elements are also deleted.
+ * Initializes THEAD elements for display and for screen readers.
  *
- * @method deleteRow
- * @param row {HTMLElement | String | Number} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
+ * @method _initTheadEls
+ * @private
  */
-YAHOO.widget.DataTable.prototype.deleteRow = function(row) {
-    // Get the Record index...
-    var nRecordIndex = null;
-    // ...by Record index
-    if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
-    }
-    // ...by element reference
+_initTheadEls : function() {
+    var i,j, l, elThead, elA11yThead, aTheads;
+    
+    // First time through
+    if(!this._elThead) {
+        // Create THEADs
+        elThead = this._elTheadContainer.firstChild.appendChild(document.createElement("thead"));
+        this._elThead = elThead;
+    
+        elA11yThead = this._elTbodyContainer.firstChild.appendChild(document.createElement("thead"));
+        this._elA11yThead = elA11yThead;
+        
+        aTheads = [elThead, elA11yThead];
+
+        Ev.addListener(elThead, "focus", this._onTheadFocus, this);
+        Ev.addListener(elThead, "keydown", this._onTheadKeydown, this);
+        Ev.addListener(elThead, "mouseover", this._onTableMouseover, this);
+        Ev.addListener(elThead, "mouseout", this._onTableMouseout, this);
+        Ev.addListener(elThead, "mousedown", this._onTableMousedown, this);
+        Ev.addListener(elThead, "mouseup", this._onTableMouseup, this);
+        Ev.addListener(elThead, "click", this._onTheadClick, this);
+        Ev.addListener(elThead.parentNode, "dblclick", this._onTableDblclick, this);
+    }
+    // Reinitialization
     else {
-        var elRow = YAHOO.util.Dom.get(row);
-        elRow = this.getTrEl(elRow);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(elRow);
+        // Clear rows from THEADs
+        elThead = this._elThead;
+        elA11yThead = this._elA11yThead;
+        aTheads = [elThead, elA11yThead];
+            
+        for(i=0; i<aTheads.length; i++) {
+            for(j=aTheads[i].rows.length-1; j>-1; j--) {
+                Ev.purgeElement(aTheads[i].rows[j], true);
+                aTheads[i].removeChild(aTheads[i].rows[j]);
+            }     
         }
     }
-    if(nRecordIndex !== null) {
-        var oRecord = this._oRecordSet.getRecord(nRecordIndex);
-        if(oRecord) {
-            var nRecordId = oRecord.getId();
-            
-            // Remove from selection tracker if there
-            var tracker = this._aSelections || [];
-            for(var j=0; j<tracker.length; j++) {
-                if((YAHOO.lang.isNumber(tracker[j]) && (tracker[j] === nRecordId)) ||
-                        ((tracker[j].constructor == Object) && (tracker[j].recordId === nRecordId))) {
-                    tracker.splice(j,1);
+
+    
+    var oColumn,
+        oColumnSet = this._oColumnSet;
+
+    // Add TRs to the THEADs
+    var colTree = oColumnSet.tree;
+    var elTheadCell;
+    for(l=0; l<aTheads.length; l++) {
+        for(i=0; i<colTree.length; i++) {
+            var elTheadRow = aTheads[l].appendChild(document.createElement("tr"));
+            elTheadRow.id = this._sId+"-hdrow"+i;
+    
+            // ...and create TH cells
+            for(j=0; j<colTree[i].length; j++) {
+                oColumn = colTree[i][j];
+                elTheadCell = elTheadRow.appendChild(document.createElement("th"));
+                if(l===0) {
+                    oColumn._elTh = elTheadCell;
                 }
+                var id = (l===1) ? this._sId+"-th" + oColumn.getId() + "-a11y": this._sId+"-th" + oColumn.getId();
+                elTheadCell.id = id;
+                elTheadCell.yuiCellIndex = j;
+                this._initThEl(elTheadCell,oColumn,i,j, (l===1));
             }
-
-            // Copy data from the Record for the event that gets fired later
-            var oRecordData = oRecord.getData();
-            var oData = {};
-            for(var param in oRecordData) {
-                oData[param] = oRecordData[param];
+    
+            if(l===0) {
+                // Set FIRST/LAST on THEAD rows
+                if(i === 0) {
+                    Dom.addClass(elTheadRow, DT.CLASS_FIRST);
+                }
+                if(i === (colTree.length-1)) {
+                    Dom.addClass(elTheadRow, DT.CLASS_LAST);
+                }
             }
+        }
 
-            // Delete Record from RecordSet
-            this._oRecordSet.deleteRecord(nRecordIndex);
-
-            // If row is in view, delete the TR element
-            var nTrIndex = this.getTrIndex(nRecordIndex);
-            if(YAHOO.lang.isNumber(nTrIndex)) {
-                var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex) ?
-                        true : false;
-                this._deleteTrEl(nTrIndex);
-
-                // Empty body
-                if(this._elTbody.rows.length === 0) {
-                    this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-                }
-                // Update UI
-                else {
-                    // Set FIRST/LAST
-                    if(nTrIndex === 0) {
-                        this._setFirstRow();
+        if(l===0) {
+            // Set FIRST/LAST on TH elements using the values in ColumnSet headers array
+            var aFirstHeaders = oColumnSet.headers[0];
+            var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1];
+            for(i=0; i<aFirstHeaders.length; i++) {
+                //TODO: A better way to get th cell
+                Dom.addClass(Dom.get(this._sId+"-th"+aFirstHeaders[i]), DT.CLASS_FIRST);
+            }
+            for(i=0; i<aLastHeaders.length; i++) {
+                //TODO: A better way to get th cell
+                Dom.addClass(Dom.get(this._sId+"-th"+aLastHeaders[i]), DT.CLASS_LAST);
+            }
+        
+            // Add DD features only after DOM has been updated
+            var foundDD = (util.DD) ? true : false;
+            var needDD = false;
+            // draggable
+            // HACK: Not able to use attribute since this code is run before
+            // attributes are initialized
+            if(this._oConfigs.draggableColumns) {
+                for(i=0; i<this._oColumnSet.tree[0].length; i++) {
+                    oColumn = this._oColumnSet.tree[0][i];
+                    if(foundDD) {
+                        elTheadCell = oColumn.getThEl();
+                        Dom.addClass(elTheadCell, DT.CLASS_DRAGGABLE);
+                        var elDragTarget = DT._initColumnDragTargetEl();
+                        oColumn._dd = new YAHOO.widget.ColumnDD(this, oColumn, elTheadCell, elDragTarget);
                     }
-                    if(isLast) {
-                        this._setLastRow();
+                    else {
+                        needDD = true;
+                    }    
+                }
+            }
+            // resizeable
+            for(i=0; i<this._oColumnSet.keys.length; i++) {
+                oColumn = this._oColumnSet.keys[i];
+                if(oColumn.resizeable) {
+                    if(foundDD) {
+                        elTheadCell = oColumn.getThEl();
+                        Dom.addClass(elTheadCell, DT.CLASS_RESIZEABLE);
+                        var elThLiner = elTheadCell.firstChild;
+                        var elThResizer = elThLiner.appendChild(document.createElement("div"));
+                        elThResizer.id = this._sId + "-colresizer" + oColumn.getId();
+                        oColumn._elResizer = elThResizer;
+                        Dom.addClass(elThResizer,DT.CLASS_RESIZER);
+                        var elResizerProxy = DT._initColumnResizerProxyEl();
+                        oColumn._ddResizer = new YAHOO.util.ColumnResizer(
+                                this, oColumn, elTheadCell, elThResizer.id, elResizerProxy);
+                        var cancelClick = function(e) {
+                            Ev.stopPropagation(e);
+                        };
+                        Ev.addListener(elThResizer,"click",cancelClick);
                     }
-                    // Set EVEN/ODD
-                    if(nTrIndex != this._elTbody.rows.length) {
-                        this._setRowStripes(nTrIndex);
+                    else {
+                        needDD = true;
                     }
                 }
             }
-
-            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
-                    oldData:oData, trElIndex:nTrIndex});
-            YAHOO.log("DataTable row deleted: Record ID = " + nRecordId +
-                    ", Record index = " + nRecordIndex +
-                    ", page row index = " + nTrIndex, "info", this.toString());
+            if(needDD) {
+                YAHOO.log("Could not find DragDrop dependancy", "warn", this.toString());
+            }
+            
+            YAHOO.log("TH cells for " + this._oColumnSet.keys.length + " keys created","info",this.toString());
+        }
+        else {
+            YAHOO.log("Accessibility TH cells for " + this._oColumnSet.keys.length + " keys created","info",this.toString());
         }
     }
-    else {
-        YAHOO.log("Could not delete row: " + row, "warn", this.toString());
-    }
-};
+},
 
 /**
- * Convenience method to delete multiple rows.
+ * Populates TH cell as defined by Column.
  *
- * @method deleteRows
- * @param row {HTMLElement | String | Number} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- * @param count {Number} (optional) How many rows to delete. A negative value
- * will delete towards the beginning.
+ * @method _initThEl
+ * @param elTheadCell {HTMLElement} TH cell element reference.
+ * @param oColumn {YAHOO.widget.Column} Column object.
+ * @param row {Number} Row index.
+ * @param col {Number} Column index.
+ * @param bA11y {Boolean} True if TH is for accessibility, so as not to
+ * initialize presentation elements.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
-    // Get the Record index...
-    var nRecordIndex = null;
-    // ...by Record index
-    if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
+_initThEl : function(elTheadCell,oColumn,row,col, bA11y) {
+    // Clear out the cell of prior content
+    // TODO: purgeListeners and other validation-related things
+    var colKey = oColumn.getKey();
+    var colId = oColumn.getId();
+    elTheadCell.yuiColumnKey = colKey;
+    elTheadCell.yuiColumnId = colId;
+    elTheadCell.innerHTML = "";
+    elTheadCell.rowSpan = oColumn.getRowspan();
+    elTheadCell.colSpan = oColumn.getColspan();
+
+    var elTheadCellLiner = elTheadCell.appendChild(document.createElement("div"));
+    var elTheadCellLabel = elTheadCellLiner.appendChild(document.createElement("span"));
+
+    // Keep it basic for screen readers
+    if(bA11y) {
+        //TODO: remove IDs and form elements from label
+        if(oColumn.abbr) {
+            elTheadCell.abbr = oColumn.abbr;
+        }
+        elTheadCellLabel.innerHTML = lang.isValue(oColumn.label) ? oColumn.label : colKey;
     }
-    // ...by element reference
+    // Visually format the elements
     else {
-        var elRow = YAHOO.util.Dom.get(row);
-        elRow = this.getTrEl(elRow);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(elRow);
+        // Needed for resizer
+        elTheadCellLiner.id = elTheadCell.id + "-liner";
+        
+        // Add classes on the liner
+        var aClasses;
+        if(lang.isString(oColumn.className)) {
+            aClasses = [oColumn.className];
         }
-    }
-    if(nRecordIndex !== null) {
-        if(count && YAHOO.lang.isNumber(count)) {
-            // Start with highest index and work down
-            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
-            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
-            for(var i=startIndex; i>endIndex-1; i--) {
-                this.deleteRow(i);
-            }
+        else if(lang.isArray(oColumn.className)) {
+            aClasses = oColumn.className;
         }
         else {
-            this.deleteRow(nRecordIndex);
+            aClasses = [];
         }
-    }
-    else {
-        YAHOO.log("Could not delete row " + row, "info", this.toString());
-    }
-};
-
-
+        
+        //TODO: document special keys will get stripped here
+        aClasses[aClasses.length] = "yui-dt-col-"+colKey.replace(/[^\w\-.:]/g,"");
+        
+        aClasses[aClasses.length] = "yui-dt-col-"+oColumn.getId();
+        
+        aClasses[aClasses.length] = DT.CLASS_LINER;
 
+        Dom.addClass(elTheadCellLiner,aClasses.join(" "));
 
+        // Add classes on the label
+        Dom.addClass(elTheadCellLabel,DT.CLASS_LABEL);
+        
+        // Add classes on the cell
+        aClasses = [];
+        if(oColumn.resizeable) {
+            aClasses[aClasses.length] = DT.CLASS_RESIZEABLE;
+        }
+        if(oColumn.sortable) {
+            aClasses[aClasses.length] = DT.CLASS_SORTABLE;
+        }
 
+        //Set Column hidden
+        if(oColumn.hidden) {
+            aClasses[aClasses.length] = DT.CLASS_HIDDEN;
+        }
+        
+        // Set Column selection on TD
+        if(oColumn.selected) {
+            aClasses[aClasses.length] = DT.CLASS_SELECTED;
+        }
+
+        Dom.addClass(elTheadCell,aClasses.join(" "));
 
+        DT.formatTheadCell(elTheadCellLabel, oColumn, this);
+    }
+},
+
+/**
+ * Creates HTML markup for Cell Editor.
+ *
+ * @method _initCellEditorEl
+ * @private
+ */
+_initCellEditorEl : function() {
+    // TODO: destroy previous instances
 
+    // Attach Cell Editor container element as first child of body
+    var elCellEditor = document.createElement("div");
+    elCellEditor.id = this._sId + "-celleditor";
+    elCellEditor.style.display = "none";
+    elCellEditor.tabIndex = 0;
+    Dom.addClass(elCellEditor, DT.CLASS_EDITOR);
+    var elFirstChild = Dom.getFirstChild(document.body);
+    if(elFirstChild) {
+        elCellEditor = Dom.insertBefore(elCellEditor, elFirstChild);
+    }
+    else {
+        elCellEditor = document.body.appendChild(elCellEditor);
+    }
+    
+    // Internal tracker of Cell Editor values
+    var oCellEditor = {};
+    oCellEditor.container = elCellEditor;
+    oCellEditor.value = null;
+    oCellEditor.isActive = false;
+    this._oCellEditor = oCellEditor;
+},
 
+/**     
+  * Initializes Column sorting.         
+  *     
+  * @method _initColumnSort     
+  * @private    
+  */    
+_initColumnSort : function() {
+    this.subscribe("theadCellClickEvent", this.onEventSortColumn);      
+},      
 
 
 
@@ -4302,411 +7414,300 @@ YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
 
 
 
+// DOM MUTATION FUNCTIONS
 
 
 
+/**
+ * Create a TR element for a given Record.
+ * @method _createTrEl
+ * @param oRecord {YAHOO.widget.Record} Record instance
+ * @return {HTMLElement} The new TR element.  This must be added to the DOM.
+ * @private 
+ */
+_createTrEl : function (oRecord) {
+    // Clone the empty tr template.  We can't clone an existing row
+    // because of the expandos and td ids that must be set in _addTdEl
+    var elRow     = this._trElTemplate.cloneNode(true);
 
+    elRow.id = this._sId+"-bdrow"+this._nTrCount;
+    this._nTrCount++;
 
-// CELL FUNCTIONS
+    // Call _updateTrEl to populate and align the row contents
+    return this._updateTrEl(elRow,oRecord);
+},
 
 /**
- * Outputs markup into the given TD based on given Record.
+ * Formats all TD elements of given TR element with data from the given Record.
  *
- * @method formatCell
- * @param elCell {HTMLElement} TD Element.
- * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
- * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
- * @return {HTML} Markup.
+ * @method _updateTrEl
+ * @param elRow {HTMLElement} The TR element to update.
+ * @param oRecord {YAHOO.widget.Record} The associated Record instance.
+ * @return {HTMLElement} DOM reference to the new TR element.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.formatCell = function(elCell, oRecord, oColumn) {
-    if(!(oRecord instanceof YAHOO.widget.Record)) {
-        oRecord = this.getRecord(elCell);
+_updateTrEl : function(elRow, oRecord) {
+    var oColumnSet = this._oColumnSet,
+        sortKey,
+        sortClass,
+        isSortedBy = this.get("sortedBy"),
+        i,j,len,jlen;
+
+    if(isSortedBy) {
+        sortKey = isSortedBy.key;
+        sortClass = isSortedBy.dir;
     }
-    if(!(oColumn instanceof YAHOO.widget.Column)) {
-        oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+
+    // Hide the row to prevent constant reflows
+    elRow.style.display = 'none';
+
+    // Remove extra TD elements
+    while(elRow.childNodes.length > oColumnSet.keys.length) {
+        elRow.removeChild(elRow.firstChild);
+    }
+    // Add more TD elements as needed
+    for (i=elRow.childNodes.length||0, len=oColumnSet.keys.length; i < len; ++i) {
+        this._addTdEl(elRow,oColumnSet.keys[i],i);
     }
-    
-    if(oRecord && oColumn) {
-        var oData = oRecord.getData(oColumn.key);
 
-        var fnFormatter;
-        if(YAHOO.lang.isString(oColumn.formatter)) {
-            switch(oColumn.formatter) {
-                case "button":
-                    fnFormatter = YAHOO.widget.DataTable.formatButton;
-                    break;
-                case "checkbox":
-                    fnFormatter = YAHOO.widget.DataTable.formatCheckbox;
-                    break;
-                case "currency":
-                    fnFormatter = YAHOO.widget.DataTable.formatCurrency;
-                    break;
-                case "date":
-                    fnFormatter = YAHOO.widget.DataTable.formatDate;
-                    break;
-                case "dropdown":
-                    fnFormatter = YAHOO.widget.DataTable.formatDropdown;
-                    break;
-                case "email":
-                    fnFormatter = YAHOO.widget.DataTable.formatEmail;
-                    break;
-                case "link":
-                    fnFormatter = YAHOO.widget.DataTable.formatLink;
-                    break;
-                case "number":
-                    fnFormatter = YAHOO.widget.DataTable.formatNumber;
-                    break;
-                case "radio":
-                    fnFormatter = YAHOO.widget.DataTable.formatRadio;
-                    break;
-                case "text":
-                    fnFormatter = YAHOO.widget.DataTable.formatText;
-                    break;
-                case "textarea":
-                    fnFormatter = YAHOO.widget.DataTable.formatTextarea;
-                    break;
-                case "textbox":
-                    fnFormatter = YAHOO.widget.DataTable.formatTextbox;
-                    break;
-                case "html":
-                    // This is the default
-                    break;
-                default:
-                    YAHOO.log("Could not find formatter function \"" +
-                            oColumn.formatter + "\"", "warn", this.toString());
-                    fnFormatter = null;
-            }
-        }
-        else if(YAHOO.lang.isFunction(oColumn.formatter)) {
-            fnFormatter = oColumn.formatter;
-        }
+    // Update TD elements with new data
+    for(i=0,len=oColumnSet.keys.length; i<len; ++i) {
+        var oColumn     = oColumnSet.keys[i],
+            elCell      = elRow.childNodes[i],
+            elCellLiner = elCell.firstChild,
+            cellHeaders = '';
 
-        // Apply special formatter
-        if(fnFormatter) {
-            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
-        }
-        else {
-            elCell.innerHTML = (YAHOO.lang.isValue(oData)) ? oData.toString() : "";
+        // Set the cell content
+        this.formatCell(elCellLiner, oRecord, oColumn);
+
+        // Set the cell's accessibility headers
+        for(j=0,jlen=oColumnSet.headers[i].length; j < jlen; ++j) {
+            cellHeaders += this._sId + "-th" + oColumnSet.headers[i][j] + "-a11y ";
         }
+        elCell.headers = cellHeaders;
 
-        // Add custom classNames
-        var aCustomClasses = null;
-        if(YAHOO.lang.isString(oColumn.className)) {
-            aCustomClasses = [oColumn.className];
+        // Set ASC/DESC on TD
+        if(oColumn.key === sortKey) {
+            Dom.replaceClass(elCell, sortClass === DT.CLASS_ASC ?
+                                     DT.CLASS_DESC : DT.CLASS_ASC, sortClass);
+        } else {
+            Dom.removeClass(elCell, DT.CLASS_ASC);
+            Dom.removeClass(elCell, DT.CLASS_DESC);
         }
-        else if(YAHOO.lang.isArray(oColumn.className)) {
-            aCustomClasses = oColumn.className;
+        
+        // Set Column hidden if appropriate
+        if(oColumn.hidden) {
+            Dom.addClass(elCell, DT.CLASS_HIDDEN);
         }
-        if(aCustomClasses) {
-            for(var i=0; i<aCustomClasses.length; i++) {
-                YAHOO.util.Dom.addClass(elCell, aCustomClasses[i]);
-            }
+        else {
+            Dom.removeClass(elCell, DT.CLASS_HIDDEN);
         }
-        
-        YAHOO.util.Dom.addClass(elCell, "yui-dt-col-"+oColumn.key);
 
-        // Is editable?
-        if(oColumn.editor) {
-            YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);
+        // Set Column selection on TH
+        if(oColumn.selected) {
+            Dom.addClass(elCell, DT.CLASS_SELECTED);
+        }
+        else {
+            Dom.removeClass(elCell, DT.CLASS_SELECTED);
         }
-        
-        this.fireEvent("cellFormatEvent", {record:oRecord, key:oColumn.key, el:elCell});
-    }
-    else {
-        YAHOO.log("Could not format cell " + elCell, "error", this.toString());
     }
-};
-
 
-/**
- * Formats a BUTTON element.
- *
- * @method DataTable.formatButton
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object | Boolean} Data value for the cell. By default, the value
- * is what gets written to the BUTTON.
- * @static
- */
-YAHOO.widget.DataTable.formatButton= function(el, oRecord, oColumn, oData) {
-    var sValue = YAHOO.lang.isValue(oData) ? oData : "Click";
-    //TODO: support YAHOO.widget.Button
-    //if(YAHOO.widget.Button) {
+    // Update Record ID
+    elRow.yuiRecordId = oRecord.getId();
     
-    //}
-    //else {
-        el.innerHTML = "<button type=\"button\" class=\""+
-                YAHOO.widget.DataTable.CLASS_BUTTON + "\">" + sValue + "</button>";
-    //}
-};
+    // Redisplay the row for reflow
+    elRow.style.display = '';
+
+    return elRow;
+},
 
-/**
- * Formats a CHECKBOX element.
- *
- * @method DataTable.formatCheckbox
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object | Boolean} Data value for the cell. Can be a simple
- * Boolean to indicate whether checkbox is checked or not. Can be object literal
- * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
- * formatter.
- * @static
- */
-YAHOO.widget.DataTable.formatCheckbox = function(el, oRecord, oColumn, oData) {
-    var bChecked = oData;
-    bChecked = (bChecked) ? " checked" : "";
-    el.innerHTML = "<input type=\"checkbox\"" + bChecked +
-            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
-};
 
 /**
- * Formats currency. Default unit is USD.
- *
- * @method DataTable.formatCurrency
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Number} Data value for the cell.
- * @static
+ * Creates a cell within the specified row and column.
+ * @method _addTdEl
+ * @param elRow {HTMLElement} The row to add the cell to
+ * @param oColumn {Column} The column definition to use for the cell
+ * @param index {number} (optional) the index to add the cell at (default null)
+ * @return {HTMLElement} the new cell
+ * @private
  */
-YAHOO.widget.DataTable.formatCurrency = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isNumber(oData)) {
-        var nAmount = oData;
-        var markup;
+_addTdEl : function (elRow,oColumn,index) {
+    var elCell      = this._tdElTemplate.cloneNode(true),
+        elCellLiner = elCell.firstChild;
 
-        // Round to the penny
-        nAmount = Math.round(nAmount*100)/100;
+    index = index || elRow.cells.length;
 
-        // Default currency is USD
-        markup = "$"+nAmount;
+    elCell.id           = elRow.id+"-cell"+this._nTdCount;
+    this._nTdCount++;
+    elCell.yuiColumnKey = oColumn.getKey();
+    elCell.yuiColumnId  = oColumn.getId();
 
-        // Normalize digits
-        var dotIndex = markup.indexOf(".");
-        if(dotIndex < 0) {
-            markup += ".00";
-        }
-        else {
-            while(dotIndex > markup.length-3) {
-                markup += "0";
-            }
-        }
-        el.innerHTML = markup;
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
+    elCell.yuiCellIndex = index;
+
+    // Set FIRST/LAST on TD
+    if (!(index % this._oColumnSet.keys.length - 1)) {
+        elCell.className = index ? DT.CLASS_LAST : DT.CLASS_FIRST;
     }
-};
+
+    var insertBeforeCell = elRow.cells[index] || null;
+    return elRow.insertBefore(elCell,insertBeforeCell);
+},
 
 /**
- * Formats JavaScript Dates.
+ * Deletes TR element by DOM reference or by DataTable page row index.
  *
- * @method DataTable.formatDate
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _deleteTrEl
+ * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
+ * @return {Boolean} Returns true if successful, else returns false.
+ * @private
  */
-YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) {
-    var oDate = oData;
-    if(oDate instanceof Date) {
-        el.innerHTML = (oDate.getMonth()+1) + "/" + oDate.getDate()  + "/" + oDate.getFullYear();
+_deleteTrEl : function(row) {
+    var rowIndex;
+
+    // Get page row index for the element
+    if(!lang.isNumber(row)) {
+        rowIndex = Dom.get(row).sectionRowIndex;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        rowIndex = row;
     }
-};
+    if(lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
+        this._elTbody.deleteRow(rowIndex);
+        return true;
+    }
+    else {
+        return false;
+    }
+},
+
+
+
+
 
-/**
- * Formats SELECT elements.
- *
- * @method DataTable.formatDropdown
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
- */
-YAHOO.widget.DataTable.formatDropdown = function(el, oRecord, oColumn, oData) {
-    var selectedValue = (YAHOO.lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
-    var options = (YAHOO.lang.isArray(oColumn.dropdownOptions)) ?
-            oColumn.dropdownOptions : null;
 
-    var selectEl;
-    var collection = el.getElementsByTagName("select");
-    
-    // Create the form element only once, so we can attach the onChange listener
-    if(collection.length === 0) {
-        // Create SELECT element
-        selectEl = document.createElement("select");
-        YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
-        selectEl = el.appendChild(selectEl);
 
-        // Add event listener
-        //TODO: static method doesn't have access to the datatable instance...
-        YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);
-    }
 
-    selectEl = collection[0];
 
-    // Update the form element
-    if(selectEl) {
-        // Clear out previous options
-        selectEl.innerHTML = "";
-        
-        // We have options to populate
-        if(options) {
-            // Create OPTION elements
-            for(var i=0; i<options.length; i++) {
-                var option = options[i];
-                var optionEl = document.createElement("option");
-                optionEl.value = (YAHOO.lang.isValue(option.value)) ?
-                        option.value : option;
-                optionEl.innerHTML = (YAHOO.lang.isValue(option.text)) ?
-                        option.text : option;
-                optionEl = selectEl.appendChild(optionEl);
-            }
-        }
-        // Selected value is our only option
-        else {
-            selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
-        }
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
-    }
-};
 
-/**
- * Formats emails.
- *
- * @method DataTable.formatEmail
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
- */
-YAHOO.widget.DataTable.formatEmail = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isString(oData)) {
-        el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
-    }
-};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CSS/STATE FUNCTIONS
+
+
+
 
 /**
- * Formats links.
+ * Assigns the class DT.CLASS_FIRST to the first TR element
+ * of the DataTable page and updates internal tracker.
  *
- * @method DataTable.formatLink
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _setFirstRow
+ * @private
  */
-YAHOO.widget.DataTable.formatLink = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isString(oData)) {
-        el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+_setFirstRow : function() {
+    var rowEl = this.getFirstTrEl();
+    if(rowEl) {
+        // Remove FIRST
+        if(this._sFirstTrId) {
+            Dom.removeClass(this._sFirstTrId, DT.CLASS_FIRST);
+        }
+        // Set FIRST
+        Dom.addClass(rowEl, DT.CLASS_FIRST);
+        this._sFirstTrId = rowEl.id;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        this._sFirstTrId = null;
     }
-};
+},
 
 /**
- * Formats numbers.
+ * Assigns the class DT.CLASS_LAST to the last TR element
+ * of the DataTable page and updates internal tracker.
  *
- * @method DataTable.formatNumber
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _setLastRow
+ * @private
  */
-YAHOO.widget.DataTable.formatNumber = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isNumber(oData)) {
-        el.innerHTML = oData;
+_setLastRow : function() {
+    var rowEl = this.getLastTrEl();
+    if(rowEl) {
+        // Unassign previous class
+        if(this._sLastTrId) {
+            Dom.removeClass(this._sLastTrId, DT.CLASS_LAST);
+        }
+        // Assign class
+        Dom.addClass(rowEl, DT.CLASS_LAST);
+        this._sLastTrId = rowEl.id;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        this._sLastTrId = null;
     }
-};
-
-/**
- * Formats INPUT TYPE=RADIO elements.
- *
- * @method DataTable.formatRadio
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatRadio = function(el, oRecord, oColumn, oData) {
-    var bChecked = oData;
-    bChecked = (bChecked) ? " checked" : "";
-    el.innerHTML = "<input type=\"radio\"" + bChecked +
-            " name=\"" + oColumn.getId() + "-radio\"" +
-            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
-};
+},
 
 /**
- * Formats text strings.
+ * Assigns the classes DT.CLASS_EVEN and
+ * DT.CLASS_ODD to alternating TR elements of the DataTable
+ * page. For performance, a subset of rows may be specified.
  *
- * @method DataTable.formatText
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
+ * @method _setRowStripes
+ * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
+ * or string ID, or page row index of where to start striping.
+ * @param range {Number} (optional) If given, how many rows to stripe, otherwise
+ * stripe all the rows until the end.
+ * @private
  */
-YAHOO.widget.DataTable.formatText = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    //TODO: move to util function
-    el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
-};
+_setRowStripes : function(row, range) {
+    // Default values stripe all rows
+    var allRows = this._elTbody.rows,
+        nStartIndex = 0,
+        nEndIndex = allRows.length,
+        aOdds = [], nOddIdx = 0,
+        aEvens = [], nEvenIdx = 0;
 
-/**
- * Formats TEXTAREA elements.
- *
- * @method DataTable.formatTextarea
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatTextarea = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    var markup = "<textarea>" + value + "</textarea>";
-    el.innerHTML = markup;
-};
+    // Stripe a subset
+    if((row !== null) && (row !== undefined)) {
+        // Validate given start row
+        var elStartRow = this.getTrEl(row);
+        if(elStartRow) {
+            nStartIndex = elStartRow.sectionRowIndex;
 
-/**
- * Formats INPUT TYPE=TEXT elements.
- *
- * @method DataTable.formatTextbox
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    var markup = "<input type=\"text\" value=\"" + value + "\">";
-    el.innerHTML = markup;
-};
+            // Validate given range
+            if(lang.isNumber(range) && (range > 1)) {
+                nEndIndex = nStartIndex + range;
+            }
+        }
+    }
 
+    for(var i=nStartIndex; i<nEndIndex; i++) {
+        if(i%2) {
+            aOdds[nOddIdx++] = allRows[i];
+        } else {
+            aEvens[nEvenIdx++] = allRows[i];
+        }
+    }
 
+    if (aOdds.length) {
+        Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
+    }
 
+    if (aEvens.length) {
+        Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
+    }
+},
 
 
 
@@ -4752,752 +7753,603 @@ YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
 
 
 
-// PAGINATION
-
-/**
- * Updates Paginator values in response to RecordSet changes and/or DOM events.
- * Pass in all, a subset, or no values.
- *
- * @method updatePaginator
- * @param oNewValues {Object} (Optional) Object literal of Paginator values, or
- * a subset of Paginator values.
- * @param {Object} Object literal of all Paginator values.
- */
-
-YAHOO.widget.DataTable.prototype.updatePaginator = function(oNewValues) {
-    // Complete the set
-    var oValidPaginator = this.get("paginator");
-    for(var param in oNewValues) {
-        if(oValidPaginator.hasOwnProperty(param)) {
-            oValidPaginator[param] = oNewValues[param];
-        }
-    }
-    
-    oValidPaginator.totalRecords = this._oRecordSet.getLength();
-    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
-    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
-    if(isNaN(oValidPaginator.totalPages)) {
-        oValidPaginator.totalPages = 0;
-    }
-
-    this.set("paginator", oValidPaginator);
-    return this.get("paginator");
-};
-
-/**
- * Displays given page of a paginated DataTable.
- *
- * @method showPage
- * @param nPage {Number} Which page.
- */
-YAHOO.widget.DataTable.prototype.showPage = function(nPage) {
-    // Validate input
-    if(!YAHOO.lang.isNumber(nPage) || (nPage < 1) || (nPage > this.get("paginator").totalPages)) {
-        nPage = 1;
-    }
-    this.updatePaginator({currentPage:nPage});
-    this.refreshView();
-};
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private DOM Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Updates Paginator containers with markup. Override this method to customize pagination UI.
+ * Syncs scrolltop and scrollleft of all TABLEs.
  *
- * @method formatPaginators
+ * @method _onScroll
+ * @param e {HTMLEvent} The scroll event.
+ * @param oSelf {DT} DataTable instance
+ * @private
  */
- YAHOO.widget.DataTable.prototype.formatPaginators = function() {
-    var pag = this.get("paginator");
-
-    // For Opera workaround
-    var dropdownEnabled = false;
-
-    // Links are enabled
-    if(pag.pageLinks > -1) {
-        for(var i=0; i<pag.links.length; i++) {
-            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
-        }
-    }
+_onScroll : function(e, oSelf) {
+    oSelf._elTheadContainer.scrollLeft = oSelf._elTbodyContainer.scrollLeft;
 
-    // Dropdown is enabled
-    for(i=0; i<pag.dropdowns.length; i++) {
-         if(pag.dropdownOptions) {
-            dropdownEnabled = true;
-            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
-        }
-        else {
-            pag.dropdowns[i].style.display = "none";
-        }
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+        oSelf.cancelCellEditor();
     }
 
-    // For Opera artifacting in dropdowns
-    if(dropdownEnabled && navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
-        document.body.style += '';
-    }
-    YAHOO.log("Paginators formatted", "info", this.toString());
-};
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
+},
 
 /**
- * Updates Paginator dropdown. If dropdown doesn't exist, the markup is created.
- * Sets dropdown elements's "selected" value.
+ * Handles click events on the DOCUMENT.
  *
- * @method formatPaginatorDropdown
- * @param elDropdown {HTMLElement} The SELECT element.
- * @param dropdownOptions {Object[]} OPTION values for display in the SELECT element.
+ * @method _onDocumentClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.formatPaginatorDropdown = function(elDropdown, dropdownOptions) {
-    if(elDropdown && (elDropdown.ownerDocument == document)) {
-        // Clear OPTION elements
-        while (elDropdown.firstChild) {
-            elDropdown.removeChild(elDropdown.firstChild);
-        }
+_onDocumentClick : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
 
-        // Create OPTION elements
-        for(var j=0; j<dropdownOptions.length; j++) {
-            var dropdownOption = dropdownOptions[j];
-            var optionEl = document.createElement("option");
-            optionEl.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
-                    dropdownOption.value : dropdownOption;
-            optionEl.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
-                    dropdownOption.text : dropdownOption;
-            optionEl = elDropdown.appendChild(optionEl);
-        }
+    if(!Dom.isAncestor(oSelf._elContainer, elTarget)) {
+        oSelf.fireEvent("tableBlurEvent");
 
-        var options = elDropdown.options;
-        // Update dropdown's "selected" value
-        if(options.length) {
-            for(var i=options.length-1; i>-1; i--) {
-                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
-                    options[i].selected = true;
-                }
+        // Fires editorBlurEvent when click is not within the TABLE.
+        // For cases when click is within the TABLE, due to timing issues,
+        // the editorBlurEvent needs to get fired by the lower-level DOM click
+        // handlers below rather than by the TABLE click handler directly.
+        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+            // Only if the click was not within the Cell Editor container
+            if(!Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
+                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
+                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
             }
         }
-
-        // Show the dropdown
-        elDropdown.style.display = "";
-        return;
     }
-    YAHOO.log("Could not update Paginator dropdown " + elDropdown, "error", this.toString());
-};
+},
 
 /**
- * Updates Paginator links container with markup.
+ * Handles focus events on the DataTable instance.
  *
- * @method formatPaginatorLinks
- * @param elContainer {HTMLElement} The link container element.
- * @param nCurrentPage {Number} Current page.
- * @param nPageLinksStart {Number} First page link to display.
- * @param nPageLinksLength {Number} How many page links to display.
- * @param nTotalPages {Number} Total number of pages.
+ * @method _onTableFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.formatPaginatorLinks = function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
-    if(elContainer && (elContainer.ownerDocument == document) &&
-            YAHOO.lang.isNumber(nCurrentPage) && YAHOO.lang.isNumber(nPageLinksStart) &&
-            YAHOO.lang.isNumber(nTotalPages)) {
-        // Set up markup for first/last/previous/next
-        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
-        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
-        var sFirstLinkMarkup = (bIsFirstPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</a> ";
-        var sPrevLinkMarkup = (bIsFirstPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</a> " ;
-        var sNextLinkMarkup = (bIsLastPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</a> " ;
-        var sLastLinkMarkup = (bIsLastPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_LAST +  "\">&gt;&gt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_LAST + "\">&gt;&gt;</a> ";
-
-        // Start with first and previous
-        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
-        
-        // Ok to show all links
-        var nMaxLinks = nTotalPages;
-        var nFirstLink = 1;
-        var nLastLink = nTotalPages;
-
-        if(nPageLinksLength > 0) {
-        // Calculate how many links to show
-            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
-                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
-
-            // Try to keep the current page in the middle
-            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
-            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
-
-            // Keep the last link in range
-            if(nFirstLink === 1) {
-                nLastLink = nMaxLinks;
-            }
-            // Keep the first link in range
-            else if(nLastLink === nTotalPages) {
-                nFirstLink = nTotalPages - nMaxLinks + 1;
-            }
-
-            // An even number of links can get funky
-            if(nLastLink - nFirstLink === nMaxLinks) {
-                nLastLink--;
-            }
-      }
-        
-        // Generate markup for each page
-        for(var i=nFirstLink; i<=nLastLink; i++) {
-            if(i != nCurrentPage) {
-                sMarkup += " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PAGE + "\">" + i + "</a> ";
-            }
-            else {
-                sMarkup += " <span class=\"" + YAHOO.widget.DataTable.CLASS_SELECTED + "\">" + i + "</span>";
-            }
-        }
-        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
-        elContainer.innerHTML = sMarkup;
-        return;
-    }
-    YAHOO.log("Could not format Paginator links", "error", this.toString());
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// SELECTION/HIGHLIGHTING
+_onTableFocus : function(e, oSelf) {
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * ID string of last highlighted cell element
+ * Handles focus events on the THEAD element.
  *
- * @property _sLastHighlightedCellId
- * @type String
+ * @method _onTheadFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sLastHighlightedCellId = null;
+_onTheadFocus : function(e, oSelf) {
+    oSelf.fireEvent("theadFocusEvent");
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * ID string of last highlighted row element
+ * Handles focus events on the TBODY element.
  *
- * @property _sLastHighlightedRowId
- * @type String
+ * @method _onTbodyFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sLastHighlightedRowId = null;
+_onTbodyFocus : function(e, oSelf) {
+    oSelf.fireEvent("tbodyFocusEvent");
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * Array of selections: {recordId:nRecordId, cellIndex:nCellIndex}
+ * Handles mouseover events on the DataTable instance.
  *
- * @property _aSelections
- * @type Object[]
+ * @method _onTableMouseover
+ * @param e {HTMLEvent} The mouseover event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._aSelections = null;
+_onTableMouseover : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+        var elTag = elTarget.nodeName.toLowerCase();
+        var bKeepBubbling = true;
+        while(elTarget && (elTag != "table")) {
+            switch(elTag) {
+                case "body":
+                     return;
+                case "a":
+                    break;
+                case "td":
+                    bKeepBubbling = oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
+                    break;
+                case "span":
+                    if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                        bKeepBubbling = oSelf.fireEvent("theadLabelMouseoverEvent",{target:elTarget,event:e});
+                        // Backward compatibility
+                        bKeepBubbling = oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                case "th":
+                    bKeepBubbling = oSelf.fireEvent("theadCellMouseoverEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
+                    break;
+                case "tr":
+                    if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                        bKeepBubbling = oSelf.fireEvent("theadRowMouseoverEvent",{target:elTarget,event:e});
+                        // Backward compatibility
+                        bKeepBubbling = oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    else {
+                        bKeepBubbling = oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                default:
+                    break;
+            }
+            if(bKeepBubbling === false) {
+                return;
+            }
+            else {
+                elTarget = elTarget.parentNode;
+                if(elTarget) {
+                    elTag = elTarget.nodeName.toLowerCase();
+                }
+            }
+        }
+        oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * ID string of last selected element
+ * Handles mouseout events on the DataTable instance.
  *
- * @property _sLastSelectedId
- * @type String
+ * @method _onTableMouseout
+ * @param e {HTMLEvent} The mouseout event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sLastSelectedId = null;
+_onTableMouseout : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelMouseoutEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellMouseoutEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowMouseoutEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
+    }
+    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * ID string of the selection anchor element.
+ * Handles mousedown events on the DataTable instance.
  *
- * @property _sSelectionAnchorId
- * @type String
+ * @method _onTableMousedown
+ * @param e {HTMLEvent} The mousedown event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sSelectionAnchorId = null;
+_onTableMousedown : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelMousedownEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellMousedownEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowMousedownEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
+    }
+    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
- * from all TR elements on the page.
+ * Handles dblclick events on the DataTable instance.
  *
- * @method _unselectAllTrEls
+ * @method _onTableDblclick
+ * @param e {HTMLEvent} The dblclick event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._unselectAllTrEls = function() {
-    var selectedRows = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
-    YAHOO.util.Dom.removeClass(selectedRows, YAHOO.widget.DataTable.CLASS_SELECTED);
-};
-
-/**
- * Returns array of selected TR elements on the page.
- *
- * @method getSelectedTrEls
- * @return {HTMLElement[]} Array of selected TR elements.
- */
-YAHOO.widget.DataTable.prototype.getSelectedTrEls = function() {
-    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
-};
-
+_onTableDblclick : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelDblclickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellDblclickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowDblclickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
+    }
+    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 /**
- * Sets given row to the selected state.
+ * Handles keydown events on the THEAD element.
  *
- * @method selectRow
- * @param row {HTMLElement | String} HTML element reference or ID.
+ * @method _onTheadKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.selectRow = function(row) {
-    // Validate the row
-    var elRow = this.getTrEl(row);
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        if(oRecord) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-            // Remove if already there
-
-            // Use Array.indexOf if available...
-            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
-                tracker.splice(tracker.indexOf(nRecordId),1);
-            }
-            // ...or do it the old-fashioned way
-            else {
-                for(var j=0; j<tracker.length; j++) {
-                   if(tracker[j] === nRecordId){
-                        tracker.splice(j,1);
-                    }
-                }
-            }
-            // Add to the end
-            tracker.push(nRecordId);
-
-            // Update trackers
-            this._sLastSelectedId = elRow.id;
-            if(!this._sSelectionAnchorId) {
-                this._sSelectionAnchorId = elRow.id;
+_onTheadKeydown : function(e, oSelf) {
+    // If tabbing to next TH label link causes THEAD to scroll,
+    // need to sync scrollLeft with TBODY
+    if(Ev.getCharCode(e) === 9) {
+        setTimeout(function() {
+            if((oSelf instanceof DT) && oSelf._sId) {
+                oSelf._elTbodyContainer.scrollLeft = oSelf._elTheadContainer.scrollLeft;
             }
-            this._aSelections = tracker;
-        
-            // Update UI
-            YAHOO.util.Dom.addClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-            this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
-            YAHOO.log("Selected " + elRow, "info", this.toString());
-
+        },0);
+    }
+    
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+            case "textarea":
+                // TODO
+                break;
+            case "thead":
+                bKeepBubbling = oSelf.fireEvent("theadKeyEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
             return;
         }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
     }
-    YAHOO.log("Could not select " + row, "warn", this.toString());
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.select = function(els) {
-    YAHOO.log("The method select() has been deprecated" +
-            " in favor of selectRow()", "warn", this.toString());
-    if(!YAHOO.lang.isArray(els)) {
-        els = [els];
-    }
-    for(var i=0; i<els.length; i++) {
-        this.selectRow(els[i]);
-    }
-};
+    oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Sets given row to the unselected state.
+ * Handles keydown events on the TBODY element. Handles selection behavior,
+ * provides hooks for ENTER to edit functionality.
  *
- * @method unselectRow
- * @param row {HTMLElement | String} HTML TR element reference or ID.
+ * @method _onTbodyKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.unselectRow = function(row) {
-    // Validate the row
-    var elRow = this.getTrEl(row);
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        if(oRecord) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-
-            // Remove if there
-            var bFound = false;
-            
-            // Use Array.indexOf if available...
-            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
-                tracker.splice(tracker.indexOf(nRecordId),1);
-                bFound = true;
-            }
-            // ...or do it the old-fashioned way
-            else {
-                for(var j=0; j<tracker.length; j++) {
-                   if(tracker[j] === nRecordId){
-                        tracker.splice(j,1);
-                        bFound = true;
-                    }
-                }
-            }
-
-            if(bFound) {
-                // Update tracker
-                this._aSelections = tracker;
-
-                // Update the UI
-                YAHOO.util.Dom.removeClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+_onTbodyKeydown : function(e, oSelf) {
+    var sMode = oSelf.get("selectionMode");
 
-                this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
-                YAHOO.log("Unselected " + elRow, "info", this.toString());
+    if(sMode == "standard") {
+        oSelf._handleStandardSelectionByKey(e);
+    }
+    else if(sMode == "single") {
+        oSelf._handleSingleSelectionByKey(e);
+    }
+    else if(sMode == "cellblock") {
+        oSelf._handleCellBlockSelectionByKey(e);
+    }
+    else if(sMode == "cellrange") {
+        oSelf._handleCellRangeSelectionByKey(e);
+    }
+    else if(sMode == "singlecell") {
+        oSelf._handleSingleCellSelectionByKey(e);
+    }
+    
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
 
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
                 return;
+            case "tbody":
+                bKeepBubbling = oSelf.fireEvent("tbodyKeyEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
             }
         }
     }
-    YAHOO.log("Could not unselect row " + row, "warn", this.toString());
-};
+    oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Clears out all row selections.
+ * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
  *
- * @method unselectAllRows
+ * @method _onTableKeypress
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.unselectAllRows = function() {
-    // Remove from tracker
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(YAHOO.lang.isNumber(tracker[j])){
-            tracker.splice(j,1);
+_onTableKeypress : function(e, oSelf) {
+    if(ua.webkit) {
+        var nKey = Ev.getCharCode(e);
+        // arrow down
+        if(nKey == 40) {
+            Ev.stopEvent(e);
+        }
+        // arrow up
+        else if(nKey == 38) {
+            Ev.stopEvent(e);
         }
     }
-
-    // Update tracker
-    this._aSelections = tracker;
-
-    // Update UI
-    this._unselectAllTrEls();
-
-    //TODO: send an array of [{el:el,record:record}]
-    //TODO: or convert this to an unselectRows method
-    //TODO: that takes an array of rows or unselects all if none given
-    this.fireEvent("unselectAllRowsEvent");
-    YAHOO.log("Unselected all rows", "info", this.toString());
-};
+},
 
 /**
- * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
- * from all TD elements in the internal tracker.
+ * Handles click events on the THEAD element.
  *
- * @method _unselectAllTdEls
+ * @method _onTheadClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._unselectAllTdEls = function() {
-    var selectedCells = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
-    YAHOO.util.Dom.removeClass(selectedCells, YAHOO.widget.DataTable.CLASS_SELECTED);
-};
-
-/**
- * Returns array of selected TD elements on the page.
- *
- * @method getSelectedTdEls
- * @return {HTMLElement[]} Array of selected TD elements.
- */
-YAHOO.widget.DataTable.prototype.getSelectedTdEls = function() {
-    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
-};
-
-/**
- * Sets given cell to the selected state.
- *
- * @method selectCell
- * @param cell {HTMLElement | String} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- */
-YAHOO.widget.DataTable.prototype.selectCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-    
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        var nColumnId = elCell.yuiColumnId;
+_onTheadClick : function(e, oSelf) {
+    // Always blur the cell editor
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
 
-        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-
-            // Remove if there
-            for(var j=0; j<tracker.length; j++) {
-               if((tracker[j].recordId === nRecordId) && (tracker[j].columnId === nColumnId)){
-                    tracker.splice(j,1);
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
                 }
-            }
-
-            // Add to the end
-            tracker.push({recordId:nRecordId, columnId:nColumnId});
-
-            // Update trackers
-            this._aSelections = tracker;
-            this._sLastSelectedId = elCell.id;
-            if(!this._sSelectionAnchorId) {
-                this._sSelectionAnchorId = elCell.id;
-            }
-
-            // Update the UI
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-            this.fireEvent("cellSelectEvent", {record:oRecord,
-                    key: this._oColumnSet.getColumn(nColumnId).key, el:elCell});
-            YAHOO.log("Selected " + elCell, "info", this.toString());
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
             return;
         }
-    }
-    YAHOO.log("Could not select " + cell, "warn", this.toString());
-};
-
-/**
- * Sets given cell to the unselected state.
- *
- * @method unselectCell
- * @param cell {HTMLElement | String} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- */
-YAHOO.widget.DataTable.prototype.unselectCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        var nColumnId = elCell.yuiColumnId;
-
-        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var id = oRecord.getId();
-
-            // Is it selected?
-            for(var j=0; j<tracker.length; j++) {
-                if((tracker[j].recordId === id) && (tracker[j].columnId === nColumnId)){
-                    // Remove from tracker
-                    tracker.splice(j,1);
-                    
-                    // Update tracker
-                    this._aSelections = tracker;
-
-                    // Update the UI
-                    YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-                    this.fireEvent("cellUnselectEvent", {record:oRecord,
-                            key:this._oColumnSet.getColumn(nColumnId).key, el:elCell});
-                    YAHOO.log("Unselected " + elCell, "info", this.toString());
-
-                    return;
-                }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
             }
         }
     }
-    YAHOO.log("Could not unselect " + cell, "warn", this.toString());
-};
-
-/**
- * Clears out all cell selections.
- *
- * @method unselectAllCells
- */
-YAHOO.widget.DataTable.prototype.unselectAllCells= function() {
-    // Remove from tracker
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(tracker[j].constructor == Object){
-            tracker.splice(j,1);
-        }
-    }
-
-    // Update tracker
-    this._aSelections = tracker;
-
-    // Update UI
-    this._unselectAllTdEls();
-    
-    //TODO: send data
-    //TODO: or fire individual cellUnselectEvent
-    this.fireEvent("unselectAllCellsEvent");
-    YAHOO.log("Unselected all cells", "info", this.toString());
-};
-
-/**
- * Returns true if given TR or TD element is select, false otherwise.
- *
- * @method isSelected
- * @param el {HTMLElement} HTML element reference or ID of a TR or TD.
- * @return {Boolean} True if element is selected.
- */
-YAHOO.widget.DataTable.prototype.isSelected = function(el) {
-    return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);
-};
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Returns selected rows as an array of Record IDs.
+ * Handles click events on the primary TBODY element.
  *
- * @method getSelectedRows
- * @return {HTMLElement[]} Array of selected rows by Record ID.
+ * @method _onTbodyClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getSelectedRows = function() {
-    var aSelectedRows = [];
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(YAHOO.lang.isNumber(tracker[j])){
-            aSelectedRows.push(tracker[j]);
-        }
+_onTbodyClick : function(e, oSelf) {
+    // Always blur the cell editor
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
     }
-    return aSelectedRows;
-};
 
-/**
- * Returns selected cells as an array of object literals:
- *     {recordId:nRecordID, columnId:nColumnId}.
- *
- * @method getSelectedCells
- * @return {HTMLElement[]} Array of selected cells by Record and Column IDs.
- */
-YAHOO.widget.DataTable.prototype.getSelectedCells = function() {
-    var aSelectedCells = [];
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(tracker[j] && (tracker[j].constructor == Object)){
-            aSelectedCells.push({recordId:tracker[j].recordId, columnId:tracker[j].columnId});
+    // Fire Custom Events
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    bKeepBubbling = oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
+                }
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    bKeepBubbling = oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                bKeepBubbling = oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                bKeepBubbling = oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                bKeepBubbling = oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
         }
-    }
-    return aSelectedCells;
-};
-
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.
- *
- * @method highlightRow
- * @param row {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.highlightRow = function(row) {
-    var elRow = this.getTrEl(row);
-
-    if(elRow) {
-        // Make sure previous row is unhighlighted
-        if(this._sLastHighlightedRowId) {
-            YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        if(bKeepBubbling === false) {
+            return;
         }
-        var oRecord = this.getRecord(elRow);
-        YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this._sLastHighlightedRowId = elRow.id;
-        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
-        YAHOO.log("Highlighted " + elRow, "info", this.toString());
-        return;
-    }
-    YAHOO.log("Could not highlight " + row, "warn", this.toString());
-};
-
-/**
- * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.
- *
- * @method unhighlightRow
- * @param row {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.unhighlightRow = function(row) {
-    var elRow = this.getTrEl(row);
-
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
-        YAHOO.log("Unhighlighted " + elRow, "info", this.toString());
-        return;
-    }
-    YAHOO.log("Could not unhighlight " + row, "warn", this.toString());
-};
-
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.
- *
- * @method highlightCell
- * @param cell {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.highlightCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-
-    if(elCell) {
-        // Make sure previous cell is unhighlighted
-        if(this._sLastHighlightedCellId) {
-            YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
         }
-        
-        var oRecord = this.getRecord(elCell);
-        YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this._sLastHighlightedCellId = elCell.id;
-        this.fireEvent("cellHighlightEvent", {record:oRecord,
-                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
-        YAHOO.log("Highlighted " + elCell, "info", this.toString());
-        return;
     }
-    YAHOO.log("Could not highlight " + cell, "warn", this.toString());
-};
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
-/**
- * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given cell.
+/*TODO undeprecate?
+ * Handles change events on SELECT elements within DataTable.
  *
- * @method unhighlightCell
- * @param cell {HTMLElement | String} DOM element reference or ID string.
+ * @method _onDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
+ * @deprecated
  */
-YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this.fireEvent("cellUnhighlightEvent", {record:oRecord,
-                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
-        YAHOO.log("Unhighlighted " + elCell, "info", this.toString());
-        return;
-    }
-    YAHOO.log("Could not unhighlight " + cell, "warn", this.toString());
-};
-
-
-
-
-
-
-
-
+_onDropdownChange : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    //TODO: pass what args?
+    //var value = elTarget[elTarget.selectedIndex].value;
+    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
+},
 
 
 
@@ -5530,518 +8382,132 @@ YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
 
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
+/**
+ * Returns unique id assigned to instance, which is a useful prefix for
+ * generating unique DOM ID strings.
+ *
+ * @method getId
+ * @return {String} Unique ID of the DataSource instance.
+ */
+getId : function() {
+    return this._sId;
+},
 
+/**
+ * DataSource instance name, for logging.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
 
-// INLINE EDITING
+toString : function() {
+    return "DataTable instance " + this._sId;
+},
 
-/*TODO: for TAB handling
- * Shows Cell Editor for next cell.
+/**
+ * Returns the DataTable instance's DataSource instance.
  *
- * @method editNextCell
- * @param elCell {HTMLElement} Cell element from which to edit next cell.
+ * @method getDataSource
+ * @return {YAHOO.util.DataSource} DataSource instance.
  */
-//YAHOO.widget.DataTable.prototype.editNextCell = function(elCell) {
-//};
+getDataSource : function() {
+    return this._oDataSource;
+},
 
 /**
- * Shows Cell Editor for given cell.
+ * Returns the DataTable instance's ColumnSet instance.
  *
- * @method showCellEditor
- * @param elCell {HTMLElement | String} Cell element to edit.
- * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
- * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ * @method getColumnSet
+ * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
  */
-YAHOO.widget.DataTable.prototype.showCellEditor = function(elCell, oRecord, oColumn) {
-    elCell = YAHOO.util.Dom.get(elCell);
-    
-    if(elCell && (elCell.ownerDocument === document)) {
-        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
-            oRecord = this.getRecord(elCell);
-        }
-        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
-            oColumn = this.getColumn(elCell);
-        }
-        if(oRecord && oColumn) {
-            var oCellEditor = this._oCellEditor;
-            
-            // Clear previous Editor
-            if(oCellEditor.isActive) {
-                this.cancelCellEditor();
-            }
-
-            // Editor not defined
-            if(!oColumn.editor) {
-                return;
-            }
-            
-            // Update Editor values
-            oCellEditor.cell = elCell;
-            oCellEditor.record = oRecord;
-            oCellEditor.column = oColumn;
-            oCellEditor.validator = (oColumn.editorOptions &&
-                    YAHOO.lang.isFunction(oColumn.editorOptions.validator)) ?
-                    oColumn.editorOptions.validator : null;
-            oCellEditor.value = oRecord.getData(oColumn.key);
-
-            // Move Editor
-            var elContainer = oCellEditor.container;
-            var x = YAHOO.util.Dom.getX(elCell);
-            var y = YAHOO.util.Dom.getY(elCell);
-
-            // SF doesn't get xy for cells in scrolling table
-            // when tbody display is set to block
-            if(isNaN(x) || isNaN(y)) {
-                x = elCell.offsetLeft + // cell pos relative to table
-                        YAHOO.util.Dom.getX(this._elTable) - // plus table pos relative to document
-                        this._elTbody.scrollLeft; // minus tbody scroll
-                y = elCell.offsetTop + // cell pos relative to table
-                        YAHOO.util.Dom.getY(this._elTable) - // plus table pos relative to document
-                        this._elTbody.scrollTop + // minus tbody scroll
-                        this._elThead.offsetHeight; // account for fixed headers
-            }
-            
-            elContainer.style.left = x + "px";
-            elContainer.style.top = y + "px";
-
-            // Show Editor
-            elContainer.style.display = "";
-            
-            // Render Editor markup
-            var fnEditor;
-            if(YAHOO.lang.isString(oColumn.editor)) {
-                switch(oColumn.editor) {
-                    case "checkbox":
-                        fnEditor = YAHOO.widget.DataTable.editCheckbox;
-                        break;
-                    case "date":
-                        fnEditor = YAHOO.widget.DataTable.editDate;
-                        break;
-                    case "dropdown":
-                        fnEditor = YAHOO.widget.DataTable.editDropdown;
-                        break;
-                    case "radio":
-                        fnEditor = YAHOO.widget.DataTable.editRadio;
-                        break;
-                    case "textarea":
-                        fnEditor = YAHOO.widget.DataTable.editTextarea;
-                        break;
-                    case "textbox":
-                        fnEditor = YAHOO.widget.DataTable.editTextbox;
-                        break;
-                    default:
-                        fnEditor = null;
-                }
-            }
-            else if(YAHOO.lang.isFunction(oColumn.editor)) {
-                fnEditor = oColumn.editor;
-            }
-
-            if(fnEditor) {
-                // Create DOM input elements
-                fnEditor(this._oCellEditor, this);
-                
-                // Show Save/Cancel buttons
-                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
-                    this.showCellEditorBtns(elContainer);
-                }
-
-                // Hook to customize the UI
-                this.doBeforeShowCellEditor(this._oCellEditor);
-
-                oCellEditor.isActive = true;
-                
-                //TODO: verify which args to pass
-                this.fireEvent("editorShowEvent", {editor:oCellEditor});
-                YAHOO.log("Cell Editor shown for " + elCell, "info", this.toString());
-                return;
-            }
-        }
-    }
-    YAHOO.log("Could not show Cell Editor for " + elCell, "warn", this.toString());
-};
+getColumnSet : function() {
+    return this._oColumnSet;
+},
 
 /**
- * Overridable abstract method to customize Cell Editor UI.
+ * Returns the DataTable instance's RecordSet instance.
  *
- * @method doBeforeShowCellEditor
- * @param oCellEditor {Object} Cell Editor object literal.
+ * @method getRecordSet
+ * @return {YAHOO.widget.RecordSet} RecordSet instance.
  */
-YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor = function(oCellEditor) {
-};
+getRecordSet : function() {
+    return this._oRecordSet;
+},
 
 /**
- * Adds Save/Cancel buttons to Cell Editor.
+ * Returns the DataTable instance's Cell Editor as an object literal with the
+ * following properties:
+ * <dl>
+ * <dt>cell</dt>
+ * <dd>{HTMLElement} Cell element being edited.</dd>
  *
- * @method showCellEditorBtns
- * @param elContainer {HTMLElement} Cell Editor container.
+ * <dt>column</dt>
+ * <dd>{YAHOO.widget.Column} Associated Column instance.</dd>
+ *
+ * <dt>container</dt>
+ * <dd>{HTMLElement} Reference to editor's container DIV element.</dd>
+ *
+ * <dt>isActive</dt>
+ * <dd>{Boolean} True if cell is currently being edited.</dd>
+ *
+ * <dt>record</dt>
+ * <dd>{YAHOO.widget.Record} Associated Record instance.</dd>
+ *
+ * <dt>validator</dt>
+ * <dd>{HTMLFunction} Associated validator function called before new data is stored. Called
+ * within the scope of the DataTable instance, the function receieves the
+ * following arguments:
+ *
+ * <dl>
+ *  <dt>oNewData</dt>
+ *  <dd>{Object} New data to validate.</dd>
+ *
+ *  <dt>oOldData</dt>
+ *  <dd>{Object} Original data in case of reversion.</dd>
+ *
+ *  <dt>oCellEditor</dt>
+ *  <dd>{Object} Object literal representation of Editor values.</dd>
+ * </dl>
+ *
+ *  </dd>
+ *
+ * <dt>defaultValue</dt>
+ * <dd>Dynamically settable default value</dd>
+ * </dl>
+ *
+ * <dt>value</dt>
+ * <dd>Current input value</dd>
+ * </dl>
+ *
+ *
+ *
+ *
+ *
+ * @method getCellEditor
+ * @return {Object} Cell Editor object literal values.
  */
-YAHOO.widget.DataTable.prototype.showCellEditorBtns = function(elContainer) {
-    // Buttons
-    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
-    YAHOO.util.Dom.addClass(elBtnsDiv, YAHOO.widget.DataTable.CLASS_BUTTON);
+getCellEditor : function() {
+    return this._oCellEditor;
+},
 
-    // Save button
-    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
-    YAHOO.util.Dom.addClass(elSaveBtn, YAHOO.widget.DataTable.CLASS_DEFAULT);
-    elSaveBtn.innerHTML = "OK";
-    YAHOO.util.Event.addListener(elSaveBtn, "click", this.saveCellEditor, this, true);
 
-    // Cancel button
-    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
-    elCancelBtn.innerHTML = "Cancel";
-    YAHOO.util.Event.addListener(elCancelBtn, "click", this.cancelCellEditor, this, true);
-};
 
-/**
- * Clears Cell Editor of all state and UI.
- *
- * @method resetCellEditor
- */
 
-YAHOO.widget.DataTable.prototype.resetCellEditor = function() {
-    var elContainer = this._oCellEditor.container;
-    elContainer.style.display = "none";
-    YAHOO.util.Event.purgeElement(elContainer, true);
-    elContainer.innerHTML = "";
-    this._oCellEditor.value = null;
-    this._oCellEditor.isActive = false;
-};
 
-/**
- * Saves Cell Editor input to Record.
- *
- * @method saveCellEditor
- */
-YAHOO.widget.DataTable.prototype.saveCellEditor = function() {
-    //TODO: Copy the editor's values to pass to the event
-    if(this._oCellEditor.isActive) {
-        var newData = this._oCellEditor.value;
-        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
 
-        // Validate input data
-        if(this._oCellEditor.validator) {
-            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
-            if(this._oCellEditor.value === null ) {
-                this.resetCellEditor();
-                this.fireEvent("editorRevertEvent",
-                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
-                YAHOO.log("Could not save Cell Editor input due to invalid data " +
-                        YAHOO.lang.dump(newData), "warn", this.toString());
-                return;
-            }
-        }
-
-        // Update the Record
-        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
-
-        // Update the UI
-        this.formatCell(this._oCellEditor.cell);
-
-        // Clear out the Cell Editor
-        this.resetCellEditor();
-
-        this.fireEvent("editorSaveEvent",
-                {editor:this._oCellEditor, oldData:oldData, newData:newData});
-        YAHOO.log("Cell Editor input saved", "info", this.toString());
-    }
-    else {
-        YAHOO.log("Cell Editor not active to save input", "warn", this.toString());
-    }
-};
-
-/**
- * Cancels Cell Editor.
- *
- * @method cancelCellEditor
- */
-YAHOO.widget.DataTable.prototype.cancelCellEditor = function() {
-    if(this._oCellEditor.isActive) {
-        this.resetCellEditor();
-        //TODO: preserve values for the event?
-        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
-        YAHOO.log("Cell Editor input canceled", "info", this.toString());
-    }
-    else {
-        YAHOO.log("Cell Editor not active to cancel input", "warn", this.toString());
-    }
-};
-
-/**
- * Enables CHECKBOX Editor.
- *
- * @method editCheckbox
- */
-//YAHOO.widget.DataTable.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) {
-YAHOO.widget.DataTable.editCheckbox = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var aCheckedValues = oRecord.getData(oColumn.key);
-    if(!YAHOO.lang.isArray(aCheckedValues)) {
-        aCheckedValues = [aCheckedValues];
-    }
-
-    // Checkboxes
-    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)) {
-        var checkboxOptions = oColumn.editorOptions.checkboxOptions;
-        var checkboxValue, checkboxId, elLabel, j, k;
-        // First create the checkbox buttons in an IE-friendly way
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxValue = YAHOO.lang.isValue(checkboxOptions[j].label) ?
-                    checkboxOptions[j].label : checkboxOptions[j];
-            checkboxId =  oSelf.id + "-editor-checkbox" + j;
-            elContainer.innerHTML += "<input type=\"checkbox\"" +
-                    " name=\"" + oSelf.id + "-editor-checkbox\"" +
-                    " value=\"" + checkboxValue + "\"" +
-                    " id=\"" +  checkboxId + "\">";
-            // Then create the labels in an IE-friendly way
-            elLabel = elContainer.appendChild(document.createElement("label"));
-            elLabel.htmlFor = checkboxId;
-            elLabel.innerHTML = checkboxValue;
-        }
-        var aCheckboxEls = [];
-        var checkboxEl;
-        // Loop through checkboxes to check them
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
-            aCheckboxEls.push(checkboxEl);
-            for(k=0; k<aCheckedValues.length; k++) {
-                if(checkboxEl.value === aCheckedValues[k]) {
-                    checkboxEl.checked = true;
-                }
-            }
-            // Focus the first checkbox
-            if(j===0) {
-                oSelf._focusEl(checkboxEl);
-            }
-        }
-        // Loop through checkboxes to assign click handlers
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
-            YAHOO.util.Event.addListener(checkboxEl, "click", function(){
-                var aNewValues = [];
-                for(var m=0; m<aCheckboxEls.length; m++) {
-                    if(aCheckboxEls[m].checked) {
-                        aNewValues.push(aCheckboxEls[m].value);
-                    }
-                }
-                oSelf._oCellEditor.value = aNewValues;
-                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-            });
-        }
-    }
-};
-
-/**
- * Enables Date Editor.
- *
- * @method editDate
- */
-YAHOO.widget.DataTable.editDate = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Calendar widget
-    if(YAHOO.widget.Calendar) {
-        var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
-        var calContainer = elContainer.appendChild(document.createElement("div"));
-        calContainer.id = "yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-dateContainer";
-        var calendar =
-                new YAHOO.widget.Calendar("yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-date",
-                calContainer.id,
-                {selected:selectedValue, pagedate:value});
-        calendar.render();
-        calContainer.style.cssFloat = "none";
-
-        //var calFloatClearer = elContainer.appendChild(document.createElement("br"));
-        //calFloatClearer.style.clear = "both";
-        
-        calendar.selectEvent.subscribe(function(type, args, obj) {
-            oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
-        });
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    }
-    else {
-        //TODO;
-    }
-};
-
-/**
- * Enables SELECT Editor.
- *
- * @method editDropdown
- */
-YAHOO.widget.DataTable.editDropdown = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Textbox
-    var elDropdown = elContainer.appendChild(document.createElement("select"));
-    var dropdownOptions = (oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
-            oColumn.editorOptions.dropdownOptions : [];
-    for(var j=0; j<dropdownOptions.length; j++) {
-        var dropdownOption = dropdownOptions[j];
-        var elOption = document.createElement("option");
-        elOption.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
-                dropdownOption.value : dropdownOption;
-        elOption.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
-                dropdownOption.text : dropdownOption;
-        elOption = elDropdown.appendChild(elOption);
-        if(value === elDropdown.options[j].value) {
-            elDropdown.options[j].selected = true;
-        }
-    }
-    
-    // Set up a listener on each check box to track the input value
-    YAHOO.util.Event.addListener(elDropdown, "change",
-        function(){
-            oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
-            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
-            
-    // Focus the dropdown
-    oSelf._focusEl(elDropdown);
-};
-
-/**
- * Enables INPUT TYPE=RADIO Editor.
- *
- * @method editRadio
- */
-YAHOO.widget.DataTable.editRadio = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Radios
-    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)) {
-        var radioOptions = oColumn.editorOptions.radioOptions;
-        var radioValue, radioId, elLabel, j;
-        // First create the radio buttons in an IE-friendly way
-        for(j=0; j<radioOptions.length; j++) {
-            radioValue = YAHOO.lang.isValue(radioOptions[j].label) ?
-                    radioOptions[j].label : radioOptions[j];
-            radioId =  oSelf.id + "-editor-radio" + j;
-            elContainer.innerHTML += "<input type=\"radio\"" +
-                    " name=\"" + oSelf.id + "-editor-radio\"" +
-                    " value=\"" + radioValue + "\"" +
-                    " id=\"" +  radioId + "\">";
-            // Then create the labels in an IE-friendly way
-            elLabel = elContainer.appendChild(document.createElement("label"));
-            elLabel.htmlFor = radioId;
-            elLabel.innerHTML = radioValue;
-        }
-        // Then check one, and assign click handlers
-        for(j=0; j<radioOptions.length; j++) {
-            var radioEl = YAHOO.util.Dom.get(oSelf.id + "-editor-radio" + j);
-            if(value === radioEl.value) {
-                radioEl.checked = true;
-                oSelf._focusEl(radioEl);
-            }
-            YAHOO.util.Event.addListener(radioEl, "click",
-                function(){
-                    oSelf._oCellEditor.value = this.value;
-                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-            });
-        }
-    }
-};
-
-/**
- * Enables TEXTAREA Editor.
- *
- * @method editTextarea
- */
-YAHOO.widget.DataTable.editTextarea = function(oEditor, oSelf) {
-   var elCell = oEditor.cell;
-   var oRecord = oEditor.record;
-   var oColumn = oEditor.column;
-   var elContainer = oEditor.container;
-   var value = oRecord.getData(oColumn.key);
-
-    // Textarea
-    var elTextarea = elContainer.appendChild(document.createElement("textarea"));
-    elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
-    elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
-    elTextarea.value = YAHOO.lang.isValue(value) ? value : "";
-    
-    // Set up a listener on each check box to track the input value
-    YAHOO.util.Event.addListener(elTextarea, "keyup", function(){
-        //TODO: set on a timeout
-        oSelf._oCellEditor.value = elTextarea.value;
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
-    
-    // Select the text
-    elTextarea.focus();
-    elTextarea.select();
-};
-
-/**
- * Enables INPUT TYPE=TEXT Editor.
- *
- * @method editTextbox
- */
-YAHOO.widget.DataTable.editTextbox = function(oEditor, oSelf) {
-   var elCell = oEditor.cell;
-   var oRecord = oEditor.record;
-   var oColumn = oEditor.column;
-   var elContainer = oEditor.container;
-   var value = YAHOO.lang.isValue(oRecord.getData(oColumn.key)) ? oRecord.getData(oColumn.key) : "";
-
-    // Textbox
-    var elTextbox = elContainer.appendChild(document.createElement("input"));
-    elTextbox.type = "text";
-    elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
-    //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
-    elTextbox.value = value;
-
-    // Set up a listener on each textbox to track the input value
-    YAHOO.util.Event.addListener(elTextbox, "keyup", function(){
-        //TODO: set on a timeout
-        oSelf._oCellEditor.value = elTextbox.value;
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
-
-    // Select the text
-    elTextbox.focus();
-    elTextbox.select();
-};
-
-/*
- * Validates Editor input value to type Number, doing type conversion as
- * necessary. A valid Number value is return, else the previous value is returned
- * if input value does not validate.
- * 
- *
- * @method validateNumber
- * @static
-*/
-YAHOO.widget.DataTable.validateNumber = function(oData) {
-    //Convert to number
-    var number = oData * 1;
-
-    // Validate
-    if(YAHOO.lang.isNumber(number)) {
-        return number;
-    }
-    else {
-        YAHOO.log("Could not validate data " + YAHOO.lang.dump(oData) + " to type Number", "warn", this.toString());
-        return null;
-    }
-};
 
 
 
@@ -6079,52 +8545,507 @@ YAHOO.widget.DataTable.validateNumber = function(oData) {
 
 
 
+// DOM ACCESSORS
 
-// ABSTRACT METHODS
+/**
+ * Returns DOM reference to the DataTable's container element.
+ *
+ * @method getContainerEl
+ * @return {HTMLElement} Reference to DIV element.
+ */
+getContainerEl : function() {
+    return this._elContainer;
+},
 
 /**
- * Overridable method gives implementers a hook to access data before
- * it gets added to RecordSet and rendered to the TBODY.
+ * Returns DOM reference to the DataTable's THEAD element.
  *
- * @method doBeforeLoadData
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @return {Boolean} Return true to continue loading data into RecordSet and
- * updating DataTable with new Records, false to cancel.
+ * @method getTheadEl
+ * @return {HTMLElement} Reference to THEAD element.
  */
-YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse) {
-    return true;
-};
+getTheadEl : function() {
+    return this._elThead;
+},
 
+/**
+ * Returns DOM reference to the DataTable's primary TBODY element.
+ *
+ * @method getTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+getTbodyEl : function() {
+    return this._elTbody;
+},
 
+/**
+ * Returns DOM reference to the DataTable's secondary TBODY element that is
+ * used to display messages.
+ *
+ * @method getMsgTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+getMsgTbodyEl : function() {
+    return this._elMsgTbody;
+},
 
+/**
+ * Returns DOM reference to the TD element within the secondary TBODY that is
+ * used to display messages.
+ *
+ * @method getMsgTdEl
+ * @return {HTMLElement} Reference to TD element.
+ */
+getMsgTdEl : function() {
+    return this._elMsgTd;
+},
 
+/**
+ * Returns the corresponding TR reference for a given DOM element, ID string or
+ * directly page row index. If the given identifier is a child of a TR element,
+ * then DOM tree is traversed until a parent TR element is returned, otherwise
+ * null.
+ *
+ * @method getTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
+ * get: by element reference, ID string, page row index, or Record.
+ * @return {HTMLElement} Reference to TR element, or null.
+ */
+getTrEl : function(row) {
+    var allRows = this._elTbody.rows;
 
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        var nTrIndex = this.getTrIndex(row);
+            if(nTrIndex !== null) {
+                return allRows[nTrIndex];
+            }
+            // Not a valid Record
+            else {
+                return null;
+            }
+    }
+    // By page row index
+    else if(lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
+        return allRows[row];
+    }
+    // By ID string or element reference
+    else {
+        var elRow;
+        var el = Dom.get(row);
 
+        // Validate HTML element
+        if(el && (el.ownerDocument == document)) {
+            // Validate TR element
+            if(el.nodeName.toLowerCase() != "tr") {
+                // Traverse up the DOM to find the corresponding TR element
+                elRow = Dom.getAncestorByTagName(el,"tr");
+            }
+            else {
+                elRow = el;
+            }
 
+            // Make sure the TR is in this TBODY
+            if(elRow && (elRow.parentNode == this._elTbody)) {
+                // Now we can return the TR element
+                return elRow;
+            }
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to the first TR element in the DataTable page, or null.
+ *
+ * @method getFirstTrEl
+ * @return {HTMLElement} Reference to TR element.
+ */
+getFirstTrEl : function() {
+    return this._elTbody.rows[0] || null;
+},
 
+/**
+ * Returns DOM reference to the last TR element in the DataTable page, or null.
+ *
+ * @method getLastTrEl
+ * @return {HTMLElement} Reference to last TR element.
+ */
+getLastTrEl : function() {
+    var allRows = this._elTbody.rows;
+        if(allRows.length > 0) {
+            return allRows[allRows.length-1] || null;
+        }
+},
 
+/**
+ * Returns DOM reference to the next TR element from the given TR element, or null.
+ *
+ * @method getNextTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element
+ * reference, ID string, page row index, or Record from which to get next TR element.
+ * @return {HTMLElement} Reference to next TR element.
+ */
+getNextTrEl : function(row) {
+    var nThisTrIndex = this.getTrIndex(row);
+    if(nThisTrIndex !== null) {
+        var allRows = this._elTbody.rows;
+        if(nThisTrIndex < allRows.length-1) {
+            return allRows[nThisTrIndex+1];
+        }
+    }
 
+    YAHOO.log("Could not get next TR element for row " + row, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the previous TR element from the given TR element, or null.
+ *
+ * @method getPreviousTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element
+ * reference, ID string, page row index, or Record from which to get previous TR element.
+ * @return {HTMLElement} Reference to previous TR element.
+ */
+getPreviousTrEl : function(row) {
+    var nThisTrIndex = this.getTrIndex(row);
+    if(nThisTrIndex !== null) {
+        var allRows = this._elTbody.rows;
+        if(nThisTrIndex > 0) {
+            return allRows[nThisTrIndex-1];
+        }
+    }
 
+    YAHOO.log("Could not get previous TR element for row " + row, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to a TD liner element.
+ *
+ * @method getTdLinerEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn}.
+ * @return {HTMLElement} Reference to TD liner element.
+ */
+getTdLinerEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    return elCell.firstChild || null;
+},
 
+/**
+ * Returns DOM reference to a TD element.
+ *
+ * @method getTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn}.
+ * @return {HTMLElement} Reference to TD element.
+ */
+getTdEl : function(cell) {
+    var elCell;
+    var el = Dom.get(cell);
 
+    // Validate HTML element
+    if(el && (el.ownerDocument == document)) {
+        // Validate TD element
+        if(el.nodeName.toLowerCase() != "td") {
+            // Traverse up the DOM to find the corresponding TR element
+            elCell = Dom.getAncestorByTagName(el, "td");
+        }
+        else {
+            elCell = el;
+        }
 
+        // Make sure the TD is in this TBODY
+        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
+            // Now we can return the TD element
+            return elCell;
+        }
+    }
+    else if(cell) {
+        var oRecord, nColKeyIndex;
 
+        if(lang.isString(cell.columnId) && lang.isString(cell.recordId)) {
+            oRecord = this.getRecord(cell.recordId);
+            var oColumn = this.getColumnById(cell.columnId);
+            if(oColumn) {
+                nColKeyIndex = oColumn.getKeyIndex();
+            }
 
+        }
+        if(cell.record && cell.column && cell.column.getKeyIndex) {
+            oRecord = cell.record;
+            nColKeyIndex = cell.column.getKeyIndex();
+        }
+        var elRow = this.getTrEl(oRecord);
+        if((nColKeyIndex !== null) && elRow && elRow.cells && elRow.cells.length > 0) {
+            return elRow.cells[nColKeyIndex] || null;
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to the first TD element in the DataTable page (by default),
+ * the first TD element of the optionally given row, or null.
+ *
+ * @method getFirstTdEl
+ * @param row {HTMLElement} (optional) row from which to get first TD
+ * @return {HTMLElement} Reference to TD element.
+ */
+getFirstTdEl : function(row) {
+    var elRow = this.getTrEl(row) || this.getFirstTrEl();
+    if(elRow && (elRow.cells.length > 0)) {
+        return elRow.cells[0];
+    }
+    YAHOO.log("Could not get first TD element for row " + elRow, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the last TD element in the DataTable page (by default),
+ * the first TD element of the optionally given row, or null.
+ *
+ * @method getLastTdEl
+ * @return {HTMLElement} Reference to last TD element.
+ */
+getLastTdEl : function(row) {
+    var elRow = this.getTrEl(row) || this.getLastTrEl();
+    if(elRow && (elRow.cells.length > 0)) {
+        return elRow.cells[elRow.cells.length-1];
+    }
+    YAHOO.log("Could not get last TD element for row " + elRow, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the next TD element from the given cell, or null.
+ *
+ * @method getNextTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.
+ * @return {HTMLElement} Reference to next TD element, or null.
+ */
+getNextTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var nThisTdIndex = elCell.yuiCellIndex;
+        var elRow = this.getTrEl(elCell);
+        if(nThisTdIndex < elRow.cells.length-1) {
+            return elRow.cells[nThisTdIndex+1];
+        }
+        else {
+            var elNextRow = this.getNextTrEl(elRow);
+            if(elNextRow) {
+                return elNextRow.cells[0];
+            }
+        }
+    }
+    YAHOO.log("Could not get next TD element for cell " + cell, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the previous TD element from the given cell, or null.
+ *
+ * @method getPreviousTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.
+ * @return {HTMLElement} Reference to previous TD element, or null.
+ */
+getPreviousTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var nThisTdIndex = elCell.yuiCellIndex;
+        var elRow = this.getTrEl(elCell);
+        if(nThisTdIndex > 0) {
+            return elRow.cells[nThisTdIndex-1];
+        }
+        else {
+            var elPreviousRow = this.getPreviousTrEl(elRow);
+            if(elPreviousRow) {
+                return this.getLastTdEl(elPreviousRow);
+            }
+        }
+    }
+    YAHOO.log("Could not get next TD element for cell " + cell, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the above TD element from the given cell, or null.
+ *
+ * @method getAboveTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.
+ * @return {HTMLElement} Reference to next TD element, or null.
+ */
+getAboveTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var elPreviousRow = this.getPreviousTrEl(elCell);
+        if(elPreviousRow) {
+            return elPreviousRow.cells[elCell.yuiCellIndex];
+        }
+    }
+    YAHOO.log("Could not get above TD element for cell " + cell, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to the below TD element from the given cell, or null.
+ *
+ * @method getBelowTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.
+ * @return {HTMLElement} Reference to previous TD element, or null.
+ */
+getBelowTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var elNextRow = this.getNextTrEl(elCell);
+        if(elNextRow) {
+            return elNextRow.cells[elCell.yuiCellIndex];
+        }
+    }
+    YAHOO.log("Could not get below TD element for cell " + cell, "info", this.toString());
+    return null;
+},
 
+/**
+ * Returns DOM reference to a TH liner element.
+ *
+ * @method getThLinerEl
+ * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,
+ * DOM element reference, or string ID.
+ * @return {HTMLElement} Reference to TH liner element.
+ */
+getThLinerEl : function(theadCell) {
+    var elCell = this.getThEl(theadCell);
+    return elCell.firstChild || null;
+},
 
+/**
+ * Returns DOM reference to a TH element.
+ *
+ * @method getThEl
+ * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,
+ * DOM element reference, or string ID.
+ * @return {HTMLElement} Reference to TH element.
+ */
+getThEl : function(theadCell) {
+    var elTheadCell;
 
+    // Validate Column instance
+    if(theadCell instanceof YAHOO.widget.Column) {
+        var oColumn = theadCell;
+        elTheadCell = oColumn.getThEl();
+        if(elTheadCell) {
+            return elTheadCell;
+        }
+    }
+    // Validate HTML element
+    else {
+        var el = Dom.get(theadCell);
+
+        if(el && (el.ownerDocument == document)) {
+            // Validate TH element
+            if(el.nodeName.toLowerCase() != "th") {
+                // Traverse up the DOM to find the corresponding TR element
+                elTheadCell = Dom.getAncestorByTagName(el,"th");
+            }
+            else {
+                elTheadCell = el;
+            }
+
+            // Make sure the TH is in this THEAD
+            if(elTheadCell && (elTheadCell.parentNode.parentNode == this._elThead)) {
+                // Now we can return the TD element
+                return elTheadCell;
+            }
+        }
+    }
+
+    return null;
+},
+
+/**
+ * Returns the page row index of given row. Returns null if the row is not on the
+ * current DataTable page.
+ *
+ * @method getTrIndex
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
+ * string reference to an element within the DataTable page, a Record instance,
+ * or a Record's RecordSet index.
+ * @return {Number} Page row index, or null if row does not exist or is not on current page.
+ */
+getTrIndex : function(row) {
+    var nRecordIndex;
+
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        nRecordIndex = this._oRecordSet.getRecordIndex(row);
+        if(nRecordIndex === null) {
+            // Not a valid Record
+            return null;
+        }
+    }
+    // Calculate page row index from Record index
+    else if(lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    if(lang.isNumber(nRecordIndex)) {
+        // Validate the number
+        if((nRecordIndex > -1) && (nRecordIndex < this._oRecordSet.getLength())) {
+            // DataTable is paginated
+            var oPaginator = this.get('paginator');
+            if(oPaginator instanceof Pag || this.get('paginated')) {
+                // Get the first and last Record on current page
+                var startRecordIndex = 0,
+                    endRecordIndex   = 0;
+
+                if (oPaginator instanceof Pag) {
+                    var rng = oPaginator.getPageRecords();
+                    startRecordIndex = rng[0];
+                    endRecordIndex   = rng[1];
+                } else {
+                    startRecordIndex = oPaginator.startRecordIndex;
+                    endRecordIndex = startRecordIndex + oPaginator.rowsPerPage - 1;
+                }
+
+                // This Record is on current page
+                if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
+                    return nRecordIndex - startRecordIndex;
+                }
+                // This Record is not on current page
+                else {
+                    return null;
+                }
+            }
+            // Not paginated, just return the Record index
+            else {
+                return nRecordIndex;
+            }
+        }
+        // RecordSet index is out of range
+        else {
+            return null;
+        }
+    }
+    // By element reference or ID string
+    else {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow && (elRow.ownerDocument == document) &&
+                (elRow.parentNode == this._elTbody)) {
+            return elRow.sectionRowIndex;
+        }
+    }
+
+    YAHOO.log("Could not get page row index for row " + row, "info", this.toString());
+    return null;
+},
 
 
 
@@ -6158,583 +9079,427 @@ YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse
 
 
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public Custom Event Handlers
-//
-/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TABLE FUNCTIONS
 
 /**
- * Overridable custom event handler to sort Column.
+ * Resets a RecordSet with the given data and populates the page view
+ * with the new data. Any previous data and selection states are cleared.
+ * However, sort states are not cleared, so if the given data is in a particular
+ * sort order, implementers should take care to reset the sortedBy property. If
+ * pagination is enabled, the currentPage is shown and Paginator UI updated,
+ * otherwise all rows are displayed as a single page. For performance, existing
+ * DOM elements are reused when possible.
  *
- * @method onEventSortColumn
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method initializeTable
  */
-YAHOO.widget.DataTable.prototype.onEventSortColumn = function(oArgs) {
-//TODO: support nested header column sorting
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    YAHOO.util.Event.stopEvent(evt);
+initializeTable : function() {
+    // Reset init flag
+    this._bInit = true;
     
-    var el = this.getThEl(target) || this.getTdEl(target);
-    if(el && YAHOO.lang.isNumber(el.yuiColumnId)) {
-        this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));
-    }
-    else {
-        YAHOO.log("Could not sort column " + target, "warn", this.toString());
-    }
-};
+    // Clear the RecordSet
+    this._oRecordSet.reset();
+
+    // Clear selections
+    this._unselectAllTrEls();
+    this._unselectAllTdEls();
+    this._aSelections = null;
+    this._oAnchorRecord = null;
+    this._oAnchorCell = null;
+},
 
 /**
- * Overridable custom event handler to manage selection according to desktop paradigm.
+ * Renders the view with existing Records from the RecordSet while
+ * maintaining sort, pagination, and selection states. For performance, reuses
+ * existing DOM elements when possible while deleting extraneous elements.
  *
- * @method onEventSelectRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method render
  */
-YAHOO.widget.DataTable.prototype.onEventSelectRow = function(oArgs) {
-    var sMode = this.get("selectionMode");
-    if ((sMode == "singlecell") || (sMode == "cellblock") || (sMode == "cellrange")) {
-        return;
+render : function() {
+    this._oChain.stop();
+    this.showTableMessage(DT.MSG_LOADING, DT.CLASS_LOADING);
+    YAHOO.log("DataTable rendering...", "info", this.toString());
+
+    var i, j, k, l, len, allRecords;
+
+    // Paginator is enabled, show a subset of Records and update Paginator UI
+    var oPaginator = this.get('paginator');
+    var bPaginated = oPaginator instanceof Pag || this.get('paginated');
+    if(bPaginated) {
+        if (oPaginator instanceof Pag) {
+            allRecords = this._oRecordSet.getRecords(
+                            oPaginator.getStartIndex(),
+                            oPaginator.getRowsPerPage());
+            oPaginator.render();
+        }
+        else {
+            // Backward compatibility
+            this.updatePaginator();
+            var rowsPerPage = oPaginator.rowsPerPage;
+            var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
+            allRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
+            this.formatPaginators();
+        }
+    }
+    // Show all records
+    else {
+        allRecords = this._oRecordSet.getRecords();
     }
 
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
+    var elTbody = this._elTbody;
+    var allRows = elTbody.rows;
 
-    var bSHIFT = evt.shiftKey;
-    var bCTRL = evt.ctrlKey;
-    var i, nAnchorTrIndex;
+    // Should have rows
+    if(lang.isArray(allRecords) && (allRecords.length > 0)) {
+        // Keep track of selected rows
+        var allSelectedRows = this.getSelectedRows();
+        // Keep track of selected cells
+        var allSelectedCells = this.getSelectedCells();
+        // Anything to reinstate?
+        var bReselect = (allSelectedRows.length>0) || (allSelectedCells.length > 0);
 
-    // Validate target row
-    var elTargetRow = this.getTrEl(elTarget);
-    if(elTargetRow) {
-        var allRows = this._elTbody.rows;
-        var nTargetTrIndex = elTargetRow.sectionRowIndex;
-        var elAnchorRow = YAHOO.util.Dom.get(this._sSelectionAnchorId);
-        
-        // Both SHIFT and CTRL
-        if((sMode != "single") && bSHIFT && bCTRL) {
-            // Validate anchor row
-            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
-                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
-                if(this.isSelected(elAnchorRow)) {
-                    // Select all rows between anchor row and target row, including target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex; i++) {
-                            if(!this.isSelected(allRows[i])) {
-                                this.selectRow(allRows[i]);
-                            }
+        // Remove extra rows from the bottom so as to preserve ID order
+        while(elTbody.hasChildNodes() && (allRows.length > allRecords.length)) {
+            elTbody.deleteRow(-1);
+        }
+
+        // Unselect all TR and TD elements in the UI
+        if(bReselect) {
+            this._unselectAllTrEls();
+            this._unselectAllTdEls();
+        }
+
+        this.hideTableMessage();
+
+        // How many rows to work with each loop
+        var loopN = this.get("renderLoopSize");
+        var loopStart,
+            loopEnd;
+
+        // From the top, update in-place existing rows, so as to reuse DOM elements
+        if(allRows.length > 0) {
+            loopEnd = allRows.length; // End at last row
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        var i = oArg.nCurrentRow,
+                            // Must reference allRows.length instead of loopEnd
+                            // here because loopEnd is reused below outside
+                            // this closure.
+                            len = loopN > 0 ? Math.min(i + loopN,allRows.length) : allRows.length;
+                        for(; i < len; ++i) {
+                            this._updateTrEl(allRows[i], allRecords[i]);
                         }
-                    }
-                    // Select all rows between target row and anchor row, including target row
-                    else {
-                        for(i=nAnchorTrIndex-1; i>=nTargetTrIndex; i--) {
-                            if(!this.isSelected(allRows[i])) {
-                                this.selectRow(allRows[i]);
-                            }
+                        if (loopN > 0) {
+                            this._syncColWidths();
                         }
+                        oArg.nCurrentRow = i;
                     }
-                }
-                else {
-                    // Unselect all rows between anchor row and target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex-1; i++) {
-                            if(this.isSelected(allRows[i])) {
-                                this.unselectRow(allRows[i]);
-                            }
+                },
+                iterations: (loopN > 0) ? Math.ceil(loopEnd/loopN) : 1,
+                argument: {nCurrentRow:0}, // Start at first row
+                scope: this,
+                timeout: (loopN > 0) ? 0 : -1
+            });
+        }
+
+        // Add more TR elements as necessary
+        loopStart = allRows.length; // where to start
+        loopEnd = allRecords.length; // where to end
+        var nRowsNeeded = (loopEnd - loopStart); // how many needed
+        if(nRowsNeeded > 0) {
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        var i = oArg.nCurrentRow,
+                            len = loopN > 0 ? Math.min(i + loopN,loopEnd) : loopEnd,
+                            df = document.createDocumentFragment(),
+                            tr;
+                        for(; i < len; ++i) {
+                            tr = this._createTrEl(allRecords[i]);
+                            tr.className = (i%2) ? DT.CLASS_ODD : DT.CLASS_EVEN;
+                            df.appendChild(tr);
                         }
+                        this._elTbody.appendChild(df);
+                        if (loopN > 0) {
+                            this._syncColWidths();
+                        }
+                        oArg.nCurrentRow = i;
                     }
-                    // Unselect all rows between target row and anchor row
-                    else {
-                        for(i=nTargetTrIndex+1; i<=nAnchorTrIndex-1; i++) {
-                            if(this.isSelected(allRows[i])) {
-                                this.unselectRow(allRows[i]);
+                },
+                iterations: (loopN > 0) ? Math.ceil(nRowsNeeded/loopN) : 1,
+                argument: {nCurrentRow:loopStart}, // start at last row
+                scope: this,
+                timeout: (loopN > 0) ? 0 : -1
+            });
+        }
+
+        this._oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId) {
+                    this._setFirstRow();
+                    this._setLastRow();
+
+                    // Reinstate selected and sorted classes
+                    if(bReselect) {
+                        // Loop over each row
+                        for(j=0; j<allRows.length; j++) {
+                            var thisRow = allRows[j];
+                            var sMode = this.get("selectionMode");
+                            if ((sMode == "standard") || (sMode == "single")) {
+                                // Set SELECTED
+                                for(k=0; k<allSelectedRows.length; k++) {
+                                    if(allSelectedRows[k] === thisRow.yuiRecordId) {
+                                        Dom.addClass(thisRow, DT.CLASS_SELECTED);
+                                        if(j === allRows.length-1) {
+                                            this._oAnchorRecord = this.getRecord(thisRow.yuiRecordId);
+                                        }
+                                    }
+                                }
+                            }
+                            else {
+                                // Loop over each cell
+                                for(k=0; k<thisRow.cells.length; k++) {
+                                    var thisCell = thisRow.cells[k];
+                                    // Set SELECTED
+                                    for(l=0; l<allSelectedCells.length; l++) {
+                                        if((allSelectedCells[l].recordId === thisRow.yuiRecordId) &&
+                                                (allSelectedCells[l].columnId === thisCell.yuiColumnId)) {
+                                            Dom.addClass(thisCell, DT.CLASS_SELECTED);
+                                            if(k === thisRow.cells.length-1) {
+                                                this._oAnchorCell = {record:this.getRecord(thisRow.yuiRecordId), column:this.getColumnById(thisCell.yuiColumnId)};
+                                            }
+                                        }
+                                    }
+                                }
                             }
                         }
                     }
-                    // Select the target row
-                    this.selectRow(elTargetRow);
                 }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetRow.id;
-
-                // Toggle selection of target
-                if(this.isSelected(elTargetRow)) {
-                    this.unselectRow(elTargetRow);
+                
+                if(this._bInit) {
+                    this._oChain.add({
+                        method: function() {
+                            if((this instanceof DT) && this._sId && this._bInit) {
+                                this._bInit = false;
+                                this.fireEvent("initEvent");
+                                YAHOO.log("DataTable initialized with " + allRecords.length + " of " + this._oRecordSet.getLength() + " rows", "info", this.toString());
+                            }
+                        },
+                        scope: this
+                    });
+                    this._oChain.run();
                 }
                 else {
-                    this.selectRow(elTargetRow);
+                    this.fireEvent("renderEvent");
+                    // Backward compatibility
+                    this.fireEvent("refreshEvent");
+                    YAHOO.log("DataTable rendered " + allRecords.length + " of " + this._oRecordSet.getLength() + " rows", "info", this.toString());
                 }
-            }
-        }
-        // Only SHIFT
-        else if((sMode != "single") && bSHIFT) {
-            this.unselectAllRows();
-
-            // Validate anchor
-            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
-                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
-
-                // Select all rows between anchor row and target row,
-                // including the anchor row and target row
-                if(nAnchorTrIndex < nTargetTrIndex) {
-                    for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                        this.selectRow(allRows[i]);
-                    }
+            
+            
+            },
+            scope: this,
+            timeout: (loopN > 0) ? 0 : -1
+        }); 
+        
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId) {
+                    this._syncColWidths();
                 }
-                // Select all rows between target row and anchor row,
-                // including the target row and anchor row
-                else {
-                    for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
-                        this.selectRow(allRows[i]);
+            },
+            scope: this
+        });
+        
+        // Bug 1741322: Force FF to redraw to fix squishy headers on wide tables
+        if(ua.gecko) {
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        Dom.removeClass(this.getContainerEl(),"yui-dt-noop");
                     }
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetRow.id;
-
-                // Select target row only
-                this.selectRow(elTargetRow);
-            }
-        }
-        // Only CTRL
-        else if((sMode != "single") && bCTRL) {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetRow.id;
-
-            // Toggle selection of target
-            if(this.isSelected(elTargetRow)) {
-                this.unselectRow(elTargetRow);
-            }
-            else {
-                this.selectRow(elTargetRow);
-            }
+                },
+                scope: this
+            });
+            this._oChain.add({
+                method: function() {
+                    if((this instanceof DT) && this._sId) {
+                        Dom.addClass(this.getContainerEl(),"yui-dt-noop");
+                    }
+                },
+                scope:this
+            });
         }
-        // Neither SHIFT nor CTRL
-        else if(sMode == "single") {
-            this.unselectAllRows();
-            this.selectRow(elTargetRow);
+            
+        this._oChain.run();  
+    }
+    // Empty
+    else {
+        // Remove all rows
+        while(elTbody.hasChildNodes()) {
+            elTbody.deleteRow(-1);
         }
-        // Neither SHIFT nor CTRL
-        else {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetRow.id;
 
-            // Select only target
-            this.unselectAllRows();
-            this.selectRow(elTargetRow);
-        }
-        YAHOO.util.Event.stopEvent(evt);
+        this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+    }
+},
 
-        // Clear any selections that are a byproduct of the click or dblclick
-        var sel;
-        if(window.getSelection) {
-               sel = window.getSelection();
-        }
-        else if(document.getSelection) {
-               sel = document.getSelection();
+/**
+ * Nulls out the entire DataTable instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+destroy : function() {
+    this._oChain.stop();
+    
+    //TODO: destroy static resizer proxy and column proxy?
+    
+    var i;
+    // Destroy ColumnDDs
+    var aTree = this._oColumnSet.tree[0];
+    for(i=0; i<aTree.length; i++) {
+        if(aTree[i]._dd) {
+            aTree[i]._dd = aTree[i]._dd.unreg();
         }
-        else if(document.selection) {
-               sel = document.selection;
+    }
+
+    // Destroy ColumnResizers
+    var aKeys = this._oColumnSet.keys;
+    for(i=0; i<aKeys.length; i++) {
+        if(aKeys[i]._ddResizer) {
+            aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg();
         }
-        if(sel) {
-            if(sel.empty) {
-                sel.empty();
-            }
-            else if (sel.removeAllRanges) {
-                sel.removeAllRanges();
-            }
-            else if(sel.collapse) {
-                sel.collapse();
-            }
+    }
+    
+    // Destroy Cell Editor
+    Ev.purgeElement(this._oCellEditor.container, true);
+    document.body.removeChild(this._oCellEditor.container);
+
+    var instanceName = this.toString();
+    var elContainer = this._elContainer;
+
+    // Unhook custom events
+    this._oRecordSet.unsubscribeAll();
+    this.unsubscribeAll();
+
+    // Unhook DOM events
+    Ev.purgeElement(elContainer, true);
+    Ev.removeListener(document, "click", this._onDocumentClick);
+
+    // Remove DOM elements
+    elContainer.innerHTML = "";
+
+    // Null out objects
+    for(var param in this) {
+        if(lang.hasOwnProperty(this, param)) {
+            this[param] = null;
         }
     }
-    else {
-        YAHOO.log("Could not select row " + elTarget, "warn", this.toString());
+    
+    // Clean up static values
+    DT._nCurrentCount--;
+    
+    if(DT._nCurrentCount < 1) {
+        if(DT._elStylesheet) {
+            document.getElementsByTagName('head')[0].removeChild(DT._elStylesheet);
+            DT._elStylesheet = null;
+        }
     }
-};
+
+    YAHOO.log("DataTable instance destroyed: " + instanceName);
+},
 
 /**
- * Overridable custom event handler to select cell.
+ * Displays message within secondary TBODY.
  *
- * @method onEventSelectCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method showTableMessage
+ * @param sHTML {String} (optional) Value for innerHTMlang.
+ * @param sClassName {String} (optional) Classname.
  */
-YAHOO.widget.DataTable.prototype.onEventSelectCell = function(oArgs) {
-    var sMode = this.get("selectionMode");
-    if ((sMode == "standard") || (sMode == "single")) {
-        return;
+showTableMessage : function(sHTML, sClassName) {
+    var elCell = this._elMsgTd;
+    if(lang.isString(sHTML)) {
+        elCell.firstChild.innerHTML = sHTML;
+    }
+    if(lang.isString(sClassName)) {
+        Dom.addClass(elCell.firstChild, sClassName);
     }
 
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
+    var elCellLiner = elCell.firstChild;
+    elCellLiner.style.width = ((this.getTheadEl().parentNode.offsetWidth) -
+        (parseInt(Dom.getStyle(elCellLiner,"paddingLeft"),10)) -
+        (parseInt(Dom.getStyle(elCellLiner,"paddingRight"),10))) + "px";
 
-    var bSHIFT = evt.shiftKey;
-    var bCTRL = evt.ctrlKey;
-    var i, j, nAnchorTrIndex, nAnchorTdIndex, currentRow, startIndex, endIndex;
-    
-    var elTargetCell = this.getTdEl(elTarget);
-    if(elTargetCell) {
-        var elTargetRow = this.getTrEl(elTargetCell);
-        var allRows = this._elTbody.rows;
-        var nTargetTrIndex = elTargetRow.sectionRowIndex;
-        var nTargetTdIndex = elTarget.yuiCellIndex;
-        var elAnchorCell = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+    this._elMsgTbody.style.display = "";
+    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
+    YAHOO.log("DataTable showing message: " + sHTML, "info", this.toString());
+},
 
-        // Both SHIFT and CTRL
-        if((sMode != "singlecell") && bSHIFT && bCTRL) {
-            // Validate anchor
-            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
-                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
-                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
-                
-                // Anchor is selected
-                if(this.isSelected(elAnchorCell)) {
-                    // All cells are on the same row
-                    if(nAnchorTrIndex == nTargetTrIndex) {
-                        // Select all cells between anchor cell and target cell, including target cell
-                        if(nAnchorTdIndex < nTargetTdIndex) {
-                            for(i=nAnchorTdIndex+1; i<=nTargetTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                        // Select all cells between target cell and anchor cell, including target cell
-                        else if(nTargetTdIndex < nAnchorTdIndex) {
-                            for(i=nTargetTdIndex; i<nAnchorTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                    }
-                    // Anchor row is above target row
-                    else if(nAnchorTrIndex < nTargetTrIndex) {
-                        if(sMode == "cellrange") {
-                            // Select all cells on anchor row from anchor cell to the end of the row
-                            for(i=nAnchorTdIndex+1; i<allRows[nAnchorTrIndex].cells.length; i++) {
-                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
-                            }
-                            
-                            // Select all cells on all rows between anchor row and target row
-                            for(i=nAnchorTrIndex+1; i<nTargetTrIndex; i++) {
-                                for(j=0; j<allRows[i].cells.length; j++){
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
+/**
+ * Hides secondary TBODY.
+ *
+ * @method hideTableMessage
+ */
+hideTableMessage : function() {
+    if(this._elMsgTbody.style.display != "none") {
+        this._elMsgTbody.style.display = "none";
+        this.fireEvent("tableMsgHideEvent");
+        YAHOO.log("DataTable message hidden", "info", this.toString());
+    }
+},
 
-                            // Select all cells on target row from first cell to the target cell
-                            for(i=0; i<=nTargetTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                        else if(sMode == "cellblock") {
-                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-                            
-                            // Select all cells from startIndex to endIndex on rows between anchor row and target row
-                            for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                                for(j=startIndex; j<=endIndex; j++) {
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    // Anchor row is below target row
-                    else {
-                        if(sMode == "cellrange") {
-                            // Select all cells on target row from target cell to the end of the row
-                            for(i=nTargetTdIndex; i<allRows[nTargetTrIndex].cells.length; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
+/**
+ * Brings focus to the TBODY element. Alias to focusTbodyEl.
+ *
+ * @method focus
+ */
+focus : function() {
+    this.focusTbodyEl();
+},
 
-                            // Select all cells on all rows between target row and anchor row
-                            for(i=nTargetTrIndex+1; i<nAnchorTrIndex; i++) {
-                                for(j=0; j<allRows[i].cells.length; j++){
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
+/**
+ * Brings focus to the THEAD element.
+ *
+ * @method focusTheadEl
+ */
+focusTheadEl : function() {
+    this._focusEl(this._elThead);
+},
 
-                            // Select all cells on anchor row from first cell to the anchor cell
-                            for(i=0; i<nAnchorTdIndex; i++) {
-                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
-                            }
-                        }
-                        else if(sMode == "cellblock") {
-                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-
-                            // Select all cells from startIndex to endIndex on rows between target row and anchor row
-                            for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
-                                for(j=endIndex; j>=startIndex; j--) {
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
-                        }
-                    }
-                }
-                // Anchor cell is unselected
-                else {
-                    // All cells are on the same row
-                    if(nAnchorTrIndex == nTargetTrIndex) {
-                        // Unselect all cells between anchor cell and target cell
-                        if(nAnchorTdIndex < nTargetTdIndex) {
-                            for(i=nAnchorTdIndex+1; i<nTargetTdIndex; i++) {
-                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                        // Select all cells between target cell and anchor cell
-                        else if(nTargetTdIndex < nAnchorTdIndex) {
-                            for(i=nTargetTdIndex+1; i<nAnchorTdIndex; i++) {
-                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                    }
-                    // Anchor row is above target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        // Unselect all cells from anchor cell to target cell
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the anchor row, only unselect cells after the anchor cell
-                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j>nAnchorTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the target row, only unelect cells before the target cell
-                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j<nTargetTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Unselect all cells on this row
-                                else {
-                                    this.unselectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    // Anchor row is below target row
-                    else {
-                        // Unselect all cells from target cell to anchor cell
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the target row, only unselect cells after the target cell
-                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j>nTargetTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the anchor row, only unselect cells before the anchor cell
-                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j<nAnchorTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Unselect all cells on this row
-                                else {
-                                    this.unselectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
-                    }
+/**
+ * Brings focus to the TBODY element.
+ *
+ * @method focusTbodyEl
+ */
+focusTbodyEl : function() {
+    this._focusEl(this._elTbody);
+},
 
-                    // Select the target cell
-                    this.selectCell(elTargetCell);
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetCell.id;
 
-                // Toggle selection of target
-                if(this.isSelected(elTargetCell)) {
-                    this.unselectCell(elTargetCell);
-                }
-                else {
-                    this.selectCell(elTargetCell);
-                }
-            }
-        }
-        // Only SHIFT
-        else if((sMode != "singlecell") && bSHIFT) {
-            this.unselectAllCells();
 
-            // Validate anchor
-            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
-                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
-                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
-                
-                // All cells are on the same row
-                if(nAnchorTrIndex == nTargetTrIndex) {
-                    // Select all cells between anchor cell and target cell,
-                    // including the anchor cell and target cell
-                    if(nAnchorTdIndex < nTargetTdIndex) {
-                        for(i=nAnchorTdIndex; i<=nTargetTdIndex; i++) {
-                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                        }
-                    }
-                    // Select all cells between target cell and anchor cell
-                    // including the target cell and anchor cell
-                    else if(nTargetTdIndex < nAnchorTdIndex) {
-                        for(i=nTargetTdIndex; i<=nAnchorTdIndex; i++) {
-                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                        }
-                    }
-                }
-                // Anchor row is above target row
-                else if(nAnchorTrIndex < nTargetTrIndex) {
-                    if(sMode == "cellrange") {
-                        // Select all cells from anchor cell to target cell
-                        // including the anchor cell and target cell
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the anchor row, only select the anchor cell and after
-                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j>=nAnchorTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the target row, only select the target cell and before
-                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j<=nTargetTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Select all cells on this row
-                                else {
-                                    this.selectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    else if(sMode == "cellblock") {
-                        // Select the cellblock from anchor cell to target cell
-                        // including the anchor cell and the target cell
-                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
 
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            for(j=startIndex; j<=endIndex; j++) {
-                                this.selectCell(allRows[i].cells[j]);
-                            }
-                        }
-                        
-                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
-                    }
-                }
-                // Anchor row is below target row
-                else {
-                    if(sMode == "cellrange") {
-                        // Select all cells from target cell to anchor cell,
-                        // including the target cell and anchor cell
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the target row, only select the target cell and after
-                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j>=nTargetTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the anchor row, only select the anchor cell and before
-                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j<=nAnchorTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Select all cells on this row
-                                else {
-                                    this.selectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    else if(sMode == "cellblock") {
-                        // Select the cellblock from target cell to anchor cell
-                        // including the target cell and the anchor cell
-                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
 
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            for(j=startIndex; j<=endIndex; j++) {
-                                this.selectCell(allRows[i].cells[j]);
-                            }
-                        }
-                        
-                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
-                    }
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetCell.id;
 
-                // Select target only
-                this.selectCell(elTargetCell);
-            }
-        }
-        // Only CTRL
-        else if((sMode != "singlecell") && bCTRL) {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetCell.id;
 
-            // Toggle selection of target
-            if(this.isSelected(elTargetCell)) {
-                this.unselectCell(elTargetCell);
-            }
-            else {
-                this.selectCell(elTargetCell);
-            }
-        }
-        // Neither SHIFT nor CTRL, or multi-selection has been disabled
-        else {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetCell.id;
 
-            // Select only target
-            this.unselectAllCells();
-            this.selectCell(elTargetCell);
-        }
 
-        YAHOO.util.Event.stopEvent(evt);
 
-        // Clear any selections that are a byproduct of the click or dblclick
-        var sel;
-        if(window.getSelection) {
-               sel = window.getSelection();
-        }
-        else if(document.getSelection) {
-               sel = document.getSelection();
-        }
-        else if(document.selection) {
-               sel = document.selection;
-        }
-        if(sel) {
-            if(sel.empty) {
-                sel.empty();
-            }
-            else if (sel.removeAllRanges) {
-                sel.removeAllRanges();
-            }
-            else if(sel.collapse) {
-                sel.collapse();
-            }
-        }
-    }
-    else {
-        YAHOO.log("Could not select cell " + elTarget, "warn", this.toString());
-    }
-};
 
 
 
@@ -6746,253 +9511,126 @@ YAHOO.widget.DataTable.prototype.onEventSelectCell = function(oArgs) {
 
 
 
-/**
- * Overridable custom event handler to highlight row.
- *
- * @method onEventHighlightRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventHighlightRow = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.highlightRow(elTarget);
-};
 
-/**
- * Overridable custom event handler to unhighlight row.
- *
- * @method onEventUnhighlightRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventUnhighlightRow = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.unhighlightRow(elTarget);
-};
 
-/**
- * Overridable custom event handler to highlight cell.
- *
- * @method onEventHighlightCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventHighlightCell = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.highlightCell(elTarget);
-};
 
-/**
- * Overridable custom event handler to unhighlight cell.
- *
- * @method onEventUnhighlightCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventUnhighlightCell = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.unhighlightCell(elTarget);
-};
 
-/**
- * Overridable custom event handler to format cell.
- *
- * @method onEventFormatCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventFormatCell = function(oArgs) {
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    var elTag = target.tagName.toLowerCase();
 
-    var elCell = this.getTdEl(target);
-    if(elCell && YAHOO.lang.isNumber(elCell.yuiColumnId)) {
-        var oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
-        this.formatCell(elCell, this.getRecord(elCell), oColumn);
-    }
-    else {
-        YAHOO.log("Could not format cell " + target, "warn", this.toString());
-    }
-};
 
-/**
- * Overridable custom event handler to edit cell.
- *
- * @method onEventShowCellEditor
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventShowCellEditor = function(oArgs) {
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    var elTag = target.tagName.toLowerCase();
 
-    var elCell = this.getTdEl(target);
-    if(elCell) {
-        this.showCellEditor(elCell);
-    }
-    else {
-        YAHOO.log("Could not edit cell " + target, "warn", this.toString());
-    }
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.onEventEditCell = function(oArgs) {
-    YAHOO.log("The method onEventEditCell() has been deprecated" +
-        " in favor of onEventShowCellEditor()", "warn", this.toString());
-    this.onEventShowCellEditor(oArgs);
-};
 
-/**
- * Overridable custom event handler to save Cell Editor input.
- *
- * @method onEventSaveCellEditor
- * @param oArgs.editor {Object} Cell Editor object literal.
- */
-YAHOO.widget.DataTable.prototype.onEventSaveCellEditor = function(oArgs) {
-    this.saveCellEditor();
-};
 
-/**
- * Callback function for creating a progressively enhanced DataTable first
- * receives data from DataSource and populates the RecordSet, then initializes
- * DOM elements.
- *
- * @method _onDataReturnEnhanceTable
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable = function(sRequest, oResponse) {
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
 
-    // Data ok to populate
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        // Update RecordSet
-        this._oRecordSet.addRecords(oResponse.results);
 
-        // Initialize DOM elements
-        this._initTableEl();
-        if(!this._elTable || !this._elThead || !this._elTbody) {
-            YAHOO.log("Could not instantiate DataTable due to an invalid DOM elements", "error", this.toString());
-            return;
-        }
 
-        // Call Element's constructor after DOM elements are created
-        // but *before* UI is updated with data
-        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
 
-        //HACK: Set the Paginator values
-        if(this._oConfigs.paginator) {
-            this.updatePaginator(this._oConfigs.paginator);
-        }
 
-        // Update the UI
-        this.refreshView();
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
-    }
-    // Empty
-    else if(ok){
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-    }
-};
-    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// RECORDSET FUNCTIONS
+
 /**
- * Callback function receives data from DataSource and populates an entire
- * DataTable with Records and TR elements, clearing previous Records, if any.
+ * Returns Record index for given TR element or page row index.
  *
- * @method onDataReturnInitializeTable
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
+ * @method getRecordIndex
+ * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
+ * element reference or page row index.
+ * @return {Number} Record's RecordSet index, or null.
  */
-YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
-
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
+getRecordIndex : function(row) {
+    var nTrIndex;
 
-    // Data ok to populate
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.initializeTable(oResponse.results);
+    if(!lang.isNumber(row)) {
+        // By Record
+        if(row instanceof YAHOO.widget.Record) {
+            return this._oRecordSet.getRecordIndex(row);
+        }
+        // By element reference
+        else {
+            // Find the TR element
+            var el = this.getTrEl(row);
+            if(el) {
+                nTrIndex = el.sectionRowIndex;
+            }
+        }
     }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    // By page row index
+    else {
+        nTrIndex = row;
     }
-    // Empty
-    else if(ok){
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+
+    if(lang.isNumber(nTrIndex)) {
+        var oPaginator = this.get("paginator");
+        if(oPaginator instanceof Pag) {
+            return oPaginator.get('recordOffset') + nTrIndex;
+        }
+        else if (this.get('paginated')) {
+            return oPaginator.startRecordIndex + nTrIndex;
+        }
+        else {
+            return nTrIndex;
+        }
     }
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows = function(sRequest, oResponse) {
-    YAHOO.log("The method onDataReturnReplaceRows() has been deprecated" +
-            " in favor of onDataReturnInitializeTable()", "warn", this.toString());
-    this.onDataReturnInitializeTable(sRequest, oResponse);
-};
+
+    YAHOO.log("Could not get Record index for row " + row, "info", this.toString());
+    return null;
+},
 
 /**
- * Callback function receives data from DataSource and appends to an existing
- * DataTable new Records and, if applicable, creates or updates
- * corresponding TR elements.
+ * For the given identifier, returns the associated Record instance.
  *
- * @method onDataReturnAppendRows
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
+ * @method getRecord
+ * @param row {HTMLElement | Number | String} DOM reference to a TR element (or
+ * child of a TR element), RecordSet position index, or Record ID.
+ * @return {YAHOO.widget.Record} Record instance.
  */
-YAHOO.widget.DataTable.prototype.onDataReturnAppendRows = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
-    
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
-    
-    // Data ok to append
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.addRows(oResponse.results);
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+getRecord : function(row) {
+    var oRecord = this._oRecordSet.getRecord(row);
+
+    if(!oRecord) {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow) {
+            oRecord = this._oRecordSet.getRecord(elRow.yuiRecordId);
+        }
     }
-};
 
-/**
- * Callback function receives data from DataSource and inserts into top of an
- * existing DataTable new Records and, if applicable, creates or updates
- * corresponding TR elements.
- *
- * @method onDataReturnInsertRows
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- */
-YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
-    
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
-    
-    // Data ok to append
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.addRows(oResponse.results, 0);
+    if(oRecord instanceof YAHOO.widget.Record) {
+        return this._oRecordSet.getRecord(oRecord);
     }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    else {
+        YAHOO.log("Could not get Record for row at " + row, "info", this.toString());
+        return null;
     }
-};
-
+},
 
 
 
@@ -7027,2091 +9665,5365 @@ YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oRe
 
 
 
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Custom Events
-    //
-    /////////////////////////////////////////////////////////////////////////////
 
-    /**
-     * Fired when the DataTable instance's initialization is complete.
-     *
-     * @event initEvent
-     */
 
-    /**
-     * Fired when the DataTable's view is refreshed.
-     *
-     * @event refreshEvent
-     */
 
-    /**
-     * Fired when data is returned from DataSource.
-     *
-     * @event dataReturnEvent
-     * @param oArgs.request {String} Original request.
-     * @param oArgs.response {Object} Response object.
-     */
 
-    /**
-     * Fired when the DataTable has a focus.
-     *
-     * @event tableFocusEvent
-     */
 
-    /**
-     * Fired when the DataTable has a blur.
-     *
-     * @event tableBlurEvent
-     */
 
-    /**
-     * Fired when the DataTable has a mouseover.
-     *
-     * @event tableMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a mouseout.
-     *
-     * @event tableMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a mousedown.
-     *
-     * @event tableMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a click.
-     *
-     * @event tableClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a dblclick.
-     *
-     * @event tableDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when a fixed scrolling DataTable has a scroll.
-     *
-     * @event tableScrollEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
-     * or the DataTable's TBODY element (everyone else).
-     *
-     */
 
-    /**
-     * Fired when a message is shown in the DataTable's message element.
-     *
-     * @event tableMsgShowEvent
-     * @param oArgs.html {String} The HTML displayed.
-     * @param oArgs.className {String} The className assigned.
-     *
-     */
+// COLUMN FUNCTIONS
+
+/**
+ * For the given identifier, returns the associated Column instance. Note: For
+ * getting Columns by Column ID string, please use the method getColumnById().
+ *
+ * @method getColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+getColumn : function(column) {
+    var oColumn = this._oColumnSet.getColumn(column);
+
+    if(!oColumn) {
+        // Validate TD element
+        var elCell = this.getTdEl(column);
+        if(elCell) {
+            oColumn = this._oColumnSet.getColumnById(elCell.yuiColumnId);
+        }
+        // Validate TH element
+        else {
+            elCell = this.getThEl(column);
+            if(elCell) {
+                oColumn = this._oColumnSet.getColumnById(elCell.yuiColumnId);
+            }
+        }
+    }
+    if(!oColumn) {
+        YAHOO.log("Could not get Column for column at " + column, "info", this.toString());
+    }
+    return oColumn;
+},
+
+/**
+ * For the given Column ID, returns the associated Column instance. Note: For
+ * getting Columns by key, please use the method getColumn().
+ *
+ * @method getColumnById
+ * @param column {String} Column ID string.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+getColumnById : function(column) {
+    return this._oColumnSet.getColumnById(column);
+},
+
+/**
+ * For the given Column instance, returns next direction to sort.
+ *
+ * @method getColumnSortDir
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @return {String} DataTable.widget.CLASS_ASC or DataTable.widget.CLASS_DESC.
+ */
+getColumnSortDir : function(oColumn) {
+    // Backward compatibility
+    if(oColumn.sortOptions && oColumn.sortOptions.defaultOrder) {
+        if(oColumn.sortOptions.defaultOrder == "asc") {
+            oColumn.sortOptions.defaultDir = DT.CLASS_ASC;
+        }
+        else if (oColumn.sortOptions.defaultOrder == "desc") {
+            oColumn.sortOptions.defaultDir = DT.CLASS_DESC;
+        }
+    }
+    
+    // What is the Column's default sort direction?
+    var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultDir) ? oColumn.sortOptions.defaultDir : DT.CLASS_ASC;
+
+    // Already sorted?
+    var bSorted = false;
+    var oSortedBy = this.get("sortedBy");
+    if(oSortedBy && (oSortedBy.key === oColumn.key)) {
+        bSorted = true;
+        if(oSortedBy.dir) {
+            sortDir = (oSortedBy.dir == DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
+        }
+        else {
+            sortDir = (sortDir == DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
+        }
+    }
+    return sortDir;
+},
+
+/**
+ * Sorts given Column.
+ *
+ * @method sortColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param sDir {String} (Optional) DT.CLASS_ASC or
+ * DT.CLASS_DESC
+ */
+sortColumn : function(oColumn, sDir) {
+    if(oColumn && (oColumn instanceof YAHOO.widget.Column)) {
+        if(!oColumn.sortable) {
+            Dom.addClass(this.getThEl(oColumn), DT.CLASS_SORTABLE);
+        }
+        
+        // Validate given direction
+        if(sDir && (sDir !== DT.CLASS_ASC) && (sDir !== DT.CLASS_DESC)) {
+            sDir = null;
+        }
+        
+        // Get the sort dir
+        var sortDir = sDir || this.getColumnSortDir(oColumn);
+
+        // Do the actual sort
+        var oSortedBy = this.get("sortedBy") || {};
+        var bSorted = (oSortedBy.key === oColumn.key) ? true : false;
+        if(!bSorted || sDir) {
+            // Is there a custom sort handler function defined?
+            var sortFnc = (oColumn.sortOptions && lang.isFunction(oColumn.sortOptions.sortFunction)) ?
+                    // Custom sort function
+                    oColumn.sortOptions.sortFunction :
+
+                    // Default sort function
+                    function(a, b, desc) {
+                        var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
+                        if(sorted === 0) {
+                            return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
+                        }
+                        else {
+                            return sorted;
+                        }
+                    };
+
+            this._oRecordSet.sortRecords(sortFnc, ((sortDir == DT.CLASS_DESC) ? true : false));
+        }
+        else {
+            this._oRecordSet.reverseRecords();
+        }
+
+        // Update sortedBy tracker
+        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
+
+        // Reset to first page
+        //TODO: Keep selection in view
+        var oPaginator = this.get('paginator');
+        if (oPaginator instanceof Pag) {
+            // TODO : is this server-side op safe?  Will fire changeRequest
+            // event mechanism
+            oPaginator.setPage(1,true);
+        }
+        else if (this.get('paginated')) {
+            // Backward compatibility
+            this.updatePaginator({currentPage:1});
+        }
+
+        // Update the UI
+        DT.formatTheadCell(oColumn.getThEl().firstChild.firstChild, oColumn, this);
+        this.render();
+
+        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
+        YAHOO.log("Column \"" + oColumn.key + "\" sorted \"" + sortDir + "\"", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not sort Column \"" + oColumn.key + "\"", "warn", this.toString());
+    }
+},
+
+/**
+ * Sets DOM elements of given Column to given pixel width. No validations
+ * against minimum width and no updating Column.width value.
+ *
+ * @method _setColumnWidth
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param sWidth {String} New width value.
+ * @private
+ */
+_setColumnWidth : function(oColumn, sWidth) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn) {
+        // Create STYLE node
+        if(!DT._bStylesheetFallback) {
+            var s;
+            if(!DT._elStylesheet) {
+                    s = document.createElement('style');
+                    s.type = 'text/css';
+                    DT._elStylesheet = document.getElementsByTagName('head').item(0).appendChild(s);
+            }
+                
+            if(DT._elStylesheet) {
+                s = DT._elStylesheet;
+                
+                var sClassname = ".yui-dt-col-" + oColumn.getId();
+                
+                // Create rule for the Column
+                var rule = DT._oStylesheetRules[sClassname];
+                if (!rule) {
+                    if (s.styleSheet && s.styleSheet.addRule) {
+                        s.styleSheet.addRule(sClassname,"width:"+sWidth);
+                        rule = s.styleSheet.rules[s.styleSheet.rules.length-1];
+                    } else if (s.sheet && s.sheet.insertRule) {
+                        s.sheet.insertRule(sClassname+" {width:"+sWidth+";}",s.sheet.cssRules.length);
+                        rule = s.sheet.cssRules[s.sheet.cssRules.length];
+                    } else {
+                        DT._bStylesheetFallback = true;
+                    }
+                    DT._oStylesheetRules[sClassname] = rule;
+                }
+                
+                // Update existing rule for the Column
+                else {
+                    rule.style.width = sWidth;
+                }
+                
+                return;
+            }
+            
+            DT._bStylesheetFallback = true;
+        }
+        // Do it the old fashioned way
+        if(DT._bStylesheetFallback) {
+            if(sWidth == "auto") {
+                sWidth = ""; 
+            }
+
+            if (!this._aFallbackColResizer[this._elTbody.rows.length]) {
+                /*
+                Compile a custom function to do all the cell width
+                assignments at the same time.  A new resizer function is created
+                for each new unique number of rows in _elTbody.  This will
+                result in a function declaration like:
+                function (oColumn,sWidth) {
+                    var colIdx = oColumn.getKeyIndex();
+                    oColumn.getThEl().firstChild.style.width =
+                    this._elTbody.rows[0].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[0].cells[colIdx].style.width =
+                    this._elTbody.rows[1].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[1].cells[colIdx].style.width =
+                    ... (for all row indices in this._elTbody.rows.length - 1)
+                    this._elTbody.rows[99].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[99].cells[colIdx].style.width = sWidth;
+                    ending with the sWidth as the initial assignment   ^
+                }
+                */
+
+                var resizerDef = [
+                    'var colIdx=oColumn.getKeyIndex();',
+                    'oColumn.getThEl().firstChild.style.width='
+                ];
+                for (var i=this._elTbody.rows.length-1, j=2; i >= 0; --i) {
+                    resizerDef[j++] = 'this._elTbody.rows[';
+                    resizerDef[j++] = i;
+                    resizerDef[j++] = '].cells[colIdx].firstChild.style.width=';
+                    resizerDef[j++] = 'this._elTbody.rows[';
+                    resizerDef[j++] = i;
+                    resizerDef[j++] = '].cells[colIdx].style.width=';
+                }
+                resizerDef[j] = 'sWidth;';
+                this._aFallbackColResizer[this._elTbody.rows.length] =
+                    new Function('oColumn','sWidth',resizerDef.join(''));
+            }
+            var resizerFn = this._aFallbackColResizer[this._elTbody.rows.length];
+
+            if (resizerFn) {
+                resizerFn.call(this,oColumn,sWidth);
+            }
+        }
+    }
+    else {
+        YAHOO.log("Could not set width of Column " + oColumn + " to " + sWidth, "warn", this.toString());
+    }
+},
+
+/**
+ * Sets given Column to given pixel width. If new width is less than minimum
+ * width, sets to minimum width. Updates oColumn.width value.
+ *
+ * @method setColumnWidth
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param nWidth {Number} New width in pixels.
+ */
+setColumnWidth : function(oColumn, nWidth) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn) {
+        // Validate new width against minimum width
+        var sWidth = "";
+        if(lang.isNumber(nWidth)) {
+            sWidth = (nWidth > oColumn.minWidth) ? nWidth + "px" : oColumn.minWidth + "px";
+        }
+
+        // Save state
+        oColumn.width = parseInt(sWidth,10);
+        
+        // Resize the DOM elements
+        this._setColumnWidth(oColumn, sWidth);
+        
+        this._syncScrollPadding();
+        
+        this.fireEvent("columnSetWidthEvent",{column:oColumn,width:nWidth});
+        YAHOO.log("Set width of Column " + oColumn + " to " + nWidth + "px", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not set width of Column " + oColumn + " to " + nWidth + "px", "warn", this.toString());
+    }
+},
+
+
+/**
+ * Hides given Column. NOTE: You cannot hide/show nested Columns. You can only
+ * hide/show non-nested Columns, and top-level parent Columns (which will
+ * hide/show all children Columns).
+ *
+ * @method hideColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ */
+hideColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && !oColumn.hidden) {
+        // Only top-level Columns can get hidden
+        if(oColumn.getTreeIndex() !== null) {
+            var allrows = this.getTbodyEl().rows;
+            var l = allrows.length;
+            var allDescendants = this._oColumnSet.getDescendants(oColumn);
+            for(var i=0; i<allDescendants.length; i++) {
+                var thisColumn = allDescendants[i];
+                thisColumn.hidden = true;
+
+                var elTheadCell = thisColumn.getThEl();
+                var elTheadCellLiner = elTheadCell.firstChild;
+                // Store to reinstate later
+                thisColumn._nLastWidth = elTheadCellLiner.offsetWidth - 
+                        (parseInt(Dom.getStyle(elTheadCellLiner,"paddingLeft"),10)|0) -
+                        (parseInt(Dom.getStyle(elTheadCellLiner,"paddingRight"),10)|0);
+                Dom.addClass(elTheadCell,DT.CLASS_HIDDEN);
+
+                // Adjust body cells (if key Column)
+                var thisKeyIndex = thisColumn.getKeyIndex();
+                if(thisKeyIndex !== null) {
+                    for(var j=0;j<l;j++) {
+                        Dom.addClass(allrows[j].cells[thisKeyIndex],DT.CLASS_HIDDEN);
+                    }
+
+                    this._setColumnWidth(thisColumn, "1px");
+                    
+                    // Disable interactive features
+                    if(thisColumn.resizeable) {
+                        Dom.removeClass(thisColumn.getResizerEl(),DT.CLASS_RESIZER);
+                    }
+                    if(thisColumn.sortable) {
+                        Dom.removeClass(thisColumn.getThEl(),DT.CLASS_SORTABLE);
+                        thisColumn.getThEl().firstChild.firstChild.firstChild.style.display = "none";
+                    }
+                }
+                // Just set thead cell width directly for parent Column
+                else {
+                    elTheadCell.firstChild.style.width = "1px";
+                }
+                
+                this.fireEvent("columnHideEvent",{column:thisColumn});
+                YAHOO.log("Column \"" + oColumn.key + "\" hidden", "info", this.toString());
+            }
+        }
+        else {
+            YAHOO.log("Could not hide Column \"" + oColumn.key + "\". Only non-nested Columns can be hidden", "warn", this.toString());
+        }
+    }
+},
+
+/**
+ * Shows given Column. NOTE: You cannot hide/show nested Columns. You can only
+ * hide/show non-nested Columns, and top-level parent Columns (which will
+ * hide/show all children Columns).
+ *
+ * @method showColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ */
+showColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && oColumn.hidden) {
+        // Only top-level Columns can get hidden
+        if(oColumn.getTreeIndex() !== null) {
+            var allrows = this.getTbodyEl().rows;
+            var l = allrows.length;
+            var allDescendants = this._oColumnSet.getDescendants(oColumn);
+            for(var i=0; i<allDescendants.length; i++) {
+                var thisColumn = allDescendants[i];
+                thisColumn.hidden = false;
+                
+                var elTheadCell = thisColumn.getThEl();
+                Dom.removeClass(elTheadCell,DT.CLASS_HIDDEN);
+
+                // Adjust body cells (if key Column)
+                var thisKeyIndex = thisColumn.getKeyIndex();
+                if(thisKeyIndex !== null) {
+                    for(var j=0;j<l;j++) {
+                        Dom.removeClass(allrows[j].cells[thisKeyIndex],DT.CLASS_HIDDEN);
+                    }
+                    
+                    this.setColumnWidth(thisColumn, (thisColumn._nLastWidth || thisColumn.minWidth), true);
+
+                    // Enable interactive features
+                    if(thisColumn.sortable) {
+                        thisColumn.getThEl().firstChild.firstChild.firstChild.style.display = "";
+                        Dom.removeClass(thisColumn.getThEl(),DT.CLASS_SORTABLE);
+                    }
+                    if(thisColumn.resizeable) {
+                        thisColumn._ddResizer.resetResizerEl();
+                        Dom.addClass(thisColumn.getResizerEl(),DT.CLASS_RESIZER);
+                    }
+                }
+                else {
+                    elTheadCell.firstChild.style.width = "";
+                }
+
+                thisColumn._nLastWidth = null;
+                this.fireEvent("columnShowEvent",{column:thisColumn});
+                YAHOO.log("Column \"" + oColumn.key + "\" shown", "info", this.toString());
+            }
+        }
+        else {
+            YAHOO.log("Could not show Column \"" + oColumn.key + "\". Only non-nested Columns can be shown", "warn", this.toString());
+        }
+    }
+},
+
+/**
+ * Removes given Column. NOTE: You cannot remove nested Columns. You can only remove
+ * non-nested Columns, and top-level parent Columns (which will remove all
+ * children Columns).
+ *
+ * @method removeColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @return oColumn {YAHOO.widget.Column} Removed Column instance.
+ */
+removeColumn : function(oColumn) {
+    var nColTreeIndex = oColumn.getTreeIndex();
+    if(nColTreeIndex !== null) {
+        this._oChain.stop();
+        var aOrigColumnDefs = this._oColumnSet.getDefinitions();
+
+        oColumn = aOrigColumnDefs.splice(nColTreeIndex,1)[0];
+        this._initColumnSet(aOrigColumnDefs);
+        this._initTheadEls();
+
+        this.render();
+        this.fireEvent("columnRemoveEvent",{column:oColumn});
+        YAHOO.log("Column \"" + oColumn.key + "\" removed", "info", this.toString());
+        return oColumn;
+    }
+    YAHOO.log("Could not remove Column \"" + oColumn.key + "\". Only non-nested Columns can be removed", "warn", this.toString());
+},
+
+/**
+ * Inserts given Column at the index if given, otherwise at the end. NOTE: You
+ * can only add non-nested Columns and top-level parent Columns. You cannot add
+ * a nested Column to an existing parent.
+ *
+ * @method insertColumn
+ * @param oColumn {Object | YAHOO.widget.Column} Object literal Column
+ * definition or a Column instance.
+ * @param index {Number} (optional) Column key index.
+ */
+insertColumn : function(oColumn, index) {
+    // Validate Column
+    if(oColumn instanceof YAHOO.widget.Column) {
+        oColumn = oColumn.getDefinition();
+    }
+    else if(oColumn.constructor !== Object) {
+        YAHOO.log("Could not insert Column \"" + oColumn + "\" due to invalid argument", "warn", this.toString());
+        return;
+    }
+    
+    var oColumnSet = this._oColumnSet;
+
+    // Validate index
+    if(!lang.isValue(index) || !lang.isNumber(index)) {
+        index = oColumnSet.tree[0].length;
+    }
+    
+    this._oChain.stop();
+    var aNewColumnDefs = this._oColumnSet.getDefinitions();
+    aNewColumnDefs.splice(index, 0, oColumn);
+    this._initColumnSet(aNewColumnDefs);
+    this._initTheadEls();
+    this.render();
+    this.fireEvent("columnInsertEvent",{column:oColumn,index:index});
+    YAHOO.log("Column \"" + oColumn.key + "\" inserted into index " + index, "info", this.toString());
+},
+
+/**
+ * Selects given Column. NOTE: You cannot select/unselect nested Columns. You can only
+ * select/unselect non-nested Columns, and bottom-level key Columns.
+ *
+ * @method selectColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+selectColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && !oColumn.selected) {
+        // Only bottom-level Columns can get hidden
+        if(oColumn.getKeyIndex() !== null) {
+            oColumn.selected = true;
+            
+            // Update head cell
+            var elTh = oColumn.getThEl();
+            Dom.addClass(elTh,DT.CLASS_SELECTED);
+
+            // Update body cells
+            var allRows = this.getTbodyEl().rows;
+            var oChain = this._oChain;
+            oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                        Dom.addClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_SELECTED);                    
+                    }
+                    oArg.rowIndex++;
+                },
+                scope: this,
+                iterations: allRows.length,
+                argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+            });
+            oChain.run();       
+            
+            this.fireEvent("columnSelectEvent",{column:oColumn});
+            YAHOO.log("Column \"" + oColumn.key + "\" selected", "info", this.toString());
+        }
+        else {
+            YAHOO.log("Could not select Column \"" + oColumn.key + "\". Only non-nested Columns can be selected", "warn", this.toString());
+        }
+    }
+},
+
+/**
+ * Unselects given Column. NOTE: You cannot select/unselect nested Columns. You can only
+ * select/unselect non-nested Columns, and bottom-level key Columns.
+ *
+ * @method unSelectColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+unselectColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && oColumn.selected) {
+        // Only bottom-level Columns can get hidden
+        if(oColumn.getKeyIndex() !== null) {
+            oColumn.selected = false;
+            
+            // Update head cell
+            var elTh = oColumn.getThEl();
+            Dom.removeClass(elTh,DT.CLASS_SELECTED);
+
+            // Update body cells
+            var allRows = this.getTbodyEl().rows;
+            var oChain = this._oChain;
+            oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                        Dom.removeClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_SELECTED); 
+                    }                   
+                    oArg.rowIndex++;
+                },
+                scope: this,
+                iterations:allRows.length,
+                argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+            });
+            oChain.run();       
+            
+            this.fireEvent("columnUnselectEvent",{column:oColumn});
+            YAHOO.log("Column \"" + oColumn.key + "\" unselected", "info", this.toString());
+        }
+        else {
+            YAHOO.log("Could not unselect Column \"" + oColumn.key + "\". Only non-nested Columns can be unselected", "warn", this.toString());
+        }
+    }
+},
+
+/**
+ * Returns an array selected Column instances.
+ *
+ * @method getSelectedColumns
+ * @return {YAHOO.widget.Column[]} Array of Column instances.
+ */
+getSelectedColumns : function(oColumn) {
+    var selectedColumns = [];
+    var aKeys = this._oColumnSet.keys;
+    for(var i=0,len=aKeys.length; i<len; i++) {
+        if(aKeys[i].selected) {
+            selectedColumns[selectedColumns.length] = aKeys[i];
+        }
+    }
+    return selectedColumns;
+},
+
+/**
+ * Assigns the class DT.CLASS_HIGHLIGHTED to cells of the given Column.
+ * NOTE: You cannot highlight/unhighlight nested Columns. You can only
+ * highlight/unhighlight non-nested Columns, and bottom-level key Columns.
+ *
+ * @method highlightColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+highlightColumn : function(column) {
+    var oColumn = this.getColumn(column);
+    // Only bottom-level Columns can get highlighted
+    if(oColumn && (oColumn.getKeyIndex() !== null)) {
+        /*// Make sure previous row is unhighlighted
+        var sId = oColumn.getId();
+        var sLastId = this._sLastHighlightedColumnId;
+        if(sLastId && (sLastId !== sId)) {
+            this.unhighlightColumn(this.getColumn(sLastId));
+        }*/
+
+        //this._sLastHighlightedColumnId = sId;
+            
+        // Update head cell
+        var elTh = oColumn.getThEl();
+        Dom.addClass(elTh,DT.CLASS_HIGHLIGHTED);
+
+        // Update body cells
+        var allRows = this.getTbodyEl().rows;
+        var oChain = this._oChain;
+        oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                    Dom.addClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_HIGHLIGHTED);   
+                }                 
+                oArg.rowIndex++;
+            },
+            scope: this,
+            iterations:allRows.length,
+            argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+        });
+        oChain.run();       
+            
+        this.fireEvent("columnHighlightEvent",{column:oColumn});
+        YAHOO.log("Column \"" + oColumn.key + "\" highlighed", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not highlight Column \"" + oColumn.key + "\". Only non-nested Columns can be highlighted", "warn", this.toString());
+    }
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED to cells of the given Column.
+ * NOTE: You cannot highlight/unhighlight nested Columns. You can only
+ * highlight/unhighlight non-nested Columns, and bottom-level key Columns.
+ *
+ * @method unhighlightColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+unhighlightColumn : function(column) {
+    var oColumn = this.getColumn(column);
+    // Only bottom-level Columns can get highlighted
+    if(oColumn && (oColumn.getKeyIndex() !== null)) {
+        // Update head cell
+        var elTh = oColumn.getThEl();
+        Dom.removeClass(elTh,DT.CLASS_HIGHLIGHTED);
+
+        // Update body cells
+        var allRows = this.getTbodyEl().rows;
+        var oChain = this._oChain;
+        oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                    Dom.removeClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_HIGHLIGHTED);
+                }                 
+                oArg.rowIndex++;
+            },
+            scope: this,
+            iterations:allRows.length,
+            argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+        });
+        oChain.run();       
+            
+        this.fireEvent("columnUnhighlightEvent",{column:oColumn});
+        YAHOO.log("Column \"" + oColumn.key + "\" unhighlighted", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not unhighlight Column \"" + oColumn.key + "\". Only non-nested Columns can be unhighlighted", "warn", this.toString());
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ROW FUNCTIONS
+
+
+/**
+ * Adds one new Record of data into the RecordSet at the index if given,
+ * otherwise at the end. If the new Record is in page view, the
+ * corresponding DOM elements are also updated.
+ *
+ * @method addRow
+ * @param oData {Object} Object literal of data for the row.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+addRow : function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._oRecordSet.addRecord(oData, index);
+        if(oRecord) {
+            var recIndex;
+            var oPaginator = this.get('paginator');
+
+            // Paginated
+            if (oPaginator instanceof Pag ||
+                this.get('paginated')) {
+                recIndex = this.getRecordIndex(oRecord);
+                var endRecIndex;
+                if (oPaginator instanceof Pag) {
+                    // Update the paginator's totalRecords
+                    var totalRecords = oPaginator.get('totalRecords');
+                    if (totalRecords !== Pag.VALUE_UNLIMITED) {
+                        oPaginator.set('totalRecords',totalRecords + 1);
+                    }
+
+                    endRecIndex = (oPaginator.getPageRecords())[1];
+                }
+                // Backward compatibility
+                else {
+                    endRecIndex = oPaginator.startRecordIndex +
+                                  oPaginator.rowsPerPage - 1;
+                    this.updatePaginator();
+                }
+
+                // New record affects the view
+                if (recIndex <= endRecIndex) {
+                    this.render();
+                }
+                
+                // TODO: what args to pass?
+                this.fireEvent("rowAddEvent", {record:oRecord});
+        
+                // For log message
+                recIndex = (lang.isValue(recIndex))? recIndex : "n/a";
+        
+                YAHOO.log("Added row: Record ID = " + oRecord.getId() +
+                        ", Record index = " + this.getRecordIndex(oRecord) +
+                        ", page row index = " + recIndex, "info", this.toString());
+                
+                return;
+            }
+            // Not paginated
+            else {
+                recIndex = this.getTrIndex(oRecord);
+                if(lang.isNumber(recIndex)) {
+                    if((this instanceof DT) && this._sId) {
+                        // Add the TR element
+                        var elNewTr = this._createTrEl(oRecord);
+                        if(elNewTr) {
+                            if (recIndex >= 0 && recIndex < this._elTbody.rows.length) {
+                                this._elTbody.insertBefore(elNewTr,
+                                    this._elTbody.rows[recIndex]);
+                                if (!recIndex) {
+                                    this._setFirstRow();
+                                }
+                            } else {
+                                this._elTbody.appendChild(elNewTr);
+                                this._setLastRow();
+                                recIndex = this._elTbody.rows.length - 1;
+                            }
+                            this._setRowStripes(recIndex);
+
+                            this._syncColWidths();
+                        }
+                        this.hideTableMessage();
+
+                        // TODO: what args to pass?
+                        this.fireEvent("rowAddEvent", {record:oRecord});
+
+                        // For log message
+                        recIndex = (lang.isValue(recIndex))? recIndex : "n/a";
+
+                        YAHOO.log("Added row: Record ID = " + oRecord.getId() +
+                                ", Record index = " + this.getRecordIndex(oRecord) +
+                                ", page row index = " + recIndex, "info", this.toString());
+                    }
+                    return;
+                }
+            }            
+        }
+    }
+    YAHOO.log("Could not add row with " + lang.dump(oData), "error", this.toString());
+},
+
+/**
+ * Convenience method to add multiple rows.
+ *
+ * @method addRows
+ * @param aData {Object[]} Array of object literal data for the rows.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+addRows : function(aData, index) {
+    if(lang.isArray(aData)) {
+        var i;
+        if(lang.isNumber(index)) {
+            for(i=aData.length-1; i>-1; i--) {
+                this.addRow(aData[i], index);
+            }
+        }
+        else {
+            for(i=0; i<aData.length; i++) {
+                this.addRow(aData[i]);
+            }
+        }
+    }
+    else {
+        YAHOO.log("Could not add rows " + lang.dump(aData));
+    }
+},
+
+/**
+ * For the given row, updates the associated Record with the given data. If the
+ * row is on current page, the corresponding DOM elements are also updated.
+ *
+ * @method updateRow
+ * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
+ * Which row to update: By Record instance, by Record's RecordSet
+ * position index, by HTMLElement reference to the TR element, or by ID string
+ * of the TR element.
+ * @param oData {Object} Object literal of data for the row.
+ */
+updateRow : function(row, oData) {
+    var oldRecord, oldData, updatedRecord, elRow;
+
+    // Get the Record directly
+    if((row instanceof YAHOO.widget.Record) || (lang.isNumber(row))) {
+            // Get the Record directly
+            oldRecord = this._oRecordSet.getRecord(row);
+
+            // Is this row on current page?
+            elRow = this.getTrEl(oldRecord);
+    }
+    // Get the Record by TR element
+    else {
+        elRow = this.getTrEl(row);
+        if(elRow) {
+            oldRecord = this.getRecord(elRow);
+        }
+    }
+
+    // Update the Record
+    if(oldRecord) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = oldRecord.getData();
+        oldData = YAHOO.widget.DataTable._cloneObject(oRecordData);
+
+        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
+    }
+    else {
+        YAHOO.log("Could not update row " + row + " with the data : " +
+                lang.dump(oData), "error", this.toString());
+        return;
+
+    }
+
+    // Update the TR only if row is on current page
+    if(elRow) {
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId) {
+                    this._updateTrEl(elRow, updatedRecord);
+                    this._syncColWidths();
+                    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+                    YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
+                            ", Record index = " + this.getRecordIndex(updatedRecord) +
+                            ", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());
+                }
+            },
+            scope: this,
+            timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
+        });
+        this._oChain.run();
+    }
+    else {
+        this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+        YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
+                ", Record index = " + this.getRecordIndex(updatedRecord) +
+                ", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());   
+    }
+
+},
+
+/**
+ * Deletes the given row's Record from the RecordSet. If the row is on current page,
+ * the corresponding DOM elements are also deleted.
+ *
+ * @method deleteRow
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+deleteRow : function(row) {
+    // Get the Record index...
+    var oRecord = null;
+    // ...by Record index
+    if(lang.isNumber(row)) {
+        oRecord = this._oRecordSet.getRecord(row);
+    }
+    // ...by element reference
+    else {
+        var elRow = Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            oRecord = this.getRecord(elRow);
+        }
+    }
+    if(oRecord) {
+        var oPaginator = this.get('paginator');
+        var sRecordId = oRecord.getId();
+
+        // Remove from selection tracker if there
+        var tracker = this._aSelections || [];
+        for(var j=tracker.length-1; j>-1; j--) {
+            if((lang.isNumber(tracker[j]) && (tracker[j] === sRecordId)) ||
+                    ((tracker[j].constructor == Object) && (tracker[j].recordId === sRecordId))) {
+                tracker.splice(j,1);
+            }
+        }
+
+        // Copy data from the Record for the event that gets fired later
+        var nTrIndex = this.getTrIndex(oRecord);
+        var nRecordIndex = this.getRecordIndex(oRecord);
+        var oRecordData = oRecord.getData();
+        var oData = YAHOO.widget.DataTable._cloneObject(oRecordData);
+
+        // Delete Record from RecordSet
+        this._oRecordSet.deleteRecord(nRecordIndex);
+
+        // If paginated and the deleted row was on this or a prior page, just
+        // re-render
+        if (oPaginator instanceof Pag ||
+            this.get('paginated')) {
+
+            var endRecIndex;
+            if (oPaginator instanceof Pag) {
+                // Update the paginator's totalRecords
+                var totalRecords = oPaginator.get('totalRecords');
+                if (totalRecords !== Pag.VALUE_UNLIMITED) {
+                    oPaginator.set('totalRecords',totalRecords - 1);
+                }
+
+                endRecIndex = (oPaginator.getPageRecords())[1];
+            } else {
+                // Backward compatibility
+                endRecIndex = oPaginator.startRecordIndex +
+                              oPaginator.rowsPerPage - 1;
+
+                this.updatePaginator();
+            }
+
+            // If the deleted record was on this or a prior page, re-render
+            if (nRecordIndex <= endRecIndex) {
+                this.render();
+            }
+        }
+        else {
+            if(lang.isNumber(nTrIndex)) {
+                this._oChain.add({
+                    method: function() {
+                        if((this instanceof DT) && this._sId) {
+                            var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex);
+                            this._deleteTrEl(nTrIndex);
+            
+                            // Empty body
+                            if(this._elTbody.rows.length === 0) {
+                                this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+                            }
+                            // Update UI
+                            else {
+                                // Set FIRST/LAST
+                                if(nTrIndex === 0) {
+                                    this._setFirstRow();
+                                }
+                                if(isLast) {
+                                    this._setLastRow();
+                                }
+                                // Set EVEN/ODD
+                                if(nTrIndex != this._elTbody.rows.length) {
+                                    this._setRowStripes(nTrIndex);
+                                }                                
+                            }
+            
+                            this._syncColWidths();
+                            
+                            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                                    oldData:oData, trElIndex:nTrIndex});
+                            YAHOO.log("DataTable row deleted: Record ID = " + sRecordId +
+                                    ", Record index = " + nRecordIndex +
+                                    ", page row index = " + nTrIndex, "info", this.toString());
+                        }
+                    },
+                    scope: this,
+                    timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
+                });
+                this._oChain.run();
+                return;
+            }
+        }
+
+        this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                oldData:oData, trElIndex:nTrIndex});
+        YAHOO.log("DataTable row deleted: Record ID = " + sRecordId +
+                ", Record index = " + nRecordIndex +
+                ", page row index = " + nTrIndex, "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not delete row: " + row, "warn", this.toString());
+    }
+},
+
+/**
+ * Convenience method to delete multiple rows.
+ *
+ * @method deleteRows
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ * @param count {Number} (optional) How many rows to delete. A negative value
+ * will delete towards the beginning.
+ */
+deleteRows : function(row, count) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        if(count && lang.isNumber(count)) {
+            // Start with highest index and work down
+            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
+            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
+            for(var i=startIndex; i>endIndex-1; i--) {
+                this.deleteRow(i);
+            }
+        }
+        else {
+            this.deleteRow(nRecordIndex);
+        }
+    }
+    else {
+        YAHOO.log("Could not delete row " + row, "info", this.toString());
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CELL FUNCTIONS
+
+/**
+ * Outputs markup into the given TD based on given Record.
+ *
+ * @method formatCell
+ * @param elCell {HTMLElement} The liner DIV element within the TD.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ */
+formatCell : function(elCell, oRecord, oColumn) {
+    if(!(oRecord instanceof YAHOO.widget.Record)) {
+        oRecord = this.getRecord(elCell);
+    }
+    if(!(oColumn instanceof YAHOO.widget.Column)) {
+        oColumn = this._oColumnSet.getColumn(elCell.parentNode.yuiColumnKey);
+    }
+
+    if(oRecord && oColumn) {
+        var sKey = oColumn.key;
+        var oData = oRecord.getData(sKey);
+
+        // Add classNames
+        var aClasses;
+        if(lang.isString(oColumn.className)) {
+            aClasses = [oColumn.className];
+        }
+        else if(lang.isArray(oColumn.className)) {
+            aClasses = oColumn.className;
+        }
+        else {
+            aClasses = [];
+        }
+
+        //TODO: document special keys will get stripped here
+        aClasses[aClasses.length] = "yui-dt-col-"+sKey.replace(/[^\w\-.:]/g,"");
+        
+        aClasses[aClasses.length] = "yui-dt-col-"+oColumn.getId();
+        
+        aClasses[aClasses.length] = DT.CLASS_LINER;
+
+        if(oColumn.sortable) {
+            aClasses[aClasses.length] = DT.CLASS_SORTABLE;
+        }
+        if(oColumn.resizeable) {
+            aClasses[aClasses.length] = DT.CLASS_RESIZEABLE;
+        }
+        if(oColumn.editor) {
+            aClasses[aClasses.length] = DT.CLASS_EDITABLE;
+        }
+
+        elCell.className = "";
+        Dom.addClass(elCell, aClasses.join(" "));
+
+
+        var fnFormatter = typeof oColumn.formatter === 'function' ?
+                          oColumn.formatter :
+                          DT.Formatter[oColumn.formatter+''];
+
+        // Apply special formatter
+        if(fnFormatter) {
+            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
+        }
+        else {
+            elCell.innerHTML = oData === undefined ||
+                               oData === null ||
+                               (typeof oData === 'number' && isNaN(oData)) ?
+                                "" : oData.toString();
+        }
+
+        this.fireEvent("cellFormatEvent", {record:oRecord, column:oColumn, key:sKey, el:elCell});
+    }
+    else {
+        YAHOO.log("Could not format cell " + elCell, "error", this.toString());
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// PAGINATION
+
+/**
+ * Delegates the Pag changeRequest events to the configured
+ * handler.
+ * @method onPaginatorChange
+ * @param {Object} an object literal describing the proposed pagination state
+ */
+onPaginatorChange : function (oState) {
+    var handler = this.get('paginationEventHandler');
+
+    handler(oState,this);
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// SELECTION/HIGHLIGHTING
+
+/**
+ * ID string of last highlighted cell element
+ *
+ * @property _sLastHighlightedTdElId
+ * @type String
+ * @private
+ */
+//_sLastHighlightedTdElId : null,
+
+/**
+ * ID string of last highlighted row element
+ *
+ * @property _sLastHighlightedTrElId
+ * @type String
+ * @private
+ */
+//_sLastHighlightedTrElId : null,
+
+/**
+ * Array to track row selections (by sRecordId) and/or cell selections
+ * (by {recordId:sRecordId, columnId:sColumnId})
+ *
+ * @property _aSelections
+ * @type Object[]
+ * @private
+ */
+_aSelections : null,
+
+/**
+ * Record instance of the row selection anchor.
+ *
+ * @property _oAnchorRecord
+ * @type YAHOO.widget.Record
+ * @private
+ */
+_oAnchorRecord : null,
+
+/**
+ * Object literal representing cell selection anchor:
+ * {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @property _oAnchorCell
+ * @type Object
+ * @private
+ */
+_oAnchorCell : null,
+
+/**
+ * Convenience method to remove the class DT.CLASS_SELECTED
+ * from all TR elements on the page.
+ *
+ * @method _unselectAllTrEls
+ * @private
+ */
+_unselectAllTrEls : function() {
+    var selectedRows = Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
+    Dom.removeClass(selectedRows, DT.CLASS_SELECTED);
+},
+
+/**
+ * Returns object literal of values that represent the selection trigger. Used
+ * to determine selection behavior resulting from a key event.
+ *
+ * @method _getSelectionTrigger
+ * @private
+ */
+_getSelectionTrigger : function() {
+    var sMode = this.get("selectionMode");
+    var oTrigger = {};
+    var oTriggerCell, oTriggerRecord, nTriggerRecordIndex, elTriggerRow, nTriggerTrIndex;
+
+    // Cell mode
+    if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+        oTriggerCell = this.getLastSelectedCell();
+        // No selected cells found
+        if(!oTriggerCell) {
+            return null;
+        }
+        else {
+            oTriggerRecord = this.getRecord(oTriggerCell.recordId);
+            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
+            elTriggerRow = this.getTrEl(oTriggerRecord);
+            nTriggerTrIndex = this.getTrIndex(elTriggerRow);
+
+            // Selected cell not found on this page
+            if(nTriggerTrIndex === null) {
+                return null;
+            }
+            else {
+                oTrigger.record = oTriggerRecord;
+                oTrigger.recordIndex = nTriggerRecordIndex;
+                oTrigger.el = this.getTdEl(oTriggerCell);
+                oTrigger.trIndex = nTriggerTrIndex;
+                oTrigger.column = this.getColumnById(oTriggerCell.columnId);
+                oTrigger.colKeyIndex = oTrigger.column.getKeyIndex();
+                oTrigger.cell = oTriggerCell;
+                return oTrigger;
+            }
+        }
+    }
+    // Row mode
+    else {
+        oTriggerRecord = this.getLastSelectedRecord();
+        // No selected rows found
+        if(!oTriggerRecord) {
+                return null;
+        }
+        else {
+            // Selected row found, but is it on current page?
+            oTriggerRecord = this.getRecord(oTriggerRecord);
+            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
+            elTriggerRow = this.getTrEl(oTriggerRecord);
+            nTriggerTrIndex = this.getTrIndex(elTriggerRow);
+
+            // Selected row not found on this page
+            if(nTriggerTrIndex === null) {
+                return null;
+            }
+            else {
+                oTrigger.record = oTriggerRecord;
+                oTrigger.recordIndex = nTriggerRecordIndex;
+                oTrigger.el = elTriggerRow;
+                oTrigger.trIndex = nTriggerTrIndex;
+                return oTrigger;
+            }
+        }
+    }
+},
+
+/**
+ * Returns object literal of values that represent the selection anchor. Used
+ * to determine selection behavior resulting from a user event.
+ *
+ * @method _getSelectionAnchor
+ * @param oTrigger {Object} (Optional) Object literal of selection trigger values
+ * (for key events).
+ * @private
+ */
+_getSelectionAnchor : function(oTrigger) {
+    var sMode = this.get("selectionMode");
+    var oAnchor = {};
+    var oAnchorRecord, nAnchorRecordIndex, nAnchorTrIndex;
+
+    // Cell mode
+    if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+        // Validate anchor cell
+        var oAnchorCell = this._oAnchorCell;
+        if(!oAnchorCell) {
+            if(oTrigger) {
+                oAnchorCell = this._oAnchorCell = oTrigger.cell;
+            }
+            else {
+                return null;
+            }
+        }
+        oAnchorRecord = this._oAnchorCell.record;
+        nAnchorRecordIndex = this._oRecordSet.getRecordIndex(oAnchorRecord);
+        nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
+        // If anchor cell is not on this page...
+        if(nAnchorTrIndex === null) {
+            // ...set TR index equal to top TR
+            if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
+                nAnchorTrIndex = 0;
+            }
+            // ...set TR index equal to bottom TR
+            else {
+                nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
+            }
+        }
+
+        oAnchor.record = oAnchorRecord;
+        oAnchor.recordIndex = nAnchorRecordIndex;
+        oAnchor.trIndex = nAnchorTrIndex;
+        oAnchor.column = this._oAnchorCell.column;
+        oAnchor.colKeyIndex = oAnchor.column.getKeyIndex();
+        oAnchor.cell = oAnchorCell;
+        return oAnchor;
+    }
+    // Row mode
+    else {
+        oAnchorRecord = this._oAnchorRecord;
+        if(!oAnchorRecord) {
+            if(oTrigger) {
+                oAnchorRecord = this._oAnchorRecord = oTrigger.record;
+            }
+            else {
+                return null;
+            }
+        }
+
+        nAnchorRecordIndex = this.getRecordIndex(oAnchorRecord);
+        nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
+        // If anchor row is not on this page...
+        if(nAnchorTrIndex === null) {
+            // ...set TR index equal to top TR
+            if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
+                nAnchorTrIndex = 0;
+            }
+            // ...set TR index equal to bottom TR
+            else {
+                nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
+            }
+        }
+
+        oAnchor.record = oAnchorRecord;
+        oAnchor.recordIndex = nAnchorRecordIndex;
+        oAnchor.trIndex = nAnchorTrIndex;
+        return oAnchor;
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "standard".
+ *
+ * @method _handleStandardSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleStandardSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var i;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+            // Validate anchor
+            if(oAnchor) {
+                if(this.isSelected(oAnchor.record)) {
+                    // Select all rows between anchor row and target row, including target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex; i++) {
+                            if(!this.isSelected(i)) {
+                                this.selectRow(i);
+                            }
+                        }
+                    }
+                    // Select all rows between target row and anchor row, including target row
+                    else {
+                        for(i=oAnchor.recordIndex-1; i>=nTargetRecordIndex; i--) {
+                            if(!this.isSelected(i)) {
+                                this.selectRow(i);
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Unselect all rows between anchor row and target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex-1; i++) {
+                            if(this.isSelected(i)) {
+                                this.unselectRow(i);
+                            }
+                        }
+                    }
+                    // Unselect all rows between target row and anchor row
+                    else {
+                        for(i=nTargetRecordIndex+1; i<=oAnchor.recordIndex-1; i++) {
+                            if(this.isSelected(i)) {
+                                this.unselectRow(i);
+                            }
+                        }
+                    }
+                    // Select the target row
+                    this.selectRow(oTargetRecord);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorRecord = oTargetRecord;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetRecord)) {
+                    this.unselectRow(oTargetRecord);
+                }
+                else {
+                    this.selectRow(oTargetRecord);
+                }
+            }
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+            this.unselectAllRows();
+
+            // Validate anchor
+            if(oAnchor) {
+                // Select all rows between anchor row and target row,
+                // including the anchor row and target row
+                if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    for(i=oAnchor.recordIndex; i<=nTargetRecordIndex; i++) {
+                        this.selectRow(i);
+                    }
+                }
+                // Select all rows between target row and anchor row,
+                // including the target row and anchor row
+                else {
+                    for(i=oAnchor.recordIndex; i>=nTargetRecordIndex; i--) {
+                        this.selectRow(i);
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorRecord = oTargetRecord;
+
+                // Select target row only
+                this.selectRow(oTargetRecord);
+            }
+        }
+        // Only CTRL
+        else if(bCTRL) {
+            // Set anchor
+            this._oAnchorRecord = oTargetRecord;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetRecord)) {
+                this.unselectRow(oTargetRecord);
+            }
+            else {
+                this.selectRow(oTargetRecord);
+            }
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleSelectionByMouse(oArgs);
+            return;
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "standard".
+ *
+ * @method _handleStandardSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleStandardSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+
+    if((nKey == 38) || (nKey == 40)) {
+        var bSHIFT = e.shiftKey;
+
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        // Determine which direction we're going to
+        if(bSHIFT) {
+            // Selecting down away from anchor row
+            if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
+                this.selectRow(this.getNextTrEl(oTrigger.el));
+            }
+            // Selecting up away from anchor row
+            else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
+                this.selectRow(this.getPreviousTrEl(oTrigger.el));
+            }
+            // Unselect trigger
+            else {
+                this.unselectRow(oTrigger.el);
+            }
+        }
+        else {
+            this._handleSingleSelectionByKey(e);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "single".
+ *
+ * @method _handleSingleSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleSingleSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var oTargetRecord = this.getRecord(elTargetRow);
+
+        // Set anchor
+        this._oAnchorRecord = oTargetRecord;
+
+        // Select only target
+        this.unselectAllRows();
+        this.selectRow(oTargetRecord);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "single".
+ *
+ * @method _handleSingleSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleSingleSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+
+    if((nKey == 38) || (nKey == 40)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Determine the new row to select
+        var elNew;
+        if(nKey == 38) { // arrow up
+            elNew = this.getPreviousTrEl(oTrigger.el);
+
+            // Validate new row
+            if(elNew === null) {
+                //TODO: wrap around to last tr on current page
+                //elNew = this.getLastTrEl();
+
+                //TODO: wrap back to last tr of previous page
+
+                // Top row selection is sticky
+                elNew = this.getFirstTrEl();
+            }
+        }
+        else if(nKey == 40) { // arrow down
+            elNew = this.getNextTrEl(oTrigger.el);
+
+            // Validate new row
+            if(elNew === null) {
+                //TODO: wrap around to first tr on current page
+                //elNew = this.getFirstTrEl();
+
+                //TODO: wrap forward to first tr of previous page
+
+                // Bottom row selection is sticky
+                elNew = this.getLastTrEl();
+            }
+        }
+
+        // Unselect all rows
+        this.unselectAllRows();
+
+        // Select the new row
+        this.selectRow(elNew);
+
+        // Set new anchor
+        this._oAnchorRecord = this.getRecord(elNew);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "cellblock".
+ *
+ * @method _handleCellBlockSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleCellBlockSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var nTargetTrIndex = this.getTrIndex(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var nTargetColKeyIndex = oTargetColumn.getKeyIndex();
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var allRows = this.getTbodyEl().rows;
+        var startIndex, endIndex, currentRow, i, j;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+
+            // Validate anchor
+            if(oAnchor) {
+                // Anchor is selected
+                if(this.isSelected(oAnchor.cell)) {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<=nTargetColKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex; i<oAnchor.colKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                        endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                        // Select all cells from startIndex to endIndex on rows between anchor row and target row
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        startIndex = Math.min(oAnchor.trIndex, nTargetColKeyIndex);
+                        endIndex = Math.max(oAnchor.trIndex, nTargetColKeyIndex);
+
+                        // Select all cells from startIndex to endIndex on rows between target row and anchor row
+                        for(i=oAnchor.trIndex; i>=nTargetTrIndex; i--) {
+                            for(j=endIndex; j>=startIndex; j--) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<nTargetColKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex+1; i<oAnchor.colKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex === oAnchor.trIndex) {
+                                    if(j>oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex === nTargetTrIndex) {
+                                    if(j<nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                    if(j<oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetCell)) {
+                    this.unselectCell(oTargetCell);
+                }
+                else {
+                    this.selectCell(oTargetCell);
+                }
+            }
+
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(oAnchor) {
+                // All cells are on the same row
+                if(oAnchor.recordIndex === nTargetRecordIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                        for(i=oAnchor.colKeyIndex; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                        for(i=nTargetColKeyIndex; i<=oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    // Select the cellblock from anchor cell to target cell
+                    // including the anchor cell and the target cell
+                    startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                    endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                    for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                        for(j=startIndex; j<=endIndex; j++) {
+                            this.selectCell(allRows[i].cells[j]);
+                        }
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    // Select the cellblock from target cell to anchor cell
+                    // including the target cell and the anchor cell
+                    startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                    endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                    for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                        for(j=startIndex; j<=endIndex; j++) {
+                            this.selectCell(allRows[i].cells[j]);
+                        }
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Select target only
+                this.selectCell(oTargetCell);
+            }
+        }
+        // Only CTRL
+        else if(bCTRL) {
+
+            // Set anchor
+            this._oAnchorCell = oTargetCell;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetCell)) {
+                this.unselectCell(oTargetCell);
+            }
+            else {
+                this.selectCell(oTargetCell);
+            }
+
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleCellSelectionByMouse(oArgs);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "cellblock".
+ *
+ * @method _handleCellBlockSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleCellBlockSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    var bSHIFT = e.shiftKey;
+    if((nKey == 9) || !bSHIFT) {
+        this._handleSingleCellSelectionByKey(e);
+        return;
+    }
+
+    if((nKey > 36) && (nKey < 41)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        var i, startIndex, endIndex, elNew, elNewRow;
+        var allRows = this.getTbodyEl().rows;
+        var elThisRow = oTrigger.el.parentNode;
+
+        // Determine which direction we're going to
+
+        if(nKey == 40) { // arrow down
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex <= oTrigger.recordIndex) {
+                // Select the horiz block on the next row...
+                // ...making sure there is room below the trigger row
+                elNewRow = this.getNextTrEl(oTrigger.el);
+                if(elNewRow) {
+                    startIndex = oAnchor.colKeyIndex;
+                    endIndex = oTrigger.colKeyIndex;
+                    // ...going left
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going right
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                startIndex = Math.min(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                endIndex = Math.max(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                // Unselect the horiz block on this row towards the next row
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+            }
+        }
+        // Arrow up
+        else if(nKey == 38) {
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex >= oTrigger.recordIndex) {
+                // Select the horiz block on the previous row...
+                // ...making sure there is room
+                elNewRow = this.getPreviousTrEl(oTrigger.el);
+                if(elNewRow) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.colKeyIndex;
+                    endIndex = oTrigger.colKeyIndex;
+                    // ...going left
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going right
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                startIndex = Math.min(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                endIndex = Math.max(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                // Unselect the horiz block on this row towards the previous row
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+            }
+        }
+        // Arrow right
+        else if(nKey == 39) {
+            // Selecting away from anchor cell
+            if(oAnchor.colKeyIndex <= oTrigger.colKeyIndex) {
+                // Select the next vert block to the right...
+                // ...making sure there is room
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.trIndex;
+                    endIndex = oTrigger.trIndex;
+                    // ...going up
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex+1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going down
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex+1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect the vert block on this column towards the right
+                startIndex = Math.min(oAnchor.trIndex, oTrigger.trIndex);
+                endIndex = Math.max(oAnchor.trIndex, oTrigger.trIndex);
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(allRows[i].cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+        // Arrow left
+        else if(nKey == 37) {
+            // Selecting away from anchor cell
+            if(oAnchor.colKeyIndex >= oTrigger.colKeyIndex) {
+                //Select the previous vert block to the left
+                if(oTrigger.colKeyIndex > 0) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.trIndex;
+                    endIndex = oTrigger.trIndex;
+                    // ...going up
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex-1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going down
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex-1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect the vert block on this column towards the left
+                startIndex = Math.min(oAnchor.trIndex, oTrigger.trIndex);
+                endIndex = Math.max(oAnchor.trIndex, oTrigger.trIndex);
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(allRows[i].cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "cellrange".
+ *
+ * @method _handleCellRangeSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleCellRangeSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var nTargetTrIndex = this.getTrIndex(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var nTargetColKeyIndex = oTargetColumn.getKeyIndex();
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var allRows = this.getTbodyEl().rows;
+        var currentRow, i, j;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+
+            // Validate anchor
+            if(oAnchor) {
+                // Anchor is selected
+                if(this.isSelected(oAnchor.cell)) {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<=nTargetColKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex; i<oAnchor.colKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Select all cells on anchor row from anchor cell to the end of the row
+                        for(i=oAnchor.colKeyIndex+1; i<elTargetRow.cells.length; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+
+                        // Select all cells on all rows between anchor row and target row
+                        for(i=oAnchor.trIndex+1; i<nTargetTrIndex; i++) {
+                            for(j=0; j<allRows[i].cells.length; j++){
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+
+                        // Select all cells on target row from first cell to the target cell
+                        for(i=0; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Select all cells on target row from target cell to the end of the row
+                        for(i=nTargetColKeyIndex; i<elTargetRow.cells.length; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+
+                        // Select all cells on all rows between target row and anchor row
+                        for(i=nTargetTrIndex+1; i<oAnchor.trIndex; i++) {
+                            for(j=0; j<allRows[i].cells.length; j++){
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+
+                        // Select all cells on anchor row from first cell to the anchor cell
+                        for(i=0; i<oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<nTargetColKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex+1; i<oAnchor.colKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex === oAnchor.trIndex) {
+                                    if(j>oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex === nTargetTrIndex) {
+                                    if(j<nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                    if(j<oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetCell)) {
+                    this.unselectCell(oTargetCell);
+                }
+                else {
+                    this.selectCell(oTargetCell);
+                }
+            }
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(oAnchor) {
+                // All cells are on the same row
+                if(oAnchor.recordIndex === nTargetRecordIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                        for(i=oAnchor.colKeyIndex; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                        for(i=nTargetColKeyIndex; i<=oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    // Select all cells from anchor cell to target cell
+                    // including the anchor cell and target cell
+                    for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                        currentRow = allRows[i];
+                        for(j=0; j<currentRow.cells.length; j++) {
+                            // This is the anchor row, only select the anchor cell and after
+                            if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                if(j>=oAnchor.colKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // This is the target row, only select the target cell and before
+                            else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                if(j<=nTargetColKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // Select all cells on this row
+                            else {
+                                this.selectCell(currentRow.cells[j]);
+                            }
+                        }
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    // Select all cells from target cell to anchor cell,
+                    // including the target cell and anchor cell
+                    for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                        currentRow = allRows[i];
+                        for(j=0; j<currentRow.cells.length; j++) {
+                            // This is the target row, only select the target cell and after
+                            if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                if(j>=nTargetColKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // This is the anchor row, only select the anchor cell and before
+                            else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                if(j<=oAnchor.colKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // Select all cells on this row
+                            else {
+                                this.selectCell(currentRow.cells[j]);
+                            }
+                        }
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Select target only
+                this.selectCell(oTargetCell);
+            }
+
+
+        }
+        // Only CTRL
+        else if(bCTRL) {
+
+            // Set anchor
+            this._oAnchorCell = oTargetCell;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetCell)) {
+                this.unselectCell(oTargetCell);
+            }
+            else {
+                this.selectCell(oTargetCell);
+            }
+
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleCellSelectionByMouse(oArgs);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "cellrange".
+ *
+ * @method _handleCellRangeSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleCellRangeSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    var bSHIFT = e.shiftKey;
+    if((nKey == 9) || !bSHIFT) {
+        this._handleSingleCellSelectionByKey(e);
+        return;
+    }
+
+    if((nKey > 36) && (nKey < 41)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        var i, elNewRow, elNew;
+        var allRows = this.getTbodyEl().rows;
+        var elThisRow = oTrigger.el.parentNode;
+
+        // Arrow down
+        if(nKey == 40) {
+            elNewRow = this.getNextTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex <= oTrigger.recordIndex) {
+                // Select all cells to the end of this row
+                for(i=oTrigger.colKeyIndex+1; i<elThisRow.cells.length; i++){
+                    elNew = elThisRow.cells[i];
+                    this.selectCell(elNew);
+                }
+
+                // Select some of the cells on the next row down
+                if(elNewRow) {
+                    for(i=0; i<=oTrigger.colKeyIndex; i++){
+                        elNew = elNewRow.cells[i];
+                        this.selectCell(elNew);
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect all cells to the end of this row
+                for(i=oTrigger.colKeyIndex; i<elThisRow.cells.length; i++){
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+
+                // Unselect some of the cells on the next row down
+                if(elNewRow) {
+                    for(i=0; i<oTrigger.colKeyIndex; i++){
+                        this.unselectCell(elNewRow.cells[i]);
+                    }
+                }
+            }
+        }
+        // Arrow up
+        else if(nKey == 38) {
+            elNewRow = this.getPreviousTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex >= oTrigger.recordIndex) {
+                // Select all the cells to the beginning of this row
+                for(i=oTrigger.colKeyIndex-1; i>-1; i--){
+                    elNew = elThisRow.cells[i];
+                    this.selectCell(elNew);
+                }
+
+                // Select some of the cells from the end of the previous row
+                if(elNewRow) {
+                    for(i=elThisRow.cells.length-1; i>=oTrigger.colKeyIndex; i--){
+                        elNew = elNewRow.cells[i];
+                        this.selectCell(elNew);
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect all the cells to the beginning of this row
+                for(i=oTrigger.colKeyIndex; i>-1; i--){
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+
+                // Unselect some of the cells from the end of the previous row
+                if(elNewRow) {
+                    for(i=elThisRow.cells.length-1; i>oTrigger.colKeyIndex; i--){
+                        this.unselectCell(elNewRow.cells[i]);
+                    }
+                }
+            }
+        }
+        // Arrow right
+        else if(nKey == 39) {
+            elNewRow = this.getNextTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex < oTrigger.recordIndex) {
+                // Select the next cell to the right
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                    elNew = elThisRow.cells[oTrigger.colKeyIndex+1];
+                    this.selectCell(elNew);
+                }
+                // Select the first cell of the next row
+                else if(elNewRow) {
+                    elNew = elNewRow.cells[0];
+                    this.selectCell(elNew);
+                }
+            }
+            // Unselecting towards anchor cell
+            else if(oAnchor.recordIndex > oTrigger.recordIndex) {
+                this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                // Unselect this cell towards the right
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                }
+                // Unselect this cells towards the first cell of the next row
+                else {
+                }
+            }
+            // Anchor is on this row
+            else {
+                // Selecting away from anchor
+                if(oAnchor.colKeyIndex <= oTrigger.colKeyIndex) {
+                    // Select the next cell to the right
+                    if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                        elNew = elThisRow.cells[oTrigger.colKeyIndex+1];
+                        this.selectCell(elNew);
+                    }
+                    // Select the first cell on the next row
+                    else if(oTrigger.trIndex < allRows.length-1){
+                        elNew = elNewRow.cells[0];
+                        this.selectCell(elNew);
+                    }
+                }
+                // Unselecting towards anchor
+                else {
+                    // Unselect this cell towards the right
+                    this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+        // Arrow left
+        else if(nKey == 37) {
+            elNewRow = this.getPreviousTrEl(oTrigger.el);
+
+            // Unselecting towards the anchor
+            if(oAnchor.recordIndex < oTrigger.recordIndex) {
+                this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                // Unselect this cell towards the left
+                if(oTrigger.colKeyIndex > 0) {
+                }
+                // Unselect this cell towards the last cell of the previous row
+                else {
+                }
+            }
+            // Selecting towards the anchor
+            else if(oAnchor.recordIndex > oTrigger.recordIndex) {
+                // Select the next cell to the left
+                if(oTrigger.colKeyIndex > 0) {
+                    elNew = elThisRow.cells[oTrigger.colKeyIndex-1];
+                    this.selectCell(elNew);
+                }
+                // Select the last cell of the previous row
+                else if(oTrigger.trIndex > 0){
+                    elNew = elNewRow.cells[elNewRow.cells.length-1];
+                    this.selectCell(elNew);
+                }
+            }
+            // Anchor is on this row
+            else {
+                // Selecting away from anchor cell
+                if(oAnchor.colKeyIndex >= oTrigger.colKeyIndex) {
+                    // Select the next cell to the left
+                    if(oTrigger.colKeyIndex > 0) {
+                        elNew = elThisRow.cells[oTrigger.colKeyIndex-1];
+                        this.selectCell(elNew);
+                    }
+                    // Select the last cell of the previous row
+                    else if(oTrigger.trIndex > 0){
+                        elNew = elNewRow.cells[elNewRow.cells.length-1];
+                        this.selectCell(elNew);
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                    // Unselect this cell towards the left
+                    if(oTrigger.colKeyIndex > 0) {
+                    }
+                    // Unselect this cell towards the last cell of the previous row
+                    else {
+                    }
+                }
+            }
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "singlecell".
+ *
+ * @method _handleSingleCellSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleSingleCellSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        // Set anchor
+        this._oAnchorCell = oTargetCell;
+
+        // Select only target
+        this.unselectAllCells();
+        this.selectCell(oTargetCell);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "singlecell".
+ *
+ * @method _handleSingleCellSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleSingleCellSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    if((nKey == 9) || ((nKey > 36) && (nKey < 41))) {
+        var bSHIFT = e.shiftKey;
+
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        // Determine the new cell to select
+        var elNew;
+        if(nKey == 40) { // Arrow down
+            elNew = this.getBelowTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to first tr on current page
+
+                //TODO: wrap forward to first tr of next page
+
+                // Bottom selection is sticky
+                elNew = oTrigger.el;
+            }
+        }
+        else if(nKey == 38) { // Arrow up
+            elNew = this.getAboveTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to last tr on current page
+
+                //TODO: wrap back to last tr of previous page
+
+                // Top selection is sticky
+                elNew = oTrigger.el;
+            }
+        }
+        else if((nKey == 39) || (!bSHIFT && (nKey == 9))) { // Arrow right or tab
+            elNew = this.getNextTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to first td on current page
+
+                //TODO: wrap forward to first td of next page
+
+                // Top-left selection is sticky, and release TAB focus
+                //elNew = oTrigger.el;
+                return;
+            }
+        }
+        else if((nKey == 37) || (bSHIFT && (nKey == 9))) { // Arrow left or shift-tab
+            elNew = this.getPreviousTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to last td on current page
+
+                //TODO: wrap back to last td of previous page
+
+                // Bottom-right selection is sticky, and release TAB focus
+                //elNew = oTrigger.el;
+                return;
+            }
+        }
+
+        Ev.stopEvent(e);
+        
+        // Unselect all cells
+        this.unselectAllCells();
+
+        // Select the new cell
+        this.selectCell(elNew);
+
+        // Set new anchor
+        this._oAnchorCell = {record:this.getRecord(elNew), column:this.getColumn(elNew)};
+    }
+},
+
+/**
+ * Returns array of selected TR elements on the page.
+ *
+ * @method getSelectedTrEls
+ * @return {HTMLElement[]} Array of selected TR elements.
+ */
+getSelectedTrEls : function() {
+    return Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
+},
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method selectRow
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element
+ * reference or ID string, Record instance, or RecordSet position index.
+ */
+selectRow : function(row) {
+    var oRecord, elRow;
+
+    if(row instanceof YAHOO.widget.Record) {
+        oRecord = this._oRecordSet.getRecord(row);
+        elRow = this.getTrEl(oRecord);
+    }
+    else if(lang.isNumber(row)) {
+        oRecord = this.getRecord(row);
+        elRow = this.getTrEl(oRecord);
+    }
+    else {
+        elRow = this.getTrEl(row);
+        oRecord = this.getRecord(elRow);
+    }
+
+    if(oRecord) {
+        // Update selection trackers
+        var tracker = this._aSelections || [];
+        var sRecordId = oRecord.getId();
+        var index = -1;
+
+        // Remove if already there:
+        // Use Array.indexOf if available...
+        /*if(tracker.indexOf && (tracker.indexOf(sRecordId) >  -1)) {
+            tracker.splice(tracker.indexOf(sRecordId),1);
+        }*/
+        if(tracker.indexOf) {
+            index = tracker.indexOf(sRecordId);
+            
+        }
+        // ...or do it the old-fashioned way
+        else {
+            for(var j=tracker.length-1; j>-1; j--) {
+                if(tracker[j] === sRecordId){
+                    index = j;
+                    break;
+                }
+            }
+        }
+        if(index > -1) {
+            tracker.splice(index,1);
+        }
+        
+        // Add to the end
+        tracker.push(sRecordId);
+        this._aSelections = tracker;
+
+        // Update trackers
+        if(!this._oAnchorRecord) {
+            this._oAnchorRecord = oRecord;
+        }
+
+        // Update UI
+        if(elRow) {
+            Dom.addClass(elRow, DT.CLASS_SELECTED);
+        }
+
+        this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Selected " + elRow, "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not select row " + row, "warn", this.toString());
+    }
+},
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method unselectRow
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element
+ * reference or ID string, Record instance, or RecordSet position index.
+ */
+unselectRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    var oRecord;
+    if(row instanceof YAHOO.widget.Record) {
+        oRecord = this._oRecordSet.getRecord(row);
+    }
+    else if(lang.isNumber(row)) {
+        oRecord = this.getRecord(row);
+    }
+    else {
+        oRecord = this.getRecord(elRow);
+    }
+
+    if(oRecord) {
+        // Update selection trackers
+        var tracker = this._aSelections || [];
+        var sRecordId = oRecord.getId();
+        var index = -1;
+
+        // Remove if found
+        var bFound = false;
+
+        // Use Array.indexOf if available...
+        if(tracker.indexOf) {
+            index = tracker.indexOf(sRecordId);
+        }
+        // ...or do it the old-fashioned way
+        else {
+            for(var j=tracker.length-1; j>-1; j--) {
+                if(tracker[j] === sRecordId){
+                    index = j;
+                    break;
+                }
+            }
+        }
+        if(index > -1) {
+            tracker.splice(index,1);
+        }
+
+        if(bFound) {
+            // Update tracker
+            this._aSelections = tracker;
+
+            // Update the UI
+            Dom.removeClass(elRow, DT.CLASS_SELECTED);
+
+            this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+            YAHOO.log("Unselected " + elRow, "info", this.toString());
+
+            return;
+        }
+
+        // Update the UI
+        Dom.removeClass(elRow, DT.CLASS_SELECTED);
+
+        this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Unselected " + elRow, "info", this.toString());
+    }
+    YAHOO.log("Could not unselect row " + row, "warn", this.toString());
+},
+
+/**
+ * Clears out all row selections.
+ *
+ * @method unselectAllRows
+ */
+unselectAllRows : function() {
+    // Remove all rows from tracker
+    var tracker = this._aSelections || [];
+    for(var j=tracker.length-1; j>-1; j--) {
+       if(lang.isString(tracker[j])){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTrEls();
+
+    //TODO: send an array of [{el:el,record:record}]
+    //TODO: or convert this to an unselectRows method
+    //TODO: that takes an array of rows or unselects all if none given
+    this.fireEvent("unselectAllRowsEvent");
+    YAHOO.log("Unselected all rows", "info", this.toString());
+},
+
+/**
+ * Convenience method to remove the class DT.CLASS_SELECTED
+ * from all TD elements in the internal tracker.
+ *
+ * @method _unselectAllTdEls
+ * @private
+ */
+_unselectAllTdEls : function() {
+    var selectedCells = Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
+    Dom.removeClass(selectedCells, DT.CLASS_SELECTED);
+},
+
+/**
+ * Returns array of selected TD elements on the page.
+ *
+ * @method getSelectedTdEls
+ * @return {HTMLElement[]} Array of selected TD elements.
+ */
+getSelectedTdEls : function() {
+    return Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
+},
+
+/**
+ * Sets given cell to the selected state.
+ *
+ * @method selectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+selectCell : function(cell) {
+/*TODO:
+accept {record}
+*/
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+
+        if(oRecord && sColumnId) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var sRecordId = oRecord.getId();
+
+            // Remove if there
+            for(var j=tracker.length-1; j>-1; j--) {
+               if((tracker[j].recordId === sRecordId) && (tracker[j].columnId === sColumnId)){
+                    tracker.splice(j,1);
+                    break;
+                }
+            }
+
+            // Add to the end
+            tracker.push({recordId:sRecordId, columnId:sColumnId});
+
+            // Update trackers
+            this._aSelections = tracker;
+            if(!this._oAnchorCell) {
+                this._oAnchorCell = {record:oRecord, column:this.getColumnById(sColumnId)};
+            }
+
+            // Update the UI
+            Dom.addClass(elCell, DT.CLASS_SELECTED);
+
+            this.fireEvent("cellSelectEvent", {record:oRecord, column:this.getColumnById(sColumnId), key: elCell.yuiColumnKey, el:elCell});
+            YAHOO.log("Selected " + elCell, "info", this.toString());
+            return;
+        }
+    }
+    YAHOO.log("Could not select cell " + cell, "warn", this.toString());
+},
+
+/**
+ * Sets given cell to the unselected state.
+ *
+ * @method unselectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+unselectCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+
+        if(oRecord && sColumnId) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var id = oRecord.getId();
+
+            // Is it selected?
+            for(var j=tracker.length-1; j>-1; j--) {
+                if((tracker[j].recordId === id) && (tracker[j].columnId === sColumnId)){
+                    // Remove from tracker
+                    tracker.splice(j,1);
+
+                    // Update tracker
+                    this._aSelections = tracker;
+
+                    // Update the UI
+                    Dom.removeClass(elCell, DT.CLASS_SELECTED);
+
+                    this.fireEvent("cellUnselectEvent", {record:oRecord, column: this.getColumnById(sColumnId), key:elCell.yuiColumnKey, el:elCell});
+                    YAHOO.log("Unselected " + elCell, "info", this.toString());
+                    return;
+                }
+            }
+        }
+    }
+    YAHOO.log("Could not unselect cell " + cell, "warn", this.toString());
+},
+
+/**
+ * Clears out all cell selections.
+ *
+ * @method unselectAllCells
+ */
+unselectAllCells: function() {
+    // Remove all cells from tracker
+    var tracker = this._aSelections || [];
+    for(var j=tracker.length-1; j>-1; j--) {
+       if(tracker[j].constructor == Object){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTdEls();
+
+    //TODO: send data
+    //TODO: or fire individual cellUnselectEvent
+    this.fireEvent("unselectAllCellsEvent");
+    YAHOO.log("Unselected all cells", "info", this.toString());
+},
+
+/**
+ * Returns true if given item is selected, false otherwise.
+ *
+ * @method isSelected
+ * @param o {String | HTMLElement | YAHOO.widget.Record | Number
+ * {record:YAHOO.widget.Record, column:YAHOO.widget.Column} } TR or TD element by
+ * reference or ID string, a Record instance, a RecordSet position index,
+ * or an object literal representation
+ * of a cell.
+ * @return {Boolean} True if item is selected.
+ */
+isSelected : function(o) {
+    var oRecord, sRecordId, j;
+
+    var el = this.getTrEl(o) || this.getTdEl(o);
+    if(el) {
+        return Dom.hasClass(el,DT.CLASS_SELECTED);
+    }
+    else {
+        var tracker = this._aSelections;
+        if(tracker && tracker.length > 0) {
+            // Looking for a Record?
+            if(o instanceof YAHOO.widget.Record) {
+                oRecord = o;
+            }
+            else if(lang.isNumber(o)) {
+                oRecord = this.getRecord(o);
+            }
+            if(oRecord) {
+                sRecordId = oRecord.getId();
+
+                // Is it there?
+                // Use Array.indexOf if available...
+                if(tracker.indexOf) {
+                    if(tracker.indexOf(sRecordId) >  -1) {
+                        return true;
+                    }
+                }
+                // ...or do it the old-fashioned way
+                else {
+                    for(j=tracker.length-1; j>-1; j--) {
+                       if(tracker[j] === sRecordId){
+                        return true;
+                       }
+                    }
+                }
+            }
+            // Looking for a cell
+            else if(o.record && o.column){
+                sRecordId = o.record.getId();
+                var sColumnId = o.column.getId();
+
+                for(j=tracker.length-1; j>-1; j--) {
+                    if((tracker[j].recordId === sRecordId) && (tracker[j].columnId === sColumnId)){
+                        return true;
+                    }
+                }
+            }
+        }
+    }
+    return false;
+},
+
+/**
+ * Returns selected rows as an array of Record IDs.
+ *
+ * @method getSelectedRows
+ * @return {String[]} Array of selected rows by Record ID.
+ */
+getSelectedRows : function() {
+    var aSelectedRows = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(lang.isString(tracker[j])){
+            aSelectedRows.push(tracker[j]);
+        }
+    }
+    return aSelectedRows;
+},
+
+/**
+ * Returns selected cells as an array of object literals:
+ *     {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @method getSelectedCells
+ * @return {Object[]} Array of selected cells by Record ID and Column ID.
+ */
+getSelectedCells : function() {
+    var aSelectedCells = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j] && (tracker[j].constructor == Object)){
+            aSelectedCells.push(tracker[j]);
+        }
+    }
+    return aSelectedCells;
+},
+
+/**
+ * Returns last selected Record ID.
+ *
+ * @method getLastSelectedRecord
+ * @return {String} Record ID of last selected row.
+ */
+getLastSelectedRecord : function() {
+    var tracker = this._aSelections;
+    if(tracker && tracker.length > 0) {
+        for(var i=tracker.length-1; i>-1; i--) {
+           if(lang.isString(tracker[i])){
+                return tracker[i];
+            }
+        }
+    }
+},
+
+/**
+ * Returns last selected cell as an object literal:
+ *     {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @method getLastSelectedCell
+ * @return {Object} Object literal representation of a cell.
+ */
+getLastSelectedCell : function() {
+    var tracker = this._aSelections;
+    if(tracker && tracker.length > 0) {
+        for(var i=tracker.length-1; i>-1; i--) {
+           if(tracker[i].recordId && tracker[i].columnId){
+                return tracker[i];
+            }
+        }
+    }
+},
+
+/**
+ * Assigns the class DT.CLASS_HIGHLIGHTED to the given row.
+ *
+ * @method highlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+highlightRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        // Make sure previous row is unhighlighted
+/*        if(this._sLastHighlightedTrElId) {
+            Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);
+        }*/
+        var oRecord = this.getRecord(elRow);
+        Dom.addClass(elRow,DT.CLASS_HIGHLIGHTED);
+        //this._sLastHighlightedTrElId = elRow.id;
+        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Highlighted " + elRow, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not highlight row " + row, "warn", this.toString());
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED from the given row.
+ *
+ * @method unhighlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+unhighlightRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        Dom.removeClass(elRow,DT.CLASS_HIGHLIGHTED);
+        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Unhighlighted " + elRow, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not unhighlight row " + row, "warn", this.toString());
+},
+
+/**
+ * Assigns the class DT.CLASS_HIGHLIGHTED to the given cell.
+ *
+ * @method highlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+highlightCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        // Make sure previous cell is unhighlighted
+        /*if(this._sLastHighlightedTdElId) {
+            Dom.removeClass(this._sLastHighlightedTdElId,DT.CLASS_HIGHLIGHTED);
+        }*/
+
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+        Dom.addClass(elCell,DT.CLASS_HIGHLIGHTED);
+        //this._sLastHighlightedTdElId = elCell.id;
+        this.fireEvent("cellHighlightEvent", {record:oRecord, column:this.getColumnById(sColumnId), key:elCell.yuiColumnKey, el:elCell});
+        YAHOO.log("Highlighted " + elCell, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not highlight cell " + cell, "warn", this.toString());
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED from the given cell.
+ *
+ * @method unhighlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+unhighlightCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        Dom.removeClass(elCell,DT.CLASS_HIGHLIGHTED);
+        this.fireEvent("cellUnhighlightEvent", {record:oRecord, column:this.getColumnById(elCell.yuiColumnId), key:elCell.yuiColumnKey, el:elCell});
+        YAHOO.log("Unhighlighted " + elCell, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not unhighlight cell " + cell, "warn", this.toString());
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// INLINE EDITING
+
+/**
+ * Shows Cell Editor for given cell.
+ *
+ * @method showCellEditor
+ * @param elCell {HTMLElement | String} Cell to edit.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ */
+showCellEditor : function(elCell, oRecord, oColumn) {
+    elCell = Dom.get(elCell);
+
+    if(elCell && (elCell.ownerDocument === document)) {
+        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
+            oRecord = this.getRecord(elCell);
+        }
+        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
+            oColumn = this.getColumn(elCell);
+        }
+        if(oRecord && oColumn) {
+            var oCellEditor = this._oCellEditor;
+
+            // Clear previous Editor
+            if(oCellEditor.isActive) {
+                this.cancelCellEditor();
+            }
+
+            // Editor not defined
+            if(!oColumn.editor) {
+                return;
+            }
+
+            // Update Editor values
+            oCellEditor.cell = elCell;
+            oCellEditor.record = oRecord;
+            oCellEditor.column = oColumn;
+            oCellEditor.validator = (oColumn.editorOptions &&
+                    lang.isFunction(oColumn.editorOptions.validator)) ?
+                    oColumn.editorOptions.validator : null;
+            oCellEditor.value = oRecord.getData(oColumn.key);
+            oCellEditor.defaultValue = null;
+
+            // Move Editor
+            var elContainer = oCellEditor.container;
+            var x = Dom.getX(elCell);
+            var y = Dom.getY(elCell);
+
+            // SF doesn't get xy for cells in scrolling table
+            // when tbody display is set to block
+            if(isNaN(x) || isNaN(y)) {
+                x = elCell.offsetLeft + // cell pos relative to table
+                        Dom.getX(this._elTbody.parentNode) - // plus table pos relative to document
+                        this._elTbody.scrollLeft; // minus tbody scroll
+                y = elCell.offsetTop + // cell pos relative to table
+                        Dom.getY(this._elTbody.parentNode) - // plus table pos relative to document
+                        this._elTbody.scrollTop + // minus tbody scroll
+                        this._elThead.offsetHeight; // account for fixed THEAD cells
+            }
+
+            elContainer.style.left = x + "px";
+            elContainer.style.top = y + "px";
+
+            // Hook to customize the UI
+            this.doBeforeShowCellEditor(this._oCellEditor);
+
+            //TODO: This is temporarily up here due so elements can be focused
+            // Show Editor
+            elContainer.style.display = "";
+
+            // Handle ESC key
+            Ev.addListener(elContainer, "keydown", function(e, oSelf) {
+                // ESC hides Cell Editor
+                if((e.keyCode == 27)) {
+                    oSelf.cancelCellEditor();
+                    oSelf.focusTbodyEl();
+                }
+                else {
+                    oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
+                }
+            }, this);
+
+            // Render Editor markup
+            var fnEditor;
+            if(lang.isString(oColumn.editor)) {
+                switch(oColumn.editor) {
+                    case "checkbox":
+                        fnEditor = DT.editCheckbox;
+                        break;
+                    case "date":
+                        fnEditor = DT.editDate;
+                        break;
+                    case "dropdown":
+                        fnEditor = DT.editDropdown;
+                        break;
+                    case "radio":
+                        fnEditor = DT.editRadio;
+                        break;
+                    case "textarea":
+                        fnEditor = DT.editTextarea;
+                        break;
+                    case "textbox":
+                        fnEditor = DT.editTextbox;
+                        break;
+                    default:
+                        fnEditor = null;
+                }
+            }
+            else if(lang.isFunction(oColumn.editor)) {
+                fnEditor = oColumn.editor;
+            }
+
+            if(fnEditor) {
+                // Create DOM input elements
+                fnEditor(this._oCellEditor, this);
+
+                // Show Save/Cancel buttons
+                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
+                    this.showCellEditorBtns(elContainer);
+                }
+
+                oCellEditor.isActive = true;
+
+                //TODO: verify which args to pass
+                this.fireEvent("editorShowEvent", {editor:oCellEditor});
+                YAHOO.log("Cell Editor shown for " + elCell, "info", this.toString());
+                return;
+            }
+        }
+    }
+    YAHOO.log("Could not show Cell Editor for " + elCell, "warn", this.toString());
+},
+
+/**
+ * Overridable abstract method to customize Cell Editor UI.
+ *
+ * @method doBeforeShowCellEditor
+ * @param oCellEditor {Object} Cell Editor object literal.
+ */
+doBeforeShowCellEditor : function(oCellEditor) {
+},
+
+/**
+ * Adds Save/Cancel buttons to Cell Editor.
+ *
+ * @method showCellEditorBtns
+ * @param elContainer {HTMLElement} Cell Editor container.
+ */
+showCellEditorBtns : function(elContainer) {
+    // Buttons
+    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
+    Dom.addClass(elBtnsDiv, DT.CLASS_BUTTON);
+
+    // Save button
+    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    Dom.addClass(elSaveBtn, DT.CLASS_DEFAULT);
+    elSaveBtn.innerHTML = "OK";
+    Ev.addListener(elSaveBtn, "click", function(oArgs, oSelf) {
+        oSelf.onEventSaveCellEditor(oArgs, oSelf);
+        oSelf.focusTbodyEl();
+    }, this, true);
+
+    // Cancel button
+    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    elCancelBtn.innerHTML = "Cancel";
+    Ev.addListener(elCancelBtn, "click", function(oArgs, oSelf) {
+        oSelf.onEventCancelCellEditor(oArgs, oSelf);
+        oSelf.focusTbodyEl();
+    }, this, true);
+},
+
+/**
+ * Clears Cell Editor of all state and UI.
+ *
+ * @method resetCellEditor
+ */
+
+resetCellEditor : function() {
+    var elContainer = this._oCellEditor.container;
+    elContainer.style.display = "none";
+    Ev.purgeElement(elContainer, true);
+    elContainer.innerHTML = "";
+    this._oCellEditor.value = null;
+    this._oCellEditor.isActive = false;
+},
+
+/**
+ * Saves Cell Editor input to Record.
+ *
+ * @method saveCellEditor
+ */
+saveCellEditor : function() {
+    if(this._oCellEditor.isActive) {
+        var newData = this._oCellEditor.value;
+        // Copy the data to pass to the event
+        var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));
+
+        // Validate input data
+        if(this._oCellEditor.validator) {
+            newData = this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData, this._oCellEditor);
+            if(newData === null ) {
+                this.resetCellEditor();
+                this.fireEvent("editorRevertEvent",
+                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
+                YAHOO.log("Could not save Cell Editor input due to invalid data " +
+                        lang.dump(newData), "warn", this.toString());
+                return;
+            }
+        }
+
+        // Update the Record
+        this._oRecordSet.updateRecordValue(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
+
+        // Update the UI
+        this.formatCell(this._oCellEditor.cell.firstChild);
+        this._syncColWidths();
+
+        // Clear out the Cell Editor
+        this.resetCellEditor();
+
+        this.fireEvent("editorSaveEvent",
+                {editor:this._oCellEditor, oldData:oldData, newData:newData});
+        YAHOO.log("Cell Editor input saved", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Cell Editor not active to save input", "warn", this.toString());
+    }
+},
+
+/**
+ * Cancels Cell Editor.
+ *
+ * @method cancelCellEditor
+ */
+cancelCellEditor : function() {
+    if(this._oCellEditor.isActive) {
+        this.resetCellEditor();
+        //TODO: preserve values for the event?
+        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
+        YAHOO.log("Cell Editor input canceled", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Cell Editor not active to cancel input", "warn", this.toString());
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ABSTRACT METHODS
+
+/**
+ * Overridable method gives implementers a hook to access data before
+ * it gets added to RecordSet and rendered to the TBODY.
+ *
+ * @method doBeforeLoadData
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} additional arguments
+ * @return {Boolean} Return true to continue loading data into RecordSet and
+ * updating DataTable with new Records, false to cancel.
+ */
+doBeforeLoadData : function(sRequest, oResponse, oPayload) {
+    return true;
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-    /**
-     * Fired when the DataTable's message element is hidden.
-     *
-     * @event tableMsgHideEvent
-     */
 
-    /**
-     * Fired when a header row has a mouseover.
-     *
-     * @event headerRowMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a mouseout.
-     *
-     * @event headerRowMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a mousedown.
-     *
-     * @event headerRowMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a click.
-     *
-     * @event headerRowClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a dblclick.
-     *
-     * @event headerRowDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header cell has a mouseover.
-     *
-     * @event headerCellMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     *
-     */
 
-    /**
-     * Fired when a header cell has a mouseout.
-     *
-     * @event headerCellMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     *
-     */
 
-    /**
-     * Fired when a header cell has a mousedown.
-     *
-     * @event headerCellMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
 
-    /**
-     * Fired when a header cell has a click.
-     *
-     * @event headerCellClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
 
-    /**
-     * Fired when a header cell has a dblclick.
-     *
-     * @event headerCellDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
 
-    /**
-     * Fired when a header label has a mouseover.
-     *
-     * @event headerLabelMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     *
-     */
 
-    /**
-     * Fired when a header label has a mouseout.
-     *
-     * @event headerLabelMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     *
-     */
 
-    /**
-     * Fired when a header label has a mousedown.
-     *
-     * @event headerLabelMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a header label has a click.
-     *
-     * @event headerLabelClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a header label has a dblclick.
-     *
-     * @event headerLabelDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a column is sorted.
-     *
-     * @event columnSortEvent
-     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
-     * @param oArgs.dir {String} Sort direction "asc" or "desc".
-     */
 
-    /**
-     * Fired when a column is resized.
-     *
-     * @event columnResizeEvent
-     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
 
-    /**
-     * Fired when a row has a mouseover.
-     *
-     * @event rowMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a row has a mouseout.
-     *
-     * @event rowMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a row has a mousedown.
-     *
-     * @event rowMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a row has a click.
-     *
-     * @event rowClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a row has a dblclick.
-     *
-     * @event rowDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a row is added.
-     *
-     * @event rowAddEvent
-     * @param oArgs.record {YAHOO.widget.Record} The added Record.
-     */
 
-    /**
-     * Fired when a row is updated.
-     *
-     * @event rowUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
-     * @param oArgs.oldData {Object} Object literal of the old data.
-     */
 
-    /**
-     * Fired when a row is deleted.
-     *
-     * @event rowDeleteEvent
-     * @param oArgs.oldData {Object} Object literal of the deleted data.
-     * @param oArgs.recordIndex {Number} Index of the deleted Record.
-     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if in view.
-     */
 
-    /**
-     * Fired when a row is selected.
-     *
-     * @event rowSelectEvent
-     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
-     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
-     */
 
-    /**
-     * Fired when a row is unselected.
-     *
-     * @event rowUnselectEvent
-     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
-     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
-     */
 
-    /*TODO: delete and use rowUnselectEvent?
-     * Fired when all row selections are cleared.
-     *
-     * @event unselectAllRowsEvent
-     */
 
-    /*
-     * Fired when a row is highlighted.
-     *
-     * @event rowHighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TR element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     */
 
-    /*
-     * Fired when a row is unhighlighted.
-     *
-     * @event rowUnhighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TR element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     */
 
-    /**
-     * Fired when a cell has a mouseover.
-     *
-     * @event cellMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a mouseout.
-     *
-     * @event cellMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a mousedown.
-     *
-     * @event cellMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a click.
-     *
-     * @event cellClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a dblclick.
-     *
-     * @event cellDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell is formatted.
-     *
-     * @event cellFormatEvent
-     * @param oArgs.el {HTMLElement} The formatted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The formatted Record.
-     * @param oArgs.key {String} The key of the formatted cell.
-     */
 
-    /**
-     * Fired when a cell is selected.
-     *
-     * @event cellSelectEvent
-     * @param oArgs.el {HTMLElement} The selected TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
-     * @param oArgs.key {String} The key of the selected cell.
-     */
 
-    /**
-     * Fired when a cell is unselected.
-     *
-     * @event cellUnselectEvent
-     * @param oArgs.el {HTMLElement} The unselected TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
-     * @param oArgs.key {String} The key of the unselected cell.
-     */
 
-    /**
-     * Fired when a cell is highlighted.
-     *
-     * @event cellHighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     * @param oArgs.key {String} The key of the highlighted cell.
-     */
 
-    /**
-     * Fired when a cell is unhighlighted.
-     *
-     * @event cellUnhighlightEvent
-     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The unhighlighted Record.
-     * @param oArgs.key {String} The key of the unhighlighted cell.
-     */
 
-    /*TODO: hide from doc and use cellUnselectEvent
-     * Fired when all cell selections are cleared.
-     *
-     * @event unselectAllCellsEvent
-     */
 
-    /*TODO: implement
-     * Fired when DataTable paginator is updated.
-     *
-     * @event paginatorUpdateEvent
-     * @param paginator {Object} Object literal of Paginator values.
-     */
 
-    /**
-     * Fired when an Editor is activated.
-     *
-     * @event editorShowEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
 
-    /**
-     * Fired when an active Editor has a keydown.
-     *
-     * @event editorKeydownEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.event {HTMLEvent} The event object.
-     */
 
-    /**
-     * Fired when Editor input is reverted.
-     *
-     * @event editorRevertEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.newData {Object} New data value.
-     * @param oArgs.oldData {Object} Old data value.
-     */
 
-    /**
-     * Fired when Editor input is saved.
-     *
-     * @event editorSaveEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.newData {Object} New data value.
-     * @param oArgs.oldData {Object} Old data value.
-     */
 
-    /**
-     * Fired when Editor input is canceled.
-     *
-     * @event editorCancelEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public Custom Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Overridable custom event handler to sort Column.
+ *
+ * @method onEventSortColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSortColumn : function(oArgs) {
+//TODO: support form elements in sortable columns
+    var evt = oArgs.event;
+    var target = oArgs.target;
+
+    var el = this.getThEl(target) || this.getTdEl(target);
+    if(el && el.yuiColumnKey) {
+        var oColumn = this.getColumn(el.yuiColumnKey);
+        if(oColumn.sortable) {
+            Ev.stopEvent(evt);
+            this.sortColumn(oColumn);
+        }
+    }
+    else {
+        YAHOO.log("Could not find Column for " + target, "warn", this.toString());
+    }
+},
+
+/**
+ * Overridable custom event handler to select Column.
+ *
+ * @method onEventSelectColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectColumn : function(oArgs) {
+    this.selectColumn(oArgs.target);
+},
+
+/**
+ * Overridable custom event handler to highlight Column. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightColumn : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightColumn(oArgs.target);
+    }
+},
 
-    /**
-     * Fired when an active Editor has a blur.
-     *
-     * @event editorBlurEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
+/**
+ * Overridable custom event handler to unhighlight Column. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightColumn : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightColumn(oArgs.target);
+    }
+},
 
+/**
+ * Overridable custom event handler to manage selection according to desktop paradigm.
+ *
+ * @method onEventSelectRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectRow : function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if(sMode == "single") {
+        this._handleSingleSelectionByMouse(oArgs);
+    }
+    else {
+        this._handleStandardSelectionByMouse(oArgs);
+    }
+},
 
+/**
+ * Overridable custom event handler to select cell.
+ *
+ * @method onEventSelectCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectCell : function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if(sMode == "cellblock") {
+        this._handleCellBlockSelectionByMouse(oArgs);
+    }
+    else if(sMode == "cellrange") {
+        this._handleCellRangeSelectionByMouse(oArgs);
+    }
+    else {
+        this._handleSingleCellSelectionByMouse(oArgs);
+    }
+},
 
+/**
+ * Overridable custom event handler to highlight row. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightRow : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightRow(oArgs.target);
+    }
+},
 
+/**
+ * Overridable custom event handler to unhighlight row. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightRow : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightRow(oArgs.target);
+    }
+},
 
+/**
+ * Overridable custom event handler to highlight cell. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightCell : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightCell(oArgs.target);
+    }
+},
 
+/**
+ * Overridable custom event handler to unhighlight cell. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightCell : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightCell(oArgs.target);
+    }
+},
 
-    /**
-     * Fired when a link is clicked.
-     *
-     * @event linkClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The A element.
-     */
+/**
+ * Overridable custom event handler to format cell.
+ *
+ * @method onEventFormatCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventFormatCell : function(oArgs) {
+    var target = oArgs.target;
 
-    /**
-     * Fired when a BUTTON element is clicked.
-     *
-     * @event buttonClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The BUTTON element.
-     */
+    var elCell = this.getTdEl(target);
+    if(elCell && elCell.yuiColumnKey) {
+        var oColumn = this.getColumn(elCell.yuiColumnKey);
+        this.formatCell(elCell.firstChild, this.getRecord(elCell), oColumn);
+    }
+    else {
+        YAHOO.log("Could not format cell " + target, "warn", this.toString());
+    }
+},
 
-    /**
-     * Fired when a CHECKBOX element is clicked.
-     *
-     * @event checkboxClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The CHECKBOX element.
-     */
+/**
+ * Overridable custom event handler to edit cell.
+ *
+ * @method onEventShowCellEditor
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventShowCellEditor : function(oArgs) {
+    var target = oArgs.target;
 
-    /*TODO
-     * Fired when a SELECT element is changed.
-     *
-     * @event dropdownChangeEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SELECT element.
-     */
+    var elCell = this.getTdEl(target);
+    if(elCell) {
+        this.showCellEditor(elCell);
+    }
+    else {
+        YAHOO.log("Could not edit cell " + target, "warn", this.toString());
+    }
+},
 
-    /**
-     * Fired when a RADIO element is clicked.
-     *
-     * @event radioClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The RADIO element.
-     */
+/**
+ * Overridable custom event handler to save Cell Editor input.
+ *
+ * @method onEventSaveCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+onEventSaveCellEditor : function(oArgs) {
+    this.saveCellEditor();
+},
+
+/**
+ * Overridable custom event handler to cancel Cell Editor.
+ *
+ * @method onEventCancelCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+onEventCancelCellEditor : function(oArgs) {
+    this.cancelCellEditor();
+},
 
+/**
+ * Callback function receives data from DataSource and populates an entire
+ * DataTable with Records and TR elements, clearing previous Records, if any.
+ *
+ * @method onDataReturnInitializeTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnInitializeTable : function(sRequest, oResponse, oPayload) {
+    this.initializeTable();
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+    this.onDataReturnSetRecords(sRequest,oResponse,oPayload);
+},
 
 /**
- * The ColumnSet class defines and manages a DataTable's Columns,
- * including nested hierarchies and access to individual Column instances.
+ * Callback function receives data from DataSource and appends to an existing
+ * DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
  *
- * @namespace YAHOO.widget
- * @class ColumnSet
- * @uses YAHOO.util.EventProvider
- * @constructor
- * @param aHeaders {Object[]} Array of object literals that define header cells.
+ * @method onDataReturnAppendRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
  */
-YAHOO.widget.ColumnSet = function(aHeaders) {
-    this._sName = "instance" + YAHOO.widget.ColumnSet._nCount;
+onDataReturnAppendRows : function(sRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
 
-    // DOM tree representation of all Columns
-    var tree = [];
-    // Flat representation of all Columns
-    var flat = [];
-    // Flat representation of only Columns that are meant to display data
-    var keys = [];
-    // Array of HEADERS attribute values for all keys in the "keys" array
-    var headers = [];
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results);
 
-    // Tracks current node list depth being tracked
-    var nodeDepth = -1;
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(sRequest,oResponse,oPayload);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
 
-    // Internal recursive function to defined Column instances
-    var parseColumns = function(nodeList, parent) {
-        // One level down
-        nodeDepth++;
+/**
+ * Callback function receives data from DataSource and inserts new records
+ * starting at the index specified in oPayload.insertIndex.  If applicable,
+ * creates or updates corresponding TR elements.
+ *
+ * @method onDataReturnInsertRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnInsertRows : function(sRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
 
-        // Create corresponding tree node if not already there for this depth
-        if(!tree[nodeDepth]) {
-            tree[nodeDepth] = [];
-        }
+    oPayload = oPayload || { insertIndex : 0 };
 
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
 
-        // Parse each node at this depth for attributes and any children
-        for(var j=0; j<nodeList.length; j++) {
-            var currentNode = nodeList[j];
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results, oPayload.insertIndex || 0);
 
-            // Instantiate a new Column for each node
-            var oColumn = new YAHOO.widget.Column(currentNode);
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(sRequest,oResponse,oPayload);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
 
-            // Add the new Column to the flat list
-            flat.push(oColumn);
+/**
+ * Receives reponse from DataSource and populates the RecordSet with the
+ * results.
+ * @method onDataReturnSetRecords
+ * @param oRequest {MIXED} Original generated request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnSetRecords : function(oRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:oRequest,response:oResponse,payload:oPayload});
 
-            // Assign its parent as an attribute, if applicable
-            if(parent) {
-                oColumn.parent = parent;
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(oRequest, oResponse, oPayload);
+
+    // Data ok to set
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        var oPaginator = this.get('paginator');
+        var startIndex = oPayload && lang.isNumber(oPayload.startIndex) ?
+                            oPayload.startIndex : 0;
+
+        // If paginating, set the number of total records if provided
+        if (oPaginator instanceof Pag) {
+            if (lang.isNumber(oResponse.totalRecords)) {
+                oPaginator.setTotalRecords(oResponse.totalRecords,true);
+            } else {
+                oPaginator.setTotalRecords(oResponse.results.length,true);
             }
+        }
 
-            // The Column has descendants
-            if(YAHOO.lang.isArray(currentNode.children)) {
-                oColumn.children = currentNode.children;
+        this._oRecordSet.setRecords(oResponse.results, startIndex);
 
-                // Determine COLSPAN value for this Column
-                var terminalChildNodes = 0;
-                var countTerminalChildNodes = function(ancestor) {
-                    var descendants = ancestor.children;
-                    // Drill down each branch and count terminal nodes
-                    for(var k=0; k<descendants.length; k++) {
-                        // Keep drilling down
-                        if(YAHOO.lang.isArray(descendants[k].children)) {
-                            countTerminalChildNodes(descendants[k]);
-                        }
-                        // Reached branch terminus
-                        else {
-                            terminalChildNodes++;
-                        }
-                    }
-                };
-                countTerminalChildNodes(currentNode);
-                oColumn._colspan = terminalChildNodes;
-
-                // Cascade certain properties to children if not defined on their own
-                var currentChildren = currentNode.children;
-                for(var k=0; k<currentChildren.length; k++) {
-                    var child = currentChildren[k];
-                    if(oColumn.className && (child.className === undefined)) {
-                        child.className = oColumn.className;
-                    }
-                    if(oColumn.editor && (child.editor === undefined)) {
-                        child.editor = oColumn.editor;
-                    }
-                    if(oColumn.editorOptions && (child.editorOptions === undefined)) {
-                        child.editorOptions = oColumn.editorOptions;
-                    }
-                    if(oColumn.formatter && (child.formatter === undefined)) {
-                        child.formatter = oColumn.formatter;
-                    }
-                    if(oColumn.resizeable && (child.resizeable === undefined)) {
-                        child.resizeable = oColumn.resizeable;
-                    }
-                    if(oColumn.sortable && (child.sortable === undefined)) {
-                        child.sortable = oColumn.sortable;
-                    }
-                    if(oColumn.width && (child.width === undefined)) {
-                        child.width = oColumn.width;
-                    }
-                    // Backward compatibility
-                    if(oColumn.type && (child.type === undefined)) {
-                        child.type = oColumn.type;
-                    }
-                    if(oColumn.type && !oColumn.formatter) {
-                        YAHOO.log("The property type has been" +
-                        " deprecated in favor of formatter", "warn", oColumn.toString());
-                        oColumn.formatter = oColumn.type;
-                    }
-                    if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
-                        YAHOO.log("The property text has been" +
-                        " deprecated in favor of label", "warn", oColumn.toString());
-                        oColumn.label = oColumn.text;
-                    }
-                    if(oColumn.parser) {
-                        YAHOO.log("The property parser is no longer supported",
-                        "warn", this.toString());
-                    }
-                    if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
-                            (oColumn.sortOptions.descFunction))) {
-                        YAHOO.log("The properties sortOptions.ascFunction and " +
-                        " sortOptions.descFunction have been deprecated in favor " +
-                        " of sortOptions.sortFunction", "warn", this.toString());
-                    }
-                }
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(oRequest,oResponse,oPayload);
 
-                // The children themselves must also be parsed for Column instances
-                if(!tree[nodeDepth+1]) {
-                    tree[nodeDepth+1] = [];
-                }
-                parseColumns(currentChildren, oColumn);
-            }
-            // This Column does not have any children
-            else {
-                oColumn._nKeyIndex = keys.length;
-                oColumn._colspan = 1;
-                keys.push(oColumn);
+        this.render();
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
+
+/**
+ * Updates the DataTable with data sent in an onDataReturn* payload
+ * @method _handleDataReturnPayload
+ * @param oRequest {MIXED} Original generated request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} Additional argument(s)
+ * @private
+ */
+_handleDataReturnPayload : function (oRequest, oResponse, oPayload) {
+    if (oPayload) {
+        // Update with any pagination information
+        var oState = oPayload.pagination;
+
+        if (oState) {
+            // Set the paginator values in preparation for refresh
+            var oPaginator = this.get('paginator');
+            if (oPaginator && oPaginator instanceof Pag) {
+                oPaginator.setStartIndex(oState.recordOffset,true);
+                oPaginator.setRowsPerPage(oState.rowsPerPage,true);
             }
 
-            // Add the Column to the top-down tree
-            tree[nodeDepth].push(oColumn);
         }
-        nodeDepth--;
-    };
 
-    // Parse out Column instances from the array of object literals
-    if(YAHOO.lang.isArray(aHeaders)) {
-        parseColumns(aHeaders);
+        // Update with any sorting information
+        oState = oPayload.sorting;
+
+        if (oState) {
+            // Set the sorting values in preparation for refresh
+            this.set('sortedBy', oState);
+        }
     }
+},
+
 
-    // Determine ROWSPAN value for each Column in the tree
-    var parseTreeForRowspan = function(tree) {
-        var maxRowDepth = 1;
-        var currentRow;
-        var currentColumn;
 
-        // Calculate the max depth of descendants for this row
-        var countMaxRowDepth = function(row, tmpRowDepth) {
-            tmpRowDepth = tmpRowDepth || 1;
 
-            for(var n=0; n<row.length; n++) {
-                var col = row[n];
-                // Column has children, so keep counting
-                if(YAHOO.lang.isArray(col.children)) {
-                    tmpRowDepth++;
-                    countMaxRowDepth(col.children, tmpRowDepth);
-                    tmpRowDepth--;
-                }
-                // No children, is it the max depth?
-                else {
-                    if(tmpRowDepth > maxRowDepth) {
-                        maxRowDepth = tmpRowDepth;
-                    }
-                }
 
-            }
-        };
 
-        // Count max row depth for each row
-        for(var m=0; m<tree.length; m++) {
-            currentRow = tree[m];
-            countMaxRowDepth(currentRow);
 
-            // Assign the right ROWSPAN values to each Column in the row
-            for(var p=0; p<currentRow.length; p++) {
-                currentColumn = currentRow[p];
-                if(!YAHOO.lang.isArray(currentColumn.children)) {
-                    currentColumn._rowspan = maxRowDepth;
-                }
-                else {
-                    currentColumn._rowspan = 1;
-                }
-            }
 
-            // Reset counter for next row
-            maxRowDepth = 1;
-        }
-    };
-    parseTreeForRowspan(tree);
 
 
 
 
 
-    // Store header relationships in an array for HEADERS attribute
-    var recurseAncestorsForHeaders = function(i, oColumn) {
-        headers[i].push(oColumn._nId);
-        if(oColumn.parent) {
-            recurseAncestorsForHeaders(i, oColumn.parent);
-        }
-    };
-    for(var i=0; i<keys.length; i++) {
-        headers[i] = [];
-        recurseAncestorsForHeaders(i, keys[i]);
-        headers[i] = headers[i].reverse();
-        headers[i] = headers[i].join(" ");
-    }
 
-    // Save to the ColumnSet instance
-    this.tree = tree;
-    this.flat = flat;
-    this.keys = keys;
-    this.headers = headers;
 
-    YAHOO.widget.ColumnSet._nCount++;
-    YAHOO.log("ColumnSet initialized", "info", this.toString());
-};
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Internal class variable to index multiple data table instances.
- *
- * @property ColumnSet._nCount
- * @type number
- * @private
- * @static
- */
-YAHOO.widget.ColumnSet._nCount = 0;
 
-/**
- * Unique instance name.
- *
- * @property _sName
- * @type String
- * @private
- */
-YAHOO.widget.ColumnSet.prototype._sName = null;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Top-down tree representation of Column hierarchy.
- *
- * @property tree
- * @type YAHOO.widget.Column[]
- */
-YAHOO.widget.ColumnSet.prototype.tree = null;
 
-/**
- * Flattened representation of all Columns.
- *
- * @property flat
- * @type YAHOO.widget.Column[]
- * @default []
- */
-YAHOO.widget.ColumnSet.prototype.flat = null;
 
-/**
- * Array of Columns that map one-to-one to a table column.
- *
- * @property keys
- * @type YAHOO.widget.Column[]
- * @default []
- */
-YAHOO.widget.ColumnSet.prototype.keys = null;
 
-/**
- * ID index of nested parent hierarchies for HEADERS accessibility attribute.
- *
- * @property headers
- * @type String[]
- * @default []
- */
-YAHOO.widget.ColumnSet.prototype.headers = null;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Public accessor to the unique name of the ColumnSet instance.
- *
- * @method toString
- * @return {String} Unique name of the ColumnSet instance.
- */
 
-YAHOO.widget.ColumnSet.prototype.toString = function() {
-    return "ColumnSet " + this._sName;
-};
 
-/**
- * Returns Column instance with given ID number or key.
- *
- * @method getColumn
- * @param column {Number | String} ID number or unique key.
- * @return {YAHOO.widget.Column} Column instance.
- */
 
-YAHOO.widget.ColumnSet.prototype.getColumn = function(column) {
-    var allColumns = this.flat;
-    if(YAHOO.lang.isNumber(column)) {
-        for(var i=0; i<allColumns.length; i++) {
-            if(allColumns[i]._nId === column) {
-                return allColumns[i];
-            }
-        }
-    }
-    else if(YAHOO.lang.isString(column)) {
-        for(i=0; i<allColumns.length; i++) {
-            if(allColumns[i].key === column) {
-                return allColumns[i];
-            }
-        }
-    }
-    return null;
-};
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
 
-/**
- * The Column class defines and manages attributes of DataTable Columns
- *
- * @namespace YAHOO.widget
- * @class Column
- * @constructor
- * @param oConfigs {Object} Object literal of configuration values.
- */
-YAHOO.widget.Column = function(oConfigs) {
-    // Internal variables
-    this._nId = YAHOO.widget.Column._nCount;
-    this._sName = "Column instance" + this._nId;
 
-    // Object literal defines Column attributes
-    if(oConfigs && (oConfigs.constructor == Object)) {
-        for(var sConfig in oConfigs) {
-            if(sConfig) {
-                this[sConfig] = oConfigs[sConfig];
-            }
-        }
-    }
 
-    if(!YAHOO.lang.isValue(this.key)) {
-        this.key = "yui-dt-column"+this._nId;
-    }
-    YAHOO.widget.Column._nCount++;
-};
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Internal instance counter.
- *
- * @property Column._nCount
- * @type Number
- * @private
- * @static
- * @default 0
- */
-YAHOO.widget.Column._nCount = 0;
+    /**
+     * Fired when the DataTable instance's initialization is complete.
+     *
+     * @event initEvent
+     */
 
-/**
- * Unique instance name.
- *
- * @property _sName
- * @type String
- * @private
- */
-YAHOO.widget.Column.prototype._sName = null;
+    /**
+     * Fired when the DataTable's view is rendered.
+     *
+     * @event renderEvent
+     */
 
+    /**
+     * Fired when data is returned from DataSource but before it is consumed by
+     * DataTable.
+     *
+     * @event dataReturnEvent
+     * @param oArgs.request {String} Original request.
+     * @param oArgs.response {Object} Response object.
+     */
 
-/**
- * Unique number assigned at instantiation, indicates original order within
- * ColumnSet.
- *
- * @property _nId
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._nId = null;
+    /**
+     * Fired when the DataTable has a focus event.
+     *
+     * @event tableFocusEvent
+     */
 
-/**
- * Reference to Column's index within its ColumnSet's keys array, or null if not applicable.
- *
- * @property _nKeyIndex
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._nKeyIndex = null;
+    /**
+     * Fired when the DataTable THEAD element has a focus event.
+     *
+     * @event theadFocusEvent
+     */
 
-/**
- * Number of table cells the Column spans.
- *
- * @property _colspan
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._colspan = 1;
+    /**
+     * Fired when the DataTable TBODY element has a focus event.
+     *
+     * @event tbodyFocusEvent
+     */
 
-/**
- * Number of table rows the Column spans.
- *
- * @property _rowspan
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._rowspan = 1;
+    /**
+     * Fired when the DataTable has a blur event.
+     *
+     * @event tableBlurEvent
+     */
 
-/**
- * Column's parent Column instance, or null.
- *
- * @property _parent
- * @type YAHOO.widget.Column
- * @private
- */
-YAHOO.widget.Column.prototype._parent = null;
+    /*TODO
+     * Fired when the DataTable THEAD element has a blur event.
+     *
+     * @event theadBlurEvent
+     */
 
-/**
- * Current offsetWidth of the Column (in pixels).
- *
- * @property _width
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._width = null;
+    /*TODO
+     * Fired when the DataTable TBODY element has a blur event.
+     *
+     * @event tbodyBlurEvent
+     */
 
-/**
- * Minimum width the Column can support (in pixels). Value is populated only if table
- * is fixedWidth, null otherwise.
- *
- * @property _minWidth
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._minWidth = null;
+    /**
+     * Fired when the DataTable has a key event.
+     *
+     * @event tableKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Fired when the DataTable THEAD element has a key event.
+     *
+     * @event theadKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
 
-/**
* Associated database field, or null.
- *
- * @property key
- * @type String
- */
-YAHOO.widget.Column.prototype.key = null;
+    /**
    * Fired when the DataTable TBODY element has a key event.
    *
+     * @event tbodyKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
 
-/**
- * Text or HTML for display as Column's label in the TH element.
- *
- * @property label
- * @type String
- */
-YAHOO.widget.Column.prototype.label = null;
+    /**
+     * Fired when the DataTable has a mouseover.
+     *
+     * @event tableMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
 
-/**
- * Column head cell ABBR for accessibility.
- *
- * @property abbr
- * @type String
- */
-YAHOO.widget.Column.prototype.abbr = null;
+    /**
+     * Fired when the DataTable has a mouseout.
+     *
+     * @event tableMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
 
-/**
- * Array of object literals that define children (nested headers) of a Column.
- *
- * @property children
- * @type Object[]
- */
-YAHOO.widget.Column.prototype.children = null;
+    /**
+     * Fired when the DataTable has a mousedown.
+     *
+     * @event tableMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a click.
+     *
+     * @event tableClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a dblclick.
+     *
+     * @event tableDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when a fixed scrolling DataTable has a scroll.
+     *
+     * @event tableScrollEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
+     * or the DataTable's TBODY element (everyone else).
+     *
+     */
 
-/**
- * Column width.
- *
- * @property width
- * @type String
- */
-YAHOO.widget.Column.prototype.width = null;
+    /**
+     * Fired when a message is shown in the DataTable's message element.
+     *
+     * @event tableMsgShowEvent
+     * @param oArgs.html {String} The HTML displayed.
+     * @param oArgs.className {String} The className assigned.
+     *
+     */
 
-/**
- * Custom CSS class or array of classes to be applied to every cell in the Column.
- *
- * @property className
- * @type String || String[]
- */
-YAHOO.widget.Column.prototype.className = null;
+    /**
+     * Fired when the DataTable's message element is hidden.
+     *
+     * @event tableMsgHideEvent
+     */
 
-/**
* Defines a format function.
- *
- * @property formatter
- * @type String || HTMLFunction
- */
-YAHOO.widget.Column.prototype.formatter = null;
+    /**
    * Fired when a THEAD row has a mouseover.
    *
+     * @event theadRowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
* Defines an editor function, otherwise Column is not editable.
- *
- * @property editor
- * @type String || HTMLFunction
- */
-YAHOO.widget.Column.prototype.editor = null;
+    /**
    * Fired when a THEAD row has a mouseout.
    *
+     * @event theadRowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
* Defines editor options for Column in an object literal of param:value pairs.
- *
- * @property editorOptions
- * @type Object
- */
-YAHOO.widget.Column.prototype.editorOptions = null;
+    /**
    * Fired when a THEAD row has a mousedown.
    *
+     * @event theadRowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
- * True if Column is resizeable, false otherwise.
- *
- * @property resizeable
- * @type Boolean
- * @default false
- */
-YAHOO.widget.Column.prototype.resizeable = false;
+    /**
+     * Fired when a THEAD row has a click.
+     *
+     * @event theadRowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
- * True if Column is sortable, false otherwise.
- *
- * @property sortable
- * @type Boolean
- * @default false
- */
-YAHOO.widget.Column.prototype.sortable = false;
+    /**
+     * Fired when a THEAD row has a dblclick.
+     *
+     * @event theadRowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
- * Default sort order for Column: "asc" or "desc".
- *
- * @property sortOptions.defaultOrder
- * @type String
- * @default null
- */
-/**
- * Custom sort handler.
- *
- * @property sortOptions.sortFunction
- * @type Function
- * @default null
- */
-YAHOO.widget.Column.prototype.sortOptions = null;
+    /**
+     * Fired when a THEAD cell has a mouseover.
+     *
+     * @event theadCellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
 
+    /**
+     * Fired when a THEAD cell has a mouseout.
+     *
+     * @event theadCellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
 
+    /**
+     * Fired when a THEAD cell has a mousedown.
+     *
+     * @event theadCellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
 
+    /**
+     * Fired when a THEAD cell has a click.
+     *
+     * @event theadCellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
 
+    /**
+     * Fired when a THEAD cell has a dblclick.
+     *
+     * @event theadCellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
 
+    /**
+     * Fired when a THEAD label has a mouseover.
+     *
+     * @event theadLabelMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
 
+    /**
+     * Fired when a THEAD label has a mouseout.
+     *
+     * @event theadLabelMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
 
+    /**
+     * Fired when a THEAD label has a mousedown.
+     *
+     * @event theadLabelMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
 
+    /**
+     * Fired when a THEAD label has a click.
+     *
+     * @event theadLabelClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
 
+    /**
+     * Fired when a THEAD label has a dblclick.
+     *
+     * @event theadLabelDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
 
+    /**
+     * Fired when a column is sorted.
+     *
+     * @event columnSortEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.dir {String} Sort direction: YAHOO.widget.DataTable.CLASS_ASC
+     * or YAHOO.widget.DataTable.CLASS_DESC.
+     */
 
+    /**
+     * Fired when a column width is set.
+     *
+     * @event columnSetWidthEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.width {Number} The width in pixels.
+     */
 
+    /**
+     * Fired when a column is drag-resized.
+     *
+     * @event columnResizeEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
 
+    /**
+     * Fired when a column is hidden.
+     *
+     * @event columnHideEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
 
+    /**
+     * Fired when a column is shown.
+     *
+     * @event columnShowEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Fired when a column is selected.
+     *
+     * @event columnSelectEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
 
-/**
- * Public accessor to the unique name of the Column instance.
- *
- * @method toString
- * @return {String} Column's unique name.
- */
-YAHOO.widget.Column.prototype.toString = function() {
-    return this._sName;
-};
+    /**
+     * Fired when a column is unselected.
+     *
+     * @event columnUnselectEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+    /**
+     * Fired when a column is removed.
+     *
+     * @event columnRemoveEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
 
-/**
- * Returns unique number assigned at instantiation, indicates original order
- * within ColumnSet.
- *
- * @method getId
- * @return {Number} Column's unique ID number.
- */
-YAHOO.widget.Column.prototype.getId = function() {
-    return this._nId;
-};
+    /**
+     * Fired when a column is inserted.
+     *
+     * @event columnInsertEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.index {Number} The index position.
+     */
 
-/**
- * Public accessor returns Column's key index within its ColumnSet's keys array, or
- * null if not applicable.
- *
- * @method getKeyIndex
- * @return {Number} Column's key index within its ColumnSet keys array, if applicable.
- */
-YAHOO.widget.Column.prototype.getKeyIndex = function() {
-    return this._nKeyIndex;
-};
+    /**
+     * Fired when a column is highlighted.
+     *
+     * @event columnHighlightEvent
+     * @param oArgs.column {YAHOO.widget.Column} The highlighted Column.
+     */
 
-/**
- * Public accessor returns Column's parent instance if any, or null otherwise.
- *
- * @method getParent
- * @return {YAHOO.widget.Column} Column's parent instance.
- */
-YAHOO.widget.Column.prototype.getParent = function() {
-    return this._parent;
-};
+    /**
+     * Fired when a column is unhighlighted.
+     *
+     * @event columnUnhighlightEvent
+     * @param oArgs.column {YAHOO.widget.Column} The unhighlighted Column.
+     */
 
-/**
- * Public accessor returns Column's calculated COLSPAN value.
- *
- * @method getColspan
- * @return {Number} Column's COLSPAN value.
- */
-YAHOO.widget.Column.prototype.getColspan = function() {
-    return this._colspan;
-};
-// Backward compatibility
-YAHOO.widget.Column.prototype.getColSpan = function() {
-    YAHOO.log("The method getColSpan() has been" +
-    " deprecated in favor of getColspan()", "warn", this.toString());
-    return this.getColspan();
-};
 
-/**
- * Public accessor returns Column's calculated ROWSPAN value.
- *
- * @method getRowspan
- * @return {Number} Column's ROWSPAN value.
- */
-YAHOO.widget.Column.prototype.getRowspan = function() {
-    return this._rowspan;
-};
+    /**
+     * Fired when a row has a mouseover.
+     *
+     * @event rowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-// Backward compatibility
-YAHOO.widget.Column.prototype.getIndex = function() {
-    YAHOO.log("The method getIndex() has been" +
-    " deprecated in favor of getKeyIndex()", "warn",
-    this.toString());
-    return this.getKeyIndex();
-};
-YAHOO.widget.Column.prototype.format = function() {
-    YAHOO.log("The method format() has been deprecated in favor of the " +
-    "DataTable method formatCell()", "error", this.toString());
-};
-YAHOO.widget.Column.formatCheckbox = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatCheckbox() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatCheckbox()", "warn",
-    "YAHOO.widget.Column.formatCheckbox");
-    YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatCurrency = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatCurrency() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatCurrency()", "warn",
-    "YAHOO.widget.Column.formatCurrency");
-    YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatDate = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatDate() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatDate()", "warn",
-    "YAHOO.widget.Column.formatDate");
-    YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatEmail = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatEmail() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatEmail()", "warn",
-    "YAHOO.widget.Column.formatEmail");
-    YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatLink() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatLink()", "warn",
-    "YAHOO.widget.Column.formatLink");
-    YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatNumber = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatNumber() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatNumber()", "warn",
-    "YAHOO.widget.Column.formatNumber");
-    YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatSelect = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.log("The method YAHOO.widget.Column.formatSelect() has been" +
-    " deprecated in favor of YAHOO.widget.DataTable.formatDropdown()", "warn",
-    "YAHOO.widget.Column.formatSelect");
-    YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
-};
+    /**
+     * Fired when a row has a mouseout.
+     *
+     * @event rowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+    /**
+     * Fired when a row has a mousedown.
+     *
+     * @event rowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
-/**
- * Sort static utility to support Column sorting.
- *
- * @namespace YAHOO.util
- * @class Sort
- * @static
- */
-YAHOO.util.Sort = {
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Public methods
-    //
-    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Fired when a row has a click.
+     *
+     * @event rowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
 
     /**
-     * Comparator function for simple case-insensitive string sorting.
+     * Fired when a row has a dblclick.
      *
-     * @method compare
-     * @param a {Object} First sort argument.
-     * @param b {Object} Second sort argument.
-     * @param desc {Boolean} True if sort direction is descending, false if
-     * sort direction is ascending.
+     * @event rowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
      */
-    compare: function(a, b, desc) {
-        if((a === null) || (typeof a == "undefined")) {
-            if((b === null) || (typeof b == "undefined")) {
-                return 0;
-            }
-            else {
-                return 1;
-            }
-        }
-        else if((b === null) || (typeof b == "undefined")) {
-            return -1;
-        }
 
-        if(a.constructor == String) {
-            a = a.toLowerCase();
-        }
-        if(b.constructor == String) {
-            b = b.toLowerCase();
-        }
-        if(a < b) {
-            return (desc) ? 1 : -1;
-        }
-        else if (a > b) {
-            return (desc) ? -1 : 1;
-        }
-        else {
-            return 0;
-        }
-    }
-};
+    /**
+     * Fired when a row is added.
+     *
+     * @event rowAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The added Record.
+     */
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+    /**
+     * Fired when a row is updated.
+     *
+     * @event rowUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
+     * @param oArgs.oldData {Object} Object literal of the old data.
+     */
 
-/**
- * ColumnResizer subclasses DragDrop to support resizeable Columns.
- *
- * @namespace YAHOO.util
- * @class ColumnResizer
- * @extends YAHOO.util.DragDrop
- * @constructor
- * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param elThead {HTMLElement} TH element reference.
- * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
- * @param sGroup {String} Group name of related DragDrop items.
- * @param oConfig {Object} (Optional) Object literal of config values.
- */
-YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elThead, sHandleId, sGroup, oConfig) {
-    if(oDataTable && oColumn && elThead && sHandleId) {
-        this.datatable = oDataTable;
-        this.column = oColumn;
-        this.cell = elThead;
-        this.init(sHandleId, sGroup, oConfig);
-        //this.initFrame();
-        this.setYConstraint(0,0);
-    }
-    else {
-        YAHOO.log("Column resizer could not be created due to invalid colElId","warn");
-    }
-};
+    /**
+     * Fired when a row is deleted.
+     *
+     * @event rowDeleteEvent
+     * @param oArgs.oldData {Object} Object literal of the deleted data.
+     * @param oArgs.recordIndex {Number} Index of the deleted Record.
+     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if on current page.
+     */
 
-if(YAHOO.util.DD) {
-    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DD);
-}
+    /**
+     * Fired when a row is selected.
+     *
+     * @event rowSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     */
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public DOM event handlers
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Fired when a row is unselected.
+     *
+     * @event rowUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     */
 
-/**
- * Handles mousedown events on the Column resizer.
- *
- * @method onMouseDown
- * @param e {string} The mousedown event
- */
-YAHOO.util.ColumnResizer.prototype.onMouseDown = function(e) {
-    this.startWidth = this.cell.offsetWidth;
-    this.startPos = YAHOO.util.Dom.getX(this.getDragEl());
+    /**
+     * Fired when all row selections are cleared.
+     *
+     * @event unselectAllRowsEvent
+     */
 
-    if(this.datatable.fixedWidth) {
-        var cellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];
-        this.minWidth = cellLabel.offsetWidth + 6;
-        var sib = this.cell.nextSibling;
-        var sibCellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];
-        this.sibMinWidth = sibCellLabel.offsetWidth + 6;
-//!!
-        var left = ((this.startWidth - this.minWidth) < 0) ? 0 : (this.startWidth - this.minWidth);
-        var right = ((sib.offsetWidth - this.sibMinWidth) < 0) ? 0 : (sib.offsetWidth - this.sibMinWidth);
-        this.setXConstraint(left, right);
-        YAHOO.log("cellstartwidth:" + this.startWidth,"time");
-        YAHOO.log("cellminwidth:" + this.minWidth,"time");
-        YAHOO.log("sibstartwidth:" + sib.offsetWidth,"time");
-        YAHOO.log("sibminwidth:" + this.sibMinWidth,"time");
-        YAHOO.log("l:" + left + " AND r:" + right,"time");
-    }
+    /**
+     * Fired when a row is highlighted.
+     *
+     * @event rowHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
 
-};
+    /**
+     * Fired when a row is unhighlighted.
+     *
+     * @event rowUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
 
-/**
- * Handles mouseup events on the Column resizer.
- *
- * @method onMouseUp
- * @param e {string} The mouseup event
- */
-YAHOO.util.ColumnResizer.prototype.onMouseUp = function(e) {
-    //TODO: replace the resizer where it belongs:
-    var resizeStyle = YAHOO.util.Dom.get(this.handleElId).style;
-    resizeStyle.left = "auto";
-    resizeStyle.right = 0;
-    resizeStyle.marginRight = "-6px";
-    resizeStyle.width = "6px";
-    //.yui-dt-headresizer {position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}
+    /**
+     * Fired when a cell has a mouseover.
+     *
+     * @event cellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
 
+    /**
+     * Fired when a cell has a mouseout.
+     *
+     * @event cellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
 
-    //var cells = this.datatable._elTable.tHead.rows[this.datatable._elTable.tHead.rows.length-1].cells;
-    //for(var i=0; i<cells.length; i++) {
-        //cells[i].style.width = "5px";
-    //}
+    /**
+     * Fired when a cell has a mousedown.
+     *
+     * @event cellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
 
-    //TODO: set new ColumnSet width values
-    this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.cell});
-};
+    /**
+     * Fired when a cell has a click.
+     *
+     * @event cellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
 
-/**
- * Handles drag events on the Column resizer.
- *
- * @method onDrag
- * @param e {string} The drag event
- */
-YAHOO.util.ColumnResizer.prototype.onDrag = function(e) {
-    var newPos = YAHOO.util.Dom.getX(this.getDragEl());
-    //YAHOO.log("newpos:"+newPos,"warn");//YAHOO.util.Event.getPageX(e);
-    var offsetX = newPos - this.startPos;
-    //YAHOO.log("offset:"+offsetX,"warn");
-    //YAHOO.log("startwidth:"+this.startWidth + " and offset:"+offsetX,"warn");
-    var newWidth = this.startWidth + offsetX;
-    //YAHOO.log("newwidth:"+newWidth,"warn");
+    /**
+     * Fired when a cell has a dblclick.
+     *
+     * @event cellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
 
-    if(newWidth < this.minWidth) {
-        newWidth = this.minWidth;
-    }
+    /**
+     * Fired when a cell is formatted.
+     *
+     * @event cellFormatEvent
+     * @param oArgs.el {HTMLElement} The formatted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the formatted cell.
+     */
 
-    // Resize the Column
-    var oDataTable = this.datatable;
-    var elCell = this.cell;
+    /**
+     * Fired when a cell is selected.
+     *
+     * @event cellSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the selected cell.
+     */
 
-    //YAHOO.log("newwidth" + newWidth,"warn");
-    //YAHOO.log(newWidth + " AND "+ elColumn.offsetWidth + " AND " + elColumn.id,"warn");
+    /**
+     * Fired when a cell is unselected.
+     *
+     * @event cellUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the unselected cell.
 
-    // Resize the other Columns
-    if(oDataTable.fixedWidth) {
-        // Moving right or left?
-        var sib = elCell.nextSibling;
-        //var sibIndex = elCell.index + 1;
-        var sibnewwidth = sib.offsetWidth - offsetX;
-        if(sibnewwidth < this.sibMinWidth) {
-            sibnewwidth = this.sibMinWidth;
-        }
+     */
 
-        //TODO: how else to cycle through all the Columns without having to use an index property?
-        for(var i=0; i<oDataTable._oColumnSet.length; i++) {
-            //if((i != elCell.index) &&  (i!=sibIndex)) {
-            //    YAHOO.util.Dom.get(oDataTable._oColumnSet.keys[i].id).style.width = oDataTable._oColumnSet.keys[i].width + "px";
-            //}
-        }
-        sib.style.width = sibnewwidth;
-        elCell.style.width = newWidth + "px";
-        //oDataTable._oColumnSet.flat[sibIndex].width = sibnewwidth;
-        //oDataTable._oColumnSet.flat[elCell.index].width = newWidth;
+    /**
+     * Fired when a cell is highlighted.
+     *
+     * @event cellHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the highlighted cell.
 
-    }
-    else {
-        elCell.style.width = newWidth + "px";
-    }
-};
+     */
 
+    /**
+     * Fired when a cell is unhighlighted.
+     *
+     * @event cellUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the unhighlighted cell.
 
+     */
 
+    /**
+     * Fired when all cell selections are cleared.
+     *
+     * @event unselectAllCellsEvent
+     */
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+    /**
+     * Fired when an Editor is activated.
+     *
+     * @event editorShowEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
 
-/**
- * A RecordSet defines and manages a set of Records.
- *
- * @namespace YAHOO.widget
- * @class RecordSet
- * @param data {Object || Object[]} An object literal or an array of data.
- * @constructor
- */
-YAHOO.widget.RecordSet = function(data) {
-    // Internal variables
-    this._sName = "RecordSet instance" + YAHOO.widget.RecordSet._nCount;
-    YAHOO.widget.RecordSet._nCount++;
-    this._records = [];
-    this._length = 0;
-    
-    if(data) {
-        if(YAHOO.lang.isArray(data)) {
-            this.addRecords(data);
-        }
-        else if(data.constructor == Object) {
-            this.addRecord(data);
-        }
-    }
+    /**
+     * Fired when an active Editor has a keydown.
+     *
+     * @event editorKeydownEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.event {HTMLEvent} The event object.
+     */
+
+    /**
+     * Fired when Editor input is reverted.
+     *
+     * @event editorRevertEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value from form input field.
+     * @param oArgs.oldData {Object} Old data value.
+     */
 
     /**
-     * Fired when a new Record is added to the RecordSet.
+     * Fired when Editor input is saved.
      *
-     * @event recordAddEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.data {Object} Data added.
+     * @event editorSaveEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value from form input field.
+     * @param oArgs.oldData {Object} Old data value.
      */
-    this.createEvent("recordAddEvent");
 
     /**
-     * Fired when multiple Records are added to the RecordSet at once.
+     * Fired when Editor input is canceled.
      *
-     * @event recordsAddEvent
-     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
-     * @param oArgs.data {Object[]} Data added.
+     * @event editorCancelEvent
+     * @param oArgs.editor {Object} The Editor object literal.
      */
-    this.createEvent("recordsAddEvent");
 
     /**
-     * Fired when a Record is updated with new data.
+     * Fired when an active Editor has a blur.
      *
-     * @event recordUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.newData {Object} New data.
-     * @param oArgs.oldData {Object} Old data.
+     * @event editorBlurEvent
+     * @param oArgs.editor {Object} The Editor object literal.
      */
-    this.createEvent("recordUpdateEvent");
-    
+
+
+
+
+
+
+
     /**
-     * Fired when a Record is deleted from the RecordSet.
+     * Fired when a link is clicked.
      *
-     * @event recordDeleteEvent
-     * @param oArgs.data {Object} A copy of the data held by the Record,
-     * or an array of data object literals if multiple Records were deleted at once.
-     * @param oArgs.index {Object} Index of the deleted Record.
+     * @event linkClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The A element.
      */
-    this.createEvent("recordDeleteEvent");
 
     /**
-     * Fired when multiple Records are deleted from the RecordSet at once.
+     * Fired when a BUTTON element is clicked.
      *
-     * @event recordsDeleteEvent
-     * @param oArgs.data {Object[]} An array of data object literals copied
-     * from the Records.
-     * @param oArgs.index {Object} Index of the first deleted Record.
+     * @event buttonClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The BUTTON element.
      */
-    this.createEvent("recordsDeleteEvent");
-    
+
     /**
-     * Fired when all Records are deleted from the RecordSet at once.
+     * Fired when a CHECKBOX element is clicked.
      *
-     * @event resetEvent
+     * @event checkboxClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The CHECKBOX element.
      */
-    this.createEvent("resetEvent");
 
-    /**
-     * Fired when a Record Key is updated with new data.
+    /*TODO
+     * Fired when a SELECT element is changed.
      *
-     * @event keyUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.key {String} The updated key.
-     * @param oArgs.newData {Object} New data.
-     * @param oArgs.oldData {Object} Old data.
+     * @event dropdownChangeEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SELECT element.
+     */
+
+    /**
+     * Fired when a RADIO element is clicked.
      *
+     * @event radioClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The RADIO element.
      */
-    this.createEvent("keyUpdateEvent");
 
-    YAHOO.log("RecordSet initialized", "info", this.toString());
-};
 
-if(YAHOO.util.EventProvider) {
-    YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
-}
-else {
-    YAHOO.log("Missing dependency: YAHOO.util.EventProvider","error",this.toString());
-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
-// Private member variables
+// Deprecated APIs
 //
 /////////////////////////////////////////////////////////////////////////////
+
 /**
- * Internal class variable to name multiple Recordset instances.
- *
- * @property RecordSet._nCount
- * @type Number
- * @private
- * @static
+ * @method getBody
+ * @deprecated Use getTbodyEl().
  */
-YAHOO.widget.RecordSet._nCount = 0;
+getBody : function() {
+    // Backward compatibility
+    YAHOO.log("The method getBody() has been deprecated" +
+            " in favor of getTbodyEl()", "warn", this.toString());
+    return this.getTbodyEl();
+},
 
 /**
- * Unique instance name.
- *
- * @property _sName
- * @type String
- * @private
+ * @method getCell
+ * @deprecated Use getTdEl().
  */
-YAHOO.widget.RecordSet.prototype._sName = null;
+getCell : function(index) {
+    // Backward compatibility
+    YAHOO.log("The method getCell() has been deprecated" +
+            " in favor of getTdEl()", "warn", this.toString());
+    return this.getTdEl(index);
+},
 
 /**
- * Internal variable to give unique indexes to Record instances.
- *
- * @property _nCount
- * @type Number
- * @private
+ * @method getRow
+ * @deprecated Use getTrEl().
  */
-YAHOO.widget.RecordSet.prototype._nRecordCount = 0;
+getRow : function(index) {
+    // Backward compatibility
+    YAHOO.log("The method getRow() has been deprecated" +
+            " in favor of getTrEl()", "warn", this.toString());
+    return this.getTrEl(index);
+},
 
 /**
- * Internal counter of how many Records are in the RecordSet.
- *
- * @property _length
- * @type Number
- * @private
+ * @method refreshView
+ * @deprecated Use render.
  */
-YAHOO.widget.RecordSet.prototype._length = null;
+refreshView : function() {
+    // Backward compatibility
+    YAHOO.log("The method refreshView() has been deprecated" +
+            " in favor of render()", "warn", this.toString());
+    this.render();
+},
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private methods
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @method select
+ * @deprecated Use selectRow.
+ */
+select : function(els) {
+    // Backward compatibility
+    YAHOO.log("The method select() has been deprecated" +
+            " in favor of selectRow()", "warn", this.toString());
+    if(!lang.isArray(els)) {
+        els = [els];
+    }
+    for(var i=0; i<els.length; i++) {
+        this.selectRow(els[i]);
+    }
+},
 
 /**
- * Adds one Record to the RecordSet at the given index. If index is null,
- * then adds the Record to the end of the RecordSet.
- *
- * @method _addRecord
- * @param oData {Object} An object literal of data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record} A Record instance.
- * @private
+ * @method updatePaginator
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype._addRecord = function(oData, index) {
-    var oRecord = new YAHOO.widget.Record(oData);
-    oRecord._nId = this._nRecordCount;
-    this._nRecordCount++;
-    
-    if(YAHOO.lang.isNumber(index) && (index > -1)) {
-        this._records.splice(index,0,oRecord);
+updatePaginator : function(oNewValues) {
+    // Complete the set (default if not present)
+    var oValidPaginator = this.get("paginator");
+
+    var nOrigCurrentPage = oValidPaginator.currentPage;
+    for(var param in oNewValues) {
+        if(lang.hasOwnProperty(oValidPaginator, param)) {
+            oValidPaginator[param] = oNewValues[param];
+        }
     }
-    else {
-        index = this.getLength();
-        this._records.push(oRecord);
+
+    oValidPaginator.totalRecords = this._oRecordSet.getLength();
+    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
+    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
+    if(isNaN(oValidPaginator.totalPages)) {
+        oValidPaginator.totalPages = 0;
+    }
+    if(oValidPaginator.currentPage > oValidPaginator.totalPages) {
+        if(oValidPaginator.totalPages < 1) {
+            oValidPaginator.currentPage = 1;
+        }
+        else {
+            oValidPaginator.currentPage = oValidPaginator.totalPages;
+        }
+    }
+
+    if(oValidPaginator.currentPage !== nOrigCurrentPage) {
+        oValidPaginator.startRecordIndex = (oValidPaginator.currentPage-1)*oValidPaginator.rowsPerPage;
+    }
+
+
+    this.set("paginator", oValidPaginator);
+    return this.get("paginator");
+},
+
+/**
+ * @method showPage
+ * @deprecated Use Paginator class APIs.
+ */
+showPage : function(nPage) {
+    var oPaginator = this.get('paginator');
+    // Validate input
+    if(!lang.isNumber(nPage) || (nPage < 1)) {
+        if (oPaginator instanceof Pag) {
+            if (!oPaginator.hasPage(nPage)) {
+                nPage = 1;
+            }
+        } else if (nPage > oPaginator.totalPages) {
+            nPage = 1;
+        }
+    }
+
+    if (oPaginator instanceof Pag) {
+        oPaginator.setPage(nPage);
+    } else {
+        this.updatePaginator({currentPage:nPage});
+        this.render();
+    }
+},
+
+/**
+ * @method formatPaginators
+ * @deprecated Use Paginator class APIs.
+ */
+formatPaginators : function() {
+    var pag = this.get("paginator");
+    if (pag instanceof Pag) {
+        pag.update();
+        return;
+    }
+
+    var i;
+
+    // For Opera workaround
+    var dropdownEnabled = false;
+
+    // Links are enabled
+    if(pag.pageLinks > -1) {
+        for(i=0; i<pag.links.length; i++) {
+            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
+        }
+    }
+
+    // Dropdown is enabled
+    for(i=0; i<pag.dropdowns.length; i++) {
+         if(pag.dropdownOptions) {
+            dropdownEnabled = true;
+            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
+        }
+        else {
+            pag.dropdowns[i].style.display = "none";
+        }
+    }
+
+    // For Opera artifacting in dropdowns
+    if(dropdownEnabled && ua.opera) {
+        document.body.style += '';
+    }
+    YAHOO.log("Paginators formatted", "info", this.toString());
+},
+
+/**
+ * @method formatPaginatorDropdown
+ * @deprecated Use Paginator class APIs.
+ */
+formatPaginatorDropdown : function(elDropdown, dropdownOptions) {
+    if(elDropdown && (elDropdown.ownerDocument == document)) {
+        // Clear OPTION elements
+        while (elDropdown.firstChild) {
+            elDropdown.removeChild(elDropdown.firstChild);
+        }
+
+        // Create OPTION elements
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var optionEl = document.createElement("option");
+            optionEl.value = (lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            optionEl.innerHTML = (lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            optionEl = elDropdown.appendChild(optionEl);
+        }
+
+        var options = elDropdown.options;
+        // Update dropdown's "selected" value
+        if(options.length) {
+            for(var i=options.length-1; i>-1; i--) {
+                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
+                    options[i].selected = true;
+                }
+            }
+        }
+
+        // Show the dropdown
+        elDropdown.style.display = "";
+        return;
     }
-    this._length++;
-    return oRecord;
-};
+    YAHOO.log("Could not update Paginator dropdown " + elDropdown, "error", this.toString());
+},
 
 /**
- * Deletes Records from the RecordSet at the given index. If range is null,
- * then only one Record is deleted.
- *
- * @method _deleteRecord
- * @param index {Number} Position index.
- * @param range {Number} (optional) How many Records to delete
- * @private
+ * @method formatPaginatorLinks
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype._deleteRecord = function(index, range) {
-    if(!YAHOO.lang.isNumber(range) || (range < 0)) {
-        range = 1;
-    }
-    this._records.splice(index, range);
-    this._length = this._length - range;
-};
+formatPaginatorLinks : function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
+    if(elContainer && (elContainer.ownerDocument == document) &&
+            lang.isNumber(nCurrentPage) && lang.isNumber(nPageLinksStart) &&
+            lang.isNumber(nTotalPages)) {
+        // Set up markup for first/last/previous/next
+        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
+        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
+        var sFirstLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_FIRST + "\">&lt;&lt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_FIRST + "\">&lt;&lt;</a> ";
+        var sPrevLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_PREVIOUS + "\">&lt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_PREVIOUS + "\">&lt;</a> " ;
+        var sNextLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_NEXT + "\">&gt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_NEXT + "\">&gt;</a> " ;
+        var sLastLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_LAST +  "\">&gt;&gt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_LAST + "\">&gt;&gt;</a> ";
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+        // Start with first and previous
+        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
 
-/**
- * Public accessor to the unique name of the RecordSet instance.
- *
- * @method toString
- * @return {String} Unique name of the RecordSet instance.
- */
-YAHOO.widget.RecordSet.prototype.toString = function() {
-    return this._sName;
-};
+        // Ok to show all links
+        var nMaxLinks = nTotalPages;
+        var nFirstLink = 1;
+        var nLastLink = nTotalPages;
 
-/**
- * Returns the number of Records held in the RecordSet.
- *
- * @method getLength
- * @return {Number} Number of records in the RecordSet.
- */
-YAHOO.widget.RecordSet.prototype.getLength = function() {
-        return this._length;
-};
+        if(nPageLinksLength > 0) {
+        // Calculate how many links to show
+            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
+                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
 
-/**
- * Returns Record at given position index.
- *
- * @method getRecord
- * @param index {Number} Record's Recordset position index.
- * @return {YAHOO.widget.Record} Record object.
- */
-YAHOO.widget.RecordSet.prototype.getRecord = function(index) {
-    if(YAHOO.lang.isNumber(index)) {
-        return this._records[index];
-    }
-    /*else if(YAHOO.lang.isString(identifier)) {
-        for(var i=0; i<this._records.length; i++) {
-            if(this._records[i].yuiRecordId == identifier) {
-                return this._records[i];
+            // Try to keep the current page in the middle
+            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
+            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
+
+            // Keep the last link in range
+            if(nFirstLink === 1) {
+                nLastLink = nMaxLinks;
+            }
+            // Keep the first link in range
+            else if(nLastLink === nTotalPages) {
+                nFirstLink = nTotalPages - nMaxLinks + 1;
             }
-        }
-    }*/
-    return null;
 
-};
+            // An even number of links can get funky
+            if(nLastLink - nFirstLink === nMaxLinks) {
+                nLastLink--;
+            }
+      }
 
-/*
- * Returns an array of Records from the RecordSet.
- *
- * @method getRecords
- * @param index {Number} (optional) Recordset position index of which Record to
- * start at.
- * @param range {Number} (optional) Number of Records to get.
- * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
- * length equal to given range. If index is not given, all Records are returned.
- */
-YAHOO.widget.RecordSet.prototype.getRecords = function(index, range) {
-    if(!YAHOO.lang.isNumber(index)) {
-        return this._records;
-    }
-    if(!YAHOO.lang.isNumber(range)) {
-        return this._records.slice(index);
+        // Generate markup for each page
+        for(var i=nFirstLink; i<=nLastLink; i++) {
+            if(i != nCurrentPage) {
+                sMarkup += " <a href=\"#\" class=\"" + DT.CLASS_PAGE + "\">" + i + "</a> ";
+            }
+            else {
+                sMarkup += " <span class=\"" + DT.CLASS_SELECTED + "\">" + i + "</span>";
+            }
+        }
+        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
+        elContainer.innerHTML = sMarkup;
+        return;
     }
-    return this._records.slice(index, index+range);
-};
+    YAHOO.log("Could not format Paginator links", "error", this.toString());
+},
 
 /**
- * Returns position index for the given Record.
- *
- * @method getRecordIndex
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @return {Number} Record's RecordSet position index.
+ * @method _onPaginatorLinkClick
+ * @private
+ * @deprecated Use Paginator class APIs.
  */
+_onPaginatorLinkClick : function(e, oSelf) {
+    // Backward compatibility
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
 
-YAHOO.widget.RecordSet.prototype.getRecordIndex = function(oRecord) {
-    for(var i=this._records.length-1; i>-1; i--) {
-        if(oRecord.getId() === this._records[i].getId()) {
-            return i;
-        }
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
     }
-    return null;
 
-};
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                Ev.stopEvent(e);
+                //TODO: after the showPage call, figure out which link
+                //TODO: was clicked and reset focus to the new version of it
+                //TODO: support multiple custom classnames
+                switch(elTarget.className) {
+                    case DT.CLASS_PAGE:
+                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
+                        return;
+                    case DT.CLASS_FIRST:
+                        oSelf.showPage(1);
+                        return;
+                    case DT.CLASS_LAST:
+                        oSelf.showPage(oSelf.get("paginator").totalPages);
+                        return;
+                    case DT.CLASS_PREVIOUS:
+                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
+                        return;
+                    case DT.CLASS_NEXT:
+                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
+                        return;
+                }
+                break;
+            default:
+                return;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.nodeName.toLowerCase();
+        }
+        else {
+            return;
+        }
+    }
+},
 
 /**
- * Adds one Record to the RecordSet at the given index. If index is null,
- * then adds the Record to the end of the RecordSet.
- *
- * @method addRecord
- * @param oData {Object} An object literal of data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record} A Record instance.
+ * @method _onPaginatorDropdownChange
+ * @private
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype.addRecord = function(oData, index) {
-    if(oData && (oData.constructor == Object)) {
-        var oRecord = this._addRecord(oData, index);
-        this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
-        YAHOO.log("Added Record at index " + index +
-                " with data " + YAHOO.lang.dump(oData), "info", this.toString());
-        return oRecord;
-    }
-    else {
-        YAHOO.log("Could not add Record with data" +
-                YAHOO.lang.dump(oData), "info", this.toString());
-        return null;
-    }
-};
+_onPaginatorDropdownChange : function(e, oSelf) {
+    // Backward compatibility
+    var elTarget = Ev.getTarget(e);
+    var newValue = elTarget[elTarget.selectedIndex].value;
 
-/**
- * Adds multiple Records at once to the RecordSet at the given index with the
- * given data. If index is null, then the new Records are added to the end of
- * the RecordSet.
- *
- * @method addRecords
- * @param aData {Object[]} An array of object literal data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record[]} An array of Record instances.
- */
-YAHOO.widget.RecordSet.prototype.addRecords = function(aData, index) {
-    if(YAHOO.lang.isArray(aData)) {
-        var newRecords = [];
-        // Can't go backwards bc we need to preserve order
-        for(var i=0; i<aData.length; i++) {
-            if(aData[i] && (aData[i].constructor == Object)) {
-                var record = this._addRecord(aData[i], index);
-                newRecords.push(record);
-            }
-       }
-        this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
-        YAHOO.log("Added " + newRecords.length + " Record(s) at index " + index +
-                " with data " + YAHOO.lang.dump(aData), "info", this.toString());
-       return newRecords;
-    }
-    else if(aData && (aData.constructor == Object)) {
-        var oRecord = this._addRecord(aData);
-        this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
-        YAHOO.log("Added 1 Record at index " + index +
-                " with data " + YAHOO.lang.dump(aData), "info", this.toString());
-        return oRecord;
+    var newRowsPerPage = lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
+    if(newRowsPerPage !== null) {
+        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
+        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
+        oSelf.render();
     }
     else {
-        YAHOO.log("Could not add Records with data " +
-                YAHOO.lang.dump(aData), "info", this.toString());
+        YAHOO.log("Could not paginate with " + newValue + " rows per page", "error", oSelf.toString());
     }
-};
+},
 
 /**
- * Updates given Record with given data.
- *
- * @method updateRecord
- * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
- * RecordSet position index.
- * @param oData {Object) Object literal of new data.
- * @return {YAHOO.widget.Record} Updated Record, or null.
+ * @method onEventEditCell
+ * @deprecated Use onEventShowCellEditor.
  */
-YAHOO.widget.RecordSet.prototype.updateRecord = function(record, oData) {
-    var oRecord = null;
-    if(YAHOO.lang.isNumber(record)) {
-        oRecord = this._records[record];
-    }
-    else if(record instanceof YAHOO.widget.Record) {
-        oRecord = record;
-    }
-    if(oRecord && oData && (oData.constructor == Object)) {
-        // Copy data from the Record for the event that gets fired later
-        var oldData = {};
-        for(var key in oRecord._oData) {
-            oldData[key] = oRecord._oData[key];
-        }
-        oRecord._oData = oData;
-        this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
-        YAHOO.log("Record at index " + this.getRecordIndex(oRecord) +
-                " updated with data " + YAHOO.lang.dump(oData), "info", this.toString());
-        return oRecord;
-    }
-    else {
-        YAHOO.log("Could not update Record " + record, "error", this.toString());
-        return null;
-    }
-};
+onEventEditCell : function(oArgs) {
+    // Backward compatibility
+    YAHOO.log("The method onEventEditCell() has been deprecated" +
+        " in favor of onEventShowCellEditor()", "warn", this.toString());
+    this.onEventShowCellEditor(oArgs);
+},
 
 /**
- * Updates given Record at given key with given data.
- *
- * @method updateKey
- * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
- * RecordSet position index.
- * @param sKey {String} Key name.
- * @param oData {Object) New data.
+ * @method onDataReturnReplaceRows
+ * @deprecated Use onDataReturnInitializeTable.
  */
-YAHOO.widget.RecordSet.prototype.updateKey = function(record, sKey, oData) {
-    var oRecord;
-    
-    if(YAHOO.lang.isNumber(record)) {
-        oRecord = this._records[record];
-    }
-    if(record instanceof YAHOO.widget.Record) {
-        oRecord = record;
-
-        var oldData = null;
-        var keyValue = oRecord._oData[sKey];
-        // Copy data from the Record for the event that gets fired later
-        if(keyValue && keyValue.constructor == Object) {
-            oldData = {};
-            for(var key in keyValue) {
-                oldData[key] = keyValue[key];
-            }
-        }
-        // Copy by value
-        else {
-            oldData = keyValue;
-        }
-
-        oRecord._oData[sKey] = oData;
-        this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
-        YAHOO.log("Key \"" + sKey +
-                "\" for Record at index " + this.getRecordIndex(oRecord) +
-                " updated to \"" + YAHOO.lang.dump(oData) + "\"", "info", this.toString());
-    }
-    else {
-        YAHOO.log("Could not update key " + sKey + " for Record " + record, "error", this.toString());
-    }
-};
+onDataReturnReplaceRows : function(sRequest, oResponse) {
+    // Backward compatibility
+    YAHOO.log("The method onDataReturnReplaceRows() has been deprecated" +
+            " in favor of onDataReturnInitializeTable()", "warn", this.toString());
+    this.onDataReturnInitializeTable(sRequest, oResponse);
+}
 
 /**
- * Replaces all Records in RecordSet with new data.
- *
- * @method replaceRecords
- * @param data {Object || Object[]} An object literal of data or an array of
- * object literal data.
- * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
- * an array of Records.
+ * @event headerRowMouseoverEvent
+ * @deprecated Use theadRowMouseoverEvent.
  */
-YAHOO.widget.RecordSet.prototype.replaceRecords = function(data) {
-    this.reset();
-    return this.addRecords(data);
-};
 
 /**
- * Sorts all Records by given function.
- *
- * @method sortRecords
- * @param fnSort {Function} Reference to a sort function.
- * @param desc {Boolean} True if sort direction is descending, false if sort
- * direction is ascending.
- * @return {YAHOO.widget.Record[]} Sorted array of Records.
+ * @event headerRowMouseoutEvent
+ * @deprecated Use theadRowMouseoutEvent.
  */
-YAHOO.widget.RecordSet.prototype.sortRecords = function(fnSort, desc) {
-    return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
-};
-
 
 /**
- * Removes the Record at the given position index from the RecordSet. If a range
- * is also provided, removes that many Records, starting from the index. Length
- * of RecordSet is correspondingly shortened.
- *
- * @method deleteRecord
- * @param index {Number} Record's RecordSet position index.
- * @param range {Number} (optional) How many Records to delete.
- * @return {Object} A copy of the data held by the deleted Record.
+ * @event headerRowMousedownEvent
+ * @deprecated Use theadRowMousedownEvent.
  */
-YAHOO.widget.RecordSet.prototype.deleteRecord = function(index) {
-    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
-        // Copy data from the Record for the event that gets fired later
-        var oRecordData = this.getRecord(index).getData();
-        var oData = {};
-        for(var key in oRecordData) {
-            oData[key] = oRecordData[key];
-        }
-        
-        this._deleteRecord(index);
-        this.fireEvent("recordDeleteEvent",{data:oData,index:index});
-        YAHOO.log("Record deleted at index " + index +
-                " and containing data " + YAHOO.lang.dump(oData), "info", this.toString());
-        return oData;
-    }
-    else {
-        YAHOO.log("Could not delete Record at index " + index, "error", this.toString());
-        return null;
-    }
-};
 
 /**
- * Removes the Record at the given position index from the RecordSet. If a range
- * is also provided, removes that many Records, starting from the index. Length
- * of RecordSet is correspondingly shortened.
- *
- * @method deleteRecords
- * @param index {Number} Record's RecordSet position index.
- * @param range {Number} (optional) How many Records to delete.
+ * @event headerRowClickEvent
+ * @deprecated Use theadRowClickEvent.
  */
-YAHOO.widget.RecordSet.prototype.deleteRecords = function(index, range) {
-    if(!YAHOO.lang.isNumber(range)) {
-        range = 1;
-    }
-    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
-        var recordsToDelete = this.getRecords(index, range);
-        // Copy data from each Record for the event that gets fired later
-        var deletedData = [];
-        for(var i=0; i<recordsToDelete.length; i++) {
-            var oData = {};
-            for(var key in recordsToDelete[i]) {
-                oData[key] = recordsToDelete[i][key];
-            }
-            deletedData.push(oData);
-        }
-        this._deleteRecord(index, range);
 
-        this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
-        YAHOO.log(range + "Record(s) deleted at index " + index +
-                " and containing data " + YAHOO.lang.dump(deletedData), "info", this.toString());
-
-    }
-    else {
-        YAHOO.log("Could not delete Records at index " + index, "error", this.toString());
-    }
-};
+/**
+ * @event headerRowDblclickEvent
+ * @deprecated Use theadRowDblclickEvent.
+ */
 
 /**
- * Deletes all Records from the RecordSet.
- *
- * @method reset
+ * @event headerCellMouseoverEvent
+ * @deprecated Use theadCellMouseoverEvent.
  */
-YAHOO.widget.RecordSet.prototype.reset = function() {
-    this._records = [];
-    this._length = 0;
-    this.fireEvent("resetEvent");
-    YAHOO.log("All Records deleted from RecordSet", "info", this.toString());
-};
 
+/**
+ * @event headerCellMouseoutEvent
+ * @deprecated Use theadCellMouseoutEvent.
+ */
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+/**
+ * @event headerCellMousedownEvent
+ * @deprecated Use theadCellMousedownEvent.
+ */
 
 /**
- * The Record class defines a DataTable record.
- *
- * @namespace YAHOO.widget
- * @class Record
- * @constructor
- * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ * @event headerCellClickEvent
+ * @deprecated Use theadCellClickEvent.
  */
-YAHOO.widget.Record = function(oLiteral) {
-    this._oData = {};
-    if(oLiteral && (oLiteral.constructor == Object)) {
-        for(var sKey in oLiteral) {
-            this._oData[sKey] = oLiteral[sKey];
-        }
-    }
-};
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 /**
- * Unique number assigned at instantiation, indicates original order within
- * RecordSet.
- *
- * @property _nId
- * @type Number
- * @private
+ * @event headerCellDblclickEvent
+ * @deprecated Use theadCellDblclickEvent.
  */
-YAHOO.widget.Record.prototype._nId = null;
 
 /**
- * Holds data for the Record in an object literal.
- *
- * @property _oData
- * @type Object
- * @private
+ * @event headerLabelMouseoverEvent
+ * @deprecated Use theadLabelMouseoverEvent.
  */
-YAHOO.widget.Record.prototype._oData = null;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @event headerLabelMouseoutEvent
+ * @deprecated Use theadLabelMouseoutEvent.
+ */
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @event headerLabelMousedownEvent
+ * @deprecated Use theadLabelMousedownEvent.
+ */
 
 /**
- * Returns unique number assigned at instantiation, indicates original order
- * within RecordSet.
- *
- * @method getId
- * @return Number
+ * @event headerLabelClickEvent
+ * @deprecated Use theadLabelClickEvent.
  */
-YAHOO.widget.Record.prototype.getId = function() {
-    return this._nId;
-};
 
 /**
- * Returns data for the Record for a key if given, or the entire object
- * literal otherwise.
- *
- * @method getData
- * @param sKey {String} (Optional) The key to retrieve a single data value.
- * @return Object
+ * @event headerLabelDbllickEvent
+ * @deprecated Use theadLabelDblclickEvent.
  */
-YAHOO.widget.Record.prototype.getData = function(sKey) {
-    if(YAHOO.lang.isString(sKey)) {
-        return this._oData[sKey];
-    }
-    else {
-        return this._oData;
-    }
-};
 
+});
+})();
 
-YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.3.0", build: "442"});
+YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.5.0", build: "895"});
index eddaa48f7905b9f3848e3010d40e1c54ae890971..0262157d4eca101a12332873055c1f31906d3e5c 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.widget.DataTable=function(elContainer,aColumnDefs,oDataSource,oConfigs){this._nIndex=YAHOO.widget.DataTable._nCount;this._sName="instance"+this._nIndex;this.id="yui-dt"+this._nIndex;this._initContainerEl(elContainer);if(!this._elContainer){return;}
-this._initConfigs(oConfigs);this._initColumnSet(aColumnDefs);if(!this._oColumnSet){return;}
-this._initRecordSet();if(!this._oRecordSet){return;}
-this._initDataSource(oDataSource);if(!this._oDataSource){return;}
-if(this._oDataSource.dataType==YAHOO.util.DataSource.TYPE_HTMLTABLE){this._oDataSource.sendRequest(this.get("initialRequest"),this._onDataReturnEnhanceTable,this);}
-else{this._initTableEl();if(!this._elTable||!this._elThead||!this._elTbody){return;}
-YAHOO.widget.DataTable.superclass.constructor.call(this,this._elContainer,this._oConfigs);if(this._oConfigs&&this._oConfigs.paginator){this.updatePaginator(this._oConfigs.paginator);}
-this._oDataSource.sendRequest(this.get("initialRequest"),this.onDataReturnInitializeTable,this);}
-this._initCellEditorEl();this._initColumnSort();this._initDomEvents();YAHOO.widget.DataTable._nCount++;};if(YAHOO.util.Element){YAHOO.lang.extend(YAHOO.widget.DataTable,YAHOO.util.Element);}
-else{}
-YAHOO.widget.DataTable.prototype.initAttributes=function(oConfigs){oConfigs=oConfigs||{};YAHOO.widget.DataTable.superclass.initAttributes.call(this,oConfigs);this.setAttributeConfig("summary",{value:null,validator:YAHOO.lang.isString,method:function(sSummary){this._elTable.summary=sSummary;}});this.setAttributeConfig("selectionMode",{value:"standard",validator:YAHOO.lang.isString});this.setAttributeConfig("initialRequest",{value:"",validator:YAHOO.lang.isString});this.setAttributeConfig("sortedBy",{value:null,validator:function(oNewSortedBy){return(oNewSortedBy&&(oNewSortedBy.constructor==Object)&&oNewSortedBy.key);},method:function(oNewSortedBy){var oOldSortedBy=this.get("sortedBy");if(oOldSortedBy&&(oOldSortedBy.constructor==Object)&&oOldSortedBy.key){var oldColumn=this._oColumnSet.getColumn(oOldSortedBy.key);var oldThEl=this.getThEl(oldColumn);YAHOO.util.Dom.removeClass(oldThEl,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(oldThEl,YAHOO.widget.DataTable.CLASS_DESC);}
-var column=(oNewSortedBy.column)?oNewSortedBy.column:this._oColumnSet.getColumn(oNewSortedBy.key);if(column){var newClass=(oNewSortedBy.dir&&(oNewSortedBy.dir!="asc"))?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;YAHOO.util.Dom.addClass(this.id+"-col"+column.getId(),newClass);}}});this.setAttributeConfig("paginator",{value:{rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]},validator:function(oNewPaginator){if(oNewPaginator&&(oNewPaginator.constructor==Object)){if((oNewPaginator.rowsPerPage!==undefined)&&(oNewPaginator.currentPage!==undefined)&&(oNewPaginator.startRecordIndex!==undefined)&&(oNewPaginator.totalRecords!==undefined)&&(oNewPaginator.totalPages!==undefined)&&(oNewPaginator.rowsThisPage!==undefined)&&(oNewPaginator.pageLinks!==undefined)&&(oNewPaginator.pageLinksStart!==undefined)&&(oNewPaginator.dropdownOptions!==undefined)&&(oNewPaginator.containers!==undefined)&&(oNewPaginator.dropdowns!==undefined)&&(oNewPaginator.links!==undefined)){if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage)&&YAHOO.lang.isNumber(oNewPaginator.currentPage)&&YAHOO.lang.isNumber(oNewPaginator.startRecordIndex)&&YAHOO.lang.isNumber(oNewPaginator.totalRecords)&&YAHOO.lang.isNumber(oNewPaginator.totalPages)&&YAHOO.lang.isNumber(oNewPaginator.rowsThisPage)&&YAHOO.lang.isNumber(oNewPaginator.pageLinks)&&YAHOO.lang.isNumber(oNewPaginator.pageLinksStart)&&YAHOO.lang.isArray(oNewPaginator.dropdownOptions)&&YAHOO.lang.isArray(oNewPaginator.containers)&&YAHOO.lang.isArray(oNewPaginator.dropdowns)&&YAHOO.lang.isArray(oNewPaginator.links)){return true;}}}
-return false;}});this.setAttributeConfig("paginated",{value:false,validator:YAHOO.lang.isBoolean,method:function(oParam){var oPaginator=this.get("paginator");var aContainerEls=oPaginator.containers;if(oParam){if(aContainerEls.length===0){var pag0=document.createElement("span");pag0.id=this.id+"-paginator0";YAHOO.util.Dom.addClass(pag0,YAHOO.widget.DataTable.CLASS_PAGINATOR);pag0=this._elContainer.insertBefore(pag0,this._elTable);aContainerEls.push(pag0);var pag1=document.createElement("span");pag1.id=this.id+"-paginator1";YAHOO.util.Dom.addClass(pag1,YAHOO.widget.DataTable.CLASS_PAGINATOR);pag1=this._elContainer.insertBefore(pag1,this._elTable.nextSibling);aContainerEls.push(pag1);this._configs.paginator.value.containers=[pag0,pag1];}
-else{for(var i=0;i<aContainerEls.length;i++){aContainerEls[i].style.display="";}}
-if(oPaginator.pageLinks>-1){var aLinkEls=oPaginator.links;if(aLinkEls.length===0){for(i=0;i<aContainerEls.length;i++){var linkEl=document.createElement("span");linkEl.id="yui-dt-pagselect"+i;linkEl=aContainerEls[i].appendChild(linkEl);YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);this._configs.paginator.value.links.push(linkEl);}}}
-var dropdownOptions=oPaginator.dropdownOptions||[];for(i=0;i<aContainerEls.length;i++){var selectEl=document.createElement("select");YAHOO.util.Dom.addClass(selectEl,YAHOO.widget.DataTable.CLASS_DROPDOWN);selectEl=aContainerEls[i].appendChild(selectEl);selectEl.id="yui-dt-pagselect"+i;YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);this._configs.paginator.value.dropdowns.push(selectEl);if(!oPaginator.dropdownOptions){selectEl.style.display="none";}}}
-else{if(aContainerEls.length>0){for(i=0;i<aContainerEls.length;i++){aContainerEls[i].style.display="none";}}}}});this.setAttributeConfig("caption",{value:null,validator:YAHOO.lang.isString,method:function(sCaption){if(!this._elCaption){if(!this._elTable.firstChild){this._elCaption=this._elTable.appendChild(document.createElement("caption"));}
-else{this._elCaption=this._elTable.insertBefore(document.createElement("caption"),this._elTable.firstChild);}}
-this._elCaption.innerHTML=sCaption;}});this.setAttributeConfig("scrollable",{value:false,validator:function(oParam){return(YAHOO.lang.isBoolean(oParam)&&!YAHOO.lang.isString(this.get("caption")));},method:function(oParam){if(oParam){YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);}
-else{YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);}}});};YAHOO.widget.DataTable.CLASS_TABLE="yui-dt-table";YAHOO.widget.DataTable.CLASS_HEADER="yui-dt-header";YAHOO.widget.DataTable.CLASS_BODY="yui-dt-body";YAHOO.widget.DataTable.CLASS_SCROLLBODY="yui-dt-scrollbody";YAHOO.widget.DataTable.CLASS_LABEL="yui-dt-label";YAHOO.widget.DataTable.CLASS_RESIZER="yui-dt-resizer";YAHOO.widget.DataTable.CLASS_EDITOR="yui-dt-editor";YAHOO.widget.DataTable.CLASS_PAGINATOR="yui-dt-paginator";YAHOO.widget.DataTable.CLASS_PAGE="yui-dt-page";YAHOO.widget.DataTable.CLASS_DEFAULT="yui-dt-default";YAHOO.widget.DataTable.CLASS_PREVIOUS="yui-dt-previous";YAHOO.widget.DataTable.CLASS_NEXT="yui-dt-next";YAHOO.widget.DataTable.CLASS_FIRST="yui-dt-first";YAHOO.widget.DataTable.CLASS_LAST="yui-dt-last";YAHOO.widget.DataTable.CLASS_EVEN="yui-dt-even";YAHOO.widget.DataTable.CLASS_ODD="yui-dt-odd";YAHOO.widget.DataTable.CLASS_SELECTED="yui-dt-selected";YAHOO.widget.DataTable.CLASS_HIGHLIGHTED="yui-dt-highlighted";YAHOO.widget.DataTable.CLASS_DISABLED="yui-dt-disabled";YAHOO.widget.DataTable.CLASS_EMPTY="yui-dt-empty";YAHOO.widget.DataTable.CLASS_LOADING="yui-dt-loading";YAHOO.widget.DataTable.CLASS_ERROR="yui-dt-error";YAHOO.widget.DataTable.CLASS_EDITABLE="yui-dt-editable";YAHOO.widget.DataTable.CLASS_SCROLLABLE="yui-dt-scrollable";YAHOO.widget.DataTable.CLASS_SORTABLE="yui-dt-sortable";YAHOO.widget.DataTable.CLASS_ASC="yui-dt-asc";YAHOO.widget.DataTable.CLASS_DESC="yui-dt-desc";YAHOO.widget.DataTable.CLASS_BUTTON="yui-dt-button";YAHOO.widget.DataTable.CLASS_DROPDOWN="yui-dt-dropdown";YAHOO.widget.DataTable.CLASS_CHECKBOX="yui-dt-checkbox";YAHOO.widget.DataTable.MSG_EMPTY="No records found.";YAHOO.widget.DataTable.MSG_LOADING="Loading data...";YAHOO.widget.DataTable.MSG_ERROR="Data error.";YAHOO.widget.DataTable._nCount=0;YAHOO.widget.DataTable.prototype._nIndex=null;YAHOO.widget.DataTable.prototype._nTrCount=0;YAHOO.widget.DataTable.prototype._sName=null;YAHOO.widget.DataTable.prototype._elContainer=null;YAHOO.widget.DataTable.prototype._elCaption=null;YAHOO.widget.DataTable.prototype._elTable=null;YAHOO.widget.DataTable.prototype._elThead=null;YAHOO.widget.DataTable.prototype._elTbody=null;YAHOO.widget.DataTable.prototype._elMsgTbody=null;YAHOO.widget.DataTable.prototype._elMsgTbodyRow=null;YAHOO.widget.DataTable.prototype._elMsgTbodyCell=null;YAHOO.widget.DataTable.prototype._oDataSource=null;YAHOO.widget.DataTable.prototype._oColumnSet=null;YAHOO.widget.DataTable.prototype._oRecordSet=null;YAHOO.widget.DataTable.prototype._sFirstLabelLinkId=null;YAHOO.widget.DataTable.prototype._sFirstTrId=null;YAHOO.widget.DataTable.prototype._sLastTrId=null;YAHOO.widget.DataTable.prototype._focusEl=function(el){el=el||this._elTable;setTimeout(function(){el.focus();},0);};YAHOO.widget.DataTable.prototype._initContainerEl=function(elContainer){this._elContainer=null;elContainer=YAHOO.util.Dom.get(elContainer);if(elContainer&&elContainer.tagName&&(elContainer.tagName.toLowerCase()=="div")){this._elContainer=elContainer;}};YAHOO.widget.DataTable.prototype._initConfigs=function(oConfigs){if(oConfigs){if(oConfigs.constructor!=Object){oConfigs=null;}
-else if(YAHOO.lang.isBoolean(oConfigs.paginator)){}
-this._oConfigs=oConfigs;}};YAHOO.widget.DataTable.prototype._initColumnSet=function(aColumnDefs){this._oColumnSet=null;if(YAHOO.lang.isArray(aColumnDefs)){this._oColumnSet=new YAHOO.widget.ColumnSet(aColumnDefs);}
-else if(aColumnDefs instanceof YAHOO.widget.ColumnSet){this._oColumnSet=aColumnDefs;}};YAHOO.widget.DataTable.prototype._initDataSource=function(oDataSource){this._oDataSource=null;if(oDataSource&&(oDataSource instanceof YAHOO.util.DataSource)){this._oDataSource=oDataSource;}
-else{var tmpTable=null;var tmpContainer=this._elContainer;if(tmpContainer.hasChildNodes()){var tmpChildren=tmpContainer.childNodes;for(i=0;i<tmpChildren.length;i++){if(tmpChildren[i].tagName&&tmpChildren[i].tagName.toLowerCase()=="table"){tmpTable=tmpChildren[i];break;}}
-if(tmpTable){var tmpFieldsArray=[];for(i=0;i<this._oColumnSet.keys.length;i++){tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});}
-this._oDataSource=new YAHOO.util.DataSource(tmpTable);this._oDataSource.responseType=YAHOO.util.DataSource.TYPE_HTMLTABLE;this._oDataSource.responseSchema={fields:tmpFieldsArray};}}}};YAHOO.widget.DataTable.prototype._initRecordSet=function(){if(this._oRecordSet){this._oRecordSet.reset();}
-else{this._oRecordSet=new YAHOO.widget.RecordSet();}};YAHOO.widget.DataTable.prototype._initTableEl=function(){YAHOO.util.Event.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";this._elTable=this._elContainer.appendChild(document.createElement("table"));var elTable=this._elTable;elTable.tabIndex=0;elTable.id=this.id+"-table";YAHOO.util.Dom.addClass(elTable,YAHOO.widget.DataTable.CLASS_TABLE);this._initTheadEl(elTable,this._oColumnSet);var elMsgTbody=document.createElement("tbody");var elMsgRow=elMsgTbody.appendChild(document.createElement("tr"));YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);this._elMsgRow=elMsgRow;var elMsgCell=elMsgRow.appendChild(document.createElement("td"));elMsgCell.colSpan=this._oColumnSet.keys.length;YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);this._elMsgTd=elMsgCell;this._elMsgTbody=elTable.appendChild(elMsgTbody);this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING,YAHOO.widget.DataTable.CLASS_LOADING);this._elTbody=elTable.appendChild(document.createElement("tbody"));YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);};YAHOO.widget.DataTable.prototype._initTheadEl=function(){var i,oColumn,colId;var oColumnSet=this._oColumnSet;this._sFirstLabelLinkId=null;var elThead=document.createElement("thead");var colTree=oColumnSet.tree;for(i=0;i<colTree.length;i++){var elTheadRow=elThead.appendChild(document.createElement("tr"));elTheadRow.id=this.id+"-hdrow"+i;var elTheadCell;for(var j=0;j<colTree[i].length;j++){oColumn=colTree[i][j];colId=oColumn.getId();elTheadCell=elTheadRow.appendChild(document.createElement("th"));elTheadCell.id=this.id+"-col"+colId;this._initThEl(elTheadCell,oColumn,i,j);}
-if(i===0){YAHOO.util.Dom.addClass(elTheadRow,YAHOO.widget.DataTable.CLASS_FIRST);}
-if(i===(colTree.length-1)){YAHOO.util.Dom.addClass(elTheadRow,YAHOO.widget.DataTable.CLASS_LAST);}}
-this._elThead=this._elTable.appendChild(elThead);var aFirstHeaders=oColumnSet.headers[0].split(" ");var aLastHeaders=oColumnSet.headers[oColumnSet.headers.length-1].split(" ");for(i=0;i<aFirstHeaders.length;i++){YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]),YAHOO.widget.DataTable.CLASS_FIRST);}
-for(i=0;i<aLastHeaders.length;i++){YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]),YAHOO.widget.DataTable.CLASS_LAST);}
-var foundDD=(YAHOO.util.DD)?true:false;var needDD=false;for(i=0;i<this._oColumnSet.keys.length;i++){oColumn=this._oColumnSet.keys[i];colId=oColumn.getId();var elTheadCellId=YAHOO.util.Dom.get(this.id+"-col"+colId);if(oColumn.resizeable){if(foundDD){if(!this.fixedWidth||(this.fixedWidth&&(oColumn.getKeyIndex()!=this._oColumnSet.keys.length-1))){var elThContainer=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];var elThResizer=elThContainer.appendChild(document.createElement("span"));elThResizer.id=this.id+"-resizer"+colId;YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);oColumn.ddResizer=new YAHOO.util.ColumnResizer(this,oColumn,elTheadCellId,elThResizer.id,elThResizer.id);var cancelClick=function(e){YAHOO.util.Event.stopPropagation(e);};YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);}
-if(this.fixedWidth){var elThLabel=(YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];elThLabel.style.overflow="hidden";}}
-else{needDD=true;}}}
-if(needDD){}};YAHOO.widget.DataTable.prototype._initThEl=function(elTheadCell,oColumn,row,col){var index=this._nIndex;var colId=oColumn.getId();elTheadCell.yuiColumnId=colId;if(oColumn.abbr){elTheadCell.abbr=oColumn.abbr;}
-if(oColumn.width){elTheadCell.style.width=oColumn.width;}
-var aCustomClasses;if(YAHOO.lang.isString(oColumn.className)){aCustomClasses=[oColumn.className];}
-else if(YAHOO.lang.isArray(oColumn.className)){aCustomClasses=oColumn.className;}
-if(aCustomClasses){for(var i=0;i<aCustomClasses.length;i++){YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);}}
-YAHOO.util.Dom.addClass(elTheadCell,"yui-dt-col-"+oColumn.key);elTheadCell.innerHTML="";elTheadCell.rowSpan=oColumn.getRowspan();elTheadCell.colSpan=oColumn.getColspan();var elTheadContainer=elTheadCell.appendChild(document.createElement("div"));elTheadContainer.id=this.id+"-container"+colId;YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);var elTheadLabel=elTheadContainer.appendChild(document.createElement("span"));elTheadLabel.id=this.id+"-label"+colId;YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);var sLabel=YAHOO.lang.isValue(oColumn.label)?oColumn.label:oColumn.key;if(oColumn.sortable){YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);var sLabelLinkId=this.id+"-labellink"+colId;var sortLink="?key="+oColumn.key;elTheadLabel.innerHTML="<a id=\""+sLabelLinkId+"\" href=\""+sortLink+"\" title=\"Click to sort\" class=\""+YAHOO.widget.DataTable.CLASS_SORTABLE+"\">"+sLabel+"</a>";if(!this._sFirstLabelLinkId){this._sFirstLabelLinkId=sLabelLinkId;}}
-else{elTheadLabel.innerHTML=sLabel;}};YAHOO.widget.DataTable.prototype._initCellEditorEl=function(){var elCellEditor=document.createElement("div");elCellEditor.id=this.id+"-celleditor";elCellEditor.style.display="none";YAHOO.util.Dom.addClass(elCellEditor,YAHOO.widget.DataTable.CLASS_EDITOR);elCellEditor=document.body.appendChild(elCellEditor);var oCellEditor={};oCellEditor.container=elCellEditor;oCellEditor.value=null;oCellEditor.isActive=false;this._oCellEditor=oCellEditor;this.subscribe("editorKeydownEvent",function(oArgs){var e=oArgs.event;var elTarget=YAHOO.util.Event.getTarget(e);if((e.keyCode==27)){this.cancelCellEditor();}});};YAHOO.widget.DataTable.prototype._initColumnSort=function(){this.subscribe("headerCellClickEvent",this.onEventSortColumn);};YAHOO.widget.DataTable.prototype._initDomEvents=function(){var elTable=this._elTable;var elThead=this._elThead;var elTbody=this._elTbody;var elContainer=this._elContainer;YAHOO.util.Event.addListener(document,"click",this._onDocumentClick,this);YAHOO.util.Event.addListener(document,"keydown",this._onDocumentKeydown,this);YAHOO.util.Event.addListener(elTable,"focus",this._onTableFocus,this);YAHOO.util.Event.addListener(elTable,"mouseover",this._onTableMouseover,this);YAHOO.util.Event.addListener(elTable,"mouseout",this._onTableMouseout,this);YAHOO.util.Event.addListener(elTable,"mousedown",this._onTableMousedown,this);YAHOO.util.Event.addListener(elTable,"keydown",this._onTableKeydown,this);YAHOO.util.Event.addListener(elTable,"keypress",this._onTableKeypress,this);YAHOO.util.Event.addListener(elTable,"dblclick",this._onTableDblclick,this);YAHOO.util.Event.addListener(elThead,"click",this._onTheadClick,this);YAHOO.util.Event.addListener(elTbody,"click",this._onTbodyClick,this);YAHOO.util.Event.addListener(elContainer,"scroll",this._onScroll,this);YAHOO.util.Event.addListener(elTbody,"scroll",this._onScroll,this);};YAHOO.widget.DataTable.prototype._addTrEl=function(oRecord,index){this.hideTableMessage();var append=(!YAHOO.lang.isNumber(index)||(index<0)||(index>=(this._elTbody.rows.length)))?true:false;var oColumnSet=this._oColumnSet;var oRecordSet=this._oRecordSet;var isSortedBy=this.get("sortedBy");var sortedColKeyIndex=null;var sortedDir,newClass;if(isSortedBy){sortedColKeyIndex=(isSortedBy.column)?isSortedBy.column.getKeyIndex():this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();sortedDir=isSortedBy.dir;newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;}
-var elRow=(append)?this._elTbody.appendChild(document.createElement("tr")):this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);elRow.id=this.id+"-bdrow"+this._nTrCount;this._nTrCount++;elRow.yuiRecordId=oRecord.getId();for(var j=0;j<oColumnSet.keys.length;j++){var oColumn=oColumnSet.keys[j];var elCell=elRow.appendChild(document.createElement("td"));elCell.id=elRow.id+"-cell"+j;elCell.yuiColumnId=oColumn.getId();elCell.headers=oColumnSet.headers[j];elCell.yuiCellIndex=j;this.formatCell(elCell,oRecord,oColumn);if(j===0){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_FIRST);}
-else if(j===this._oColumnSet.keys.length-1){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_LAST);}
-YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_DESC);if(j===sortedColKeyIndex){newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;YAHOO.util.Dom.addClass(elCell,newClass);}
-if(this.fixedWidth){elCell.style.overflow="hidden";}}
-return elRow.id;};YAHOO.widget.DataTable.prototype._updateTrEl=function(elRow,oRecord){this.hideTableMessage();var isSortedBy=this.get("sortedBy");var sortedColKeyIndex=null;var sortedDir,newClass;if(isSortedBy){sortedColKeyIndex=(isSortedBy.column)?isSortedBy.column.getKeyIndex():this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();sortedDir=isSortedBy.dir;newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;}
-for(var j=0;j<elRow.cells.length;j++){var oColumn=this._oColumnSet.keys[j];var elCell=elRow.cells[j];this.formatCell(elCell,oRecord,oColumn);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_DESC);if(j===sortedColKeyIndex){YAHOO.util.Dom.addClass(elCell,newClass);}}
-elRow.yuiRecordId=oRecord.getId();return elRow.id;};YAHOO.widget.DataTable.prototype._deleteTrEl=function(row){var rowIndex;if(!YAHOO.lang.isNumber(row)){rowIndex=YAHOO.util.Dom.get(row).sectionRowIndex;}
-else{rowIndex=row;}
-if(YAHOO.lang.isNumber(rowIndex)&&(rowIndex>-2)&&(rowIndex<this._elTbody.rows.length)){this._elTbody.deleteRow(rowIndex);return true;}
-else{return false;}};YAHOO.widget.DataTable.prototype._setFirstRow=function(){var rowEl=this.getFirstTrEl();if(rowEl){if(this._sFirstTrId){YAHOO.util.Dom.removeClass(this._sFirstTrId,YAHOO.widget.DataTable.CLASS_FIRST);}
-YAHOO.util.Dom.addClass(rowEl,YAHOO.widget.DataTable.CLASS_FIRST);this._sFirstTrId=rowEl.id;}
-else{this._sFirstTrId=null;}};YAHOO.widget.DataTable.prototype._setLastRow=function(){var rowEl=this.getLastTrEl();if(rowEl){if(this._sLastTrId){YAHOO.util.Dom.removeClass(this._sLastTrId,YAHOO.widget.DataTable.CLASS_LAST);}
-YAHOO.util.Dom.addClass(rowEl,YAHOO.widget.DataTable.CLASS_LAST);this._sLastTrId=rowEl.id;}
-else{this._sLastTrId=null;}};YAHOO.widget.DataTable.prototype._setRowStripes=function(row,range){var allRows=this._elTbody.rows;var nStartIndex=0;var nEndIndex=allRows.length;if((row!==null)&&(row!==undefined)){var elStartRow=this.getTrEl(row);if(elStartRow){nStartIndex=elStartRow.sectionRowIndex;if(YAHOO.lang.isNumber(range)&&(range>1)){nEndIndex=nStartIndex+range;}}}
-for(var i=nStartIndex;i<nEndIndex;i++){if(i%2){YAHOO.util.Dom.removeClass(allRows[i],YAHOO.widget.DataTable.CLASS_EVEN);YAHOO.util.Dom.addClass(allRows[i],YAHOO.widget.DataTable.CLASS_ODD);}
-else{YAHOO.util.Dom.removeClass(allRows[i],YAHOO.widget.DataTable.CLASS_ODD);YAHOO.util.Dom.addClass(allRows[i],YAHOO.widget.DataTable.CLASS_EVEN);}}};YAHOO.widget.DataTable.prototype._onScroll=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});oSelf.cancelCellEditor();}
-oSelf.fireEvent("tableScrollEvent",{event:e,target:elTarget});};YAHOO.widget.DataTable.prototype._onDocumentClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(!YAHOO.util.Dom.isAncestor(oSelf._elTable,elTarget)){oSelf.fireEvent("tableBlurEvent");if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container,elTarget)&&(oSelf._oCellEditor.container.id!==elTarget.id)){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}}}};YAHOO.widget.DataTable.prototype._onDocumentKeydown=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive&&YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container,elTarget)){oSelf.fireEvent("editorKeydownEvent",{editor:oSelf._oCellEditor,event:e});}};YAHOO.widget.DataTable.prototype._onTableMouseover=function(e,oSelf){oSelf.fireEvent("tableFocusEvent");};YAHOO.widget.DataTable.prototype._onTableMouseover=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});}
-break;case"th":oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});}
-else{oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});}
-break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableMouseout=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});}
-break;case"th":oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});}
-else{oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});}
-break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableMousedown=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});}
-break;case"th":oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});}
-else{oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});}
-break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableMousedownEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableDblclick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"td":oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});}
-break;case"th":oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});}
-else{oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});}
-break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableDblclickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableKeydown=function(e,oSelf){var bSHIFT=e.shiftKey;var elTarget=YAHOO.util.Event.getTarget(e);if(YAHOO.util.Dom.isAncestor(oSelf._elThead,elTarget)){return;}
-var nKey=YAHOO.util.Event.getCharCode(e);if(nKey===9&&!bSHIFT&&(elTarget.id===oSelf._elTable.id)){if(oSelf._sFirstLabelLinkId){YAHOO.util.Event.stopEvent(e);oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));}
-return;}
-var lastSelectedId=oSelf._sLastSelectedId;var lastSelectedEl=YAHOO.util.Dom.get(lastSelectedId);if(lastSelectedEl&&oSelf.isSelected(lastSelectedEl)){if((nKey>36)&&(nKey<41)){YAHOO.util.Event.stopEvent(e);}
-else{return;}
-var sMode=oSelf.get("selectionMode");var allRows=oSelf._elTbody.rows;var anchorId=oSelf._sSelectionAnchorId;var anchorEl=YAHOO.util.Dom.get(anchorId);var newSelectedEl,trIndex,tdIndex,startIndex,endIndex,i,anchorPos;if(bSHIFT&&(sMode=="cellblock")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(nKey==40){if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
-else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
-else{anchorPos=0;}
-startIndex=Math.min(anchorEl.yuiCellIndex,tdIndex);endIndex=Math.max(anchorEl.yuiCellIndex,tdIndex);if(anchorPos<=0){if(trIndex<allRows.length-1){for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[trIndex+1].cells[i];oSelf.selectCell(newSelectedEl);}
-oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
-else{for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
-oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
-else if(nKey==38){if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
-else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
-else{anchorPos=0;}
-startIndex=Math.min(anchorEl.yuiCellIndex,tdIndex);endIndex=Math.max(anchorEl.yuiCellIndex,tdIndex);if(anchorPos>=0){if(trIndex>0){for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[trIndex-1].cells[i];oSelf.selectCell(newSelectedEl);}
-oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
-else{for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
-oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
-else if(nKey==39){if(anchorEl.yuiCellIndex>tdIndex){anchorPos=1;}
-else if(anchorEl.yuiCellIndex<tdIndex){anchorPos=-1;}
-else{anchorPos=0;}
-if(anchorPos<=0){if(tdIndex<allRows[trIndex].cells.length-1){startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[i].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
-oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}
-else{startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[i].cells[tdIndex]);}
-oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}
-else if(nKey==37){if(anchorEl.yuiCellIndex>tdIndex){anchorPos=1;}
-else if(anchorEl.yuiCellIndex<tdIndex){anchorPos=-1;}
-else{anchorPos=0;}
-if(anchorPos>=0){if(tdIndex>0){startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[i].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
-oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}}
-else{startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[i].cells[tdIndex]);}
-oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}}}
-else if(bSHIFT&&(sMode=="cellrange")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
-else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
-else{anchorPos=0;}
-if(nKey==40){if(anchorPos<=0){for(i=tdIndex+1;i<allRows[trIndex].cells.length;i++){newSelectedEl=allRows[trIndex].cells[i];oSelf.selectCell(newSelectedEl);}
-if(trIndex<allRows.length-1){for(i=0;i<=tdIndex;i++){newSelectedEl=allRows[trIndex+1].cells[i];oSelf.selectCell(newSelectedEl);}}}
-else{for(i=tdIndex;i<allRows[trIndex].cells.length;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
-for(i=0;i<tdIndex;i++){oSelf.unselectCell(allRows[trIndex+1].cells[i]);}
-oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
-else if(nKey==38){if(anchorPos>=0){for(i=tdIndex-1;i>-1;i--){newSelectedEl=allRows[trIndex].cells[i];oSelf.selectCell(newSelectedEl);}
-if(trIndex>0){for(i=allRows[trIndex].cells.length-1;i>=tdIndex;i--){newSelectedEl=allRows[trIndex-1].cells[i];oSelf.selectCell(newSelectedEl);}}}
-else{for(i=tdIndex;i>-1;i--){oSelf.unselectCell(allRows[trIndex].cells[i]);}
-for(i=allRows[trIndex].cells.length-1;i>tdIndex;i--){oSelf.unselectCell(allRows[trIndex-1].cells[i]);}
-oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
-else if(nKey==39){if(anchorPos<0){if(tdIndex<allRows[trIndex].cells.length-1){newSelectedEl=allRows[trIndex].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
-else if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[0];oSelf.selectCell(newSelectedEl);}}
-else if(anchorPos>0){oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex<allRows[trIndex].cells.length-1){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}
-else{oSelf._sLastSelectedId=allRows[trIndex+1].cells[0].id;}}
-else{if(anchorEl.yuiCellIndex<=tdIndex){if(tdIndex<allRows[trIndex].cells.length-1){newSelectedEl=allRows[trIndex].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
-else if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[0];oSelf.selectCell(newSelectedEl);}}
-else{oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}}
-else if(nKey==37){if(anchorPos<0){oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex>0){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}
-else{oSelf._sLastSelectedId=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;}}
-else if(anchorPos>0){if(tdIndex>0){newSelectedEl=allRows[trIndex].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
-else if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];oSelf.selectCell(newSelectedEl);}}
-else{if(anchorEl.yuiCellIndex>=tdIndex){if(tdIndex>0){newSelectedEl=allRows[trIndex].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
-else if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];oSelf.selectCell(newSelectedEl);}}
-else{oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex>0){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}
-else{oSelf._sLastSelectedId=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;}}}}}
-else if((sMode=="cellblock")||(sMode=="cellrange")||(sMode=="singlecell")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(nKey==40){oSelf.unselectAllCells();if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[tdIndex];oSelf.selectCell(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}
-else if(nKey==38){oSelf.unselectAllCells();if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[tdIndex];oSelf.selectCell(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}
-else if(nKey==39){oSelf.unselectAllCells();if(tdIndex<lastSelectedEl.parentNode.cells.length-1){newSelectedEl=lastSelectedEl.parentNode.cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}
-else if(nKey==37){oSelf.unselectAllCells();if(tdIndex>0){newSelectedEl=lastSelectedEl.parentNode.cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}}
-else if(bSHIFT&&(sMode!="single")){trIndex=lastSelectedEl.sectionRowIndex;if(anchorEl.sectionRowIndex>trIndex){anchorPos=1;}
-else if(anchorEl.sectionRowIndex<trIndex){anchorPos=-1;}
-else{anchorPos=0;}
-if(nKey==40){if(anchorPos<=0){if(trIndex<allRows.length-1){oSelf.selectRow(trIndex+1);}}
-else{oSelf.unselectRow(lastSelectedEl);oSelf._sLastSelectedId=allRows[trIndex+1].id;}}
-else if(nKey==38){if(anchorPos>=0){if(trIndex>0){oSelf.selectRow(trIndex-1);}}
-else{oSelf.unselectRow(lastSelectedEl);oSelf._sLastSelectedId=allRows[trIndex-1].id;}}
-else if(nKey==39){}
-else if(nKey==37){}}
-else{trIndex=lastSelectedEl.sectionRowIndex;if(nKey==40){oSelf.unselectAllRows();if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1];oSelf.selectRow(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectRow(lastSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}
-else if(nKey==38){oSelf.unselectAllRows();if(trIndex>0){newSelectedEl=allRows[trIndex-1];oSelf.selectRow(newSelectedEl);}
-else{newSelectedEl=lastSelectedEl;oSelf.selectRow(newSelectedEl);}
-oSelf._sSelectionAnchorId=newSelectedEl.id;}
-else if(nKey==39){}
-else if(nKey==37){}}}};YAHOO.widget.DataTable.prototype._onTableKeypress=function(e,oSelf){var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){var nKey=YAHOO.util.Event.getCharCode(e);if(nKey==40){YAHOO.util.Event.stopEvent(e);}
-else if(nKey==38){YAHOO.util.Event.stopEvent(e);}}};YAHOO.widget.DataTable.prototype._onTheadClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
-while(elTarget&&(elTag!="thead")){switch(elTag){case"body":break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});}
-break;case"th":oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});break;case"tr":oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableClickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTbodyClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
-while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"input":if(elTarget.type.toLowerCase()=="checkbox"){oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});}
-else if(elTarget.type.toLowerCase()=="radio"){oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});}
-break;case"a":oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});break;case"button":oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});break;case"td":oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});break;case"tr":oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});break;default:break;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
-oSelf.fireEvent("tableClickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onPaginatorLinkClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
-while(elTarget&&(elTag!="table")){switch(elTag){case"body":return;case"a":YAHOO.util.Event.stopEvent(e);switch(elTarget.className){case YAHOO.widget.DataTable.CLASS_PAGE:oSelf.showPage(parseInt(elTarget.innerHTML,10));return;case YAHOO.widget.DataTable.CLASS_FIRST:oSelf.showPage(1);return;case YAHOO.widget.DataTable.CLASS_LAST:oSelf.showPage(oSelf.get("paginator").totalPages);return;case YAHOO.widget.DataTable.CLASS_PREVIOUS:oSelf.showPage(oSelf.get("paginator").currentPage-1);return;case YAHOO.widget.DataTable.CLASS_NEXT:oSelf.showPage(oSelf.get("paginator").currentPage+1);return;}
-break;default:return;}
-elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}
-else{return;}}};YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var newValue=elTarget[elTarget.selectedIndex].value;var newRowsPerPage=YAHOO.lang.isValue(parseInt(newValue,10))?parseInt(newValue,10):null;if(newRowsPerPage!==null){var newStartRecordIndex=(oSelf.get("paginator").currentPage-1)*newRowsPerPage;oSelf.updatePaginator({rowsPerPage:newRowsPerPage,startRecordIndex:newStartRecordIndex});oSelf.refreshView();}
-else{}};YAHOO.widget.DataTable.prototype._onDropdownChange=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);oSelf.fireEvent("dropdownChangeEvent",{event:e,target:elTarget});};YAHOO.widget.DataTable.prototype.toString=function(){return"DataTable "+this._sName;};YAHOO.widget.DataTable.prototype.getDataSource=function(){return this._oDataSource;};YAHOO.widget.DataTable.prototype.getColumnSet=function(){return this._oColumnSet;};YAHOO.widget.DataTable.prototype.getRecordSet=function(){return this._oRecordSet;};YAHOO.widget.DataTable.prototype.getCellEditor=function(){return this._oCellEditor;};YAHOO.widget.DataTable.prototype.getTableEl=function(){return this._elTable;};YAHOO.widget.DataTable.prototype.getTheadEl=function(){return this._elThead;};YAHOO.widget.DataTable.prototype.getTbodyEl=function(){return this._elTbody;};YAHOO.widget.DataTable.prototype.getBody=function(){return this.getTbodyEl();};YAHOO.widget.DataTable.prototype.getMsgTbodyEl=function(){return this._elMsgTbody;};YAHOO.widget.DataTable.prototype.getMsgTdEl=function(){return this._elMsgTd;};YAHOO.widget.DataTable.prototype.getTrEl=function(row){var allRows=this._elTbody.rows;if(row instanceof YAHOO.widget.Record){var nTrIndex=this.getTrIndex(row);return allRows[nTrIndex];}
-else if(YAHOO.lang.isNumber(row)&&(row>-1)&&(row<allRows.length)){return allRows[row];}
-else{var elRow;var el=YAHOO.util.Dom.get(row);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="tr"){elRow=YAHOO.util.Dom.getAncestorByTagName(el,"tr");}
-else{elRow=el;}
-if(elRow&&(elRow.parentNode==this._elTbody)){return elRow;}}}
-return null;};YAHOO.widget.DataTable.prototype.getRow=function(index){return this.getTrEl(index);};YAHOO.widget.DataTable.prototype.getFirstTrEl=function(){return this._elTbody.rows[0]||null;};YAHOO.widget.DataTable.prototype.getLastTrEl=function(){var allRows=this._elTbody.rows;if(allRows.length>0){return allRows[allRows.length-1]||null;}};YAHOO.widget.DataTable.prototype.getTdEl=function(cell){var elCell;var el=YAHOO.util.Dom.get(cell);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="td"){elCell=YAHOO.util.Dom.getAncestorByTagName(el,"td");}
-else{elCell=el;}
-if(elCell&&(elCell.parentNode.parentNode==this._elTbody)){return elCell;}}
-return null;};YAHOO.widget.DataTable.prototype.getThEl=function(header){var elHeader;if(header instanceof YAHOO.widget.Column){var oColumn=header;elHeader=YAHOO.util.Dom.get(this.id+"-col"+oColumn.getId());if(elHeader){return elHeader;}}
-else{var el=YAHOO.util.Dom.get(header);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="th"){elHeader=YAHOO.util.Dom.getAncestorByTagName(el,"th");}
-else{elHeader=el;}
-if(elHeader&&(elHeader.parentNode.parentNode==this._elThead)){return elHeader;}}}
-return null;};YAHOO.widget.DataTable.prototype.getTrIndex=function(row){var nRecordIndex;if(row instanceof YAHOO.widget.Record){nRecordIndex=this._oRecordSet.getRecordIndex(row);}
-else if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
-if(YAHOO.lang.isNumber(nRecordIndex)){if(this.get("paginated")){var startRecordIndex=this.get("paginator").startRecordIndex;var endRecordIndex=startRecordIndex+this.get("paginator").rowsPerPage-1;if((nRecordIndex>=startRecordIndex)&&(nRecordIndex<=endRecordIndex)){return nRecordIndex-startRecordIndex;}
-else{return null;}}
-else{return nRecordIndex;}}
-else{elRow=this.getTrEl(row);if(elRow&&(elRow.ownerDocument==document)&&(elRow.parentNode==this._elTbody)){return elRow.sectionRowIndex;}}
-return null;};YAHOO.widget.DataTable.prototype.initializeTable=function(oData){this._oRecordSet.reset();var records=this._oRecordSet.addRecords(oData);this._unselectAllTrEls();this._unselectAllTdEls();this._aSelections=null;this._sLastSelectedId=null;this._sSelectionAnchorId=null;this.refreshView();this.fireEvent("initEvent");};YAHOO.widget.DataTable.prototype.refreshView=function(){var i,j,k,l,aRecords;var oPaginator=this.updatePaginator();if(this.get("paginated")){var rowsPerPage=oPaginator.rowsPerPage;var startRecordIndex=(oPaginator.currentPage-1)*rowsPerPage;aRecords=this._oRecordSet.getRecords(startRecordIndex,rowsPerPage);this.formatPaginators();}
-else{aRecords=this._oRecordSet.getRecords();}
-var elTbody=this._elTbody;var elRows=elTbody.rows;if(YAHOO.lang.isArray(aRecords)&&(aRecords.length>0)){this.hideTableMessage();var aSelectedRows=this.getSelectedRows();var aSelectedCells=this.getSelectedCells();var bReselect=(aSelectedRows.length>0)||(aSelectedCells.length>0);while(elTbody.hasChildNodes()&&(elRows.length>aRecords.length)){elTbody.deleteRow(-1);}
-if(bReselect){this._unselectAllTrEls();this._unselectAllTdEls();}
-for(i=0;i<elRows.length;i++){this._updateTrEl(elRows[i],aRecords[i]);}
-for(i=elRows.length;i<aRecords.length;i++){this._addTrEl(aRecords[i]);}
-var allRows=elTbody.rows;if(bReselect){for(j=0;j<allRows.length;j++){var thisRow=allRows[j];var sMode=this.get("selectionMode");if((sMode=="standard")||(sMode=="single")){for(k=0;k<aSelectedRows.length;k++){if(aSelectedRows[k]===thisRow.yuiRecordId){YAHOO.util.Dom.addClass(thisRow,YAHOO.widget.DataTable.CLASS_SELECTED);if(j===allRows.length-1){this._sLastSelectedId=thisRow.id;this._sSelectionAnchorId=thisRow.id;}}}}
-else{for(k=0;k<thisRow.cells.length;k++){var thisCell=thisRow.cells[k];for(l=0;l<aSelectedCells.length;l++){if((aSelectedCells[l].recordId===thisRow.yuiRecordId)&&(aSelectedCells[l].columnId===thisCell.yuiColumnId)){YAHOO.util.Dom.addClass(thisCell,YAHOO.widget.DataTable.CLASS_SELECTED);if(k===thisRow.cells.length-1){this._sLastSelectedId=thisCell.id;this._sSelectionAnchorId=thisCell.id;}}}}}}}
-this._setFirstRow();this._setLastRow();this._setRowStripes();this.fireEvent("refreshEvent");}
-else{while(elTbody.hasChildNodes()){elTbody.deleteRow(-1);}
-this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.destroy=function(){YAHOO.util.Event.purgeElement(this._oCellEditor.container,true);document.body.removeChild(this._oCellEditor.container);var instanceName=this.toString();var elContainer=this._elContainer;this._oRecordSet.unsubscribeAll();this.unsubscribeAll();YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var param in this){if(this.hasOwnProperty(param)){this[param]=null;}}};YAHOO.widget.DataTable.prototype.showTableMessage=function(sHTML,sClassName){var elCell=this._elMsgTd;if(YAHOO.lang.isString(sHTML)){elCell.innerHTML=sHTML;}
-if(YAHOO.lang.isString(sClassName)){YAHOO.util.Dom.addClass(elCell,sClassName);}
-this._elMsgTbody.style.display="";this.fireEvent("tableMsgShowEvent",{html:sHTML,className:sClassName});};YAHOO.widget.DataTable.prototype.hideTableMessage=function(){if(this._elMsgTbody.style.display!="none"){this._elMsgTbody.style.display="none";this.fireEvent("tableMsgHideEvent");}};YAHOO.widget.DataTable.prototype.focus=function(){this._focusEl(this._elTable);};YAHOO.widget.DataTable.prototype.getRecordIndex=function(row){var nTrIndex;if(!YAHOO.lang.isNumber(row)){if(row instanceof YAHOO.widget.Record){return this._oRecordSet.getRecordIndex(row);}
-else{var el=this.getTrEl(row);if(el){nTrIndex=el.sectionRowIndex;}}}
-else{nTrIndex=row;}
-if(YAHOO.lang.isNumber(nTrIndex)){if(this.get("paginated")){return this.get("paginator").startRecordIndex+nTrIndex;}
-else{return nTrIndex;}}
-return null;};YAHOO.widget.DataTable.prototype.getRecord=function(row){var nRecordIndex=row;if(!YAHOO.lang.isNumber(nRecordIndex)){var elRow=this.getTrEl(row);if(elRow){nRecordIndex=this.getRecordIndex(row);}}
-if(YAHOO.lang.isNumber(nRecordIndex)){return this._oRecordSet.getRecord(nRecordIndex);}
-return null;};YAHOO.widget.DataTable.prototype.getColumn=function(column){var nColumnIndex=column;if(!YAHOO.lang.isNumber(nColumnIndex)){var elCell=this.getTdEl(column);if(elCell){nColumnIndex=elCell.yuiColumnId;}
-else{elCell=this.getThEl(column);if(elCell){nColumnIndex=elCell.yuiColumnId;}}}
-if(YAHOO.lang.isNumber(nColumnIndex)){return this._oColumnSet.getColumn(nColumnIndex);}
-return null;};YAHOO.widget.DataTable.prototype.sortColumn=function(oColumn){if(!oColumn){return;}
-if(!oColumn instanceof YAHOO.widget.Column){return;}
-if(oColumn.sortable){var sortDir=(oColumn.sortOptions&&oColumn.sortOptions.defaultOrder)?oColumn.sortOptions.defaultOrder:"asc";var oSortedBy=this.get("sortedBy");if(oSortedBy&&(oSortedBy.key===oColumn.key)){if(oSortedBy.dir){sortDir=(oSortedBy.dir=="asc")?"desc":"asc";}
-else{sortDir=(sortDir=="asc")?"desc":"asc";}}
-var sortFnc=(oColumn.sortOptions&&YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction))?oColumn.sortOptions.sortFunction:function(a,b,desc){var sorted=YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key),desc);if(sorted===0){return YAHOO.util.Sort.compare(a.getId(),b.getId(),desc);}
-else{return sorted;}};var desc=(sortDir=="desc")?true:false;this._oRecordSet.sortRecords(sortFnc,desc);this.set("sortedBy",{key:oColumn.key,dir:sortDir,column:oColumn});this.updatePaginator({currentPage:1});this.refreshView();this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});}
-else{}};YAHOO.widget.DataTable.prototype.addRow=function(oData,index){if(oData&&(oData.constructor==Object)){var oRecord=this._oRecordSet.addRecord(oData,index);if(oRecord){var nTrIndex=this.getTrIndex(oRecord);if(YAHOO.lang.isNumber(nTrIndex)){if(this.get("paginated")){this.refreshView();}
-else{var newTrId=this._addTrEl(oRecord,nTrIndex);if(newTrId){var append=(YAHOO.lang.isNumber(nTrIndex)&&(nTrIndex==this._elTbody.rows.length-1))?true:false;if(append){if((this._elTbody.rows.length-1)%2){YAHOO.util.Dom.addClass(newTrId,YAHOO.widget.DataTable.CLASS_ODD);}
-else{YAHOO.util.Dom.addClass(newTrId,YAHOO.widget.DataTable.CLASS_EVEN);}}
-else{this._setRowStripes(nTrIndex);}
-if(append){this._setLastRow();}
-else if(YAHOO.lang.isNumber(index)&&(nTrIndex===0)){this._setFirstRow();}}}}
-else{this.updatePaginator();}
-this.fireEvent("rowAddEvent",{record:oRecord});nTrIndex=(YAHOO.lang.isValue(nTrIndex))?nTrIndex:"n/a";return;}}};YAHOO.widget.DataTable.prototype.addRows=function(aData,index){if(YAHOO.lang.isArray(aData)){var i;if(YAHOO.lang.isNumber(index)){for(i=aData.length-1;i>-1;i--){this.addRow(aData[i],index);}}
-else{for(i=0;i<aData.length;i++){this.addRow(aData[i]);}}}
-else{}};YAHOO.widget.DataTable.prototype.updateRow=function(row,oData){var oldRecord,updatedRecord,elRow;if((row instanceof YAHOO.widget.Record)||(YAHOO.lang.isNumber(row))){oldRecord=this._oRecordSet.getRecord(row);elRow=this.getTrEl(oldRecord);}
-else{elRow=this.getTrEl(row);if(elRow){oldRecord=this._oRecordSet.getRecord(this.getRecordIndex(elRow));}}
-if(oldRecord){var oRecordData=oldRecord.getData();var oldData={};for(var param in oRecordData){oldData[param]=oRecordData[param];}
-updatedRecord=this._oRecordSet.updateRecord(oldRecord,oData);}
-else{return;}
-if(elRow){this._updateTrEl(elRow,updatedRecord);}
-this.fireEvent("rowUpdateEvent",{record:updatedRecord,oldData:oldData});};YAHOO.widget.DataTable.prototype.deleteRow=function(row){var nRecordIndex=null;if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
-else{var elRow=YAHOO.util.Dom.get(row);elRow=this.getTrEl(elRow);if(elRow){nRecordIndex=this.getRecordIndex(elRow);}}
-if(nRecordIndex!==null){var oRecord=this._oRecordSet.getRecord(nRecordIndex);if(oRecord){var nRecordId=oRecord.getId();var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if((YAHOO.lang.isNumber(tracker[j])&&(tracker[j]===nRecordId))||((tracker[j].constructor==Object)&&(tracker[j].recordId===nRecordId))){tracker.splice(j,1);}}
-var oRecordData=oRecord.getData();var oData={};for(var param in oRecordData){oData[param]=oRecordData[param];}
-this._oRecordSet.deleteRecord(nRecordIndex);var nTrIndex=this.getTrIndex(nRecordIndex);if(YAHOO.lang.isNumber(nTrIndex)){var isLast=(nTrIndex==this.getLastTrEl().sectionRowIndex)?true:false;this._deleteTrEl(nTrIndex);if(this._elTbody.rows.length===0){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}
-else{if(nTrIndex===0){this._setFirstRow();}
-if(isLast){this._setLastRow();}
-if(nTrIndex!=this._elTbody.rows.length){this._setRowStripes(nTrIndex);}}}
-this.fireEvent("rowDeleteEvent",{recordIndex:nRecordIndex,oldData:oData,trElIndex:nTrIndex});}}
-else{}};YAHOO.widget.DataTable.prototype.deleteRows=function(row,count){var nRecordIndex=null;if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
-else{var elRow=YAHOO.util.Dom.get(row);elRow=this.getTrEl(elRow);if(elRow){nRecordIndex=this.getRecordIndex(elRow);}}
-if(nRecordIndex!==null){if(count&&YAHOO.lang.isNumber(count)){var startIndex=(count>0)?nRecordIndex+count-1:nRecordIndex;var endIndex=(count>0)?nRecordIndex:nRecordIndex+count+1;for(var i=startIndex;i>endIndex-1;i--){this.deleteRow(i);}}
-else{this.deleteRow(nRecordIndex);}}
-else{}};YAHOO.widget.DataTable.prototype.formatCell=function(elCell,oRecord,oColumn){if(!(oRecord instanceof YAHOO.widget.Record)){oRecord=this.getRecord(elCell);}
-if(!(oColumn instanceof YAHOO.widget.Column)){oColumn=this._oColumnSet.getColumn(elCell.yuiColumnId);}
-if(oRecord&&oColumn){var oData=oRecord.getData(oColumn.key);var fnFormatter;if(YAHOO.lang.isString(oColumn.formatter)){switch(oColumn.formatter){case"button":fnFormatter=YAHOO.widget.DataTable.formatButton;break;case"checkbox":fnFormatter=YAHOO.widget.DataTable.formatCheckbox;break;case"currency":fnFormatter=YAHOO.widget.DataTable.formatCurrency;break;case"date":fnFormatter=YAHOO.widget.DataTable.formatDate;break;case"dropdown":fnFormatter=YAHOO.widget.DataTable.formatDropdown;break;case"email":fnFormatter=YAHOO.widget.DataTable.formatEmail;break;case"link":fnFormatter=YAHOO.widget.DataTable.formatLink;break;case"number":fnFormatter=YAHOO.widget.DataTable.formatNumber;break;case"radio":fnFormatter=YAHOO.widget.DataTable.formatRadio;break;case"text":fnFormatter=YAHOO.widget.DataTable.formatText;break;case"textarea":fnFormatter=YAHOO.widget.DataTable.formatTextarea;break;case"textbox":fnFormatter=YAHOO.widget.DataTable.formatTextbox;break;case"html":break;default:fnFormatter=null;}}
-else if(YAHOO.lang.isFunction(oColumn.formatter)){fnFormatter=oColumn.formatter;}
-if(fnFormatter){fnFormatter.call(this,elCell,oRecord,oColumn,oData);}
-else{elCell.innerHTML=(YAHOO.lang.isValue(oData))?oData.toString():"";}
-var aCustomClasses=null;if(YAHOO.lang.isString(oColumn.className)){aCustomClasses=[oColumn.className];}
-else if(YAHOO.lang.isArray(oColumn.className)){aCustomClasses=oColumn.className;}
-if(aCustomClasses){for(var i=0;i<aCustomClasses.length;i++){YAHOO.util.Dom.addClass(elCell,aCustomClasses[i]);}}
-YAHOO.util.Dom.addClass(elCell,"yui-dt-col-"+oColumn.key);if(oColumn.editor){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);}
-this.fireEvent("cellFormatEvent",{record:oRecord,key:oColumn.key,el:elCell});}
-else{}};YAHOO.widget.DataTable.formatButton=function(el,oRecord,oColumn,oData){var sValue=YAHOO.lang.isValue(oData)?oData:"Click";el.innerHTML="<button type=\"button\" class=\""+
-YAHOO.widget.DataTable.CLASS_BUTTON+"\">"+sValue+"</button>";};YAHOO.widget.DataTable.formatCheckbox=function(el,oRecord,oColumn,oData){var bChecked=oData;bChecked=(bChecked)?" checked":"";el.innerHTML="<input type=\"checkbox\""+bChecked+" class=\""+YAHOO.widget.DataTable.CLASS_CHECKBOX+"\">";};YAHOO.widget.DataTable.formatCurrency=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isNumber(oData)){var nAmount=oData;var markup;nAmount=Math.round(nAmount*100)/100;markup="$"+nAmount;var dotIndex=markup.indexOf(".");if(dotIndex<0){markup+=".00";}
-else{while(dotIndex>markup.length-3){markup+="0";}}
-el.innerHTML=markup;}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatDate=function(el,oRecord,oColumn,oData){var oDate=oData;if(oDate instanceof Date){el.innerHTML=(oDate.getMonth()+1)+"/"+oDate.getDate()+"/"+oDate.getFullYear();}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatDropdown=function(el,oRecord,oColumn,oData){var selectedValue=(YAHOO.lang.isValue(oData))?oData:oRecord.getData(oColumn.key);var options=(YAHOO.lang.isArray(oColumn.dropdownOptions))?oColumn.dropdownOptions:null;var selectEl;var collection=el.getElementsByTagName("select");if(collection.length===0){selectEl=document.createElement("select");YAHOO.util.Dom.addClass(selectEl,YAHOO.widget.DataTable.CLASS_DROPDOWN);selectEl=el.appendChild(selectEl);YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);}
-selectEl=collection[0];if(selectEl){selectEl.innerHTML="";if(options){for(var i=0;i<options.length;i++){var option=options[i];var optionEl=document.createElement("option");optionEl.value=(YAHOO.lang.isValue(option.value))?option.value:option;optionEl.innerHTML=(YAHOO.lang.isValue(option.text))?option.text:option;optionEl=selectEl.appendChild(optionEl);}}
-else{selectEl.innerHTML="<option value=\""+selectedValue+"\">"+selectedValue+"</option>";}}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatEmail=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isString(oData)){el.innerHTML="<a href=\"mailto:"+oData+"\">"+oData+"</a>";}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatLink=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isString(oData)){el.innerHTML="<a href=\""+oData+"\">"+oData+"</a>";}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatNumber=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isNumber(oData)){el.innerHTML=oData;}
-else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatRadio=function(el,oRecord,oColumn,oData){var bChecked=oData;bChecked=(bChecked)?" checked":"";el.innerHTML="<input type=\"radio\""+bChecked+" name=\""+oColumn.getId()+"-radio\""+" class=\""+YAHOO.widget.DataTable.CLASS_CHECKBOX+"\">";};YAHOO.widget.DataTable.formatText=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";el.innerHTML=value.toString().replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");};YAHOO.widget.DataTable.formatTextarea=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";var markup="<textarea>"+value+"</textarea>";el.innerHTML=markup;};YAHOO.widget.DataTable.formatTextbox=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";var markup="<input type=\"text\" value=\""+value+"\">";el.innerHTML=markup;};YAHOO.widget.DataTable.prototype.updatePaginator=function(oNewValues){var oValidPaginator=this.get("paginator");for(var param in oNewValues){if(oValidPaginator.hasOwnProperty(param)){oValidPaginator[param]=oNewValues[param];}}
-oValidPaginator.totalRecords=this._oRecordSet.getLength();oValidPaginator.rowsThisPage=Math.min(oValidPaginator.rowsPerPage,oValidPaginator.totalRecords);oValidPaginator.totalPages=Math.ceil(oValidPaginator.totalRecords/oValidPaginator.rowsThisPage);if(isNaN(oValidPaginator.totalPages)){oValidPaginator.totalPages=0;}
-this.set("paginator",oValidPaginator);return this.get("paginator");};YAHOO.widget.DataTable.prototype.showPage=function(nPage){if(!YAHOO.lang.isNumber(nPage)||(nPage<1)||(nPage>this.get("paginator").totalPages)){nPage=1;}
-this.updatePaginator({currentPage:nPage});this.refreshView();};YAHOO.widget.DataTable.prototype.formatPaginators=function(){var pag=this.get("paginator");var dropdownEnabled=false;if(pag.pageLinks>-1){for(var i=0;i<pag.links.length;i++){this.formatPaginatorLinks(pag.links[i],pag.currentPage,pag.pageLinksStart,pag.pageLinks,pag.totalPages);}}
-for(i=0;i<pag.dropdowns.length;i++){if(pag.dropdownOptions){dropdownEnabled=true;this.formatPaginatorDropdown(pag.dropdowns[i],pag.dropdownOptions);}
-else{pag.dropdowns[i].style.display="none";}}
-if(dropdownEnabled&&navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+='';}};YAHOO.widget.DataTable.prototype.formatPaginatorDropdown=function(elDropdown,dropdownOptions){if(elDropdown&&(elDropdown.ownerDocument==document)){while(elDropdown.firstChild){elDropdown.removeChild(elDropdown.firstChild);}
-for(var j=0;j<dropdownOptions.length;j++){var dropdownOption=dropdownOptions[j];var optionEl=document.createElement("option");optionEl.value=(YAHOO.lang.isValue(dropdownOption.value))?dropdownOption.value:dropdownOption;optionEl.innerHTML=(YAHOO.lang.isValue(dropdownOption.text))?dropdownOption.text:dropdownOption;optionEl=elDropdown.appendChild(optionEl);}
-var options=elDropdown.options;if(options.length){for(var i=options.length-1;i>-1;i--){if((this.get("paginator").rowsPerPage+"")===options[i].value){options[i].selected=true;}}}
-elDropdown.style.display="";return;}};YAHOO.widget.DataTable.prototype.formatPaginatorLinks=function(elContainer,nCurrentPage,nPageLinksStart,nPageLinksLength,nTotalPages){if(elContainer&&(elContainer.ownerDocument==document)&&YAHOO.lang.isNumber(nCurrentPage)&&YAHOO.lang.isNumber(nPageLinksStart)&&YAHOO.lang.isNumber(nTotalPages)){var bIsFirstPage=(nCurrentPage==1)?true:false;var bIsLastPage=(nCurrentPage==nTotalPages)?true:false;var sFirstLinkMarkup=(bIsFirstPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_FIRST+"\">&lt;&lt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_FIRST+"\">&lt;&lt;</a> ";var sPrevLinkMarkup=(bIsFirstPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_PREVIOUS+"\">&lt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_PREVIOUS+"\">&lt;</a> ";var sNextLinkMarkup=(bIsLastPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_NEXT+"\">&gt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_NEXT+"\">&gt;</a> ";var sLastLinkMarkup=(bIsLastPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_LAST+"\">&gt;&gt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_LAST+"\">&gt;&gt;</a> ";var sMarkup=sFirstLinkMarkup+sPrevLinkMarkup;var nMaxLinks=nTotalPages;var nFirstLink=1;var nLastLink=nTotalPages;if(nPageLinksLength>0){nMaxLinks=(nPageLinksStart+nPageLinksLength<nTotalPages)?nPageLinksStart+nPageLinksLength-1:nTotalPages;nFirstLink=(nCurrentPage-Math.floor(nMaxLinks/2)>0)?nCurrentPage-Math.floor(nMaxLinks/2):1;nLastLink=(nCurrentPage+Math.floor(nMaxLinks/2)<=nTotalPages)?nCurrentPage+Math.floor(nMaxLinks/2):nTotalPages;if(nFirstLink===1){nLastLink=nMaxLinks;}
-else if(nLastLink===nTotalPages){nFirstLink=nTotalPages-nMaxLinks+1;}
-if(nLastLink-nFirstLink===nMaxLinks){nLastLink--;}}
-for(var i=nFirstLink;i<=nLastLink;i++){if(i!=nCurrentPage){sMarkup+=" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_PAGE+"\">"+i+"</a> ";}
-else{sMarkup+=" <span class=\""+YAHOO.widget.DataTable.CLASS_SELECTED+"\">"+i+"</span>";}}
-sMarkup+=sNextLinkMarkup+sLastLinkMarkup;elContainer.innerHTML=sMarkup;return;}};YAHOO.widget.DataTable.prototype._sLastHighlightedCellId=null;YAHOO.widget.DataTable.prototype._sLastHighlightedRowId=null;YAHOO.widget.DataTable.prototype._aSelections=null;YAHOO.widget.DataTable.prototype._sLastSelectedId=null;YAHOO.widget.DataTable.prototype._sSelectionAnchorId=null;YAHOO.widget.DataTable.prototype._unselectAllTrEls=function(){var selectedRows=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);YAHOO.util.Dom.removeClass(selectedRows,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedTrEls=function(){return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);};YAHOO.widget.DataTable.prototype.selectRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);if(oRecord){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();if(tracker.indexOf&&(tracker.indexOf(nRecordId)>-1)){tracker.splice(tracker.indexOf(nRecordId),1);}
-else{for(var j=0;j<tracker.length;j++){if(tracker[j]===nRecordId){tracker.splice(j,1);}}}
-tracker.push(nRecordId);this._sLastSelectedId=elRow.id;if(!this._sSelectionAnchorId){this._sSelectionAnchorId=elRow.id;}
-this._aSelections=tracker;YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("rowSelectEvent",{record:oRecord,el:elRow});return;}}};YAHOO.widget.DataTable.prototype.select=function(els){if(!YAHOO.lang.isArray(els)){els=[els];}
-for(var i=0;i<els.length;i++){this.selectRow(els[i]);}};YAHOO.widget.DataTable.prototype.unselectRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);if(oRecord){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();var bFound=false;if(tracker.indexOf&&(tracker.indexOf(nRecordId)>-1)){tracker.splice(tracker.indexOf(nRecordId),1);bFound=true;}
-else{for(var j=0;j<tracker.length;j++){if(tracker[j]===nRecordId){tracker.splice(j,1);bFound=true;}}}
-if(bFound){this._aSelections=tracker;YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("rowUnselectEvent",{record:oRecord,el:elRow});return;}}}};YAHOO.widget.DataTable.prototype.unselectAllRows=function(){var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(YAHOO.lang.isNumber(tracker[j])){tracker.splice(j,1);}}
-this._aSelections=tracker;this._unselectAllTrEls();this.fireEvent("unselectAllRowsEvent");};YAHOO.widget.DataTable.prototype._unselectAllTdEls=function(){var selectedCells=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);YAHOO.util.Dom.removeClass(selectedCells,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedTdEls=function(){return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);};YAHOO.widget.DataTable.prototype.selectCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);var nColumnId=elCell.yuiColumnId;if(oRecord&&YAHOO.lang.isNumber(nColumnId)){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();for(var j=0;j<tracker.length;j++){if((tracker[j].recordId===nRecordId)&&(tracker[j].columnId===nColumnId)){tracker.splice(j,1);}}
-tracker.push({recordId:nRecordId,columnId:nColumnId});this._aSelections=tracker;this._sLastSelectedId=elCell.id;if(!this._sSelectionAnchorId){this._sSelectionAnchorId=elCell.id;}
-YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("cellSelectEvent",{record:oRecord,key:this._oColumnSet.getColumn(nColumnId).key,el:elCell});return;}}};YAHOO.widget.DataTable.prototype.unselectCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);var nColumnId=elCell.yuiColumnId;if(oRecord&&YAHOO.lang.isNumber(nColumnId)){var tracker=this._aSelections||[];var id=oRecord.getId();for(var j=0;j<tracker.length;j++){if((tracker[j].recordId===id)&&(tracker[j].columnId===nColumnId)){tracker.splice(j,1);this._aSelections=tracker;YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("cellUnselectEvent",{record:oRecord,key:this._oColumnSet.getColumn(nColumnId).key,el:elCell});return;}}}}};YAHOO.widget.DataTable.prototype.unselectAllCells=function(){var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(tracker[j].constructor==Object){tracker.splice(j,1);}}
-this._aSelections=tracker;this._unselectAllTdEls();this.fireEvent("unselectAllCellsEvent");};YAHOO.widget.DataTable.prototype.isSelected=function(el){return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedRows=function(){var aSelectedRows=[];var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(YAHOO.lang.isNumber(tracker[j])){aSelectedRows.push(tracker[j]);}}
-return aSelectedRows;};YAHOO.widget.DataTable.prototype.getSelectedCells=function(){var aSelectedCells=[];var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(tracker[j]&&(tracker[j].constructor==Object)){aSelectedCells.push({recordId:tracker[j].recordId,columnId:tracker[j].columnId});}}
-return aSelectedCells;};YAHOO.widget.DataTable.prototype.highlightRow=function(row){var elRow=this.getTrEl(row);if(elRow){if(this._sLastHighlightedRowId){YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);}
-var oRecord=this.getRecord(elRow);YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this._sLastHighlightedRowId=elRow.id;this.fireEvent("rowHighlightEvent",{record:oRecord,el:elRow});return;}};YAHOO.widget.DataTable.prototype.unhighlightRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this.fireEvent("rowUnhighlightEvent",{record:oRecord,el:elRow});return;}};YAHOO.widget.DataTable.prototype.highlightCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){if(this._sLastHighlightedCellId){YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);}
-var oRecord=this.getRecord(elCell);YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this._sLastHighlightedCellId=elCell.id;this.fireEvent("cellHighlightEvent",{record:oRecord,key:this._oColumnSet.getColumn(elCell.yuiColumnId).key,el:elCell});return;}};YAHOO.widget.DataTable.prototype.unhighlightCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this.fireEvent("cellUnhighlightEvent",{record:oRecord,key:this._oColumnSet.getColumn(elCell.yuiColumnId).key,el:elCell});return;}};YAHOO.widget.DataTable.prototype.showCellEditor=function(elCell,oRecord,oColumn){elCell=YAHOO.util.Dom.get(elCell);if(elCell&&(elCell.ownerDocument===document)){if(!oRecord||!(oRecord instanceof YAHOO.widget.Record)){oRecord=this.getRecord(elCell);}
-if(!oColumn||!(oColumn instanceof YAHOO.widget.Column)){oColumn=this.getColumn(elCell);}
-if(oRecord&&oColumn){var oCellEditor=this._oCellEditor;if(oCellEditor.isActive){this.cancelCellEditor();}
-if(!oColumn.editor){return;}
-oCellEditor.cell=elCell;oCellEditor.record=oRecord;oCellEditor.column=oColumn;oCellEditor.validator=(oColumn.editorOptions&&YAHOO.lang.isFunction(oColumn.editorOptions.validator))?oColumn.editorOptions.validator:null;oCellEditor.value=oRecord.getData(oColumn.key);var elContainer=oCellEditor.container;var x=YAHOO.util.Dom.getX(elCell);var y=YAHOO.util.Dom.getY(elCell);if(isNaN(x)||isNaN(y)){x=elCell.offsetLeft+
-YAHOO.util.Dom.getX(this._elTable)-
-this._elTbody.scrollLeft;y=elCell.offsetTop+
-YAHOO.util.Dom.getY(this._elTable)-
-this._elTbody.scrollTop+
-this._elThead.offsetHeight;}
-elContainer.style.left=x+"px";elContainer.style.top=y+"px";elContainer.style.display="";var fnEditor;if(YAHOO.lang.isString(oColumn.editor)){switch(oColumn.editor){case"checkbox":fnEditor=YAHOO.widget.DataTable.editCheckbox;break;case"date":fnEditor=YAHOO.widget.DataTable.editDate;break;case"dropdown":fnEditor=YAHOO.widget.DataTable.editDropdown;break;case"radio":fnEditor=YAHOO.widget.DataTable.editRadio;break;case"textarea":fnEditor=YAHOO.widget.DataTable.editTextarea;break;case"textbox":fnEditor=YAHOO.widget.DataTable.editTextbox;break;default:fnEditor=null;}}
-else if(YAHOO.lang.isFunction(oColumn.editor)){fnEditor=oColumn.editor;}
-if(fnEditor){fnEditor(this._oCellEditor,this);if(!oColumn.editorOptions||!oColumn.editorOptions.disableBtns){this.showCellEditorBtns(elContainer);}
-this.doBeforeShowCellEditor(this._oCellEditor);oCellEditor.isActive=true;this.fireEvent("editorShowEvent",{editor:oCellEditor});return;}}}};YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor=function(oCellEditor){};YAHOO.widget.DataTable.prototype.showCellEditorBtns=function(elContainer){var elBtnsDiv=elContainer.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(elBtnsDiv,YAHOO.widget.DataTable.CLASS_BUTTON);var elSaveBtn=elBtnsDiv.appendChild(document.createElement("button"));YAHOO.util.Dom.addClass(elSaveBtn,YAHOO.widget.DataTable.CLASS_DEFAULT);elSaveBtn.innerHTML="OK";YAHOO.util.Event.addListener(elSaveBtn,"click",this.saveCellEditor,this,true);var elCancelBtn=elBtnsDiv.appendChild(document.createElement("button"));elCancelBtn.innerHTML="Cancel";YAHOO.util.Event.addListener(elCancelBtn,"click",this.cancelCellEditor,this,true);};YAHOO.widget.DataTable.prototype.resetCellEditor=function(){var elContainer=this._oCellEditor.container;elContainer.style.display="none";YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";this._oCellEditor.value=null;this._oCellEditor.isActive=false;};YAHOO.widget.DataTable.prototype.saveCellEditor=function(){if(this._oCellEditor.isActive){var newData=this._oCellEditor.value;var oldData=this._oCellEditor.record.getData(this._oCellEditor.column.key);if(this._oCellEditor.validator){this._oCellEditor.value=this._oCellEditor.validator.call(this,newData,oldData);if(this._oCellEditor.value===null){this.resetCellEditor();this.fireEvent("editorRevertEvent",{editor:this._oCellEditor,oldData:oldData,newData:newData});return;}}
-this._oRecordSet.updateKey(this._oCellEditor.record,this._oCellEditor.column.key,this._oCellEditor.value);this.formatCell(this._oCellEditor.cell);this.resetCellEditor();this.fireEvent("editorSaveEvent",{editor:this._oCellEditor,oldData:oldData,newData:newData});}
-else{}};YAHOO.widget.DataTable.prototype.cancelCellEditor=function(){if(this._oCellEditor.isActive){this.resetCellEditor();this.fireEvent("editorCancelEvent",{editor:this._oCellEditor});}
-else{}};YAHOO.widget.DataTable.editCheckbox=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var aCheckedValues=oRecord.getData(oColumn.key);if(!YAHOO.lang.isArray(aCheckedValues)){aCheckedValues=[aCheckedValues];}
-if(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)){var checkboxOptions=oColumn.editorOptions.checkboxOptions;var checkboxValue,checkboxId,elLabel,j,k;for(j=0;j<checkboxOptions.length;j++){checkboxValue=YAHOO.lang.isValue(checkboxOptions[j].label)?checkboxOptions[j].label:checkboxOptions[j];checkboxId=oSelf.id+"-editor-checkbox"+j;elContainer.innerHTML+="<input type=\"checkbox\""+" name=\""+oSelf.id+"-editor-checkbox\""+" value=\""+checkboxValue+"\""+" id=\""+checkboxId+"\">";elLabel=elContainer.appendChild(document.createElement("label"));elLabel.htmlFor=checkboxId;elLabel.innerHTML=checkboxValue;}
-var aCheckboxEls=[];var checkboxEl;for(j=0;j<checkboxOptions.length;j++){checkboxEl=YAHOO.util.Dom.get(oSelf.id+"-editor-checkbox"+j);aCheckboxEls.push(checkboxEl);for(k=0;k<aCheckedValues.length;k++){if(checkboxEl.value===aCheckedValues[k]){checkboxEl.checked=true;}}
-if(j===0){oSelf._focusEl(checkboxEl);}}
-for(j=0;j<checkboxOptions.length;j++){checkboxEl=YAHOO.util.Dom.get(oSelf.id+"-editor-checkbox"+j);YAHOO.util.Event.addListener(checkboxEl,"click",function(){var aNewValues=[];for(var m=0;m<aCheckboxEls.length;m++){if(aCheckboxEls[m].checked){aNewValues.push(aCheckboxEls[m].value);}}
-oSelf._oCellEditor.value=aNewValues;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});}}};YAHOO.widget.DataTable.editDate=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);if(YAHOO.widget.Calendar){var selectedValue=(value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();var calContainer=elContainer.appendChild(document.createElement("div"));calContainer.id="yui-dt-"+oSelf._nIndex+"-col"+oColumn.getKeyIndex()+"-dateContainer";var calendar=new YAHOO.widget.Calendar("yui-dt-"+oSelf._nIndex+"-col"+oColumn.getKeyIndex()+"-date",calContainer.id,{selected:selectedValue,pagedate:value});calendar.render();calContainer.style.cssFloat="none";calendar.selectEvent.subscribe(function(type,args,obj){oSelf._oCellEditor.value=new Date(args[0][0][0],args[0][0][1]-1,args[0][0][2]);});oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});}
-else{}};YAHOO.widget.DataTable.editDropdown=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);var elDropdown=elContainer.appendChild(document.createElement("select"));var dropdownOptions=(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions))?oColumn.editorOptions.dropdownOptions:[];for(var j=0;j<dropdownOptions.length;j++){var dropdownOption=dropdownOptions[j];var elOption=document.createElement("option");elOption.value=(YAHOO.lang.isValue(dropdownOption.value))?dropdownOption.value:dropdownOption;elOption.innerHTML=(YAHOO.lang.isValue(dropdownOption.text))?dropdownOption.text:dropdownOption;elOption=elDropdown.appendChild(elOption);if(value===elDropdown.options[j].value){elDropdown.options[j].selected=true;}}
-YAHOO.util.Event.addListener(elDropdown,"change",function(){oSelf._oCellEditor.value=elDropdown[elDropdown.selectedIndex].value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});oSelf._focusEl(elDropdown);};YAHOO.widget.DataTable.editRadio=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);if(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)){var radioOptions=oColumn.editorOptions.radioOptions;var radioValue,radioId,elLabel,j;for(j=0;j<radioOptions.length;j++){radioValue=YAHOO.lang.isValue(radioOptions[j].label)?radioOptions[j].label:radioOptions[j];radioId=oSelf.id+"-editor-radio"+j;elContainer.innerHTML+="<input type=\"radio\""+" name=\""+oSelf.id+"-editor-radio\""+" value=\""+radioValue+"\""+" id=\""+radioId+"\">";elLabel=elContainer.appendChild(document.createElement("label"));elLabel.htmlFor=radioId;elLabel.innerHTML=radioValue;}
-for(j=0;j<radioOptions.length;j++){var radioEl=YAHOO.util.Dom.get(oSelf.id+"-editor-radio"+j);if(value===radioEl.value){radioEl.checked=true;oSelf._focusEl(radioEl);}
-YAHOO.util.Event.addListener(radioEl,"click",function(){oSelf._oCellEditor.value=this.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});}}};YAHOO.widget.DataTable.editTextarea=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);var elTextarea=elContainer.appendChild(document.createElement("textarea"));elTextarea.style.width=elCell.offsetWidth+"px";elTextarea.style.height="3em";elTextarea.value=YAHOO.lang.isValue(value)?value:"";YAHOO.util.Event.addListener(elTextarea,"keyup",function(){oSelf._oCellEditor.value=elTextarea.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});elTextarea.focus();elTextarea.select();};YAHOO.widget.DataTable.editTextbox=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=YAHOO.lang.isValue(oRecord.getData(oColumn.key))?oRecord.getData(oColumn.key):"";var elTextbox=elContainer.appendChild(document.createElement("input"));elTextbox.type="text";elTextbox.style.width=elCell.offsetWidth+"px";elTextbox.value=value;YAHOO.util.Event.addListener(elTextbox,"keyup",function(){oSelf._oCellEditor.value=elTextbox.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});elTextbox.focus();elTextbox.select();};YAHOO.widget.DataTable.validateNumber=function(oData){var number=oData*1;if(YAHOO.lang.isNumber(number)){return number;}
-else{return null;}};YAHOO.widget.DataTable.prototype.doBeforeLoadData=function(sRequest,oResponse){return true;};YAHOO.widget.DataTable.prototype.onEventSortColumn=function(oArgs){var evt=oArgs.event;var target=oArgs.target;YAHOO.util.Event.stopEvent(evt);var el=this.getThEl(target)||this.getTdEl(target);if(el&&YAHOO.lang.isNumber(el.yuiColumnId)){this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));}
-else{}};YAHOO.widget.DataTable.prototype.onEventSelectRow=function(oArgs){var sMode=this.get("selectionMode");if((sMode=="singlecell")||(sMode=="cellblock")||(sMode=="cellrange")){return;}
-var evt=oArgs.event;var elTarget=oArgs.target;var bSHIFT=evt.shiftKey;var bCTRL=evt.ctrlKey;var i,nAnchorTrIndex;var elTargetRow=this.getTrEl(elTarget);if(elTargetRow){var allRows=this._elTbody.rows;var nTargetTrIndex=elTargetRow.sectionRowIndex;var elAnchorRow=YAHOO.util.Dom.get(this._sSelectionAnchorId);if((sMode!="single")&&bSHIFT&&bCTRL){if(elAnchorRow&&YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)){nAnchorTrIndex=elAnchorRow.sectionRowIndex;if(this.isSelected(elAnchorRow)){if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex+1;i<=nTargetTrIndex;i++){if(!this.isSelected(allRows[i])){this.selectRow(allRows[i]);}}}
-else{for(i=nAnchorTrIndex-1;i>=nTargetTrIndex;i--){if(!this.isSelected(allRows[i])){this.selectRow(allRows[i]);}}}}
-else{if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex+1;i<=nTargetTrIndex-1;i++){if(this.isSelected(allRows[i])){this.unselectRow(allRows[i]);}}}
-else{for(i=nTargetTrIndex+1;i<=nAnchorTrIndex-1;i++){if(this.isSelected(allRows[i])){this.unselectRow(allRows[i]);}}}
-this.selectRow(elTargetRow);}}
-else{this._sSelectionAnchorId=elTargetRow.id;if(this.isSelected(elTargetRow)){this.unselectRow(elTargetRow);}
-else{this.selectRow(elTargetRow);}}}
-else if((sMode!="single")&&bSHIFT){this.unselectAllRows();if(elAnchorRow&&YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)){nAnchorTrIndex=elAnchorRow.sectionRowIndex;if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){this.selectRow(allRows[i]);}}
-else{for(i=nAnchorTrIndex;i>=nTargetTrIndex;i--){this.selectRow(allRows[i]);}}}
-else{this._sSelectionAnchorId=elTargetRow.id;this.selectRow(elTargetRow);}}
-else if((sMode!="single")&&bCTRL){this._sSelectionAnchorId=elTargetRow.id;if(this.isSelected(elTargetRow)){this.unselectRow(elTargetRow);}
-else{this.selectRow(elTargetRow);}}
-else if(sMode=="single"){this.unselectAllRows();this.selectRow(elTargetRow);}
-else{this._sSelectionAnchorId=elTargetRow.id;this.unselectAllRows();this.selectRow(elTargetRow);}
-YAHOO.util.Event.stopEvent(evt);var sel;if(window.getSelection){sel=window.getSelection();}
-else if(document.getSelection){sel=document.getSelection();}
-else if(document.selection){sel=document.selection;}
-if(sel){if(sel.empty){sel.empty();}
-else if(sel.removeAllRanges){sel.removeAllRanges();}
-else if(sel.collapse){sel.collapse();}}}
-else{}};YAHOO.widget.DataTable.prototype.onEventSelectCell=function(oArgs){var sMode=this.get("selectionMode");if((sMode=="standard")||(sMode=="single")){return;}
-var evt=oArgs.event;var elTarget=oArgs.target;var bSHIFT=evt.shiftKey;var bCTRL=evt.ctrlKey;var i,j,nAnchorTrIndex,nAnchorTdIndex,currentRow,startIndex,endIndex;var elTargetCell=this.getTdEl(elTarget);if(elTargetCell){var elTargetRow=this.getTrEl(elTargetCell);var allRows=this._elTbody.rows;var nTargetTrIndex=elTargetRow.sectionRowIndex;var nTargetTdIndex=elTarget.yuiCellIndex;var elAnchorCell=YAHOO.util.Dom.get(this._sSelectionAnchorId);if((sMode!="singlecell")&&bSHIFT&&bCTRL){if(elAnchorCell&&YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)){nAnchorTrIndex=elAnchorCell.parentNode.sectionRowIndex;nAnchorTdIndex=elAnchorCell.yuiCellIndex;if(this.isSelected(elAnchorCell)){if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex+1;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
-else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex;i<nAnchorTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}}
-else if(nAnchorTrIndex<nTargetTrIndex){if(sMode=="cellrange"){for(i=nAnchorTdIndex+1;i<allRows[nAnchorTrIndex].cells.length;i++){this.selectCell(allRows[nAnchorTrIndex].cells[i]);}
-for(i=nAnchorTrIndex+1;i<nTargetTrIndex;i++){for(j=0;j<allRows[i].cells.length;j++){this.selectCell(allRows[i].cells[j]);}}
-for(i=0;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
-else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}}}
-else{if(sMode=="cellrange"){for(i=nTargetTdIndex;i<allRows[nTargetTrIndex].cells.length;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}
-for(i=nTargetTrIndex+1;i<nAnchorTrIndex;i++){for(j=0;j<allRows[i].cells.length;j++){this.selectCell(allRows[i].cells[j]);}}
-for(i=0;i<nAnchorTdIndex;i++){this.selectCell(allRows[nAnchorTrIndex].cells[i]);}}
-else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i>=nTargetTrIndex;i--){for(j=endIndex;j>=startIndex;j--){this.selectCell(allRows[i].cells[j]);}}}}}
-else{if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex+1;i<nTargetTdIndex;i++){this.unselectCell(allRows[nTargetTrIndex].cells[i]);}}
-else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex+1;i<nAnchorTdIndex;i++){this.unselectCell(allRows[nTargetTrIndex].cells[i]);}}}
-if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j>nAnchorTdIndex){this.unselectCell(currentRow.cells[j]);}}
-else if(currentRow.sectionRowIndex==nTargetTrIndex){if(j<nTargetTdIndex){this.unselectCell(currentRow.cells[j]);}}
-else{this.unselectCell(currentRow.cells[j]);}}}}
-else{for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nTargetTrIndex){if(j>nTargetTdIndex){this.unselectCell(currentRow.cells[j]);}}
-else if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j<nAnchorTdIndex){this.unselectCell(currentRow.cells[j]);}}
-else{this.unselectCell(currentRow.cells[j]);}}}}
-this.selectCell(elTargetCell);}}
-else{this._sSelectionAnchorId=elTargetCell.id;if(this.isSelected(elTargetCell)){this.unselectCell(elTargetCell);}
-else{this.selectCell(elTargetCell);}}}
-else if((sMode!="singlecell")&&bSHIFT){this.unselectAllCells();if(elAnchorCell&&YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)){nAnchorTrIndex=elAnchorCell.parentNode.sectionRowIndex;nAnchorTdIndex=elAnchorCell.yuiCellIndex;if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
-else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex;i<=nAnchorTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}}
-else if(nAnchorTrIndex<nTargetTrIndex){if(sMode=="cellrange"){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j>=nAnchorTdIndex){this.selectCell(currentRow.cells[j]);}}
-else if(currentRow.sectionRowIndex==nTargetTrIndex){if(j<=nTargetTdIndex){this.selectCell(currentRow.cells[j]);}}
-else{this.selectCell(currentRow.cells[j]);}}}}
-else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}
-this._sLastSelectedId=allRows[nTargetTrIndex].cells[nTargetTdIndex].id;}}
-else{if(sMode=="cellrange"){for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nTargetTrIndex){if(j>=nTargetTdIndex){this.selectCell(currentRow.cells[j]);}}
-else if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j<=nAnchorTdIndex){this.selectCell(currentRow.cells[j]);}}
-else{this.selectCell(currentRow.cells[j]);}}}}
-else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}
-this._sLastSelectedId=allRows[nTargetTrIndex].cells[nTargetTdIndex].id;}}}
-else{this._sSelectionAnchorId=elTargetCell.id;this.selectCell(elTargetCell);}}
-else if((sMode!="singlecell")&&bCTRL){this._sSelectionAnchorId=elTargetCell.id;if(this.isSelected(elTargetCell)){this.unselectCell(elTargetCell);}
-else{this.selectCell(elTargetCell);}}
-else{this._sSelectionAnchorId=elTargetCell.id;this.unselectAllCells();this.selectCell(elTargetCell);}
-YAHOO.util.Event.stopEvent(evt);var sel;if(window.getSelection){sel=window.getSelection();}
-else if(document.getSelection){sel=document.getSelection();}
-else if(document.selection){sel=document.selection;}
-if(sel){if(sel.empty){sel.empty();}
-else if(sel.removeAllRanges){sel.removeAllRanges();}
-else if(sel.collapse){sel.collapse();}}}
-else{}};YAHOO.widget.DataTable.prototype.onEventHighlightRow=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.highlightRow(elTarget);};YAHOO.widget.DataTable.prototype.onEventUnhighlightRow=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.unhighlightRow(elTarget);};YAHOO.widget.DataTable.prototype.onEventHighlightCell=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.highlightCell(elTarget);};YAHOO.widget.DataTable.prototype.onEventUnhighlightCell=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.unhighlightCell(elTarget);};YAHOO.widget.DataTable.prototype.onEventFormatCell=function(oArgs){var evt=oArgs.event;var target=oArgs.target;var elTag=target.tagName.toLowerCase();var elCell=this.getTdEl(target);if(elCell&&YAHOO.lang.isNumber(elCell.yuiColumnId)){var oColumn=this._oColumnSet.getColumn(elCell.yuiColumnId);this.formatCell(elCell,this.getRecord(elCell),oColumn);}
-else{}};YAHOO.widget.DataTable.prototype.onEventShowCellEditor=function(oArgs){var evt=oArgs.event;var target=oArgs.target;var elTag=target.tagName.toLowerCase();var elCell=this.getTdEl(target);if(elCell){this.showCellEditor(elCell);}
-else{}};YAHOO.widget.DataTable.prototype.onEventEditCell=function(oArgs){this.onEventShowCellEditor(oArgs);};YAHOO.widget.DataTable.prototype.onEventSaveCellEditor=function(oArgs){this.saveCellEditor();};YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable=function(sRequest,oResponse){var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this._oRecordSet.addRecords(oResponse.results);this._initTableEl();if(!this._elTable||!this._elThead||!this._elTbody){return;}
-YAHOO.widget.DataTable.superclass.constructor.call(this,this._elContainer,this._oConfigs);if(this._oConfigs.paginator){this.updatePaginator(this._oConfigs.paginator);}
-this.refreshView();}
-else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}
-else if(ok){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.initializeTable(oResponse.results);}
-else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}
-else if(ok){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows=function(sRequest,oResponse){this.onDataReturnInitializeTable(sRequest,oResponse);};YAHOO.widget.DataTable.prototype.onDataReturnAppendRows=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.addRows(oResponse.results);}
-else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}};YAHOO.widget.DataTable.prototype.onDataReturnInsertRows=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.addRows(oResponse.results,0);}
-else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}};YAHOO.widget.ColumnSet=function(aHeaders){this._sName="instance"+YAHOO.widget.ColumnSet._nCount;var tree=[];var flat=[];var keys=[];var headers=[];var nodeDepth=-1;var parseColumns=function(nodeList,parent){nodeDepth++;if(!tree[nodeDepth]){tree[nodeDepth]=[];}
-for(var j=0;j<nodeList.length;j++){var currentNode=nodeList[j];var oColumn=new YAHOO.widget.Column(currentNode);flat.push(oColumn);if(parent){oColumn.parent=parent;}
-if(YAHOO.lang.isArray(currentNode.children)){oColumn.children=currentNode.children;var terminalChildNodes=0;var countTerminalChildNodes=function(ancestor){var descendants=ancestor.children;for(var k=0;k<descendants.length;k++){if(YAHOO.lang.isArray(descendants[k].children)){countTerminalChildNodes(descendants[k]);}
-else{terminalChildNodes++;}}};countTerminalChildNodes(currentNode);oColumn._colspan=terminalChildNodes;var currentChildren=currentNode.children;for(var k=0;k<currentChildren.length;k++){var child=currentChildren[k];if(oColumn.className&&(child.className===undefined)){child.className=oColumn.className;}
-if(oColumn.editor&&(child.editor===undefined)){child.editor=oColumn.editor;}
-if(oColumn.editorOptions&&(child.editorOptions===undefined)){child.editorOptions=oColumn.editorOptions;}
-if(oColumn.formatter&&(child.formatter===undefined)){child.formatter=oColumn.formatter;}
-if(oColumn.resizeable&&(child.resizeable===undefined)){child.resizeable=oColumn.resizeable;}
-if(oColumn.sortable&&(child.sortable===undefined)){child.sortable=oColumn.sortable;}
-if(oColumn.width&&(child.width===undefined)){child.width=oColumn.width;}
-if(oColumn.type&&(child.type===undefined)){child.type=oColumn.type;}
-if(oColumn.type&&!oColumn.formatter){oColumn.formatter=oColumn.type;}
-if(oColumn.text&&!YAHOO.lang.isValue(oColumn.label)){oColumn.label=oColumn.text;}
-if(oColumn.parser){}
-if(oColumn.sortOptions&&((oColumn.sortOptions.ascFunction)||(oColumn.sortOptions.descFunction))){}}
-if(!tree[nodeDepth+1]){tree[nodeDepth+1]=[];}
-parseColumns(currentChildren,oColumn);}
-else{oColumn._nKeyIndex=keys.length;oColumn._colspan=1;keys.push(oColumn);}
-tree[nodeDepth].push(oColumn);}
-nodeDepth--;};if(YAHOO.lang.isArray(aHeaders)){parseColumns(aHeaders);}
-var parseTreeForRowspan=function(tree){var maxRowDepth=1;var currentRow;var currentColumn;var countMaxRowDepth=function(row,tmpRowDepth){tmpRowDepth=tmpRowDepth||1;for(var n=0;n<row.length;n++){var col=row[n];if(YAHOO.lang.isArray(col.children)){tmpRowDepth++;countMaxRowDepth(col.children,tmpRowDepth);tmpRowDepth--;}
-else{if(tmpRowDepth>maxRowDepth){maxRowDepth=tmpRowDepth;}}}};for(var m=0;m<tree.length;m++){currentRow=tree[m];countMaxRowDepth(currentRow);for(var p=0;p<currentRow.length;p++){currentColumn=currentRow[p];if(!YAHOO.lang.isArray(currentColumn.children)){currentColumn._rowspan=maxRowDepth;}
-else{currentColumn._rowspan=1;}}
-maxRowDepth=1;}};parseTreeForRowspan(tree);var recurseAncestorsForHeaders=function(i,oColumn){headers[i].push(oColumn._nId);if(oColumn.parent){recurseAncestorsForHeaders(i,oColumn.parent);}};for(var i=0;i<keys.length;i++){headers[i]=[];recurseAncestorsForHeaders(i,keys[i]);headers[i]=headers[i].reverse();headers[i]=headers[i].join(" ");}
-this.tree=tree;this.flat=flat;this.keys=keys;this.headers=headers;YAHOO.widget.ColumnSet._nCount++;};YAHOO.widget.ColumnSet._nCount=0;YAHOO.widget.ColumnSet.prototype._sName=null;YAHOO.widget.ColumnSet.prototype.tree=null;YAHOO.widget.ColumnSet.prototype.flat=null;YAHOO.widget.ColumnSet.prototype.keys=null;YAHOO.widget.ColumnSet.prototype.headers=null;YAHOO.widget.ColumnSet.prototype.toString=function(){return"ColumnSet "+this._sName;};YAHOO.widget.ColumnSet.prototype.getColumn=function(column){var allColumns=this.flat;if(YAHOO.lang.isNumber(column)){for(var i=0;i<allColumns.length;i++){if(allColumns[i]._nId===column){return allColumns[i];}}}
-else if(YAHOO.lang.isString(column)){for(i=0;i<allColumns.length;i++){if(allColumns[i].key===column){return allColumns[i];}}}
-return null;};YAHOO.widget.Column=function(oConfigs){this._nId=YAHOO.widget.Column._nCount;this._sName="Column instance"+this._nId;if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
-if(!YAHOO.lang.isValue(this.key)){this.key="yui-dt-column"+this._nId;}
-YAHOO.widget.Column._nCount++;};YAHOO.widget.Column._nCount=0;YAHOO.widget.Column.prototype._sName=null;YAHOO.widget.Column.prototype._nId=null;YAHOO.widget.Column.prototype._nKeyIndex=null;YAHOO.widget.Column.prototype._colspan=1;YAHOO.widget.Column.prototype._rowspan=1;YAHOO.widget.Column.prototype._parent=null;YAHOO.widget.Column.prototype._width=null;YAHOO.widget.Column.prototype._minWidth=null;YAHOO.widget.Column.prototype.key=null;YAHOO.widget.Column.prototype.label=null;YAHOO.widget.Column.prototype.abbr=null;YAHOO.widget.Column.prototype.children=null;YAHOO.widget.Column.prototype.width=null;YAHOO.widget.Column.prototype.className=null;YAHOO.widget.Column.prototype.formatter=null;YAHOO.widget.Column.prototype.editor=null;YAHOO.widget.Column.prototype.editorOptions=null;YAHOO.widget.Column.prototype.resizeable=false;YAHOO.widget.Column.prototype.sortable=false;YAHOO.widget.Column.prototype.sortOptions=null;YAHOO.widget.Column.prototype.toString=function(){return this._sName;};YAHOO.widget.Column.prototype.getId=function(){return this._nId;};YAHOO.widget.Column.prototype.getKeyIndex=function(){return this._nKeyIndex;};YAHOO.widget.Column.prototype.getParent=function(){return this._parent;};YAHOO.widget.Column.prototype.getColspan=function(){return this._colspan;};YAHOO.widget.Column.prototype.getColSpan=function(){return this.getColspan();};YAHOO.widget.Column.prototype.getRowspan=function(){return this._rowspan;};YAHOO.widget.Column.prototype.getIndex=function(){return this.getKeyIndex();};YAHOO.widget.Column.prototype.format=function(){};YAHOO.widget.Column.formatCheckbox=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatCheckbox(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatCurrency=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatCurrency(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatDate=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatDate(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatEmail=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatEmail(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatLink=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatLink(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatNumber=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatNumber(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatSelect=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatDropdown(elCell,oRecord,oColumn,oData);};YAHOO.util.Sort={compare:function(a,b,desc){if((a===null)||(typeof a=="undefined")){if((b===null)||(typeof b=="undefined")){return 0;}
-else{return 1;}}
-else if((b===null)||(typeof b=="undefined")){return-1;}
-if(a.constructor==String){a=a.toLowerCase();}
-if(b.constructor==String){b=b.toLowerCase();}
-if(a<b){return(desc)?1:-1;}
-else if(a>b){return(desc)?-1:1;}
-else{return 0;}}};YAHOO.util.ColumnResizer=function(oDataTable,oColumn,elThead,sHandleId,sGroup,oConfig){if(oDataTable&&oColumn&&elThead&&sHandleId){this.datatable=oDataTable;this.column=oColumn;this.cell=elThead;this.init(sHandleId,sGroup,oConfig);this.setYConstraint(0,0);}
-else{}};if(YAHOO.util.DD){YAHOO.extend(YAHOO.util.ColumnResizer,YAHOO.util.DD);}
-YAHOO.util.ColumnResizer.prototype.onMouseDown=function(e){this.startWidth=this.cell.offsetWidth;this.startPos=YAHOO.util.Dom.getX(this.getDragEl());if(this.datatable.fixedWidth){var cellLabel=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];this.minWidth=cellLabel.offsetWidth+6;var sib=this.cell.nextSibling;var sibCellLabel=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];this.sibMinWidth=sibCellLabel.offsetWidth+6;var left=((this.startWidth-this.minWidth)<0)?0:(this.startWidth-this.minWidth);var right=((sib.offsetWidth-this.sibMinWidth)<0)?0:(sib.offsetWidth-this.sibMinWidth);this.setXConstraint(left,right);}};YAHOO.util.ColumnResizer.prototype.onMouseUp=function(e){var resizeStyle=YAHOO.util.Dom.get(this.handleElId).style;resizeStyle.left="auto";resizeStyle.right=0;resizeStyle.marginRight="-6px";resizeStyle.width="6px";this.datatable.fireEvent("columnResizeEvent",{column:this.column,target:this.cell});};YAHOO.util.ColumnResizer.prototype.onDrag=function(e){var newPos=YAHOO.util.Dom.getX(this.getDragEl());var offsetX=newPos-this.startPos;var newWidth=this.startWidth+offsetX;if(newWidth<this.minWidth){newWidth=this.minWidth;}
-var oDataTable=this.datatable;var elCell=this.cell;if(oDataTable.fixedWidth){var sib=elCell.nextSibling;var sibnewwidth=sib.offsetWidth-offsetX;if(sibnewwidth<this.sibMinWidth){sibnewwidth=this.sibMinWidth;}
-for(var i=0;i<oDataTable._oColumnSet.length;i++){}
-sib.style.width=sibnewwidth;elCell.style.width=newWidth+"px";}
-else{elCell.style.width=newWidth+"px";}};YAHOO.widget.RecordSet=function(data){this._sName="RecordSet instance"+YAHOO.widget.RecordSet._nCount;YAHOO.widget.RecordSet._nCount++;this._records=[];this._length=0;if(data){if(YAHOO.lang.isArray(data)){this.addRecords(data);}
-else if(data.constructor==Object){this.addRecord(data);}}
-this.createEvent("recordAddEvent");this.createEvent("recordsAddEvent");this.createEvent("recordUpdateEvent");this.createEvent("recordDeleteEvent");this.createEvent("recordsDeleteEvent");this.createEvent("resetEvent");this.createEvent("keyUpdateEvent");};if(YAHOO.util.EventProvider){YAHOO.augment(YAHOO.widget.RecordSet,YAHOO.util.EventProvider);}
-else{}
-YAHOO.widget.RecordSet._nCount=0;YAHOO.widget.RecordSet.prototype._sName=null;YAHOO.widget.RecordSet.prototype._nRecordCount=0;YAHOO.widget.RecordSet.prototype._length=null;YAHOO.widget.RecordSet.prototype._addRecord=function(oData,index){var oRecord=new YAHOO.widget.Record(oData);oRecord._nId=this._nRecordCount;this._nRecordCount++;if(YAHOO.lang.isNumber(index)&&(index>-1)){this._records.splice(index,0,oRecord);}
-else{index=this.getLength();this._records.push(oRecord);}
-this._length++;return oRecord;};YAHOO.widget.RecordSet.prototype._deleteRecord=function(index,range){if(!YAHOO.lang.isNumber(range)||(range<0)){range=1;}
-this._records.splice(index,range);this._length=this._length-range;};YAHOO.widget.RecordSet.prototype.toString=function(){return this._sName;};YAHOO.widget.RecordSet.prototype.getLength=function(){return this._length;};YAHOO.widget.RecordSet.prototype.getRecord=function(index){if(YAHOO.lang.isNumber(index)){return this._records[index];}
-return null;};YAHOO.widget.RecordSet.prototype.getRecords=function(index,range){if(!YAHOO.lang.isNumber(index)){return this._records;}
-if(!YAHOO.lang.isNumber(range)){return this._records.slice(index);}
-return this._records.slice(index,index+range);};YAHOO.widget.RecordSet.prototype.getRecordIndex=function(oRecord){for(var i=this._records.length-1;i>-1;i--){if(oRecord.getId()===this._records[i].getId()){return i;}}
-return null;};YAHOO.widget.RecordSet.prototype.addRecord=function(oData,index){if(oData&&(oData.constructor==Object)){var oRecord=this._addRecord(oData,index);this.fireEvent("recordAddEvent",{record:oRecord,data:oData});return oRecord;}
-else{return null;}};YAHOO.widget.RecordSet.prototype.addRecords=function(aData,index){if(YAHOO.lang.isArray(aData)){var newRecords=[];for(var i=0;i<aData.length;i++){if(aData[i]&&(aData[i].constructor==Object)){var record=this._addRecord(aData[i],index);newRecords.push(record);}}
-this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});return newRecords;}
-else if(aData&&(aData.constructor==Object)){var oRecord=this._addRecord(aData);this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});return oRecord;}
-else{}};YAHOO.widget.RecordSet.prototype.updateRecord=function(record,oData){var oRecord=null;if(YAHOO.lang.isNumber(record)){oRecord=this._records[record];}
-else if(record instanceof YAHOO.widget.Record){oRecord=record;}
-if(oRecord&&oData&&(oData.constructor==Object)){var oldData={};for(var key in oRecord._oData){oldData[key]=oRecord._oData[key];}
-oRecord._oData=oData;this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});return oRecord;}
-else{return null;}};YAHOO.widget.RecordSet.prototype.updateKey=function(record,sKey,oData){var oRecord;if(YAHOO.lang.isNumber(record)){oRecord=this._records[record];}
-if(record instanceof YAHOO.widget.Record){oRecord=record;var oldData=null;var keyValue=oRecord._oData[sKey];if(keyValue&&keyValue.constructor==Object){oldData={};for(var key in keyValue){oldData[key]=keyValue[key];}}
-else{oldData=keyValue;}
-oRecord._oData[sKey]=oData;this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});}
-else{}};YAHOO.widget.RecordSet.prototype.replaceRecords=function(data){this.reset();return this.addRecords(data);};YAHOO.widget.RecordSet.prototype.sortRecords=function(fnSort,desc){return this._records.sort(function(a,b){return fnSort(a,b,desc);});};YAHOO.widget.RecordSet.prototype.deleteRecord=function(index){if(YAHOO.lang.isNumber(index)&&(index>-1)&&(index<this.getLength())){var oRecordData=this.getRecord(index).getData();var oData={};for(var key in oRecordData){oData[key]=oRecordData[key];}
-this._deleteRecord(index);this.fireEvent("recordDeleteEvent",{data:oData,index:index});return oData;}
-else{return null;}};YAHOO.widget.RecordSet.prototype.deleteRecords=function(index,range){if(!YAHOO.lang.isNumber(range)){range=1;}
-if(YAHOO.lang.isNumber(index)&&(index>-1)&&(index<this.getLength())){var recordsToDelete=this.getRecords(index,range);var deletedData=[];for(var i=0;i<recordsToDelete.length;i++){var oData={};for(var key in recordsToDelete[i]){oData[key]=recordsToDelete[i][key];}
-deletedData.push(oData);}
-this._deleteRecord(index,range);this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});}
-else{}};YAHOO.widget.RecordSet.prototype.reset=function(){this._records=[];this._length=0;this.fireEvent("resetEvent");};YAHOO.widget.Record=function(oLiteral){this._oData={};if(oLiteral&&(oLiteral.constructor==Object)){for(var sKey in oLiteral){this._oData[sKey]=oLiteral[sKey];}}};YAHOO.widget.Record.prototype._nId=null;YAHOO.widget.Record.prototype._oData=null;YAHOO.widget.Record.prototype.getId=function(){return this._nId;};YAHOO.widget.Record.prototype.getData=function(sKey){if(YAHOO.lang.isString(sKey)){return this._oData[sKey];}
-else{return this._oData;}};YAHOO.register("datatable",YAHOO.widget.DataTable,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.util.Chain=function(){this.q=[].slice.call(arguments);};YAHOO.util.Chain.prototype={id:0,run:function(){var F=this.q[0],C;if(!F||this.id){return this;}C=F.method||F;if(typeof C==="function"){var E=F.scope||{},B=F.argument||[],A=F.timeout||0,D=this;if(!(B instanceof Array)){B=[B];}if(A<0){this.id=A;if(F.until){for(;!F.until();){C.apply(E,B);}}else{if(F.iterations){for(;F.iterations-->0;){C.apply(E,B);}}else{C.apply(E,B);}}this.q.shift();this.id=0;return this.run();}else{if(F.until){if(F.until()){this.q.shift();return this.run();}}else{if(!F.iterations||!--F.iterations){this.q.shift();}}this.id=setTimeout(function(){C.apply(E,B);if(D.id){D.id=0;D.run();}},A);}}return this;},add:function(A){this.q.push(A);return this;},pause:function(){clearTimeout(this.id);this.id=0;return this;},stop:function(){this.pause();this.q=[];return this;}};YAHOO.widget.ColumnSet=function(A){this._sId="yui-cs"+YAHOO.widget.ColumnSet._nCount;A=YAHOO.widget.DataTable._cloneObject(A);this._init(A);YAHOO.widget.ColumnSet._nCount++;};YAHOO.widget.ColumnSet._nCount=0;YAHOO.widget.ColumnSet.prototype={_sId:null,_aDefinitions:null,tree:null,flat:null,keys:null,headers:null,_init:function(I){var J=[];var A=[];var G=[];var E=[];var C=-1;var B=function(M,S){C++;if(!J[C]){J[C]=[];}for(var O=0;O<M.length;O++){var K=M[O];var Q=new YAHOO.widget.Column(K);K.yuiColumnId=Q._sId=YAHOO.widget.Column._nCount+"";if(!YAHOO.lang.isValue(Q.key)){Q.key="yui-dt-col"+YAHOO.widget.Column._nCount;}YAHOO.widget.Column._nCount++;A.push(Q);if(S){Q.parent=S;}if(YAHOO.lang.isArray(K.children)){Q.children=K.children;var R=0;var P=function(V){var W=V.children;for(var U=0;U<W.length;U++){if(YAHOO.lang.isArray(W[U].children)){P(W[U]);}else{R++;}}};P(K);Q._nColspan=R;var T=K.children;for(var N=0;N<T.length;N++){var L=T[N];if(Q.className&&(L.className===undefined)){L.className=Q.className;}if(Q.editor&&(L.editor===undefined)){L.editor=Q.editor;}if(Q.editorOptions&&(L.editorOptions===undefined)){L.editorOptions=Q.editorOptions;}if(Q.formatter&&(L.formatter===undefined)){L.formatter=Q.formatter;}if(Q.resizeable&&(L.resizeable===undefined)){L.resizeable=Q.resizeable;}if(Q.sortable&&(L.sortable===undefined)){L.sortable=Q.sortable;}if(Q.width&&(L.width===undefined)){L.width=Q.width;}if(Q.type&&(L.type===undefined)){L.type=Q.type;}if(Q.type&&!Q.formatter){Q.formatter=Q.type;}if(Q.text&&!YAHOO.lang.isValue(Q.label)){Q.label=Q.text;}if(Q.parser){}if(Q.sortOptions&&((Q.sortOptions.ascFunction)||(Q.sortOptions.descFunction))){}}if(!J[C+1]){J[C+1]=[];}B(T,Q);}else{Q._nKeyIndex=G.length;Q._nColspan=1;G.push(Q);}J[C].push(Q);}C--;};if(YAHOO.lang.isArray(I)){B(I);this._aDefinitions=I;}else{return null;}var F;var D=function(L){var M=1;var O;var N;var P=function(T,S){S=S||1;for(var U=0;U<T.length;U++){var R=T[U];if(YAHOO.lang.isArray(R.children)){S++;P(R.children,S);S--;}else{if(S>M){M=S;}}}};for(var K=0;K<L.length;K++){O=L[K];P(O);for(var Q=0;Q<O.length;Q++){N=O[Q];if(!YAHOO.lang.isArray(N.children)){N._nRowspan=M;}else{N._nRowspan=1;}}M=1;}};D(J);for(F=0;F<J[0].length;F++){J[0][F]._nTreeIndex=F;}var H=function(K,L){E[K].push(L._sId);if(L.parent){H(K,L.parent);}};for(F=0;F<G.length;F++){E[F]=[];H(F,G[F]);E[F]=E[F].reverse();}this.tree=J;this.flat=A;this.keys=G;this.headers=E;},getId:function(){return this._sId;},toString:function(){return"ColumnSet instance "+this._sId;},getDefinitions:function(){var A=this._aDefinitions;var B=function(D,F){for(var C=0;C<D.length;C++){var E=D[C];var G=F.getColumnById(E.yuiColumnId);if(G){E.abbr=G.abbr;E.className=G.className;E.editor=G.editor;E.editorOptions=G.editorOptions;E.formatter=G.formatter;E.hidden=G.hidden;E.key=G.key;E.label=G.label;E.minWidth=G.minWidth;E.resizeable=G.resizeable;E.selected=G.selected;E.sortable=G.sortable;E.sortOptions=G.sortOptions;E.width=G.width;}if(YAHOO.lang.isArray(E.children)){B(E.children,F);}}};B(A,this);this._aDefinitions=A;return A;},getColumnById:function(C){if(YAHOO.lang.isString(C)){var A=this.flat;for(var B=A.length-1;B>-1;B--){if(A[B]._sId===C){return A[B];}}}return null;},getColumn:function(C){if(YAHOO.lang.isNumber(C)&&this.keys[C]){return this.keys[C];}else{if(YAHOO.lang.isString(C)){var A=this.flat;var D=[];for(var B=0;B<A.length;B++){if(A[B].key===C){D.push(A[B]);}}if(D.length===1){return D[0];}else{if(D.length>1){return D;}}}}return null;},getDescendants:function(D){var B=this;var C=[];var A;var E=function(F){C.push(F);if(F.children){for(A=0;A<F.children.length;A++){E(B.getColumn(F.children[A].key));}}};E(D);return C;}};YAHOO.widget.Column=function(B){if(B&&(B.constructor==Object)){for(var A in B){if(A){this[A]=B[A];}}}if(this.width&&!YAHOO.lang.isNumber(this.width)){this.width=null;}};YAHOO.lang.augmentObject(YAHOO.widget.Column,{_nCount:0,formatCheckbox:function(B,A,C,D){YAHOO.widget.DataTable.formatCheckbox(B,A,C,D);},formatCurrency:function(B,A,C,D){YAHOO.widget.DataTable.formatCurrency(B,A,C,D);},formatDate:function(B,A,C,D){YAHOO.widget.DataTable.formatDate(B,A,C,D);},formatEmail:function(B,A,C,D){YAHOO.widget.DataTable.formatEmail(B,A,C,D);},formatLink:function(B,A,C,D){YAHOO.widget.DataTable.formatLink(B,A,C,D);},formatNumber:function(B,A,C,D){YAHOO.widget.DataTable.formatNumber(B,A,C,D);},formatSelect:function(B,A,C,D){YAHOO.widget.DataTable.formatDropdown(B,A,C,D);}});YAHOO.widget.Column.prototype={_sId:null,_oDefinition:null,_nKeyIndex:null,_nTreeIndex:null,_nColspan:1,_nRowspan:1,_oParent:null,_elTh:null,_elResizer:null,_dd:null,_ddResizer:null,key:null,label:null,abbr:null,children:null,width:null,minWidth:10,hidden:false,selected:false,className:null,formatter:null,editor:null,editorOptions:null,resizeable:false,sortable:false,sortOptions:null,getId:function(){return this._sId;},toString:function(){return"Column instance "+this._sId;},getDefinition:function(){var A=this._oDefinition;A.abbr=this.abbr;A.className=this.className;A.editor=this.editor;A.editorOptions=this.editorOptions;A.formatter=this.formatter;A.key=this.key;A.label=this.label;A.minWidth=this.minWidth;A.resizeable=this.resizeable;
+A.sortable=this.sortable;A.sortOptions=this.sortOptions;A.width=this.width;return A;},getKey:function(){return this.key;},getKeyIndex:function(){return this._nKeyIndex;},getTreeIndex:function(){return this._nTreeIndex;},getParent:function(){return this._oParent;},getColspan:function(){return this._nColspan;},getColSpan:function(){return this.getColspan();},getRowspan:function(){return this._nRowspan;},getThEl:function(){return this._elTh;},getResizerEl:function(){return this._elResizer;},getColEl:function(){return this.getThEl();},getIndex:function(){return this.getKeyIndex();},format:function(){}};YAHOO.util.Sort={compare:function(B,A,C){if((B===null)||(typeof B=="undefined")){if((A===null)||(typeof A=="undefined")){return 0;}else{return 1;}}else{if((A===null)||(typeof A=="undefined")){return -1;}}if(B.constructor==String){B=B.toLowerCase();}if(A.constructor==String){A=A.toLowerCase();}if(B<A){return(C)?1:-1;}else{if(B>A){return(C)?-1:1;}else{return 0;}}}};YAHOO.widget.ColumnDD=function(D,A,C,B){if(D&&A&&C&&B){this.datatable=D;this.table=D.getTheadEl().parentNode;this.column=A;this.headCell=C;this.pointer=B;this.newIndex=null;this.init(C);this.initFrame();this.invalidHandleTypes={};this.setPadding(10,0,(this.datatable.getTheadEl().offsetHeight+10),0);}else{}};if(YAHOO.util.DDProxy){YAHOO.extend(YAHOO.widget.ColumnDD,YAHOO.util.DDProxy,{initConstraints:function(){var G=YAHOO.util.Dom.getRegion(this.table),D=this.getEl(),F=YAHOO.util.Dom.getXY(D),C=parseInt(YAHOO.util.Dom.getStyle(D,"width"),10),A=parseInt(YAHOO.util.Dom.getStyle(D,"height"),10),E=((F[0]-G.left)+15),B=((G.right-F[0]-C)+15);this.setXConstraint(E,B);this.setYConstraint(10,10);YAHOO.util.Event.on(window,"resize",function(){this.initConstraints();},this,true);},_resizeProxy:function(){this.constructor.superclass._resizeProxy.apply(this,arguments);var A=this.getDragEl(),B=this.getEl();YAHOO.util.Dom.setStyle(this.pointer,"height",(this.table.parentNode.offsetHeight+10)+"px");YAHOO.util.Dom.setStyle(this.pointer,"display","block");var C=YAHOO.util.Dom.getXY(B);YAHOO.util.Dom.setXY(this.pointer,[C[0],(C[1]-5)]);YAHOO.util.Dom.setStyle(A,"height",this.datatable.getContainerEl().offsetHeight+"px");YAHOO.util.Dom.setStyle(A,"width",(parseInt(YAHOO.util.Dom.getStyle(A,"width"),10)+4)+"px");YAHOO.util.Dom.setXY(this.dragEl,C);},onMouseDown:function(){this.initConstraints();this.resetConstraints();},clickValidator:function(B){if(!this.column.hidden){var A=YAHOO.util.Event.getTarget(B);return(this.isValidHandleChild(A)&&(this.id==this.handleElId||this.DDM.handleWasClicked(A,this.id)));}},onDragOver:function(G,A){var E=this.datatable.getColumn(A);if(E){var C=YAHOO.util.Event.getPageX(G),H=YAHOO.util.Dom.getX(A),I=H+((YAHOO.util.Dom.get(A).offsetWidth)/2),F=this.column.getTreeIndex(),B=E.getTreeIndex(),J=B;if(C<I){YAHOO.util.Dom.setX(this.pointer,H);}else{var D=parseInt(E.getThEl().offsetWidth,10);YAHOO.util.Dom.setX(this.pointer,(H+D));J++;}if(B>F){J--;}if(J<0){J=0;}else{if(J>this.datatable.getColumnSet().tree[0].length){J=this.datatable.getColumnSet().tree[0].length;}}this.newIndex=J;}},onDragDrop:function(){if(YAHOO.lang.isNumber(this.newIndex)&&(this.newIndex!==this.column.getTreeIndex())){var C=this.datatable;C._oChain.stop();var B=C._oColumnSet.getDefinitions();var A=B.splice(this.column.getTreeIndex(),1)[0];B.splice(this.newIndex,0,A);C._initColumnSet(B);C._initTheadEls();C.render();}},endDrag:function(){this.newIndex=null;YAHOO.util.Dom.setStyle(this.pointer,"display","none");}});}YAHOO.util.ColumnResizer=function(E,C,D,A,B){if(E&&C&&D&&A){this.datatable=E;this.column=C;this.headCell=D;this.headCellLiner=D.firstChild;this.init(A,A,{dragOnly:true,dragElId:B.id});this.initFrame();}else{}};if(YAHOO.util.DD){YAHOO.extend(YAHOO.util.ColumnResizer,YAHOO.util.DDProxy,{resetResizerEl:function(){var A=YAHOO.util.Dom.get(this.handleElId).style;A.left="auto";A.right=0;A.top="auto";A.bottom=0;},onMouseUp:function(A){this.resetResizerEl();this.datatable.fireEvent("columnResizeEvent",{column:this.column,target:this.headCell});},onMouseDown:function(A){this.startWidth=this.headCell.firstChild.offsetWidth;this.startX=YAHOO.util.Event.getXY(A)[0];this.nLinerPadding=(parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0)+(parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0);},clickValidator:function(B){if(!this.column.hidden){var A=YAHOO.util.Event.getTarget(B);return(this.isValidHandleChild(A)&&(this.id==this.handleElId||this.DDM.handleWasClicked(A,this.id)));}},onDrag:function(C){var D=YAHOO.util.Event.getXY(C)[0];if(D>YAHOO.util.Dom.getX(this.headCellLiner)){var A=D-this.startX;var B=this.startWidth+A-this.nLinerPadding;this.datatable.setColumnWidth(this.column,B);}}});}YAHOO.widget.RecordSet=function(A){this._sId="yui-rs"+YAHOO.widget.RecordSet._nCount;YAHOO.widget.RecordSet._nCount++;this._records=[];if(A){if(YAHOO.lang.isArray(A)){this.addRecords(A);}else{if(A.constructor==Object){this.addRecord(A);}}}this.createEvent("recordAddEvent");this.createEvent("recordsAddEvent");this.createEvent("recordSetEvent");this.createEvent("recordsSetEvent");this.createEvent("recordUpdateEvent");this.createEvent("recordDeleteEvent");this.createEvent("recordsDeleteEvent");this.createEvent("resetEvent");this.createEvent("keyUpdateEvent");this.createEvent("recordValueUpdateEvent");};YAHOO.widget.RecordSet._nCount=0;YAHOO.widget.RecordSet.prototype={_sId:null,_addRecord:function(C,A){var B=new YAHOO.widget.Record(C);if(YAHOO.lang.isNumber(A)&&(A>-1)){this._records.splice(A,0,B);}else{this._records[this._records.length]=B;}return B;},_setRecord:function(B,A){if(!YAHOO.lang.isNumber(A)||A<0){A=this._records.length;}return(this._records[A]=new YAHOO.widget.Record(B));},_deleteRecord:function(B,A){if(!YAHOO.lang.isNumber(A)||(A<0)){A=1;}this._records.splice(B,A);},getId:function(){return this._sId;},toString:function(){return"RecordSet instance "+this._sId;},getLength:function(){return this._records.length;},getRecord:function(A){var B;
+if(A instanceof YAHOO.widget.Record){for(B=0;B<this._records.length;B++){if(this._records[B]&&(this._records[B]._sId===A._sId)){return A;}}}else{if(YAHOO.lang.isNumber(A)){if((A>-1)&&(A<this.getLength())){return this._records[A];}}else{if(YAHOO.lang.isString(A)){for(B=0;B<this._records.length;B++){if(this._records[B]&&(this._records[B]._sId===A)){return this._records[B];}}}}}return null;},getRecords:function(B,A){if(!YAHOO.lang.isNumber(B)){return this._records;}if(!YAHOO.lang.isNumber(A)){return this._records.slice(B);}return this._records.slice(B,B+A);},hasRecords:function(B,A){var D=this.getRecords(B,A);for(var C=0;C<A;++C){if(typeof D[C]==="undefined"){return false;}}return true;},getRecordIndex:function(B){if(B){for(var A=this._records.length-1;A>-1;A--){if(this._records[A]&&B.getId()===this._records[A].getId()){return A;}}}return null;},addRecord:function(C,A){if(C&&(C.constructor==Object)){var B=this._addRecord(C,A);this.fireEvent("recordAddEvent",{record:B,data:C});return B;}else{return null;}},addRecords:function(C,B){if(YAHOO.lang.isArray(C)){var F=[];for(var D=0;D<C.length;D++){if(C[D]&&(C[D].constructor==Object)){var A=this._addRecord(C[D],B);F.push(A);}}this.fireEvent("recordsAddEvent",{records:F,data:C});return F;}else{if(C&&(C.constructor==Object)){var E=this._addRecord(C);this.fireEvent("recordsAddEvent",{records:[E],data:C});return E;}else{}}},setRecord:function(C,A){if(C&&(C.constructor==Object)){var B=this._setRecord(C,A);this.fireEvent("recordSetEvent",{record:B,data:C});return B;}else{return null;}},setRecords:function(B,A){if(YAHOO.lang.isArray(B)){var D=YAHOO.widget.Record,G=[A,0],C=B.length-1,F;for(;C>=0;--C){F=B[C]&&typeof B[C]==="object"?new D(B[C]):this._records[C];if(F){G[C+2]=F;}}this._records[A+G.length-3]=G[G.length-1];G[1]=G.length-2;G.splice.apply(this._records,G);this.fireEvent("recordsSet",{records:G,data:B});return G.slice(2);}else{if(B&&(B.constructor==Object)){var E=this._setRecord(B);this.fireEvent("recordsSetEvent",{records:[E],data:B});return E;}else{}}},updateRecord:function(A,E){var C=this.getRecord(A);if(C&&E&&(E.constructor==Object)){var D={};for(var B in C._oData){D[B]=C._oData[B];}C._oData=E;this.fireEvent("recordUpdateEvent",{record:C,newData:E,oldData:D});return C;}else{return null;}},updateKey:function(A,B,C){this.updateRecordValue(A,B,C);},updateRecordValue:function(A,D,G){var C=this.getRecord(A);if(C){var F=null;var E=C._oData[D];if(E&&E.constructor==Object){F={};for(var B in E){F[B]=E[B];}}else{F=E;}C._oData[D]=G;this.fireEvent("keyUpdateEvent",{record:C,key:D,newData:G,oldData:F});this.fireEvent("recordValueUpdateEvent",{record:C,key:D,newData:G,oldData:F});}else{}},replaceRecords:function(A){this.reset();return this.addRecords(A);},sortRecords:function(A,B){return this._records.sort(function(D,C){return A(D,C,B);});},reverseRecords:function(){return this._records.reverse();},deleteRecord:function(B){if(YAHOO.lang.isNumber(B)&&(B>-1)&&(B<this.getLength())){var A=this.getRecord(B).getData();var D={};for(var C in A){D[C]=A[C];}this._deleteRecord(B);this.fireEvent("recordDeleteEvent",{data:D,index:B});return D;}else{return null;}},deleteRecords:function(C,A){if(!YAHOO.lang.isNumber(A)){A=1;}if(YAHOO.lang.isNumber(C)&&(C>-1)&&(C<this.getLength())){var F=this.getRecords(C,A);var B=[];for(var E=0;E<F.length;E++){var G={};for(var D in F[E]){G[D]=F[E][D];}B.push(G);}this._deleteRecord(C,A);this.fireEvent("recordsDeleteEvent",{data:B,index:C});}else{}},reset:function(){this._records=[];this.fireEvent("resetEvent");}};YAHOO.augment(YAHOO.widget.RecordSet,YAHOO.util.EventProvider);YAHOO.widget.Record=function(A){this._sId="yui-rec"+YAHOO.widget.Record._nCount;YAHOO.widget.Record._nCount++;this._oData={};if(A&&(A.constructor==Object)){for(var B in A){this._oData[B]=A[B];}}};YAHOO.widget.Record._nCount=0;YAHOO.widget.Record.prototype={_sId:null,_oData:null,getId:function(){return this._sId;},getData:function(A){if(YAHOO.lang.isString(A)){return this._oData[A];}else{return this._oData;}},setData:function(A,B){this._oData[A]=B;}};YAHOO.widget.Paginator=function(D){var H=YAHOO.widget.Paginator.VALUE_UNLIMITED,G=YAHOO.lang,E,A,B,C;D=G.isObject(D)?D:{};this.initConfig();this.initEvents();this.set("rowsPerPage",D.rowsPerPage,true);if(G.isNumber(D.totalRecords)){this.set("totalRecords",D.totalRecords,true);}this.initUIComponents();for(E in D){if(G.hasOwnProperty(D,E)){this.set(E,D[E],true);}}A=this.get("initialPage");B=this.get("totalRecords");C=this.get("rowsPerPage");if(A>1&&C!==H){var F=(A-1)*C;if(B===H||F<B){this.set("recordOffset",F,true);}}};YAHOO.lang.augmentObject(YAHOO.widget.Paginator,{id:0,ID_BASE:"yui-pg",VALUE_UNLIMITED:-1,TEMPLATE_DEFAULT:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",TEMPLATE_ROWS_PER_PAGE:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"},true);YAHOO.widget.Paginator.prototype={_containers:[],initConfig:function(){var B=YAHOO.widget.Paginator.VALUE_UNLIMITED,A=YAHOO.lang;this.setAttributeConfig("rowsPerPage",{value:0,validator:A.isNumber});this.setAttributeConfig("containers",{value:null,writeOnce:true,validator:function(E){if(!A.isArray(E)){E=[E];}for(var D=0,C=E.length;D<C;++D){if(A.isString(E[D])||(A.isObject(E[D])&&E[D].nodeType===1)){continue;}return false;}return true;},method:function(C){C=YAHOO.util.Dom.get(C);if(!A.isArray(C)){C=[C];}this._containers=C;}});this.setAttributeConfig("totalRecords",{value:B,validator:A.isNumber});this.setAttributeConfig("recordOffset",{value:0,validator:function(D){var C=this.get("totalRecords");if(A.isNumber(D)){return C===B||C>D;}return false;}});this.setAttributeConfig("initialPage",{value:1,validator:A.isNumber});this.setAttributeConfig("template",{value:YAHOO.widget.Paginator.TEMPLATE_DEFAULT,validator:A.isString});this.setAttributeConfig("containerClass",{value:"yui-pg-container",validator:A.isString});this.setAttributeConfig("alwaysVisible",{value:true,validator:A.isBoolean});this.setAttributeConfig("updateOnChange",{value:false,validator:A.isBoolean});
+this.setAttributeConfig("id",{value:YAHOO.widget.Paginator.id++,readOnly:true});this.setAttributeConfig("rendered",{value:false,readOnly:true});},initUIComponents:function(){var C=YAHOO.widget.Paginator.ui;for(var B in C){var A=C[B];if(YAHOO.lang.isObject(A)&&YAHOO.lang.isFunction(A.init)){A.init(this);}}},initEvents:function(){this.createEvent("recordOffsetChange");this.createEvent("totalRecordsChange");this.createEvent("rowsPerPageChange");this.createEvent("alwaysVisibleChange");this.createEvent("rendered");this.createEvent("changeRequest");this.createEvent("beforeDestroy");this.subscribe("totalRecordsChange",this.updateVisibility,this,true);this.subscribe("alwaysVisibleChange",this.updateVisibility,this,true);},render:function(){if(this.get("rendered")){return ;}var M=this.get("totalRecords");if(M!==YAHOO.widget.Paginator.VALUE_UNLIMITED&&M<this.get("rowsPerPage")&&!this.get("alwaysVisible")){return ;}var F=YAHOO.util.Dom,N=this.get("template"),P=this.get("containerClass");N=N.replace(/\{([a-z0-9_ \-]+)\}/gi,'<span class="yui-pg-ui $1"></span>');for(var H=0,J=this._containers.length;H<J;++H){var L=this._containers[H],G=YAHOO.widget.Paginator.ID_BASE+this.get("id")+"-"+H;if(!L){continue;}L.style.display="none";F.addClass(L,P);L.innerHTML=N;var E=F.getElementsByClassName("yui-pg-ui","span",L);for(var D=0,O=E.length;D<O;++D){var C=E[D],B=C.parentNode,A=C.className.replace(/\s*yui-pg-ui\s+/g,""),K=YAHOO.widget.Paginator.ui[A];if(YAHOO.lang.isFunction(K)){var I=new K(this);if(YAHOO.lang.isFunction(I.render)){B.replaceChild(I.render(G),C);}}}L.style.display="";}if(this._containers.length){this.setAttributeConfig("rendered",{value:true});this.fireEvent("rendered",this.getState());}},destroy:function(){this.fireEvent("beforeDestroy");for(var B=0,A=this._containers.length;B<A;++B){this._containers[B].innerHTML="";}this.setAttributeConfig("rendered",{value:false});},updateVisibility:function(F){var B=this.get("alwaysVisible");if(F.type==="alwaysVisibleChange"||!B){var H=this.get("totalRecords"),G=true,D=this.get("rowsPerPage"),E=this.get("rowsPerPageOptions"),C,A;if(YAHOO.lang.isArray(E)){for(C=0,A=E.length;C<A;++C){D=Math.min(D,E[C]);}}if(H!==YAHOO.widget.Paginator.VALUE_UNLIMITED&&H<=D){G=false;}G=G||B;for(C=0,A=this._containers.length;C<A;++C){YAHOO.util.Dom.setStyle(this._containers[C],"display",G?"":"none");}}},getContainerNodes:function(){return this._containers;},getTotalPages:function(){var A=this.get("totalRecords");var B=this.get("rowsPerPage");if(!B){return null;}if(A===YAHOO.widget.Paginator.VALUE_UNLIMITED){return YAHOO.widget.Paginator.VALUE_UNLIMITED;}return Math.ceil(A/B);},hasPage:function(B){if(!YAHOO.lang.isNumber(B)||B<1){return false;}var A=this.getTotalPages();return(A===YAHOO.widget.Paginator.VALUE_UNLIMITED||A>=B);},getCurrentPage:function(){var A=this.get("rowsPerPage");if(!A){return null;}return Math.floor(this.get("recordOffset")/A)+1;},hasNextPage:function(){var A=this.getCurrentPage(),B=this.getTotalPages();if(A===null){return false;}return(B===YAHOO.widget.Paginator.VALUE_UNLIMITED?true:A<B);},getNextPage:function(){return this.hasNextPage()?this.getCurrentPage()+1:null;},hasPreviousPage:function(){return(this.getCurrentPage()>1);},getPreviousPage:function(){return(this.hasPreviousPage()?this.getCurrentPage()-1:1);},getPageRecords:function(D){if(!YAHOO.lang.isNumber(D)){D=this.getCurrentPage();}var C=this.get("rowsPerPage"),B=this.get("totalRecords"),E,A;if(!C){return null;}E=(D-1)*C;if(B!==YAHOO.widget.Paginator.VALUE_UNLIMITED){if(E>=B){return null;}A=Math.min(E+C,B)-1;}else{A=E+C-1;}return[E,A];},setPage:function(B,A){if(this.hasPage(B)&&B!==this.getCurrentPage()){if(this.get("updateOnChange")||A){this.set("recordOffset",(B-1)*this.get("rowsPerPage"));}else{this.fireEvent("changeRequest",this.getState({"page":B}));}}},getRowsPerPage:function(){return this.get("rowsPerPage");},setRowsPerPage:function(B,A){if(YAHOO.lang.isNumber(B)&&B>0&&B!==this.get("rowsPerPage")){if(this.get("updateOnChange")||A){this.set("rowsPerPage",B);}else{this.fireEvent("changeRequest",this.getState({"rowsPerPage":B}));}}},getTotalRecords:function(){return this.get("totalRecords");},setTotalRecords:function(B,A){if(YAHOO.lang.isNumber(B)&&B>=0&&B!==this.get("totalRecords")){if(this.get("updateOnChange")||A){this.set("totalRecords",B);}else{this.fireEvent("changeRequest",this.getState({"totalRecords":B}));}}},getStartIndex:function(){return this.get("recordOffset");},setStartIndex:function(B,A){if(YAHOO.lang.isNumber(B)&&B>=0&&B!==this.get("recordOffset")){if(this.get("updateOnChange")||A){this.set("recordOffset",B);}else{this.fireEvent("changeRequest",this.getState({"recordOffset":B}));}}},getState:function(C){var F=YAHOO.widget.Paginator.VALUE_UNLIMITED,A=YAHOO.lang;var B={paginator:this,page:this.getCurrentPage(),totalRecords:this.get("totalRecords"),recordOffset:this.get("recordOffset"),rowsPerPage:this.get("rowsPerPage"),records:this.getPageRecords()};if(!C){return B;}var E=B.recordOffset;var D={paginator:this,before:B,rowsPerPage:C.rowsPerPage||B.rowsPerPage,totalRecords:(A.isNumber(C.totalRecords)?Math.max(C.totalRecords,F):B.totalRecords)};if(D.totalRecords===0){E=0;D.page=0;}else{if(!A.isNumber(C.recordOffset)&&A.isNumber(C.page)){E=(C.page-1)*D.rowsPerPage;if(D.totalRecords===F){D.page=C.page;}else{D.page=Math.min(C.page,Math.ceil(D.totalRecords/D.rowsPerPage));E=Math.min(E,D.totalRecords-1);}}else{E=Math.min(E,D.totalRecords-1);D.page=Math.floor(E/D.rowsPerPage)+1;}}D.recordOffset=D.recordOffset||E-(E%D.rowsPerPage);D.records=[D.recordOffset,D.recordOffset+D.rowsPerPage-1];if(D.totalRecords!==F&&D.recordOffset<D.totalRecords&&D.records[1]>D.totalRecords-1){D.records[1]=D.totalRecords-1;}return D;}};YAHOO.lang.augmentProto(YAHOO.widget.Paginator,YAHOO.util.AttributeProvider);(function(){YAHOO.widget.Paginator.ui={};var C=YAHOO.widget.Paginator,B=C.ui,A=YAHOO.lang;B.FirstPageLink=function(D){this.paginator=D;D.createEvent("firstPageLinkLabelChange");D.createEvent("firstPageLinkClassChange");
+D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("firstPageLinkLabelChange",this.update,this,true);D.subscribe("firstPageLinkClassChange",this.update,this,true);};B.FirstPageLink.init=function(D){D.setAttributeConfig("firstPageLinkLabel",{value:"&lt;&lt;&nbsp;first",validator:A.isString});D.setAttributeConfig("firstPageLinkClass",{value:"yui-pg-first",validator:A.isString});};B.FirstPageLink.prototype={current:null,link:null,span:null,render:function(E){var F=this.paginator,G=F.get("firstPageLinkClass"),D=F.get("firstPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=E+"-first-link";this.link.href="#";this.link.className=G;this.link.innerHTML=D;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=E+"-first-span";this.span.className=G;this.span.innerHTML=D;this.current=F.get("recordOffset")<1?this.span:this.link;return this.current;},update:function(E){if(E&&E.prevValue===E.newValue){return ;}var D=this.current?this.current.parentNode:null;if(this.paginator.get("recordOffset")<1){if(D&&this.current===this.link){D.replaceChild(this.span,this.current);this.current=this.span;}}else{if(D&&this.current===this.span){D.replaceChild(this.link,this.current);this.current=this.link;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);},onClick:function(D){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(1);}};B.LastPageLink=function(D){this.paginator=D;D.createEvent("lastPageLinkLabelChange");D.createEvent("lastPageLinkClassChange");D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("totalRecordsChange",this.update,this,true);D.subscribe("rowsPerPageChange",this.update,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("lastPageLinkLabelChange",this.update,this,true);D.subscribe("lastPageLinkClassChange",this.update,this,true);};B.LastPageLink.init=function(D){D.setAttributeConfig("lastPageLinkLabel",{value:"last&nbsp;&gt;&gt;",validator:A.isString});D.setAttributeConfig("lastPageLinkClass",{value:"yui-pg-last",validator:A.isString});};B.LastPageLink.prototype={current:null,link:null,span:null,na:null,render:function(E){var G=this.paginator,H=G.get("lastPageLinkClass"),D=G.get("lastPageLinkLabel"),F=G.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");this.na=this.span.cloneNode(false);this.link.id=E+"-last-link";this.link.href="#";this.link.className=H;this.link.innerHTML=D;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=E+"-last-span";this.span.className=H;this.span.innerHTML=D;this.na.id=E+"-last-na";switch(F){case C.VALUE_UNLIMITED:this.current=this.na;break;case G.getCurrentPage():this.current=this.span;break;default:this.current=this.link;}return this.current;},update:function(E){if(E&&E.prevValue===E.newValue){return ;}var D=this.current?this.current.parentNode:null,F=this.link;if(D){switch(this.paginator.getTotalPages()){case C.VALUE_UNLIMITED:F=this.na;break;case this.paginator.getCurrentPage():F=this.span;break;}if(this.current!==F){D.replaceChild(F,this.current);this.current=F;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);},onClick:function(D){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(this.paginator.getTotalPages());}};B.PreviousPageLink=function(D){this.paginator=D;D.createEvent("previousPageLinkLabelChange");D.createEvent("previousPageLinkClassChange");D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("previousPageLinkLabelChange",this.update,this,true);D.subscribe("previousPageLinkClassChange",this.update,this,true);};B.PreviousPageLink.init=function(D){D.setAttributeConfig("previousPageLinkLabel",{value:"&lt;&nbsp;prev",validator:A.isString});D.setAttributeConfig("previousPageLinkClass",{value:"yui-pg-previous",validator:A.isString});};B.PreviousPageLink.prototype={current:null,link:null,span:null,render:function(E){var F=this.paginator,G=F.get("previousPageLinkClass"),D=F.get("previousPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=E+"-prev-link";this.link.href="#";this.link.className=G;this.link.innerHTML=D;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=E+"-prev-span";this.span.className=G;this.span.innerHTML=D;this.current=F.get("recordOffset")<1?this.span:this.link;return this.current;},update:function(E){if(E&&E.prevValue===E.newValue){return ;}var D=this.current?this.current.parentNode:null;if(this.paginator.get("recordOffset")<1){if(D&&this.current===this.link){D.replaceChild(this.span,this.current);this.current=this.span;}}else{if(D&&this.current===this.span){D.replaceChild(this.link,this.current);this.current=this.link;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);},onClick:function(D){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(this.paginator.getPreviousPage());}};B.NextPageLink=function(D){this.paginator=D;D.createEvent("nextPageLinkLabelChange");D.createEvent("nextPageLinkClassChange");D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("totalRecordsChange",this.update,this,true);D.subscribe("rowsPerPageChange",this.update,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("nextPageLinkLabelChange",this.update,this,true);D.subscribe("nextPageLinkClassChange",this.update,this,true);};B.NextPageLink.init=function(D){D.setAttributeConfig("nextPageLinkLabel",{value:"next&nbsp;&gt;",validator:A.isString});D.setAttributeConfig("nextPageLinkClass",{value:"yui-pg-next",validator:A.isString});};B.NextPageLink.prototype={current:null,link:null,span:null,render:function(E){var G=this.paginator,H=G.get("nextPageLinkClass"),D=G.get("nextPageLinkLabel"),F=G.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=E+"-next-link";
+this.link.href="#";this.link.className=H;this.link.innerHTML=D;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=E+"-next-span";this.span.className=H;this.span.innerHTML=D;this.current=G.getCurrentPage()===F?this.span:this.link;return this.current;},update:function(F){if(F&&F.prevValue===F.newValue){return ;}var E=this.paginator.getTotalPages(),D=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()!==E){if(D&&this.current===this.span){D.replaceChild(this.link,this.current);this.current=this.link;}}else{if(this.current===this.link){if(D){D.replaceChild(this.span,this.current);this.current=this.span;}}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);},onClick:function(D){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(this.paginator.getNextPage());}};B.PageLinks=function(D){this.paginator=D;D.createEvent("pageLinkClassChange");D.createEvent("currentPageClassChange");D.createEvent("pageLinksContainerClassChange");D.createEvent("pageLinksChange");D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("pageLinksChange",this.rebuild,this,true);D.subscribe("totalRecordsChange",this.rebuild,this,true);D.subscribe("rowsPerPageChange",this.rebuild,this,true);D.subscribe("pageLinkClassChange",this.rebuild,this,true);D.subscribe("currentPageClassChange",this.rebuild,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("pageLinksContainerClassChange",this.rebuild,this,true);};B.PageLinks.init=function(D){D.setAttributeConfig("pageLinkClass",{value:"yui-pg-page",validator:A.isString});D.setAttributeConfig("currentPageClass",{value:"yui-pg-current-page",validator:A.isString});D.setAttributeConfig("pageLinksContainerClass",{value:"yui-pg-pages",validator:A.isString});D.setAttributeConfig("pageLinks",{value:10,validator:A.isNumber});D.setAttributeConfig("pageLabelBuilder",{value:function(E,F){return E;},validator:A.isFunction});};B.PageLinks.calculateRange=function(F,G,E){var J=C.VALUE_UNLIMITED,I,D,H;if(!F){return null;}if(E===0||G===0||(G===J&&E===J)){return[0,-1];}if(G!==J){E=E===J?G:Math.min(E,G);}I=Math.max(1,Math.ceil(F-(E/2)));if(G===J){D=I+E-1;}else{D=Math.min(G,I+E-1);}H=E-(D-I+1);I=Math.max(1,I-H);return[I,D];};B.PageLinks.prototype={current:null,container:null,render:function(D){var E=this.paginator;this.container=document.createElement("span");this.container.id=D+"-pages";this.container.className=E.get("pageLinksContainerClass");YAHOO.util.Event.on(this.container,"click",this.onClick,this,true);this.update({newValue:null,rebuild:true});return this.container;},update:function(K){if(K&&K.prevValue===K.newValue){return ;}var F=this.paginator,J=F.getCurrentPage();if(this.current!==J||K.rebuild){var M=F.get("pageLabelBuilder"),I=B.PageLinks.calculateRange(J,F.getTotalPages(),F.get("pageLinks")),E=I[0],G=I[1],L="",D,H;D='<a href="#" class="'+F.get("pageLinkClass")+'" page="';for(H=E;H<=G;++H){if(H===J){L+='<span class="'+F.get("currentPageClass")+" "+F.get("pageLinkClass")+'">'+M(H,F)+"</span>";}else{L+=D+H+'">'+M(H,F)+"</a>";}}this.container.innerHTML=L;}},rebuild:function(D){D.rebuild=true;this.update(D);},destroy:function(){YAHOO.util.Event.purgeElement(this.container,true);},onClick:function(E){var D=YAHOO.util.Event.getTarget(E);if(D&&YAHOO.util.Dom.hasClass(D,this.paginator.get("pageLinkClass"))){YAHOO.util.Event.stopEvent(E);this.paginator.setPage(parseInt(D.getAttribute("page"),10));}}};B.RowsPerPageDropdown=function(D){this.paginator=D;D.createEvent("rowsPerPageOptionsChange");D.createEvent("rowsPerPageDropdownClassChange");D.subscribe("rowsPerPageChange",this.update,this,true);D.subscribe("rowsPerPageOptionsChange",this.rebuild,this,true);D.subscribe("beforeDestroy",this.destroy,this,true);D.subscribe("rowsPerPageDropdownClassChange",this.rebuild,this,true);};B.RowsPerPageDropdown.init=function(D){D.setAttributeConfig("rowsPerPageOptions",{value:[],validator:A.isArray});D.setAttributeConfig("rowsPerPageDropdownClass",{value:"yui-pg-rpp-options",validator:A.isString});};B.RowsPerPageDropdown.prototype={select:null,render:function(D){this.select=document.createElement("select");this.select.id=D+"-rpp";this.select.className=this.paginator.get("rowsPerPageDropdownClass");this.select.title="Rows per page";YAHOO.util.Event.on(this.select,"change",this.onChange,this,true);this.rebuild();return this.select;},update:function(H){if(H&&H.prevValue===H.newValue){return ;}var G=this.paginator.get("rowsPerPage"),E=this.select.options,F,D;for(F=0,D=E.length;F<D;++F){if(parseInt(E[F].value,10)===G){E[F].selected=true;}}},rebuild:function(K){var F=this.paginator,G=this.select,L=F.get("rowsPerPageOptions"),D=document.createElement("option"),I,J;while(G.firstChild){G.removeChild(G.firstChild);}for(I=0,J=L.length;I<J;++I){var H=D.cloneNode(false),E=L[I];H.value=A.isValue(E.value)?E.value:E;H.innerHTML=A.isValue(E.text)?E.text:E;G.appendChild(H);}this.update();},destroy:function(){YAHOO.util.Event.purgeElement(this.select);},onChange:function(D){this.paginator.setRowsPerPage(parseInt(this.select.options[this.select.selectedIndex].value,10));}};B.CurrentPageReport=function(D){this.paginator=D;D.createEvent("pageReportClassChange");D.createEvent("pageReportTemplateChange");D.subscribe("recordOffsetChange",this.update,this,true);D.subscribe("totalRecordsChange",this.update,this,true);D.subscribe("rowsPerPageChange",this.update,this,true);D.subscribe("pageReportTemplateChange",this.update,this,true);D.subscribe("pageReportClassChange",this.update,this,true);};B.CurrentPageReport.init=function(D){D.setAttributeConfig("pageReportClass",{value:"yui-pg-current",validator:A.isString});D.setAttributeConfig("pageReportTemplate",{value:"({currentPage} of {totalPages})",validator:A.isString});D.setAttributeConfig("pageReportValueGenerator",{value:function(G){var F=G.getCurrentPage(),E=G.getPageRecords(F);return{"currentPage":F,"totalPages":G.getTotalPages(),"startIndex":E[0],"endIndex":E[1],"startRecord":E[0]+1,"endRecord":E[1]+1,"totalRecords":G.get("totalRecords")};
+},validator:A.isFunction});};B.CurrentPageReport.sprintf=function(E,D){return E.replace(/{([\w\s\-]+)}/g,function(F,G){return(G in D)?D[G]:"";});};B.CurrentPageReport.prototype={span:null,render:function(D){this.span=document.createElement("span");this.span.id=D+"-page-report";this.span.className=this.paginator.get("pageReportClass");this.update();return this.span;},update:function(D){if(D&&D.prevValue===D.newValue){return ;}this.span.innerHTML=B.CurrentPageReport.sprintf(this.paginator.get("pageReportTemplate"),this.paginator.get("pageReportValueGenerator")(this.paginator));}};})();YAHOO.widget.DataTable=function(A,G,I,C){var E=YAHOO.widget.DataTable,F=YAHOO.util.DataSource;this._nIndex=E._nCount;this._sId="yui-dt"+this._nIndex;this._oChain=new YAHOO.util.Chain();this._initConfigs(C);this._initDataSource(I);if(!this._oDataSource){return ;}this._initColumnSet(G);if(!this._oColumnSet){return ;}this._initRecordSet();if(!this._oRecordSet){return ;}this._initNodeTemplates();this._initContainerEl(A);if(!this._elContainer){return ;}this._initTableEl();if(!this._elContainer||!this._elThead||!this._elTbody){return ;}E.superclass.constructor.call(this,this._elContainer,this._oConfigs);var D=this.get("sortedBy");if(D){if(D.dir=="desc"){this._configs.sortedBy.value.dir=E.CLASS_DESC;}else{if(D.dir=="asc"){this._configs.sortedBy.value.dir=E.CLASS_ASC;}}}if(this._oConfigs.paginator&&!(this._oConfigs.paginator instanceof YAHOO.widget.Paginator)){this.updatePaginator(this._oConfigs.paginator);}this._initCellEditorEl();this._initColumnSort();YAHOO.util.Event.addListener(document,"click",this._onDocumentClick,this);E._nCount++;E._nCurrentCount++;var H={success:this.onDataReturnSetRecords,failure:this.onDataReturnSetRecords,scope:this,argument:{}};if(this.get("initialLoad")===true){this._oDataSource.sendRequest(this.get("initialRequest"),H);}else{if(this.get("initialLoad")===false){this.showTableMessage(E.MSG_EMPTY,E.CLASS_EMPTY);this._oChain.add({method:function(){if((this instanceof E)&&this._sId&&this._bInit){this._bInit=false;this.fireEvent("initEvent");}},scope:this});this._oChain.run();}else{var B=this.get("initialLoad");H.argument=B.argument;this._oDataSource.sendRequest(B.request,H);}}};(function(){var C=YAHOO.lang,F=YAHOO.util,E=YAHOO.widget,A=YAHOO.env.ua,D=F.Dom,I=F.Event,H=F.DataSource,G=E.DataTable,B=E.Paginator;C.augmentObject(G,{CLASS_LINER:"yui-dt-liner",CLASS_LABEL:"yui-dt-label",CLASS_COLTARGET:"yui-dt-coltarget",CLASS_RESIZER:"yui-dt-resizer",CLASS_RESIZERPROXY:"yui-dt-resizerproxy",CLASS_EDITOR:"yui-dt-editor",CLASS_PAGINATOR:"yui-dt-paginator",CLASS_PAGE:"yui-dt-page",CLASS_DEFAULT:"yui-dt-default",CLASS_PREVIOUS:"yui-dt-previous",CLASS_NEXT:"yui-dt-next",CLASS_FIRST:"yui-dt-first",CLASS_LAST:"yui-dt-last",CLASS_EVEN:"yui-dt-even",CLASS_ODD:"yui-dt-odd",CLASS_SELECTED:"yui-dt-selected",CLASS_HIGHLIGHTED:"yui-dt-highlighted",CLASS_HIDDEN:"yui-dt-hidden",CLASS_DISABLED:"yui-dt-disabled",CLASS_EMPTY:"yui-dt-empty",CLASS_LOADING:"yui-dt-loading",CLASS_ERROR:"yui-dt-error",CLASS_EDITABLE:"yui-dt-editable",CLASS_DRAGGABLE:"yui-dt-draggable",CLASS_RESIZEABLE:"yui-dt-resizeable",CLASS_SCROLLABLE:"yui-dt-scrollable",CLASS_SORTABLE:"yui-dt-sortable",CLASS_ASC:"yui-dt-asc",CLASS_DESC:"yui-dt-desc",CLASS_BUTTON:"yui-dt-button",CLASS_CHECKBOX:"yui-dt-checkbox",CLASS_DROPDOWN:"yui-dt-dropdown",CLASS_RADIO:"yui-dt-radio",MSG_EMPTY:"No records found.",MSG_LOADING:"Loading data...",MSG_ERROR:"Data error.",_nCount:0,_nCurrentCount:0,_elStylesheet:null,_bStylesheetFallback:false,_oStylesheetRules:{},_elColumnDragTarget:null,_elColumnResizerProxy:null,_cloneObject:function(M){if(C.isUndefined(M)){return M;}var O={};if(C.isArray(M)){var N=[];for(var L=0,K=M.length;L<K;L++){N[L]=G._cloneObject(M[L]);}O=N;}else{if(M.constructor==Object){for(var J in M){if(C.hasOwnProperty(M,J)){if(C.isValue(M[J])&&(M[J].constructor==Object)||C.isArray(M[J])){O[J]=G._cloneObject(M[J]);}else{O[J]=M[J];}}}}else{O=M;}}return O;},_initColumnDragTargetEl:function(){if(!G._elColumnDragTarget){var J=document.createElement("div");J.id="yui-dt-coltarget";J.className=G.CLASS_COLTARGET;J.style.display="none";document.body.insertBefore(J,document.body.firstChild);G._elColumnDragTarget=J;}return G._elColumnDragTarget;},_initColumnResizerProxyEl:function(){if(!G._elColumnResizerProxy){var J=document.createElement("div");J.id="yui-dt-colresizerproxy";D.addClass(J,G.CLASS_RESIZERPROXY);document.body.insertBefore(J,document.body.firstChild);G._elColumnResizerProxy=J;}return G._elColumnResizerProxy;},formatTheadCell:function(J,L,M){var R=L.getKey();var Q=C.isValue(L.label)?L.label:R;if(L.sortable){var O=M.getColumnSortDir(L);var N=(O===G.CLASS_DESC)?"descending":"ascending";var K=M.getId()+"-sort"+L.getId()+"-"+N;var P="Click to sort "+N;J.innerHTML='<a href="'+K+'" title="'+P+'" class="'+G.CLASS_SORTABLE+'">'+Q+"</a>";}else{J.innerHTML=Q;}},formatButton:function(J,K,L,N){var M=C.isValue(N)?N:"Click";J.innerHTML='<button type="button" class="'+G.CLASS_BUTTON+'">'+M+"</button>";},formatCheckbox:function(J,K,L,N){var M=N;M=(M)?" checked":"";J.innerHTML='<input type="checkbox"'+M+' class="'+G.CLASS_CHECKBOX+'">';},formatCurrency:function(J,K,L,M){J.innerHTML=F.Number.format(M,{prefix:"$",decimalPlaces:2,decimalSeparator:".",thousandsSeparator:","});},formatDate:function(J,K,L,M){J.innerHTML=F.Date.format(M,{format:"MM/DD/YYYY"});},formatDropdown:function(L,S,Q,J){var R=(C.isValue(J))?J:S.getData(Q.key);var T=(C.isArray(Q.dropdownOptions))?Q.dropdownOptions:null;var K;var P=L.getElementsByTagName("select");if(P.length===0){K=document.createElement("select");D.addClass(K,G.CLASS_DROPDOWN);K=L.appendChild(K);I.addListener(K,"change",this._onDropdownChange,this);}K=P[0];if(K){K.innerHTML="";if(T){for(var N=0;N<T.length;N++){var O=T[N];var M=document.createElement("option");M.value=(C.isValue(O.value))?O.value:O;M.innerHTML=(C.isValue(O.text))?O.text:O;M=K.appendChild(M);}}else{K.innerHTML='<option value="'+R+'">'+R+"</option>";}}else{L.innerHTML=C.isValue(J)?J:"";
+}},formatEmail:function(J,K,L,M){if(C.isString(M)){J.innerHTML='<a href="mailto:'+M+'">'+M+"</a>";}else{J.innerHTML=C.isValue(M)?M:"";}},formatLink:function(J,K,L,M){if(C.isString(M)){J.innerHTML='<a href="'+M+'">'+M+"</a>";}else{J.innerHTML=C.isValue(M)?M:"";}},formatNumber:function(J,K,L,M){if(C.isNumber(M)){J.innerHTML=M;}else{J.innerHTML=C.isValue(M)?M:"";}},formatRadio:function(J,K,L,N){var M=N;M=(M)?" checked":"";J.innerHTML='<input type="radio"'+M+' name="col'+L.getId()+'-radio"'+' class="'+G.CLASS_RADIO+'">';},formatText:function(J,K,M,N){var L=(C.isValue(K.getData(M.key)))?K.getData(M.key):"";J.innerHTML=L.toString().replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");},formatTextarea:function(K,L,N,O){var M=(C.isValue(L.getData(N.key)))?L.getData(N.key):"";var J="<textarea>"+M+"</textarea>";K.innerHTML=J;},formatTextbox:function(K,L,N,O){var M=(C.isValue(L.getData(N.key)))?L.getData(N.key):"";var J='<input type="text" value="'+M+'">';K.innerHTML=J;},handleSimplePagination:function(K,J){K.paginator.setTotalRecords(K.totalRecords,true);K.paginator.setStartIndex(K.recordOffset,true);K.paginator.setRowsPerPage(K.rowsPerPage,true);J.render();},handleDataSourcePagination:function(K,J){var N=K.records[1]-K.recordOffset;if(J._oRecordSet.hasRecords(K.recordOffset,N)){G.handleSimplePagination(K,J);}else{var L=J.get("generateRequest");var M=L({pagination:K},J);var O={success:J.onDataReturnSetRecords,failure:J.onDataReturnSetRecords,argument:{startIndex:K.recordOffset,pagination:K},scope:J};J._oDataSource.sendRequest(M,O);}},editCheckbox:function(S,R){var T=S.cell;var X=S.record;var P=S.column;var J=S.container;var M=S.value;if(!C.isArray(M)){M=[M];}if(P.editorOptions&&C.isArray(P.editorOptions.checkboxOptions)){var W=P.editorOptions.checkboxOptions;var O,U,N,L,K;for(L=0;L<W.length;L++){O=C.isValue(W[L].label)?W[L].label:W[L];U=R.getId()+"-editor-checkbox"+L;J.innerHTML+='<input type="checkbox"'+' name="'+R.getId()+'-editor-checkbox"'+' value="'+O+'"'+' id="'+U+'">';N=J.appendChild(document.createElement("label"));N.htmlFor=U;N.innerHTML=O;}var Q=[];var V;for(L=0;L<W.length;L++){V=D.get(R.getId()+"-editor-checkbox"+L);Q.push(V);for(K=0;K<M.length;K++){if(V.value===M[K]){V.checked=true;}}if(L===0){R._focusEl(V);}}for(L=0;L<W.length;L++){V=D.get(R.getId()+"-editor-checkbox"+L);I.addListener(V,"click",function(){var Z=[];for(var Y=0;Y<Q.length;Y++){if(Q[Y].checked){Z.push(Q[Y].value);}}R._oCellEditor.value=Z;R.fireEvent("editorUpdateEvent",{editor:R._oCellEditor});});}}},editDate:function(Q,N){var R=Q.cell;var U=Q.record;var L=Q.column;var J=Q.container;var S=Q.value;if(!(S instanceof Date)){S=Q.defaultValue||new Date();}if(YAHOO.widget.Calendar){var M=(S.getMonth()+1)+"/"+S.getDate()+"/"+S.getFullYear();var T=J.appendChild(document.createElement("div"));var P=L.getColEl();T.id=P+"-dateContainer";var K=new YAHOO.widget.Calendar(P+"-date",T.id,{selected:M,pagedate:S});K.render();T.style.cssFloat="none";if(A.ie==6){var O=J.appendChild(document.createElement("br"));O.style.clear="both";}K.selectEvent.subscribe(function(W,V,X){N._oCellEditor.value=new Date(V[0][0][0],V[0][0][1]-1,V[0][0][2]);N.fireEvent("editorUpdateEvent",{editor:N._oCellEditor});});}else{}},editDropdown:function(P,O){var Q=P.cell;var U=P.record;var M=P.column;var K=P.container;var R=P.value;if(!C.isValue(R)){R=P.defaultValue;}var T=K.appendChild(document.createElement("select"));var S=(M.editorOptions&&C.isArray(M.editorOptions.dropdownOptions))?M.editorOptions.dropdownOptions:[];for(var L=0;L<S.length;L++){var N=S[L];var J=document.createElement("option");J.value=(C.isValue(N.value))?N.value:N;J.innerHTML=(C.isValue(N.text))?N.text:N;J=T.appendChild(J);if(R===T.options[L].value){T.options[L].selected=true;}}I.addListener(T,"change",function(){O._oCellEditor.value=T[T.selectedIndex].value;O.fireEvent("editorUpdateEvent",{editor:O._oCellEditor});});O._focusEl(T);},editRadio:function(Q,O){var R=Q.cell;var V=Q.record;var N=Q.column;var J=Q.container;var S=Q.value;if(!C.isValue(S)){S=Q.defaultValue;}if(N.editorOptions&&C.isArray(N.editorOptions.radioOptions)){var P=N.editorOptions.radioOptions;var K,T,M,L;for(L=0;L<P.length;L++){K=C.isValue(P[L].label)?P[L].label:P[L];T=O.getId()+"-col"+N.getId()+"-radioeditor"+L;J.innerHTML+='<input type="radio"'+' name="'+O.getId()+'-editor-radio"'+' value="'+K+'"'+' id="'+T+'">';M=J.appendChild(document.createElement("label"));M.htmlFor=T;M.innerHTML=K;}for(L=0;L<P.length;L++){var U=D.get(O.getId()+"-col"+N.getId()+"-radioeditor"+L);if(S===U.value){U.checked=true;O._focusEl(U);}I.addListener(U,"click",function(){O._oCellEditor.value=this.value;O.fireEvent("editorUpdateEvent",{editor:O._oCellEditor});});}}},editTextarea:function(Q,K){var N=Q.cell;var L=Q.record;var P=Q.column;var O=Q.container;var M=Q.value;if(!C.isValue(M)){M=Q.defaultValue||"";}var J=O.appendChild(document.createElement("textarea"));J.style.width=N.offsetWidth+"px";J.style.height="3em";J.value=M;I.addListener(J,"keyup",function(){K._oCellEditor.value=J.value;K.fireEvent("editorUpdateEvent",{editor:K._oCellEditor});});J.focus();J.select();},editTextbox:function(P,J){var M=P.cell;var K=P.record;var O=P.column;var N=P.container;var L=P.value;if(!C.isValue(L)){L=P.defaultValue||"";}var Q=N.appendChild(document.createElement("input"));Q.type="text";Q.style.width=M.offsetWidth+"px";Q.value=L;I.addListener(Q,"keyup",function(){J._oCellEditor.value=Q.value;J.fireEvent("editorUpdateEvent",{editor:J._oCellEditor});});Q.focus();Q.select();},validateNumber:function(K){var J=K*1;if(C.isNumber(J)){return J;}else{return null;}},_generateRequest:function(L,K){var J=L;if(L.pagination){if(K._oDataSource.dataType===H.TYPE_XHR){J="?page="+L.pagination.page+"&recordOffset="+L.pagination.recordOffset+"&rowsPerPage="+L.pagination.rowsPerPage;}}return J;}});G.Formatter={button:G.formatButton,checkbox:G.formatCheckbox,currency:G.formatCurrency,"date":G.formatDate,dropdown:G.formatDropdown,email:G.formatEmail,link:G.formatLink,"number":G.formatNumber,radio:G.formatRadio,text:G.formatText,textarea:G.formatTextarea,textbox:G.formatTextbox};
+C.extend(G,F.Element,{initAttributes:function(J){J=J||{};G.superclass.initAttributes.call(this,J);this.setAttributeConfig("summary",{value:null,validator:C.isString,method:function(K){this._elThead.parentNode.summary=K;}});this.setAttributeConfig("selectionMode",{value:"standard",validator:C.isString});this.setAttributeConfig("initialRequest",{value:null});this.setAttributeConfig("initialLoad",{value:true});this.setAttributeConfig("generateRequest",{value:G._generateRequest,validator:C.isFunction});this.setAttributeConfig("sortedBy",{value:null,validator:function(K){return(K&&(K.constructor==Object)&&K.key);},method:function(K){var M=this.get("sortedBy");if(M&&(M.constructor==Object)&&M.key){var O=this._oColumnSet.getColumn(M.key);var N=this.getThEl(O);D.removeClass(N,G.CLASS_ASC);D.removeClass(N,G.CLASS_DESC);}var P=(K.column)?K.column:this._oColumnSet.getColumn(K.key);if(P){if(K.dir&&((K.dir=="asc")||(K.dir=="desc"))){var Q=(K.dir=="desc")?G.CLASS_DESC:G.CLASS_ASC;D.addClass(P.getThEl(),Q);}else{var L=K.dir||G.CLASS_ASC;D.addClass(P.getThEl(),L);}}}});this.setAttributeConfig("paginator",{value:{rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]},validator:function(K){if(typeof K==="object"&&K){if(K instanceof B){return true;}else{if(K&&(K.constructor==Object)){if((K.rowsPerPage!==undefined)&&(K.currentPage!==undefined)&&(K.startRecordIndex!==undefined)&&(K.totalRecords!==undefined)&&(K.totalPages!==undefined)&&(K.rowsThisPage!==undefined)&&(K.pageLinks!==undefined)&&(K.pageLinksStart!==undefined)&&(K.dropdownOptions!==undefined)&&(K.containers!==undefined)&&(K.dropdowns!==undefined)&&(K.links!==undefined)){if(C.isNumber(K.rowsPerPage)&&C.isNumber(K.currentPage)&&C.isNumber(K.startRecordIndex)&&C.isNumber(K.totalRecords)&&C.isNumber(K.totalPages)&&C.isNumber(K.rowsThisPage)&&C.isNumber(K.pageLinks)&&C.isNumber(K.pageLinksStart)&&C.isArray(K.dropdownOptions)&&C.isArray(K.containers)&&C.isArray(K.dropdowns)&&C.isArray(K.links)){return true;}}}}}return false;},method:function(L){if(L instanceof B){L.subscribe("changeRequest",this.onPaginatorChange,this,true);var M=L.getContainerNodes();if(!M.length){var K=document.createElement("div");K.id=this._sId+"-paginator0";this._elContainer.insertBefore(K,this._elContainer.firstChild);var N=document.createElement("div");N.id=this._sId+"-paginator1";this._elContainer.appendChild(N);M=[K,N];D.addClass(M,G.CLASS_PAGINATOR);L.set("containers",M);}}}});this.setAttributeConfig("paginated",{value:false,validator:C.isBoolean,method:function(N){var P=this.get("paginated");var L,M;if(N==P){return ;}var Q=this.get("paginator");if(!(Q instanceof B)){Q=Q||{rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]};var O=Q.containers;if(N){if(O.length===0){var U=document.createElement("span");U.id=this._sId+"-paginator0";D.addClass(U,G.CLASS_PAGINATOR);U=this._elContainer.insertBefore(U,this._elContainer.firstChild);O.push(U);var S=document.createElement("span");S.id=this._sId+"-paginator1";D.addClass(S,G.CLASS_PAGINATOR);S=this._elContainer.appendChild(S);O.push(S);Q.containers=O;this._configs.paginator.value=Q;}else{for(L=0;L<O.length;L++){O[L].style.display="";}}if(Q.pageLinks>-1){var T=Q.links;if(T.length===0){for(L=0;L<O.length;L++){var R=document.createElement("span");R.id="yui-dt-pagselect"+L;R=O[L].appendChild(R);I.addListener(R,"click",this._onPaginatorLinkClick,this);this._configs.paginator.value.links.push(R);}}}for(L=0;L<O.length;L++){var K=document.createElement("select");D.addClass(K,G.CLASS_DROPDOWN);K=O[L].appendChild(K);K.id="yui-dt-pagselect"+L;I.addListener(K,"change",this._onPaginatorDropdownChange,this);this._configs.paginator.value.dropdowns.push(K);if(!Q.dropdownOptions){K.style.display="none";}}}else{if(O.length>0){for(L=0;L<O.length;L++){O[L].style.display="none";}}}}}});this.setAttributeConfig("paginationEventHandler",{value:G.handleSimplePagination,validator:C.isObject});this.setAttributeConfig("caption",{value:null,validator:C.isString,method:function(K){if(!this._elCaption){this._elCaption=this._elThead.parentNode.insertBefore(document.createElement("caption"),this._elThead.parentNode.firstChild);}this._elCaption.innerHTML=K;}});this.setAttributeConfig("scrollable",{value:false,validator:function(K){return(C.isBoolean(K));},method:function(K){if(K){D.addClass(this._elContainer,G.CLASS_SCROLLABLE);if(A.webkit&&A.webkit<420){this._elTbodyContainer.style.marginTop=this._elTbody.parentNode.style.marginTop.replace("-","");}this._syncScrollPadding();}else{D.removeClass(this._elContainer,G.CLASS_SCROLLABLE);if(A.webkit&&A.webkit<420){this._elTbodyContainer.style.marginTop="";}this._syncScrollPadding();}}});this.setAttributeConfig("width",{value:null,validator:C.isString,method:function(K){if(this.get("scrollable")){this._elTheadContainer.style.width=K;this._elTbodyContainer.style.width=K;}}});this.setAttributeConfig("height",{value:null,validator:C.isString,method:function(K){if(this.get("scrollable")){this._elTbodyContainer.style.height=K;}}});this.setAttributeConfig("draggableColumns",{value:false,validator:C.isBoolean,writeOnce:true});this.setAttributeConfig("renderLoopSize",{value:0,validator:C.isNumber});},_bInit:true,_nIndex:null,_nTrCount:0,_nTdCount:0,_sId:null,_oChain:null,_aFallbackColResizer:[],_elContainer:null,_elTheadContainer:null,_elTbodyContainer:null,_elCaption:null,_elThead:null,_elTbody:null,_elMsgTbody:null,_elMsgTbodyRow:null,_elMsgTbodyCell:null,_oDataSource:null,_oColumnSet:null,_oRecordSet:null,_sFirstTrId:null,_sLastTrId:null,_tdElTemplate:null,_trElTemplate:null,_bScrollbarX:null,clearTextSelection:function(){var J;if(window.getSelection){J=window.getSelection();}else{if(document.getSelection){J=document.getSelection();}else{if(document.selection){J=document.selection;}}}if(J){if(J.empty){J.empty();
+}else{if(J.removeAllRanges){J.removeAllRanges();}else{if(J.collapse){J.collapse();}}}}},_focusEl:function(J){J=J||this._elTbody;setTimeout(function(){try{J.focus();}catch(K){}},0);},_syncColWidths:function(){var R=this._oColumnSet.keys,J=this.getFirstTrEl();if(R&&J&&(J.cells.length===R.length)){var T=false;if((YAHOO.env.ua.gecko||YAHOO.env.ua.opera)&&this.get("scrollable")&&this.get("width")){T=true;this._elTheadContainer.style.width="";this._elTbodyContainer.style.width="";}var O,Q,L=J.cells.length;for(O=0;O<L;O++){Q=R[O];if(!Q.width){this._setColumnWidth(Q,"auto");}}for(O=0;O<L;O++){Q=R[O];var N;if(!Q.width){var M=Q.getThEl();var P=J.cells[O];if(M.offsetWidth!==P.offsetWidth){var S=(M.offsetWidth>P.offsetWidth)?M.firstChild:P.firstChild;N=S.offsetWidth-(parseInt(D.getStyle(S,"paddingLeft"),10)|0)-(parseInt(D.getStyle(S,"paddingRight"),10)|0);N=(Q.minWidth&&(Q.minWidth>N))?Q.minWidth:N;}}else{N=Q.width;}if(Q.hidden){Q._nLastWidth=N;N=1;}this._setColumnWidth(Q,N+"px");}if(T){var K=this.get("width");this._elTheadContainer.style.width=K;this._elTbodyContainer.style.width=K;}}this._syncScrollPadding();},_syncScrollPadding:function(){if(this.get("scrollable")){var L=this._elTbody,N=this._elTbodyContainer,P,J,O,M,K;if(!this.get("height")&&(A.ie)){N.style.height=(N.scrollWidth>N.offsetWidth)?(L.offsetHeight+19)+"px":L.offsetHeight+"px";}if(!this.get("width")){this._elContainer.style.width=(N.scrollHeight>N.offsetHeight)?(L.parentNode.offsetWidth+19)+"px":(L.parentNode.offsetWidth)+"px";}else{if(N.scrollWidth>N.offsetWidth){if(!this._bScrollbarX){P=this._oColumnSet.headers[this._oColumnSet.headers.length-1];J=P.length;O=this._sId+"-th";for(M=0;M<J;M++){K=D.get(O+P[M]).firstChild;K.style.marginRight=(parseInt(D.getStyle(K,"marginRight"),10)+27)+"px";}this._bScrollbarX=true;}}else{if(this._bScrollbarX){P=this._oColumnSet.headers[this._oColumnSet.headers.length-1];J=P.length;O=this._sId+"-th";for(M=0;M<J;M++){K=D.get(O+P[M]).firstChild;D.setStyle(K,"marginRight","");}this._bScrollbarX=false;}}}}},_initNodeTemplates:function(){var K=document,J=K.createElement("tr"),M=K.createElement("td"),L=K.createElement("div");M.appendChild(L);this._tdElTemplate=M;this._trElTemplate=J;},_initContainerEl:function(J){if(this._elContainer){I.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";}J=D.get(J);if(J&&J.nodeName&&(J.nodeName.toLowerCase()=="div")){I.purgeElement(J,true);J.innerHTML="";D.addClass(J,"yui-dt yui-dt-noop");this._elTheadContainer=J.appendChild(document.createElement("div"));D.addClass(this._elTheadContainer,"yui-dt-hd");this._elTbodyContainer=J.appendChild(document.createElement("div"));D.addClass(this._elTbodyContainer,"yui-dt-bd");this._elContainer=J;}},_initConfigs:function(J){if(J){if(J.constructor!=Object){J=null;}else{if(C.isBoolean(J.paginator)){}}this._oConfigs=J;}else{this._oConfigs={};}},_initColumnSet:function(L){if(this._oColumnSet){for(var K=0,J=this._oColumnSet.keys.length;K<J;K++){G._oStylesheetRules[".yui-dt-col-"+this._oColumnSet.keys[K].getId()]=undefined;}this._oColumnSet=null;}if(C.isArray(L)){this._oColumnSet=new YAHOO.widget.ColumnSet(L);}else{if(L instanceof YAHOO.widget.ColumnSet){this._oColumnSet=L;}}},_initDataSource:function(J){this._oDataSource=null;if(J&&(J instanceof H)){this._oDataSource=J;}else{var K=null;var O=this._elContainer;var L;if(O.hasChildNodes()){var N=O.childNodes;for(L=0;L<N.length;L++){if(N[L].nodeName&&N[L].nodeName.toLowerCase()=="table"){K=N[L];break;}}if(K){var M=[];for(L=0;L<this._oColumnSet.keys.length;L++){M.push({key:this._oColumnSet.keys[L].key});}this._oDataSource=new H(K);this._oDataSource.responseType=H.TYPE_HTMLTABLE;this._oDataSource.responseSchema={fields:M};}}}},_initRecordSet:function(){if(this._oRecordSet){this._oRecordSet.reset();}else{this._oRecordSet=new YAHOO.widget.RecordSet();}},_initTableEl:function(){var S;if(this._elThead){var N;var V=this._oColumnSet.tree[0];for(N=0;N<V.length;N++){if(V[N]._dd){V[N]._dd=V[N]._dd.unreg();}}var U=this._oColumnSet.keys;for(N=0;N<U.length;N++){if(U[N]._ddResizer){U[N]._ddResizer=U[N]._ddResizer.unreg();}}S=this._elThead.parentNode;I.purgeElement(S,true);S.parentNode.removeChild(S);this._elThead=null;}if(this._elTbody){S=this._elTbody.parentNode;I.purgeElement(S,true);S.parentNode.removeChild(S);this._elTbody=null;}var W=document.createElement("table");W.id=this._sId+"-headtable";W=this._elTheadContainer.appendChild(W);var T=document.createElement("table");T.id=this._sId+"-bodytable";this._elTbodyContainer.appendChild(T);this._initTheadEls();this._elTbody=T.appendChild(document.createElement("tbody"));this._elTbody.tabIndex=0;D.addClass(this._elTbody,G.CLASS_BODY);this._elTbody.parentNode.style.marginTop="-"+this._elTbody.offsetTop+"px";var Q=document.createElement("tbody");var J=Q.appendChild(document.createElement("tr"));D.addClass(J,G.CLASS_FIRST);D.addClass(J,G.CLASS_LAST);this._elMsgRow=J;var R=J.appendChild(document.createElement("td"));R.colSpan=this._oColumnSet.keys.length;D.addClass(R,G.CLASS_FIRST);D.addClass(R,G.CLASS_LAST);this._elMsgTd=R;this._elMsgTbody=T.appendChild(Q);var O=R.appendChild(document.createElement("div"));D.addClass(O,G.CLASS_LINER);this.showTableMessage(G.MSG_LOADING,G.CLASS_LOADING);var L=this._elContainer;var M=this._elThead;var K=this._elTbody;if(A.ie){K.hideFocus=true;}var P=this._elTbodyContainer;I.addListener(L,"focus",this._onTableFocus,this);I.addListener(K,"focus",this._onTbodyFocus,this);I.addListener(K,"mouseover",this._onTableMouseover,this);I.addListener(K,"mouseout",this._onTableMouseout,this);I.addListener(K,"mousedown",this._onTableMousedown,this);I.addListener(K,"keydown",this._onTbodyKeydown,this);I.addListener(K,"keypress",this._onTableKeypress,this);I.addListener(K.parentNode,"dblclick",this._onTableDblclick,this);I.addListener(K,"click",this._onTbodyClick,this);I.addListener(P,"scroll",this._onScroll,this);},_initTheadEls:function(){var Z,X,V,a,M,P;if(!this._elThead){a=this._elTheadContainer.firstChild.appendChild(document.createElement("thead"));
+this._elThead=a;M=this._elTbodyContainer.firstChild.appendChild(document.createElement("thead"));this._elA11yThead=M;P=[a,M];I.addListener(a,"focus",this._onTheadFocus,this);I.addListener(a,"keydown",this._onTheadKeydown,this);I.addListener(a,"mouseover",this._onTableMouseover,this);I.addListener(a,"mouseout",this._onTableMouseout,this);I.addListener(a,"mousedown",this._onTableMousedown,this);I.addListener(a,"mouseup",this._onTableMouseup,this);I.addListener(a,"click",this._onTheadClick,this);I.addListener(a.parentNode,"dblclick",this._onTableDblclick,this);}else{a=this._elThead;M=this._elA11yThead;P=[a,M];for(Z=0;Z<P.length;Z++){for(X=P[Z].rows.length-1;X>-1;X--){I.purgeElement(P[Z].rows[X],true);P[Z].removeChild(P[Z].rows[X]);}}}var Q,c=this._oColumnSet;var L=c.tree;var O;for(V=0;V<P.length;V++){for(Z=0;Z<L.length;Z++){var W=P[V].appendChild(document.createElement("tr"));W.id=this._sId+"-hdrow"+Z;for(X=0;X<L[Z].length;X++){Q=L[Z][X];O=W.appendChild(document.createElement("th"));if(V===0){Q._elTh=O;}var S=(V===1)?this._sId+"-th"+Q.getId()+"-a11y":this._sId+"-th"+Q.getId();O.id=S;O.yuiCellIndex=X;this._initThEl(O,Q,Z,X,(V===1));}if(V===0){if(Z===0){D.addClass(W,G.CLASS_FIRST);}if(Z===(L.length-1)){D.addClass(W,G.CLASS_LAST);}}}if(V===0){var U=c.headers[0];var N=c.headers[c.headers.length-1];for(Z=0;Z<U.length;Z++){D.addClass(D.get(this._sId+"-th"+U[Z]),G.CLASS_FIRST);}for(Z=0;Z<N.length;Z++){D.addClass(D.get(this._sId+"-th"+N[Z]),G.CLASS_LAST);}var T=(F.DD)?true:false;var b=false;if(this._oConfigs.draggableColumns){for(Z=0;Z<this._oColumnSet.tree[0].length;Z++){Q=this._oColumnSet.tree[0][Z];if(T){O=Q.getThEl();D.addClass(O,G.CLASS_DRAGGABLE);var R=G._initColumnDragTargetEl();Q._dd=new YAHOO.widget.ColumnDD(this,Q,O,R);}else{b=true;}}}for(Z=0;Z<this._oColumnSet.keys.length;Z++){Q=this._oColumnSet.keys[Z];if(Q.resizeable){if(T){O=Q.getThEl();D.addClass(O,G.CLASS_RESIZEABLE);var K=O.firstChild;var J=K.appendChild(document.createElement("div"));J.id=this._sId+"-colresizer"+Q.getId();Q._elResizer=J;D.addClass(J,G.CLASS_RESIZER);var d=G._initColumnResizerProxyEl();Q._ddResizer=new YAHOO.util.ColumnResizer(this,Q,O,J.id,d);var Y=function(f){I.stopPropagation(f);};I.addListener(J,"click",Y);}else{b=true;}}}if(b){}}else{}}},_initThEl:function(Q,O,S,K,R){var N=O.getKey();var J=O.getId();Q.yuiColumnKey=N;Q.yuiColumnId=J;Q.innerHTML="";Q.rowSpan=O.getRowspan();Q.colSpan=O.getColspan();var P=Q.appendChild(document.createElement("div"));var M=P.appendChild(document.createElement("span"));if(R){if(O.abbr){Q.abbr=O.abbr;}M.innerHTML=C.isValue(O.label)?O.label:N;}else{P.id=Q.id+"-liner";var L;if(C.isString(O.className)){L=[O.className];}else{if(C.isArray(O.className)){L=O.className;}else{L=[];}}L[L.length]="yui-dt-col-"+N.replace(/[^\w\-.:]/g,"");L[L.length]="yui-dt-col-"+O.getId();L[L.length]=G.CLASS_LINER;D.addClass(P,L.join(" "));D.addClass(M,G.CLASS_LABEL);L=[];if(O.resizeable){L[L.length]=G.CLASS_RESIZEABLE;}if(O.sortable){L[L.length]=G.CLASS_SORTABLE;}if(O.hidden){L[L.length]=G.CLASS_HIDDEN;}if(O.selected){L[L.length]=G.CLASS_SELECTED;}D.addClass(Q,L.join(" "));G.formatTheadCell(M,O,this);}},_initCellEditorEl:function(){var J=document.createElement("div");J.id=this._sId+"-celleditor";J.style.display="none";J.tabIndex=0;D.addClass(J,G.CLASS_EDITOR);var L=D.getFirstChild(document.body);if(L){J=D.insertBefore(J,L);}else{J=document.body.appendChild(J);}var K={};K.container=J;K.value=null;K.isActive=false;this._oCellEditor=K;},_initColumnSort:function(){this.subscribe("theadCellClickEvent",this.onEventSortColumn);},_createTrEl:function(K){var J=this._trElTemplate.cloneNode(true);J.id=this._sId+"-bdrow"+this._nTrCount;this._nTrCount++;return this._updateTrEl(J,K);},_updateTrEl:function(J,W){var T=this._oColumnSet,M,K,L=this.get("sortedBy"),P,O,R,V;if(L){M=L.key;K=L.dir;}J.style.display="none";while(J.childNodes.length>T.keys.length){J.removeChild(J.firstChild);}for(P=J.childNodes.length||0,R=T.keys.length;P<R;++P){this._addTdEl(J,T.keys[P],P);}for(P=0,R=T.keys.length;P<R;++P){var Q=T.keys[P],U=J.childNodes[P],N=U.firstChild,S="";this.formatCell(N,W,Q);for(O=0,V=T.headers[P].length;O<V;++O){S+=this._sId+"-th"+T.headers[P][O]+"-a11y ";}U.headers=S;if(Q.key===M){D.replaceClass(U,K===G.CLASS_ASC?G.CLASS_DESC:G.CLASS_ASC,K);}else{D.removeClass(U,G.CLASS_ASC);D.removeClass(U,G.CLASS_DESC);}if(Q.hidden){D.addClass(U,G.CLASS_HIDDEN);}else{D.removeClass(U,G.CLASS_HIDDEN);}if(Q.selected){D.addClass(U,G.CLASS_SELECTED);}else{D.removeClass(U,G.CLASS_SELECTED);}}J.yuiRecordId=W.getId();J.style.display="";return J;},_addTdEl:function(J,M,K){var L=this._tdElTemplate.cloneNode(true),N=L.firstChild;K=K||J.cells.length;L.id=J.id+"-cell"+this._nTdCount;this._nTdCount++;L.yuiColumnKey=M.getKey();L.yuiColumnId=M.getId();L.yuiCellIndex=K;if(!(K%this._oColumnSet.keys.length-1)){L.className=K?G.CLASS_LAST:G.CLASS_FIRST;}var O=J.cells[K]||null;return J.insertBefore(L,O);},_deleteTrEl:function(J){var K;if(!C.isNumber(J)){K=D.get(J).sectionRowIndex;}else{K=J;}if(C.isNumber(K)&&(K>-2)&&(K<this._elTbody.rows.length)){this._elTbody.deleteRow(K);return true;}else{return false;}},_setFirstRow:function(){var J=this.getFirstTrEl();if(J){if(this._sFirstTrId){D.removeClass(this._sFirstTrId,G.CLASS_FIRST);}D.addClass(J,G.CLASS_FIRST);this._sFirstTrId=J.id;}else{this._sFirstTrId=null;}},_setLastRow:function(){var J=this.getLastTrEl();if(J){if(this._sLastTrId){D.removeClass(this._sLastTrId,G.CLASS_LAST);}D.addClass(J,G.CLASS_LAST);this._sLastTrId=J.id;}else{this._sLastTrId=null;}},_setRowStripes:function(T,L){var M=this._elTbody.rows,Q=0,S=M.length,P=[],R=0,N=[],J=0;if((T!==null)&&(T!==undefined)){var O=this.getTrEl(T);if(O){Q=O.sectionRowIndex;if(C.isNumber(L)&&(L>1)){S=Q+L;}}}for(var K=Q;K<S;K++){if(K%2){P[R++]=M[K];}else{N[J++]=M[K];}}if(P.length){D.replaceClass(P,G.CLASS_EVEN,G.CLASS_ODD);}if(N.length){D.replaceClass(N,G.CLASS_ODD,G.CLASS_EVEN);}},_onScroll:function(L,K){K._elTheadContainer.scrollLeft=K._elTbodyContainer.scrollLeft;if(K._oCellEditor&&K._oCellEditor.isActive){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});
+K.cancelCellEditor();}var M=I.getTarget(L);var J=M.nodeName.toLowerCase();K.fireEvent("tableScrollEvent",{event:L,target:M});},_onDocumentClick:function(L,K){var M=I.getTarget(L);var J=M.nodeName.toLowerCase();if(!D.isAncestor(K._elContainer,M)){K.fireEvent("tableBlurEvent");if(K._oCellEditor&&K._oCellEditor.isActive){if(!D.isAncestor(K._oCellEditor.container,M)&&(K._oCellEditor.container.id!==M.id)){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});}}}},_onTableFocus:function(K,J){J.fireEvent("tableFocusEvent");},_onTheadFocus:function(K,J){J.fireEvent("theadFocusEvent");J.fireEvent("tableFocusEvent");},_onTbodyFocus:function(K,J){J.fireEvent("tbodyFocusEvent");J.fireEvent("tableFocusEvent");},_onTableMouseover:function(M,K){var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"a":break;case"td":L=K.fireEvent("cellMouseoverEvent",{target:N,event:M});break;case"span":if(D.hasClass(N,G.CLASS_LABEL)){L=K.fireEvent("theadLabelMouseoverEvent",{target:N,event:M});L=K.fireEvent("headerLabelMouseoverEvent",{target:N,event:M});}break;case"th":L=K.fireEvent("theadCellMouseoverEvent",{target:N,event:M});L=K.fireEvent("headerCellMouseoverEvent",{target:N,event:M});break;case"tr":if(N.parentNode.nodeName.toLowerCase()=="thead"){L=K.fireEvent("theadRowMouseoverEvent",{target:N,event:M});L=K.fireEvent("headerRowMouseoverEvent",{target:N,event:M});}else{L=K.fireEvent("rowMouseoverEvent",{target:N,event:M});}break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableMouseoverEvent",{target:(N||K._elContainer),event:M});},_onTableMouseout:function(M,K){var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"a":break;case"td":L=K.fireEvent("cellMouseoutEvent",{target:N,event:M});break;case"span":if(D.hasClass(N,G.CLASS_LABEL)){L=K.fireEvent("theadLabelMouseoutEvent",{target:N,event:M});L=K.fireEvent("headerLabelMouseoutEvent",{target:N,event:M});}break;case"th":L=K.fireEvent("theadCellMouseoutEvent",{target:N,event:M});L=K.fireEvent("headerCellMouseoutEvent",{target:N,event:M});break;case"tr":if(N.parentNode.nodeName.toLowerCase()=="thead"){L=K.fireEvent("theadRowMouseoutEvent",{target:N,event:M});L=K.fireEvent("headerRowMouseoutEvent",{target:N,event:M});}else{L=K.fireEvent("rowMouseoutEvent",{target:N,event:M});}break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableMouseoutEvent",{target:(N||K._elContainer),event:M});},_onTableMousedown:function(M,K){var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"a":break;case"td":L=K.fireEvent("cellMousedownEvent",{target:N,event:M});break;case"span":if(D.hasClass(N,G.CLASS_LABEL)){L=K.fireEvent("theadLabelMousedownEvent",{target:N,event:M});L=K.fireEvent("headerLabelMousedownEvent",{target:N,event:M});}break;case"th":L=K.fireEvent("theadCellMousedownEvent",{target:N,event:M});L=K.fireEvent("headerCellMousedownEvent",{target:N,event:M});break;case"tr":if(N.parentNode.nodeName.toLowerCase()=="thead"){L=K.fireEvent("theadRowMousedownEvent",{target:N,event:M});L=K.fireEvent("headerRowMousedownEvent",{target:N,event:M});}else{L=K.fireEvent("rowMousedownEvent",{target:N,event:M});}break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableMousedownEvent",{target:(N||K._elContainer),event:M});},_onTableDblclick:function(M,K){var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"td":L=K.fireEvent("cellDblclickEvent",{target:N,event:M});break;case"span":if(D.hasClass(N,G.CLASS_LABEL)){L=K.fireEvent("theadLabelDblclickEvent",{target:N,event:M});L=K.fireEvent("headerLabelDblclickEvent",{target:N,event:M});}break;case"th":L=K.fireEvent("theadCellDblclickEvent",{target:N,event:M});L=K.fireEvent("headerCellDblclickEvent",{target:N,event:M});break;case"tr":if(N.parentNode.nodeName.toLowerCase()=="thead"){L=K.fireEvent("theadRowDblclickEvent",{target:N,event:M});L=K.fireEvent("headerRowDblclickEvent",{target:N,event:M});}else{L=K.fireEvent("rowDblclickEvent",{target:N,event:M});}break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableDblclickEvent",{target:(N||K._elContainer),event:M});},_onTheadKeydown:function(M,K){if(I.getCharCode(M)===9){setTimeout(function(){if((K instanceof G)&&K._sId){K._elTbodyContainer.scrollLeft=K._elTheadContainer.scrollLeft;}},0);}var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"input":case"textarea":break;case"thead":L=K.fireEvent("theadKeyEvent",{target:N,event:M});break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableKeyEvent",{target:(N||K._elContainer),event:M});},_onTbodyKeydown:function(N,L){var K=L.get("selectionMode");if(K=="standard"){L._handleStandardSelectionByKey(N);}else{if(K=="single"){L._handleSingleSelectionByKey(N);}else{if(K=="cellblock"){L._handleCellBlockSelectionByKey(N);}else{if(K=="cellrange"){L._handleCellRangeSelectionByKey(N);}else{if(K=="singlecell"){L._handleSingleCellSelectionByKey(N);}}}}}if(L._oCellEditor&&L._oCellEditor.isActive){L.fireEvent("editorBlurEvent",{editor:L._oCellEditor});}var O=I.getTarget(N);var J=O.nodeName.toLowerCase();var M=true;while(O&&(J!="table")){switch(J){case"body":return ;case"tbody":M=L.fireEvent("tbodyKeyEvent",{target:O,event:N});break;default:break;}if(M===false){return ;}else{O=O.parentNode;if(O){J=O.nodeName.toLowerCase();}}}L.fireEvent("tableKeyEvent",{target:(O||L._elContainer),event:N});},_onTableKeypress:function(L,K){if(A.webkit){var J=I.getCharCode(L);if(J==40){I.stopEvent(L);}else{if(J==38){I.stopEvent(L);}}}},_onTheadClick:function(M,K){if(K._oCellEditor&&K._oCellEditor.isActive){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});
+}var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"input":if(N.type.toLowerCase()=="checkbox"){L=K.fireEvent("theadCheckboxClickEvent",{target:N,event:M});}else{if(N.type.toLowerCase()=="radio"){L=K.fireEvent("theadRadioClickEvent",{target:N,event:M});}}break;case"a":L=K.fireEvent("theadLinkClickEvent",{target:N,event:M});break;case"button":L=K.fireEvent("theadButtonClickEvent",{target:N,event:M});break;case"span":if(D.hasClass(N,G.CLASS_LABEL)){L=K.fireEvent("theadLabelClickEvent",{target:N,event:M});L=K.fireEvent("headerLabelClickEvent",{target:N,event:M});}break;case"th":L=K.fireEvent("theadCellClickEvent",{target:N,event:M});L=K.fireEvent("headerCellClickEvent",{target:N,event:M});break;case"tr":L=K.fireEvent("theadRowClickEvent",{target:N,event:M});L=K.fireEvent("headerRowClickEvent",{target:N,event:M});break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableClickEvent",{target:(N||K._elContainer),event:M});},_onTbodyClick:function(M,K){if(K._oCellEditor&&K._oCellEditor.isActive){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});}var N=I.getTarget(M);var J=N.nodeName.toLowerCase();var L=true;while(N&&(J!="table")){switch(J){case"body":return ;case"input":if(N.type.toLowerCase()=="checkbox"){L=K.fireEvent("checkboxClickEvent",{target:N,event:M});}else{if(N.type.toLowerCase()=="radio"){L=K.fireEvent("radioClickEvent",{target:N,event:M});}}break;case"a":L=K.fireEvent("linkClickEvent",{target:N,event:M});break;case"button":L=K.fireEvent("buttonClickEvent",{target:N,event:M});break;case"td":L=K.fireEvent("cellClickEvent",{target:N,event:M});break;case"tr":L=K.fireEvent("rowClickEvent",{target:N,event:M});break;default:break;}if(L===false){return ;}else{N=N.parentNode;if(N){J=N.nodeName.toLowerCase();}}}K.fireEvent("tableClickEvent",{target:(N||K._elContainer),event:M});},_onDropdownChange:function(K,J){var L=I.getTarget(K);J.fireEvent("dropdownChangeEvent",{event:K,target:L});},getId:function(){return this._sId;},toString:function(){return"DataTable instance "+this._sId;},getDataSource:function(){return this._oDataSource;},getColumnSet:function(){return this._oColumnSet;},getRecordSet:function(){return this._oRecordSet;},getCellEditor:function(){return this._oCellEditor;},getContainerEl:function(){return this._elContainer;},getTheadEl:function(){return this._elThead;},getTbodyEl:function(){return this._elTbody;},getMsgTbodyEl:function(){return this._elMsgTbody;},getMsgTdEl:function(){return this._elMsgTd;},getTrEl:function(N){var M=this._elTbody.rows;if(N instanceof YAHOO.widget.Record){var L=this.getTrIndex(N);if(L!==null){return M[L];}else{return null;}}else{if(C.isNumber(N)&&(N>-1)&&(N<M.length)){return M[N];}else{var J;var K=D.get(N);if(K&&(K.ownerDocument==document)){if(K.nodeName.toLowerCase()!="tr"){J=D.getAncestorByTagName(K,"tr");}else{J=K;}if(J&&(J.parentNode==this._elTbody)){return J;}}}}return null;},getFirstTrEl:function(){return this._elTbody.rows[0]||null;},getLastTrEl:function(){var J=this._elTbody.rows;if(J.length>0){return J[J.length-1]||null;}},getNextTrEl:function(L){var J=this.getTrIndex(L);if(J!==null){var K=this._elTbody.rows;if(J<K.length-1){return K[J+1];}}return null;},getPreviousTrEl:function(L){var J=this.getTrIndex(L);if(J!==null){var K=this._elTbody.rows;if(J>0){return K[J-1];}}return null;},getTdLinerEl:function(J){var K=this.getTdEl(J);return K.firstChild||null;},getTdEl:function(J){var O;var M=D.get(J);if(M&&(M.ownerDocument==document)){if(M.nodeName.toLowerCase()!="td"){O=D.getAncestorByTagName(M,"td");}else{O=M;}if(O&&(O.parentNode.parentNode==this._elTbody)){return O;}}else{if(J){var N,L;if(C.isString(J.columnId)&&C.isString(J.recordId)){N=this.getRecord(J.recordId);var P=this.getColumnById(J.columnId);if(P){L=P.getKeyIndex();}}if(J.record&&J.column&&J.column.getKeyIndex){N=J.record;L=J.column.getKeyIndex();}var K=this.getTrEl(N);if((L!==null)&&K&&K.cells&&K.cells.length>0){return K.cells[L]||null;}}}return null;},getFirstTdEl:function(K){var J=this.getTrEl(K)||this.getFirstTrEl();if(J&&(J.cells.length>0)){return J.cells[0];}return null;},getLastTdEl:function(K){var J=this.getTrEl(K)||this.getLastTrEl();if(J&&(J.cells.length>0)){return J.cells[J.cells.length-1];}return null;},getNextTdEl:function(J){var N=this.getTdEl(J);if(N){var L=N.yuiCellIndex;var K=this.getTrEl(N);if(L<K.cells.length-1){return K.cells[L+1];}else{var M=this.getNextTrEl(K);if(M){return M.cells[0];}}}return null;},getPreviousTdEl:function(J){var N=this.getTdEl(J);if(N){var L=N.yuiCellIndex;var K=this.getTrEl(N);if(L>0){return K.cells[L-1];}else{var M=this.getPreviousTrEl(K);if(M){return this.getLastTdEl(M);}}}return null;},getAboveTdEl:function(J){var L=this.getTdEl(J);if(L){var K=this.getPreviousTrEl(L);if(K){return K.cells[L.yuiCellIndex];}}return null;},getBelowTdEl:function(J){var L=this.getTdEl(J);if(L){var K=this.getNextTrEl(L);if(K){return K.cells[L.yuiCellIndex];}}return null;},getThLinerEl:function(K){var J=this.getThEl(K);return J.firstChild||null;},getThEl:function(M){var J;if(M instanceof YAHOO.widget.Column){var L=M;J=L.getThEl();if(J){return J;}}else{var K=D.get(M);if(K&&(K.ownerDocument==document)){if(K.nodeName.toLowerCase()!="th"){J=D.getAncestorByTagName(K,"th");}else{J=K;}if(J&&(J.parentNode.parentNode==this._elThead)){return J;}}}return null;},getTrIndex:function(O){var N;if(O instanceof YAHOO.widget.Record){N=this._oRecordSet.getRecordIndex(O);if(N===null){return null;}}else{if(C.isNumber(O)){N=O;}}if(C.isNumber(N)){if((N>-1)&&(N<this._oRecordSet.getLength())){var L=this.get("paginator");if(L instanceof B||this.get("paginated")){var M=0,P=0;if(L instanceof B){var K=L.getPageRecords();M=K[0];P=K[1];}else{M=L.startRecordIndex;P=M+L.rowsPerPage-1;}if((N>=M)&&(N<=P)){return N-M;}else{return null;}}else{return N;}}else{return null;}}else{var J=this.getTrEl(O);if(J&&(J.ownerDocument==document)&&(J.parentNode==this._elTbody)){return J.sectionRowIndex;
+}}return null;},initializeTable:function(){this._bInit=true;this._oRecordSet.reset();this._unselectAllTrEls();this._unselectAllTdEls();this._aSelections=null;this._oAnchorRecord=null;this._oAnchorCell=null;},render:function(){this._oChain.stop();this.showTableMessage(G.MSG_LOADING,G.CLASS_LOADING);var S,R,Q,P,U,X;var W=this.get("paginator");var Z=W instanceof B||this.get("paginated");if(Z){if(W instanceof B){X=this._oRecordSet.getRecords(W.getStartIndex(),W.getRowsPerPage());W.render();}else{this.updatePaginator();var N=W.rowsPerPage;var K=(W.currentPage-1)*N;X=this._oRecordSet.getRecords(K,N);this.formatPaginators();}}else{X=this._oRecordSet.getRecords();}var b=this._elTbody;var M=b.rows;if(C.isArray(X)&&(X.length>0)){var V=this.getSelectedRows();var a=this.getSelectedCells();var L=(V.length>0)||(a.length>0);while(b.hasChildNodes()&&(M.length>X.length)){b.deleteRow(-1);}if(L){this._unselectAllTrEls();this._unselectAllTdEls();}this.hideTableMessage();var J=this.get("renderLoopSize");var O,T;if(M.length>0){T=M.length;this._oChain.add({method:function(e){if((this instanceof G)&&this._sId){var d=e.nCurrentRow,c=J>0?Math.min(d+J,M.length):M.length;for(;d<c;++d){this._updateTrEl(M[d],X[d]);}if(J>0){this._syncColWidths();}e.nCurrentRow=d;}},iterations:(J>0)?Math.ceil(T/J):1,argument:{nCurrentRow:0},scope:this,timeout:(J>0)?0:-1});}O=M.length;T=X.length;var Y=(T-O);if(Y>0){this._oChain.add({method:function(e){if((this instanceof G)&&this._sId){var d=e.nCurrentRow,c=J>0?Math.min(d+J,T):T,g=document.createDocumentFragment(),f;for(;d<c;++d){f=this._createTrEl(X[d]);f.className=(d%2)?G.CLASS_ODD:G.CLASS_EVEN;g.appendChild(f);}this._elTbody.appendChild(g);if(J>0){this._syncColWidths();}e.nCurrentRow=d;}},iterations:(J>0)?Math.ceil(Y/J):1,argument:{nCurrentRow:O},scope:this,timeout:(J>0)?0:-1});}this._oChain.add({method:function(d){if((this instanceof G)&&this._sId){this._setFirstRow();this._setLastRow();if(L){for(R=0;R<M.length;R++){var f=M[R];var c=this.get("selectionMode");if((c=="standard")||(c=="single")){for(Q=0;Q<V.length;Q++){if(V[Q]===f.yuiRecordId){D.addClass(f,G.CLASS_SELECTED);if(R===M.length-1){this._oAnchorRecord=this.getRecord(f.yuiRecordId);}}}}else{for(Q=0;Q<f.cells.length;Q++){var e=f.cells[Q];for(P=0;P<a.length;P++){if((a[P].recordId===f.yuiRecordId)&&(a[P].columnId===e.yuiColumnId)){D.addClass(e,G.CLASS_SELECTED);if(Q===f.cells.length-1){this._oAnchorCell={record:this.getRecord(f.yuiRecordId),column:this.getColumnById(e.yuiColumnId)};}}}}}}}}if(this._bInit){this._oChain.add({method:function(){if((this instanceof G)&&this._sId&&this._bInit){this._bInit=false;this.fireEvent("initEvent");}},scope:this});this._oChain.run();}else{this.fireEvent("renderEvent");this.fireEvent("refreshEvent");}},scope:this,timeout:(J>0)?0:-1});this._oChain.add({method:function(){if((this instanceof G)&&this._sId){this._syncColWidths();}},scope:this});if(A.gecko){this._oChain.add({method:function(c){if((this instanceof G)&&this._sId){D.removeClass(this.getContainerEl(),"yui-dt-noop");}},scope:this});this._oChain.add({method:function(){if((this instanceof G)&&this._sId){D.addClass(this.getContainerEl(),"yui-dt-noop");}},scope:this});}this._oChain.run();}else{while(b.hasChildNodes()){b.deleteRow(-1);}this.showTableMessage(G.MSG_EMPTY,G.CLASS_EMPTY);}},destroy:function(){this._oChain.stop();var L;var M=this._oColumnSet.tree[0];for(L=0;L<M.length;L++){if(M[L]._dd){M[L]._dd=M[L]._dd.unreg();}}var K=this._oColumnSet.keys;for(L=0;L<K.length;L++){if(K[L]._ddResizer){K[L]._ddResizer=K[L]._ddResizer.unreg();}}I.purgeElement(this._oCellEditor.container,true);document.body.removeChild(this._oCellEditor.container);var J=this.toString();var N=this._elContainer;this._oRecordSet.unsubscribeAll();this.unsubscribeAll();I.purgeElement(N,true);I.removeListener(document,"click",this._onDocumentClick);N.innerHTML="";for(var O in this){if(C.hasOwnProperty(this,O)){this[O]=null;}}G._nCurrentCount--;if(G._nCurrentCount<1){if(G._elStylesheet){document.getElementsByTagName("head")[0].removeChild(G._elStylesheet);G._elStylesheet=null;}}},showTableMessage:function(K,J){var L=this._elMsgTd;if(C.isString(K)){L.firstChild.innerHTML=K;}if(C.isString(J)){D.addClass(L.firstChild,J);}var M=L.firstChild;M.style.width=((this.getTheadEl().parentNode.offsetWidth)-(parseInt(D.getStyle(M,"paddingLeft"),10))-(parseInt(D.getStyle(M,"paddingRight"),10)))+"px";this._elMsgTbody.style.display="";this.fireEvent("tableMsgShowEvent",{html:K,className:J});},hideTableMessage:function(){if(this._elMsgTbody.style.display!="none"){this._elMsgTbody.style.display="none";this.fireEvent("tableMsgHideEvent");}},focus:function(){this.focusTbodyEl();},focusTheadEl:function(){this._focusEl(this._elThead);},focusTbodyEl:function(){this._focusEl(this._elTbody);},getRecordIndex:function(M){var L;if(!C.isNumber(M)){if(M instanceof YAHOO.widget.Record){return this._oRecordSet.getRecordIndex(M);}else{var K=this.getTrEl(M);if(K){L=K.sectionRowIndex;}}}else{L=M;}if(C.isNumber(L)){var J=this.get("paginator");if(J instanceof B){return J.get("recordOffset")+L;}else{if(this.get("paginated")){return J.startRecordIndex+L;}else{return L;}}}return null;},getRecord:function(L){var K=this._oRecordSet.getRecord(L);if(!K){var J=this.getTrEl(L);if(J){K=this._oRecordSet.getRecord(J.yuiRecordId);}}if(K instanceof YAHOO.widget.Record){return this._oRecordSet.getRecord(K);}else{return null;}},getColumn:function(J){var L=this._oColumnSet.getColumn(J);if(!L){var K=this.getTdEl(J);if(K){L=this._oColumnSet.getColumnById(K.yuiColumnId);}else{K=this.getThEl(J);if(K){L=this._oColumnSet.getColumnById(K.yuiColumnId);}}}if(!L){}return L;},getColumnById:function(J){return this._oColumnSet.getColumnById(J);},getColumnSortDir:function(L){if(L.sortOptions&&L.sortOptions.defaultOrder){if(L.sortOptions.defaultOrder=="asc"){L.sortOptions.defaultDir=G.CLASS_ASC;}else{if(L.sortOptions.defaultOrder=="desc"){L.sortOptions.defaultDir=G.CLASS_DESC;}}}var K=(L.sortOptions&&L.sortOptions.defaultDir)?L.sortOptions.defaultDir:G.CLASS_ASC;
+var J=false;var M=this.get("sortedBy");if(M&&(M.key===L.key)){J=true;if(M.dir){K=(M.dir==G.CLASS_ASC)?G.CLASS_DESC:G.CLASS_ASC;}else{K=(K==G.CLASS_ASC)?G.CLASS_DESC:G.CLASS_ASC;}}return K;},sortColumn:function(O,M){if(O&&(O instanceof YAHOO.widget.Column)){if(!O.sortable){D.addClass(this.getThEl(O),G.CLASS_SORTABLE);}if(M&&(M!==G.CLASS_ASC)&&(M!==G.CLASS_DESC)){M=null;}var L=M||this.getColumnSortDir(O);var P=this.get("sortedBy")||{};var K=(P.key===O.key)?true:false;if(!K||M){var N=(O.sortOptions&&C.isFunction(O.sortOptions.sortFunction))?O.sortOptions.sortFunction:function(R,Q,T){var S=YAHOO.util.Sort.compare(R.getData(O.key),Q.getData(O.key),T);if(S===0){return YAHOO.util.Sort.compare(R.getId(),Q.getId(),T);}else{return S;}};this._oRecordSet.sortRecords(N,((L==G.CLASS_DESC)?true:false));}else{this._oRecordSet.reverseRecords();}this.set("sortedBy",{key:O.key,dir:L,column:O});var J=this.get("paginator");if(J instanceof B){J.setPage(1,true);}else{if(this.get("paginated")){this.updatePaginator({currentPage:1});}}G.formatTheadCell(O.getThEl().firstChild.firstChild,O,this);this.render();this.fireEvent("columnSortEvent",{column:O,dir:L});}else{}},_setColumnWidth:function(N,J){N=this.getColumn(N);if(N){if(!G._bStylesheetFallback){var R;if(!G._elStylesheet){R=document.createElement("style");R.type="text/css";G._elStylesheet=document.getElementsByTagName("head").item(0).appendChild(R);}if(G._elStylesheet){R=G._elStylesheet;var Q=".yui-dt-col-"+N.getId();var O=G._oStylesheetRules[Q];if(!O){if(R.styleSheet&&R.styleSheet.addRule){R.styleSheet.addRule(Q,"width:"+J);O=R.styleSheet.rules[R.styleSheet.rules.length-1];}else{if(R.sheet&&R.sheet.insertRule){R.sheet.insertRule(Q+" {width:"+J+";}",R.sheet.cssRules.length);O=R.sheet.cssRules[R.sheet.cssRules.length];}else{G._bStylesheetFallback=true;}}G._oStylesheetRules[Q]=O;}else{O.style.width=J;}return ;}G._bStylesheetFallback=true;}if(G._bStylesheetFallback){if(J=="auto"){J="";}if(!this._aFallbackColResizer[this._elTbody.rows.length]){var P=["var colIdx=oColumn.getKeyIndex();","oColumn.getThEl().firstChild.style.width="];for(var M=this._elTbody.rows.length-1,L=2;M>=0;--M){P[L++]="this._elTbody.rows[";P[L++]=M;P[L++]="].cells[colIdx].firstChild.style.width=";P[L++]="this._elTbody.rows[";P[L++]=M;P[L++]="].cells[colIdx].style.width=";}P[L]="sWidth;";this._aFallbackColResizer[this._elTbody.rows.length]=new Function("oColumn","sWidth",P.join(""));}var K=this._aFallbackColResizer[this._elTbody.rows.length];if(K){K.call(this,N,J);}}}else{}},setColumnWidth:function(L,J){L=this.getColumn(L);if(L){var K="";if(C.isNumber(J)){K=(J>L.minWidth)?J+"px":L.minWidth+"px";}L.width=parseInt(K,10);this._setColumnWidth(L,K);this._syncScrollPadding();this.fireEvent("columnSetWidthEvent",{column:L,width:J});}else{}},hideColumn:function(P){P=this.getColumn(P);if(P&&!P.hidden){if(P.getTreeIndex()!==null){var M=this.getTbodyEl().rows;var L=M.length;var K=this._oColumnSet.getDescendants(P);for(var O=0;O<K.length;O++){var Q=K[O];Q.hidden=true;var S=Q.getThEl();var R=S.firstChild;Q._nLastWidth=R.offsetWidth-(parseInt(D.getStyle(R,"paddingLeft"),10)|0)-(parseInt(D.getStyle(R,"paddingRight"),10)|0);D.addClass(S,G.CLASS_HIDDEN);var J=Q.getKeyIndex();if(J!==null){for(var N=0;N<L;N++){D.addClass(M[N].cells[J],G.CLASS_HIDDEN);}this._setColumnWidth(Q,"1px");if(Q.resizeable){D.removeClass(Q.getResizerEl(),G.CLASS_RESIZER);}if(Q.sortable){D.removeClass(Q.getThEl(),G.CLASS_SORTABLE);Q.getThEl().firstChild.firstChild.firstChild.style.display="none";}}else{S.firstChild.style.width="1px";}this.fireEvent("columnHideEvent",{column:Q});}}else{}}},showColumn:function(P){P=this.getColumn(P);if(P&&P.hidden){if(P.getTreeIndex()!==null){var M=this.getTbodyEl().rows;var L=M.length;var K=this._oColumnSet.getDescendants(P);for(var O=0;O<K.length;O++){var Q=K[O];Q.hidden=false;var R=Q.getThEl();D.removeClass(R,G.CLASS_HIDDEN);var J=Q.getKeyIndex();if(J!==null){for(var N=0;N<L;N++){D.removeClass(M[N].cells[J],G.CLASS_HIDDEN);}this.setColumnWidth(Q,(Q._nLastWidth||Q.minWidth),true);if(Q.sortable){Q.getThEl().firstChild.firstChild.firstChild.style.display="";D.removeClass(Q.getThEl(),G.CLASS_SORTABLE);}if(Q.resizeable){Q._ddResizer.resetResizerEl();D.addClass(Q.getResizerEl(),G.CLASS_RESIZER);}}else{R.firstChild.style.width="";}Q._nLastWidth=null;this.fireEvent("columnShowEvent",{column:Q});}}else{}}},removeColumn:function(L){var K=L.getTreeIndex();if(K!==null){this._oChain.stop();var J=this._oColumnSet.getDefinitions();L=J.splice(K,1)[0];this._initColumnSet(J);this._initTheadEls();this.render();this.fireEvent("columnRemoveEvent",{column:L});return L;}},insertColumn:function(M,J){if(M instanceof YAHOO.widget.Column){M=M.getDefinition();}else{if(M.constructor!==Object){return ;}}var K=this._oColumnSet;if(!C.isValue(J)||!C.isNumber(J)){J=K.tree[0].length;}this._oChain.stop();var L=this._oColumnSet.getDefinitions();L.splice(J,0,M);this._initColumnSet(L);this._initTheadEls();this.render();this.fireEvent("columnInsertEvent",{column:M,index:J});},selectColumn:function(L){L=this.getColumn(L);if(L&&!L.selected){if(L.getKeyIndex()!==null){L.selected=true;var M=L.getThEl();D.addClass(M,G.CLASS_SELECTED);var K=this.getTbodyEl().rows;var J=this._oChain;J.add({method:function(N){if((this instanceof G)&&this._sId&&K[N.rowIndex]&&K[N.rowIndex].cells[N.cellIndex]){D.addClass(K[N.rowIndex].cells[N.cellIndex],G.CLASS_SELECTED);}N.rowIndex++;},scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()}});J.run();this.fireEvent("columnSelectEvent",{column:L});}else{}}},unselectColumn:function(L){L=this.getColumn(L);if(L&&L.selected){if(L.getKeyIndex()!==null){L.selected=false;var M=L.getThEl();D.removeClass(M,G.CLASS_SELECTED);var K=this.getTbodyEl().rows;var J=this._oChain;J.add({method:function(N){if((this instanceof G)&&this._sId&&K[N.rowIndex]&&K[N.rowIndex].cells[N.cellIndex]){D.removeClass(K[N.rowIndex].cells[N.cellIndex],G.CLASS_SELECTED);}N.rowIndex++;},scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()}});
+J.run();this.fireEvent("columnUnselectEvent",{column:L});}else{}}},getSelectedColumns:function(N){var K=[];var L=this._oColumnSet.keys;for(var M=0,J=L.length;M<J;M++){if(L[M].selected){K[K.length]=L[M];}}return K;},highlightColumn:function(K){var M=this.getColumn(K);if(M&&(M.getKeyIndex()!==null)){var N=M.getThEl();D.addClass(N,G.CLASS_HIGHLIGHTED);var L=this.getTbodyEl().rows;var J=this._oChain;J.add({method:function(O){if((this instanceof G)&&this._sId&&L[O.rowIndex]&&L[O.rowIndex].cells[O.cellIndex]){D.addClass(L[O.rowIndex].cells[O.cellIndex],G.CLASS_HIGHLIGHTED);}O.rowIndex++;},scope:this,iterations:L.length,argument:{rowIndex:0,cellIndex:M.getKeyIndex()}});J.run();this.fireEvent("columnHighlightEvent",{column:M});}else{}},unhighlightColumn:function(K){var M=this.getColumn(K);if(M&&(M.getKeyIndex()!==null)){var N=M.getThEl();D.removeClass(N,G.CLASS_HIGHLIGHTED);var L=this.getTbodyEl().rows;var J=this._oChain;J.add({method:function(O){if((this instanceof G)&&this._sId&&L[O.rowIndex]&&L[O.rowIndex].cells[O.cellIndex]){D.removeClass(L[O.rowIndex].cells[O.cellIndex],G.CLASS_HIGHLIGHTED);}O.rowIndex++;},scope:this,iterations:L.length,argument:{rowIndex:0,cellIndex:M.getKeyIndex()}});J.run();this.fireEvent("columnUnhighlightEvent",{column:M});}else{}},addRow:function(Q,L){if(Q&&(Q.constructor==Object)){var N=this._oRecordSet.addRecord(Q,L);if(N){var J;var K=this.get("paginator");if(K instanceof B||this.get("paginated")){J=this.getRecordIndex(N);var M;if(K instanceof B){var O=K.get("totalRecords");if(O!==B.VALUE_UNLIMITED){K.set("totalRecords",O+1);}M=(K.getPageRecords())[1];}else{M=K.startRecordIndex+K.rowsPerPage-1;this.updatePaginator();}if(J<=M){this.render();}this.fireEvent("rowAddEvent",{record:N});J=(C.isValue(J))?J:"n/a";return ;}else{J=this.getTrIndex(N);if(C.isNumber(J)){if((this instanceof G)&&this._sId){var P=this._createTrEl(N);if(P){if(J>=0&&J<this._elTbody.rows.length){this._elTbody.insertBefore(P,this._elTbody.rows[J]);if(!J){this._setFirstRow();}}else{this._elTbody.appendChild(P);this._setLastRow();J=this._elTbody.rows.length-1;}this._setRowStripes(J);this._syncColWidths();}this.hideTableMessage();this.fireEvent("rowAddEvent",{record:N});J=(C.isValue(J))?J:"n/a";}return ;}}}}},addRows:function(K,J){if(C.isArray(K)){var L;if(C.isNumber(J)){for(L=K.length-1;L>-1;L--){this.addRow(K[L],J);}}else{for(L=0;L<K.length;L++){this.addRow(K[L]);}}}else{}},updateRow:function(O,P){var J,N,M,K;if((O instanceof YAHOO.widget.Record)||(C.isNumber(O))){J=this._oRecordSet.getRecord(O);K=this.getTrEl(J);}else{K=this.getTrEl(O);if(K){J=this.getRecord(K);}}if(J){var L=J.getData();N=YAHOO.widget.DataTable._cloneObject(L);M=this._oRecordSet.updateRecord(J,P);}else{return ;}if(K){this._oChain.add({method:function(){if((this instanceof G)&&this._sId){this._updateTrEl(K,M);this._syncColWidths();this.fireEvent("rowUpdateEvent",{record:M,oldData:N});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._oChain.run();}else{this.fireEvent("rowUpdateEvent",{record:M,oldData:N});}},deleteRow:function(U){var V=null;if(C.isNumber(U)){V=this._oRecordSet.getRecord(U);}else{var K=D.get(U);K=this.getTrEl(K);if(K){V=this.getRecord(K);}}if(V){var R=this.get("paginator");var Q=V.getId();var S=this._aSelections||[];for(var N=S.length-1;N>-1;N--){if((C.isNumber(S[N])&&(S[N]===Q))||((S[N].constructor==Object)&&(S[N].recordId===Q))){S.splice(N,1);}}var M=this.getTrIndex(V);var J=this.getRecordIndex(V);var T=V.getData();var L=YAHOO.widget.DataTable._cloneObject(T);this._oRecordSet.deleteRecord(J);if(R instanceof B||this.get("paginated")){var P;if(R instanceof B){var O=R.get("totalRecords");if(O!==B.VALUE_UNLIMITED){R.set("totalRecords",O-1);}P=(R.getPageRecords())[1];}else{P=R.startRecordIndex+R.rowsPerPage-1;this.updatePaginator();}if(J<=P){this.render();}}else{if(C.isNumber(M)){this._oChain.add({method:function(){if((this instanceof G)&&this._sId){var W=(M==this.getLastTrEl().sectionRowIndex);this._deleteTrEl(M);if(this._elTbody.rows.length===0){this.showTableMessage(G.MSG_EMPTY,G.CLASS_EMPTY);}else{if(M===0){this._setFirstRow();}if(W){this._setLastRow();}if(M!=this._elTbody.rows.length){this._setRowStripes(M);}}this._syncColWidths();this.fireEvent("rowDeleteEvent",{recordIndex:J,oldData:L,trElIndex:M});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._oChain.run();return ;}}this.fireEvent("rowDeleteEvent",{recordIndex:J,oldData:L,trElIndex:M});}else{}},deleteRows:function(P,L){var N=null;if(C.isNumber(P)){N=P;}else{var J=D.get(P);J=this.getTrEl(J);if(J){N=this.getRecordIndex(J);}}if(N!==null){if(L&&C.isNumber(L)){var O=(L>0)?N+L-1:N;var M=(L>0)?N:N+L+1;for(var K=O;K>M-1;K--){this.deleteRow(K);}}else{this.deleteRow(N);}}else{}},formatCell:function(M,K,O){if(!(K instanceof YAHOO.widget.Record)){K=this.getRecord(M);}if(!(O instanceof YAHOO.widget.Column)){O=this._oColumnSet.getColumn(M.parentNode.yuiColumnKey);}if(K&&O){var L=O.key;var P=K.getData(L);var N;if(C.isString(O.className)){N=[O.className];}else{if(C.isArray(O.className)){N=O.className;}else{N=[];}}N[N.length]="yui-dt-col-"+L.replace(/[^\w\-.:]/g,"");N[N.length]="yui-dt-col-"+O.getId();N[N.length]=G.CLASS_LINER;if(O.sortable){N[N.length]=G.CLASS_SORTABLE;}if(O.resizeable){N[N.length]=G.CLASS_RESIZEABLE;}if(O.editor){N[N.length]=G.CLASS_EDITABLE;}M.className="";D.addClass(M,N.join(" "));var J=typeof O.formatter==="function"?O.formatter:G.Formatter[O.formatter+""];if(J){J.call(this,M,K,O,P);}else{M.innerHTML=P===undefined||P===null||(typeof P==="number"&&isNaN(P))?"":P.toString();}this.fireEvent("cellFormatEvent",{record:K,column:O,key:L,el:M});}else{}},onPaginatorChange:function(J){var K=this.get("paginationEventHandler");K(J,this);},_aSelections:null,_oAnchorRecord:null,_oAnchorCell:null,_unselectAllTrEls:function(){var J=D.getElementsByClassName(G.CLASS_SELECTED,"tr",this._elTbody);D.removeClass(J,G.CLASS_SELECTED);},_getSelectionTrigger:function(){var M=this.get("selectionMode");var L={};var P,J,K,O,N;if((M=="cellblock")||(M=="cellrange")||(M=="singlecell")){P=this.getLastSelectedCell();
+if(!P){return null;}else{J=this.getRecord(P.recordId);K=this.getRecordIndex(J);O=this.getTrEl(J);N=this.getTrIndex(O);if(N===null){return null;}else{L.record=J;L.recordIndex=K;L.el=this.getTdEl(P);L.trIndex=N;L.column=this.getColumnById(P.columnId);L.colKeyIndex=L.column.getKeyIndex();L.cell=P;return L;}}}else{J=this.getLastSelectedRecord();if(!J){return null;}else{J=this.getRecord(J);K=this.getRecordIndex(J);O=this.getTrEl(J);N=this.getTrIndex(O);if(N===null){return null;}else{L.record=J;L.recordIndex=K;L.el=O;L.trIndex=N;return L;}}}},_getSelectionAnchor:function(L){var K=this.get("selectionMode");var M={};var N,P,J;if((K=="cellblock")||(K=="cellrange")||(K=="singlecell")){var O=this._oAnchorCell;if(!O){if(L){O=this._oAnchorCell=L.cell;}else{return null;}}N=this._oAnchorCell.record;P=this._oRecordSet.getRecordIndex(N);J=this.getTrIndex(N);if(J===null){if(P<this.getRecordIndex(this.getFirstTrEl())){J=0;}else{J=this.getRecordIndex(this.getLastTrEl());}}M.record=N;M.recordIndex=P;M.trIndex=J;M.column=this._oAnchorCell.column;M.colKeyIndex=M.column.getKeyIndex();M.cell=O;return M;}else{N=this._oAnchorRecord;if(!N){if(L){N=this._oAnchorRecord=L.record;}else{return null;}}P=this.getRecordIndex(N);J=this.getTrIndex(N);if(J===null){if(P<this.getRecordIndex(this.getFirstTrEl())){J=0;}else{J=this.getRecordIndex(this.getLastTrEl());}}M.record=N;M.recordIndex=P;M.trIndex=J;return M;}},_handleStandardSelectionByMouse:function(K){var J=K.target;var M=this.getTrEl(J);if(M){var P=K.event;var S=P.shiftKey;var O=P.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&P.metaKey);var R=this.getRecord(M);var L=this._oRecordSet.getRecordIndex(R);var Q=this._getSelectionAnchor();var N;if(S&&O){if(Q){if(this.isSelected(Q.record)){if(Q.recordIndex<L){for(N=Q.recordIndex+1;N<=L;N++){if(!this.isSelected(N)){this.selectRow(N);}}}else{for(N=Q.recordIndex-1;N>=L;N--){if(!this.isSelected(N)){this.selectRow(N);}}}}else{if(Q.recordIndex<L){for(N=Q.recordIndex+1;N<=L-1;N++){if(this.isSelected(N)){this.unselectRow(N);}}}else{for(N=L+1;N<=Q.recordIndex-1;N++){if(this.isSelected(N)){this.unselectRow(N);}}}this.selectRow(R);}}else{this._oAnchorRecord=R;if(this.isSelected(R)){this.unselectRow(R);}else{this.selectRow(R);}}}else{if(S){this.unselectAllRows();if(Q){if(Q.recordIndex<L){for(N=Q.recordIndex;N<=L;N++){this.selectRow(N);}}else{for(N=Q.recordIndex;N>=L;N--){this.selectRow(N);}}}else{this._oAnchorRecord=R;this.selectRow(R);}}else{if(O){this._oAnchorRecord=R;if(this.isSelected(R)){this.unselectRow(R);}else{this.selectRow(R);}}else{this._handleSingleSelectionByMouse(K);return ;}}}}},_handleStandardSelectionByKey:function(N){var J=I.getCharCode(N);if((J==38)||(J==40)){var L=N.shiftKey;var K=this._getSelectionTrigger();if(!K){return null;}I.stopEvent(N);var M=this._getSelectionAnchor(K);if(L){if((J==40)&&(M.recordIndex<=K.trIndex)){this.selectRow(this.getNextTrEl(K.el));}else{if((J==38)&&(M.recordIndex>=K.trIndex)){this.selectRow(this.getPreviousTrEl(K.el));}else{this.unselectRow(K.el);}}}else{this._handleSingleSelectionByKey(N);}}},_handleSingleSelectionByMouse:function(L){var M=L.target;var K=this.getTrEl(M);if(K){var J=this.getRecord(K);this._oAnchorRecord=J;this.unselectAllRows();this.selectRow(J);}},_handleSingleSelectionByKey:function(M){var J=I.getCharCode(M);if((J==38)||(J==40)){var K=this._getSelectionTrigger();if(!K){return null;}I.stopEvent(M);var L;if(J==38){L=this.getPreviousTrEl(K.el);if(L===null){L=this.getFirstTrEl();}}else{if(J==40){L=this.getNextTrEl(K.el);if(L===null){L=this.getLastTrEl();}}}this.unselectAllRows();this.selectRow(L);this._oAnchorRecord=this.getRecord(L);}},_handleCellBlockSelectionByMouse:function(Z){var a=Z.target;var K=this.getTdEl(a);if(K){var Y=Z.event;var P=Y.shiftKey;var L=Y.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&Y.metaKey);var R=this.getTrEl(K);var Q=this.getTrIndex(R);var U=this.getColumn(K);var V=U.getKeyIndex();var T=this.getRecord(R);var c=this._oRecordSet.getRecordIndex(T);var O={record:T,column:U};var S=this._getSelectionAnchor();var N=this.getTbodyEl().rows;var M,J,b,X,W;if(P&&L){if(S){if(this.isSelected(S.cell)){if(S.recordIndex===c){if(S.colKeyIndex<V){for(X=S.colKeyIndex+1;X<=V;X++){this.selectCell(R.cells[X]);}}else{if(V<S.colKeyIndex){for(X=V;X<S.colKeyIndex;X++){this.selectCell(R.cells[X]);}}}}else{if(S.recordIndex<c){M=Math.min(S.colKeyIndex,V);J=Math.max(S.colKeyIndex,V);for(X=S.trIndex;X<=Q;X++){for(W=M;W<=J;W++){this.selectCell(N[X].cells[W]);}}}else{M=Math.min(S.trIndex,V);J=Math.max(S.trIndex,V);for(X=S.trIndex;X>=Q;X--){for(W=J;W>=M;W--){this.selectCell(N[X].cells[W]);}}}}}else{if(S.recordIndex===c){if(S.colKeyIndex<V){for(X=S.colKeyIndex+1;X<V;X++){this.unselectCell(R.cells[X]);}}else{if(V<S.colKeyIndex){for(X=V+1;X<S.colKeyIndex;X++){this.unselectCell(R.cells[X]);}}}}if(S.recordIndex<c){for(X=S.trIndex;X<=Q;X++){b=N[X];for(W=0;W<b.cells.length;W++){if(b.sectionRowIndex===S.trIndex){if(W>S.colKeyIndex){this.unselectCell(b.cells[W]);}}else{if(b.sectionRowIndex===Q){if(W<V){this.unselectCell(b.cells[W]);}}else{this.unselectCell(b.cells[W]);}}}}}else{for(X=Q;X<=S.trIndex;X++){b=N[X];for(W=0;W<b.cells.length;W++){if(b.sectionRowIndex==Q){if(W>V){this.unselectCell(b.cells[W]);}}else{if(b.sectionRowIndex==S.trIndex){if(W<S.colKeyIndex){this.unselectCell(b.cells[W]);}}else{this.unselectCell(b.cells[W]);}}}}}this.selectCell(K);}}else{this._oAnchorCell=O;if(this.isSelected(O)){this.unselectCell(O);}else{this.selectCell(O);}}}else{if(P){this.unselectAllCells();if(S){if(S.recordIndex===c){if(S.colKeyIndex<V){for(X=S.colKeyIndex;X<=V;X++){this.selectCell(R.cells[X]);}}else{if(V<S.colKeyIndex){for(X=V;X<=S.colKeyIndex;X++){this.selectCell(R.cells[X]);}}}}else{if(S.recordIndex<c){M=Math.min(S.colKeyIndex,V);J=Math.max(S.colKeyIndex,V);for(X=S.trIndex;X<=Q;X++){for(W=M;W<=J;W++){this.selectCell(N[X].cells[W]);}}}else{M=Math.min(S.colKeyIndex,V);J=Math.max(S.colKeyIndex,V);for(X=Q;X<=S.trIndex;X++){for(W=M;W<=J;W++){this.selectCell(N[X].cells[W]);
+}}}}}else{this._oAnchorCell=O;this.selectCell(O);}}else{if(L){this._oAnchorCell=O;if(this.isSelected(O)){this.unselectCell(O);}else{this.selectCell(O);}}else{this._handleSingleCellSelectionByMouse(Z);}}}}},_handleCellBlockSelectionByKey:function(O){var J=I.getCharCode(O);var T=O.shiftKey;if((J==9)||!T){this._handleSingleCellSelectionByKey(O);return ;}if((J>36)&&(J<41)){var U=this._getSelectionTrigger();if(!U){return null;}I.stopEvent(O);var R=this._getSelectionAnchor(U);var K,S,L,Q,M;var P=this.getTbodyEl().rows;var N=U.el.parentNode;if(J==40){if(R.recordIndex<=U.recordIndex){M=this.getNextTrEl(U.el);if(M){S=R.colKeyIndex;L=U.colKeyIndex;if(S>L){for(K=S;K>=L;K--){Q=M.cells[K];this.selectCell(Q);}}else{for(K=S;K<=L;K++){Q=M.cells[K];this.selectCell(Q);}}}}else{S=Math.min(R.colKeyIndex,U.colKeyIndex);L=Math.max(R.colKeyIndex,U.colKeyIndex);for(K=S;K<=L;K++){this.unselectCell(N.cells[K]);}}}else{if(J==38){if(R.recordIndex>=U.recordIndex){M=this.getPreviousTrEl(U.el);if(M){S=R.colKeyIndex;L=U.colKeyIndex;if(S>L){for(K=S;K>=L;K--){Q=M.cells[K];this.selectCell(Q);}}else{for(K=S;K<=L;K++){Q=M.cells[K];this.selectCell(Q);}}}}else{S=Math.min(R.colKeyIndex,U.colKeyIndex);L=Math.max(R.colKeyIndex,U.colKeyIndex);for(K=S;K<=L;K++){this.unselectCell(N.cells[K]);}}}else{if(J==39){if(R.colKeyIndex<=U.colKeyIndex){if(U.colKeyIndex<N.cells.length-1){S=R.trIndex;L=U.trIndex;if(S>L){for(K=S;K>=L;K--){Q=P[K].cells[U.colKeyIndex+1];this.selectCell(Q);}}else{for(K=S;K<=L;K++){Q=P[K].cells[U.colKeyIndex+1];this.selectCell(Q);}}}}else{S=Math.min(R.trIndex,U.trIndex);L=Math.max(R.trIndex,U.trIndex);for(K=S;K<=L;K++){this.unselectCell(P[K].cells[U.colKeyIndex]);}}}else{if(J==37){if(R.colKeyIndex>=U.colKeyIndex){if(U.colKeyIndex>0){S=R.trIndex;L=U.trIndex;if(S>L){for(K=S;K>=L;K--){Q=P[K].cells[U.colKeyIndex-1];this.selectCell(Q);}}else{for(K=S;K<=L;K++){Q=P[K].cells[U.colKeyIndex-1];this.selectCell(Q);}}}}else{S=Math.min(R.trIndex,U.trIndex);L=Math.max(R.trIndex,U.trIndex);for(K=S;K<=L;K++){this.unselectCell(P[K].cells[U.colKeyIndex]);}}}}}}}},_handleCellRangeSelectionByMouse:function(X){var Y=X.target;var J=this.getTdEl(Y);if(J){var W=X.event;var N=W.shiftKey;var K=W.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&W.metaKey);var P=this.getTrEl(J);var O=this.getTrIndex(P);var S=this.getColumn(J);var T=S.getKeyIndex();var R=this.getRecord(P);var a=this._oRecordSet.getRecordIndex(R);var M={record:R,column:S};var Q=this._getSelectionAnchor();var L=this.getTbodyEl().rows;var Z,V,U;if(N&&K){if(Q){if(this.isSelected(Q.cell)){if(Q.recordIndex===a){if(Q.colKeyIndex<T){for(V=Q.colKeyIndex+1;V<=T;V++){this.selectCell(P.cells[V]);}}else{if(T<Q.colKeyIndex){for(V=T;V<Q.colKeyIndex;V++){this.selectCell(P.cells[V]);}}}}else{if(Q.recordIndex<a){for(V=Q.colKeyIndex+1;V<P.cells.length;V++){this.selectCell(P.cells[V]);}for(V=Q.trIndex+1;V<O;V++){for(U=0;U<L[V].cells.length;U++){this.selectCell(L[V].cells[U]);}}for(V=0;V<=T;V++){this.selectCell(P.cells[V]);}}else{for(V=T;V<P.cells.length;V++){this.selectCell(P.cells[V]);}for(V=O+1;V<Q.trIndex;V++){for(U=0;U<L[V].cells.length;U++){this.selectCell(L[V].cells[U]);}}for(V=0;V<Q.colKeyIndex;V++){this.selectCell(P.cells[V]);}}}}else{if(Q.recordIndex===a){if(Q.colKeyIndex<T){for(V=Q.colKeyIndex+1;V<T;V++){this.unselectCell(P.cells[V]);}}else{if(T<Q.colKeyIndex){for(V=T+1;V<Q.colKeyIndex;V++){this.unselectCell(P.cells[V]);}}}}if(Q.recordIndex<a){for(V=Q.trIndex;V<=O;V++){Z=L[V];for(U=0;U<Z.cells.length;U++){if(Z.sectionRowIndex===Q.trIndex){if(U>Q.colKeyIndex){this.unselectCell(Z.cells[U]);}}else{if(Z.sectionRowIndex===O){if(U<T){this.unselectCell(Z.cells[U]);}}else{this.unselectCell(Z.cells[U]);}}}}}else{for(V=O;V<=Q.trIndex;V++){Z=L[V];for(U=0;U<Z.cells.length;U++){if(Z.sectionRowIndex==O){if(U>T){this.unselectCell(Z.cells[U]);}}else{if(Z.sectionRowIndex==Q.trIndex){if(U<Q.colKeyIndex){this.unselectCell(Z.cells[U]);}}else{this.unselectCell(Z.cells[U]);}}}}}this.selectCell(J);}}else{this._oAnchorCell=M;if(this.isSelected(M)){this.unselectCell(M);}else{this.selectCell(M);}}}else{if(N){this.unselectAllCells();if(Q){if(Q.recordIndex===a){if(Q.colKeyIndex<T){for(V=Q.colKeyIndex;V<=T;V++){this.selectCell(P.cells[V]);}}else{if(T<Q.colKeyIndex){for(V=T;V<=Q.colKeyIndex;V++){this.selectCell(P.cells[V]);}}}}else{if(Q.recordIndex<a){for(V=Q.trIndex;V<=O;V++){Z=L[V];for(U=0;U<Z.cells.length;U++){if(Z.sectionRowIndex==Q.trIndex){if(U>=Q.colKeyIndex){this.selectCell(Z.cells[U]);}}else{if(Z.sectionRowIndex==O){if(U<=T){this.selectCell(Z.cells[U]);}}else{this.selectCell(Z.cells[U]);}}}}}else{for(V=O;V<=Q.trIndex;V++){Z=L[V];for(U=0;U<Z.cells.length;U++){if(Z.sectionRowIndex==O){if(U>=T){this.selectCell(Z.cells[U]);}}else{if(Z.sectionRowIndex==Q.trIndex){if(U<=Q.colKeyIndex){this.selectCell(Z.cells[U]);}}else{this.selectCell(Z.cells[U]);}}}}}}}else{this._oAnchorCell=M;this.selectCell(M);}}else{if(K){this._oAnchorCell=M;if(this.isSelected(M)){this.unselectCell(M);}else{this.selectCell(M);}}else{this._handleSingleCellSelectionByMouse(X);}}}}},_handleCellRangeSelectionByKey:function(N){var J=I.getCharCode(N);var R=N.shiftKey;if((J==9)||!R){this._handleSingleCellSelectionByKey(N);return ;}if((J>36)&&(J<41)){var S=this._getSelectionTrigger();if(!S){return null;}I.stopEvent(N);var Q=this._getSelectionAnchor(S);var K,L,P;var O=this.getTbodyEl().rows;var M=S.el.parentNode;if(J==40){L=this.getNextTrEl(S.el);if(Q.recordIndex<=S.recordIndex){for(K=S.colKeyIndex+1;K<M.cells.length;K++){P=M.cells[K];this.selectCell(P);}if(L){for(K=0;K<=S.colKeyIndex;K++){P=L.cells[K];this.selectCell(P);}}}else{for(K=S.colKeyIndex;K<M.cells.length;K++){this.unselectCell(M.cells[K]);}if(L){for(K=0;K<S.colKeyIndex;K++){this.unselectCell(L.cells[K]);}}}}else{if(J==38){L=this.getPreviousTrEl(S.el);if(Q.recordIndex>=S.recordIndex){for(K=S.colKeyIndex-1;K>-1;K--){P=M.cells[K];this.selectCell(P);}if(L){for(K=M.cells.length-1;K>=S.colKeyIndex;K--){P=L.cells[K];this.selectCell(P);}}}else{for(K=S.colKeyIndex;K>-1;K--){this.unselectCell(M.cells[K]);
+}if(L){for(K=M.cells.length-1;K>S.colKeyIndex;K--){this.unselectCell(L.cells[K]);}}}}else{if(J==39){L=this.getNextTrEl(S.el);if(Q.recordIndex<S.recordIndex){if(S.colKeyIndex<M.cells.length-1){P=M.cells[S.colKeyIndex+1];this.selectCell(P);}else{if(L){P=L.cells[0];this.selectCell(P);}}}else{if(Q.recordIndex>S.recordIndex){this.unselectCell(M.cells[S.colKeyIndex]);if(S.colKeyIndex<M.cells.length-1){}else{}}else{if(Q.colKeyIndex<=S.colKeyIndex){if(S.colKeyIndex<M.cells.length-1){P=M.cells[S.colKeyIndex+1];this.selectCell(P);}else{if(S.trIndex<O.length-1){P=L.cells[0];this.selectCell(P);}}}else{this.unselectCell(M.cells[S.colKeyIndex]);}}}}else{if(J==37){L=this.getPreviousTrEl(S.el);if(Q.recordIndex<S.recordIndex){this.unselectCell(M.cells[S.colKeyIndex]);if(S.colKeyIndex>0){}else{}}else{if(Q.recordIndex>S.recordIndex){if(S.colKeyIndex>0){P=M.cells[S.colKeyIndex-1];this.selectCell(P);}else{if(S.trIndex>0){P=L.cells[L.cells.length-1];this.selectCell(P);}}}else{if(Q.colKeyIndex>=S.colKeyIndex){if(S.colKeyIndex>0){P=M.cells[S.colKeyIndex-1];this.selectCell(P);}else{if(S.trIndex>0){P=L.cells[L.cells.length-1];this.selectCell(P);}}}else{this.unselectCell(M.cells[S.colKeyIndex]);if(S.colKeyIndex>0){}else{}}}}}}}}}},_handleSingleCellSelectionByMouse:function(O){var P=O.target;var L=this.getTdEl(P);if(L){var K=this.getTrEl(L);var J=this.getRecord(K);var N=this.getColumn(L);var M={record:J,column:N};this._oAnchorCell=M;this.unselectAllCells();this.selectCell(M);}},_handleSingleCellSelectionByKey:function(N){var J=I.getCharCode(N);if((J==9)||((J>36)&&(J<41))){var L=N.shiftKey;var K=this._getSelectionTrigger();if(!K){return null;}var M;if(J==40){M=this.getBelowTdEl(K.el);if(M===null){M=K.el;}}else{if(J==38){M=this.getAboveTdEl(K.el);if(M===null){M=K.el;}}else{if((J==39)||(!L&&(J==9))){M=this.getNextTdEl(K.el);if(M===null){return ;}}else{if((J==37)||(L&&(J==9))){M=this.getPreviousTdEl(K.el);if(M===null){return ;}}}}}I.stopEvent(N);this.unselectAllCells();this.selectCell(M);this._oAnchorCell={record:this.getRecord(M),column:this.getColumn(M)};}},getSelectedTrEls:function(){return D.getElementsByClassName(G.CLASS_SELECTED,"tr",this._elTbody);},selectRow:function(P){var O,J;if(P instanceof YAHOO.widget.Record){O=this._oRecordSet.getRecord(P);J=this.getTrEl(O);}else{if(C.isNumber(P)){O=this.getRecord(P);J=this.getTrEl(O);}else{J=this.getTrEl(P);O=this.getRecord(J);}}if(O){var N=this._aSelections||[];var M=O.getId();var L=-1;if(N.indexOf){L=N.indexOf(M);}else{for(var K=N.length-1;K>-1;K--){if(N[K]===M){L=K;break;}}}if(L>-1){N.splice(L,1);}N.push(M);this._aSelections=N;if(!this._oAnchorRecord){this._oAnchorRecord=O;}if(J){D.addClass(J,G.CLASS_SELECTED);}this.fireEvent("rowSelectEvent",{record:O,el:J});}else{}},unselectRow:function(Q){var J=this.getTrEl(Q);var P;if(Q instanceof YAHOO.widget.Record){P=this._oRecordSet.getRecord(Q);}else{if(C.isNumber(Q)){P=this.getRecord(Q);}else{P=this.getRecord(J);}}if(P){var O=this._aSelections||[];var M=P.getId();var L=-1;var N=false;if(O.indexOf){L=O.indexOf(M);}else{for(var K=O.length-1;K>-1;K--){if(O[K]===M){L=K;break;}}}if(L>-1){O.splice(L,1);}if(N){this._aSelections=O;D.removeClass(J,G.CLASS_SELECTED);this.fireEvent("rowUnselectEvent",{record:P,el:J});return ;}D.removeClass(J,G.CLASS_SELECTED);this.fireEvent("rowUnselectEvent",{record:P,el:J});}},unselectAllRows:function(){var K=this._aSelections||[];for(var J=K.length-1;J>-1;J--){if(C.isString(K[J])){K.splice(J,1);}}this._aSelections=K;this._unselectAllTrEls();this.fireEvent("unselectAllRowsEvent");},_unselectAllTdEls:function(){var J=D.getElementsByClassName(G.CLASS_SELECTED,"td",this._elTbody);D.removeClass(J,G.CLASS_SELECTED);},getSelectedTdEls:function(){return D.getElementsByClassName(G.CLASS_SELECTED,"td",this._elTbody);},selectCell:function(J){var P=this.getTdEl(J);if(P){var O=this.getRecord(P);var N=P.yuiColumnId;if(O&&N){var M=this._aSelections||[];var L=O.getId();for(var K=M.length-1;K>-1;K--){if((M[K].recordId===L)&&(M[K].columnId===N)){M.splice(K,1);break;}}M.push({recordId:L,columnId:N});this._aSelections=M;if(!this._oAnchorCell){this._oAnchorCell={record:O,column:this.getColumnById(N)};}D.addClass(P,G.CLASS_SELECTED);this.fireEvent("cellSelectEvent",{record:O,column:this.getColumnById(N),key:P.yuiColumnKey,el:P});return ;}}},unselectCell:function(J){var O=this.getTdEl(J);if(O){var N=this.getRecord(O);var M=O.yuiColumnId;if(N&&M){var L=this._aSelections||[];var P=N.getId();for(var K=L.length-1;K>-1;K--){if((L[K].recordId===P)&&(L[K].columnId===M)){L.splice(K,1);this._aSelections=L;D.removeClass(O,G.CLASS_SELECTED);this.fireEvent("cellUnselectEvent",{record:N,column:this.getColumnById(M),key:O.yuiColumnKey,el:O});return ;}}}}},unselectAllCells:function(){var K=this._aSelections||[];for(var J=K.length-1;J>-1;J--){if(K[J].constructor==Object){K.splice(J,1);}}this._aSelections=K;this._unselectAllTdEls();this.fireEvent("unselectAllCellsEvent");},isSelected:function(P){var O,K,J;var L=this.getTrEl(P)||this.getTdEl(P);if(L){return D.hasClass(L,G.CLASS_SELECTED);}else{var N=this._aSelections;if(N&&N.length>0){if(P instanceof YAHOO.widget.Record){O=P;}else{if(C.isNumber(P)){O=this.getRecord(P);}}if(O){K=O.getId();if(N.indexOf){if(N.indexOf(K)>-1){return true;}}else{for(J=N.length-1;J>-1;J--){if(N[J]===K){return true;}}}}else{if(P.record&&P.column){K=P.record.getId();var M=P.column.getId();for(J=N.length-1;J>-1;J--){if((N[J].recordId===K)&&(N[J].columnId===M)){return true;}}}}}}return false;},getSelectedRows:function(){var J=[];var L=this._aSelections||[];for(var K=0;K<L.length;K++){if(C.isString(L[K])){J.push(L[K]);}}return J;},getSelectedCells:function(){var K=[];var L=this._aSelections||[];for(var J=0;J<L.length;J++){if(L[J]&&(L[J].constructor==Object)){K.push(L[J]);}}return K;},getLastSelectedRecord:function(){var K=this._aSelections;if(K&&K.length>0){for(var J=K.length-1;J>-1;J--){if(C.isString(K[J])){return K[J];}}}},getLastSelectedCell:function(){var K=this._aSelections;if(K&&K.length>0){for(var J=K.length-1;J>-1;
+J--){if(K[J].recordId&&K[J].columnId){return K[J];}}}},highlightRow:function(L){var J=this.getTrEl(L);if(J){var K=this.getRecord(J);D.addClass(J,G.CLASS_HIGHLIGHTED);this.fireEvent("rowHighlightEvent",{record:K,el:J});return ;}},unhighlightRow:function(L){var J=this.getTrEl(L);if(J){var K=this.getRecord(J);D.removeClass(J,G.CLASS_HIGHLIGHTED);this.fireEvent("rowUnhighlightEvent",{record:K,el:J});return ;}},highlightCell:function(J){var M=this.getTdEl(J);if(M){var L=this.getRecord(M);var K=M.yuiColumnId;D.addClass(M,G.CLASS_HIGHLIGHTED);this.fireEvent("cellHighlightEvent",{record:L,column:this.getColumnById(K),key:M.yuiColumnKey,el:M});return ;}},unhighlightCell:function(J){var L=this.getTdEl(J);if(L){var K=this.getRecord(L);D.removeClass(L,G.CLASS_HIGHLIGHTED);this.fireEvent("cellUnhighlightEvent",{record:K,column:this.getColumnById(L.yuiColumnId),key:L.yuiColumnKey,el:L});return ;}},showCellEditor:function(N,L,P){N=D.get(N);if(N&&(N.ownerDocument===document)){if(!L||!(L instanceof YAHOO.widget.Record)){L=this.getRecord(N);}if(!P||!(P instanceof YAHOO.widget.Column)){P=this.getColumn(N);}if(L&&P){var M=this._oCellEditor;if(M.isActive){this.cancelCellEditor();}if(!P.editor){return ;}M.cell=N;M.record=L;M.column=P;M.validator=(P.editorOptions&&C.isFunction(P.editorOptions.validator))?P.editorOptions.validator:null;M.value=L.getData(P.key);M.defaultValue=null;var O=M.container;var J=D.getX(N);var Q=D.getY(N);if(isNaN(J)||isNaN(Q)){J=N.offsetLeft+D.getX(this._elTbody.parentNode)-this._elTbody.scrollLeft;Q=N.offsetTop+D.getY(this._elTbody.parentNode)-this._elTbody.scrollTop+this._elThead.offsetHeight;}O.style.left=J+"px";O.style.top=Q+"px";this.doBeforeShowCellEditor(this._oCellEditor);O.style.display="";I.addListener(O,"keydown",function(S,R){if((S.keyCode==27)){R.cancelCellEditor();R.focusTbodyEl();}else{R.fireEvent("editorKeydownEvent",{editor:R._oCellEditor,event:S});}},this);var K;if(C.isString(P.editor)){switch(P.editor){case"checkbox":K=G.editCheckbox;break;case"date":K=G.editDate;break;case"dropdown":K=G.editDropdown;break;case"radio":K=G.editRadio;break;case"textarea":K=G.editTextarea;break;case"textbox":K=G.editTextbox;break;default:K=null;}}else{if(C.isFunction(P.editor)){K=P.editor;}}if(K){K(this._oCellEditor,this);if(!P.editorOptions||!P.editorOptions.disableBtns){this.showCellEditorBtns(O);}M.isActive=true;this.fireEvent("editorShowEvent",{editor:M});return ;}}}},doBeforeShowCellEditor:function(J){},showCellEditorBtns:function(L){var M=L.appendChild(document.createElement("div"));D.addClass(M,G.CLASS_BUTTON);var K=M.appendChild(document.createElement("button"));D.addClass(K,G.CLASS_DEFAULT);K.innerHTML="OK";I.addListener(K,"click",function(O,N){N.onEventSaveCellEditor(O,N);N.focusTbodyEl();},this,true);var J=M.appendChild(document.createElement("button"));J.innerHTML="Cancel";I.addListener(J,"click",function(O,N){N.onEventCancelCellEditor(O,N);N.focusTbodyEl();},this,true);},resetCellEditor:function(){var J=this._oCellEditor.container;J.style.display="none";I.purgeElement(J,true);J.innerHTML="";this._oCellEditor.value=null;this._oCellEditor.isActive=false;},saveCellEditor:function(){if(this._oCellEditor.isActive){var J=this._oCellEditor.value;var K=YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));if(this._oCellEditor.validator){J=this._oCellEditor.value=this._oCellEditor.validator.call(this,J,K,this._oCellEditor);if(J===null){this.resetCellEditor();this.fireEvent("editorRevertEvent",{editor:this._oCellEditor,oldData:K,newData:J});return ;}}this._oRecordSet.updateRecordValue(this._oCellEditor.record,this._oCellEditor.column.key,this._oCellEditor.value);this.formatCell(this._oCellEditor.cell.firstChild);this._syncColWidths();this.resetCellEditor();this.fireEvent("editorSaveEvent",{editor:this._oCellEditor,oldData:K,newData:J});}else{}},cancelCellEditor:function(){if(this._oCellEditor.isActive){this.resetCellEditor();this.fireEvent("editorCancelEvent",{editor:this._oCellEditor});}else{}},doBeforeLoadData:function(J,K,L){return true;},onEventSortColumn:function(L){var J=L.event;var N=L.target;var K=this.getThEl(N)||this.getTdEl(N);if(K&&K.yuiColumnKey){var M=this.getColumn(K.yuiColumnKey);if(M.sortable){I.stopEvent(J);this.sortColumn(M);}}else{}},onEventSelectColumn:function(J){this.selectColumn(J.target);},onEventHighlightColumn:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.highlightColumn(J.target);}},onEventUnhighlightColumn:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.unhighlightColumn(J.target);}},onEventSelectRow:function(K){var J=this.get("selectionMode");if(J=="single"){this._handleSingleSelectionByMouse(K);}else{this._handleStandardSelectionByMouse(K);}},onEventSelectCell:function(K){var J=this.get("selectionMode");if(J=="cellblock"){this._handleCellBlockSelectionByMouse(K);}else{if(J=="cellrange"){this._handleCellRangeSelectionByMouse(K);}else{this._handleSingleCellSelectionByMouse(K);}}},onEventHighlightRow:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.highlightRow(J.target);}},onEventUnhighlightRow:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.unhighlightRow(J.target);}},onEventHighlightCell:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.highlightCell(J.target);}},onEventUnhighlightCell:function(J){if(!D.isAncestor(J.target,I.getRelatedTarget(J.event))){this.unhighlightCell(J.target);}},onEventFormatCell:function(J){var M=J.target;var K=this.getTdEl(M);if(K&&K.yuiColumnKey){var L=this.getColumn(K.yuiColumnKey);this.formatCell(K.firstChild,this.getRecord(K),L);}else{}},onEventShowCellEditor:function(J){var L=J.target;var K=this.getTdEl(L);if(K){this.showCellEditor(K);}else{}},onEventSaveCellEditor:function(J){this.saveCellEditor();},onEventCancelCellEditor:function(J){this.cancelCellEditor();},onDataReturnInitializeTable:function(J,K,L){this.initializeTable();this.onDataReturnSetRecords(J,K,L);
+},onDataReturnAppendRows:function(K,L,M){this.fireEvent("dataReturnEvent",{request:K,response:L,payload:M});var J=this.doBeforeLoadData(K,L,M);if(J&&L&&!L.error&&C.isArray(L.results)){this.addRows(L.results);this._handleDataReturnPayload(K,L,M);}else{if(J&&L.error){this.showTableMessage(G.MSG_ERROR,G.CLASS_ERROR);}}},onDataReturnInsertRows:function(K,L,M){this.fireEvent("dataReturnEvent",{request:K,response:L,payload:M});M=M||{insertIndex:0};var J=this.doBeforeLoadData(K,L,M);if(J&&L&&!L.error&&C.isArray(L.results)){this.addRows(L.results,M.insertIndex||0);this._handleDataReturnPayload(K,L,M);}else{if(J&&L.error){this.showTableMessage(G.MSG_ERROR,G.CLASS_ERROR);}}},onDataReturnSetRecords:function(M,L,N){this.fireEvent("dataReturnEvent",{request:M,response:L,payload:N});var K=this.doBeforeLoadData(M,L,N);if(K&&L&&!L.error&&C.isArray(L.results)){var J=this.get("paginator");var O=N&&C.isNumber(N.startIndex)?N.startIndex:0;if(J instanceof B){if(C.isNumber(L.totalRecords)){J.setTotalRecords(L.totalRecords,true);}else{J.setTotalRecords(L.results.length,true);}}this._oRecordSet.setRecords(L.results,O);this._handleDataReturnPayload(M,L,N);this.render();}else{if(K&&L.error){this.showTableMessage(G.MSG_ERROR,G.CLASS_ERROR);}}},_handleDataReturnPayload:function(M,L,N){if(N){var K=N.pagination;if(K){var J=this.get("paginator");if(J&&J instanceof B){J.setStartIndex(K.recordOffset,true);J.setRowsPerPage(K.rowsPerPage,true);}}K=N.sorting;if(K){this.set("sortedBy",K);}}},getBody:function(){return this.getTbodyEl();},getCell:function(J){return this.getTdEl(J);},getRow:function(J){return this.getTrEl(J);},refreshView:function(){this.render();},select:function(K){if(!C.isArray(K)){K=[K];}for(var J=0;J<K.length;J++){this.selectRow(K[J]);}},updatePaginator:function(K){var M=this.get("paginator");var J=M.currentPage;for(var L in K){if(C.hasOwnProperty(M,L)){M[L]=K[L];}}M.totalRecords=this._oRecordSet.getLength();M.rowsThisPage=Math.min(M.rowsPerPage,M.totalRecords);M.totalPages=Math.ceil(M.totalRecords/M.rowsThisPage);if(isNaN(M.totalPages)){M.totalPages=0;}if(M.currentPage>M.totalPages){if(M.totalPages<1){M.currentPage=1;}else{M.currentPage=M.totalPages;}}if(M.currentPage!==J){M.startRecordIndex=(M.currentPage-1)*M.rowsPerPage;}this.set("paginator",M);return this.get("paginator");},showPage:function(K){var J=this.get("paginator");if(!C.isNumber(K)||(K<1)){if(J instanceof B){if(!J.hasPage(K)){K=1;}}else{if(K>J.totalPages){K=1;}}}if(J instanceof B){J.setPage(K);}else{this.updatePaginator({currentPage:K});this.render();}},formatPaginators:function(){var K=this.get("paginator");if(K instanceof B){K.update();return ;}var J;var L=false;if(K.pageLinks>-1){for(J=0;J<K.links.length;J++){this.formatPaginatorLinks(K.links[J],K.currentPage,K.pageLinksStart,K.pageLinks,K.totalPages);}}for(J=0;J<K.dropdowns.length;J++){if(K.dropdownOptions){L=true;this.formatPaginatorDropdown(K.dropdowns[J],K.dropdownOptions);}else{K.dropdowns[J].style.display="none";}}if(L&&A.opera){document.body.style+="";}},formatPaginatorDropdown:function(O,N){if(O&&(O.ownerDocument==document)){while(O.firstChild){O.removeChild(O.firstChild);}for(var L=0;L<N.length;L++){var P=N[L];var J=document.createElement("option");J.value=(C.isValue(P.value))?P.value:P;J.innerHTML=(C.isValue(P.text))?P.text:P;J=O.appendChild(J);}var K=O.options;if(K.length){for(var M=K.length-1;M>-1;M--){if((this.get("paginator").rowsPerPage+"")===K[M].value){K[M].selected=true;}}}O.style.display="";return ;}},formatPaginatorLinks:function(N,J,W,M,T){if(N&&(N.ownerDocument==document)&&C.isNumber(J)&&C.isNumber(W)&&C.isNumber(T)){var P=(J==1)?true:false;var K=(J==T)?true:false;var R=(P)?' <span class="'+G.CLASS_DISABLED+" "+G.CLASS_FIRST+'">&lt;&lt;</span> ':' <a href="#" class="'+G.CLASS_FIRST+'">&lt;&lt;</a> ';var U=(P)?' <span class="'+G.CLASS_DISABLED+" "+G.CLASS_PREVIOUS+'">&lt;</span> ':' <a href="#" class="'+G.CLASS_PREVIOUS+'">&lt;</a> ';var X=(K)?' <span class="'+G.CLASS_DISABLED+" "+G.CLASS_NEXT+'">&gt;</span> ':' <a href="#" class="'+G.CLASS_NEXT+'">&gt;</a> ';var L=(K)?' <span class="'+G.CLASS_DISABLED+" "+G.CLASS_LAST+'">&gt;&gt;</span> ':' <a href="#" class="'+G.CLASS_LAST+'">&gt;&gt;</a> ';var Q=R+U;var Y=T;var S=1;var V=T;if(M>0){Y=(W+M<T)?W+M-1:T;S=(J-Math.floor(Y/2)>0)?J-Math.floor(Y/2):1;V=(J+Math.floor(Y/2)<=T)?J+Math.floor(Y/2):T;if(S===1){V=Y;}else{if(V===T){S=T-Y+1;}}if(V-S===Y){V--;}}for(var O=S;O<=V;O++){if(O!=J){Q+=' <a href="#" class="'+G.CLASS_PAGE+'">'+O+"</a> ";}else{Q+=' <span class="'+G.CLASS_SELECTED+'">'+O+"</span>";}}Q+=X+L;N.innerHTML=Q;return ;}},_onPaginatorLinkClick:function(L,K){var M=I.getTarget(L);var J=M.nodeName.toLowerCase();if(K._oCellEditor&&K._oCellEditor.isActive){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});}while(M&&(J!="table")){switch(J){case"body":return ;case"a":I.stopEvent(L);switch(M.className){case G.CLASS_PAGE:K.showPage(parseInt(M.innerHTML,10));return ;case G.CLASS_FIRST:K.showPage(1);return ;case G.CLASS_LAST:K.showPage(K.get("paginator").totalPages);return ;case G.CLASS_PREVIOUS:K.showPage(K.get("paginator").currentPage-1);return ;case G.CLASS_NEXT:K.showPage(K.get("paginator").currentPage+1);return ;}break;default:return ;}M=M.parentNode;if(M){J=M.nodeName.toLowerCase();}else{return ;}}},_onPaginatorDropdownChange:function(N,K){var O=I.getTarget(N);var M=O[O.selectedIndex].value;var J=C.isValue(parseInt(M,10))?parseInt(M,10):null;if(J!==null){var L=(K.get("paginator").currentPage-1)*J;K.updatePaginator({rowsPerPage:J,startRecordIndex:L});K.render();}else{}},onEventEditCell:function(J){this.onEventShowCellEditor(J);},onDataReturnReplaceRows:function(J,K){this.onDataReturnInitializeTable(J,K);}});})();YAHOO.register("datatable",YAHOO.widget.DataTable,{version:"2.5.0",build:"895"});
\ No newline at end of file
index b56afe45a1c21d8462748e609c8cef7057d1d0ad..7dd6e5e2ee0a62a5230522c0e63402779a8fae66 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
- * The DataTable widget provides a progressively enhanced DHTML control for
- * displaying tabular data across A-grade browsers.
+ * Mechanism to execute a series of callbacks in a non-blocking queue.  Each callback is executed via setTimout unless configured with a negative timeout, in which case it is run in blocking mode in the same execution thread as the previous callback.  Callbacks can be function references or object literals with the following keys:
+ * <ul>
+ *    <li><code>method</code> - {Function} REQUIRED the callback function.</li>
+ *    <li><code>scope</code> - {Object} the scope from which to execute the callback.  Default is the global window scope.</li>
+ *    <li><code>argument</code> - {Array} parameters to be passed to method as individual arguments.</li>
+ *    <li><code>timeout</code> - {number} millisecond delay to wait after previous callback completion before executing this callback.  Negative values cause immediate blocking execution.  Default 0.</li>
+ *    <li><code>until</code> - {Function} boolean function executed before each iteration.  Return true to indicate completion and proceed to the next callback.</li>
+ *    <li><code>iterations</code> - {Number} number of times to execute the callback before proceeding to the next callback in the chain. Incompatible with <code>until</code>.</li>
+ * </ul>
  *
- * @module datatable
- * @requires yahoo, dom, event, datasource
- * @optional dragdrop
- * @title DataTable Widget
- * @beta
- */
+ * @namespace YAHOO.util
+ * @class Chain
+ * @constructor
+ * @param callback* {Function|Object} Any number of callbacks to initialize the queue
+*/
+YAHOO.util.Chain = function () {
+    /**
+     * The callback queue
+     * @property q
+     * @type {Array}
+     * @private
+     */
+    this.q = [].slice.call(arguments);
+};
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+YAHOO.util.Chain.prototype = {
+    /**
+     * Timeout id used to pause or stop execution and indicate the execution state of the Chain.  0 indicates paused or stopped, -1 indicates blocking execution, and any positive number indicates non-blocking execution.
+     * @property id
+     * @type {number}
+     * @private
+     */
+    id   : 0,
 
-/**
- * DataTable class for the YUI DataTable widget.
- *
- * @namespace YAHOO.widget
- * @class DataTable
- * @uses YAHOO.util.EventProvider
- * @constructor
- * @param elContainer {HTMLElement} Container element for the TABLE.
- * @param aColumnDefs {Object[]} Array of object literal Column definitions.
- * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
- * @param oConfigs {object} (optional) Object literal of configuration values.
- */
-YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
-    // Internal vars
-    this._nIndex = YAHOO.widget.DataTable._nCount;
-    this._sName = "instance" + this._nIndex;
-    this.id = "yui-dt"+this._nIndex;
+    /**
+     * Begin executing the chain, or resume execution from the last paused position.
+     * @method run
+     * @return {Chain} the Chain instance
+     */
+    run : function () {
+        // Grab the first callback in the queue
+        var c  = this.q[0],
+            fn;
 
-    // Initialize container element
-    this._initContainerEl(elContainer);
-    if(!this._elContainer) {
-        return;
-    }
+        // If there is no callback in the queue or the Chain is currently
+        // in an execution mode, return
+        if (!c || this.id) {
+            return this;
+        }
 
-    // Initialize configs
-    this._initConfigs(oConfigs);
+        fn = c.method || c;
 
-    // Initialize ColumnSet
-    this._initColumnSet(aColumnDefs);
-    if(!this._oColumnSet) {
-        return;
-    }
-    
-    // Initialize RecordSet
-    this._initRecordSet();
-    if(!this._oRecordSet) {
-        return;
-    }
+        if (typeof fn === 'function') {
+            var o    = c.scope || {},
+                args = c.argument || [],
+                ms   = c.timeout || 0,
+                me   = this;
+                
+            if (!(args instanceof Array)) {
+                args = [args];
+            }
 
-    // Initialize DataSource
-    this._initDataSource(oDataSource);
-    if(!this._oDataSource) {
-        return;
-    }
+            // Execute immediately if the callback timeout is negative.
+            if (ms < 0) {
+                this.id = ms;
+                if (c.until) {
+                    for (;!c.until();) {
+                        // Execute the callback from scope, with argument
+                        fn.apply(o,args);
+                    }
+                } else if (c.iterations) {
+                    for (;c.iterations-- > 0;) {
+                        fn.apply(o,args);
+                    }
+                } else {
+                    fn.apply(o,args);
+                }
+                this.q.shift();
+                this.id = 0;
+                return this.run();
+            } else {
+                // If the until condition is set, check if we're done
+                if (c.until) {
+                    if (c.until()) {
+                        // Shift this callback from the queue and execute the next
+                        // callback
+                        this.q.shift();
+                        return this.run();
+                    }
+                // Otherwise if either iterations is not set or we're
+                // executing the last iteration, shift callback from the queue
+                } else if (!c.iterations || !--c.iterations) {
+                    this.q.shift();
+                }
 
-    // Progressive enhancement special case
-    if(this._oDataSource.dataType == YAHOO.util.DataSource.TYPE_HTMLTABLE) {
-        this._oDataSource.sendRequest(this.get("initialRequest"), this._onDataReturnEnhanceTable, this);
-    }
-    else {
-        // Initialize DOM elements
-        this._initTableEl();
-        if(!this._elTable || !this._elThead || !this._elTbody) {
-            return;
+                // Otherwise set to execute after the configured timeout
+                this.id = setTimeout(function () {
+                    // Execute the callback from scope, with argument
+                    fn.apply(o,args);
+                    // Check if the Chain was not paused from inside the callback
+                    if (me.id) {
+                        // Indicate ready to run state
+                        me.id = 0;
+                        // Start the fun all over again
+                        me.run();
+                    }
+                },ms);
+            }
         }
 
-        // Call Element's constructor after DOM elements are created
-        // but *before* table is populated with data
-        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
-        
-        //HACK: Set the Paginator values here via updatePaginator
-        if(this._oConfigs && this._oConfigs.paginator) {
-            this.updatePaginator(this._oConfigs.paginator);
-        }
+        return this;
+    },
+    
+    /**
+     * Add a callback to the end of the queue
+     * @method add
+     * @param c {Function|Object} the callback function ref or object literal
+     * @return {Chain} the Chain instance
+     */
+    add  : function (c) {
+        this.q.push(c);
+        return this;
+    },
+
+    /**
+     * Pause the execution of the Chain after the current execution of the
+     * current callback completes.  If called interstitially, clears the
+     * timeout for the pending callback. Paused Chains can be restarted with
+     * chain.run()
+     * @method pause
+     * @return {Chain} the Chain instance
+     */
+    pause: function () {
+        clearTimeout(this.id);
+        this.id = 0;
+        return this;
+    },
 
-        // Send out for data in an asynchronous request
-        this._oDataSource.sendRequest(this.get("initialRequest"), this.onDataReturnInitializeTable, this);
+    /**
+     * Stop and clear the Chain's queue after the current execution of the
+     * current callback completes.
+     * @method stop
+     * @return {Chain} the Chain instance
+     */
+    stop : function () { 
+        this.pause();
+        this.q = [];
+        return this;
     }
+};
 
-    // Initialize inline Cell editing
-    this._initCellEditorEl();
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
-    // Initialize Column sort
-    this._initColumnSort();
+/**
+ * The ColumnSet class defines and manages a DataTable's Columns,
+ * including nested hierarchies and access to individual Column instances.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSet
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param aDefinitions {Object[]} Array of object literals that define cells in
+ * the THEAD.
+ */
+YAHOO.widget.ColumnSet = function(aDefinitions) {
+    this._sId = "yui-cs" + YAHOO.widget.ColumnSet._nCount;
 
-    // Initialize DOM event listeners
-    this._initDomEvents();
+    // First clone the defs
+    aDefinitions = YAHOO.widget.DataTable._cloneObject(aDefinitions);
+    this._init(aDefinitions);
 
-    YAHOO.widget.DataTable._nCount++;
+    YAHOO.widget.ColumnSet._nCount++;
 };
 
-if(YAHOO.util.Element) {
-    YAHOO.lang.extend(YAHOO.widget.DataTable, YAHOO.util.Element);
-}
-else {
-}
-
 /////////////////////////////////////////////////////////////////////////////
 //
-// Superclass methods
+// Private member variables
 //
 /////////////////////////////////////////////////////////////////////////////
 
 /**
- * Implementation of Element's abstract method. Sets up config values.
+ * Internal class variable to index multiple ColumnSet instances.
  *
- * @method initAttributes
- * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @property ColumnSet._nCount
+ * @type Number
  * @private
+ * @static
  */
+YAHOO.widget.ColumnSet._nCount = 0;
 
-YAHOO.widget.DataTable.prototype.initAttributes = function(oConfigs) {
-    oConfigs = oConfigs || {};
-    YAHOO.widget.DataTable.superclass.initAttributes.call(this, oConfigs);
-
+YAHOO.widget.ColumnSet.prototype = {
     /**
-    * @config summary
-    * @description Value for the SUMMARY attribute.
-    * @type String
-    */
-    this.setAttributeConfig("summary", {
-        value: null,
-        validator: YAHOO.lang.isString,
-        method: function(sSummary) {
-            this._elTable.summary = sSummary;
-        }
-    });
+     * Unique instance name.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
     /**
-    * @config selectionMode
-    * @description Specifies row or cell selection mode. Accepts the following strings:
-    *    <dl>
-    *      <dt>"standard"</dt>
-    *      <dd>Standard row selection with support for modifier keys to enable
-    *      multiple selections.</dd>
-    *
-    *      <dt>"single"</dt>
-    *      <dd>Row selection with modifier keys disabled to not allow
-    *      multiple selections.</dd>
-    *
-    *      <dt>"singlecell"</dt>
-    *      <dd>Cell selection with modifier keys disabled to not allow
-    *      multiple selections.</dd>
-    *
-    *      <dt>"cellblock"</dt>
-    *      <dd>Cell selection with support for modifier keys to enable multiple
-    *      selections in a block-fashion, like a spreadsheet.</dd>
-    *
-    *      <dt>"cellrange"</dt>
-    *      <dd>Cell selection with support for modifier keys to enable multiple
-    *      selections in a range-fashion, like a calendar.</dd>
-    *    </dl>
-    *
-    * @default "standard"
-    * @type String
-    */
-    this.setAttributeConfig("selectionMode", {
-        value: "standard",
-        validator: YAHOO.lang.isString
-    });
+     * Array of object literal Column definitions passed to the constructor.
+     *
+     * @property _aDefinitions
+     * @type Object[]
+     * @private
+     */
+    _aDefinitions : null,
 
-    /**
-    * @config initialRequest
-    * @description Defines the initial request that gets sent to the DataSource.
-    * @type String
-    */
-    this.setAttributeConfig("initialRequest", {
-        value: "",
-        validator: YAHOO.lang.isString
-    });
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
     /**
-    * @config sortedBy
-    * @description Object literal provides metadata for initial sort values if
-    * data will arrive pre-sorted:
-    * <dl>
-    *     <dt>sortedBy.key</dt>
-    *     <dd>Key of sorted Column</dd>
-    *     <dt>sortedBy.dir</dt>
-    *     <dd>Initial sort direction, either "asc" or "desc"</dd>
-    * </dl>
-    * @type Object
-    */
-    this.setAttributeConfig("sortedBy", {
-        value: null,
-        // TODO: accepted array for nested sorts
-        validator: function(oNewSortedBy) {
-            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
-        },
-        method: function(oNewSortedBy) {
-            // Remove ASC/DESC from TH
-            var oOldSortedBy = this.get("sortedBy");
-            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
-                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
-                var oldThEl = this.getThEl(oldColumn);
-                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_ASC);
-                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_DESC);
-            }
-            
-            // Set ASC/DESC on TH
-            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
-            if(column) {
-                var newClass = (oNewSortedBy.dir && (oNewSortedBy.dir != "asc")) ?
-                        YAHOO.widget.DataTable.CLASS_DESC :
-                        YAHOO.widget.DataTable.CLASS_ASC;
-                YAHOO.util.Dom.addClass(this.id + "-col" + column.getId(), newClass);
-            }
-        }
-    });
+     * Top-down tree representation of Column hierarchy.
+     *
+     * @property tree
+     * @type YAHOO.widget.Column[]
+     */
+    tree : null,
 
     /**
-    * @config paginator
-    * @description Object literal of pagination values.
-    * @default <br>
-    *   { containers:[], // UI container elements <br>
-    *   rowsPerPage:500, // 500 rows <br>
-    *   currentPage:1,  // page one <br>
-    *   pageLinks:0,    // show all links <br>
-    *   pageLinksStart:1, // first link is page 1 <br>
-    *   dropdownOptions:null, // no dropdown <br>
-    *   links: [], // links elements <br>
-    *   dropdowns: [] } //dropdown elements
-    * 
-    * @type Object
-    */
-    this.setAttributeConfig("paginator", {
-        value: {
-            rowsPerPage:500, // 500 rows per page
-            currentPage:1,  // show page one
-            startRecordIndex:0, // start with first Record
-            totalRecords:0, // how many Records total
-            totalPages:0, // how many pages total
-            rowsThisPage:0, // how many rows this page
-            pageLinks:0,    // show all links
-            pageLinksStart:1, // first link is page 1
-            dropdownOptions: null, //no dropdown
-            containers:[], // Paginator container element references
-            dropdowns: [], //dropdown element references,
-            links: [] // links elements
-        },
-        validator: function(oNewPaginator) {
-            if(oNewPaginator && (oNewPaginator.constructor == Object)) {
-                // Check for incomplete set of values
-                if((oNewPaginator.rowsPerPage !== undefined) &&
-                        (oNewPaginator.currentPage !== undefined) &&
-                        (oNewPaginator.startRecordIndex !== undefined) &&
-                        (oNewPaginator.totalRecords !== undefined) &&
-                        (oNewPaginator.totalPages !== undefined) &&
-                        (oNewPaginator.rowsThisPage !== undefined) &&
-                        (oNewPaginator.pageLinks !== undefined) &&
-                        (oNewPaginator.pageLinksStart !== undefined) &&
-                        (oNewPaginator.dropdownOptions !== undefined) &&
-                        (oNewPaginator.containers !== undefined) &&
-                        (oNewPaginator.dropdowns !== undefined) &&
-                        (oNewPaginator.links !== undefined)) {
-
-                    // Validate each value
-                    if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.currentPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.startRecordIndex) &&
-                            YAHOO.lang.isNumber(oNewPaginator.totalRecords) &&
-                            YAHOO.lang.isNumber(oNewPaginator.totalPages) &&
-                            YAHOO.lang.isNumber(oNewPaginator.rowsThisPage) &&
-                            YAHOO.lang.isNumber(oNewPaginator.pageLinks) &&
-                            YAHOO.lang.isNumber(oNewPaginator.pageLinksStart) &&
-                            YAHOO.lang.isArray(oNewPaginator.dropdownOptions) &&
-                            YAHOO.lang.isArray(oNewPaginator.containers) &&
-                            YAHOO.lang.isArray(oNewPaginator.dropdowns) &&
-                            YAHOO.lang.isArray(oNewPaginator.links)) {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-    });
+     * Flattened representation of all Columns.
+     *
+     * @property flat
+     * @type YAHOO.widget.Column[]
+     * @default []
+     */
+    flat : null,
 
     /**
-    * @config paginated
-    * @description True if built-in client-side pagination is enabled
-    * @default false
-    * @type Boolean
-    */
-    this.setAttributeConfig("paginated", {
-        value: false,
-        validator: YAHOO.lang.isBoolean,
-        method: function(oParam) {
-            var oPaginator = this.get("paginator");
-            var aContainerEls = oPaginator.containers;
-            
-            // Paginator is enabled
-            if(oParam) {
-                // No containers found, create two from scratch
-                if(aContainerEls.length === 0) {
-                    // One before TABLE
-                    var pag0 = document.createElement("span");
-                    pag0.id = this.id + "-paginator0";
-                    YAHOO.util.Dom.addClass(pag0, YAHOO.widget.DataTable.CLASS_PAGINATOR);
-                    pag0 = this._elContainer.insertBefore(pag0, this._elTable);
-                    aContainerEls.push(pag0);
-
-                    // One after TABLE
-                    var pag1 = document.createElement("span");
-                    pag1.id = this.id + "-paginator1";
-                    YAHOO.util.Dom.addClass(pag1, YAHOO.widget.DataTable.CLASS_PAGINATOR);
-                    pag1 = this._elContainer.insertBefore(pag1, this._elTable.nextSibling);
-                    aContainerEls.push(pag1);
-
-                    // Add containers directly to tracker
-                    this._configs.paginator.value.containers = [pag0, pag1];
+     * Array of Columns that map one-to-one to a table column.
+     *
+     * @property keys
+     * @type YAHOO.widget.Column[]
+     * @default []
+     */
+    keys : null,
 
-                }
-                else {
-                    // Show each container
-                    for(var i=0; i<aContainerEls.length; i++) {
-                        aContainerEls[i].style.display = "";
-                    }
-                }
+    /**
+     * ID index of nested parent hierarchies for HEADERS accessibility attribute.
+     *
+     * @property headers
+     * @type String[]
+     * @default []
+     */
+    headers : null,
 
-                // Links are enabled
-                if(oPaginator.pageLinks > -1) {
-                    var aLinkEls = oPaginator.links;
-                    // No links containers found, create from scratch
-                    if(aLinkEls.length === 0) {
-                        for(i=0; i<aContainerEls.length; i++) {
-                            // Create one links container per Paginator container
-                            var linkEl = document.createElement("span");
-                            linkEl.id = "yui-dt-pagselect"+i;
-                            linkEl = aContainerEls[i].appendChild(linkEl);
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-                            // Add event listener
-                            //TODO: anon fnc
-                            YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+    /**
+     * Initializes ColumnSet instance with data from Column definitions.
+     *
+     * @method _init
+     * @param aDefinitions {Object[]} Array of object literals that define cells in
+     * the THEAD .
+     * @private
+     */
 
-                             // Add directly to tracker
-                            this._configs.paginator.value.links.push(linkEl);
-                       }
-                   }
-                }
+    _init : function(aDefinitions) {        
+        // DOM tree representation of all Columns
+        var tree = [];
+        // Flat representation of all Columns
+        var flat = [];
+        // Flat representation of only Columns that are meant to display data
+        var keys = [];
+        // Array of HEADERS attribute values for all keys in the "keys" array
+        var headers = [];
+
+        // Tracks current node list depth being tracked
+        var nodeDepth = -1;
+
+        // Internal recursive function to define Column instances
+        var parseColumns = function(nodeList, parent) {
+            // One level down
+            nodeDepth++;
+
+            // Create corresponding tree node if not already there for this depth
+            if(!tree[nodeDepth]) {
+                tree[nodeDepth] = [];
+            }
 
-                // Show these options in the dropdown
-                var dropdownOptions = oPaginator.dropdownOptions || [];
 
-                for(i=0; i<aContainerEls.length; i++) {
-                    // Create one SELECT element per Paginator container
-                    var selectEl = document.createElement("select");
-                    YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
-                    selectEl = aContainerEls[i].appendChild(selectEl);
-                    selectEl.id = "yui-dt-pagselect"+i;
+            // Parse each node at this depth for attributes and any children
+            for(var j=0; j<nodeList.length; j++) {
+                var currentNode = nodeList[j];
 
-                    // Add event listener
-                    //TODO: anon fnc
-                    YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+                // Instantiate a new Column for each node
+                var oColumn = new YAHOO.widget.Column(currentNode);
+                
+                // Assign unique ID to Column and cross-reference it back to the
+                // original object literal definition
+                currentNode.yuiColumnId = oColumn._sId = YAHOO.widget.Column._nCount + "";
+                
+                // Assign a key if not found
+                if(!YAHOO.lang.isValue(oColumn.key)) {
+                    oColumn.key = "yui-dt-col" + YAHOO.widget.Column._nCount;
+                }
+                // Increment counter
+                YAHOO.widget.Column._nCount++;
 
-                    // Add DOM reference directly to tracker
-                   this._configs.paginator.value.dropdowns.push(selectEl);
+                // Add the new Column to the flat list
+                flat.push(oColumn);
 
-                    // Hide dropdown
-                    if(!oPaginator.dropdownOptions) {
-                        selectEl.style.display = "none";
-                    }
+                // Assign its parent as an attribute, if applicable
+                if(parent) {
+                    oColumn.parent = parent;
                 }
 
-                //TODO: fire paginatorDisabledEvent & add to api doc
+                // The Column has descendants
+                if(YAHOO.lang.isArray(currentNode.children)) {
+                    oColumn.children = currentNode.children;
+
+                    // Determine COLSPAN value for this Column
+                    var terminalChildNodes = 0;
+                    var countTerminalChildNodes = function(ancestor) {
+                        var descendants = ancestor.children;
+                        // Drill down each branch and count terminal nodes
+                        for(var k=0; k<descendants.length; k++) {
+                            // Keep drilling down
+                            if(YAHOO.lang.isArray(descendants[k].children)) {
+                                countTerminalChildNodes(descendants[k]);
+                            }
+                            // Reached branch terminus
+                            else {
+                                terminalChildNodes++;
+                            }
+                        }
+                    };
+                    countTerminalChildNodes(currentNode);
+                    oColumn._nColspan = terminalChildNodes;
+
+                    // Cascade certain properties to children if not defined on their own
+                    var currentChildren = currentNode.children;
+                    for(var k=0; k<currentChildren.length; k++) {
+                        var child = currentChildren[k];
+                        if(oColumn.className && (child.className === undefined)) {
+                            child.className = oColumn.className;
+                        }
+                        if(oColumn.editor && (child.editor === undefined)) {
+                            child.editor = oColumn.editor;
+                        }
+                        if(oColumn.editorOptions && (child.editorOptions === undefined)) {
+                            child.editorOptions = oColumn.editorOptions;
+                        }
+                        if(oColumn.formatter && (child.formatter === undefined)) {
+                            child.formatter = oColumn.formatter;
+                        }
+                        if(oColumn.resizeable && (child.resizeable === undefined)) {
+                            child.resizeable = oColumn.resizeable;
+                        }
+                        if(oColumn.sortable && (child.sortable === undefined)) {
+                            child.sortable = oColumn.sortable;
+                        }
+                        if(oColumn.width && (child.width === undefined)) {
+                            child.width = oColumn.width;
+                        }
+                        // Backward compatibility
+                        if(oColumn.type && (child.type === undefined)) {
+                            child.type = oColumn.type;
+                        }
+                        if(oColumn.type && !oColumn.formatter) {
+                            oColumn.formatter = oColumn.type;
+                        }
+                        if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
+                            oColumn.label = oColumn.text;
+                        }
+                        if(oColumn.parser) {
+                        }
+                        if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
+                                (oColumn.sortOptions.descFunction))) {
+                        }
+                    }
+
+                    // The children themselves must also be parsed for Column instances
+                    if(!tree[nodeDepth+1]) {
+                        tree[nodeDepth+1] = [];
+                    }
+                    parseColumns(currentChildren, oColumn);
+                }
+                // This Column does not have any children
+                else {
+                    oColumn._nKeyIndex = keys.length;
+                    oColumn._nColspan = 1;
+                    keys.push(oColumn);
+                }
+
+                // Add the Column to the top-down tree
+                tree[nodeDepth].push(oColumn);
             }
-            // Pagination is disabled
-            else {
-                // Containers found
-                if(aContainerEls.length > 0) {
-                    // Destroy or just hide?
-                    
-                    // Hide each container
-                    for(i=0; i<aContainerEls.length; i++) {
-                        aContainerEls[i].style.display = "none";
+            nodeDepth--;
+        };
+
+        // Parse out Column instances from the array of object literals
+        if(YAHOO.lang.isArray(aDefinitions)) {
+            parseColumns(aDefinitions);
+
+            // Store the array
+            this._aDefinitions = aDefinitions;
+        }
+        else {
+            return null;
+        }
+
+        var i;
+
+        // Determine ROWSPAN value for each Column in the tree
+        var parseTreeForRowspan = function(tree) {
+            var maxRowDepth = 1;
+            var currentRow;
+            var currentColumn;
+
+            // Calculate the max depth of descendants for this row
+            var countMaxRowDepth = function(row, tmpRowDepth) {
+                tmpRowDepth = tmpRowDepth || 1;
+
+                for(var n=0; n<row.length; n++) {
+                    var col = row[n];
+                    // Column has children, so keep counting
+                    if(YAHOO.lang.isArray(col.children)) {
+                        tmpRowDepth++;
+                        countMaxRowDepth(col.children, tmpRowDepth);
+                        tmpRowDepth--;
+                    }
+                    // No children, is it the max depth?
+                    else {
+                        if(tmpRowDepth > maxRowDepth) {
+                            maxRowDepth = tmpRowDepth;
+                        }
                     }
 
-                    /*TODO?
-                    // Destroy each container
-                    for(i=0; i<aContainerEls.length; i++) {
-                        YAHOO.util.Event.purgeElement(aContainerEls[i], true);
-                        aContainerEls.innerHTML = null;
-                        //TODO: remove container?
-                        // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
+                }
+            };
+
+            // Count max row depth for each row
+            for(var m=0; m<tree.length; m++) {
+                currentRow = tree[m];
+                countMaxRowDepth(currentRow);
+
+                // Assign the right ROWSPAN values to each Column in the row
+                for(var p=0; p<currentRow.length; p++) {
+                    currentColumn = currentRow[p];
+                    if(!YAHOO.lang.isArray(currentColumn.children)) {
+                        currentColumn._nRowspan = maxRowDepth;
+                    }
+                    else {
+                        currentColumn._nRowspan = 1;
                     }
-                    */
                 }
-                //TODO: fire paginatorDisabledEvent & add to api doc
+
+                // Reset counter for next row
+                maxRowDepth = 1;
             }
+        };
+        parseTreeForRowspan(tree);
+
+        // Store tree index values
+        for(i=0; i<tree[0].length; i++) {
+            tree[0][i]._nTreeIndex = i;
         }
-    });
+
+        // Store header relationships in an array for HEADERS attribute
+        var recurseAncestorsForHeaders = function(i, oColumn) {
+            headers[i].push(oColumn._sId);
+            if(oColumn.parent) {
+                recurseAncestorsForHeaders(i, oColumn.parent);
+            }
+        };
+        for(i=0; i<keys.length; i++) {
+            headers[i] = [];
+            recurseAncestorsForHeaders(i, keys[i]);
+            headers[i] = headers[i].reverse();
+        }
+
+        // Save to the ColumnSet instance
+        this.tree = tree;
+        this.flat = flat;
+        this.keys = keys;
+        this.headers = headers;
+    },
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
     /**
-    * @config caption
-    * @description Value for the CAPTION element.
-    * @type String
-    */
-    this.setAttributeConfig("caption", {
-        value: null,
-        validator: YAHOO.lang.isString,
-        method: function(sCaption) {
-            // Create CAPTION element
-            if(!this._elCaption) {
-                if(!this._elTable.firstChild) {
-                    this._elCaption = this._elTable.appendChild(document.createElement("caption"));
+     * Returns unique name of the ColumnSet instance.
+     *
+     * @method getId
+     * @return {String} Unique name of the ColumnSet instance.
+     */
+
+    getId : function() {
+        return this._sId;
+    },
+
+    /**
+     * ColumnSet instance name, for logging.
+     *
+     * @method toString
+     * @return {String} Unique name of the ColumnSet instance.
+     */
+
+    toString : function() {
+        return "ColumnSet instance " + this._sId;
+    },
+
+    /**
+     * Public accessor to the definitions array.
+     *
+     * @method getDefinitions
+     * @return {Object[]} Array of object literal Column definitions.
+     */
+
+    getDefinitions : function() {
+        var aDefinitions = this._aDefinitions;
+        
+        // Internal recursive function to define Column instances
+        var parseColumns = function(nodeList, oSelf) {
+            // Parse each node at this depth for attributes and any children
+            for(var j=0; j<nodeList.length; j++) {
+                var currentNode = nodeList[j];
+                
+                // Get the Column for each node
+                var oColumn = oSelf.getColumnById(currentNode.yuiColumnId);
+                
+                if(oColumn) {    
+                    // Update the definition
+                    currentNode.abbr = oColumn.abbr;
+                    currentNode.className = oColumn.className;
+                    currentNode.editor = oColumn.editor;
+                    currentNode.editorOptions = oColumn.editorOptions;
+                    currentNode.formatter = oColumn.formatter;
+                    currentNode.hidden = oColumn.hidden;
+                    currentNode.key = oColumn.key;
+                    currentNode.label = oColumn.label;
+                    currentNode.minWidth = oColumn.minWidth;
+                    currentNode.resizeable = oColumn.resizeable;
+                    currentNode.selected = oColumn.selected;
+                    currentNode.sortable = oColumn.sortable;
+                    currentNode.sortOptions = oColumn.sortOptions;
+                    currentNode.width = oColumn.width;
                 }
-                else {
-                    this._elCaption = this._elTable.insertBefore(document.createElement("caption"), this._elTable.firstChild);
+                            
+                // The Column has descendants
+                if(YAHOO.lang.isArray(currentNode.children)) {
+                    // The children themselves must also be parsed for Column instances
+                    parseColumns(currentNode.children, oSelf);
+                }
+            }
+        };
+
+        parseColumns(aDefinitions, this);
+        this._aDefinitions = aDefinitions;
+        return aDefinitions;
+    },
+
+    /**
+     * Returns Column instance with given ID.
+     *
+     * @method getColumnById
+     * @param column {String} Column ID.
+     * @return {YAHOO.widget.Column} Column instance.
+     */
+
+    getColumnById : function(column) {
+        if(YAHOO.lang.isString(column)) {
+            var allColumns = this.flat;
+            for(var i=allColumns.length-1; i>-1; i--) {
+                if(allColumns[i]._sId === column) {
+                    return allColumns[i];
                 }
             }
-            // Set CAPTION value
-            this._elCaption.innerHTML = sCaption;
         }
-    });
+        return null;
+    },
 
     /**
-    * @config scrollable
-    * @description True if primary TBODY should scroll while THEAD remains fixed.
-    * When enabling this feature, captions cannot be used, and the following
-    * features are not recommended: inline editing, resizeable columns.
-    * @default false
-    * @type Boolean
-    */
-    this.setAttributeConfig("scrollable", {
-        value: false,
-        validator: function(oParam) {
-            //TODO: validate agnst resizeable
-            return (YAHOO.lang.isBoolean(oParam) &&
-                    // Not compatible with caption
-                    !YAHOO.lang.isString(this.get("caption")));
-        },
-        method: function(oParam) {
-            if(oParam) {
-                //TODO: conf height
-                YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
-                YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+     * Returns Column instance with given key or ColumnSet key index.
+     *
+     * @method getColumn
+     * @param column {String | Number} Column key or ColumnSet key index.
+     * @return {YAHOO.widget.Column} Column instance.
+     */
+
+    getColumn : function(column) {
+        if(YAHOO.lang.isNumber(column) && this.keys[column]) {
+            return this.keys[column];
+        }
+        else if(YAHOO.lang.isString(column)) {
+            var allColumns = this.flat;
+            var aColumns = [];
+            for(var i=0; i<allColumns.length; i++) {
+                if(allColumns[i].key === column) {
+                    aColumns.push(allColumns[i]);
+                }
             }
-            else {
-                YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
-                YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+            if(aColumns.length === 1) {
+                return aColumns[0];
+            }
+            else if(aColumns.length > 1) {
+                return aColumns;
+            }
+        }
+        return null;
+    },
+
+    /**
+     * Public accessor returns array of given Column's desendants (if any), including itself.
+     *
+     * @method getDescendants
+     * @parem {YAHOO.widget.Column} Column instance.
+     * @return {Array} Array including the Column itself and all descendants (if any).
+     */
+    getDescendants : function(oColumn) {
+        var oSelf = this;
+        var allDescendants = [];
+        var i;
+
+        // Recursive function to loop thru all children
+        var parse = function(oParent) {
+            allDescendants.push(oParent);
+            // This Column has children
+            if(oParent.children) {
+                for(i=0; i<oParent.children.length; i++) {
+                    parse(oSelf.getColumn(oParent.children[i].key));
+                }
+            }
+        };
+        parse(oColumn);
+
+        return allDescendants;
+    }
+};
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The Column class defines and manages attributes of DataTable Columns
+ *
+ * @namespace YAHOO.widget
+ * @class Column
+ * @constructor
+ * @param oConfigs {Object} Object literal of definitions.
+ */
+YAHOO.widget.Column = function(oConfigs) {
+    // Object literal defines Column attributes
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
             }
         }
-    });
+   }
+    // Backward compatibility
+    if(this.width && !YAHOO.lang.isNumber(this.width)) {
+        this.width = null;
+    }
 };
 
 /////////////////////////////////////////////////////////////////////////////
 //
-// Public constants
+// Private member variables
 //
 /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Class name assigned to TABLE element.
- *
- * @property DataTable.CLASS_TABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-table"
- */
-YAHOO.widget.DataTable.CLASS_TABLE = "yui-dt-table";
-
-/**
- * Class name assigned to header container elements within each TH element.
- *
- * @property DataTable.CLASS_HEADER
- * @type String
- * @static
- * @final
- * @default "yui-dt-header"
- */
-YAHOO.widget.DataTable.CLASS_HEADER = "yui-dt-header";
+YAHOO.lang.augmentObject(YAHOO.widget.Column, {
+    /**
+     * Internal class variable to index multiple Column instances.
+     *
+     * @property Column._nCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCount : 0,
 
-/**
- * Class name assigned to the primary TBODY element.
- *
- * @property DataTable.CLASS_BODY
- * @type String
- * @static
- * @final
- * @default "yui-dt-body"
- */
-YAHOO.widget.DataTable.CLASS_BODY = "yui-dt-body";
+    formatCheckbox : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to the scrolling TBODY element of a fixed scrolling DataTable.
- *
- * @property DataTable.CLASS_SCROLLBODY
- * @type String
- * @static
- * @final
- * @default "yui-dt-scrollbody"
- */
-YAHOO.widget.DataTable.CLASS_SCROLLBODY = "yui-dt-scrollbody";
+    formatCurrency : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to display label elements.
- *
- * @property DataTable.CLASS_LABEL
- * @type String
- * @static
- * @final
- * @default "yui-dt-label"
- */
-YAHOO.widget.DataTable.CLASS_LABEL = "yui-dt-label";
+    formatDate : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to resizer handle elements.
- *
- * @property DataTable.CLASS_RESIZER
- * @type String
- * @static
- * @final
- * @default "yui-dt-resizer"
- */
-YAHOO.widget.DataTable.CLASS_RESIZER = "yui-dt-resizer";
+    formatEmail : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to Editor container elements.
- *
- * @property DataTable.CLASS_EDITOR
- * @type String
- * @static
- * @final
- * @default "yui-dt-editor"
- */
-YAHOO.widget.DataTable.CLASS_EDITOR = "yui-dt-editor";
+    formatLink : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to paginator container elements.
- *
- * @property DataTable.CLASS_PAGINATOR
- * @type String
- * @static
- * @final
- * @default "yui-dt-paginator"
- */
-YAHOO.widget.DataTable.CLASS_PAGINATOR = "yui-dt-paginator";
+    formatNumber : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
+    },
 
-/**
- * Class name assigned to page number indicators.
- *
- * @property DataTable.CLASS_PAGE
- * @type String
- * @static
- * @final
- * @default "yui-dt-page"
- */
-YAHOO.widget.DataTable.CLASS_PAGE = "yui-dt-page";
+    formatSelect : function(elCell, oRecord, oColumn, oData) {
+        YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
+    }
+});
 
-/**
- * Class name assigned to default indicators.
- *
- * @property DataTable.CLASS_DEFAULT
- * @type String
- * @static
- * @final
- * @default "yui-dt-default"
- */
-YAHOO.widget.DataTable.CLASS_DEFAULT = "yui-dt-default";
+YAHOO.widget.Column.prototype = {
+    /**
+     * Unique String identifier assigned at instantiation.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
-/**
- * Class name assigned to previous indicators.
- *
- * @property DataTable.CLASS_PREVIOUS
- * @type String
- * @static
- * @final
- * @default "yui-dt-previous"
- */
-YAHOO.widget.DataTable.CLASS_PREVIOUS = "yui-dt-previous";
+    /**
+     * Object literal definition
+     *
+     * @property _oDefinition
+     * @type Object
+     * @private
+     */
+    _oDefinition : null,
 
-/**
- * Class name assigned next indicators.
- *
- * @property DataTable.CLASS_NEXT
- * @type String
- * @static
- * @final
- * @default "yui-dt-next"
- */
-YAHOO.widget.DataTable.CLASS_NEXT = "yui-dt-next";
+    /**
+     * Reference to Column's current position index within its ColumnSet's keys
+     * array, if applicable. This property only applies to non-nested and bottom-
+     * level child Columns.
+     *
+     * @property _nKeyIndex
+     * @type Number
+     * @private
    */
+    _nKeyIndex : null,
 
-/**
- * Class name assigned to first elements.
- *
- * @property DataTable.CLASS_FIRST
- * @type String
- * @static
- * @final
- * @default "yui-dt-first"
- */
-YAHOO.widget.DataTable.CLASS_FIRST = "yui-dt-first";
+    /**
+     * Reference to Column's current position index within its ColumnSet's tree
+     * array, if applicable. This property only applies to non-nested and top-
+     * level parent Columns.
+     *
+     * @property _nTreeIndex
+     * @type Number
+     * @private
    */
+    _nTreeIndex : null,
 
-/**
- * Class name assigned to last elements.
- *
- * @property DataTable.CLASS_LAST
- * @type String
- * @static
- * @final
- * @default "yui-dt-last"
- */
-YAHOO.widget.DataTable.CLASS_LAST = "yui-dt-last";
+    /**
+     * Number of table cells the Column spans.
+     *
+     * @property _nColspan
+     * @type Number
+     * @private
+     */
+    _nColspan : 1,
 
-/**
- * Class name assigned to even elements.
- *
- * @property DataTable.CLASS_EVEN
- * @type String
- * @static
- * @final
- * @default "yui-dt-even"
- */
-YAHOO.widget.DataTable.CLASS_EVEN = "yui-dt-even";
+    /**
+     * Number of table rows the Column spans.
+     *
+     * @property _nRowspan
+     * @type Number
+     * @private
+     */
+    _nRowspan : 1,
 
-/**
- * Class name assigned to odd elements.
- *
- * @property DataTable.CLASS_ODD
- * @type String
- * @static
- * @final
- * @default "yui-dt-odd"
- */
-YAHOO.widget.DataTable.CLASS_ODD = "yui-dt-odd";
+    /**
+     * Column's parent Column instance, or null.
+     *
+     * @property _oParent
+     * @type YAHOO.widget.Column
+     * @private
+     */
+    _oParent : null,
 
-/**
- * Class name assigned to selected elements.
- *
- * @property DataTable.CLASS_SELECTED
- * @type String
- * @static
- * @final
- * @default "yui-dt-selected"
- */
-YAHOO.widget.DataTable.CLASS_SELECTED = "yui-dt-selected";
+    /*TODO: remove
+     * The DOM reference the associated COL element.
+     *
+     * @property _elCol
+     * @type HTMLElement
+     * @private
+     */
+    //YAHOO.widget.Column.prototype._elCol = null;
 
-/**
- * Class name assigned to highlighted elements.
- *
- * @property DataTable.CLASS_HIGHLIGHTED
- * @type String
- * @static
- * @final
- * @default "yui-dt-highlighted"
- */
-YAHOO.widget.DataTable.CLASS_HIGHLIGHTED = "yui-dt-highlighted";
+    /**
+     * The DOM reference to the associated TH element.
+     *
+     * @property _elTh
+     * @type HTMLElement
+     * @private
+     */
+    _elTh : null,
 
-/**
- * Class name assigned to disabled elements.
- *
- * @property DataTable.CLASS_DISABLED
- * @type String
- * @static
- * @final
- * @default "yui-dt-disabled"
- */
-YAHOO.widget.DataTable.CLASS_DISABLED = "yui-dt-disabled";
+    /**
+     * The DOM reference to the associated resizerelement (if any).
+     *
+     * @property _elResizer
+     * @type HTMLElement
+     * @private
+     */
+    _elResizer : null,
 
-/**
- * Class name assigned to empty indicators.
- *
- * @property DataTable.CLASS_EMPTY
- * @type String
- * @static
- * @final
- * @default "yui-dt-empty"
- */
-YAHOO.widget.DataTable.CLASS_EMPTY = "yui-dt-empty";
+    /**
+     * For unreg() purposes, a reference to the Column's DragDrop instance.
+     *
+     * @property _dd
+     * @type YAHOO.util.DragDrop
+     * @private
+     */
+    _dd : null,
 
-/**
- * Class name assigned to loading indicatorx.
- *
- * @property DataTable.CLASS_LOADING
- * @type String
- * @static
- * @final
- * @default "yui-dt-loading"
- */
-YAHOO.widget.DataTable.CLASS_LOADING = "yui-dt-loading";
+    /**
+     * For unreg() purposes, a reference to the Column resizer's DragDrop instance.
+     *
+     * @property _ddResizer
+     * @type YAHOO.util.DragDrop
+     * @private
+     */
+    _ddResizer : null,
 
-/**
- * Class name assigned to error indicators.
- *
- * @property DataTable.CLASS_ERROR
- * @type String
- * @static
- * @final
- * @default "yui-dt-error"
- */
-YAHOO.widget.DataTable.CLASS_ERROR = "yui-dt-error";
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Class name assigned to editable elements.
- *
- * @property DataTable.CLASS_EDITABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-editable"
- */
-YAHOO.widget.DataTable.CLASS_EDITABLE = "yui-dt-editable";
+    /**
+     * Associated database field, or null.
+     *
+     * @property key
+     * @type String
+     */
+    key : null,
 
-/**
- * Class name assigned to scrollable elements.
- *
- * @property DataTable.CLASS_SCROLLABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-scrollable"
- */
-YAHOO.widget.DataTable.CLASS_SCROLLABLE = "yui-dt-scrollable";
+    /**
+     * Text or HTML for display as Column's label in the TH element.
+     *
+     * @property label
+     * @type String
+     */
+    label : null,
 
-/**
- * Class name assigned to sortable elements.
- *
- * @property DataTable.CLASS_SORTABLE
- * @type String
- * @static
- * @final
- * @default "yui-dt-sortable"
- */
-YAHOO.widget.DataTable.CLASS_SORTABLE = "yui-dt-sortable";
+    /**
+     * Column head cell ABBR for accessibility.
+     *
+     * @property abbr
+     * @type String
+     */
+    abbr : null,
 
-/**
- * Class name assigned to ascending elements.
- *
- * @property DataTable.CLASS_ASC
- * @type String
- * @static
- * @final
- * @default "yui-dt-asc"
- */
-YAHOO.widget.DataTable.CLASS_ASC = "yui-dt-asc";
+    /**
+     * Array of object literals that define children (nested headers) of a Column.
+     *
+     * @property children
+     * @type Object[]
+     */
+    children : null,
 
-/**
- * Class name assigned to descending elements.
- *
- * @property DataTable.CLASS_DESC
- * @type String
- * @static
- * @final
- * @default "yui-dt-desc"
- */
-YAHOO.widget.DataTable.CLASS_DESC = "yui-dt-desc";
+    /**
+     * Column width (in pixels).
+     *
+     * @property width
+     * @type Number
+     */
+    width : null,
 
-/**
- * Class name assigned to BUTTON container elements.
- *
- * @property DataTable.CLASS_BUTTON
- * @type String
- * @static
- * @final
- * @default "yui-dt-button"
- */
-YAHOO.widget.DataTable.CLASS_BUTTON = "yui-dt-button";
+    /**
+     * Minimum Column width (in pixels).
+     *
+     * @property minWidth
+     * @type Number
+     * @default 10
+     */
+    minWidth : 10,
 
-/**
- * Class name assigned to SELECT container elements.
- *
- * @property DataTable.CLASS_DROPDOWN
- * @type String
- * @static
- * @final
- * @default "yui-dt-dropdown"
- */
-YAHOO.widget.DataTable.CLASS_DROPDOWN = "yui-dt-dropdown";
+    /**
+     * True if Column is in hidden state.
+     *
+     * @property hidden
+     * @type Boolean
+     * @default false     
+     */
+    hidden : false,
 
-/**
- * Class name assigned to INPUT TYPE=CHECKBOX container elements.
- *
- * @property DataTable.CLASS_CHECKBOX
- * @type String
- * @static
- * @final
- * @default "yui-dt-checkbox"
- */
-YAHOO.widget.DataTable.CLASS_CHECKBOX = "yui-dt-checkbox";
+    /**
+     * True if Column is in selected state.
+     *
+     * @property selected
+     * @type Boolean
+     * @default false     
+     */
+    selected : false,
 
-/**
- * Message to display if DataTable has no data.
- *
- * @property DataTable.MSG_EMPTY
- * @type String
- * @static
- * @final
- * @default "No records found."
- */
-YAHOO.widget.DataTable.MSG_EMPTY = "No records found.";
-
-/**
- * Message to display while DataTable is loading data.
- *
- * @property DataTable.MSG_LOADING
- * @type String
- * @static
- * @final
- * @default "Loading data..."
- */
-YAHOO.widget.DataTable.MSG_LOADING = "Loading data...";
-
-/**
- * Message to display while DataTable has data error.
- *
- * @property DataTable.MSG_ERROR
- * @type String
- * @static
- * @final
- * @default "Data error."
- */
-YAHOO.widget.DataTable.MSG_ERROR = "Data error.";
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
-
-/**
- * Internal class variable for indexing multiple DataTable instances.
- *
- * @property DataTable._nCount
- * @type Number
- * @private
- * @static
- */
-YAHOO.widget.DataTable._nCount = 0;
-
-/**
- * Index assigned to instance.
- *
- * @property _nIndex
- * @type Number
- * @private
- */
-YAHOO.widget.DataTable.prototype._nIndex = null;
-
-/**
- * Counter for IDs assigned to TR elements.
- *
- * @property _nTrCount
- * @type Number
- * @private
- */
-YAHOO.widget.DataTable.prototype._nTrCount = 0;
-
-/**
- * Unique name assigned to instance.
- *
- * @property _sName
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sName = null;
-
-/**
- * DOM reference to the container element for the DataTable instance into which
- * the TABLE element gets created.
- *
- * @property _elContainer
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elContainer = null;
-
-/**
- * DOM reference to the CAPTION element for the DataTable instance.
- *
- * @property _elCaption
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elCaption = null;
-
-/**
- * DOM reference to the TABLE element for the DataTable instance.
- *
- * @property _elTable
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elTable = null;
-
-/**
- * DOM reference to the THEAD element for the DataTable instance.
- *
- * @property _elThead
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elThead = null;
-
-/**
- * DOM reference to the primary TBODY element for the DataTable instance.
- *
- * @property _elTbody
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elTbody = null;
-
-/**
- * DOM reference to the secondary TBODY element used to display DataTable messages.
- *
- * @property _elMsgTbody
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbody = null;
-
-/**
- * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
- *
- * @property _elMsgTbodyRow
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbodyRow = null;
-
-/**
- * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
- *
- * @property _elMsgTbodyCell
- * @type HTMLElement
- * @private
- */
-YAHOO.widget.DataTable.prototype._elMsgTbodyCell = null;
-
-/**
- * DataSource instance for the DataTable instance.
- *
- * @property _oDataSource
- * @type YAHOO.util.DataSource
- * @private
- */
-YAHOO.widget.DataTable.prototype._oDataSource = null;
-
-/**
- * ColumnSet instance for the DataTable instance.
- *
- * @property _oColumnSet
- * @type YAHOO.widget.ColumnSet
- * @private
- */
-YAHOO.widget.DataTable.prototype._oColumnSet = null;
-
-/**
- * RecordSet instance for the DataTable instance.
- *
- * @property _oRecordSet
- * @type YAHOO.widget.RecordSet
- * @private
- */
-YAHOO.widget.DataTable.prototype._oRecordSet = null;
-
-/**
- * ID string of first label link element of the current DataTable page, if any.
- * Used for focusing sortable Columns with TAB.
- *
- * @property _sFirstLabelLinkId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sFirstLabelLinkId = null;
-
-/**
- * ID string of first TR element of the current DataTable page.
- *
- * @property _sFirstTrId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sFirstTrId = null;
-
-/**
- * ID string of the last TR element of the current DataTable page.
- *
- * @property _sLastTrId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sLastTrId = null;
+    /**
+     * Custom CSS class or array of classes to be applied to every cell in the Column.
+     *
+     * @property className
+     * @type String || String[]
+     */
+    className : null,
 
+    /**
+     * Defines a format function.
+     *
+     * @property formatter
+     * @type String || HTMLFunction
+     */
+    formatter : null,
 
+    /**
+     * Defines an editor function, otherwise Column is not editable.
+     *
+     * @property editor
+     * @type String || HTMLFunction
+     */
+    editor : null,
 
+    /**
+     * Defines editor options for Column in an object literal of param:value pairs.
+     *
+     * @property editorOptions
+     * @type Object
+     */
+    editorOptions : null,
 
+    /**
+     * True if Column is resizeable, false otherwise. The Drag & Drop Utility is
+     * required to enable this feature. Only bottom-level and non-nested Columns are
+     * resizeble. 
+     *
+     * @property resizeable
+     * @type Boolean
+     * @default false
+     */
+    resizeable : false,
 
+    /**
+     * True if Column is sortable, false otherwise.
+     *
+     * @property sortable
+     * @type Boolean
+     * @default false
+     */
+    sortable : false,
 
+    /**
+     * @property sortOptions.defaultOrder
+     * @deprecated Use sortOptions.defaultDir.
+     */
+    /**
+     * Default sort direction for Column: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.
+     *
+     * @property sortOptions.defaultDir
+     * @type String
+     * @default null
+     */
+    /**
+     * Custom sort handler.
+     *
+     * @property sortOptions.sortFunction
+     * @type Function
+     * @default null
+     */
+    sortOptions : null,
 
 
 
@@ -1014,2627 +995,5498 @@ YAHOO.widget.DataTable.prototype._sLastTrId = null;
 
 
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Returns unique ID string.
+     *
+     * @method getId
+     * @return {String} Unique ID string.
+     */
+    getId : function() {
+        return this._sId;
+    },
 
+    /**
+     * Column instance name, for logging.
+     *
+     * @method toString
+     * @return {String} Column's unique name.
+     */
+    toString : function() {
+        return "Column instance " + this._sId;
+    },
 
+    /**
+     * Returns object literal definition.
+     *
+     * @method getDefinition
+     * @return {Object} Object literal definition.
+     */
+    getDefinition : function() {
+        var oDefinition = this._oDefinition;
+        
+        // Update the definition
+        oDefinition.abbr = this.abbr;
+        oDefinition.className = this.className;
+        oDefinition.editor = this.editor;
+        oDefinition.editorOptions = this.editorOptions;
+        oDefinition.formatter = this.formatter;
+        oDefinition.key = this.key;
+        oDefinition.label = this.label;
+        oDefinition.minWidth = this.minWidth;
+        oDefinition.resizeable = this.resizeable;
+        oDefinition.sortable = this.sortable;
+        oDefinition.sortOptions = this.sortOptions;
+        oDefinition.width = this.width;
+
+        return oDefinition;
+    },
 
+    /**
+     * Returns unique Column key.
+     *
+     * @method getKey
+     * @return {String} Column key.
+     */
+    getKey : function() {
+        return this.key;
+    },
 
+    /**
+     * Public accessor returns Column's current position index within its
+     * ColumnSet's keys array, if applicable. Only non-nested and bottom-level
+     * child Columns will return a value.
+     *
+     * @method getKeyIndex
+     * @return {Number} Position index, or null.
+     */
+    getKeyIndex : function() {
+        return this._nKeyIndex;
+    },
 
+    /**
+     * Public accessor returns Column's current position index within its
+     * ColumnSet's tree array, if applicable. Only non-nested and top-level parent
+     * Columns will return a value;
+     *
+     * @method getTreeIndex
+     * @return {Number} Position index, or null.
+     */
+    getTreeIndex : function() {
+        return this._nTreeIndex;
+    },
 
+    /**
+     * Public accessor returns Column's parent instance if any, or null otherwise.
+     *
+     * @method getParent
+     * @return {YAHOO.widget.Column} Column's parent instance.
+     */
+    getParent : function() {
+        return this._oParent;
+    },
 
+    /**
+     * Public accessor returns Column's calculated COLSPAN value.
+     *
+     * @method getColspan
+     * @return {Number} Column's COLSPAN value.
+     */
+    getColspan : function() {
+        return this._nColspan;
+    },
+    // Backward compatibility
+    getColSpan : function() {
+        return this.getColspan();
+    },
 
+    /**
+     * Public accessor returns Column's calculated ROWSPAN value.
+     *
+     * @method getRowspan
+     * @return {Number} Column's ROWSPAN value.
+     */
+    getRowspan : function() {
+        return this._nRowspan;
+    },
 
+    /**
+     * Returns DOM reference to the key TH element.
+     *
+     * @method getThEl
+     * @return {HTMLElement} TH element.
+     */
+    getThEl : function() {
+        return this._elTh;
+    },
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private methods
-//
-/////////////////////////////////////////////////////////////////////////////
+    /**
+     * Returns DOM reference to the resizer element, or null.
+     *
+     * @method getResizerEl
+     * @return {HTMLElement} DIV element.
+     */
+    getResizerEl : function() {
+        return this._elResizer;
+    },
 
-/**
- * Sets focus on the given element.
- *
* @method _focusEl
- * @param el {HTMLElement} Element.
- * @private
- */
-YAHOO.widget.DataTable.prototype._focusEl = function(el) {
-    el = el || this._elTable;
-    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
-    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
-    // strange unexpected things as the user clicks on buttons and other controls.
-    setTimeout(function() { el.focus(); },0);
+    // Backward compatibility
+    /**
+     * @method getColEl
    * @deprecated Use getThEl
+     */
+    getColEl : function() {
+        return this.getThEl();
+    },
+    getIndex : function() {
+        return this.getKeyIndex();
+    },
+    format : function() {
+    }
 };
 
-
-
-
-
-// INIT FUNCTIONS
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Initializes container element.
+ * Sort static utility to support Column sorting.
  *
- * @method _initContainerEl
- * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
- * @private
+ * @namespace YAHOO.util
+ * @class Sort
+ * @static
  */
-YAHOO.widget.DataTable.prototype._initContainerEl = function(elContainer) {
-    this._elContainer = null;
-    elContainer = YAHOO.util.Dom.get(elContainer);
-    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
-        this._elContainer = elContainer;
-    }
-};
+YAHOO.util.Sort = {
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-/**
- * Initializes object literal of config values.
- *
- * @method _initConfigs
- * @param oConfig {Object} Object literal of config values.
- * @private
- */
-YAHOO.widget.DataTable.prototype._initConfigs = function(oConfigs) {
-    if(oConfigs) {
-        if(oConfigs.constructor != Object) {
-            oConfigs = null;
+    /**
+     * Comparator function for simple case-insensitive string sorting.
+     *
+     * @method compare
+     * @param a {Object} First sort argument.
+     * @param b {Object} Second sort argument.
+     * @param desc {Boolean} True if sort direction is descending, false if
+     * sort direction is ascending.
+     */
+    compare: function(a, b, desc) {
+        if((a === null) || (typeof a == "undefined")) {
+            if((b === null) || (typeof b == "undefined")) {
+                return 0;
+            }
+            else {
+                return 1;
+            }
         }
-        // Backward compatibility
-        else if(YAHOO.lang.isBoolean(oConfigs.paginator)) {
+        else if((b === null) || (typeof b == "undefined")) {
+            return -1;
+        }
+
+        if(a.constructor == String) {
+            a = a.toLowerCase();
+        }
+        if(b.constructor == String) {
+            b = b.toLowerCase();
+        }
+        if(a < b) {
+            return (desc) ? 1 : -1;
+        }
+        else if (a > b) {
+            return (desc) ? -1 : 1;
+        }
+        else {
+            return 0;
         }
-        this._oConfigs = oConfigs;
     }
 };
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
 /**
- * Initializes ColumnSet.
+ * ColumnDD subclasses DragDrop to support rearrangeable Columns.
  *
- * @method _initColumnSet
- * @param aColumnDefs {Object[]} Array of object literal Column definitions.
- * @private
+ * @namespace YAHOO.util
+ * @class ColumnDD
+ * @extends YAHOO.util.DDProxy
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elTh {HTMLElement} TH element reference.
+ * @param elTarget {HTMLElement} Drag target element.
  */
-YAHOO.widget.DataTable.prototype._initColumnSet = function(aColumnDefs) {
-    this._oColumnSet = null;
-    if(YAHOO.lang.isArray(aColumnDefs)) {
-        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
+YAHOO.widget.ColumnDD = function(oDataTable, oColumn, elTh, elTarget) {
+    if(oDataTable && oColumn && elTh && elTarget) {
+        this.datatable = oDataTable;
+        this.table = oDataTable.getTheadEl().parentNode;
+        this.column = oColumn;
+        this.headCell = elTh;
+        this.pointer = elTarget;
+        this.newIndex = null;
+        this.init(elTh);
+        this.initFrame(); // Needed for DDProxy
+        this.invalidHandleTypes = {};
+
+        //Set padding to account for children of nested columns
+        this.setPadding(10, 0, (this.datatable.getTheadEl().offsetHeight + 10) , 0);
     }
-    // Backward compatibility
-    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
-        this._oColumnSet =  aColumnDefs;
+    else {
     }
 };
 
-/**
- * Initializes DataSource.
- *
- * @method _initDataSource
- * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._initDataSource = function(oDataSource) {
-    this._oDataSource = null;
-    if(oDataSource && (oDataSource instanceof YAHOO.util.DataSource)) {
-        this._oDataSource = oDataSource;
-    }
-    // Backward compatibility
-    else {
-        var tmpTable = null;
-        var tmpContainer = this._elContainer;
-        // Peek in container child nodes to see if TABLE already exists
-        if(tmpContainer.hasChildNodes()) {
-            var tmpChildren = tmpContainer.childNodes;
-            for(i=0; i<tmpChildren.length; i++) {
-                if(tmpChildren[i].tagName && tmpChildren[i].tagName.toLowerCase() == "table") {
-                    tmpTable = tmpChildren[i];
-                    break;
-                }
+if(YAHOO.util.DDProxy) {
+    YAHOO.extend(YAHOO.widget.ColumnDD, YAHOO.util.DDProxy, {
+        initConstraints: function() {
+            //Get the top, right, bottom and left positions
+            var region = YAHOO.util.Dom.getRegion(this.table),
+                //Get the element we are working on
+                el = this.getEl(),
+                //Get the xy position of it
+                xy = YAHOO.util.Dom.getXY(el),
+                //Get the width and height
+                width = parseInt(YAHOO.util.Dom.getStyle(el, 'width'), 10),
+                height = parseInt(YAHOO.util.Dom.getStyle(el, 'height'), 10),
+                //Set left to x minus left
+                left = ((xy[0] - region.left) + 15), //Buffer of 15px
+                //Set right to right minus x minus width
+                right = ((region.right - xy[0] - width) + 15);
+    
+            //Set the constraints based on the above calculations
+            this.setXConstraint(left, right);
+            this.setYConstraint(10, 10);
+            
+            YAHOO.util.Event.on(window, 'resize', function() {
+                this.initConstraints();
+            }, this, true);
+        },
+        _resizeProxy: function() {
+            this.constructor.superclass._resizeProxy.apply(this, arguments);
+            var dragEl = this.getDragEl(),
+                el = this.getEl();
+
+            YAHOO.util.Dom.setStyle(this.pointer, 'height', (this.table.parentNode.offsetHeight + 10) + 'px');
+            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'block');
+            var xy = YAHOO.util.Dom.getXY(el);
+            YAHOO.util.Dom.setXY(this.pointer, [xy[0], (xy[1] - 5)]);
+            
+            YAHOO.util.Dom.setStyle(dragEl, 'height', this.datatable.getContainerEl().offsetHeight + "px");
+            YAHOO.util.Dom.setStyle(dragEl, 'width', (parseInt(YAHOO.util.Dom.getStyle(dragEl, 'width'),10) + 4) + 'px');
+            YAHOO.util.Dom.setXY(this.dragEl, xy);
+        },
+        onMouseDown: function() {
+                this.initConstraints();
+                this.resetConstraints();
+        },
+        clickValidator: function(e) {
+            if(!this.column.hidden) {
+                var target = YAHOO.util.Event.getTarget(e);
+                return ( this.isValidHandleChild(target) &&
+                            (this.id == this.handleElId ||
+                                this.DDM.handleWasClicked(target, this.id)) );
             }
-            if(tmpTable) {
-                var tmpFieldsArray = [];
-                for(i=0; i<this._oColumnSet.keys.length; i++) {
-                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+        },
+        onDragOver: function(ev, id) {
+            // Validate target
+            var target = this.datatable.getColumn(id);
+            if(target) {
+                var mouseX = YAHOO.util.Event.getPageX(ev),
+                targetX = YAHOO.util.Dom.getX(id),
+                midX = targetX + ((YAHOO.util.Dom.get(id).offsetWidth)/2),
+                currentIndex =  this.column.getTreeIndex(),
+                targetIndex = target.getTreeIndex(),
+                newIndex = targetIndex;
+                
+                
+                if (mouseX < midX) {
+                   YAHOO.util.Dom.setX(this.pointer, targetX);
+                } else {
+                    var thisWidth = parseInt(target.getThEl().offsetWidth, 10);
+                    YAHOO.util.Dom.setX(this.pointer, (targetX + thisWidth));
+                    newIndex++;
                 }
-
-                this._oDataSource = new YAHOO.util.DataSource(tmpTable);
-                this._oDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
-                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
+                if (targetIndex > currentIndex) {
+                    newIndex--;
+                }
+                if(newIndex < 0) {
+                    newIndex = 0;
+                }
+                else if(newIndex > this.datatable.getColumnSet().tree[0].length) {
+                    newIndex = this.datatable.getColumnSet().tree[0].length;
+                }
+                this.newIndex = newIndex;
+            }
+        },
+        onDragDrop: function() {
+            if(YAHOO.lang.isNumber(this.newIndex) && (this.newIndex !== this.column.getTreeIndex())) {
+                var oDataTable = this.datatable;
+                oDataTable._oChain.stop();
+                var aColumnDefs = oDataTable._oColumnSet.getDefinitions();
+                var oColumn = aColumnDefs.splice(this.column.getTreeIndex(),1)[0];
+                aColumnDefs.splice(this.newIndex, 0, oColumn);
+                oDataTable._initColumnSet(aColumnDefs);
+                oDataTable._initTheadEls();
+                oDataTable.render();
             }
+        },
+        endDrag: function() {
+            this.newIndex = null;
+            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'none');
         }
-    }
-};
+    });
+}
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Initializes RecordSet.
+ * ColumnResizer subclasses DragDrop to support resizeable Columns.
  *
- * @method _initRecordSet
- * @private
+ * @namespace YAHOO.util
+ * @class ColumnResizer
+ * @extends YAHOO.util.DDProxy
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elTh {HTMLElement} TH element reference.
+ * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
+ * @param elProxy {HTMLElement} Resizer proxy element.
  */
-YAHOO.widget.DataTable.prototype._initRecordSet = function() {
-    if(this._oRecordSet) {
-        this._oRecordSet.reset();
+YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elTh, sHandleId, elProxy) {
+    if(oDataTable && oColumn && elTh && sHandleId) {
+        this.datatable = oDataTable;
+        this.column = oColumn;
+        this.headCell = elTh;
+        this.headCellLiner = elTh.firstChild;
+        this.init(sHandleId, sHandleId, {dragOnly:true, dragElId: elProxy.id});
+        this.initFrame(); // Needed for proxy
     }
     else {
-        this._oRecordSet = new YAHOO.widget.RecordSet();
     }
 };
 
-/**
- * Creates HTML markup for TABLE, THEAD and TBODY elements.
- *
- * @method _initTableEl
- * @private
- */
-YAHOO.widget.DataTable.prototype._initTableEl = function() {
-    // Clear the container
-    YAHOO.util.Event.purgeElement(this._elContainer, true);
-    this._elContainer.innerHTML = "";
-
-    // Create TABLE
-    this._elTable = this._elContainer.appendChild(document.createElement("table"));
-    var elTable = this._elTable;
-    elTable.tabIndex = 0;
-    elTable.id = this.id + "-table";
-    YAHOO.util.Dom.addClass(elTable, YAHOO.widget.DataTable.CLASS_TABLE);
-
-    // Create THEAD
-    this._initTheadEl(elTable, this._oColumnSet);
-
-
-    // Create TBODY for messages
-    var elMsgTbody = document.createElement("tbody");
-    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
-    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);
-    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);
-    this._elMsgRow = elMsgRow;
-    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
-    elMsgCell.colSpan = this._oColumnSet.keys.length;
-    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);
-    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);
-    this._elMsgTd = elMsgCell;
-    this._elMsgTbody = elTable.appendChild(elMsgTbody);
-    this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING, YAHOO.widget.DataTable.CLASS_LOADING);
-
-    // Create TBODY for data
-    this._elTbody = elTable.appendChild(document.createElement("tbody"));
-    YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);
-};
-
-/**
- * Populates THEAD element with TH cells as defined by ColumnSet.
- *
- * @method _initTheadEl
- * @private
- */
-YAHOO.widget.DataTable.prototype._initTheadEl = function() {
-    var i,oColumn, colId;
-    var oColumnSet = this._oColumnSet;
-    this._sFirstLabelLinkId = null;
+if(YAHOO.util.DD) {
+    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DDProxy, {
+        /////////////////////////////////////////////////////////////////////////////
+        //
+        // Public methods
+        //
+        /////////////////////////////////////////////////////////////////////////////
+        /**
+         * Resets resizer element.
+         *
+         * @method resetResizerEl
+         */
+        resetResizerEl : function() {
+            var resizerStyle = YAHOO.util.Dom.get(this.handleElId).style;
+            resizerStyle.left = "auto";
+            resizerStyle.right = 0;
+            resizerStyle.top = "auto";
+            resizerStyle.bottom = 0;
+        },
     
-    // Create THEAD
-    var elThead = document.createElement("thead");
-
-    // Iterate through each row of Column headers...
-    var colTree = oColumnSet.tree;
-    for(i=0; i<colTree.length; i++) {
-        var elTheadRow = elThead.appendChild(document.createElement("tr"));
-        elTheadRow.id = this.id+"-hdrow"+i;
-
-        var elTheadCell;
-        // ...and create THEAD cells
-        for(var j=0; j<colTree[i].length; j++) {
-            oColumn = colTree[i][j];
-            colId = oColumn.getId();
-            elTheadCell = elTheadRow.appendChild(document.createElement("th"));
-            elTheadCell.id = this.id + "-col" + colId;
-            this._initThEl(elTheadCell,oColumn,i,j);
-        }
-
-        // Set FIRST/LAST on THEAD rows
-        if(i === 0) {
-            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_FIRST);
-        }
-        if(i === (colTree.length-1)) {
-            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_LAST);
-        }
-    }
-
-    this._elThead = this._elTable.appendChild(elThead);
-
-    // Set FIRST/LAST on THEAD cells using the values in ColumnSet headers array
-    var aFirstHeaders = oColumnSet.headers[0].split(" ");
-    var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1].split(" ");
-    for(i=0; i<aFirstHeaders.length; i++) {
-        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]), YAHOO.widget.DataTable.CLASS_FIRST);
-    }
-    for(i=0; i<aLastHeaders.length; i++) {
-        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]), YAHOO.widget.DataTable.CLASS_LAST);
-    }
+        /////////////////////////////////////////////////////////////////////////////
+        //
+        // Public DOM event handlers
+        //
+        /////////////////////////////////////////////////////////////////////////////
     
-    // Add Resizer only after DOM has been updated
-    var foundDD = (YAHOO.util.DD) ? true : false;
-    var needDD = false;
-    for(i=0; i<this._oColumnSet.keys.length; i++) {
-        oColumn = this._oColumnSet.keys[i];
-        colId = oColumn.getId();
-        var elTheadCellId = YAHOO.util.Dom.get(this.id + "-col" + colId);
-        if(oColumn.resizeable) {
-            if(foundDD) {
-                //TODO: fix fixed width tables
-                // Skip the last column for fixed-width tables
-                if(!this.fixedWidth || (this.fixedWidth &&
-                        (oColumn.getKeyIndex() != this._oColumnSet.keys.length-1))) {
-                    // TODO: better way to get elTheadContainer
-                    var elThContainer = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];
-                    var elThResizer = elThContainer.appendChild(document.createElement("span"));
-                    elThResizer.id = this.id + "-resizer" + colId;
-                    YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);
-                    oColumn.ddResizer = new YAHOO.util.ColumnResizer(
-                            this, oColumn, elTheadCellId, elThResizer.id, elThResizer.id);
-                    var cancelClick = function(e) {
-                        YAHOO.util.Event.stopPropagation(e);
-                    };
-                    YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);
-                }
-                if(this.fixedWidth) {
-                    //TODO: fix fixedWidth
-                    //elThContainer.style.overflow = "hidden";
-                    //TODO: better way to get elTheadText
-                    var elThLabel = (YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];
-                    elThLabel.style.overflow = "hidden";
-                }
+        /**
+         * Handles mouseup events on the Column resizer.
+         *
+         * @method onMouseUp
+         * @param e {string} The mouseup event
+         */
+        onMouseUp : function(e) {
+            this.resetResizerEl();
+            this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.headCell});
+        },
+    
+        /**
+         * Handles mousedown events on the Column resizer.
+         *
+         * @method onMouseDown
+         * @param e {string} The mousedown event
+         */
+        onMouseDown : function(e) {
+            this.startWidth = this.headCell.firstChild.offsetWidth;
+            this.startX = YAHOO.util.Event.getXY(e)[0];
+            this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0) +
+                    (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0);
+        },
+    
+        /**
+         * Custom clickValidator to ensure Column is not in hidden state.
+         *
+         * @method clickValidator
+         * @param {Event} e
+         * @private
+         */
+        clickValidator : function(e) {
+            if(!this.column.hidden) {
+                var target = YAHOO.util.Event.getTarget(e);
+                return ( this.isValidHandleChild(target) &&
+                            (this.id == this.handleElId ||
+                                this.DDM.handleWasClicked(target, this.id)) );
             }
-            else {
-                needDD = true;
+        },
+    
+        /**
+         * Handles drag events on the Column resizer.
+         *
+         * @method onDrag
+         * @param e {string} The drag event
+         */
+        onDrag : function(e) {
+            var newX = YAHOO.util.Event.getXY(e)[0];
+            if(newX > YAHOO.util.Dom.getX(this.headCellLiner)) {
+                var offsetX = newX - this.startX;
+                var newWidth = this.startWidth + offsetX - this.nLinerPadding;
+                this.datatable.setColumnWidth(this.column, newWidth);
             }
         }
-    }
-    if(needDD) {
-    }
+    });
+}
 
-};
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
 /**
- * Populates TH cell as defined by Column.
+ * A RecordSet defines and manages a set of Records.
  *
- * @method _initThEl
- * @param elTheadCell {HTMLElement} TH cell element reference.
- * @param oColumn {YAHOO.widget.Column} Column object.
- * @param row {number} Row index.
- * @param col {number} Column index.
- * @private
+ * @namespace YAHOO.widget
+ * @class RecordSet
+ * @param data {Object || Object[]} An object literal or an array of data.
+ * @constructor
  */
-YAHOO.widget.DataTable.prototype._initThEl = function(elTheadCell,oColumn,row,col) {
-    // Clear out the cell of prior content
-    // TODO: purgeListeners and other validation-related things
-    var index = this._nIndex;
-    var colId = oColumn.getId();
-    elTheadCell.yuiColumnId = colId;
-    if(oColumn.abbr) {
-        elTheadCell.abbr = oColumn.abbr;
-    }
-    if(oColumn.width) {
-        elTheadCell.style.width = oColumn.width;
-    }
+YAHOO.widget.RecordSet = function(data) {
+    // Internal variables
+    this._sId = "yui-rs" + YAHOO.widget.RecordSet._nCount;
+    YAHOO.widget.RecordSet._nCount++;
+    this._records = [];
+    //this._length = 0;
 
-    var aCustomClasses;
-    if(YAHOO.lang.isString(oColumn.className)) {
-        aCustomClasses = [oColumn.className];
-    }
-    else if(YAHOO.lang.isArray(oColumn.className)) {
-        aCustomClasses = oColumn.className;
-    }
-    if(aCustomClasses) {
-        for(var i=0; i<aCustomClasses.length; i++) {
-            YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);
+    if(data) {
+        if(YAHOO.lang.isArray(data)) {
+            this.addRecords(data);
         }
-    }
-    
-    YAHOO.util.Dom.addClass(elTheadCell, "yui-dt-col-"+oColumn.key);
-    
-    elTheadCell.innerHTML = "";
-    elTheadCell.rowSpan = oColumn.getRowspan();
-    elTheadCell.colSpan = oColumn.getColspan();
-
-    var elTheadContainer = elTheadCell.appendChild(document.createElement("div"));
-    elTheadContainer.id = this.id + "-container" + colId;
-    YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);
-    var elTheadLabel = elTheadContainer.appendChild(document.createElement("span"));
-    elTheadLabel.id = this.id + "-label" + colId;
-    YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);
-
-    var sLabel = YAHOO.lang.isValue(oColumn.label) ? oColumn.label : oColumn.key;
-    if(oColumn.sortable) {
-        YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);
-        //TODO: Make sortLink customizeable
-        //TODO: Make title configurable
-        //TODO: Separate label from an accessibility link that says
-        // "Click to sort ascending" and push it offscreen
-        var sLabelLinkId = this.id + "-labellink" + colId;
-        var sortLink = "?key=" + oColumn.key;
-        elTheadLabel.innerHTML = "<a id=\"" + sLabelLinkId + "\" href=\"" + sortLink + "\" title=\"Click to sort\" class=\"" + YAHOO.widget.DataTable.CLASS_SORTABLE + "\">" + sLabel + "</a>";
-        if(!this._sFirstLabelLinkId) {
-            this._sFirstLabelLinkId = sLabelLinkId;
+        else if(data.constructor == Object) {
+            this.addRecord(data);
         }
     }
-    else {
-        elTheadLabel.innerHTML = sLabel;
-    }
-};
 
-/**
- * Creates HTML markup for Cell Editor.
- *
- * @method _initCellEditorEl
- * @private
- */
-YAHOO.widget.DataTable.prototype._initCellEditorEl = function() {
-    // Attach Cell Editor container element to body
-    var elCellEditor = document.createElement("div");
-    elCellEditor.id = this.id + "-celleditor";
-    elCellEditor.style.display = "none";
-    YAHOO.util.Dom.addClass(elCellEditor, YAHOO.widget.DataTable.CLASS_EDITOR);
-    elCellEditor = document.body.appendChild(elCellEditor);
+    /**
+     * Fired when a new Record is added to the RecordSet.
+     *
+     * @event recordAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordAddEvent");
 
-    // Internal tracker of Cell Editor values
-    var oCellEditor = {};
-    oCellEditor.container = elCellEditor;
-    oCellEditor.value = null;
-    oCellEditor.isActive = false;
-    this._oCellEditor = oCellEditor;
+    /**
+     * Fired when multiple Records are added to the RecordSet at once.
+     *
+     * @event recordsAddEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsAddEvent");
 
-    // Handle ESC key
-    this.subscribe("editorKeydownEvent", function(oArgs) {
-        var e = oArgs.event;
-        var elTarget = YAHOO.util.Event.getTarget(e);
+    /**
+     * Fired when a Record is set in the RecordSet.
+     *
+     * @event recordSetEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordSetEvent");
 
-        // ESC hides Cell Editor
-        if((e.keyCode == 27)) {
-            this.cancelCellEditor();
-        }
-    });
-};
+    /**
+     * Fired when multiple Records are set in the RecordSet at once.
+     *
+     * @event recordsSetEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsSetEvent");
+
+    /**
+     * Fired when a Record is updated with new data.
+     *
+     * @event recordUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     */
+    this.createEvent("recordUpdateEvent");
+    
+    /**
+     * Fired when a Record is deleted from the RecordSet.
+     *
+     * @event recordDeleteEvent
+     * @param oArgs.data {Object} A copy of the data held by the Record,
+     * or an array of data object literals if multiple Records were deleted at once.
+     * @param oArgs.index {Object} Index of the deleted Record.
+     */
+    this.createEvent("recordDeleteEvent");
+
+    /**
+     * Fired when multiple Records are deleted from the RecordSet at once.
+     *
+     * @event recordsDeleteEvent
+     * @param oArgs.data {Object[]} An array of data object literals copied
+     * from the Records.
+     * @param oArgs.index {Object} Index of the first deleted Record.
+     */
+    this.createEvent("recordsDeleteEvent");
+    
+    /**
+     * Fired when all Records are deleted from the RecordSet at once.
+     *
+     * @event resetEvent
+     */
+    this.createEvent("resetEvent");
+
+    /**
+     * @event keyUpdateEvent    
+     * @deprecated Use recordValueUpdateEvent     
+     */
+    this.createEvent("keyUpdateEvent");
+    /**
+     * Fired when a Record value is updated with new data.
+     *
+     * @event recordValueUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.key {String} The updated key.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     *
+     */
+    this.createEvent("recordValueUpdateEvent");
 
-/**
- * Initializes Column sorting.
- *
- * @method _initColumnSort
- * @private
- */
-YAHOO.widget.DataTable.prototype._initColumnSort = function() {
-    this.subscribe("headerCellClickEvent", this.onEventSortColumn);
 };
 
 /**
- * Initializes DOM event listeners.
+ * Internal class variable to name multiple Recordset instances.
  *
- * @method _initDomEvents
+ * @property RecordSet._nCount
+ * @type Number
  * @private
+ * @static
  */
-YAHOO.widget.DataTable.prototype._initDomEvents = function() {
-    var elTable = this._elTable;
-    var elThead = this._elThead;
-    var elTbody = this._elTbody;
-    var elContainer = this._elContainer;
-
-    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
-    YAHOO.util.Event.addListener(document, "keydown", this._onDocumentKeydown, this);
-
-    YAHOO.util.Event.addListener(elTable, "focus", this._onTableFocus, this);
-    YAHOO.util.Event.addListener(elTable, "mouseover", this._onTableMouseover, this);
-    YAHOO.util.Event.addListener(elTable, "mouseout", this._onTableMouseout, this);
-    YAHOO.util.Event.addListener(elTable, "mousedown", this._onTableMousedown, this);
-    YAHOO.util.Event.addListener(elTable, "keydown", this._onTableKeydown, this);
-    YAHOO.util.Event.addListener(elTable, "keypress", this._onTableKeypress, this);
+YAHOO.widget.RecordSet._nCount = 0;
 
-    // Since we can't listen for click and dblclick on the same element...
-    YAHOO.util.Event.addListener(elTable, "dblclick", this._onTableDblclick, this);
-    YAHOO.util.Event.addListener(elThead, "click", this._onTheadClick, this);
-    YAHOO.util.Event.addListener(elTbody, "click", this._onTbodyClick, this);
+YAHOO.widget.RecordSet.prototype = {
 
-    YAHOO.util.Event.addListener(elContainer, "scroll", this._onScroll, this); // for IE
-    YAHOO.util.Event.addListener(elTbody, "scroll", this._onScroll, this); // for everyone else
-};
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Unique String identifier assigned at instantiation.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
+    /**
+     * Internal counter of how many Records are in the RecordSet.
+     *
+     * @property _length
+     * @type Number
+     * @private
+     * @deprecated No longer used
+     */
+    //_length : null,
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Adds one Record to the RecordSet at the given index. If index is null,
+     * then adds the Record to the end of the RecordSet.
+     *
+     * @method _addRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     * @private
+     */
+    _addRecord : function(oData, index) {
+        var oRecord = new YAHOO.widget.Record(oData);
+        
+        if(YAHOO.lang.isNumber(index) && (index > -1)) {
+            this._records.splice(index,0,oRecord);
+        }
+        else {
+            //index = this.getLength();
+            //this._records[index] = oRecord;
+            this._records[this._records.length] = oRecord;
+        }
+        //this._length++;
+        return oRecord;
+    },
 
+    /**
+     * Sets/replaces one Record to the RecordSet at the given index.  Existing
+     * Records with higher indexes are not shifted.  If no index specified, the
+     * Record is added to the end of the RecordSet.
+     *
+     * @method _setRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     * @private
+     */
+    _setRecord : function(oData, index) {
+        if (!YAHOO.lang.isNumber(index) || index < 0) {
+            index = this._records.length;
+        }
+        return (this._records[index] = new YAHOO.widget.Record(oData));
+        /*
+        if(YAHOO.lang.isNumber(index) && (index > -1)) {
+            this._records[index] = oRecord;
+            if((index+1) > this.getLength()) {
+                this._length = index+1;
+            }
+        }
+        else {
+            this._records[this.getLength()] = oRecord;
+            this._length++;
+        }
+        return oRecord;
+        */
+    },
 
+    /**
+     * Deletes Records from the RecordSet at the given index. If range is null,
+     * then only one Record is deleted.
+     *
+     * @method _deleteRecord
+     * @param index {Number} Position index.
+     * @param range {Number} (optional) How many Records to delete
+     * @private
+     */
+    _deleteRecord : function(index, range) {
+        if(!YAHOO.lang.isNumber(range) || (range < 0)) {
+            range = 1;
+        }
+        this._records.splice(index, range);
+        //this._length = this._length - range;
+    },
 
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Returns unique name of the RecordSet instance.
+     *
+     * @method getId
+     * @return {String} Unique name of the RecordSet instance.
+     */
+    getId : function() {
+        return this._sId;
+    },
 
+    /**
+     * Public accessor to the unique name of the RecordSet instance.
+     *
+     * @method toString
+     * @return {String} Unique name of the RecordSet instance.
+     */
+    toString : function() {
+        return "RecordSet instance " + this._sId;
+    },
 
+    /**
+     * Returns the number of Records held in the RecordSet.
+     *
+     * @method getLength
+     * @return {Number} Number of records in the RecordSet.
+     */
+    getLength : function() {
+            //return this._length;
+            return this._records.length;
+    },
 
+    /**
+     * Returns Record by ID or RecordSet position index.
+     *
+     * @method getRecord
+     * @param record {YAHOO.widget.Record | Number | String} Record instance,
+     * RecordSet position index, or Record ID.
+     * @return {YAHOO.widget.Record} Record object.
+     */
+    getRecord : function(record) {
+        var i;
+        if(record instanceof YAHOO.widget.Record) {
+            for(i=0; i<this._records.length; i++) {
+                if(this._records[i] && (this._records[i]._sId === record._sId)) {
+                    return record;
+                }
+            }
+        }
+        else if(YAHOO.lang.isNumber(record)) {
+            if((record > -1) && (record < this.getLength())) {
+                return this._records[record];
+            }
+        }
+        else if(YAHOO.lang.isString(record)) {
+            for(i=0; i<this._records.length; i++) {
+                if(this._records[i] && (this._records[i]._sId === record)) {
+                    return this._records[i];
+                }
+            }
+        }
+        // Not a valid Record for this RecordSet
+        return null;
 
+    },
 
+    /**
+     * Returns an array of Records from the RecordSet.
+     *
+     * @method getRecords
+     * @param index {Number} (optional) Recordset position index of which Record to
+     * start at.
+     * @param range {Number} (optional) Number of Records to get.
+     * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
+     * length equal to given range. If index is not given, all Records are returned.
+     */
+    getRecords : function(index, range) {
+        if(!YAHOO.lang.isNumber(index)) {
+            return this._records;
+        }
+        if(!YAHOO.lang.isNumber(range)) {
+            return this._records.slice(index);
+        }
+        return this._records.slice(index, index+range);
+    },
 
+    /**
+     * Returns a boolean indicating whether Records exist in the RecordSet at the
+     * specified index range.  Returns true if and only if a Record exists at each
+     * index in the range.
+     * @method hasRecords
+     * @param index
+     * @param range
+     * @return {Boolean} true if all indices are populated in the RecordSet
+     */
+    hasRecords : function (index, range) {
+        var recs = this.getRecords(index,range);
+        for (var i = 0; i < range; ++i) {
+            if (typeof recs[i] === 'undefined') {
+                return false;
+            }
+        }
+        return true;
+    },
 
+    /**
+     * Returns current position index for the given Record.
+     *
+     * @method getRecordIndex
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @return {Number} Record's RecordSet position index.
+     */
 
+    getRecordIndex : function(oRecord) {
+        if(oRecord) {
+            for(var i=this._records.length-1; i>-1; i--) {
+                if(this._records[i] && oRecord.getId() === this._records[i].getId()) {
+                    return i;
+                }
+            }
+        }
+        return null;
 
+    },
 
+    /**
+     * Adds one Record to the RecordSet at the given index. If index is null,
+     * then adds the Record to the end of the RecordSet.
+     *
+     * @method addRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     */
+    addRecord : function(oData, index) {
+        if(oData && (oData.constructor == Object)) {
+            var oRecord = this._addRecord(oData, index);
+            this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
+            return oRecord;
+        }
+        else {
+            return null;
+        }
+    },
 
+    /**
+     * Adds multiple Records at once to the RecordSet at the given index with the
+     * given object literal data. If index is null, then the new Records are
+     * added to the end of the RecordSet.
+     *
+     * @method addRecords
+     * @param aData {Object[]} An object literal data or an array of data object literals.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record[]} An array of Record instances.
+     */
+    addRecords : function(aData, index) {
+        if(YAHOO.lang.isArray(aData)) {
+            var newRecords = [];
+            // Can't go backwards bc we need to preserve order
+            for(var i=0; i<aData.length; i++) {
+                if(aData[i] && (aData[i].constructor == Object)) {
+                    var record = this._addRecord(aData[i], index);
+                    newRecords.push(record);
+                }
+           }
+            this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
+           return newRecords;
+        }
+        else if(aData && (aData.constructor == Object)) {
+            var oRecord = this._addRecord(aData);
+            this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
+            return oRecord;
+        }
+        else {
+        }
+    },
 
+    /**
+     * Sets or replaces one Record to the RecordSet at the given index. Unlike
+     * addRecord, an existing Record at that index is not shifted to preserve it.
+     * If no index is specified, it adds the Record to the end of the RecordSet.
+     *
+     * @method setRecord
+     * @param oData {Object} An object literal of data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record} A Record instance.
+     */
+    setRecord : function(oData, index) {
+        if(oData && (oData.constructor == Object)) {
+            var oRecord = this._setRecord(oData, index);
+            this.fireEvent("recordSetEvent",{record:oRecord,data:oData});
+            return oRecord;
+        }
+        else {
+            return null;
+        }
+    },
 
+    /**
+     * Sets or replaces multiple Records at once to the RecordSet with the given
+     * data, starting at the given index. If index is not specified, then the new
+     * Records are added to the end of the RecordSet.
+     *
+     * @method setRecords
+     * @param aData {Object[]} An array of object literal data.
+     * @param index {Number} (optional) Position index.
+     * @return {YAHOO.widget.Record[]} An array of Record instances.
+     */
+    setRecords : function(aData, index) {
+        if(YAHOO.lang.isArray(aData)) {
+            var Rec = YAHOO.widget.Record,
+                spliceParams = [index,0],
+                i = aData.length - 1,
+                r;
+
+            // build up a parameter array for a single call to splice in
+            // the new records.
+            for(; i >= 0 ; --i) {
+                // If the data in aData isn't valid, use the existing
+                // record to avoid harming valid records
+                r = aData[i] && typeof aData[i] === 'object' ?
+                                new Rec(aData[i]) : this._records[i];
+                if (r) {
+                    spliceParams[i+2] = r;
+                }
+            }
 
+            // We need to explicitly set the last record because splice doesn't
+            // honor start indexes higher than the current length.
+            this._records[index + spliceParams.length - 3] =
+                spliceParams[spliceParams.length - 1];
 
+            // Set the number of records to change (length minus first 2
+            // placeholders).  This must be done here because the end of aData
+            // may have contained invalid record data so we avoid increasing
+            // _records.length incorrectly.  And we do need to set the last
+            // record, although we just did that.
+            spliceParams[1] = spliceParams.length - 2;
 
+            // Call splice.apply to simulate a single update to _records
+            // rather than looping through the new records and setting them
+            // to the index one by one.  Use the spliceParams array to get
+            // the splice method to apply.  A bit convoluted, I know.
+            spliceParams.splice.apply(this._records,spliceParams);
 
+            this.fireEvent("recordsSet",{records:spliceParams,data:aData});
 
+            // return the records that were set.  The first two indexes
+            // in spliceParams are the start index and length, so return
+            // everything starting at index 2
+            return spliceParams.slice(2);
+        }
+        else if(aData && (aData.constructor == Object)) {
+            var oRecord = this._setRecord(aData);
+            this.fireEvent("recordsSetEvent",{records:[oRecord],data:aData});
+            return oRecord;
+        }
+        else {
+        }
+    },
 
+    /**
+     * Updates given Record with given data.
+     *
+     * @method updateRecord
+     * @param record {YAHOO.widget.Record | Number | String} A Record instance,
+     * a RecordSet position index, or a Record ID.
+     * @param oData {Object} Object literal of new data.
+     * @return {YAHOO.widget.Record} Updated Record, or null.
+     */
+    updateRecord : function(record, oData) {
+        var oRecord = this.getRecord(record);
+        if(oRecord && oData && (oData.constructor == Object)) {
+            // Copy data from the Record for the event that gets fired later
+            var oldData = {};
+            for(var key in oRecord._oData) {
+                oldData[key] = oRecord._oData[key];
+            }
+            oRecord._oData = oData;
+            this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
+            return oRecord;
+        }
+        else {
+            return null;
+        }
+    },
 
+    /**
+     * @method updateKey
+     * @deprecated Use updateRecordValue
+     */
+    updateKey : function(record, sKey, oData) {
+        this.updateRecordValue(record, sKey, oData);
+    },
+    /**
+     * Sets given Record at given key to given data.
+     *
+     * @method updateRecordValue
+     * @param record {YAHOO.widget.Record | Number | String} A Record instance,
+     * a RecordSet position index, or a Record ID.
+     * @param sKey {String} Key name.
+     * @param oData {Object} New data.
+     */
+    updateRecordValue : function(record, sKey, oData) {
+        var oRecord = this.getRecord(record);
+        if(oRecord) {
+            var oldData = null;
+            var keyValue = oRecord._oData[sKey];
+            // Copy data from the Record for the event that gets fired later
+            if(keyValue && keyValue.constructor == Object) {
+                oldData = {};
+                for(var key in keyValue) {
+                    oldData[key] = keyValue[key];
+                }
+            }
+            // Copy by value
+            else {
+                oldData = keyValue;
+            }
 
+            oRecord._oData[sKey] = oData;
+            this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+            this.fireEvent("recordValueUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+        }
+        else {
+        }
+    },
 
+    /**
+     * Replaces all Records in RecordSet with new object literal data.
+     *
+     * @method replaceRecords
+     * @param data {Object || Object[]} An object literal of data or an array of
+     * data object literals.
+     * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
+     * an array of Records.
+     */
+    replaceRecords : function(data) {
+        this.reset();
+        return this.addRecords(data);
+    },
 
+    /**
+     * Sorts all Records by given function. Records keep their unique IDs but will
+     * have new RecordSet position indexes.
+     *
+     * @method sortRecords
+     * @param fnSort {Function} Reference to a sort function.
+     * @param desc {Boolean} True if sort direction is descending, false if sort
+     * direction is ascending.
+     * @return {YAHOO.widget.Record[]} Sorted array of Records.
+     */
+    sortRecords : function(fnSort, desc) {
+        return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
+    },
 
+    /**
+     * Reverses all Records, so ["one", "two", "three"] becomes ["three", "two", "one"].
+     *
+     * @method reverseRecords
+     * @return {YAHOO.widget.Record[]} Reverse-sorted array of Records.
+     */
+    reverseRecords : function() {
+        return this._records.reverse();
+    },
 
+    /**
+     * Removes the Record at the given position index from the RecordSet. If a range
+     * is also provided, removes that many Records, starting from the index. Length
+     * of RecordSet is correspondingly shortened.
+     *
+     * @method deleteRecord
+     * @param index {Number} Record's RecordSet position index.
+     * @param range {Number} (optional) How many Records to delete.
+     * @return {Object} A copy of the data held by the deleted Record.
+     */
+    deleteRecord : function(index) {
+        if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+            // Copy data from the Record for the event that gets fired later
+            var oRecordData = this.getRecord(index).getData();
+            var oData = {};
+            for(var key in oRecordData) {
+                oData[key] = oRecordData[key];
+            }
+            
+            this._deleteRecord(index);
+            this.fireEvent("recordDeleteEvent",{data:oData,index:index});
+            return oData;
+        }
+        else {
+            return null;
+        }
+    },
 
+    /**
+     * Removes the Record at the given position index from the RecordSet. If a range
+     * is also provided, removes that many Records, starting from the index. Length
+     * of RecordSet is correspondingly shortened.
+     *
+     * @method deleteRecords
+     * @param index {Number} Record's RecordSet position index.
+     * @param range {Number} (optional) How many Records to delete.
+     */
+    deleteRecords : function(index, range) {
+        if(!YAHOO.lang.isNumber(range)) {
+            range = 1;
+        }
+        if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+            var recordsToDelete = this.getRecords(index, range);
+            // Copy data from each Record for the event that gets fired later
+            var deletedData = [];
+            for(var i=0; i<recordsToDelete.length; i++) {
+                var oData = {};
+                for(var key in recordsToDelete[i]) {
+                    oData[key] = recordsToDelete[i][key];
+                }
+                deletedData.push(oData);
+            }
+            this._deleteRecord(index, range);
 
+            this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
 
+        }
+        else {
+        }
+    },
 
+    /**
+     * Deletes all Records from the RecordSet.
+     *
+     * @method reset
+     */
+    reset : function() {
+        this._records = [];
+        //this._length = 0;
+        this.fireEvent("resetEvent");
+    }
+};
 
-// DOM MUTATION FUNCTIONS
+YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
+/**
+ * The Record class defines a DataTable record.
+ *
+ * @namespace YAHOO.widget
+ * @class Record
+ * @constructor
+ * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ */
+YAHOO.widget.Record = function(oLiteral) {
+    this._sId = "yui-rec" + YAHOO.widget.Record._nCount;
+    YAHOO.widget.Record._nCount++;
+    this._oData = {};
+    if(oLiteral && (oLiteral.constructor == Object)) {
+        for(var sKey in oLiteral) {
+            this._oData[sKey] = oLiteral[sKey];
+        }
+    }
+};
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Adds a TR element to the primary TBODY at the page row index if given, otherwise
- * at the end of the page. Formats TD elements within the TR element using data
- * from the given Record.
+ * Internal class variable to give unique IDs to Record instances.
  *
- * @method _addTrEl
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param index {Number} (optional) The page row index at which to add the TR
- * element.
- * @return {String} ID of the added TR element, or null.
+ * @property Record._nCount
+ * @type Number
  * @private
  */
-YAHOO.widget.DataTable.prototype._addTrEl = function(oRecord, index) {
-    this.hideTableMessage();
-
-    // It's an append if no index provided, or index is negative or too big
-    var append = (!YAHOO.lang.isNumber(index) || (index < 0) ||
-            (index >= (this._elTbody.rows.length))) ? true : false;
-            
-    var oColumnSet = this._oColumnSet;
-    var oRecordSet = this._oRecordSet;
-    var isSortedBy = this.get("sortedBy");
-    var sortedColKeyIndex  = null;
-    var sortedDir, newClass;
-    if(isSortedBy) {
-        sortedColKeyIndex = (isSortedBy.column) ?
-                isSortedBy.column.getKeyIndex() :
-                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
-        sortedDir = isSortedBy.dir;
-        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
-                YAHOO.widget.DataTable.CLASS_ASC;
-
-    }
+YAHOO.widget.Record._nCount = 0;
 
+YAHOO.widget.Record.prototype = {
+    /**
+     * Immutable unique ID assigned at instantiation. Remains constant while a
+     * Record's position index can change from sorting.
+     *
+     * @property _sId
+     * @type String
+     * @private
+     */
+    _sId : null,
 
-    var elRow = (append) ? this._elTbody.appendChild(document.createElement("tr")) :
-        this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);
+    /**
+     * Holds data for the Record in an object literal.
+     *
+     * @property _oData
+     * @type Object
+     * @private
+     */
+    _oData : null,
 
-    elRow.id = this.id+"-bdrow"+this._nTrCount;
-    this._nTrCount++;
-    elRow.yuiRecordId = oRecord.getId();
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public member variables
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-    // Create TD cells
-    for(var j=0; j<oColumnSet.keys.length; j++) {
-        var oColumn = oColumnSet.keys[j];
-        var elCell = elRow.appendChild(document.createElement("td"));
-        elCell.id = elRow.id+"-cell"+j;
-        elCell.yuiColumnId = oColumn.getId();
-        elCell.headers = oColumnSet.headers[j];
-        // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
-        elCell.yuiCellIndex = j;
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
 
-        // Update UI
-        this.formatCell(elCell, oRecord, oColumn);
+    /**
+     * Returns unique ID assigned at instantiation.
+     *
+     * @method getId
+     * @return String
+     */
+    getId : function() {
+        return this._sId;
+    },
 
-        // Set FIRST/LAST on TD
-        if (j === 0) {
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_FIRST);
-        }
-        else if (j === this._oColumnSet.keys.length-1) {
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_LAST);
+    /**
+     * Returns data for the Record for a key if given, or the entire object
+     * literal otherwise.
+     *
+     * @method getData
+     * @param sKey {String} (Optional) The key to retrieve a single data value.
+     * @return Object
+     */
+    getData : function(sKey) {
+        if(YAHOO.lang.isString(sKey)) {
+            return this._oData[sKey];
         }
-        
-        // Remove ASC/DESC
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
-        
-        // Set ASC/DESC on TD
-        if(j === sortedColKeyIndex) {
-            newClass = (sortedDir === "desc") ?
-                    YAHOO.widget.DataTable.CLASS_DESC :
-                    YAHOO.widget.DataTable.CLASS_ASC;
-            YAHOO.util.Dom.addClass(elCell, newClass);
+        else {
+            return this._oData;
         }
+    },
 
-
-        /*p.abx {word-wrap:break-word;}
-ought to solve the problem for Safari (the long words will wrap in your
-tds, instead of overflowing to the next td.
-(this is supported by IE win as well, so hide it if needed).
-
-One thing, though: it doesn't work in combination with
-'white-space:nowrap'.*/
-
-// need a div wrapper for safari?
-        //TODO: fix fixedWidth
-        if(this.fixedWidth) {
-            elCell.style.overflow = "hidden";
-            //elCell.style.width = "20px";
-        }
+    /**
+     * Sets given data at the given key. Use the RecordSet method setValue to trigger
+     * events. 
+     *
+     * @method setData
+     * @param sKey {String} The key of the new value.
+     * @param oData {MIXED} The new value.
+     */
+    setData : function(sKey, oData) {
+        this._oData[sKey] = oData;
     }
-
-    return elRow.id;
 };
 
 /**
- * Formats all TD elements of given TR element with data from the given Record.
+ * The Paginator widget provides a set of controls to navigate through paged
+ * data.
  *
- * @method _updateTrEl
- * @param elRow {HTMLElement} The TR element to update.
- * @param oRecord {YAHOO.widget.Record} The associated Record instance.
- * @return {String} ID of the updated TR element, or null.
- * @private
+ * @namespace YAHOO.widget
+ * @class Paginator
+ * @uses YAHOO.util.EventProvider
+ * @uses YAHOO.util.AttributeProvider
+ *
+ * @constructor
+ * @param config {Object} Object literal to set instance and ui component
+ * configuration.
  */
-YAHOO.widget.DataTable.prototype._updateTrEl = function(elRow, oRecord) {
-    this.hideTableMessage();
+YAHOO.widget.Paginator = function (config) {
+    var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+        lang      = YAHOO.lang,
+        attrib, initialPage, records, perPage;
 
-    var isSortedBy = this.get("sortedBy");
-    var sortedColKeyIndex  = null;
-    var sortedDir, newClass;
-    if(isSortedBy) {
-        sortedColKeyIndex = (isSortedBy.column) ?
-                isSortedBy.column.getKeyIndex() :
-                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
-        sortedDir = isSortedBy.dir;
-        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
-                YAHOO.widget.DataTable.CLASS_ASC;
-    }
+    config = lang.isObject(config) ? config : {};
 
-    // Update TD elements with new data
-    for(var j=0; j<elRow.cells.length; j++) {
-        var oColumn = this._oColumnSet.keys[j];
-        var elCell = elRow.cells[j];
-        this.formatCell(elCell, oRecord, oColumn);
+    this.initConfig();
 
-        // Remove ASC/DESC
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
-        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+    this.initEvents();
 
-        // Set ASC/DESC on TD
-        if(j === sortedColKeyIndex) {
-            YAHOO.util.Dom.addClass(elCell, newClass);
-        }
+    // Set the basic config keys first
+    this.set('rowsPerPage',config.rowsPerPage,true);
+    if (lang.isNumber(config.totalRecords)) {
+        this.set('totalRecords',config.totalRecords,true);
     }
-
-    // Update Record ID
-    elRow.yuiRecordId = oRecord.getId();
     
-    return elRow.id;
-};
+    this.initUIComponents();
 
-
-/**
- * Deletes TR element by DOM reference or by DataTable page row index.
- *
- * @method _deleteTrEl
- * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
- * @return {Boolean} Returns true if successful, else returns false.
- * @private
- */
-YAHOO.widget.DataTable.prototype._deleteTrEl = function(row) {
-    var rowIndex;
-    
-    // Get page row index for the element
-    if(!YAHOO.lang.isNumber(row)) {
-        rowIndex = YAHOO.util.Dom.get(row).sectionRowIndex;
-    }
-    else {
-        rowIndex = row;
-    }
-    if(YAHOO.lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
-        this._elTbody.deleteRow(rowIndex);
-        return true;
+    // Update the other config values
+    for (attrib in config) {
+        if (lang.hasOwnProperty(config,attrib)) {
+            this.set(attrib,config[attrib],true);
+        }
     }
-    else {
-        return false;
+
+    // Calculate the initial record offset
+    initialPage = this.get('initialPage');
+    records     = this.get('totalRecords');
+    perPage     = this.get('rowsPerPage');
+    if (initialPage > 1 && perPage !== UNLIMITED) {
+        var startIndex = (initialPage - 1) * perPage;
+        if (records === UNLIMITED || startIndex < records) {
+            this.set('recordOffset',startIndex,true);
+        }
     }
 };
 
 
+// Static members
+YAHOO.lang.augmentObject(YAHOO.widget.Paginator, {
+    /**
+     * Incrementing index used to give instances unique ids.
+     * @static
+     * @property id
+     * @type number
+     * @private
+     */
+    id : 0,
 
+    /**
+     * Base of id strings used for ui components.
+     * @static
+     * @property ID_BASE
+     * @type string
+     * @private
+     */
+    ID_BASE : 'yui-pg',
 
+    /**
+     * Used to identify unset, optional configurations, or used explicitly in
+     * the case of totalRecords to indicate unlimited pagination.
+     * @static
+     * @property VALUE_UNLIMITED
+     * @type number
+     * @final
+     */
+    VALUE_UNLIMITED : -1,
 
+    /**
+     * Default template used by Paginator instances.  Update this if you want
+     * all new Paginators to use a different default template.
+     * @static
+     * @property TEMPLATE_DEFAULT
+     * @type string
+     */
+    TEMPLATE_DEFAULT : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",
 
+    /**
+     * Common alternate pagination format, including page links, links for
+     * previous, next, first and last pages as well as a rows-per-page
+     * dropdown.  Offered as a convenience.
+     * @static
+     * @property TEMPLATE_ROWS_PER_PAGE
+     * @type string
+     */
+    TEMPLATE_ROWS_PER_PAGE : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
 
+},true);
 
 
+// Instance members and methods
+YAHOO.widget.Paginator.prototype = {
 
+    // Instance members
 
+    /**
+     * Array of nodes in which to render pagination controls.  This is set via
+     * the &quot;containers&quot; attribute.
+     * @property _containers
+     * @type Array(HTMLElement)
+     * @private
+     */
+    _containers : [],
 
 
 
 
+    // Instance methods
 
+    /**
+     * Initialize the Paginator's attributes (see YAHOO.util.Element class
+     * AttributeProvider).
+     * @method initConfig
+     * @private
+     */
+    initConfig : function () {
+
+        var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+            l         = YAHOO.lang;
+
+        /**
+         * REQUIRED. Number of records constituting a &quot;page&quot;
+         * @attribute rowsPerPage
+         * @type integer
+         */
+        this.setAttributeConfig('rowsPerPage', {
+            value     : 0,
+            validator : l.isNumber
+        });
 
+        /**
+         * REQUIRED. Node references or ids of nodes in which to render the
+         * pagination controls.
+         * @attribute containers
+         * @type {string|HTMLElement|Array(string|HTMLElement)}
+         */
+        this.setAttributeConfig('containers', {
+            value     : null,
+            writeOnce : true,
+            validator : function (val) {
+                if (!l.isArray(val)) {
+                    val = [val];
+                }
+                for (var i = 0, len = val.length; i < len; ++i) {
+                    if (l.isString(val[i]) || 
+                        (l.isObject(val[i]) && val[i].nodeType === 1)) {
+                        continue;
+                    }
+                    return false;
+                }
+                return true;
+            },
+            method : function (val) {
+                val = YAHOO.util.Dom.get(val);
+                if (!l.isArray(val)) {
+                    val = [val];
+                }
+                this._containers = val;
+            }
+        });
 
+        /**
+         * Total number of records to paginate through
+         * @attribute totalRecords
+         * @type integer
+         * @default Paginator.VALUE_UNLIMITED
+         */
+        this.setAttributeConfig('totalRecords', {
+            value     : UNLIMITED,
+            validator : l.isNumber
+        });
 
+        /**
+         * Zero based index of the record considered first on the current page.
+         * For page based interactions, don't modify this attribute directly;
+         * use setPage(n).
+         * @attribute recordOffset
+         * @type integer
+         * @default 0
+         */
+        this.setAttributeConfig('recordOffset', {
+            value     : 0,
+            validator : function (val) {
+                var total = this.get('totalRecords');
+                if (l.isNumber(val)) {
+                    return total === UNLIMITED || total > val;
+                }
 
+                return false;
+            }
+        });
 
+        /**
+         * Page to display on initial paint
+         * @attribute initialPage
+         * @type integer
+         * @default 1
+         */
+        this.setAttributeConfig('initialPage', {
+            value     : 1,
+            validator : l.isNumber
+        });
 
+        /**
+         * Template used to render controls.  The string will be used as
+         * innerHTML on all specified container nodes.  Bracketed keys
+         * (e.g. {pageLinks}) in the string will be replaced with an instance
+         * of the so named ui component.
+         * @see Paginator.TEMPLATE_DEFAULT
+         * @see Paginator.TEMPLATE_ROWS_PER_PAGE
+         * @attribute template
+         * @type string
+         */
+        this.setAttributeConfig('template', {
+            value : YAHOO.widget.Paginator.TEMPLATE_DEFAULT,
+            validator : l.isString
+        });
 
+        /**
+         * Class assigned to the element(s) containing pagination controls.
+         * @attribute containerClass
+         * @type string
+         * @default 'yui-pg-container'
+         */
+        this.setAttributeConfig('containerClass', {
+            value : 'yui-pg-container',
+            validator : l.isString
+        });
 
+        /**
+         * Display pagination controls even when there is only one page.  Set
+         * to false to forgo rendering and/or hide the containers when there
+         * is only one page of data.  Note if you are using the rowsPerPage
+         * dropdown ui component, visibility will be maintained as long as the
+         * number of records exceeds the smallest page size.
+         * @attribute alwaysVisible
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig('alwaysVisible', {
+            value : true,
+            validator : l.isBoolean
+        });
 
+        /**
+         * Update the UI immediately upon interaction.  If false, changeRequest
+         * subscribers or other external code will need to explicitly set the
+         * new values in the paginator to trigger repaint.
+         * @attribute updateOnChange
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig('updateOnChange', {
+            value     : false,
+            validator : l.isBoolean
+        });
 
 
-// CSS/STATE FUNCTIONS
 
+        // Read only attributes
 
+        /**
+         * Unique id assigned to this instance
+         * @attribute id
+         * @type integer
+         * @final
+         */
+        this.setAttributeConfig('id', {
+            value    : YAHOO.widget.Paginator.id++,
+            readOnly : true
+        });
 
+        /**
+         * Indicator of whether the DOM nodes have been initially created
+         * @attribute rendered
+         * @type boolean
+         * @final
+         */
+        this.setAttributeConfig('rendered', {
+            value    : false,
+            readOnly : true
+        });
 
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element
- * of the DataTable page and updates internal tracker.
- *
- * @method _setFirstRow
- * @private
- */
-YAHOO.widget.DataTable.prototype._setFirstRow = function() {
-    var rowEl = this.getFirstTrEl();
-    if(rowEl) {
-        // Remove FIRST
-        if(this._sFirstTrId) {
-            YAHOO.util.Dom.removeClass(this._sFirstTrId, YAHOO.widget.DataTable.CLASS_FIRST);
+    },
+
+    /**
+     * Initialize registered ui components onto this instance.
+     * @method initUIComponents
+     * @private
+     */
+    initUIComponents : function () {
+        var ui = YAHOO.widget.Paginator.ui;
+        for (var name in ui) {
+            var UIComp = ui[name];
+            if (YAHOO.lang.isObject(UIComp) &&
+                YAHOO.lang.isFunction(UIComp.init)) {
+                UIComp.init(this);
+            }
         }
-        // Set FIRST
-        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_FIRST);
-        this._sFirstTrId = rowEl.id;
-    }
-    else {
-        this._sFirstTrId = null;
-    }
-};
+    },
 
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element
- * of the DataTable page and updates internal tracker.
- *
- * @method _setLastRow
- * @private
- */
-YAHOO.widget.DataTable.prototype._setLastRow = function() {
-    var rowEl = this.getLastTrEl();
-    if(rowEl) {
-        // Unassign previous class
-        if(this._sLastTrId) {
-            YAHOO.util.Dom.removeClass(this._sLastTrId, YAHOO.widget.DataTable.CLASS_LAST);
+    /**
+     * Initialize this instance's CustomEvents.
+     * @method initEvents
+     * @private
+     */
+    initEvents : function () {
+        this.createEvent('recordOffsetChange');
+        this.createEvent('totalRecordsChange');
+        this.createEvent('rowsPerPageChange');
+        this.createEvent('alwaysVisibleChange');
+
+        this.createEvent('rendered');
+        this.createEvent('changeRequest');
+        this.createEvent('beforeDestroy');
+
+        // Listen for changes to totalRecords and alwaysVisible 
+        this.subscribe('totalRecordsChange',this.updateVisibility,this,true);
+        this.subscribe('alwaysVisibleChange',this.updateVisibility,this,true);
+    },
+
+    /**
+     * Render the pagination controls per the format attribute into the
+     * specified container nodes.
+     * @method render
+     */
+    render : function () {
+        if (this.get('rendered')) {
+            return;
         }
-        // Assign class
-        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_LAST);
-        this._sLastTrId = rowEl.id;
-    }
-    else {
-        this._sLastTrId = null;
-    }
-};
 
-/**
- * Assigns the classes YAHOO.widget.DataTable.CLASS_EVEN and
- * YAHOO.widget.DataTable.CLASS_ODD to alternating TR elements of the DataTable
- * page. For performance, a subset of rows may be specified.
- *
- * @method _setRowStripes
- * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
- * or string ID, or page row index of where to start striping.
- * @param range {Number} (optional) If given, how many rows to stripe, otherwise
- * stripe all the rows until the end.
- * @private
- */
-YAHOO.widget.DataTable.prototype._setRowStripes = function(row, range) {
-    // Default values stripe all rows
-    var allRows = this._elTbody.rows;
-    var nStartIndex = 0;
-    var nEndIndex = allRows.length;
-    
-    // Stripe a subset
-    if((row !== null) && (row !== undefined)) {
-        // Validate given start row
-        var elStartRow = this.getTrEl(row);
-        if(elStartRow) {
-            nStartIndex = elStartRow.sectionRowIndex;
-            
-            // Validate given range
-            if(YAHOO.lang.isNumber(range) && (range > 1)) {
-                nEndIndex = nStartIndex + range;
+        // Forgo rendering if only one page and alwaysVisible is off
+        var totalRecords = this.get('totalRecords');
+        if (totalRecords !== YAHOO.widget.Paginator.VALUE_UNLIMITED &&
+            totalRecords < this.get('rowsPerPage') &&
+            !this.get('alwaysVisible')) {
+            return;
+        }
+
+        var Dom            = YAHOO.util.Dom,
+            template       = this.get('template'),
+            containerClass = this.get('containerClass');
+
+        // add marker spans to the template html to indicate drop zones
+        // for ui components
+        template = template.replace(/\{([a-z0-9_ \-]+)\}/gi,
+            '<span class="yui-pg-ui $1"></span>');
+        for (var i = 0, len = this._containers.length; i < len; ++i) {
+            var c       = this._containers[i],
+                // ex. yui-pg0-1 (first paginator, second container)
+                id_base = YAHOO.widget.Paginator.ID_BASE + this.get('id') +
+                          '-' + i;
+
+            if (!c) {
+                continue;
+            }
+            // Hide the container while its contents are rendered
+            c.style.display = 'none';
+
+            Dom.addClass(c,containerClass);
+
+            // Place the template innerHTML
+            c.innerHTML = template;
+
+            // Replace each marker with the ui component's render() output
+            var markers = Dom.getElementsByClassName('yui-pg-ui','span',c);
+
+            for (var j = 0, jlen = markers.length; j < jlen; ++j) {
+                var m      = markers[j],
+                    mp     = m.parentNode,
+                    name   = m.className.replace(/\s*yui-pg-ui\s+/g,''),
+                    UIComp = YAHOO.widget.Paginator.ui[name];
+
+                if (YAHOO.lang.isFunction(UIComp)) {
+                    var comp = new UIComp(this);
+                    if (YAHOO.lang.isFunction(comp.render)) {
+                        mp.replaceChild(comp.render(id_base),m);
+                    }
+                }
             }
+
+            // Show the container allowing page reflow
+            c.style.display = '';
         }
-    }
 
-    for(var i=nStartIndex; i<nEndIndex; i++) {
-        if(i%2) {
-            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
-            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+        // Set render attribute manually to support its readOnly contract
+        if (this._containers.length) {
+            this.setAttributeConfig('rendered',{value:true});
+
+            this.fireEvent('rendered',this.getState());
         }
-        else {
-            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
-            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+    },
+
+    /**
+     * Removes controls from the page and unhooks events.
+     * @method destroy
+     */
+    destroy : function () {
+        this.fireEvent('beforeDestroy');
+        for (var i = 0, len = this._containers.length; i < len; ++i) {
+            this._containers[i].innerHTML = '';
         }
-    }
-};
+        this.setAttributeConfig('rendered',{value:false});
+    },
 
+    /**
+     * Hides the containers if there is only one page of data and attribute
+     * alwaysVisible is false.  Conversely, it displays the containers if either
+     * there is more than one page worth of data or alwaysVisible is turned on.
+     * @method updateVisibility
+     */
+    updateVisibility : function (e) {
+        var alwaysVisible = this.get('alwaysVisible');
+        if (e.type === 'alwaysVisibleChange' || !alwaysVisible) {
+            var totalRecords = this.get('totalRecords'),
+                visible = true,
+                rpp = this.get('rowsPerPage'),
+                rppOptions = this.get('rowsPerPageOptions'),
+                i,len;
+
+            if (YAHOO.lang.isArray(rppOptions)) {
+                for (i = 0, len = rppOptions.length; i < len; ++i) {
+                    rpp = Math.min(rpp,rppOptions[i]);
+                }
+            }
+
+            if (totalRecords !== YAHOO.widget.Paginator.VALUE_UNLIMITED &&
+                totalRecords <= rpp) {
+                visible = false;
+            }
+
+            visible = visible || alwaysVisible;
+
+            for (i = 0, len = this._containers.length; i < len; ++i) {
+                YAHOO.util.Dom.setStyle(this._containers[i],'display',
+                    visible ? '' : 'none');
+            }
+        }
+    },
+
+
+
+
+    /**
+     * Get the configured container nodes
+     * @method getContainerNodes
+     * @return {Array} array of HTMLElement nodes
+     */
+    getContainerNodes : function () {
+        return this._containers;
+    },
 
+    /**
+     * Get the total number of pages in the data set according to the current
+     * rowsPerPage and totalRecords values.  If totalRecords is not set, or
+     * set to YAHOO.widget.Paginator.VALUE_UNLIMITED, returns
+     * YAHOO.widget.Paginator.VALUE_UNLIMITED.
+     * @method getTotalPages
+     * @return {number}
+     */
+    getTotalPages : function () {
+        var records = this.get('totalRecords');
+        var perPage = this.get('rowsPerPage');
+
+        // rowsPerPage not set.  Can't calculate
+        if (!perPage) {
+            return null;
+        }
 
+        if (records === YAHOO.widget.Paginator.VALUE_UNLIMITED) {
+            return YAHOO.widget.Paginator.VALUE_UNLIMITED;
+        }
 
+        return Math.ceil(records/perPage);
+    },
 
+    /**
+     * Does the requested page have any records?
+     * @method hasPage
+     * @param page {number} the page in question
+     * @return {boolean}
+     */
+    hasPage : function (page) {
+        if (!YAHOO.lang.isNumber(page) || page < 1) {
+            return false;
+        }
 
+        var totalPages = this.getTotalPages();
 
+        return (totalPages === YAHOO.widget.Paginator.VALUE_UNLIMITED || totalPages >= page);
+    },
 
+    /**
+     * Get the page number corresponding to the current record offset.
+     * @method getCurrentPage
+     * @return {number}
+     */
+    getCurrentPage : function () {
+        var perPage = this.get('rowsPerPage');
+        if (!perPage) {
+            return null;
+        }
+        return Math.floor(this.get('recordOffset') / perPage) + 1;
+    },
 
+    /**
+     * Are there records on the next page?
+     * @method hasNextPage
+     * @return {boolean}
+     */
+    hasNextPage : function () {
+        var currentPage = this.getCurrentPage(),
+            totalPages  = this.getTotalPages();
 
+        if (currentPage === null) {
+            return false;
+        }
 
+        return (totalPages === YAHOO.widget.Paginator.VALUE_UNLIMITED ? true : currentPage < totalPages);
+    },
 
+    /**
+     * Get the page number of the next page, or null if the current page is the
+     * last page.
+     * @method getNextPage
+     * @return {number}
+     */
+    getNextPage : function () {
+        return this.hasNextPage() ? this.getCurrentPage() + 1 : null;
+    },
 
+    /**
+     * Is there a page before the current page?
+     * @method hasPreviousPage
+     * @return {boolean}
+     */
+    hasPreviousPage : function () {
+        return (this.getCurrentPage() > 1);
+    },
 
+    /**
+     * Get the page number of the previous page, or null if the current page
+     * is the first page.
+     * @method getPreviousPage
+     * @return {number}
+     */
+    getPreviousPage : function () {
+        return (this.hasPreviousPage() ? this.getCurrentPage() - 1 : 1);
+    },
 
+    /**
+     * Get the start and end record indexes of the specified page.
+     * @method getPageRecords
+     * @param page {number} (optional) The page (current page if not specified)
+     * @return {Array} [start_index, end_index]
+     */
+    getPageRecords : function (page) {
+        if (!YAHOO.lang.isNumber(page)) {
+            page = this.getCurrentPage();
+        }
 
+        var perPage = this.get('rowsPerPage'),
+            records = this.get('totalRecords'),
+            start, end;
 
+        if (!perPage) {
+            return null;
+        }
 
+        start = (page - 1) * perPage;
+        if (records !== YAHOO.widget.Paginator.VALUE_UNLIMITED) {
+            if (start >= records) {
+                return null;
+            }
+            end = Math.min(start + perPage, records) - 1;
+        } else {
+            end = start + perPage - 1;
+        }
 
+        return [start,end];
+    },
 
+    /**
+     * Set the current page to the provided page number if possible.
+     * @method setPage
+     * @param newPage {number} the new page number
+     * @param silent {boolean} whether to forcibly avoid firing the
+     * changeRequest event
+     */
+    setPage : function (page,silent) {
+        if (this.hasPage(page) && page !== this.getCurrentPage()) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('recordOffset', (page - 1) * this.get('rowsPerPage'));
+            } else {
+                this.fireEvent('changeRequest',this.getState({'page':page}));
+            }
+        }
+    },
 
+    /**
+     * Get the number of rows per page.
+     * @method getRowsPerPage
+     * @return {number} the current setting of the rowsPerPage attribute
+     */
+    getRowsPerPage : function () {
+        return this.get('rowsPerPage');
+    },
 
+    /**
+     * Set the number of rows per page.
+     * @method setRowsPerPage
+     * @param rpp {number} the new number of rows per page
+     * @param silent {boolean} whether to forcibly avoid firing the
+     * changeRequest event
+     */
+    setRowsPerPage : function (rpp,silent) {
+        if (YAHOO.lang.isNumber(rpp) && rpp > 0 &&
+            rpp !== this.get('rowsPerPage')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('rowsPerPage',rpp);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'rowsPerPage':rpp}));
+            }
+        }
+    },
 
+    /**
+     * Get the total number of records.
+     * @method getTotalRecords
+     * @return {number} the current setting of totalRecords attribute
+     */
+    getTotalRecords : function () {
+        return this.get('totalRecords');
+    },
 
+    /**
+     * Set the total number of records.
+     * @method setTotalRecords
+     * @param total {number} the new total number of records
+     * @param silent {boolean} whether to forcibly avoid firing the changeRequest event
+     */
+    setTotalRecords : function (total,silent) {
+        if (YAHOO.lang.isNumber(total) && total >= 0 &&
+            total !== this.get('totalRecords')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('totalRecords',total);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'totalRecords':total}));
+            }
+        }
+    },
 
+    /**
+     * Get the index of the first record on the current page
+     * @method getStartIndex
+     * @return {number} the index of the first record on the current page
+     */
+    getStartIndex : function () {
+        return this.get('recordOffset');
+    },
 
+    /**
+     * Move the record offset to a new starting index.  This will likely cause
+     * the calculated current page to change.  You should probably use setPage.
+     * @method setStartIndex
+     * @param offset {number} the new record offset
+     * @param silent {boolean} whether to forcibly avoid firing the changeRequest event
+     */
+    setStartIndex : function (offset,silent) {
+        if (YAHOO.lang.isNumber(offset) && offset >= 0 &&
+            offset !== this.get('recordOffset')) {
+            if (this.get('updateOnChange') || silent) {
+                this.set('recordOffset',offset);
+            } else {
+                this.fireEvent('changeRequest',
+                    this.getState({'recordOffset':offset}));
+            }
+        }
+    },
 
+    /**
+     * Get an object literal describing the current state of the paginator.  If
+     * an object literal of proposed values is passed, the proposed state will
+     * be returned as an object literal with the following keys:
+     * <ul>
+     * <li>paginator - instance of the Paginator</li>
+     * <li>page - number</li>
+     * <li>totalRecords - number</li>
+     * <li>recordOffset - number</li>
+     * <li>rowsPerPage - number</li>
+     * <li>records - [ start_index, end_index ]</li>
+     * <li>before - (OPTIONAL) { state object literal for current state }</li>
+     * </ul>
+     * @method getState
+     * @return {object}
+     * @param changes {object} OPTIONAL object literal with proposed values
+     * Supported change keys include:
+     * <ul>
+     * <li>rowsPerPage</li>
+     * <li>totalRecords</li>
+     * <li>recordOffset OR</li>
+     * <li>page</li>
+     * </ul>
+     */
+    getState : function (changes) {
+        var UNLIMITED = YAHOO.widget.Paginator.VALUE_UNLIMITED,
+            L         = YAHOO.lang;
+
+        var currentState = {
+            paginator    : this,
+            page         : this.getCurrentPage(),
+            totalRecords : this.get('totalRecords'),
+            recordOffset : this.get('recordOffset'),
+            rowsPerPage  : this.get('rowsPerPage'),
+            records      : this.getPageRecords()
+        };
 
+        if (!changes) {
+            return currentState;
+        }
 
+        var newOffset = currentState.recordOffset;
+        var state = {
+            paginator    : this,
+            before       : currentState,
 
+            rowsPerPage  : changes.rowsPerPage || currentState.rowsPerPage,
+            totalRecords : (L.isNumber(changes.totalRecords) ?
+                                Math.max(changes.totalRecords,UNLIMITED) :
+                                currentState.totalRecords)
+        };
 
+        if (state.totalRecords === 0) {
+            newOffset  = 0;
+            state.page = 0;
+        } else {
+            if (!L.isNumber(changes.recordOffset) &&
+                 L.isNumber(changes.page)) {
+                newOffset = (changes.page - 1) * state.rowsPerPage;
+                if (state.totalRecords === UNLIMITED) {
+                    state.page = changes.page;
+                } else {
+                    // Limit values by totalRecords and rowsPerPage
+                    state.page = Math.min(
+                                    changes.page,
+                                    Math.ceil(state.totalRecords / state.rowsPerPage));
+                    newOffset  = Math.min(newOffset, state.totalRecords - 1);
+                }
+            } else {
+                newOffset  = Math.min(newOffset,state.totalRecords - 1);
+                state.page = Math.floor(newOffset/state.rowsPerPage) + 1;
+            }
+        }
 
+        // Jump offset to top of page
+        state.recordOffset = state.recordOffset ||
+                             newOffset - (newOffset % state.rowsPerPage);
 
+        state.records = [ state.recordOffset,
+                          state.recordOffset + state.rowsPerPage - 1 ];
 
+        if (state.totalRecords !== UNLIMITED &&
+            state.recordOffset < state.totalRecords &&
+            state.records[1] > state.totalRecords - 1) {
+            // limit upper index to totalRecords - 1
+            state.records[1] = state.totalRecords - 1;
+        }
 
+        return state;
+    }
+};
 
+YAHOO.lang.augmentProto(YAHOO.widget.Paginator, YAHOO.util.AttributeProvider);
 
 
 
 
 
 
+// UI Components
 
+(function () {
 
+// UI Component namespace
+YAHOO.widget.Paginator.ui = {};
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private DOM Event Handlers
-//
-/////////////////////////////////////////////////////////////////////////////
+var Paginator = YAHOO.widget.Paginator,
+    ui        = Paginator.ui,
+    l         = YAHOO.lang;
 
 /**
- * Handles scroll events on the CONTAINER (for IE) and TBODY elements (for everyone else).
+ * ui Component to generate the link to jump to the first page.
  *
- * @method _onScroll
- * @param e {HTMLEvent} The scroll event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class FirstPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onScroll = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
-    
-    if(oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-        oSelf.cancelCellEditor();
-    }
+ui.FirstPageLink = function (p) {
+    this.paginator = p;
 
-    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
+    p.createEvent('firstPageLinkLabelChange');
+    p.createEvent('firstPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('firstPageLinkLabelChange',this.update,this,true);
+    p.subscribe('firstPageLinkClassChange',this.update,this,true);
 };
 
 /**
- * Handles click events on the DOCUMENT.
- *
- * @method _onDocumentClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onDocumentClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.FirstPageLink.init = function (p) {
 
-    if(!YAHOO.util.Dom.isAncestor(oSelf._elTable, elTarget)) {
-        oSelf.fireEvent("tableBlurEvent");
+    /**
+     * Used as innerHTML for the first page link/span.
+     * @attribute firstPageLinkLabel
+     * @default '&lt;&lt;&nbsp;first'
+     */
+    p.setAttributeConfig('firstPageLinkLabel', {
+        value : '&lt;&lt;&nbsp;first',
+        validator : l.isString
+    });
 
-        // Fires editorBlurEvent when click is not within the TABLE.
-        // For cases when click is within the TABLE, due to timing issues,
-        // the editorBlurEvent needs to get fired by the lower-level DOM click
-        // handlers below rather than by the TABLE click handler directly.
-        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-            // Only if the click was not within the Cell Editor container
-            if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
-                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
-                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    /**
+     * CSS class assigned to the link/span
+     * @attribute firstPageLinkClass
+     * @default 'yui-pg-first'
+     */
+    p.setAttributeConfig('firstPageLinkClass', {
+        value : 'yui-pg-first',
+        validator : l.isString
+    });
+};
+
+// Instance members and methods
+ui.FirstPageLink.prototype = {
+
+    /**
+     * The currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
+
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
+
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('firstPageLinkClass'),
+            label = p.get('firstPageLinkLabel');
+
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
+
+        this.link.id        = id_base + '-first-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-first-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.current = p.get('recordOffset') < 1 ? this.span : this.link;
+        return this.current;
+    },
+
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
+
+        var par = this.current ? this.current.parentNode : null;
+        if (this.paginator.get('recordOffset') < 1) {
+            if (par && this.current === this.link) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
+            }
+        } else {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
             }
         }
+    },
+
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Pass new value to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(1);
     }
 };
 
+
+
 /**
- * Handles keydown events on the DOCUMENT.
+ * ui Component to generate the link to jump to the last page.
  *
- * @method _onDocumentKeydown
- * @param e {HTMLEvent} The keydown event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class LastPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onDocumentKeydown = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.LastPageLink = function (p) {
+    this.paginator = p;
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive &&
-            YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget)) {
-        oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
-    }
+    p.createEvent('lastPageLinkLabelChange');
+    p.createEvent('lastPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('lastPageLinkLabelChange',this.update,this,true);
+    p.subscribe('lastPageLinkClassChange', this.update,this,true);
 };
 
 /**
- * Handles focus events on the TABLE element.
- *
- * @method _onTableFocus
- * @param e {HTMLEvent} The focus event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param paginator {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
-    oSelf.fireEvent("tableFocusEvent");
+ui.LastPageLink.init = function (p) {
+
+    /**
+     * Used as innerHTML for the last page link/span.
+     * @attribute lastPageLinkLabel
+     * @default 'last&nbsp;&gt;&gt;'
+     */
+    p.setAttributeConfig('lastPageLinkLabel', {
+        value : 'last&nbsp;&gt;&gt;',
+        validator : l.isString
+    });
+
+    /**
+     * CSS class assigned to the link/span
+     * @attribute lastPageLinkClass
+     * @default 'yui-pg-last'
+     */
+    p.setAttributeConfig('lastPageLinkClass', {
+        value : 'yui-pg-last',
+        validator : l.isString
+    });
 };
 
-/**
- * Handles mouseover events on the TABLE element.
- *
- * @method _onTableMouseover
- * @param e {HTMLEvent} The mouseover event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.LastPageLink.prototype = {
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                 break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
+
+    /**
+     * Link HTMLElement node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
+
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+    /**
+     * Empty place holder node for when the last page link is inappropriate to
+     * display in any form (unlimited paging).
+     * @property na
+     * @type HTMLElement
+     * @private
+     */
+    na        : null,
+
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('lastPageLinkClass'),
+            label = p.get('lastPageLinkLabel'),
+            last  = p.getTotalPages();
+
+        this.link = document.createElement('a');
+        this.span = document.createElement('span');
+        this.na   = this.span.cloneNode(false);
+
+        this.link.id        = id_base + '-last-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-last-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.na.id = id_base + '-last-na';
+
+        switch (last) {
+            case Paginator.VALUE_UNLIMITED :
+                    this.current = this.na; break;
+            case p.getCurrentPage() :
+                    this.current = this.span; break;
+            default :
+                    this.current = this.link;
         }
-    }
-    oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elTable),event:e});
-};
 
-/**
- * Handles mouseout events on the TABLE element.
- *
- * @method _onTableMouseout
- * @param e {HTMLEvent} The mouseout event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onTableMouseout = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+        return this.current;
+    },
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
+    /**
+     * Swap the link, span, and na nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event (ignored)
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
         }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
+
+        var par   = this.current ? this.current.parentNode : null,
+            after = this.link;
+
+        if (par) {
+            switch (this.paginator.getTotalPages()) {
+                case Paginator.VALUE_UNLIMITED :
+                        after = this.na; break;
+                case this.paginator.getCurrentPage() :
+                        after = this.span; break;
+            }
+
+            if (this.current !== after) {
+                par.replaceChild(after,this.current);
+                this.current = after;
+            }
         }
+    },
+
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getTotalPages());
     }
-    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elTable),event:e});
 };
 
+
 /**
- * Handles mousedown events on the TABLE element.
+ * ui Component to generate the link to jump to the previous page.
  *
- * @method _onTableMousedown
- * @param e {HTMLEvent} The mousedown event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class PreviousPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTableMousedown = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.PreviousPageLink = function (p) {
+    this.paginator = p;
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "a":
-                break;
-            case "td":
-                oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-    }
-    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elTable),event:e});
+    p.createEvent('previousPageLinkLabelChange');
+    p.createEvent('previousPageLinkClassChange');
+
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
+
+    // TODO: make this work
+    p.subscribe('previousPageLinkLabelChange',this.update,this,true);
+    p.subscribe('previousPageLinkClassChange',this.update,this,true);
 };
 
 /**
- * Handles dblclick events on the TABLE element.
- *
- * @method _onTableDblclick
- * @param e {HTMLEvent} The dblclick event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTableDblclick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.PreviousPageLink.init = function (p) {
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "td":
-                oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
-                break;
-            case "span":
-                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                    oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "th":
-                oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
-                    oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
-                }
-                else {
-                    oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
-                }
-                break;
-            default:
-                break;
+    /**
+     * Used as innerHTML for the previous page link/span.
+     * @attribute previousPageLinkLabel
+     * @default '&lt;&nbsp;prev'
+     */
+    p.setAttributeConfig('previousPageLinkLabel', {
+        value : '&lt;&nbsp;prev',
+        validator : l.isString
+    });
+
+    /**
+     * CSS class assigned to the link/span
+     * @attribute previousPageLinkClass
+     * @default 'yui-pg-previous'
+     */
+    p.setAttributeConfig('previousPageLinkClass', {
+        value : 'yui-pg-previous',
+        validator : l.isString
+    });
+};
+
+ui.PreviousPageLink.prototype = {
+
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
+
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
+
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('previousPageLinkClass'),
+            label = p.get('previousPageLinkLabel');
+
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
+
+        this.link.id        = id_base + '-prev-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-prev-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.current = p.get('recordOffset') < 1 ? this.span : this.link;
+        return this.current;
+    },
+
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
         }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
+
+        var par = this.current ? this.current.parentNode : null;
+        if (this.paginator.get('recordOffset') < 1) {
+            if (par && this.current === this.link) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
+            }
+        } else {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
+            }
         }
+    },
+
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
+
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getPreviousPage());
     }
-    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elTable),event:e});
 };
 
+
+
 /**
- * Handles keydown events on the TABLE element. Handles arrow selection.
+ * ui Component to generate the link to jump to the next page.
  *
- * @method _onTableKeydown
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class NextPageLink
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTableKeydown = function(e, oSelf) {
-    var bSHIFT = e.shiftKey;
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    
-    // Ignore actions in the THEAD
-    if(YAHOO.util.Dom.isAncestor(oSelf._elThead, elTarget)) {
-        return;
-    }
-    
-    var nKey = YAHOO.util.Event.getCharCode(e);
-    
-    // TAB to first label link if any
-    if(nKey === 9 && !bSHIFT && (elTarget.id === oSelf._elTable.id)) {
-        if(oSelf._sFirstLabelLinkId) {
-            YAHOO.util.Event.stopEvent(e);
-            oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));
-        }
-        return;
-    }
+ui.NextPageLink = function (p) {
+    this.paginator = p;
 
-    // Something is currently selected
-    var lastSelectedId = oSelf._sLastSelectedId;
-    var lastSelectedEl = YAHOO.util.Dom.get(lastSelectedId);
-    if(lastSelectedEl && oSelf.isSelected(lastSelectedEl)) {
-        //TODO: handle tab, backspace, delete
-        
-        // Handle arrow selection
-        if((nKey > 36) && (nKey < 41)) {
-            YAHOO.util.Event.stopEvent(e);
-        }
-        else {
-            return;
-        }
+    p.createEvent('nextPageLinkLabelChange');
+    p.createEvent('nextPageLinkClassChange');
 
-        var sMode = oSelf.get("selectionMode");
-        var allRows = oSelf._elTbody.rows;
-        var anchorId = oSelf._sSelectionAnchorId;
-        var anchorEl = YAHOO.util.Dom.get(anchorId);
-        var newSelectedEl, trIndex, tdIndex, startIndex, endIndex, i, anchorPos;
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
 
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT cell block selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        if(bSHIFT && (sMode == "cellblock")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
+    // TODO: make this work
+    p.subscribe('nextPageLinkLabelChange', this.update,this,true);
+    p.subscribe('nextPageLinkClassChange', this.update,this,true);
+};
 
-            // Arrow DOWN
-            if(nKey == 40) {
-                // Is the anchor cell above, below, or same row
-                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.NextPageLink.init = function (p) {
 
-                // Is the anchor cell left or right
-                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
-                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+    /**
+     * Used as innerHTML for the next page link/span.
+     * @attribute nextPageLinkLabel
+     * @default 'next&nbsp;&gt;'
+     */
+    p.setAttributeConfig('nextPageLinkLabel', {
+        value : 'next&nbsp;&gt;',
+        validator : l.isString
+    });
 
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    // Select the horiz block on the next row
-                    if(trIndex < allRows.length-1) {
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[trIndex+1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the horiz block on this row towards the next row
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                }
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Is the anchor cell above, below, or same row
-                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * CSS class assigned to the link/span
+     * @attribute nextPageLinkClass
+     * @default 'yui-pg-next'
+     */
+    p.setAttributeConfig('nextPageLinkClass', {
+        value : 'yui-pg-next',
+        validator : l.isString
+    });
+};
 
-                // Is the anchor cell left or right?
-                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
-                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+ui.NextPageLink.prototype = {
 
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    // Select the horiz block on the previous row
-                    if(trIndex > 0) {
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[trIndex-1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the horiz block on this row towards the previous row
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                }
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Is the anchor cell left, right, or same column
-                if(anchorEl.yuiCellIndex > tdIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.yuiCellIndex < tdIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * Currently placed HTMLElement node
+     * @property current
+     * @type HTMLElement
+     * @private
+     */
+    current   : null,
 
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    //Select the next vert block to the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[i].cells[tdIndex+1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the vert block on this column towards the right
-                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                }
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Is the anchor cell left, right, or same column
-                if(anchorEl.yuiCellIndex > tdIndex) {
-                    anchorPos = 1;
-                }
-                else if(anchorEl.yuiCellIndex < tdIndex) {
-                    anchorPos = -1;
-                }
-                else {
-                    anchorPos = 0;
-                }
+    /**
+     * Link node
+     * @property link
+     * @type HTMLElement
+     * @private
+     */
+    link      : null,
 
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    //Select the previous vert block to the left
-                    if(tdIndex > 0) {
-                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                        for(i=startIndex; i<=endIndex; i++) {
-                            newSelectedEl = allRows[i].cells[tdIndex-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect the vert block on this column towards the left
-                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
-                    for(i=startIndex; i<=endIndex; i++) {
-                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                }
-            }
+    /**
+     * Span node (inactive link)
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span      : null,
+
+
+    /**
+     * Generate the nodes and return the appropriate node given the current
+     * pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p     = this.paginator,
+            c     = p.get('nextPageLinkClass'),
+            label = p.get('nextPageLinkLabel'),
+            last  = p.getTotalPages();
+
+        this.link     = document.createElement('a');
+        this.span     = document.createElement('span');
+
+        this.link.id        = id_base + '-next-link';
+        this.link.href      = '#';
+        this.link.className = c;
+        this.link.innerHTML = label;
+        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
+
+        this.span.id        = id_base + '-next-span';
+        this.span.className = c;
+        this.span.innerHTML = label;
+
+        this.current = p.getCurrentPage() === last ? this.span : this.link;
+
+        return this.current;
+    },
+
+    /**
+     * Swap the link and span nodes if appropriate.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
         }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT cell range selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if(bSHIFT && (sMode == "cellrange")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
 
-            // Is the anchor cell above, below, or same row
-            if(anchorEl.parentNode.sectionRowIndex > trIndex) {
-                anchorPos = 1;
-            }
-            else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
-                anchorPos = -1;
+        var last = this.paginator.getTotalPages(),
+            par  = this.current ? this.current.parentNode : null;
+
+        if (this.paginator.getCurrentPage() !== last) {
+            if (par && this.current === this.span) {
+                par.replaceChild(this.link,this.current);
+                this.current = this.link;
             }
-            else {
-                anchorPos = 0;
+        } else if (this.current === this.link) {
+            if (par) {
+                par.replaceChild(this.span,this.current);
+                this.current = this.span;
             }
+        }
+    },
 
-            // Arrow down
-            if(nKey == 40) {
-                // Selecting away from anchor cell
-                if(anchorPos <= 0) {
-                    // Select all cells to the end of this row
-                    for(i=tdIndex+1; i<allRows[trIndex].cells.length; i++){
-                        newSelectedEl = allRows[trIndex].cells[i];
-                        oSelf.selectCell(newSelectedEl);
-                    }
+    /**
+     * Removes the onClick listener from the link in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.link);
+    },
 
-                    // Select some of the cells on the next row down
-                    if(trIndex < allRows.length-1) {
-                        for(i=0; i<=tdIndex; i++){
-                            newSelectedEl = allRows[trIndex+1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect all cells to the end of this row
-                    for(i=tdIndex; i<allRows[trIndex].cells.length; i++){
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
+    /**
+     * Listener for the link's onclick event.  Passes to setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        YAHOO.util.Event.stopEvent(e);
+        this.paginator.setPage(this.paginator.getNextPage());
+    }
+};
 
-                    // Unselect some of the cells on the next row down
-                    for(i=0; i<tdIndex; i++){
-                        oSelf.unselectCell(allRows[trIndex+1].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
-                }
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Selecting away from anchor cell
-                if(anchorPos >= 0) {
-                    // Select all the cells to the beginning of this row
-                    for(i=tdIndex-1; i>-1; i--){
-                        newSelectedEl = allRows[trIndex].cells[i];
-                        oSelf.selectCell(newSelectedEl);
-                    }
 
-                    // Select some of the cells from the end of the previous row
-                    if(trIndex > 0) {
-                        for(i=allRows[trIndex].cells.length-1; i>=tdIndex; i--){
-                            newSelectedEl = allRows[trIndex-1].cells[i];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                }
-                // Unselecting towards anchor cell
-                else {
-                    // Unselect all the cells to the beginning of this row
-                    for(i=tdIndex; i>-1; i--){
-                        oSelf.unselectCell(allRows[trIndex].cells[i]);
-                    }
+/**
+ * ui Component to generate the page links
+ *
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class PageLinks
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
+ */
+ui.PageLinks = function (p) {
+    this.paginator = p;
 
-                    // Unselect some of the cells from the end of the previous row
-                    for(i=allRows[trIndex].cells.length-1; i>tdIndex; i--){
-                        oSelf.unselectCell(allRows[trIndex-1].cells[i]);
-                    }
-                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
-                }
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Selecting away from anchor cell
-                if(anchorPos < 0) {
-                    // Select the next cell to the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        newSelectedEl = allRows[trIndex].cells[tdIndex+1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                    // Select the first cell of the next row
-                    else if(trIndex < allRows.length-1) {
-                        newSelectedEl = allRows[trIndex+1].cells[0];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                }
-                // Unselecting towards anchor cell
-                else if(anchorPos > 0) {
-                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+    p.createEvent('pageLinkClassChange');
+    p.createEvent('currentPageClassChange');
+    p.createEvent('pageLinksContainerClassChange');
+    p.createEvent('pageLinksChange');
 
-                    // Unselect this cell towards the right
-                    if(tdIndex < allRows[trIndex].cells.length-1) {
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                    // Unselect this cells towards the first cell of the next row
-                    else {
-                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[0].id;
-                    }
-                }
-                // Anchor is on this row
-                else {
-                    // Selecting away from anchor
-                    if(anchorEl.yuiCellIndex <= tdIndex) {
-                        // Select the next cell to the right
-                        if(tdIndex < allRows[trIndex].cells.length-1) {
-                            newSelectedEl = allRows[trIndex].cells[tdIndex+1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        // Select the first cell on the next row
-                        else if(trIndex < allRows.length-1){
-                            newSelectedEl = allRows[trIndex+1].cells[0];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                    // Unselecting towards anchor
-                    else {
-                        // Unselect this cell towards the right
-                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
-                    }
-                }
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Unselecting towards the anchor
-                if(anchorPos < 0) {
-                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('pageLinksChange',   this.rebuild,this,true);
+    p.subscribe('totalRecordsChange',this.rebuild,this,true);
+    p.subscribe('rowsPerPageChange', this.rebuild,this,true);
+    p.subscribe('pageLinkClassChange', this.rebuild,this,true);
+    p.subscribe('currentPageClassChange', this.rebuild,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
 
-                    // Unselect this cell towards the left
-                    if(tdIndex > 0) {
-                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                    }
-                    // Unselect this cell towards the last cell of the previous row
-                    else {
-                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
-                    }
-                }
-                // Selecting towards the anchor
-                else if(anchorPos > 0) {
-                    // Select the next cell to the left
-                    if(tdIndex > 0) {
-                        newSelectedEl = allRows[trIndex].cells[tdIndex-1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                    // Select the last cell of the previous row
-                    else if(trIndex > 0){
-                        newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
-                        oSelf.selectCell(newSelectedEl);
-                    }
-                }
-                // Anchor is on this row
-                else {
-                    // Selecting away from anchor cell
-                    if(anchorEl.yuiCellIndex >= tdIndex) {
-                        // Select the next cell to the left
-                        if(tdIndex > 0) {
-                            newSelectedEl = allRows[trIndex].cells[tdIndex-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                        // Select the last cell of the previous row
-                        else if(trIndex > 0){
-                            newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
-                            oSelf.selectCell(newSelectedEl);
-                        }
-                    }
-                    // Unselecting towards anchor cell
-                    else {
-                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+    //TODO: Make this work
+    p.subscribe('pageLinksContainerClassChange', this.rebuild,this,true);
+};
 
-                        // Unselect this cell towards the left
-                        if(tdIndex > 0) {
-                            oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
-                        }
-                        // Unselect this cell towards the last cell of the previous row
-                        else {
-                            oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
-                        }
-                    }
-                }
-            }
-        }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // Simple single cell selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
-            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
-            tdIndex = lastSelectedEl.yuiCellIndex;
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.PageLinks.init = function (p) {
 
-            // Arrow down
-            if(nKey == 40) {
-                oSelf.unselectAllCells();
+    /**
+     * CSS class assigned to each page link/span.
+     * @attribute pageLinkClass
+     * @default 'yui-pg-page'
+     */
+    p.setAttributeConfig('pageLinkClass', {
+        value : 'yui-pg-page',
+        validator : l.isString
+    });
 
-                // Select the next cell down
-                if(trIndex < allRows.length-1) {
-                    newSelectedEl = allRows[trIndex+1].cells[tdIndex];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the bottom cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+    /**
+     * CSS class assigned to the current page span.
+     * @attribute currentPageClass
+     * @default 'yui-pg-current-page'
+     */
+    p.setAttributeConfig('currentPageClass', {
+        value : 'yui-pg-current-page',
+        validator : l.isString
+    });
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                oSelf.unselectAllCells();
+    /**
+     * CSS class assigned to the span containing the page links.
+     * @attribute pageLinksContainerClass
+     * @default 'yui-pg-pages'
+     */
+    p.setAttributeConfig('pageLinksContainerClass', {
+        value : 'yui-pg-pages',
+        validator : l.isString
+    });
 
-                // Select the next cell up
-                if(trIndex > 0) {
-                    newSelectedEl = allRows[trIndex-1].cells[tdIndex];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the top cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+    /**
+     * Maximum number of page links to display at one time.
+     * @attribute pageLinks
+     * @default 10
+     */
+    p.setAttributeConfig('pageLinks', {
+        value : 10,
+        validator : l.isNumber
+    });
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                oSelf.unselectAllCells();
+    /**
+     * Function used generate the innerHTML for each page link/span.  The
+     * function receives as parameters the page number and a reference to the
+     * paginator object.
+     * @attribute pageLabelBuilder
+     * @default function (page, paginator) { return page; }
+     */
+    p.setAttributeConfig('pageLabelBuilder', {
+        value : function (page, paginator) { return page; },
+        validator : l.isFunction
+    });
+};
 
-                // Select the next cell to the right
-                if(tdIndex < lastSelectedEl.parentNode.cells.length-1) {
-                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex+1];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the right cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+/**
+ * Calculates start and end page numbers given a current page, attempting
+ * to keep the current page in the middle
+ * @static
+ * @method calculateRange
+ * @param {int} currentPage  The current page
+ * @param {int} totalPages   (optional) Maximum number of pages
+ * @param {int} numPages     (optional) Preferred number of pages in range
+ * @return {Array} [start_page_number, end_page_number]
+ */
+ui.PageLinks.calculateRange = function (currentPage,totalPages,numPages) {
+    var UNLIMITED = Paginator.VALUE_UNLIMITED,
+        start, end, delta;
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                oSelf.unselectAllCells();
+    if (!currentPage) {
+        return null;
+    }
 
-                // Select the next cell to the left
-                if(tdIndex > 0) {
-                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex-1];
-                    oSelf.selectCell(newSelectedEl);
-                }
-                // Select only the left cell
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectCell(newSelectedEl);
-                }
+    // Either has no pages, or unlimited pages.  Show none.
+    if (numPages === 0 || totalPages === 0 ||
+        (totalPages === UNLIMITED && numPages === UNLIMITED)) {
+        return [0,-1];
+    }
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-        }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // SHIFT row selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else if(bSHIFT && (sMode != "single")) {
-            trIndex = lastSelectedEl.sectionRowIndex;
+    // Limit requested pageLinks if there are fewer totalPages
+    if (totalPages !== UNLIMITED) {
+        numPages = numPages === UNLIMITED ?
+                    totalPages :
+                    Math.min(numPages,totalPages);
+    }
 
-            if(anchorEl.sectionRowIndex > trIndex) {
-                anchorPos = 1;
-            }
-            else if(anchorEl.sectionRowIndex < trIndex) {
-                anchorPos = -1;
-            }
-            else {
-                anchorPos = 0;
-            }
+    // Determine start and end, trying to keep current in the middle
+    start = Math.max(1,Math.ceil(currentPage - (numPages/2)));
+    if (totalPages === UNLIMITED) {
+        end = start + numPages - 1;
+    } else {
+        end = Math.min(totalPages, start + numPages - 1);
+    }
 
-            // Arrow down
-            if(nKey == 40) {
-                // Selecting away from anchor row
-                if(anchorPos <= 0) {
-                    // Select the next row down
-                    if(trIndex < allRows.length-1) {
-                        oSelf.selectRow(trIndex+1);
-                    }
-                }
-                // Unselecting toward anchor row
-                else {
-                    // Unselect this row towards the anchor row down
-                    oSelf.unselectRow(lastSelectedEl);
-                    oSelf._sLastSelectedId = allRows[trIndex+1].id;
-                }
+    // Adjust the start index when approaching the last page
+    delta = numPages - (end - start + 1);
+    start = Math.max(1, start - delta);
 
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                // Selecting away from anchor row
-                if(anchorPos >= 0) {
-                    // Select the next row up
-                    if(trIndex > 0) {
-                        oSelf.selectRow(trIndex-1);
-                    }
-                }
-                // Unselect this row towards the anchor row up
-                else {
-                    oSelf.unselectRow(lastSelectedEl);
-                    oSelf._sLastSelectedId = allRows[trIndex-1].id;
+    return [start,end];
+};
+
+
+ui.PageLinks.prototype = {
+
+    /**
+     * Current page
+     * @property current
+     * @type number
+     * @private
+     */
+    current     : null,
+
+    /**
+     * Span node containing the page links
+     * @property container
+     * @type HTMLElement
+     * @private
+     */
+    container   : null,
+
+
+    /**
+     * Generate the nodes and return the container node containing page links
+     * appropriate to the current pagination state.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        var p = this.paginator;
+
+        // Set up container
+        this.container = document.createElement('span');
+        this.container.id        = id_base + '-pages';
+        this.container.className = p.get('pageLinksContainerClass');
+        YAHOO.util.Event.on(this.container,'click',this.onClick,this,true);
+
+        // Call update, flagging a need to rebuild
+        this.update({newValue : null, rebuild : true});
+
+        return this.container;
+    },
+
+    /**
+     * Update the links if appropriate
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
+
+        var p           = this.paginator,
+            currentPage = p.getCurrentPage();
+
+        // Replace content if there's been a change
+        if (this.current !== currentPage || e.rebuild) {
+            var labelBuilder = p.get('pageLabelBuilder'),
+                range        = ui.PageLinks.calculateRange(
+                                currentPage,
+                                p.getTotalPages(),
+                                p.get('pageLinks')),
+                start        = range[0],
+                end          = range[1],
+                content      = '',
+                linkTemplate,i;
+
+            linkTemplate = '<a href="#" class="' + p.get('pageLinkClass') +
+                           '" page="';
+            for (i = start; i <= end; ++i) {
+                if (i === currentPage) {
+                    content +=
+                        '<span class="' + p.get('currentPageClass') + ' ' +
+                                          p.get('pageLinkClass') + '">' +
+                        labelBuilder(i,p) + '</span>';
+                } else {
+                    content +=
+                        linkTemplate + i + '">' + labelBuilder(i,p) + '</a>';
                 }
             }
-            // Arrow right
-            else if(nKey == 39) {
-                // Do nothing
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Do nothing
-            }
+
+            this.container.innerHTML = content;
         }
-        ////////////////////////////////////////////////////////////////////////
-        //
-        // Simple single row selection
-        //
-        ////////////////////////////////////////////////////////////////////////
-        else {
-            trIndex = lastSelectedEl.sectionRowIndex;
+    },
 
-            // Arrow down
-            if(nKey == 40) {
-                oSelf.unselectAllRows();
+    /**
+     * Force a rebuild of the page links.
+     * @method rebuild
+     * @param e {CustomEvent} The calling change event
+     */
+    rebuild     : function (e) {
+        e.rebuild = true;
+        this.update(e);
+    },
 
-                // Select the next row
-                if(trIndex < allRows.length-1) {
-                    newSelectedEl = allRows[trIndex+1];
-                    oSelf.selectRow(newSelectedEl);
-                }
-                // Select only the last row
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectRow(lastSelectedEl);
-                }
+    /**
+     * Removes the onClick listener from the container in preparation for
+     * content removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.container,true);
+    },
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow up
-            else if(nKey == 38) {
-                oSelf.unselectAllRows();
+    /**
+     * Listener for the container's onclick event.  Looks for qualifying link
+     * clicks, and pulls the page number from the link's page attribute.
+     * Sends link's page attribute to the Paginator's setPage method.
+     * @method onClick
+     * @param e {DOMEvent} The click event
+     */
+    onClick : function (e) {
+        var t = YAHOO.util.Event.getTarget(e);
+        if (t && YAHOO.util.Dom.hasClass(t,
+                        this.paginator.get('pageLinkClass'))) {
 
-                // Select the previous row
-                if(trIndex > 0) {
-                    newSelectedEl = allRows[trIndex-1];
-                    oSelf.selectRow(newSelectedEl);
-                }
-                // Select only the first row
-                else {
-                    newSelectedEl = lastSelectedEl;
-                    oSelf.selectRow(newSelectedEl);
-                }
+            YAHOO.util.Event.stopEvent(e);
 
-                oSelf._sSelectionAnchorId = newSelectedEl.id;
-            }
-            // Arrow right
-            else if(nKey == 39) {
-                // Do nothing
-            }
-            // Arrow left
-            else if(nKey == 37) {
-                // Do nothing
-            }
+            this.paginator.setPage(parseInt(t.getAttribute('page'),10));
         }
     }
+
 };
 
+
 /**
- * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
+ * ui Component to generate the rows-per-page dropdown
  *
- * @method _onTableKeypress
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class RowsPerPageDropdown
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
  */
-YAHOO.widget.DataTable.prototype._onTableKeypress = function(e, oSelf) {
-    var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
-    if(isMac) {
-        var nKey = YAHOO.util.Event.getCharCode(e);
-        // arrow down
-        if(nKey == 40) {
-            YAHOO.util.Event.stopEvent(e);
-        }
-        // arrow up
-        else if(nKey == 38) {
-            YAHOO.util.Event.stopEvent(e);
-        }
-    }
-};
+ui.RowsPerPageDropdown = function (p) {
+    this.paginator = p;
 
-/**
- * Handles click events on the THEAD element.
- *
- * @method _onTheadClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onTheadClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+    p.createEvent('rowsPerPageOptionsChange');
+    p.createEvent('rowsPerPageDropdownClassChange');
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    p.subscribe('rowsPerPageChange',this.update,this,true);
+    p.subscribe('rowsPerPageOptionsChange',this.rebuild,this,true);
+    p.subscribe('beforeDestroy',this.destroy,this,true);
 
-    while(elTarget && (elTag != "thead")) {
-            switch(elTag) {
-                case "body":
-                    break;
-                case "span":
-                    if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
-                        oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
-                    }
-                    break;
-                case "th":
-                    oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
-                    break;
-                case "tr":
-                    oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
-                    break;
-                default:
-                    break;
-            }
-            elTarget = elTarget.parentNode;
-            if(elTarget) {
-                elTag = elTarget.tagName.toLowerCase();
-            }
-    }
-    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+    // TODO: make this work
+    p.subscribe('rowsPerPageDropdownClassChange',this.rebuild,this,true);
 };
 
 /**
- * Handles click events on the primary TBODY element.
- *
- * @method _onTbodyClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
  */
-YAHOO.widget.DataTable.prototype._onTbodyClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.RowsPerPageDropdown.init = function (p) {
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    /**
+     * Array of available rows-per-page sizes.  Converted into select options.
+     * Array values may be positive integers or object literals in the form<br>
+     * { value : NUMBER, text : STRING }
+     * @attribute rowsPerPageOptions
+     * @default []
+     */
+    p.setAttributeConfig('rowsPerPageOptions', {
+        value : [],
+        validator : l.isArray
+    });
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                break;
-            case "input":
-                if(elTarget.type.toLowerCase() == "checkbox") {
-                    oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
-                }
-                else if(elTarget.type.toLowerCase() == "radio") {
-                    oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
-                }
-                break;
-            case "a":
-                oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
-                break;
-            case "button":
-                oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
-                break;
-            case "td":
-                oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
-                break;
-            case "tr":
-                oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
-                break;
-            default:
-                break;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-    }
-    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+    /**
+     * CSS class assigned to the select node
+     * @attribute rowsPerPageDropdownClass
+     * @default 'yui-pg-rpp-options'
+     */
+    p.setAttributeConfig('rowsPerPageDropdownClass', {
+        value : 'yui-pg-rpp-options',
+        validator : l.isString
+    });
 };
 
-/*TODO: delete
- * Handles keyup events on the TBODY. Executes deletion.
- *
- * @method _onTbodyKeyup
- * @param e {HTMLEvent} The key event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-/*YAHOO.widget.DataTable.prototype._onTbodyKeyup = function(e, oSelf) {
-   var nKey = YAHOO.util.Event.getCharCode(e);
-    // delete
-    if(nKey == 46) {//TODO: if something is selected
-        //TODO: delete row
-    }
-};*/
-
-/**
- * Handles click events on paginator links.
- *
- * @method _onPaginatorLinkClick
- * @param e {HTMLEvent} The click event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onPaginatorLinkClick = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var elTag = elTarget.tagName.toLowerCase();
+ui.RowsPerPageDropdown.prototype = {
 
-    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
-        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
-    }
+    /**
+     * select node
+     * @property select
+     * @type HTMLElement
+     * @private
+     */
+    select  : null,
 
-    while(elTarget && (elTag != "table")) {
-        switch(elTag) {
-            case "body":
-                return;
-            case "a":
-                YAHOO.util.Event.stopEvent(e);
-                //TODO: after the showPage call, figure out which link
-                //TODO: was clicked and reset focus to the new version of it
-                switch(elTarget.className) {
-                    case YAHOO.widget.DataTable.CLASS_PAGE:
-                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_FIRST:
-                        oSelf.showPage(1);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_LAST:
-                        oSelf.showPage(oSelf.get("paginator").totalPages);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_PREVIOUS:
-                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
-                        return;
-                    case YAHOO.widget.DataTable.CLASS_NEXT:
-                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
-                        return;
-                }
-                break;
-            default:
-                return;
-        }
-        elTarget = elTarget.parentNode;
-        if(elTarget) {
-            elTag = elTarget.tagName.toLowerCase();
-        }
-        else {
-            return;
-        }
-    }
-};
 
-/**
* Handles change events on paginator SELECT element.
- *
- * @method _onPaginatorDropdownChange
- * @param e {HTMLEvent} The change event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    var newValue = elTarget[elTarget.selectedIndex].value;
+    /**
    * Generate the select and option nodes and returns the select node.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        this.select = document.createElement('select');
+        this.select.id        = id_base + '-rpp';
+        this.select.className = this.paginator.get('rowsPerPageDropdownClass');
+        this.select.title = 'Rows per page';
 
-    var newRowsPerPage = YAHOO.lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
-    if(newRowsPerPage !== null) {
-        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
-        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
-        oSelf.refreshView();
-    }
-    else {
-    }
-};
+        YAHOO.util.Event.on(this.select,'change',this.onChange,this,true);
 
-/**
- * Handles change events on SELECT elements within DataTable.
- *
- * @method _onDropdownChange
- * @param e {HTMLEvent} The change event.
- * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onDropdownChange = function(e, oSelf) {
-    var elTarget = YAHOO.util.Event.getTarget(e);
-    //TODO: pass what args?
-    //var value = elTarget[elTarget.selectedIndex].value;
-    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
-};
+        this.rebuild();
 
+        return this.select;
+    },
 
+    /**
+     * Select the appropriate option if changed.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
+        var rpp     = this.paginator.get('rowsPerPage'),
+            options = this.select.options,
+            i,len;
 
+        for (i = 0, len = options.length; i < len; ++i) {
+            if (parseInt(options[i].value,10) === rpp) {
+                options[i].selected = true;
+            }
+        }
+    },
 
 
+    /**
+     * (Re)generate the select options.
+     * @method rebuild
+     */
+    rebuild : function (e) {
+        var p       = this.paginator,
+            sel     = this.select,
+            options = p.get('rowsPerPageOptions'),
+            opt_tem = document.createElement('option'),
+            i,len;
 
+        while (sel.firstChild) {
+            sel.removeChild(sel.firstChild);
+        }
 
+        for (i = 0, len = options.length; i < len; ++i) {
+            var node = opt_tem.cloneNode(false),
+                opt  = options[i];
+            node.value = l.isValue(opt.value) ? opt.value : opt;
+            node.innerHTML = l.isValue(opt.text) ? opt.text : opt;
+            sel.appendChild(node);
+        }
 
+        this.update();
+    },
 
+    /**
+     * Removes the onChange listener from the select in preparation for content
+     * removal.
+     * @method destroy
+     * @private
+     */
+    destroy : function () {
+        YAHOO.util.Event.purgeElement(this.select);
+    },
 
+    /**
+     * Listener for the select's onchange event.  Sent to setRowsPerPage method.
+     * @method onChange
+     * @param e {DOMEvent} The change event
+     */
+    onChange : function (e) {
+        this.paginator.setRowsPerPage(
+                parseInt(this.select.options[this.select.selectedIndex].value,10));
+    }
+};
 
 
 
+/**
+ * ui Component to generate the textual report of current pagination status.
+ * E.g. "Now viewing page 1 of 13".
+ *
+ * @namespace YAHOO.widget.Paginator.ui
+ * @class CurrentPageReport
+ * @for YAHOO.widget.Paginator
+ *
+ * @constructor
+ * @param p {Pagintor} Paginator instance to attach to
+ */
+ui.CurrentPageReport = function (p) {
+    this.paginator = p;
 
+    p.createEvent('pageReportClassChange');
+    p.createEvent('pageReportTemplateChange');
 
+    p.subscribe('recordOffsetChange',this.update,this,true);
+    p.subscribe('totalRecordsChange',this.update,this,true);
+    p.subscribe('rowsPerPageChange', this.update,this,true);
+    p.subscribe('pageReportTemplateChange', this.update,this,true);
 
+    //TODO: make this work
+    p.subscribe('pageReportClassChange', this.update,this,true);
+};
 
+/**
+ * Decorates Paginator instances with new attributes. Called during
+ * Paginator instantiation.
+ * @method init
+ * @param p {Paginator} Paginator instance to decorate
+ * @static
+ */
+ui.CurrentPageReport.init = function (p) {
 
+    /**
+     * CSS class assigned to the span containing the info.
+     * @attribute pageReportClass
+     * @default 'yui-pg-current'
+     */
+    p.setAttributeConfig('pageReportClass', {
+        value : 'yui-pg-current',
+        validator : l.isString
+    });
 
+    /**
+     * Used as innerHTML for the span.  Place holders in the form of {name}
+     * will be replaced with the so named value from the key:value map
+     * generated by the function held in the pageReportValueGenerator attribute.
+     * @attribute pageReportTemplate
+     * @default '({currentPage} of {totalPages})'
+     * @see pageReportValueGenerator attribute
+     */
+    p.setAttributeConfig('pageReportTemplate', {
+        value : '({currentPage} of {totalPages})',
+        validator : l.isString
+    });
 
+    /**
+     * Function to generate the value map used to populate the
+     * pageReportTemplate.  The function is passed the Paginator instance as a
+     * parameter.  The default function returns a map with the following keys:
+     * <ul>
+     * <li>currentPage</li>
+     * <li>totalPages</li>
+     * <li>startIndex</li>
+     * <li>endIndex</li>
+     * <li>startRecord</li>
+     * <li>endRecord</li>
+     * <li>totalRecords</li>
+     * </ul>
+     * @attribute pageReportValueGenarator
+     */
+    p.setAttributeConfig('pageReportValueGenerator', {
+        value : function (paginator) {
+            var curPage = paginator.getCurrentPage(),
+                records = paginator.getPageRecords(curPage);
+
+            return {
+                'currentPage' : curPage,
+                'totalPages'  : paginator.getTotalPages(),
+                'startIndex'  : records[0],
+                'endIndex'    : records[1],
+                'startRecord' : records[0] + 1,
+                'endRecord'   : records[1] + 1,
+                'totalRecords': paginator.get('totalRecords')
+            };
+        },
+        validator : l.isFunction
+    });
+};
 
+/**
+ * Replace place holders in a string with the named values found in an
+ * object literal.
+ * @static
+ * @method sprintf
+ * @param template {string} The content string containing place holders
+ * @param values {object} The key:value pairs used to replace the place holders
+ * @return {string}
+ */
+ui.CurrentPageReport.sprintf = function (template, values) {
+    return template.replace(/{([\w\s\-]+)}/g, function (x,key) {
+            return (key in values) ? values[key] : '';
+        });
+};
 
+ui.CurrentPageReport.prototype = {
 
+    /**
+     * Span node containing the formatted info
+     * @property span
+     * @type HTMLElement
+     * @private
+     */
+    span : null,
 
 
+    /**
+     * Generate the span containing info formatted per the pageReportTemplate
+     * attribute.
+     * @method render
+     * @param id_base {string} used to create unique ids for generated nodes
+     * @return {HTMLElement}
+     */
+    render : function (id_base) {
+        this.span = document.createElement('span');
+        this.span.id        = id_base + '-page-report';
+        this.span.className = this.paginator.get('pageReportClass');
+        this.update();
+        
+        return this.span;
+    },
+    
+    /**
+     * Regenerate the content of the span if appropriate. Calls
+     * CurrentPageReport.sprintf with the value of the pageReportTemplate
+     * attribute and the value map returned from pageReportValueGenerator
+     * function.
+     * @method update
+     * @param e {CustomEvent} The calling change event
+     */
+    update : function (e) {
+        if (e && e.prevValue === e.newValue) {
+            return;
+        }
 
 
+        this.span.innerHTML = ui.CurrentPageReport.sprintf(
+            this.paginator.get('pageReportTemplate'),
+            this.paginator.get('pageReportValueGenerator')(this.paginator));
+    }
+};
 
+})();
 
+/**
+ * The DataTable widget provides a progressively enhanced DHTML control for
+ * displaying tabular data across A-grade browsers.
+ *
+ * @module datatable
+ * @requires yahoo, dom, event, element, datasource
+ * @optional connection, dragdrop
+ * @title DataTable Widget
+ * @beta
+ */
 
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
 
+/**
+ * DataTable class for the YUI DataTable widget.
+ *
+ * @namespace YAHOO.widget
+ * @class DataTable
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param elContainer {HTMLElement} Container element for the TABLE.
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param oConfigs {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
+    var DT = YAHOO.widget.DataTable,
+        DS = YAHOO.util.DataSource;
 
+    // Internal vars
+    this._nIndex = DT._nCount;
+    this._sId = "yui-dt"+this._nIndex;
+    this._oChain = new YAHOO.util.Chain();
 
+    // Initialize configs
+    this._initConfigs(oConfigs);
 
+    // Initialize DataSource
+    this._initDataSource(oDataSource);
+    if(!this._oDataSource) {
+        return;
+    }
 
+    // Initialize ColumnSet
+    this._initColumnSet(aColumnDefs);
+    if(!this._oColumnSet) {
+        return;
+    }
 
+    // Initialize RecordSet
+    this._initRecordSet();
+    if(!this._oRecordSet) {
+        return;
+    }
 
+    // Initialize node templates
+    this._initNodeTemplates();
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+    // Initialize container element
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        return;
+    }
 
+    // Initialize the rest of the DOM elements
+    this._initTableEl();
+    if(!this._elContainer || !this._elThead || !this._elTbody) {
+        return;
+    }
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+    // Call Element's constructor after DOM elements are created
+    // but *before* table is populated with data
+    DT.superclass.constructor.call(this, this._elContainer, this._oConfigs);
 
-// OBJECT ACCESSORS
-
-/**
- * Public accessor to the unique name of the DataSource instance.
- *
- * @method toString
- * @return {String} Unique name of the DataSource instance.
- */
+    // HACK: Set sortedBy values for backward compatibility
+    var oSortedBy = this.get("sortedBy");
+    if(oSortedBy) {
+        if(oSortedBy.dir == "desc") {
+            this._configs.sortedBy.value.dir = DT.CLASS_DESC;
+        }
+        else if(oSortedBy.dir == "asc") {
+            this._configs.sortedBy.value.dir = DT.CLASS_ASC;
+        }
+    }
 
-YAHOO.widget.DataTable.prototype.toString = function() {
-    return "DataTable " + this._sName;
-};
+    //HACK: Set the paginator values.  Attribute doesn't afford for merging
+    // obj value's keys.  It's all or nothing.  Merge in provided keys.
+    if(this._oConfigs.paginator && !(this._oConfigs.paginator instanceof YAHOO.widget.Paginator)) {
+        // Backward compatibility
+        this.updatePaginator(this._oConfigs.paginator);
+    }
 
-/**
- * Returns the DataTable instance's DataSource instance.
- *
- * @method getDataSource
- * @return {YAHOO.util.DataSource} DataSource instance.
- */
-YAHOO.widget.DataTable.prototype.getDataSource = function() {
-    return this._oDataSource;
-};
+    // Initialize inline Cell editing
+    this._initCellEditorEl();
+    
+    // Initialize Column sort
+    this._initColumnSort();
 
-/**
- * Returns the DataTable instance's ColumnSet instance.
- *
- * @method getColumnSet
- * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
- */
-YAHOO.widget.DataTable.prototype.getColumnSet = function() {
-    return this._oColumnSet;
-};
+    // Once per instance
+    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
 
-/**
- * Returns the DataTable instance's RecordSet instance.
- *
- * @method getRecordSet
- * @return {YAHOO.widget.RecordSet} RecordSet instance.
- */
-YAHOO.widget.DataTable.prototype.getRecordSet = function() {
-    return this._oRecordSet;
+    DT._nCount++;
+    DT._nCurrentCount++;
+    
+    // Send a simple initial request
+    var oCallback = {
+        success : this.onDataReturnSetRecords,
+        failure : this.onDataReturnSetRecords,
+        scope   : this,
+        argument: {}
+    };
+    if(this.get("initialLoad") === true) {
+        this._oDataSource.sendRequest(this.get("initialRequest"), oCallback);
+    }
+    // Do not send an initial request at all
+    else if(this.get("initialLoad") === false) {
+        this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId && this._bInit) {
+                    this._bInit = false;
+                    this.fireEvent("initEvent");
+                }
+            },
+            scope: this
+        });
+        this._oChain.run();
+    }
+    // Send an initial request with a custom payload
+    else {
+        var oCustom = this.get("initialLoad");
+        oCallback.argument = oCustom.argument;
+        this._oDataSource.sendRequest(oCustom.request, oCallback);
+    }
 };
 
-/**
- * Returns the DataTable instance's Cell Editor as an object literal with the
- * following properties:
- * <dl>
- * <dt>cell</dt>
- * <dd>Cell element being edited</dd>
- *
- * <dt>column</dt>
- * <dd>Associated Column instance</dd>
- *
- * <dt>container</dt>
- * <dd>Reference to editor's container DIV element</dd>
- *
- * <dt>isActive</dt>
- * <dd>True if cell is currently being edited</dd>
- *
- * <dt>record</dt>
- * <dd>Associated Record instance</dd>
- *
- * <dt>validator</dt>
- * <dd>Associated validator function</dd>
- *
- * <dt>value</dt>
- * <dd>Current input value</dd>
- * </dl>
- *
- *
- *
- *
- *
- *
- * @method getCellEditor
- * @return {Object} Cell Editor object literal values.
- */
-YAHOO.widget.DataTable.prototype.getCellEditor = function() {
-    return this._oCellEditor;
-};
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+(function () {
 
+var lang   = YAHOO.lang,
+    util   = YAHOO.util,
+    widget = YAHOO.widget,
+    ua     = YAHOO.env.ua,
+    
+    Dom    = util.Dom,
+    Ev     = util.Event,
+    DS     = util.DataSource,
+    DT     = widget.DataTable,
+    Pag    = widget.Paginator;
+    
 
+    
 
+lang.augmentObject(DT, {
 
+    /**
+     * Class name assigned to liner DIV elements.
+     *
+     * @property DataTable.CLASS_LINER
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-liner"
+     */
+    CLASS_LINER : "yui-dt-liner",
 
+    /**
+     * Class name assigned to display label elements.
+     *
+     * @property DataTable.CLASS_LABEL
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-label"
+     */
+    CLASS_LABEL : "yui-dt-label",
 
+    /**
+     * Class name assigned to Column drag target.
+     *
+     * @property DataTable.CLASS_COLTARGET
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-coltarget"
+     */
+    CLASS_COLTARGET : "yui-dt-coltarget",
 
+    /**
+     * Class name assigned to resizer handle elements.
+     *
+     * @property DataTable.CLASS_RESIZER
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizer"
+     */
+    CLASS_RESIZER : "yui-dt-resizer",
 
+    /**
+     * Class name assigned to resizer proxy elements.
+     *
+     * @property DataTable.CLASS_RESIZERPROXY
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizerproxy"
+     */
+    CLASS_RESIZERPROXY : "yui-dt-resizerproxy",
 
+    /**
+     * Class name assigned to Editor container elements.
+     *
+     * @property DataTable.CLASS_EDITOR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-editor"
+     */
+    CLASS_EDITOR : "yui-dt-editor",
 
+    /**
+     * Class name assigned to paginator container elements.
+     *
+     * @property DataTable.CLASS_PAGINATOR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-paginator"
+     */
+    CLASS_PAGINATOR : "yui-dt-paginator",
 
+    /**
+     * Class name assigned to page number indicators.
+     *
+     * @property DataTable.CLASS_PAGE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-page"
+     */
+    CLASS_PAGE : "yui-dt-page",
 
+    /**
+     * Class name assigned to default indicators.
+     *
+     * @property DataTable.CLASS_DEFAULT
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-default"
+     */
+    CLASS_DEFAULT : "yui-dt-default",
 
+    /**
+     * Class name assigned to previous indicators.
+     *
+     * @property DataTable.CLASS_PREVIOUS
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-previous"
+     */
+    CLASS_PREVIOUS : "yui-dt-previous",
 
+    /**
+     * Class name assigned next indicators.
+     *
+     * @property DataTable.CLASS_NEXT
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-next"
+     */
+    CLASS_NEXT : "yui-dt-next",
 
+    /**
+     * Class name assigned to first elements.
+     *
+     * @property DataTable.CLASS_FIRST
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-first"
+     */
+    CLASS_FIRST : "yui-dt-first",
 
+    /**
+     * Class name assigned to last elements.
+     *
+     * @property DataTable.CLASS_LAST
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-last"
+     */
+    CLASS_LAST : "yui-dt-last",
 
+    /**
+     * Class name assigned to even elements.
+     *
+     * @property DataTable.CLASS_EVEN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-even"
+     */
+    CLASS_EVEN : "yui-dt-even",
 
+    /**
+     * Class name assigned to odd elements.
+     *
+     * @property DataTable.CLASS_ODD
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-odd"
+     */
+    CLASS_ODD : "yui-dt-odd",
 
+    /**
+     * Class name assigned to selected elements.
+     *
+     * @property DataTable.CLASS_SELECTED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-selected"
+     */
+    CLASS_SELECTED : "yui-dt-selected",
 
+    /**
+     * Class name assigned to highlighted elements.
+     *
+     * @property DataTable.CLASS_HIGHLIGHTED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-highlighted"
+     */
+    CLASS_HIGHLIGHTED : "yui-dt-highlighted",
 
+    /**
+     * Class name assigned to hidden elements.
+     *
+     * @property DataTable.CLASS_HIDDEN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-hidden"
+     */
+    CLASS_HIDDEN : "yui-dt-hidden",
 
+    /**
+     * Class name assigned to disabled elements.
+     *
+     * @property DataTable.CLASS_DISABLED
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-disabled"
+     */
+    CLASS_DISABLED : "yui-dt-disabled",
 
+    /**
+     * Class name assigned to empty indicators.
+     *
+     * @property DataTable.CLASS_EMPTY
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-empty"
+     */
+    CLASS_EMPTY : "yui-dt-empty",
 
+    /**
+     * Class name assigned to loading indicatorx.
+     *
+     * @property DataTable.CLASS_LOADING
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-loading"
+     */
+    CLASS_LOADING : "yui-dt-loading",
 
+    /**
+     * Class name assigned to error indicators.
+     *
+     * @property DataTable.CLASS_ERROR
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-error"
+     */
+    CLASS_ERROR : "yui-dt-error",
 
+    /**
+     * Class name assigned to editable elements.
+     *
+     * @property DataTable.CLASS_EDITABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-editable"
+     */
+    CLASS_EDITABLE : "yui-dt-editable",
 
+    /**
+     * Class name assigned to draggable elements.
+     *
+     * @property DataTable.CLASS_DRAGGABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-draggable"
+     */
+    CLASS_DRAGGABLE : "yui-dt-draggable",
 
+    /**
+     * Class name assigned to resizeable elements.
+     *
+     * @property DataTable.CLASS_RESIZEABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-resizeable"
+     */
+    CLASS_RESIZEABLE : "yui-dt-resizeable",
 
+    /**
+     * Class name assigned to scrollable elements.
+     *
+     * @property DataTable.CLASS_SCROLLABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-scrollable"
+     */
+    CLASS_SCROLLABLE : "yui-dt-scrollable",
 
+    /**
+     * Class name assigned to sortable elements.
+     *
+     * @property DataTable.CLASS_SORTABLE
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-sortable"
+     */
+    CLASS_SORTABLE : "yui-dt-sortable",
 
+    /**
+     * Class name assigned to ascending elements.
+     *
+     * @property DataTable.CLASS_ASC
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-asc"
+     */
+    CLASS_ASC : "yui-dt-asc",
 
+    /**
+     * Class name assigned to descending elements.
+     *
+     * @property DataTable.CLASS_DESC
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-desc"
+     */
+    CLASS_DESC : "yui-dt-desc",
 
+    /**
+     * Class name assigned to BUTTON elements and/or container elements.
+     *
+     * @property DataTable.CLASS_BUTTON
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-button"
+     */
+    CLASS_BUTTON : "yui-dt-button",
 
+    /**
+     * Class name assigned to INPUT TYPE=CHECKBOX elements and/or container elements.
+     *
+     * @property DataTable.CLASS_CHECKBOX
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-checkbox"
+     */
+    CLASS_CHECKBOX : "yui-dt-checkbox",
 
+    /**
+     * Class name assigned to SELECT elements and/or container elements.
+     *
+     * @property DataTable.CLASS_DROPDOWN
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-dropdown"
+     */
+    CLASS_DROPDOWN : "yui-dt-dropdown",
 
+    /**
+     * Class name assigned to INPUT TYPE=RADIO elements and/or container elements.
+     *
+     * @property DataTable.CLASS_RADIO
+     * @type String
+     * @static
+     * @final
+     * @default "yui-dt-radio"
+     */
+    CLASS_RADIO : "yui-dt-radio",
 
+    /**
+     * Message to display if DataTable has no data.
+     *
+     * @property DataTable.MSG_EMPTY
+     * @type String
+     * @static
+     * @final
+     * @default "No records found."
+     */
+    MSG_EMPTY : "No records found.",
 
+    /**
+     * Message to display while DataTable is loading data.
+     *
+     * @property DataTable.MSG_LOADING
+     * @type String
+     * @static
+     * @final
+     * @default "Loading data..."
+     */
+    MSG_LOADING : "Loading data...",
 
+    /**
+     * Message to display while DataTable has data error.
+     *
+     * @property DataTable.MSG_ERROR
+     * @type String
+     * @static
+     * @final
+     * @default "Data error."
+     */
+    MSG_ERROR : "Data error.",
 
+    /////////////////////////////////////////////////////////////////////////
+    //
+    // Private static variables
+    //
+    /////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Internal class variable for indexing multiple DataTable instances.
+     *
+     * @property DataTable._nCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCount : 0,
 
+    /**
+     * Internal class variable tracking current number of DataTable instances,
+     * so that certain class values can be reset when all instances are destroyed.          
+     *
+     * @property DataTable._nCurrentCount
+     * @type Number
+     * @private
+     * @static
+     */
+    _nCurrentCount : 0,
 
-// DOM ACCESSORS
+    /**
+     * Reference to STYLE node that is dynamically created and written to
+     * in order to manage Column widths.
+     *
+     * @property DataTable._elStylesheet
+     * @type HTMLElement
+     * @private
+     * @static     
+     */
+    _elStylesheet : null,
 
-/**
* Returns DOM reference to the DataTable's TABLE element.
- *
- * @method getTableEl
- * @return {HTMLElement} Reference to TABLE element.
- */
-YAHOO.widget.DataTable.prototype.getTableEl = function() {
-    return this._elTable;
-};
+    /**
    * Set to true if _elStylesheet cannot be populated due to browser incompatibility.
    *
+     * @property DataTable._bStylesheetFallback
+     * @type boolean
+     * @private
+     * @static     
+     */
+    _bStylesheetFallback : false,
 
-/**
* Returns DOM reference to the DataTable's THEAD element.
- *
- * @method getTheadEl
- * @return {HTMLElement} Reference to THEAD element.
- */
-YAHOO.widget.DataTable.prototype.getTheadEl = function() {
-    return this._elThead;
-};
+    /**
    * Object literal hash of Columns and their dynamically create style rules.
    *
+     * @property DataTable._oStylesheetRules
+     * @type Object
+     * @private
+     * @static     
+     */
+    _oStylesheetRules : {},
 
-/**
- * Returns DOM reference to the DataTable's primary TBODY element.
- *
- * @method getTbodyEl
- * @return {HTMLElement} Reference to TBODY element.
- */
-YAHOO.widget.DataTable.prototype.getTbodyEl = function() {
-    return this._elTbody;
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.getBody = function() {
-    return this.getTbodyEl();
-};
+    /**
+     * Element reference to shared Column drag target.
+     *
+     * @property DataTable._elColumnDragTarget
+     * @type HTMLElement
+     * @private
+     * @static 
+     */
+    _elColumnDragTarget : null,
 
-/**
- * Returns DOM reference to the DataTable's secondary TBODY element that is
- * used to display messages.
- *
- * @method getMsgTbodyEl
- * @return {HTMLElement} Reference to TBODY element.
- */
-YAHOO.widget.DataTable.prototype.getMsgTbodyEl = function() {
-    return this._elMsgTbody;
-};
+    /**
+     * Element reference to shared Column resizer proxy.
+     *
+     * @property DataTable._elColumnResizerProxy
+     * @type HTMLElement
+     * @private
+     * @static 
+     */
+    _elColumnResizerProxy : null,
 
-/**
- * Returns DOM reference to the TD element within the secondary TBODY that is
- * used to display messages.
- *
- * @method getMsgTdEl
- * @return {HTMLElement} Reference to TD element.
- */
-YAHOO.widget.DataTable.prototype.getMsgTdEl = function() {
-    return this._elMsgTd;
-};
-
-/**
- * Returns the corresponding TR reference for a given DOM element, ID string or
- * directly page row index. If the given identifier is a child of a TR element,
- * then DOM tree is traversed until a parent TR element is returned, otherwise
- * null.
- *
- * @method getTrEl
- * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
- * get: by element reference, ID string, page row index, or Record.
- * @return {HTMLElement} Reference to TR element, or null.
- */
-YAHOO.widget.DataTable.prototype.getTrEl = function(row) {
-    var allRows = this._elTbody.rows;
-    
-    // By Record
-    if(row instanceof YAHOO.widget.Record) {
-        var nTrIndex = this.getTrIndex(row);
-        return allRows[nTrIndex];
-    }
-    // By page row index
-    else if(YAHOO.lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
-        return allRows[row];
-    }
-    // By ID string or element reference
-    else {
-        var elRow;
-        var el = YAHOO.util.Dom.get(row);
+    /**
+     * Clones object literal or array of object literals.
+     *
+     * @method DataTable._cloneObject
+     * @param o {Object} Object.
+     * @private
+     * @static     
+     */
+    _cloneObject : function(o) {
+        if(lang.isUndefined(o)) {
+            return o;
+        }
         
-        // Validate HTML element
-        if(el && (el.ownerDocument == document)) {
-            // Validate TR element
-            if(el.tagName.toLowerCase() != "tr") {
-                // Traverse up the DOM to find the corresponding TR element
-                elRow = YAHOO.util.Dom.getAncestorByTagName(el,"tr");
-            }
-            else {
-                elRow = el;
+        var copy = {};
+        
+        if(lang.isArray(o)) {
+            var array = [];
+            for(var i=0,len=o.length;i<len;i++) {
+                array[i] = DT._cloneObject(o[i]);
             }
-
-            // Make sure the TR is in this TBODY
-            if(elRow && (elRow.parentNode == this._elTbody)) {
-                // Now we can return the TR element
-                return elRow;
+            copy = array;
+        }
+        else if(o.constructor == Object) { 
+            for (var x in o){
+                if(lang.hasOwnProperty(o, x)) {
+                    if(lang.isValue(o[x]) && (o[x].constructor == Object) || lang.isArray(o[x])) {
+                        copy[x] = DT._cloneObject(o[x]);
+                    }
+                    else {
+                        copy[x] = o[x];
+                    }
+                }
             }
         }
-    }
+        else {
+            copy = o;
+        }
     
-    return null;
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.getRow = function(index) {
-    return this.getTrEl(index);
-};
-
-/**
- * Returns DOM reference to the first TR element in the DataTable page, or null.
- *
- * @method getFirstTrEl
- * @return {HTMLElement} Reference to TR element.
- */
-YAHOO.widget.DataTable.prototype.getFirstTrEl = function() {
-    return this._elTbody.rows[0] || null;
-};
+        return copy;
+    },
 
-/**
- * Returns DOM reference to the last TR element in the DataTable page, or null.
- *
- * @method getLastTrEl
- * @return {HTMLElement} Reference to last TR element.
- */
-YAHOO.widget.DataTable.prototype.getLastTrEl = function() {
-    var allRows = this._elTbody.rows;
-        if(allRows.length > 0) {
-            return allRows[allRows.length-1] || null;
+    /**
+     * Creates HTML markup for shared Column drag target.
+     *
+     * @method DataTable._initColumnDragTargetEl
+     * @return {HTMLElement} Reference to Column drag target. 
+     * @private
+     * @static 
+     */
+    _initColumnDragTargetEl : function() {
+        if(!DT._elColumnDragTarget) {
+            // Attach Column drag target element as first child of body
+            var elColumnDragTarget = document.createElement('div');
+            elColumnDragTarget.id = "yui-dt-coltarget";
+            elColumnDragTarget.className = DT.CLASS_COLTARGET;
+            elColumnDragTarget.style.display = "none";
+            document.body.insertBefore(elColumnDragTarget, document.body.firstChild);
+
+            // Internal tracker of Column drag target
+            DT._elColumnDragTarget = elColumnDragTarget;
+            
         }
-};
+        return DT._elColumnDragTarget;
+    },
 
-/**
* Returns DOM reference to the given TD element.
- *
* @method getTdEl
* @param cell {HTMLElement | String} DOM element reference or string ID.
- * @return {HTMLElement} Reference to TD element.
- */
-YAHOO.widget.DataTable.prototype.getTdEl = function(cell) {
-    var elCell;
-    var el = YAHOO.util.Dom.get(cell);
+    /**
    * Creates HTML markup for shared Column resizer proxy.
    *
    * @method DataTable._initColumnResizerProxyEl
    * @return {HTMLElement} Reference to Column resizer proxy.
+     * @private 
+     * @static 
+     */
+    _initColumnResizerProxyEl : function() {
+        if(!DT._elColumnResizerProxy) {
 
-    // Validate HTML element
-    if(el && (el.ownerDocument == document)) {
-        // Validate TD element
-        if(el.tagName.toLowerCase() != "td") {
-            // Traverse up the DOM to find the corresponding TR element
-            elCell = YAHOO.util.Dom.getAncestorByTagName(el, "td");
-        }
-        else {
-            elCell = el;
-        }
+            // Attach Column resizer element as first child of body
+            var elColumnResizerProxy = document.createElement("div");
+            elColumnResizerProxy.id = "yui-dt-colresizerproxy";
+            Dom.addClass(elColumnResizerProxy, DT.CLASS_RESIZERPROXY);
+            document.body.insertBefore(elColumnResizerProxy, document.body.firstChild);
 
-        // Make sure the TD is in this TBODY
-        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
-            // Now we can return the TD element
-            return elCell;
+            // Internal tracker of Column resizer proxy
+            DT._elColumnResizerProxy = elColumnResizerProxy;
         }
-    }
-    
-    return null;
-};
+        return DT._elColumnResizerProxy;
+    },
 
-/**
- * Returns DOM reference to the TH element at given DataTable page coordinates, or null.
- *
- * @method getThEl
- * @param header {HTMLElement | String | YAHOO.widget.Column} DOM element
- * reference or string ID, or Column instance.
- * @return {HTMLElement} Reference to TH element.
- */
-YAHOO.widget.DataTable.prototype.getThEl = function(header) {
-    var elHeader;
-        
-    // Validate Column instance
-    if(header instanceof YAHOO.widget.Column) {
-        var oColumn = header;
-        elHeader = YAHOO.util.Dom.get(this.id + "-col" + oColumn.getId());
-        if(elHeader) {
-            return elHeader;
+    /**
+     * Outputs markup into the given TH based on given Column.
+     *
+     * @method DataTable.formatTheadCell
+     * @param elCellLabel {HTMLElement} The label DIV element within the TH liner.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oSelf {DT} DataTable instance.
+     * @static
+     */
+    formatTheadCell : function(elCellLabel, oColumn, oSelf) {
+        var sKey = oColumn.getKey();
+        var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey;
+
+        // Add accessibility link for sortable Columns
+        if(oColumn.sortable) {
+            // Calculate the direction
+            var sSortClass = oSelf.getColumnSortDir(oColumn);
+            var sSortDir = (sSortClass === DT.CLASS_DESC) ? "descending" : "ascending";
+
+            // Generate a unique HREF for visited status
+            var sHref = oSelf.getId() + "-sort" + oColumn.getId() + "-" + sSortDir;
+            
+            // Generate a dynamic TITLE for sort status
+            var sTitle = "Click to sort " + sSortDir;
+            
+            // Format the element
+            elCellLabel.innerHTML = "<a href=\"" + sHref + "\" title=\"" + sTitle + "\" class=\"" + DT.CLASS_SORTABLE + "\">" + sLabel + "</a>";
         }
-    }
-    // Validate HTML element
-    else {
-        var el = YAHOO.util.Dom.get(header);
+        // Just display the label for non-sortable Columns
+        else {
+            elCellLabel.innerHTML = sLabel;
+        }
+    },
 
-        if(el && (el.ownerDocument == document)) {
-            // Validate TH element
-            if(el.tagName.toLowerCase() != "th") {
-                // Traverse up the DOM to find the corresponding TR element
-                elHeader = YAHOO.util.Dom.getAncestorByTagName(el,"th");
-            }
-            else {
-                elHeader = el;
-            }
+    /**
+     * Formats a BUTTON element.
+     *
+     * @method DataTable.formatButton
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object | Boolean} Data value for the cell. By default, the value
+     * is what gets written to the BUTTON.
+     * @static
+     */
+    formatButton : function(el, oRecord, oColumn, oData) {
+        var sValue = lang.isValue(oData) ? oData : "Click";
+        //TODO: support YAHOO.widget.Button
+        //if(YAHOO.widget.Button) {
+
+        //}
+        //else {
+            el.innerHTML = "<button type=\"button\" class=\""+
+                    DT.CLASS_BUTTON + "\">" + sValue + "</button>";
+        //}
+    },
 
-            // Make sure the TH is in this THEAD
-            if(elHeader && (elHeader.parentNode.parentNode == this._elThead)) {
-                // Now we can return the TD element
-                return elHeader;
-            }
-        }
-    }
+    /**
+     * Formats a CHECKBOX element.
+     *
+     * @method DataTable.formatCheckbox
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object | Boolean} Data value for the cell. Can be a simple
+     * Boolean to indicate whether checkbox is checked or not. Can be object literal
+     * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
+     * formatter.
+     * @static
+     */
+    formatCheckbox : function(el, oRecord, oColumn, oData) {
+        var bChecked = oData;
+        bChecked = (bChecked) ? " checked" : "";
+        el.innerHTML = "<input type=\"checkbox\"" + bChecked +
+                " class=\"" + DT.CLASS_CHECKBOX + "\">";
+    },
 
-    return null;
-};
+    /**
+     * Formats currency. Default unit is USD.
+     *
+     * @method DataTable.formatCurrency
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Number} Data value for the cell.
+     * @static
+     */
+    formatCurrency : function(el, oRecord, oColumn, oData) {
+        el.innerHTML = util.Number.format(oData, {
+                prefix:"$",
+                decimalPlaces:2,
+                decimalSeparator:".",
+                thousandsSeparator:","
+            });
+    },
 
-/**
- * Returns the page row index of given row. Returns null if the row is not in
- * view on the current DataTable page.
- *
- * @method getTrIndex
- * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
- * string reference to an element within the DataTable page, a Record instance,
- * or a Record's RecordSet index.
- * @return {Number} Page row index, or null if row does not exist or is not in view.
- */
-YAHOO.widget.DataTable.prototype.getTrIndex = function(row) {
-    var nRecordIndex;
-    
-    // By Record
-    if(row instanceof YAHOO.widget.Record) {
-        nRecordIndex = this._oRecordSet.getRecordIndex(row);
-    }
-    // Calculate page row index from Record index
-    else if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
-    }
-    if(YAHOO.lang.isNumber(nRecordIndex)) {
-        // DataTable is paginated
-        if(this.get("paginated")) {
-            // Get the first and last Record on this page
-            var startRecordIndex = this.get("paginator").startRecordIndex;
-            var endRecordIndex = startRecordIndex + this.get("paginator").rowsPerPage - 1;
-            // This Record is in view
-            if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
-                return nRecordIndex - startRecordIndex;
-            }
-            // This Record is not in view
+    /**
+     * Formats JavaScript Dates.
+     *
+     * @method DataTable.formatDate
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatDate : function(el, oRecord, oColumn, oData) {
+        el.innerHTML = util.Date.format(oData, {format:"MM/DD/YYYY"});
+    },
+
+    /**
+     * Formats SELECT elements.
+     *
+     * @method DataTable.formatDropdown
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatDropdown : function(el, oRecord, oColumn, oData) {
+        var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
+        var options = (lang.isArray(oColumn.dropdownOptions)) ?
+                oColumn.dropdownOptions : null;
+
+        var selectEl;
+        var collection = el.getElementsByTagName("select");
+
+        // Create the form element only once, so we can attach the onChange listener
+        if(collection.length === 0) {
+            // Create SELECT element
+            selectEl = document.createElement("select");
+            Dom.addClass(selectEl, DT.CLASS_DROPDOWN);
+            selectEl = el.appendChild(selectEl);
+
+            // Add event listener
+            Ev.addListener(selectEl,"change",this._onDropdownChange,this);
+        }
+
+        selectEl = collection[0];
+
+        // Update the form element
+        if(selectEl) {
+            // Clear out previous options
+            selectEl.innerHTML = "";
+
+            // We have options to populate
+            if(options) {
+                // Create OPTION elements
+                for(var i=0; i<options.length; i++) {
+                    var option = options[i];
+                    var optionEl = document.createElement("option");
+                    optionEl.value = (lang.isValue(option.value)) ?
+                            option.value : option;
+                    optionEl.innerHTML = (lang.isValue(option.text)) ?
+                            option.text : option;
+                    optionEl = selectEl.appendChild(optionEl);
+                }
+            }
+            // Selected value is our only option
             else {
-                return null;
+                selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
             }
         }
-        // Not paginated, just return the Record index
         else {
-            return nRecordIndex;
+            el.innerHTML = lang.isValue(oData) ? oData : "";
         }
+    },
 
-    }
-    // By element reference or ID string
-    else {
-        // Validate TR element
-        elRow = this.getTrEl(row);
-        if(elRow && (elRow.ownerDocument == document) &&
-                (elRow.parentNode == this._elTbody)) {
-            return elRow.sectionRowIndex;
+    /**
+     * Formats emails.
+     *
+     * @method DataTable.formatEmail
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatEmail : function(el, oRecord, oColumn, oData) {
+        if(lang.isString(oData)) {
+            el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
         }
-    }
-    
-    return null;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats links.
+     *
+     * @method DataTable.formatLink
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatLink : function(el, oRecord, oColumn, oData) {
+        if(lang.isString(oData)) {
+            el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats numbers.
+     *
+     * @method DataTable.formatNumber
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} Data value for the cell, or null.
+     * @static
+     */
+    formatNumber : function(el, oRecord, oColumn, oData) {
+        if(lang.isNumber(oData)) {
+            el.innerHTML = oData;
+        }
+        else {
+            el.innerHTML = lang.isValue(oData) ? oData : "";
+        }
+    },
 
+    /**
+     * Formats INPUT TYPE=RADIO elements.
+     *
+     * @method DataTable.formatRadio
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatRadio : function(el, oRecord, oColumn, oData) {
+        var bChecked = oData;
+        bChecked = (bChecked) ? " checked" : "";
+        el.innerHTML = "<input type=\"radio\"" + bChecked +
+                " name=\"col" + oColumn.getId() + "-radio\"" +
+                " class=\"" + DT.CLASS_RADIO+ "\">";
+    },
 
+    /**
+     * Formats text strings.
+     *
+     * @method DataTable.formatText
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatText : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        //TODO: move to util function
+        el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+    },
 
+    /**
+     * Formats TEXTAREA elements.
+     *
+     * @method DataTable.formatTextarea
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatTextarea : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        var markup = "<textarea>" + value + "</textarea>";
+        el.innerHTML = markup;
+    },
 
+    /**
+     * Formats INPUT TYPE=TEXT elements.
+     *
+     * @method DataTable.formatTextbox
+     * @param el {HTMLElement} The element to format with markup.
+     * @param oRecord {YAHOO.widget.Record} Record instance.
+     * @param oColumn {YAHOO.widget.Column} Column instance.
+     * @param oData {Object} (Optional) Data value for the cell.
+     * @static
+     */
+    formatTextbox : function(el, oRecord, oColumn, oData) {
+        var value = (lang.isValue(oRecord.getData(oColumn.key))) ?
+                oRecord.getData(oColumn.key) : "";
+        var markup = "<input type=\"text\" value=\"" + value + "\">";
+        el.innerHTML = markup;
+    },
 
+    /**
+     * Handles Pag changeRequest events for static DataSources
+     * (i.e. DataSources that return all data immediately)
+     * @method DataTable.handleSimplePagination
+     * @param {object} the requested state of the pagination
+     * @param {DataTable} the DataTable instance
+     * @static     
+     */
+    handleSimplePagination : function (oState,self) {
+        // Set the core pagination values silently (the second param)
+        // to avoid looping back through the changeRequest mechanism
+        oState.paginator.setTotalRecords(oState.totalRecords,true);
+        oState.paginator.setStartIndex(oState.recordOffset,true);
+        oState.paginator.setRowsPerPage(oState.rowsPerPage,true);
 
+        self.render();
+    },
 
+    /**
+     * Handles Pag changeRequest events for dynamic DataSources
+     * such as DataSource.TYPE_XHR or DataSource.TYPE_JSFUNCTION.
+     * @method DataTable.handleDataSourcePagination
+     * @param {object} the requested state of the pagination
+     * @param {DataTable} the DataTable instance
+     * @static     
+     */
+    handleDataSourcePagination : function (oState,self) {
+        var requestedRecords = oState.records[1] - oState.recordOffset;
+
+        if (self._oRecordSet.hasRecords(oState.recordOffset, requestedRecords)) {
+            DT.handleSimplePagination(oState,self);
+        } else {
+            // Translate the proposed page state into a DataSource request param
+            var generateRequest = self.get('generateRequest');
+            var request = generateRequest({ pagination : oState }, self);
+
+            var callback = {
+                success : self.onDataReturnSetRecords,
+                failure : self.onDataReturnSetRecords,
+                argument : {
+                    startIndex : oState.recordOffset,
+                    pagination : oState
+                },
+                scope : self
+            };
+
+            self._oDataSource.sendRequest(request, callback);
+        }
+    },
 
+    /**
+     * Enables CHECKBOX Editor.
+     *
+     * @method DataTable.editCheckbox
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    //DT.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) 
+    editCheckbox : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var aCheckedValues = oEditor.value;
+        if(!lang.isArray(aCheckedValues)) {
+            aCheckedValues = [aCheckedValues];
+        }
+
+        // Checkboxes
+        if(oColumn.editorOptions && lang.isArray(oColumn.editorOptions.checkboxOptions)) {
+            var checkboxOptions = oColumn.editorOptions.checkboxOptions;
+            var checkboxValue, checkboxId, elLabel, j, k;
+            // First create the checkbox buttons in an IE-friendly way
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxValue = lang.isValue(checkboxOptions[j].label) ?
+                        checkboxOptions[j].label : checkboxOptions[j];
+                checkboxId =  oSelf.getId() + "-editor-checkbox" + j;
+                elContainer.innerHTML += "<input type=\"checkbox\"" +
+                        " name=\"" + oSelf.getId() + "-editor-checkbox\"" +
+                        " value=\"" + checkboxValue + "\"" +
+                        " id=\"" +  checkboxId + "\">";
+                // Then create the labels in an IE-friendly way
+                elLabel = elContainer.appendChild(document.createElement("label"));
+                elLabel.htmlFor = checkboxId;
+                elLabel.innerHTML = checkboxValue;
+            }
+            var aCheckboxEls = [];
+            var checkboxEl;
+            // Loop through checkboxes to check them
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxEl = Dom.get(oSelf.getId() + "-editor-checkbox" + j);
+                aCheckboxEls.push(checkboxEl);
+                for(k=0; k<aCheckedValues.length; k++) {
+                    if(checkboxEl.value === aCheckedValues[k]) {
+                        checkboxEl.checked = true;
+                    }
+                }
+                // Focus the first checkbox
+                if(j===0) {
+                    oSelf._focusEl(checkboxEl);
+                }
+            }
+            // Loop through checkboxes to assign click handlers
+            for(j=0; j<checkboxOptions.length; j++) {
+                checkboxEl = Dom.get(oSelf.getId() + "-editor-checkbox" + j);
+                Ev.addListener(checkboxEl, "click", function(){
+                    var aNewValues = [];
+                    for(var m=0; m<aCheckboxEls.length; m++) {
+                        if(aCheckboxEls[m].checked) {
+                            aNewValues.push(aCheckboxEls[m].value);
+                        }
+                    }
+                    oSelf._oCellEditor.value = aNewValues;
+                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+                });
+            }
+        }
+    },
 
+    /**
+     * Enables Date Editor.
+     *
+     * @method DataTable.editDate
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editDate : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+        
+        // Set a default
+        if(!(value instanceof Date)) {
+            value = oEditor.defaultValue || new Date();
+        }
+
+        // Calendar widget
+        if(YAHOO.widget.Calendar) {
+            var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
+            var calContainer = elContainer.appendChild(document.createElement("div"));
+            var calPrefix = oColumn.getColEl();
+            calContainer.id = calPrefix + "-dateContainer";
+            var calendar =
+                    new YAHOO.widget.Calendar(calPrefix + "-date",
+                    calContainer.id,
+                    {selected:selectedValue, pagedate:value});
+            calendar.render();
+            calContainer.style.cssFloat = "none";
+
+            if(ua.ie == 6) {
+                var calFloatClearer = elContainer.appendChild(document.createElement("br"));
+                calFloatClearer.style.clear = "both";
+            }
 
+            calendar.selectEvent.subscribe(function(type, args, obj) {
+                oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+        else {
+            //TODO;
+        }
+    },
 
+    /**
+     * Enables SELECT Editor.
+     *
+     * @method DataTable.editDropdown
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editDropdown : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+        
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue;
+        }
 
 
+        // Textbox
+        var elDropdown = elContainer.appendChild(document.createElement("select"));
+        var dropdownOptions = (oColumn.editorOptions && lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
+                oColumn.editorOptions.dropdownOptions : [];
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var elOption = document.createElement("option");
+            elOption.value = (lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            elOption.innerHTML = (lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            elOption = elDropdown.appendChild(elOption);
+            if(value === elDropdown.options[j].value) {
+                elDropdown.options[j].selected = true;
+            }
+        }
 
+        // Set up a listener on each check box to track the input value
+        Ev.addListener(elDropdown, "change",
+            function(){
+                oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
+        // Focus the dropdown
+        oSelf._focusEl(elDropdown);
+    },
 
+    /**
+     * Enables INPUT TYPE=RADIO Editor.
+     *
+     * @method DataTable.editRadio
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editRadio : function(oEditor, oSelf) {
+        var elCell = oEditor.cell;
+        var oRecord = oEditor.record;
+        var oColumn = oEditor.column;
+        var elContainer = oEditor.container;
+        var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue;
+        }
+
+        // Radios
+        if(oColumn.editorOptions && lang.isArray(oColumn.editorOptions.radioOptions)) {
+            var radioOptions = oColumn.editorOptions.radioOptions;
+            var radioValue, radioId, elLabel, j;
+            // First create the radio buttons in an IE-friendly way
+            for(j=0; j<radioOptions.length; j++) {
+                radioValue = lang.isValue(radioOptions[j].label) ?
+                        radioOptions[j].label : radioOptions[j];
+                radioId =  oSelf.getId() + "-col" + oColumn.getId() + "-radioeditor" + j;
+                elContainer.innerHTML += "<input type=\"radio\"" +
+                        " name=\"" + oSelf.getId() + "-editor-radio\"" +
+                        " value=\"" + radioValue + "\"" +
+                        " id=\"" +  radioId + "\">";
+                // Then create the labels in an IE-friendly way
+                elLabel = elContainer.appendChild(document.createElement("label"));
+                elLabel.htmlFor = radioId;
+                elLabel.innerHTML = radioValue;
+            }
+            // Then check one, and assign click handlers
+            for(j=0; j<radioOptions.length; j++) {
+                var radioEl = Dom.get(oSelf.getId() + "-col" + oColumn.getId() + "-radioeditor" + j);
+                if(value === radioEl.value) {
+                    radioEl.checked = true;
+                    oSelf._focusEl(radioEl);
+                }
+                Ev.addListener(radioEl, "click",
+                    function(){
+                        oSelf._oCellEditor.value = this.value;
+                        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+                });
+            }
+        }
+    },
 
+    /**
+     * Enables TEXTAREA Editor.
+     *
+     * @method DataTable.editTextarea
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editTextarea : function(oEditor, oSelf) {
+       var elCell = oEditor.cell;
+       var oRecord = oEditor.record;
+       var oColumn = oEditor.column;
+       var elContainer = oEditor.container;
+       var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue || "";
+        }
+
+        // Textarea
+        var elTextarea = elContainer.appendChild(document.createElement("textarea"));
+        elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+        elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+        elTextarea.value = value;
+
+        // Set up a listener on each check box to track the input value
+        Ev.addListener(elTextarea, "keyup", function(){
+            //TODO: set on a timeout
+            oSelf._oCellEditor.value = elTextarea.value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
+        // Select the text
+        elTextarea.focus();
+        elTextarea.select();
+    },
 
+    /**
+     * Enables INPUT TYPE=TEXT Editor.
+     *
+     * @method DataTable.editTextbox
+     * @param oEditor {Object} Object literal representation of Editor values.
+     * @param oSelf {DT} Reference back to DataTable instance.
+     * @static
+     */
+    editTextbox : function(oEditor, oSelf) {
+       var elCell = oEditor.cell;
+       var oRecord = oEditor.record;
+       var oColumn = oEditor.column;
+       var elContainer = oEditor.container;
+       var value = oEditor.value;
+
+        // Set a default
+        if(!lang.isValue(value)) {
+            value = oEditor.defaultValue || "";
+        }
+
+        // Textbox
+        var elTextbox = elContainer.appendChild(document.createElement("input"));
+        elTextbox.type = "text";
+        elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+        //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+        elTextbox.value = value;
+
+        // Set up a listener on each textbox to track the input value
+        Ev.addListener(elTextbox, "keyup", function(){
+            //TODO: set on a timeout
+            oSelf._oCellEditor.value = elTextbox.value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+        });
 
+        // Select the text
+        elTextbox.focus();
+        elTextbox.select();
+    },
 
+    /**
+     * Validates Editor input value to type Number, doing type conversion as
+     * necessary. A valid Number value is return, else the previous value is returned
+     * if input value does not validate.
+     *
+     *
+     * @method DataTable.validateNumber
+     * @param oData {Object} Data to validate.
+     * @static
+    */
+    validateNumber : function(oData) {
+        //Convert to number
+        var number = oData * 1;
 
+        // Validate
+        if(lang.isNumber(number)) {
+            return number;
+        }
+        else {
+            return null;
+        }
+    },
 
+    /**
+     * Translates (proposed) DataTable state data into a form consumable by
+     * DataSource sendRequest as the request parameter.  Use
+     * set('generateParameter', yourFunc) to use a custom function rather than this
+     * one.
+     * @method DataTable._generateRequest
+     * @param oData {Object} Object literal defining the current or proposed state
+     * @param oDataTable {DataTable} Reference to the DataTable instance
+     * @returns {MIXED} Returns appropriate value based on DataSource type
+     * @private
+     * @static     
+     */
+    _generateRequest : function (oData, oDataTable) {
+        var request = oData;
+
+        if (oData.pagination) {
+            if (oDataTable._oDataSource.dataType === DS.TYPE_XHR) {
+                request = '?page=' +         oData.pagination.page +
+                          '&recordOffset=' + oData.pagination.recordOffset +
+                          '&rowsPerPage=' +  oData.pagination.rowsPerPage;
+            }
+        }
+        
+        return request;
+    }
+});
 
+// Do in separate step so referenced properties are available
+// TODO: editor shortcuts
+/**
+ * Cell formatting functions.
+ * @property DataTable.Formatter
+ * @type Object
+ * @static
+ */
+DT.Formatter = {
+    button   : DT.formatButton,
+    checkbox : DT.formatCheckbox,
+    currency : DT.formatCurrency,
+    "date"   : DT.formatDate,
+    dropdown : DT.formatDropdown,
+    email    : DT.formatEmail,
+    link     : DT.formatLink,
+    "number" : DT.formatNumber,
+    radio    : DT.formatRadio,
+    text     : DT.formatText,
+    textarea : DT.formatTextarea,
+    textbox  : DT.formatTextbox
+};
 
+lang.extend(DT, util.Element, {
 
-// TABLE FUNCTIONS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Superclass methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Resets a RecordSet with the given data and populates the page view
- * with the new data. Any previous data and selection states are cleared.
- * However, sort states are not cleared, so if the given data is in a particular
- * sort order, implementers should take care to reset the sortedBy property. If
- * pagination is enabled, the currentPage is shown and Paginator UI updated,
- * otherwise all rows are displayed as a single page. For performance, existing
- * DOM elements are reused when possible.
+ * Implementation of Element's abstract method. Sets up config values.
  *
- * @method initializeTable
- * @param oData {Object | Object[]} An object literal of data or an array of
- * object literals containing data.
+ * @method initAttributes
+ * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.initializeTable = function(oData) {
-    // Clear the RecordSet
-    this._oRecordSet.reset();
-
-    // Add data to RecordSet
-    var records = this._oRecordSet.addRecords(oData);
 
-    // Clear selections
-    this._unselectAllTrEls();
-    this._unselectAllTdEls();
-    this._aSelections = null;
-    this._sLastSelectedId = null;
-    this._sSelectionAnchorId = null;
+initAttributes : function(oConfigs) {
+    oConfigs = oConfigs || {};
+    DT.superclass.initAttributes.call(this, oConfigs);
 
-    // Refresh the view
-    this.refreshView();
-    this.fireEvent("initEvent");
-};
+    /**
+    * @attribute summary
+    * @description Value for the SUMMARY attribute.
+    * @type String
+    */
+    this.setAttributeConfig("summary", {
+        value: null,
+        validator: lang.isString,
+        method: function(sSummary) {
+            this._elThead.parentNode.summary = sSummary;
+        }
+    });
 
-/**
- * Refreshes the view with existing Records from the RecordSet while
- * maintaining sort, pagination, and selection states. For performance, reuses
- * existing DOM elements when possible while deleting extraneous elements.
- *
- * @method refreshView
- */
-YAHOO.widget.DataTable.prototype.refreshView = function() {
-    var i, j, k, l, aRecords;
-    var oPaginator = this.updatePaginator();
+    /**
+    * @attribute selectionMode
+    * @description Specifies row or cell selection mode. Accepts the following strings:
+    *    <dl>
+    *      <dt>"standard"</dt>
+    *      <dd>Standard row selection with support for modifier keys to enable
+    *      multiple selections.</dd>
+    *
+    *      <dt>"single"</dt>
+    *      <dd>Row selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"singlecell"</dt>
+    *      <dd>Cell selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"cellblock"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a block-fashion, like a spreadsheet.</dd>
+    *
+    *      <dt>"cellrange"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a range-fashion, like a calendar.</dd>
+    *    </dl>
+    *
+    * @default "standard"
+    * @type String
+    */
+    this.setAttributeConfig("selectionMode", {
+        value: "standard",
+        validator: lang.isString
+    });
 
-    // Paginator is enabled, show a subset of Records and update Paginator UI
-    if(this.get("paginated")) {
-        var rowsPerPage = oPaginator.rowsPerPage;
-        var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
-        aRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
-        this.formatPaginators();
-    }
-    // Show all records
-    else {
-        aRecords = this._oRecordSet.getRecords();
-    }
+    /**
+    * @attribute initialRequest
+    * @description Defines the initial request that gets sent to the DataSource
+    * during initialization. Value is ignored if initialLoad is set to any value
+    * other than true.    
+    * @type MIXED
+    * @default null
+    */
+    this.setAttributeConfig("initialRequest", {
+        value: null
+    });
 
-    var elTbody = this._elTbody;
-    var elRows = elTbody.rows;
+    /**
+    * @attribute initialLoad
+    * @description Determines whether or not to load data at instantiation. By
+    * default, will trigger a sendRequest() to the DataSource and pass in the
+    * request defined by initialRequest. If set to false, data will not load
+    * at instantiation. Alternatively, implementers who wish to work with a 
+    * custom payload may pass in an object literal with the following values:
+    *     
+    *    <dl>
+    *      <dt>request (MIXED)</dt>
+    *      <dd>Request value.</dd>
+    *
+    *      <dt>argument (MIXED)</dt>
+    *      <dd>Custom data that will be passed through to the callback function.</dd>
+    *    </dl>
+    *
+    *                    
+    * @type Boolean | Object
+    * @default true
+    */
+    this.setAttributeConfig("initialLoad", {
+        value: true
+    });
 
-    // Has rows
-    if(YAHOO.lang.isArray(aRecords) && (aRecords.length > 0)) {
-        this.hideTableMessage();
+    /**
+     * @attribute generateRequest
+     * @description A function used to translate proposed DataTable state info
+     * into a value which is then passed to the DataSource's sendRequest method.
+     * This function is called to get the DataTable's initial data as well as
+     * any data changes or requests such as pagination or sorting.  The method
+     * is passed two params, an object literal with the state data and a
+     * reference to the DataTable.
+     * @type function
+     * @default DT._generateRequest
+     */
+    this.setAttributeConfig("generateRequest", {
+        value: DT._generateRequest,
+        validator: lang.isFunction
+    });
 
-        // Keep track of selected rows
-        var aSelectedRows = this.getSelectedRows();
-        // Keep track of selected cells
-        var aSelectedCells = this.getSelectedCells();
-        // Anything to reinstate?
-        var bReselect = (aSelectedRows.length>0) || (aSelectedCells.length > 0);
+    /**
+    * @attribute sortedBy
+    * @description Object literal provides metadata for initial sort values if
+    * data will arrive pre-sorted:
+    * <dl>
+    *     <dt>sortedBy.key</dt>
+    *     <dd>{String} Key of sorted Column</dd>
+    *     <dt>sortedBy.dir</dt>
+    *     <dd>{String} Initial sort direction, either DT.CLASS_ASC or DT.CLASS_DESC</dd>
+    * </dl>
+    * @type Object
+    */
+    this.setAttributeConfig("sortedBy", {
+        value: null,
+        // TODO: accepted array for nested sorts
+        validator: function(oNewSortedBy) {
+            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
+        },
+        method: function(oNewSortedBy) {
+            // Remove ASC/DESC from TH
+            var oOldSortedBy = this.get("sortedBy");
+            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
+                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
+                var oldThEl = this.getThEl(oldColumn);
+                Dom.removeClass(oldThEl, DT.CLASS_ASC);
+                Dom.removeClass(oldThEl, DT.CLASS_DESC);
+            }
 
-        // Remove extra rows from the bottom so as to preserve ID order
-        while(elTbody.hasChildNodes() && (elRows.length > aRecords.length)) {
-            elTbody.deleteRow(-1);
+            // Set ASC/DESC on TH
+            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
+            if(column) {
+                // Backward compatibility
+                if(oNewSortedBy.dir && ((oNewSortedBy.dir == "asc") ||  (oNewSortedBy.dir == "desc"))) {
+                    var newClass = (oNewSortedBy.dir == "desc") ?
+                            DT.CLASS_DESC :
+                            DT.CLASS_ASC;
+                    Dom.addClass(column.getThEl(), newClass);
+                }
+                else {
+                     var sortClass = oNewSortedBy.dir || DT.CLASS_ASC;
+                     Dom.addClass(column.getThEl(), sortClass);
+                }
+            }
         }
-
-        // Unselect all TR and TD elements in the UI
-        if(bReselect) {
-            this._unselectAllTrEls();
-            this._unselectAllTdEls();
+    });
+    
+    /**
+    * @attribute paginator
+    * @description Stores an instance of Pag, or (for
+    * backward compatibility), an object literal of pagination values in the
+    * following form:<br>
+    *   { containers:[], // UI container elements <br>
+    *   rowsPerPage:500, // 500 rows <br>
+    *   currentPage:1,  // page one <br>
+    *   pageLinks:0,    // show all links <br>
+    *   pageLinksStart:1, // first link is page 1 <br>
+    *   dropdownOptions:null, // no dropdown <br>
+    *   links: [], // links elements <br>
+    *   dropdowns: [] } //dropdown elements
+    *
+    * @default null
+    * @type {Object|YAHOO.widget.Paginator}
+    */
+    this.setAttributeConfig("paginator", {
+        value : { // Backward compatibility
+            rowsPerPage:500, // 500 rows per page
+            currentPage:1,  // show page one
+            startRecordIndex:0, // start with first Record
+            totalRecords:0, // how many Records total
+            totalPages:0, // how many pages total
+            rowsThisPage:0, // how many rows this page
+            pageLinks:0,    // show all links
+            pageLinksStart:1, // first link is page 1
+            dropdownOptions: null, //no dropdown
+            containers:[], // Paginator container element references
+            dropdowns: [], //dropdown element references,
+            links: [] // links elements
+        },
+        validator : function (oNewPaginator) {
+            if (typeof oNewPaginator === 'object' && oNewPaginator) {
+                if (oNewPaginator instanceof Pag) {
+                    return true;
+                }
+                else {
+                    // Backward compatibility
+                    if(oNewPaginator && (oNewPaginator.constructor == Object)) {
+                        // Check for incomplete set of values
+                        if((oNewPaginator.rowsPerPage !== undefined) &&
+                                (oNewPaginator.currentPage !== undefined) &&
+                                (oNewPaginator.startRecordIndex !== undefined) &&
+                                (oNewPaginator.totalRecords !== undefined) &&
+                                (oNewPaginator.totalPages !== undefined) &&
+                                (oNewPaginator.rowsThisPage !== undefined) &&
+                                (oNewPaginator.pageLinks !== undefined) &&
+                                (oNewPaginator.pageLinksStart !== undefined) &&
+                                (oNewPaginator.dropdownOptions !== undefined) &&
+                                (oNewPaginator.containers !== undefined) &&
+                                (oNewPaginator.dropdowns !== undefined) &&
+                                (oNewPaginator.links !== undefined)) {
+
+                            // Validate each value
+                            if(lang.isNumber(oNewPaginator.rowsPerPage) &&
+                                    lang.isNumber(oNewPaginator.currentPage) &&
+                                    lang.isNumber(oNewPaginator.startRecordIndex) &&
+                                    lang.isNumber(oNewPaginator.totalRecords) &&
+                                    lang.isNumber(oNewPaginator.totalPages) &&
+                                    lang.isNumber(oNewPaginator.rowsThisPage) &&
+                                    lang.isNumber(oNewPaginator.pageLinks) &&
+                                    lang.isNumber(oNewPaginator.pageLinksStart) &&
+                                    lang.isArray(oNewPaginator.dropdownOptions) &&
+                                    lang.isArray(oNewPaginator.containers) &&
+                                    lang.isArray(oNewPaginator.dropdowns) &&
+                                    lang.isArray(oNewPaginator.links)) {
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        method : function (oNewPaginator) {
+            // Hook into the pagintor's change event
+            if (oNewPaginator instanceof Pag) {
+                oNewPaginator.subscribe('changeRequest', this.onPaginatorChange, this, true);
+
+                // If the paginator has no configured containers, add some
+                var containers = oNewPaginator.getContainerNodes();
+                if (!containers.length) {
+                    // Build the container nodes
+                    var c_above = document.createElement('div');
+                    c_above.id = this._sId + "-paginator0";
+                    this._elContainer.insertBefore(c_above,this._elContainer.firstChild);
+
+                    // ...and one below the table
+                    var c_below = document.createElement('div');
+                    c_below.id = this._sId + "-paginator1";
+                    this._elContainer.appendChild(c_below);
+
+                    containers = [c_above, c_below];
+                    Dom.addClass(containers,
+                                DT.CLASS_PAGINATOR);
+
+                    oNewPaginator.set('containers',containers);
+                }
+            }
         }
+    });
 
-        // From the top, update in-place existing rows
-        for(i=0; i<elRows.length; i++) {
-            this._updateTrEl(elRows[i], aRecords[i]);
-        }
+    /**
+    * @attribute paginated
+    * @deprecated No longer used, as long as "paginator" value is an instance of
+    * Paginator class.  
+    */
+    this.setAttributeConfig("paginated", {
+        value: false,
+        validator: lang.isBoolean,
+        method : function (on) {
+            var curVal = this.get('paginated');
+            var i,len;
+            if (on == curVal) {
+                return;
+            }
 
-        // Add TR elements as necessary
-        for(i=elRows.length; i<aRecords.length; i++) {
-            this._addTrEl(aRecords[i]);
-        }
+            var oPaginator  = this.get('paginator');
+            if (!(oPaginator instanceof Pag)) {
+                // Backward compatibility--pagination generated here
+                oPaginator = oPaginator || {
+                    rowsPerPage     : 500,  // 500 rows per page
+                    currentPage     : 1,    // show page one
+                    startRecordIndex: 0,    // start with first Record
+                    totalRecords    : 0,    // how many Records total
+                    totalPages      : 0,    // how many pages total
+                    rowsThisPage    : 0,    // how many rows this page
+                    pageLinks       : 0,    // show all links
+                    pageLinksStart  : 1,    // first link is page 1
+                    dropdownOptions : null, // no dropdown
+                    containers      : [],   // Paginator container element references
+                    dropdowns       : [],   // dropdown element references,
+                    links           : []    // links elements
+                };
+                var aContainerEls = oPaginator.containers;
+
+                // Paginator is enabled
+                if(on) {
+                    // No containers found, create two from scratch
+                    if(aContainerEls.length === 0) {
+                        // One before TABLE
+                        var pag0 = document.createElement("span");
+                        pag0.id = this._sId + "-paginator0";
+                        Dom.addClass(pag0, DT.CLASS_PAGINATOR);
+                        pag0 = this._elContainer.insertBefore(pag0, this._elContainer.firstChild);
+                        aContainerEls.push(pag0);
+
+                        // One after TABLE
+                        var pag1 = document.createElement("span");
+                        pag1.id = this._sId + "-paginator1";
+                        Dom.addClass(pag1, DT.CLASS_PAGINATOR);
+                        pag1 = this._elContainer.appendChild(pag1);
+                        aContainerEls.push(pag1);
+
+                        // (re)set the paginator value directly
+                        oPaginator.containers = aContainerEls;
+                        this._configs.paginator.value= oPaginator;
+                    }
+                    else {
+                        // Show each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            aContainerEls[i].style.display = "";
+                        }
+                    }
 
-        // Reinstate selected and sorted classes
-        var allRows = elTbody.rows;
-        if(bReselect) {
-            // Loop over each row
-            for(j=0; j<allRows.length; j++) {
-                var thisRow = allRows[j];
-                var sMode = this.get("selectionMode");
-                if ((sMode == "standard") || (sMode == "single")) {
-                    // Set SELECTED
-                    for(k=0; k<aSelectedRows.length; k++) {
-                        if(aSelectedRows[k] === thisRow.yuiRecordId) {
-                            YAHOO.util.Dom.addClass(thisRow, YAHOO.widget.DataTable.CLASS_SELECTED);
-                            if(j === allRows.length-1) {
-                                this._sLastSelectedId = thisRow.id;
-                                this._sSelectionAnchorId = thisRow.id;
-                            }
+                    // Links are enabled
+                    if(oPaginator.pageLinks > -1) {
+                        var aLinkEls = oPaginator.links;
+                        // No links containers found, create from scratch
+                        if(aLinkEls.length === 0) {
+                            for(i=0; i<aContainerEls.length; i++) {
+                                // Create one links container per Paginator container
+                                var linkEl = document.createElement("span");
+                                linkEl.id = "yui-dt-pagselect"+i;
+                                linkEl = aContainerEls[i].appendChild(linkEl);
+
+                                // Add event listener
+                                //TODO: anon fnc
+                                Ev.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+
+                                 // Add directly to tracker
+                                this._configs.paginator.value.links.push(linkEl);
+                           }
+                       }
+                    }
+
+                    for(i=0; i<aContainerEls.length; i++) {
+                        // Create one SELECT element per Paginator container
+                        var selectEl = document.createElement("select");
+                        Dom.addClass(selectEl, DT.CLASS_DROPDOWN);
+                        selectEl = aContainerEls[i].appendChild(selectEl);
+                        selectEl.id = "yui-dt-pagselect"+i;
+
+                        // Add event listener
+                        //TODO: anon fnc
+                        Ev.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+
+                        // Add DOM reference directly to tracker
+                       this._configs.paginator.value.dropdowns.push(selectEl);
+
+                        // Hide dropdown
+                        if(!oPaginator.dropdownOptions) {
+                            selectEl.style.display = "none";
                         }
                     }
+
+                    //TODO: fire paginatorDisabledEvent & add to api doc
                 }
+                // Pagination is disabled
                 else {
-                    // Loop over each cell
-                    for(k=0; k<thisRow.cells.length; k++) {
-                        var thisCell = thisRow.cells[k];
-                        // Set SELECTED
-                        for(l=0; l<aSelectedCells.length; l++) {
-                            if((aSelectedCells[l].recordId === thisRow.yuiRecordId) &&
-                                    (aSelectedCells[l].columnId === thisCell.yuiColumnId)) {
-                                YAHOO.util.Dom.addClass(thisCell, YAHOO.widget.DataTable.CLASS_SELECTED);
-                                if(k === thisRow.cells.length-1) {
-                                    this._sLastSelectedId = thisCell.id;
-                                    this._sSelectionAnchorId = thisCell.id;
-                                }
-                            }
+                    // Containers found
+                    if(aContainerEls.length > 0) {
+                        // Destroy or just hide?
+
+                        // Hide each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            aContainerEls[i].style.display = "none";
+                        }
+
+                        /*TODO?
+                        // Destroy each container
+                        for(i=0; i<aContainerEls.length; i++) {
+                            Ev.purgeElement(aContainerEls[i], true);
+                            aContainerEls.innerHTML = null;
+                            //TODO: remove container?
+                            // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
                         }
+                        */
                     }
+                    //TODO: fire paginatorDisabledEvent & add to api doc
                 }
             }
         }
-        
-        // Set FIRST/LAST, EVEN/ODD
-        this._setFirstRow();
-        this._setLastRow();
-        this._setRowStripes();
+    });
 
-        this.fireEvent("refreshEvent");
-    }
-    // Empty
-    else {
-        // Remove all rows
-        while(elTbody.hasChildNodes()) {
-            elTbody.deleteRow(-1);
-        }
+    /**
+     * @attribute paginationEventHandler
+     * @description For use with Pag pagination.  A
+     * handler function that receives the requestChange event from the
+     * configured paginator.  The handler method will be passed these
+     * parameters:
+     * <ol>
+     * <li>oState {Object} - an object literal describing the requested
+     * pagination state</li>
+     * <li>oSelf {DataTable} - The DataTable instance.</li>
+     * </ol>
+     * 
+     * For pagination through dynamic or server side data, assign
+     * DT.handleDataSourcePagination or your own custom
+     * handler.
+     * @type {function|Object}
+     * @default DT.handleSimplePagination
+     */
+    this.setAttributeConfig("paginationEventHandler", {
+        value     : DT.handleSimplePagination,
+        validator : lang.isObject
+    });
 
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-    }
-};
+    /**
+    * @attribute caption
+    * @description Value for the CAPTION element.
+    * @type String
+    */
+    this.setAttributeConfig("caption", {
+        value: null,
+        validator: lang.isString,
+        method: function(sCaption) {
+            // Create CAPTION element
+            if(!this._elCaption) {
+                this._elCaption = this._elThead.parentNode.insertBefore(document.createElement("caption"), this._elThead.parentNode.firstChild);
+            }
+            // Set CAPTION value
+            this._elCaption.innerHTML = sCaption;
+        }
+    });
 
-/**
- * Nulls out the entire DataTable instance and related objects, removes attached
- * event listeners, and clears out DOM elements inside the container. After
- * calling this method, the instance reference should be expliclitly nulled by
- * implementer, as in myDataTable = null. Use with caution!
- *
- * @method destroy
- */
-YAHOO.widget.DataTable.prototype.destroy = function() {
-    // Destroy Cell Editor
-    YAHOO.util.Event.purgeElement(this._oCellEditor.container, true);
-    document.body.removeChild(this._oCellEditor.container);
-    
-    var instanceName = this.toString();
-    var elContainer = this._elContainer;
+    /**
+    * @attribute scrollable
+    * @description True if primary TBODY should scroll.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("scrollable", {
+        value: false,
+        validator: function(oParam) {
+            return (lang.isBoolean(oParam));
+        },
+        method: function(oParam) {
+            if(oParam) {
+                Dom.addClass(this._elContainer,DT.CLASS_SCROLLABLE);
+                // Bug 1743176 - Safari 2 shifts the _elTbodyContainer up
+                // when placed in overflow:auto container.  Should only shift
+                // the table inside.  Apply topMargin to _elTbodyContainer
+                // to account for the bug.
+                if (ua.webkit && ua.webkit < 420) {
+                    this._elTbodyContainer.style.marginTop =
+                        this._elTbody.parentNode.style.marginTop.replace('-','');
+                }
+                this._syncScrollPadding();
+            }
+            else {
+                Dom.removeClass(this._elContainer,DT.CLASS_SCROLLABLE);
+                if (ua.webkit && ua.webkit < 420) {
+                    this._elTbodyContainer.style.marginTop = "";
+                }
+                this._syncScrollPadding();
+            }
+        }
+    });
 
-    // Unhook custom events
-    this._oRecordSet.unsubscribeAll();
-    this.unsubscribeAll();
+    /**
+    * @attribute width
+    * @description Table width for scrollable tables
+    * @type String
+    */
+    this.setAttributeConfig("width", {
+        value: null,
+        validator: lang.isString,
+        method: function(oParam) {
+            if(this.get("scrollable")) {
+                this._elTheadContainer.style.width = oParam;
+                this._elTbodyContainer.style.width = oParam;            
+            }
+        }
+    });
 
-    // Unhook DOM events
-    YAHOO.util.Event.purgeElement(elContainer, true);
+    /**
+    * @attribute height
+    * @description Table height for scrollable tables
+    * @type String
+    */
+    this.setAttributeConfig("height", {
+        value: null,
+        validator: lang.isString,
+        method: function(oParam) {
+            if(this.get("scrollable")) {
+                this._elTbodyContainer.style.height = oParam;  
+            }          
+        }
+    });
 
-    // Remove DOM elements
-    elContainer.innerHTML = "";
+    /**
+    * @attribute draggableColumns
+    * @description True if Columns are draggable to reorder, false otherwise.
+    * The Drag & Drop Utility is required to enable this feature. Only top-level
+    * and non-nested Columns are draggable. Write once.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("draggableColumns", {
+        value: false,
+        validator: lang.isBoolean,
+        writeOnce: true
+    });
 
-    // Null out objects
-    for(var param in this) {
-        if(this.hasOwnProperty(param)) {
-            this[param] = null;
-        }
-    }
+    /**
+     * @attribute renderLoopSize        
+     * @description A value greater than 0 enables DOM rendering of rows to be
+     * executed from a non-blocking timeout queue and sets how many rows to be
+     * rendered per timeout. Recommended for very large data sets.     
+     * @type Number     
+     * @default 0       
+     */         
+     this.setAttributeConfig("renderLoopSize", {        
+         value: 0,      
+         validator: lang.isNumber       
+     });        
+},
 
-};
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Displays message within secondary TBODY.
+ * True if instance is initialized, so as to fire the initEvent rather than
+ * renderEvent.
  *
- * @method showTableMessage
- * @param sHTML {String} (optional) Value for innerHTML.
- * @param sClassName {String} (optional) Classname.
+ * @property _bInit
+ * @type Boolean
+ * @default true
+ * @private
  */
-YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML, sClassName) {
-    var elCell = this._elMsgTd;
-    if(YAHOO.lang.isString(sHTML)) {
-        elCell.innerHTML = sHTML;
-    }
-    if(YAHOO.lang.isString(sClassName)) {
-        YAHOO.util.Dom.addClass(elCell, sClassName);
-    }
-    this._elMsgTbody.style.display = "";
-    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
-};
+_bInit : true,
 
 /**
- * Hides secondary TBODY.
+ * Index assigned to instance.
  *
- * @method hideTableMessage
+ * @property _nIndex
+ * @type Number
+ * @private
  */
-YAHOO.widget.DataTable.prototype.hideTableMessage = function() {
-    if(this._elMsgTbody.style.display != "none") {
-        this._elMsgTbody.style.display = "none";
-        this.fireEvent("tableMsgHideEvent");
-    }
-};
+_nIndex : null,
 
 /**
- * Brings focus to DataTable instance.
+ * Counter for IDs assigned to TR elements.
  *
- * @method focus
+ * @property _nTrCount
+ * @type Number
+ * @private
  */
-YAHOO.widget.DataTable.prototype.focus = function() {
-    this._focusEl(this._elTable);
-};
-
-
-
-
-
-
+_nTrCount : 0,
 
+/**
+ * Counter for IDs assigned to TD elements.
+ *
+ * @property _nTdCount
+ * @type Number
+ * @private
+ */
+_nTdCount : 0,
 
+/**
+ * Unique id assigned to instance "yui-dtN", useful prefix for generating unique
+ * DOM ID strings and log messages.
+ *
+ * @property _sId
+ * @type String
+ * @private
+ */
+_sId : null,
 
+/**
+ * Render chain.
+ *
+ * @property _oChain
+ * @type YAHOO.util.Chain
+ * @private
+ */
+_oChain : null,
 
+/**
+ * Sparse array of custom functions to set column widths for browsers that don't
+ * support dynamic CSS rules.  Functions are added at the index representing
+ * the number of rows they update.
+ *
+ * @property _aFallbackColResizer
+ * @type Array
+ * @private
+ */
+_aFallbackColResizer : [],
 
+/**
+ * DOM reference to the container element for the DataTable instance into which
+ * all other elements get created.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+_elContainer : null,
 
+/**
+ * DOM reference to the container element for the DataTable's primary THEAD.
+ *
+ * @property _elTheadContainer
+ * @type HTMLElement
+ * @private
+ */
+_elTheadContainer : null,
 
+/**
+ * DOM reference to the container element for the DataTable's primary TBODY.
+ *
+ * @property _elTbodyContainer
+ * @type HTMLElement
+ * @private
+ */
+_elTbodyContainer : null,
 
+/**
+ * DOM reference to the CAPTION element for the DataTable instance.
+ *
+ * @property _elCaption
+ * @type HTMLElement
+ * @private
+ */
+_elCaption : null,
 
+/**
+ * DOM reference to the primary THEAD element for the DataTable instance.
+ *
+ * @property _elThead
+ * @type HTMLElement
+ * @private
+ */
+_elThead : null,
 
+/**
+ * DOM reference to the primary TBODY element for the DataTable instance.
+ *
+ * @property _elTbody
+ * @type HTMLElement
+ * @private
+ */
+_elTbody : null,
 
+/**
+ * DOM reference to the secondary TBODY element used to display DataTable messages.
+ *
+ * @property _elMsgTbody
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbody : null,
 
+/**
+ * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyRow
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbodyRow : null,
 
+/**
+ * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyCell
+ * @type HTMLElement
+ * @private
+ */
+_elMsgTbodyCell : null,
 
+/**
+ * DataSource instance for the DataTable instance.
+ *
+ * @property _oDataSource
+ * @type YAHOO.util.DataSource
+ * @private
+ */
+_oDataSource : null,
 
+/**
+ * ColumnSet instance for the DataTable instance.
+ *
+ * @property _oColumnSet
+ * @type YAHOO.widget.ColumnSet
+ * @private
+ */
+_oColumnSet : null,
 
+/**
+ * RecordSet instance for the DataTable instance.
+ *
+ * @property _oRecordSet
+ * @type YAHOO.widget.RecordSet
+ * @private
+ */
+_oRecordSet : null,
 
+/**
+ * ID string of first TR element of the current DataTable page.
+ *
+ * @property _sFirstTrId
+ * @type String
+ * @private
+ */
+_sFirstTrId : null,
 
+/**
+ * ID string of the last TR element of the current DataTable page.
+ *
+ * @property _sLastTrId
+ * @type String
+ * @private
+ */
+_sLastTrId : null,
 
+/**
+ * Template cell to create all new cells from.
+ * @property _tdElTemplate
+ * @type {HTMLElement}
+ * @private 
+ */
+_tdElTemplate : null,
 
+/**
+ * Template row to create all new rows from.
+ * @property _trElTemplate
+ * @type {HTMLElement}
+ * @private 
+ */
+_trElTemplate : null,
 
+/**
+ * True if x-scrollbar is currently visible.
+ * @property _bScrollbarX
+ * @type {Boolean}
+ * @private 
+ */
+_bScrollbarX : null,
 
 
 
@@ -3662,115 +6514,219 @@ YAHOO.widget.DataTable.prototype.focus = function() {
 
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
-
-
-
-
-
-
-
-
-
-
-
-// RECORDSET FUNCTIONS
+/**
+ * Clears browser text selection. Useful to call on rowSelectEvent or
+ * cellSelectEvent to prevent clicks or dblclicks from selecting text in the
+ * browser.
+ *
+ * @method clearTextSelection
+ */
+clearTextSelection : function() {
+    var sel;
+    if(window.getSelection) {
+       sel = window.getSelection();
+    }
+    else if(document.getSelection) {
+       sel = document.getSelection();
+    }
+    else if(document.selection) {
+       sel = document.selection;
+    }
+    if(sel) {
+        if(sel.empty) {
+            sel.empty();
+        }
+        else if (sel.removeAllRanges) {
+            sel.removeAllRanges();
+        }
+        else if(sel.collapse) {
+            sel.collapse();
+        }
+    }
+},
 
 /**
- * Returns Record index for given TR element or page row index.
+ * Sets focus on the given element.
  *
- * @method getRecordIndex
- * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
- * element reference or page row index.
- * @return {Number} Record's RecordSet index, or null.
+ * @method _focusEl
+ * @param el {HTMLElement} Element.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getRecordIndex = function(row) {
-    var nTrIndex;
-
-    if(!YAHOO.lang.isNumber(row)) {
-        // By Record
-        if(row instanceof YAHOO.widget.Record) {
-            return this._oRecordSet.getRecordIndex(row);
+_focusEl : function(el) {
+    el = el || this._elTbody;
+    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
+    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
+    // strange unexpected things as the user clicks on buttons and other controls.
+    setTimeout(function() {
+        try {
+            el.focus();
         }
-        // By element reference
-        else {
-            // Find the TR element
-            var el = this.getTrEl(row);
-            if(el) {
-                nTrIndex = el.sectionRowIndex;
-            }
+        catch(e) {
         }
-    }
-    // By page row index
-    else {
-        nTrIndex = row;
-    }
+    },0);
+},
 
-    if(YAHOO.lang.isNumber(nTrIndex)) {
-        if(this.get("paginated")) {
-            return this.get("paginator").startRecordIndex + nTrIndex;
+/**
+ * Syncs up widths of THs and TDs across all those Columns without width values.
+ * Actual adjustment is to the liner DIVs so window resizing will not affect cells. 
+ *
+ * @method _syncColWidths
+ * @private
+ */
+_syncColWidths : function() {
+    // Validate there is at least one row with cells and at least one Column
+    var allKeys = this._oColumnSet.keys,
+        elRow = this.getFirstTrEl();
+
+    if(allKeys && elRow && (elRow.cells.length === allKeys.length)) {
+        // Temporarily unsnap container since it causes inaccurate calculations
+        var bUnsnap = false;
+        if((YAHOO.env.ua.gecko || YAHOO.env.ua.opera) && this.get("scrollable") && this.get("width")) {
+            bUnsnap = true;
+            this._elTheadContainer.style.width = "";
+            this._elTbodyContainer.style.width = "";
+        }
+
+        var i,
+            oColumn,
+            cellsLen = elRow.cells.length;
+        // First time through, reset the widths to get an accurate measure of the TD
+        for(i=0; i<cellsLen; i++) {
+            oColumn = allKeys[i];
+            // Only for Columns without widths
+            if(!oColumn.width) {
+                this._setColumnWidth(oColumn, "auto");
+            }
         }
-        else {
-            return nTrIndex;
+
+        // Calculate width for every Column
+        for(i=0; i<cellsLen; i++) {
+            oColumn = allKeys[i];
+            var newWidth;
+            
+            // Columns without widths
+            if(!oColumn.width) {
+                var elTh = oColumn.getThEl();
+                var elTd = elRow.cells[i];
+                
+                if(elTh.offsetWidth !== elTd.offsetWidth) {
+                    var elWider = (elTh.offsetWidth > elTd.offsetWidth) ? elTh.firstChild : elTd.firstChild;               
+                    // Calculate the final width by comparing liner widths
+                    newWidth = elWider.offsetWidth -
+                            (parseInt(Dom.getStyle(elWider,"paddingLeft"),10)|0) -
+                            (parseInt(Dom.getStyle(elWider,"paddingRight"),10)|0);
+                    
+                    // Validate against minWidth        
+                    newWidth = (oColumn.minWidth && (oColumn.minWidth > newWidth)) ?
+                            oColumn.minWidth : newWidth;
+            
+                }
+            }
+            // Columns with widths
+            else {
+                newWidth = oColumn.width;
+            }
+            
+            // Hidden Columns
+            if(oColumn.hidden) {
+                oColumn._nLastWidth = newWidth;
+                newWidth = 1;
+            }
+            
+            // Update to the new width
+            this._setColumnWidth(oColumn, newWidth+"px"); 
         }
+        
+        // Resnap unsnapped containers
+        if(bUnsnap) {
+            var sWidth = this.get("width");
+            this._elTheadContainer.style.width = sWidth;
+            this._elTbodyContainer.style.width = sWidth;     
+        } 
     }
-
-    return null;
-};
+    
+    this._syncScrollPadding();
+},
 
 /**
- * For the given identifier, returns the associated Record instance.
+ * Syncs padding around scrollable tables, including Column header right-padding
+ * and container width and height.
  *
- * @method getRecord
- * @param row {HTMLElement | String | Number} RecordSet position index, DOM
- * reference or ID string to an element within the DataTable page.
- * @return {YAHOO.widget.Record} Record instance.
+ * @method _syncScrollPadding
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getRecord = function(row) {
-    var nRecordIndex = row;
-    
-    // By element reference or ID string
-    if(!YAHOO.lang.isNumber(nRecordIndex)) {
-        // Validate TR element
-        var elRow = this.getTrEl(row);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(row);
+_syncScrollPadding : function() {
+    // Proceed only if scrollable is enabled
+    if(this.get("scrollable")) {
+        var elTbody = this._elTbody,
+            elTbodyContainer = this._elTbodyContainer,
+            aLastHeaders, len, prefix, i, elLiner;
+        
+        // IE 6 and 7 only when y-scrolling not enabled
+        if(!this.get("height") && (ua.ie)) {
+            // Snap outer container height to content
+            // but account for x-scrollbar if it is visible
+            elTbodyContainer.style.height = 
+                    (elTbodyContainer.scrollWidth > elTbodyContainer.offsetWidth) ?
+                    (elTbody.offsetHeight + 19) + "px" : 
+                    elTbody.offsetHeight + "px";
+        }
+        
+        // X-scrolling not enabled
+        if(!this.get("width")) {
+            // Snap outer container width to content
+            // but account for y-scrollbar if it is visible
+            this._elContainer.style.width = 
+                    (elTbodyContainer.scrollHeight > elTbodyContainer.offsetHeight) ?
+                    (elTbody.parentNode.offsetWidth + 19) + "px" :
+                    (elTbody.parentNode.offsetWidth) + "px";
+        }
+        // X-scrolling is enabled and x-scrollbar is visible
+        else if(elTbodyContainer.scrollWidth > elTbodyContainer.offsetWidth) {
+            // Perform sync routine
+            if(!this._bScrollbarX) {
+                // Add Column header right-padding
+                aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1];
+                len = aLastHeaders.length;
+                prefix = this._sId+"-th";
+                for(i=0; i<len; i++) {
+                    //TODO: A better way to get th cell
+                    elLiner = Dom.get(prefix+aLastHeaders[i]).firstChild;
+                    elLiner.style.marginRight = 
+                            (parseInt(Dom.getStyle(elLiner,"marginRight"),10) + 
+                            27) + "px";
+                }
+                
+                // Save state   
+                this._bScrollbarX = true;
+            }
+        }
+        // X-scrollbar enabled but x-scrollbar is not visible
+        else {
+            // Perform sync routine
+            if(this._bScrollbarX) {                 
+                // Remove Column header right-padding                   
+                aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1];
+                len = aLastHeaders.length;
+                prefix = this._sId+"-th";
+                for(i=0; i<len; i++) {
+                    //TODO: A better way to get th cell
+                    elLiner = Dom.get(prefix+aLastHeaders[i]).firstChild;
+                    Dom.setStyle(elLiner,"marginRight","");
+                }
+                                        
+                // Save state
+                this._bScrollbarX = false;
+            }
         }
     }
-    // By Record index
-    if(YAHOO.lang.isNumber(nRecordIndex)) {
-        return this._oRecordSet.getRecord(nRecordIndex);
-    }
-    
-    return null;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+},
 
 
 
@@ -3782,436 +6738,547 @@ YAHOO.widget.DataTable.prototype.getRecord = function(row) {
 
 
 
+// INIT FUNCTIONS
 
+/**
+ * Initializes the HTMLElement templates used to create various table child
+ * nodes.
+ * @method _initNodeTemplates
+ * @private
+ */
+_initNodeTemplates : function () {
+    var d   = document,
+        tr  = d.createElement('tr'),
+        td  = d.createElement('td'),
+        div = d.createElement('div');
 
+    // Append the liner element
+    td.appendChild(div);
 
+    this._tdElTemplate = td;
+    this._trElTemplate = tr;
+},
 
+/**
+ * Initializes the DataTable container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
+ * @private
+ */
+_initContainerEl : function(elContainer) {
+    // Clear any previous container
+    if(this._elContainer) {
+        Ev.purgeElement(this._elContainer, true);
+        this._elContainer.innerHTML = "";
+    }
 
+    elContainer = Dom.get(elContainer);
+    if(elContainer && elContainer.nodeName && (elContainer.nodeName.toLowerCase() == "div")) {
+        // Esp for progressive enhancement
+        Ev.purgeElement(elContainer, true);
+        elContainer.innerHTML = "";
 
+        Dom.addClass(elContainer,"yui-dt yui-dt-noop");
+        
+        // Container for header TABLE
+        this._elTheadContainer = elContainer.appendChild(document.createElement("div"));
+        Dom.addClass(this._elTheadContainer, "yui-dt-hd");
 
+        // Container for body TABLE
+        this._elTbodyContainer = elContainer.appendChild(document.createElement("div"));
+        Dom.addClass(this._elTbodyContainer, "yui-dt-bd");
 
-// COLUMN FUNCTIONS
+        this._elContainer = elContainer;
+    }
+},
 
 /**
- * For the given identifier, returns the associated Column instance.
+ * Initializes object literal of config values.
  *
- * @method getColumn
- * @param column {HTMLElement | String | Number} ColumnSet.keys position index, DOM
- * reference or ID string to an element within the DataTable page.
- * @return {YAHOO.widget.Column} Column instance.
+ * @method _initConfigs
+ * @param oConfig {Object} Object literal of config values.
+ * @private
  */
- YAHOO.widget.DataTable.prototype.getColumn = function(column) {
-    var nColumnIndex = column;
-
-    // By element reference or ID string
-    if(!YAHOO.lang.isNumber(nColumnIndex)) {
-        // Validate TD element
-        var elCell = this.getTdEl(column);
-        if(elCell) {
-            nColumnIndex = elCell.yuiColumnId;
+_initConfigs : function(oConfigs) {
+    if(oConfigs) {
+        if(oConfigs.constructor != Object) {
+            oConfigs = null;
         }
-        // Validate TH element
-        else {
-            elCell = this.getThEl(column);
-            if(elCell) {
-                nColumnIndex = elCell.yuiColumnId;
-            }
+        // Backward compatibility
+        else if(lang.isBoolean(oConfigs.paginator)) {
         }
+        this._oConfigs = oConfigs;
     }
-    
-    // By Column index
-    if(YAHOO.lang.isNumber(nColumnIndex)) {
-        return this._oColumnSet.getColumn(nColumnIndex);
+    else {
+        this._oConfigs = {};
     }
-
-    return null;
- };
+},
 
 /**
- * Sorts given Column.
+ * Initializes ColumnSet.
  *
- * @method sortColumn
- * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @method _initColumnSet
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.sortColumn = function(oColumn) {
-    if(!oColumn) {
-        return;
+_initColumnSet : function(aColumnDefs) {
+    if(this._oColumnSet) {
+        // First clear _oStylesheetRules for existing ColumnSet
+        for(var i=0, l=this._oColumnSet.keys.length; i<l; i++) {
+            DT._oStylesheetRules[".yui-dt-col-"+this._oColumnSet.keys[i].getId()] = undefined;
+        }
+        
+        this._oColumnSet = null;
     }
-    if(!oColumn instanceof YAHOO.widget.Column) {
-        //TODO: accept the TH or TH.key
-        //TODO: Get the column based on TH.yuiColumnId
-        return;
+    
+    if(lang.isArray(aColumnDefs)) {
+        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
+    }
+    // Backward compatibility
+    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
+        this._oColumnSet =  aColumnDefs;
     }
-    if(oColumn.sortable) {
-        // What is the default sort direction?
-        var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultOrder) ? oColumn.sortOptions.defaultOrder : "asc";
+},
 
-        // Already sorted?
-        var oSortedBy = this.get("sortedBy");
-        if(oSortedBy && (oSortedBy.key === oColumn.key)) {
-            if(oSortedBy.dir) {
-                sortDir = (oSortedBy.dir == "asc") ? "desc" : "asc";
+/**
+ * Initializes DataSource.
+ *
+ * @method _initDataSource
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @private
+ */
+_initDataSource : function(oDataSource) {
+    this._oDataSource = null;
+    if(oDataSource && (oDataSource instanceof DS)) {
+        this._oDataSource = oDataSource;
+    }
+    // Backward compatibility
+    else {
+        var tmpTable = null;
+        var tmpContainer = this._elContainer;
+        var i;
+        // Peek in container child nodes to see if TABLE already exists
+        if(tmpContainer.hasChildNodes()) {
+            var tmpChildren = tmpContainer.childNodes;
+            for(i=0; i<tmpChildren.length; i++) {
+                if(tmpChildren[i].nodeName && tmpChildren[i].nodeName.toLowerCase() == "table") {
+                    tmpTable = tmpChildren[i];
+                    break;
+                }
             }
-            else {
-                sortDir = (sortDir == "asc") ? "desc" : "asc";
+            if(tmpTable) {
+                var tmpFieldsArray = [];
+                for(i=0; i<this._oColumnSet.keys.length; i++) {
+                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+                }
+
+                this._oDataSource = new DS(tmpTable);
+                this._oDataSource.responseType = DS.TYPE_HTMLTABLE;
+                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
             }
         }
+    }
+},
 
-        // Is there a custom sort handler function defined?
-        var sortFnc = (oColumn.sortOptions && YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction)) ?
-                oColumn.sortOptions.sortFunction : function(a, b, desc) {
-                    var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
-                    if(sorted === 0) {
-                        return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
-                    }
-                    else {
-                        return sorted;
-                    }
-        };
-
-        // Do the actual sort
-        var desc = (sortDir == "desc") ? true : false;
-        this._oRecordSet.sortRecords(sortFnc, desc);
-
-        // Update sortedBy tracker
-        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
-        
-        // Reset to first page
-        //TODO: Keep selection in view
-        this.updatePaginator({currentPage:1});
-
-        // Update the UI
-        this.refreshView();
-
-        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
+/**
+ * Initializes RecordSet.
+ *
+ * @method _initRecordSet
+ * @private
+ */
+_initRecordSet : function() {
+    if(this._oRecordSet) {
+        this._oRecordSet.reset();
     }
     else {
-        //TODO
+        this._oRecordSet = new YAHOO.widget.RecordSet();
     }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+},
 
+/**
+ * Creates HTML markup for TABLE, THEAD and TBODY elements.
+ *
+ * @method _initTableEl
+ * @private
+ */
+_initTableEl : function() {
+    var elTable;
 
+    // Destroy existing
+    if(this._elThead) {
+        var i;
+        // Destroy ColumnDDs
+        var aTree = this._oColumnSet.tree[0];
+        for(i=0; i<aTree.length; i++) {
+            if(aTree[i]._dd) {
+                aTree[i]._dd = aTree[i]._dd.unreg();
+            }
+        }
+    
+        // Destroy ColumnResizers
+        var aKeys = this._oColumnSet.keys;
+        for(i=0; i<aKeys.length; i++) {
+            if(aKeys[i]._ddResizer) {
+                aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg();
+            }
+        }
+        elTable = this._elThead.parentNode;
+        Ev.purgeElement(elTable, true);
+        elTable.parentNode.removeChild(elTable);
+        this._elThead = null;
+    }
+    if(this._elTbody) {
+        elTable = this._elTbody.parentNode;
+        Ev.purgeElement(elTable, true);
+        elTable.parentNode.removeChild(elTable);
+        this._elTbody = null;
+    }
 
+    // Create elements for header
+    // Create TABLE
+    var elHeadTable = document.createElement("table");
+    elHeadTable.id = this._sId + "-headtable";
+    elHeadTable = this._elTheadContainer.appendChild(elHeadTable);
 
+    // Create elements for body
+    // Create TABLE
+    var elBodyTable = document.createElement("table");
+    elBodyTable.id = this._sId + "-bodytable";
+    this._elTbodyContainer.appendChild(elBodyTable);
 
+    // Create THEAD for display and for a11y
+    this._initTheadEls();
 
+    // Create TBODY for data
+    this._elTbody = elBodyTable.appendChild(document.createElement("tbody"));
+    this._elTbody.tabIndex = 0;
+    Dom.addClass(this._elTbody,DT.CLASS_BODY);
+    // Bug 1716354 - fix gap in Safari 2 and 3 (Also saw small gap in Opera.
+    // this fixes all)
+    this._elTbody.parentNode.style.marginTop = "-"+this._elTbody.offsetTop+"px";
 
+    // Create TBODY for messages
+    var elMsgTbody = document.createElement("tbody");
+    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
+    Dom.addClass(elMsgRow,DT.CLASS_FIRST);
+    Dom.addClass(elMsgRow,DT.CLASS_LAST);
+    this._elMsgRow = elMsgRow;
+    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
+    elMsgCell.colSpan = this._oColumnSet.keys.length;
+    Dom.addClass(elMsgCell,DT.CLASS_FIRST);
+    Dom.addClass(elMsgCell,DT.CLASS_LAST);
+    this._elMsgTd = elMsgCell;
+    this._elMsgTbody = elBodyTable.appendChild(elMsgTbody);
+    var elMsgCellLiner = elMsgCell.appendChild(document.createElement("div"));
+    Dom.addClass(elMsgCellLiner,DT.CLASS_LINER);
+    this.showTableMessage(DT.MSG_LOADING, DT.CLASS_LOADING);
 
+    var elContainer = this._elContainer;
+    var elThead = this._elThead;
+    var elTbody = this._elTbody;
+    
+    // IE puts focus outline in the wrong place
+    if(ua.ie) {
+        elTbody.hideFocus=true;
+    }
+    var elTbodyContainer = this._elTbodyContainer;
 
+    // Set up DOM events
+    Ev.addListener(elContainer, "focus", this._onTableFocus, this);
+    Ev.addListener(elTbody, "focus", this._onTbodyFocus, this);
 
+    Ev.addListener(elTbody, "mouseover", this._onTableMouseover, this);
+    Ev.addListener(elTbody, "mouseout", this._onTableMouseout, this);
+    Ev.addListener(elTbody, "mousedown", this._onTableMousedown, this);
 
+    Ev.addListener(elTbody, "keydown", this._onTbodyKeydown, this);
 
+    Ev.addListener(elTbody, "keypress", this._onTableKeypress, this);
 
-// ROW FUNCTIONS
+    // Since we can't listen for click and dblclick on the same element...
+    Ev.addListener(elTbody.parentNode, "dblclick", this._onTableDblclick, this);
+    Ev.addListener(elTbody, "click", this._onTbodyClick, this);
 
+    Ev.addListener(elTbodyContainer, "scroll", this._onScroll, this); // to sync horiz scroll headers
+},
 
 /**
- * Adds one new Record of data into the RecordSet at the index if given,
- * otherwise at the end. If the new Record is in page view, the
- * corresponding DOM elements are also updated.
+ * Initializes THEAD elements for display and for screen readers.
  *
- * @method addRow
- * @param oData {Object} Object literal of data for the row.
- * @param index {Number} (optional) RecordSet position index at which to add data.
+ * @method _initTheadEls
+ * @private
  */
-YAHOO.widget.DataTable.prototype.addRow = function(oData, index) {
-    if(oData && (oData.constructor == Object)) {
-        var oRecord = this._oRecordSet.addRecord(oData, index);
-        if(oRecord) {
-            var nTrIndex = this.getTrIndex(oRecord);
+_initTheadEls : function() {
+    var i,j, l, elThead, elA11yThead, aTheads;
+    
+    // First time through
+    if(!this._elThead) {
+        // Create THEADs
+        elThead = this._elTheadContainer.firstChild.appendChild(document.createElement("thead"));
+        this._elThead = elThead;
+    
+        elA11yThead = this._elTbodyContainer.firstChild.appendChild(document.createElement("thead"));
+        this._elA11yThead = elA11yThead;
+        
+        aTheads = [elThead, elA11yThead];
+
+        Ev.addListener(elThead, "focus", this._onTheadFocus, this);
+        Ev.addListener(elThead, "keydown", this._onTheadKeydown, this);
+        Ev.addListener(elThead, "mouseover", this._onTableMouseover, this);
+        Ev.addListener(elThead, "mouseout", this._onTableMouseout, this);
+        Ev.addListener(elThead, "mousedown", this._onTableMousedown, this);
+        Ev.addListener(elThead, "mouseup", this._onTableMouseup, this);
+        Ev.addListener(elThead, "click", this._onTheadClick, this);
+        Ev.addListener(elThead.parentNode, "dblclick", this._onTableDblclick, this);
+    }
+    // Reinitialization
+    else {
+        // Clear rows from THEADs
+        elThead = this._elThead;
+        elA11yThead = this._elA11yThead;
+        aTheads = [elThead, elA11yThead];
+            
+        for(i=0; i<aTheads.length; i++) {
+            for(j=aTheads[i].rows.length-1; j>-1; j--) {
+                Ev.purgeElement(aTheads[i].rows[j], true);
+                aTheads[i].removeChild(aTheads[i].rows[j]);
+            }     
+        }
+    }
 
-            // Row is in view
-            if(YAHOO.lang.isNumber(nTrIndex)) {
-                // Paginated so just refresh the view to keep pagination state
-                if(this.get("paginated")) {
-                    this.refreshView();
-                }
-                // Add the TR element
-                else {
-                    var newTrId = this._addTrEl(oRecord, nTrIndex);
-                    if(newTrId) {
-                        // Is this an insert or an append?
-                        var append = (YAHOO.lang.isNumber(nTrIndex) &&
-                                (nTrIndex == this._elTbody.rows.length-1)) ? true : false;
-
-                        // Stripe the one new row
-                        if(append) {
-                            if((this._elTbody.rows.length-1)%2) {
-                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_ODD);
-                            }
-                            else {
-                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_EVEN);
-                            }
-                        }
-                        // Restripe all the rows after the new one
-                        else {
-                            this._setRowStripes(nTrIndex);
-                        }
+    
+    var oColumn,
+        oColumnSet = this._oColumnSet;
 
-                        // If new row is at the bottom
-                        if(append) {
-                            this._setLastRow();
-                        }
-                        // If new row is at the top
-                        else if(YAHOO.lang.isNumber(index) && (nTrIndex === 0)) {
-                            this._setFirstRow();
-                        }
-                    }
+    // Add TRs to the THEADs
+    var colTree = oColumnSet.tree;
+    var elTheadCell;
+    for(l=0; l<aTheads.length; l++) {
+        for(i=0; i<colTree.length; i++) {
+            var elTheadRow = aTheads[l].appendChild(document.createElement("tr"));
+            elTheadRow.id = this._sId+"-hdrow"+i;
+    
+            // ...and create TH cells
+            for(j=0; j<colTree[i].length; j++) {
+                oColumn = colTree[i][j];
+                elTheadCell = elTheadRow.appendChild(document.createElement("th"));
+                if(l===0) {
+                    oColumn._elTh = elTheadCell;
                 }
+                var id = (l===1) ? this._sId+"-th" + oColumn.getId() + "-a11y": this._sId+"-th" + oColumn.getId();
+                elTheadCell.id = id;
+                elTheadCell.yuiCellIndex = j;
+                this._initThEl(elTheadCell,oColumn,i,j, (l===1));
             }
-            // Record is not in view so just update pagination UI
-            else {
-                this.updatePaginator();
+    
+            if(l===0) {
+                // Set FIRST/LAST on THEAD rows
+                if(i === 0) {
+                    Dom.addClass(elTheadRow, DT.CLASS_FIRST);
+                }
+                if(i === (colTree.length-1)) {
+                    Dom.addClass(elTheadRow, DT.CLASS_LAST);
+                }
             }
-
-            // TODO: what args to pass?
-            this.fireEvent("rowAddEvent", {record:oRecord});
-
-            // For log message
-            nTrIndex = (YAHOO.lang.isValue(nTrIndex))? nTrIndex : "n/a";
-
-            return;
         }
-    }
-};
 
-/**
- * Convenience method to add multiple rows.
- *
- * @method addRows
- * @param aData {Object[]} Array of object literal data for the rows.
- * @param index {Number} (optional) RecordSet position index at which to add data.
- */
-YAHOO.widget.DataTable.prototype.addRows = function(aData, index) {
-    if(YAHOO.lang.isArray(aData)) {
-        var i;
-        if(YAHOO.lang.isNumber(index)) {
-            for(i=aData.length-1; i>-1; i--) {
-                this.addRow(aData[i], index);
+        if(l===0) {
+            // Set FIRST/LAST on TH elements using the values in ColumnSet headers array
+            var aFirstHeaders = oColumnSet.headers[0];
+            var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1];
+            for(i=0; i<aFirstHeaders.length; i++) {
+                //TODO: A better way to get th cell
+                Dom.addClass(Dom.get(this._sId+"-th"+aFirstHeaders[i]), DT.CLASS_FIRST);
+            }
+            for(i=0; i<aLastHeaders.length; i++) {
+                //TODO: A better way to get th cell
+                Dom.addClass(Dom.get(this._sId+"-th"+aLastHeaders[i]), DT.CLASS_LAST);
+            }
+        
+            // Add DD features only after DOM has been updated
+            var foundDD = (util.DD) ? true : false;
+            var needDD = false;
+            // draggable
+            // HACK: Not able to use attribute since this code is run before
+            // attributes are initialized
+            if(this._oConfigs.draggableColumns) {
+                for(i=0; i<this._oColumnSet.tree[0].length; i++) {
+                    oColumn = this._oColumnSet.tree[0][i];
+                    if(foundDD) {
+                        elTheadCell = oColumn.getThEl();
+                        Dom.addClass(elTheadCell, DT.CLASS_DRAGGABLE);
+                        var elDragTarget = DT._initColumnDragTargetEl();
+                        oColumn._dd = new YAHOO.widget.ColumnDD(this, oColumn, elTheadCell, elDragTarget);
+                    }
+                    else {
+                        needDD = true;
+                    }    
+                }
+            }
+            // resizeable
+            for(i=0; i<this._oColumnSet.keys.length; i++) {
+                oColumn = this._oColumnSet.keys[i];
+                if(oColumn.resizeable) {
+                    if(foundDD) {
+                        elTheadCell = oColumn.getThEl();
+                        Dom.addClass(elTheadCell, DT.CLASS_RESIZEABLE);
+                        var elThLiner = elTheadCell.firstChild;
+                        var elThResizer = elThLiner.appendChild(document.createElement("div"));
+                        elThResizer.id = this._sId + "-colresizer" + oColumn.getId();
+                        oColumn._elResizer = elThResizer;
+                        Dom.addClass(elThResizer,DT.CLASS_RESIZER);
+                        var elResizerProxy = DT._initColumnResizerProxyEl();
+                        oColumn._ddResizer = new YAHOO.util.ColumnResizer(
+                                this, oColumn, elTheadCell, elThResizer.id, elResizerProxy);
+                        var cancelClick = function(e) {
+                            Ev.stopPropagation(e);
+                        };
+                        Ev.addListener(elThResizer,"click",cancelClick);
+                    }
+                    else {
+                        needDD = true;
+                    }
+                }
             }
+            if(needDD) {
+            }
+            
         }
         else {
-            for(i=0; i<aData.length; i++) {
-                this.addRow(aData[i]);
-            }
         }
     }
-    else {
-    }
-};
+},
 
 /**
- * For the given row, updates the associated Record with the given data. If the
- * row is in view, the corresponding DOM elements are also updated.
+ * Populates TH cell as defined by Column.
  *
- * @method updateRow
- * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
- * Which row to update: By Record instance, by Record's RecordSet
- * position index, by HTMLElement reference to the TR element, or by ID string
- * of the TR element.
- * @param oData {Object} Object literal of data for the row.
+ * @method _initThEl
+ * @param elTheadCell {HTMLElement} TH cell element reference.
+ * @param oColumn {YAHOO.widget.Column} Column object.
+ * @param row {Number} Row index.
+ * @param col {Number} Column index.
+ * @param bA11y {Boolean} True if TH is for accessibility, so as not to
+ * initialize presentation elements.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.updateRow = function(row, oData) {
-    var oldRecord, updatedRecord, elRow;
+_initThEl : function(elTheadCell,oColumn,row,col, bA11y) {
+    // Clear out the cell of prior content
+    // TODO: purgeListeners and other validation-related things
+    var colKey = oColumn.getKey();
+    var colId = oColumn.getId();
+    elTheadCell.yuiColumnKey = colKey;
+    elTheadCell.yuiColumnId = colId;
+    elTheadCell.innerHTML = "";
+    elTheadCell.rowSpan = oColumn.getRowspan();
+    elTheadCell.colSpan = oColumn.getColspan();
 
-    // Get the Record directly
-    if((row instanceof YAHOO.widget.Record) || (YAHOO.lang.isNumber(row))) {
-            // Get the Record directly
-            oldRecord = this._oRecordSet.getRecord(row);
-            
-            // Is this row in view?
-            elRow = this.getTrEl(oldRecord);
-    }
-    // Get the Record by TR element
-    else {
-        elRow = this.getTrEl(row);
-        if(elRow) {
-            oldRecord = this._oRecordSet.getRecord(this.getRecordIndex(elRow));
-        }
-    }
+    var elTheadCellLiner = elTheadCell.appendChild(document.createElement("div"));
+    var elTheadCellLabel = elTheadCellLiner.appendChild(document.createElement("span"));
 
-    // Update the Record
-    if(oldRecord) {
-        // Copy data from the Record for the event that gets fired later
-        var oRecordData = oldRecord.getData();
-        var oldData = {};
-        for(var param in oRecordData) {
-            oldData[param] = oRecordData[param];
+    // Keep it basic for screen readers
+    if(bA11y) {
+        //TODO: remove IDs and form elements from label
+        if(oColumn.abbr) {
+            elTheadCell.abbr = oColumn.abbr;
         }
-
-        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
-    }
-    else {
-        return;
-
-    }
-    
-    // Update the TR only if row is in view
-    if(elRow) {
-        this._updateTrEl(elRow, updatedRecord);
-    }
-
-    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
-};
-
-/**
- * Deletes the given row's Record from the RecordSet. If the row is in view, the
- * corresponding DOM elements are also deleted.
- *
- * @method deleteRow
- * @param row {HTMLElement | String | Number} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- */
-YAHOO.widget.DataTable.prototype.deleteRow = function(row) {
-    // Get the Record index...
-    var nRecordIndex = null;
-    // ...by Record index
-    if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
+        elTheadCellLabel.innerHTML = lang.isValue(oColumn.label) ? oColumn.label : colKey;
     }
-    // ...by element reference
+    // Visually format the elements
     else {
-        var elRow = YAHOO.util.Dom.get(row);
-        elRow = this.getTrEl(elRow);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(elRow);
+        // Needed for resizer
+        elTheadCellLiner.id = elTheadCell.id + "-liner";
+        
+        // Add classes on the liner
+        var aClasses;
+        if(lang.isString(oColumn.className)) {
+            aClasses = [oColumn.className];
         }
-    }
-    if(nRecordIndex !== null) {
-        var oRecord = this._oRecordSet.getRecord(nRecordIndex);
-        if(oRecord) {
-            var nRecordId = oRecord.getId();
-            
-            // Remove from selection tracker if there
-            var tracker = this._aSelections || [];
-            for(var j=0; j<tracker.length; j++) {
-                if((YAHOO.lang.isNumber(tracker[j]) && (tracker[j] === nRecordId)) ||
-                        ((tracker[j].constructor == Object) && (tracker[j].recordId === nRecordId))) {
-                    tracker.splice(j,1);
-                }
-            }
+        else if(lang.isArray(oColumn.className)) {
+            aClasses = oColumn.className;
+        }
+        else {
+            aClasses = [];
+        }
+        
+        //TODO: document special keys will get stripped here
+        aClasses[aClasses.length] = "yui-dt-col-"+colKey.replace(/[^\w\-.:]/g,"");
+        
+        aClasses[aClasses.length] = "yui-dt-col-"+oColumn.getId();
+        
+        aClasses[aClasses.length] = DT.CLASS_LINER;
 
-            // Copy data from the Record for the event that gets fired later
-            var oRecordData = oRecord.getData();
-            var oData = {};
-            for(var param in oRecordData) {
-                oData[param] = oRecordData[param];
-            }
+        Dom.addClass(elTheadCellLiner,aClasses.join(" "));
 
-            // Delete Record from RecordSet
-            this._oRecordSet.deleteRecord(nRecordIndex);
+        // Add classes on the label
+        Dom.addClass(elTheadCellLabel,DT.CLASS_LABEL);
+        
+        // Add classes on the cell
+        aClasses = [];
+        if(oColumn.resizeable) {
+            aClasses[aClasses.length] = DT.CLASS_RESIZEABLE;
+        }
+        if(oColumn.sortable) {
+            aClasses[aClasses.length] = DT.CLASS_SORTABLE;
+        }
 
-            // If row is in view, delete the TR element
-            var nTrIndex = this.getTrIndex(nRecordIndex);
-            if(YAHOO.lang.isNumber(nTrIndex)) {
-                var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex) ?
-                        true : false;
-                this._deleteTrEl(nTrIndex);
+        //Set Column hidden
+        if(oColumn.hidden) {
+            aClasses[aClasses.length] = DT.CLASS_HIDDEN;
+        }
+        
+        // Set Column selection on TD
+        if(oColumn.selected) {
+            aClasses[aClasses.length] = DT.CLASS_SELECTED;
+        }
 
-                // Empty body
-                if(this._elTbody.rows.length === 0) {
-                    this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-                }
-                // Update UI
-                else {
-                    // Set FIRST/LAST
-                    if(nTrIndex === 0) {
-                        this._setFirstRow();
-                    }
-                    if(isLast) {
-                        this._setLastRow();
-                    }
-                    // Set EVEN/ODD
-                    if(nTrIndex != this._elTbody.rows.length) {
-                        this._setRowStripes(nTrIndex);
-                    }
-                }
-            }
+        Dom.addClass(elTheadCell,aClasses.join(" "));
 
-            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
-                    oldData:oData, trElIndex:nTrIndex});
-        }
-    }
-    else {
+        DT.formatTheadCell(elTheadCellLabel, oColumn, this);
     }
-};
+},
 
 /**
- * Convenience method to delete multiple rows.
+ * Creates HTML markup for Cell Editor.
  *
- * @method deleteRows
- * @param row {HTMLElement | String | Number} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- * @param count {Number} (optional) How many rows to delete. A negative value
- * will delete towards the beginning.
+ * @method _initCellEditorEl
+ * @private
  */
-YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
-    // Get the Record index...
-    var nRecordIndex = null;
-    // ...by Record index
-    if(YAHOO.lang.isNumber(row)) {
-        nRecordIndex = row;
-    }
-    // ...by element reference
-    else {
-        var elRow = YAHOO.util.Dom.get(row);
-        elRow = this.getTrEl(elRow);
-        if(elRow) {
-            nRecordIndex = this.getRecordIndex(elRow);
-        }
-    }
-    if(nRecordIndex !== null) {
-        if(count && YAHOO.lang.isNumber(count)) {
-            // Start with highest index and work down
-            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
-            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
-            for(var i=startIndex; i>endIndex-1; i--) {
-                this.deleteRow(i);
-            }
-        }
-        else {
-            this.deleteRow(nRecordIndex);
-        }
+_initCellEditorEl : function() {
+    // TODO: destroy previous instances
+
+    // Attach Cell Editor container element as first child of body
+    var elCellEditor = document.createElement("div");
+    elCellEditor.id = this._sId + "-celleditor";
+    elCellEditor.style.display = "none";
+    elCellEditor.tabIndex = 0;
+    Dom.addClass(elCellEditor, DT.CLASS_EDITOR);
+    var elFirstChild = Dom.getFirstChild(document.body);
+    if(elFirstChild) {
+        elCellEditor = Dom.insertBefore(elCellEditor, elFirstChild);
     }
     else {
+        elCellEditor = document.body.appendChild(elCellEditor);
     }
-};
-
-
-
+    
+    // Internal tracker of Cell Editor values
+    var oCellEditor = {};
+    oCellEditor.container = elCellEditor;
+    oCellEditor.value = null;
+    oCellEditor.isActive = false;
+    this._oCellEditor = oCellEditor;
+},
 
+/**     
+  * Initializes Column sorting.         
+  *     
+  * @method _initColumnSort     
+  * @private    
+  */    
+_initColumnSort : function() {
+    this.subscribe("theadCellClickEvent", this.onEventSortColumn);      
+},      
 
 
 
@@ -4245,412 +7312,300 @@ YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
 
 
 
+// DOM MUTATION FUNCTIONS
 
 
 
+/**
+ * Create a TR element for a given Record.
+ * @method _createTrEl
+ * @param oRecord {YAHOO.widget.Record} Record instance
+ * @return {HTMLElement} The new TR element.  This must be added to the DOM.
+ * @private 
+ */
+_createTrEl : function (oRecord) {
+    // Clone the empty tr template.  We can't clone an existing row
+    // because of the expandos and td ids that must be set in _addTdEl
+    var elRow     = this._trElTemplate.cloneNode(true);
 
+    elRow.id = this._sId+"-bdrow"+this._nTrCount;
+    this._nTrCount++;
 
-
-
-
-
-// CELL FUNCTIONS
+    // Call _updateTrEl to populate and align the row contents
+    return this._updateTrEl(elRow,oRecord);
+},
 
 /**
- * Outputs markup into the given TD based on given Record.
+ * Formats all TD elements of given TR element with data from the given Record.
  *
- * @method formatCell
- * @param elCell {HTMLElement} TD Element.
- * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
- * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
- * @return {HTML} Markup.
+ * @method _updateTrEl
+ * @param elRow {HTMLElement} The TR element to update.
+ * @param oRecord {YAHOO.widget.Record} The associated Record instance.
+ * @return {HTMLElement} DOM reference to the new TR element.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.formatCell = function(elCell, oRecord, oColumn) {
-    if(!(oRecord instanceof YAHOO.widget.Record)) {
-        oRecord = this.getRecord(elCell);
+_updateTrEl : function(elRow, oRecord) {
+    var oColumnSet = this._oColumnSet,
+        sortKey,
+        sortClass,
+        isSortedBy = this.get("sortedBy"),
+        i,j,len,jlen;
+
+    if(isSortedBy) {
+        sortKey = isSortedBy.key;
+        sortClass = isSortedBy.dir;
     }
-    if(!(oColumn instanceof YAHOO.widget.Column)) {
-        oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+
+    // Hide the row to prevent constant reflows
+    elRow.style.display = 'none';
+
+    // Remove extra TD elements
+    while(elRow.childNodes.length > oColumnSet.keys.length) {
+        elRow.removeChild(elRow.firstChild);
+    }
+    // Add more TD elements as needed
+    for (i=elRow.childNodes.length||0, len=oColumnSet.keys.length; i < len; ++i) {
+        this._addTdEl(elRow,oColumnSet.keys[i],i);
     }
-    
-    if(oRecord && oColumn) {
-        var oData = oRecord.getData(oColumn.key);
 
-        var fnFormatter;
-        if(YAHOO.lang.isString(oColumn.formatter)) {
-            switch(oColumn.formatter) {
-                case "button":
-                    fnFormatter = YAHOO.widget.DataTable.formatButton;
-                    break;
-                case "checkbox":
-                    fnFormatter = YAHOO.widget.DataTable.formatCheckbox;
-                    break;
-                case "currency":
-                    fnFormatter = YAHOO.widget.DataTable.formatCurrency;
-                    break;
-                case "date":
-                    fnFormatter = YAHOO.widget.DataTable.formatDate;
-                    break;
-                case "dropdown":
-                    fnFormatter = YAHOO.widget.DataTable.formatDropdown;
-                    break;
-                case "email":
-                    fnFormatter = YAHOO.widget.DataTable.formatEmail;
-                    break;
-                case "link":
-                    fnFormatter = YAHOO.widget.DataTable.formatLink;
-                    break;
-                case "number":
-                    fnFormatter = YAHOO.widget.DataTable.formatNumber;
-                    break;
-                case "radio":
-                    fnFormatter = YAHOO.widget.DataTable.formatRadio;
-                    break;
-                case "text":
-                    fnFormatter = YAHOO.widget.DataTable.formatText;
-                    break;
-                case "textarea":
-                    fnFormatter = YAHOO.widget.DataTable.formatTextarea;
-                    break;
-                case "textbox":
-                    fnFormatter = YAHOO.widget.DataTable.formatTextbox;
-                    break;
-                case "html":
-                    // This is the default
-                    break;
-                default:
-                    fnFormatter = null;
-            }
-        }
-        else if(YAHOO.lang.isFunction(oColumn.formatter)) {
-            fnFormatter = oColumn.formatter;
-        }
+    // Update TD elements with new data
+    for(i=0,len=oColumnSet.keys.length; i<len; ++i) {
+        var oColumn     = oColumnSet.keys[i],
+            elCell      = elRow.childNodes[i],
+            elCellLiner = elCell.firstChild,
+            cellHeaders = '';
 
-        // Apply special formatter
-        if(fnFormatter) {
-            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
-        }
-        else {
-            elCell.innerHTML = (YAHOO.lang.isValue(oData)) ? oData.toString() : "";
+        // Set the cell content
+        this.formatCell(elCellLiner, oRecord, oColumn);
+
+        // Set the cell's accessibility headers
+        for(j=0,jlen=oColumnSet.headers[i].length; j < jlen; ++j) {
+            cellHeaders += this._sId + "-th" + oColumnSet.headers[i][j] + "-a11y ";
         }
+        elCell.headers = cellHeaders;
 
-        // Add custom classNames
-        var aCustomClasses = null;
-        if(YAHOO.lang.isString(oColumn.className)) {
-            aCustomClasses = [oColumn.className];
+        // Set ASC/DESC on TD
+        if(oColumn.key === sortKey) {
+            Dom.replaceClass(elCell, sortClass === DT.CLASS_ASC ?
+                                     DT.CLASS_DESC : DT.CLASS_ASC, sortClass);
+        } else {
+            Dom.removeClass(elCell, DT.CLASS_ASC);
+            Dom.removeClass(elCell, DT.CLASS_DESC);
         }
-        else if(YAHOO.lang.isArray(oColumn.className)) {
-            aCustomClasses = oColumn.className;
+        
+        // Set Column hidden if appropriate
+        if(oColumn.hidden) {
+            Dom.addClass(elCell, DT.CLASS_HIDDEN);
         }
-        if(aCustomClasses) {
-            for(var i=0; i<aCustomClasses.length; i++) {
-                YAHOO.util.Dom.addClass(elCell, aCustomClasses[i]);
-            }
+        else {
+            Dom.removeClass(elCell, DT.CLASS_HIDDEN);
         }
-        
-        YAHOO.util.Dom.addClass(elCell, "yui-dt-col-"+oColumn.key);
 
-        // Is editable?
-        if(oColumn.editor) {
-            YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);
+        // Set Column selection on TH
+        if(oColumn.selected) {
+            Dom.addClass(elCell, DT.CLASS_SELECTED);
+        }
+        else {
+            Dom.removeClass(elCell, DT.CLASS_SELECTED);
         }
-        
-        this.fireEvent("cellFormatEvent", {record:oRecord, key:oColumn.key, el:elCell});
-    }
-    else {
     }
-};
 
-
-/**
- * Formats a BUTTON element.
- *
- * @method DataTable.formatButton
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object | Boolean} Data value for the cell. By default, the value
- * is what gets written to the BUTTON.
- * @static
- */
-YAHOO.widget.DataTable.formatButton= function(el, oRecord, oColumn, oData) {
-    var sValue = YAHOO.lang.isValue(oData) ? oData : "Click";
-    //TODO: support YAHOO.widget.Button
-    //if(YAHOO.widget.Button) {
+    // Update Record ID
+    elRow.yuiRecordId = oRecord.getId();
     
-    //}
-    //else {
-        el.innerHTML = "<button type=\"button\" class=\""+
-                YAHOO.widget.DataTable.CLASS_BUTTON + "\">" + sValue + "</button>";
-    //}
-};
+    // Redisplay the row for reflow
+    elRow.style.display = '';
+
+    return elRow;
+},
 
-/**
- * Formats a CHECKBOX element.
- *
- * @method DataTable.formatCheckbox
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object | Boolean} Data value for the cell. Can be a simple
- * Boolean to indicate whether checkbox is checked or not. Can be object literal
- * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
- * formatter.
- * @static
- */
-YAHOO.widget.DataTable.formatCheckbox = function(el, oRecord, oColumn, oData) {
-    var bChecked = oData;
-    bChecked = (bChecked) ? " checked" : "";
-    el.innerHTML = "<input type=\"checkbox\"" + bChecked +
-            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
-};
 
 /**
- * Formats currency. Default unit is USD.
- *
- * @method DataTable.formatCurrency
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Number} Data value for the cell.
- * @static
+ * Creates a cell within the specified row and column.
+ * @method _addTdEl
+ * @param elRow {HTMLElement} The row to add the cell to
+ * @param oColumn {Column} The column definition to use for the cell
+ * @param index {number} (optional) the index to add the cell at (default null)
+ * @return {HTMLElement} the new cell
+ * @private
  */
-YAHOO.widget.DataTable.formatCurrency = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isNumber(oData)) {
-        var nAmount = oData;
-        var markup;
+_addTdEl : function (elRow,oColumn,index) {
+    var elCell      = this._tdElTemplate.cloneNode(true),
+        elCellLiner = elCell.firstChild;
 
-        // Round to the penny
-        nAmount = Math.round(nAmount*100)/100;
+    index = index || elRow.cells.length;
 
-        // Default currency is USD
-        markup = "$"+nAmount;
+    elCell.id           = elRow.id+"-cell"+this._nTdCount;
+    this._nTdCount++;
+    elCell.yuiColumnKey = oColumn.getKey();
+    elCell.yuiColumnId  = oColumn.getId();
 
-        // Normalize digits
-        var dotIndex = markup.indexOf(".");
-        if(dotIndex < 0) {
-            markup += ".00";
-        }
-        else {
-            while(dotIndex > markup.length-3) {
-                markup += "0";
-            }
-        }
-        el.innerHTML = markup;
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
+    elCell.yuiCellIndex = index;
+
+    // Set FIRST/LAST on TD
+    if (!(index % this._oColumnSet.keys.length - 1)) {
+        elCell.className = index ? DT.CLASS_LAST : DT.CLASS_FIRST;
     }
-};
+
+    var insertBeforeCell = elRow.cells[index] || null;
+    return elRow.insertBefore(elCell,insertBeforeCell);
+},
 
 /**
- * Formats JavaScript Dates.
+ * Deletes TR element by DOM reference or by DataTable page row index.
  *
- * @method DataTable.formatDate
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _deleteTrEl
+ * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
+ * @return {Boolean} Returns true if successful, else returns false.
+ * @private
  */
-YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) {
-    var oDate = oData;
-    if(oDate instanceof Date) {
-        el.innerHTML = (oDate.getMonth()+1) + "/" + oDate.getDate()  + "/" + oDate.getFullYear();
+_deleteTrEl : function(row) {
+    var rowIndex;
+
+    // Get page row index for the element
+    if(!lang.isNumber(row)) {
+        rowIndex = Dom.get(row).sectionRowIndex;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        rowIndex = row;
     }
-};
+    if(lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
+        this._elTbody.deleteRow(rowIndex);
+        return true;
+    }
+    else {
+        return false;
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-/**
- * Formats SELECT elements.
- *
- * @method DataTable.formatDropdown
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
- */
-YAHOO.widget.DataTable.formatDropdown = function(el, oRecord, oColumn, oData) {
-    var selectedValue = (YAHOO.lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
-    var options = (YAHOO.lang.isArray(oColumn.dropdownOptions)) ?
-            oColumn.dropdownOptions : null;
 
-    var selectEl;
-    var collection = el.getElementsByTagName("select");
-    
-    // Create the form element only once, so we can attach the onChange listener
-    if(collection.length === 0) {
-        // Create SELECT element
-        selectEl = document.createElement("select");
-        YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
-        selectEl = el.appendChild(selectEl);
 
-        // Add event listener
-        //TODO: static method doesn't have access to the datatable instance...
-        YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);
-    }
 
-    selectEl = collection[0];
 
-    // Update the form element
-    if(selectEl) {
-        // Clear out previous options
-        selectEl.innerHTML = "";
-        
-        // We have options to populate
-        if(options) {
-            // Create OPTION elements
-            for(var i=0; i<options.length; i++) {
-                var option = options[i];
-                var optionEl = document.createElement("option");
-                optionEl.value = (YAHOO.lang.isValue(option.value)) ?
-                        option.value : option;
-                optionEl.innerHTML = (YAHOO.lang.isValue(option.text)) ?
-                        option.text : option;
-                optionEl = selectEl.appendChild(optionEl);
-            }
-        }
-        // Selected value is our only option
-        else {
-            selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
-        }
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
-    }
-};
 
-/**
- * Formats emails.
- *
- * @method DataTable.formatEmail
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
- */
-YAHOO.widget.DataTable.formatEmail = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isString(oData)) {
-        el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
-    }
-    else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
-    }
-};
+
+
+
+
+
+
+
+
+// CSS/STATE FUNCTIONS
+
+
+
 
 /**
- * Formats links.
+ * Assigns the class DT.CLASS_FIRST to the first TR element
+ * of the DataTable page and updates internal tracker.
  *
- * @method DataTable.formatLink
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _setFirstRow
+ * @private
  */
-YAHOO.widget.DataTable.formatLink = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isString(oData)) {
-        el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+_setFirstRow : function() {
+    var rowEl = this.getFirstTrEl();
+    if(rowEl) {
+        // Remove FIRST
+        if(this._sFirstTrId) {
+            Dom.removeClass(this._sFirstTrId, DT.CLASS_FIRST);
+        }
+        // Set FIRST
+        Dom.addClass(rowEl, DT.CLASS_FIRST);
+        this._sFirstTrId = rowEl.id;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        this._sFirstTrId = null;
     }
-};
+},
 
 /**
- * Formats numbers.
+ * Assigns the class DT.CLASS_LAST to the last TR element
+ * of the DataTable page and updates internal tracker.
  *
- * @method DataTable.formatNumber
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} Data value for the cell, or null.
- * @static
+ * @method _setLastRow
+ * @private
  */
-YAHOO.widget.DataTable.formatNumber = function(el, oRecord, oColumn, oData) {
-    if(YAHOO.lang.isNumber(oData)) {
-        el.innerHTML = oData;
+_setLastRow : function() {
+    var rowEl = this.getLastTrEl();
+    if(rowEl) {
+        // Unassign previous class
+        if(this._sLastTrId) {
+            Dom.removeClass(this._sLastTrId, DT.CLASS_LAST);
+        }
+        // Assign class
+        Dom.addClass(rowEl, DT.CLASS_LAST);
+        this._sLastTrId = rowEl.id;
     }
     else {
-        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+        this._sLastTrId = null;
     }
-};
+},
 
 /**
- * Formats INPUT TYPE=RADIO elements.
- *
- * @method DataTable.formatRadio
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatRadio = function(el, oRecord, oColumn, oData) {
-    var bChecked = oData;
-    bChecked = (bChecked) ? " checked" : "";
-    el.innerHTML = "<input type=\"radio\"" + bChecked +
-            " name=\"" + oColumn.getId() + "-radio\"" +
-            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
-};
-
-/**
- * Formats text strings.
+ * Assigns the classes DT.CLASS_EVEN and
+ * DT.CLASS_ODD to alternating TR elements of the DataTable
+ * page. For performance, a subset of rows may be specified.
  *
- * @method DataTable.formatText
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
+ * @method _setRowStripes
+ * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
+ * or string ID, or page row index of where to start striping.
+ * @param range {Number} (optional) If given, how many rows to stripe, otherwise
+ * stripe all the rows until the end.
+ * @private
  */
-YAHOO.widget.DataTable.formatText = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    //TODO: move to util function
-    el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
-};
+_setRowStripes : function(row, range) {
+    // Default values stripe all rows
+    var allRows = this._elTbody.rows,
+        nStartIndex = 0,
+        nEndIndex = allRows.length,
+        aOdds = [], nOddIdx = 0,
+        aEvens = [], nEvenIdx = 0;
 
-/**
- * Formats TEXTAREA elements.
- *
- * @method DataTable.formatTextarea
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatTextarea = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    var markup = "<textarea>" + value + "</textarea>";
-    el.innerHTML = markup;
-};
+    // Stripe a subset
+    if((row !== null) && (row !== undefined)) {
+        // Validate given start row
+        var elStartRow = this.getTrEl(row);
+        if(elStartRow) {
+            nStartIndex = elStartRow.sectionRowIndex;
 
-/**
- * Formats INPUT TYPE=TEXT elements.
- *
- * @method DataTable.formatTextbox
- * @param el {HTMLElement} The element to format with markup.
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param oData {Object} (Optional) Data value for the cell.
- * @static
- */
-YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
-    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
-            oRecord.getData(oColumn.key) : "";
-    var markup = "<input type=\"text\" value=\"" + value + "\">";
-    el.innerHTML = markup;
-};
+            // Validate given range
+            if(lang.isNumber(range) && (range > 1)) {
+                nEndIndex = nStartIndex + range;
+            }
+        }
+    }
 
+    for(var i=nStartIndex; i<nEndIndex; i++) {
+        if(i%2) {
+            aOdds[nOddIdx++] = allRows[i];
+        } else {
+            aEvens[nEvenIdx++] = allRows[i];
+        }
+    }
 
+    if (aOdds.length) {
+        Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
+    }
 
+    if (aEvens.length) {
+        Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
+    }
+},
 
 
 
@@ -4696,728 +7651,603 @@ YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
 
 
 
-// PAGINATION
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private DOM Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Updates Paginator values in response to RecordSet changes and/or DOM events.
- * Pass in all, a subset, or no values.
+ * Syncs scrolltop and scrollleft of all TABLEs.
  *
- * @method updatePaginator
- * @param oNewValues {Object} (Optional) Object literal of Paginator values, or
- * a subset of Paginator values.
- * @param {Object} Object literal of all Paginator values.
+ * @method _onScroll
+ * @param e {HTMLEvent} The scroll event.
+ * @param oSelf {DT} DataTable instance
+ * @private
  */
+_onScroll : function(e, oSelf) {
+    oSelf._elTheadContainer.scrollLeft = oSelf._elTbodyContainer.scrollLeft;
 
-YAHOO.widget.DataTable.prototype.updatePaginator = function(oNewValues) {
-    // Complete the set
-    var oValidPaginator = this.get("paginator");
-    for(var param in oNewValues) {
-        if(oValidPaginator.hasOwnProperty(param)) {
-            oValidPaginator[param] = oNewValues[param];
-        }
-    }
-    
-    oValidPaginator.totalRecords = this._oRecordSet.getLength();
-    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
-    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
-    if(isNaN(oValidPaginator.totalPages)) {
-        oValidPaginator.totalPages = 0;
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+        oSelf.cancelCellEditor();
     }
 
-    this.set("paginator", oValidPaginator);
-    return this.get("paginator");
-};
-
-/**
- * Displays given page of a paginated DataTable.
- *
- * @method showPage
- * @param nPage {Number} Which page.
- */
-YAHOO.widget.DataTable.prototype.showPage = function(nPage) {
-    // Validate input
-    if(!YAHOO.lang.isNumber(nPage) || (nPage < 1) || (nPage > this.get("paginator").totalPages)) {
-        nPage = 1;
-    }
-    this.updatePaginator({currentPage:nPage});
-    this.refreshView();
-};
-
-/**
- * Updates Paginator containers with markup. Override this method to customize pagination UI.
- *
- * @method formatPaginators
- */
- YAHOO.widget.DataTable.prototype.formatPaginators = function() {
-    var pag = this.get("paginator");
-
-    // For Opera workaround
-    var dropdownEnabled = false;
-
-    // Links are enabled
-    if(pag.pageLinks > -1) {
-        for(var i=0; i<pag.links.length; i++) {
-            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
-        }
-    }
-
-    // Dropdown is enabled
-    for(i=0; i<pag.dropdowns.length; i++) {
-         if(pag.dropdownOptions) {
-            dropdownEnabled = true;
-            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
-        }
-        else {
-            pag.dropdowns[i].style.display = "none";
-        }
-    }
-
-    // For Opera artifacting in dropdowns
-    if(dropdownEnabled && navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
-        document.body.style += '';
-    }
-};
-
-/**
- * Updates Paginator dropdown. If dropdown doesn't exist, the markup is created.
- * Sets dropdown elements's "selected" value.
- *
- * @method formatPaginatorDropdown
- * @param elDropdown {HTMLElement} The SELECT element.
- * @param dropdownOptions {Object[]} OPTION values for display in the SELECT element.
- */
-YAHOO.widget.DataTable.prototype.formatPaginatorDropdown = function(elDropdown, dropdownOptions) {
-    if(elDropdown && (elDropdown.ownerDocument == document)) {
-        // Clear OPTION elements
-        while (elDropdown.firstChild) {
-            elDropdown.removeChild(elDropdown.firstChild);
-        }
-
-        // Create OPTION elements
-        for(var j=0; j<dropdownOptions.length; j++) {
-            var dropdownOption = dropdownOptions[j];
-            var optionEl = document.createElement("option");
-            optionEl.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
-                    dropdownOption.value : dropdownOption;
-            optionEl.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
-                    dropdownOption.text : dropdownOption;
-            optionEl = elDropdown.appendChild(optionEl);
-        }
-
-        var options = elDropdown.options;
-        // Update dropdown's "selected" value
-        if(options.length) {
-            for(var i=options.length-1; i>-1; i--) {
-                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
-                    options[i].selected = true;
-                }
-            }
-        }
-
-        // Show the dropdown
-        elDropdown.style.display = "";
-        return;
-    }
-};
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
+},
 
 /**
- * Updates Paginator links container with markup.
+ * Handles click events on the DOCUMENT.
  *
- * @method formatPaginatorLinks
- * @param elContainer {HTMLElement} The link container element.
- * @param nCurrentPage {Number} Current page.
- * @param nPageLinksStart {Number} First page link to display.
- * @param nPageLinksLength {Number} How many page links to display.
- * @param nTotalPages {Number} Total number of pages.
+ * @method _onDocumentClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.formatPaginatorLinks = function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
-    if(elContainer && (elContainer.ownerDocument == document) &&
-            YAHOO.lang.isNumber(nCurrentPage) && YAHOO.lang.isNumber(nPageLinksStart) &&
-            YAHOO.lang.isNumber(nTotalPages)) {
-        // Set up markup for first/last/previous/next
-        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
-        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
-        var sFirstLinkMarkup = (bIsFirstPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</a> ";
-        var sPrevLinkMarkup = (bIsFirstPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</a> " ;
-        var sNextLinkMarkup = (bIsLastPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</a> " ;
-        var sLastLinkMarkup = (bIsLastPage) ?
-                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
-                " " + YAHOO.widget.DataTable.CLASS_LAST +  "\">&gt;&gt;</span> " :
-                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_LAST + "\">&gt;&gt;</a> ";
-
-        // Start with first and previous
-        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
-        
-        // Ok to show all links
-        var nMaxLinks = nTotalPages;
-        var nFirstLink = 1;
-        var nLastLink = nTotalPages;
-
-        if(nPageLinksLength > 0) {
-        // Calculate how many links to show
-            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
-                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
-
-            // Try to keep the current page in the middle
-            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
-            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
+_onDocumentClick : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
 
-            // Keep the last link in range
-            if(nFirstLink === 1) {
-                nLastLink = nMaxLinks;
-            }
-            // Keep the first link in range
-            else if(nLastLink === nTotalPages) {
-                nFirstLink = nTotalPages - nMaxLinks + 1;
-            }
+    if(!Dom.isAncestor(oSelf._elContainer, elTarget)) {
+        oSelf.fireEvent("tableBlurEvent");
 
-            // An even number of links can get funky
-            if(nLastLink - nFirstLink === nMaxLinks) {
-                nLastLink--;
-            }
-      }
-        
-        // Generate markup for each page
-        for(var i=nFirstLink; i<=nLastLink; i++) {
-            if(i != nCurrentPage) {
-                sMarkup += " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PAGE + "\">" + i + "</a> ";
-            }
-            else {
-                sMarkup += " <span class=\"" + YAHOO.widget.DataTable.CLASS_SELECTED + "\">" + i + "</span>";
+        // Fires editorBlurEvent when click is not within the TABLE.
+        // For cases when click is within the TABLE, due to timing issues,
+        // the editorBlurEvent needs to get fired by the lower-level DOM click
+        // handlers below rather than by the TABLE click handler directly.
+        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+            // Only if the click was not within the Cell Editor container
+            if(!Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
+                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
+                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
             }
         }
-        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
-        elContainer.innerHTML = sMarkup;
-        return;
     }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// SELECTION/HIGHLIGHTING
-
-/**
- * ID string of last highlighted cell element
- *
- * @property _sLastHighlightedCellId
- * @type String
- * @private
- */
-YAHOO.widget.DataTable.prototype._sLastHighlightedCellId = null;
+},
 
 /**
- * ID string of last highlighted row element
+ * Handles focus events on the DataTable instance.
  *
- * @property _sLastHighlightedRowId
- * @type String
+ * @method _onTableFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sLastHighlightedRowId = null;
+_onTableFocus : function(e, oSelf) {
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * Array of selections: {recordId:nRecordId, cellIndex:nCellIndex}
+ * Handles focus events on the THEAD element.
  *
- * @property _aSelections
- * @type Object[]
+ * @method _onTheadFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._aSelections = null;
+_onTheadFocus : function(e, oSelf) {
+    oSelf.fireEvent("theadFocusEvent");
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * ID string of last selected element
+ * Handles focus events on the TBODY element.
  *
- * @property _sLastSelectedId
- * @type String
+ * @method _onTbodyFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sLastSelectedId = null;
+_onTbodyFocus : function(e, oSelf) {
+    oSelf.fireEvent("tbodyFocusEvent");
+    oSelf.fireEvent("tableFocusEvent");
+},
 
 /**
- * ID string of the selection anchor element.
+ * Handles mouseover events on the DataTable instance.
  *
- * @property _sSelectionAnchorId
- * @type String
+ * @method _onTableMouseover
+ * @param e {HTMLEvent} The mouseover event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._sSelectionAnchorId = null;
+_onTableMouseover : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+        var elTag = elTarget.nodeName.toLowerCase();
+        var bKeepBubbling = true;
+        while(elTarget && (elTag != "table")) {
+            switch(elTag) {
+                case "body":
+                     return;
+                case "a":
+                    break;
+                case "td":
+                    bKeepBubbling = oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
+                    break;
+                case "span":
+                    if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                        bKeepBubbling = oSelf.fireEvent("theadLabelMouseoverEvent",{target:elTarget,event:e});
+                        // Backward compatibility
+                        bKeepBubbling = oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                case "th":
+                    bKeepBubbling = oSelf.fireEvent("theadCellMouseoverEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
+                    break;
+                case "tr":
+                    if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                        bKeepBubbling = oSelf.fireEvent("theadRowMouseoverEvent",{target:elTarget,event:e});
+                        // Backward compatibility
+                        bKeepBubbling = oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    else {
+                        bKeepBubbling = oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                default:
+                    break;
+            }
+            if(bKeepBubbling === false) {
+                return;
+            }
+            else {
+                elTarget = elTarget.parentNode;
+                if(elTarget) {
+                    elTag = elTarget.nodeName.toLowerCase();
+                }
+            }
+        }
+        oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
- * from all TR elements on the page.
+ * Handles mouseout events on the DataTable instance.
  *
- * @method _unselectAllTrEls
+ * @method _onTableMouseout
+ * @param e {HTMLEvent} The mouseout event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._unselectAllTrEls = function() {
-    var selectedRows = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
-    YAHOO.util.Dom.removeClass(selectedRows, YAHOO.widget.DataTable.CLASS_SELECTED);
-};
-
-/**
- * Returns array of selected TR elements on the page.
- *
- * @method getSelectedTrEls
- * @return {HTMLElement[]} Array of selected TR elements.
- */
-YAHOO.widget.DataTable.prototype.getSelectedTrEls = function() {
-    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
-};
-
-/**
- * Sets given row to the selected state.
- *
- * @method selectRow
- * @param row {HTMLElement | String} HTML element reference or ID.
- */
-YAHOO.widget.DataTable.prototype.selectRow = function(row) {
-    // Validate the row
-    var elRow = this.getTrEl(row);
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        if(oRecord) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-            // Remove if already there
-
-            // Use Array.indexOf if available...
-            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
-                tracker.splice(tracker.indexOf(nRecordId),1);
-            }
-            // ...or do it the old-fashioned way
-            else {
-                for(var j=0; j<tracker.length; j++) {
-                   if(tracker[j] === nRecordId){
-                        tracker.splice(j,1);
-                    }
+_onTableMouseout : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelMouseoutEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
                 }
-            }
-            // Add to the end
-            tracker.push(nRecordId);
-
-            // Update trackers
-            this._sLastSelectedId = elRow.id;
-            if(!this._sSelectionAnchorId) {
-                this._sSelectionAnchorId = elRow.id;
-            }
-            this._aSelections = tracker;
-        
-            // Update UI
-            YAHOO.util.Dom.addClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-            this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
-
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellMouseoutEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowMouseoutEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
             return;
         }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
     }
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.select = function(els) {
-    if(!YAHOO.lang.isArray(els)) {
-        els = [els];
-    }
-    for(var i=0; i<els.length; i++) {
-        this.selectRow(els[i]);
-    }
-};
+    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Sets given row to the unselected state.
+ * Handles mousedown events on the DataTable instance.
  *
- * @method unselectRow
- * @param row {HTMLElement | String} HTML TR element reference or ID.
+ * @method _onTableMousedown
+ * @param e {HTMLEvent} The mousedown event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.unselectRow = function(row) {
-    // Validate the row
-    var elRow = this.getTrEl(row);
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        if(oRecord) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-
-            // Remove if there
-            var bFound = false;
-            
-            // Use Array.indexOf if available...
-            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
-                tracker.splice(tracker.indexOf(nRecordId),1);
-                bFound = true;
-            }
-            // ...or do it the old-fashioned way
-            else {
-                for(var j=0; j<tracker.length; j++) {
-                   if(tracker[j] === nRecordId){
-                        tracker.splice(j,1);
-                        bFound = true;
-                    }
-                }
-            }
-
-            if(bFound) {
-                // Update tracker
-                this._aSelections = tracker;
-
-                // Update the UI
-                YAHOO.util.Dom.removeClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-                this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
-
+_onTableMousedown : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
                 return;
+            case "a":
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelMousedownEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellMousedownEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowMousedownEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
             }
         }
     }
-};
+    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Clears out all row selections.
+ * Handles dblclick events on the DataTable instance.
  *
- * @method unselectAllRows
+ * @method _onTableDblclick
+ * @param e {HTMLEvent} The dblclick event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.unselectAllRows = function() {
-    // Remove from tracker
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(YAHOO.lang.isNumber(tracker[j])){
-            tracker.splice(j,1);
+_onTableDblclick : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelDblclickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellDblclickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
+                    bKeepBubbling = oSelf.fireEvent("theadRowDblclickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
+                }
+                else {
+                    bKeepBubbling = oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
         }
     }
-
-    // Update tracker
-    this._aSelections = tracker;
-
-    // Update UI
-    this._unselectAllTrEls();
-
-    //TODO: send an array of [{el:el,record:record}]
-    //TODO: or convert this to an unselectRows method
-    //TODO: that takes an array of rows or unselects all if none given
-    this.fireEvent("unselectAllRowsEvent");
-};
-
+    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 /**
- * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
- * from all TD elements in the internal tracker.
+ * Handles keydown events on the THEAD element.
  *
- * @method _unselectAllTdEls
+ * @method _onTheadKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
  * @private
  */
-YAHOO.widget.DataTable.prototype._unselectAllTdEls = function() {
-    var selectedCells = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
-    YAHOO.util.Dom.removeClass(selectedCells, YAHOO.widget.DataTable.CLASS_SELECTED);
-};
+_onTheadKeydown : function(e, oSelf) {
+    // If tabbing to next TH label link causes THEAD to scroll,
+    // need to sync scrollLeft with TBODY
+    if(Ev.getCharCode(e) === 9) {
+        setTimeout(function() {
+            if((oSelf instanceof DT) && oSelf._sId) {
+                oSelf._elTbodyContainer.scrollLeft = oSelf._elTheadContainer.scrollLeft;
+            }
+        },0);
+    }
+    
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+            case "textarea":
+                // TODO
+                break;
+            case "thead":
+                bKeepBubbling = oSelf.fireEvent("theadKeyEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
+    }
+    oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Returns array of selected TD elements on the page.
+ * Handles keydown events on the TBODY element. Handles selection behavior,
+ * provides hooks for ENTER to edit functionality.
  *
- * @method getSelectedTdEls
- * @return {HTMLElement[]} Array of selected TD elements.
+ * @method _onTbodyKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getSelectedTdEls = function() {
-    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
-};
+_onTbodyKeydown : function(e, oSelf) {
+    var sMode = oSelf.get("selectionMode");
 
-/**
- * Sets given cell to the selected state.
- *
- * @method selectCell
- * @param cell {HTMLElement | String} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
- */
-YAHOO.widget.DataTable.prototype.selectCell = function(cell) {
-    var elCell = this.getTdEl(cell);
+    if(sMode == "standard") {
+        oSelf._handleStandardSelectionByKey(e);
+    }
+    else if(sMode == "single") {
+        oSelf._handleSingleSelectionByKey(e);
+    }
+    else if(sMode == "cellblock") {
+        oSelf._handleCellBlockSelectionByKey(e);
+    }
+    else if(sMode == "cellrange") {
+        oSelf._handleCellRangeSelectionByKey(e);
+    }
+    else if(sMode == "singlecell") {
+        oSelf._handleSingleCellSelectionByKey(e);
+    }
     
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        var nColumnId = elCell.yuiColumnId;
-
-        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var nRecordId = oRecord.getId();
-
-            // Remove if there
-            for(var j=0; j<tracker.length; j++) {
-               if((tracker[j].recordId === nRecordId) && (tracker[j].columnId === nColumnId)){
-                    tracker.splice(j,1);
-                }
-            }
-
-            // Add to the end
-            tracker.push({recordId:nRecordId, columnId:nColumnId});
-
-            // Update trackers
-            this._aSelections = tracker;
-            this._sLastSelectedId = elCell.id;
-            if(!this._sSelectionAnchorId) {
-                this._sSelectionAnchorId = elCell.id;
-            }
-
-            // Update the UI
-            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
 
-            this.fireEvent("cellSelectEvent", {record:oRecord,
-                    key: this._oColumnSet.getColumn(nColumnId).key, el:elCell});
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "tbody":
+                bKeepBubbling = oSelf.fireEvent("tbodyKeyEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        if(bKeepBubbling === false) {
             return;
         }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
+        }
     }
-};
+    oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Sets given cell to the unselected state.
+ * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
  *
- * @method unselectCell
- * @param cell {HTMLElement | String} DOM element reference or ID string
- * to DataTable page element or RecordSet index.
+ * @method _onTableKeypress
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.unselectCell = function(cell) {
-    var elCell = this.getTdEl(cell);
+_onTableKeypress : function(e, oSelf) {
+    if(ua.webkit) {
+        var nKey = Ev.getCharCode(e);
+        // arrow down
+        if(nKey == 40) {
+            Ev.stopEvent(e);
+        }
+        // arrow up
+        else if(nKey == 38) {
+            Ev.stopEvent(e);
+        }
+    }
+},
 
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        var nColumnId = elCell.yuiColumnId;
+/**
+ * Handles click events on the THEAD element.
+ *
+ * @method _onTheadClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
+ */
+_onTheadClick : function(e, oSelf) {
+    // Always blur the cell editor
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
 
-        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
-            // Get Record ID
-            var tracker = this._aSelections || [];
-            var id = oRecord.getId();
-
-            // Is it selected?
-            for(var j=0; j<tracker.length; j++) {
-                if((tracker[j].recordId === id) && (tracker[j].columnId === nColumnId)){
-                    // Remove from tracker
-                    tracker.splice(j,1);
-                    
-                    // Update tracker
-                    this._aSelections = tracker;
-
-                    // Update the UI
-                    YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
-
-                    this.fireEvent("cellUnselectEvent", {record:oRecord,
-                            key:this._oColumnSet.getColumn(nColumnId).key, el:elCell});
-
-                    return;
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
                 }
-            }
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
+                    bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
+                    // Backward compatibility
+                    bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
+                // Backward compatibility
+                bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
         }
-    }
-};
-
-/**
- * Clears out all cell selections.
- *
- * @method unselectAllCells
- */
-YAHOO.widget.DataTable.prototype.unselectAllCells= function() {
-    // Remove from tracker
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(tracker[j].constructor == Object){
-            tracker.splice(j,1);
+        if(bKeepBubbling === false) {
+            return;
         }
-    }
-
-    // Update tracker
-    this._aSelections = tracker;
-
-    // Update UI
-    this._unselectAllTdEls();
-    
-    //TODO: send data
-    //TODO: or fire individual cellUnselectEvent
-    this.fireEvent("unselectAllCellsEvent");
-};
-
-/**
- * Returns true if given TR or TD element is select, false otherwise.
- *
- * @method isSelected
- * @param el {HTMLElement} HTML element reference or ID of a TR or TD.
- * @return {Boolean} True if element is selected.
- */
-YAHOO.widget.DataTable.prototype.isSelected = function(el) {
-    return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);
-};
-
-/**
- * Returns selected rows as an array of Record IDs.
- *
- * @method getSelectedRows
- * @return {HTMLElement[]} Array of selected rows by Record ID.
- */
-YAHOO.widget.DataTable.prototype.getSelectedRows = function() {
-    var aSelectedRows = [];
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(YAHOO.lang.isNumber(tracker[j])){
-            aSelectedRows.push(tracker[j]);
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
         }
     }
-    return aSelectedRows;
-};
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
 /**
- * Returns selected cells as an array of object literals:
- *     {recordId:nRecordID, columnId:nColumnId}.
+ * Handles click events on the primary TBODY element.
  *
- * @method getSelectedCells
- * @return {HTMLElement[]} Array of selected cells by Record and Column IDs.
+ * @method _onTbodyClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
  */
-YAHOO.widget.DataTable.prototype.getSelectedCells = function() {
-    var aSelectedCells = [];
-    var tracker = this._aSelections || [];
-    for(var j=0; j<tracker.length; j++) {
-       if(tracker[j] && (tracker[j].constructor == Object)){
-            aSelectedCells.push({recordId:tracker[j].recordId, columnId:tracker[j].columnId});
-        }
+_onTbodyClick : function(e, oSelf) {
+    // Always blur the cell editor
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
     }
-    return aSelectedCells;
-};
-
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.
- *
- * @method highlightRow
- * @param row {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.highlightRow = function(row) {
-    var elRow = this.getTrEl(row);
 
-    if(elRow) {
-        // Make sure previous row is unhighlighted
-        if(this._sLastHighlightedRowId) {
-            YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+    // Fire Custom Events
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
+    var bKeepBubbling = true;
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    bKeepBubbling = oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
+                }
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    bKeepBubbling = oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                bKeepBubbling = oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                bKeepBubbling = oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
+                break;
+            case "td":
+                bKeepBubbling = oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                bKeepBubbling = oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
         }
-        var oRecord = this.getRecord(elRow);
-        YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this._sLastHighlightedRowId = elRow.id;
-        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
-        return;
-    }
-};
-
-/**
- * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.
- *
- * @method unhighlightRow
- * @param row {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.unhighlightRow = function(row) {
-    var elRow = this.getTrEl(row);
-
-    if(elRow) {
-        var oRecord = this.getRecord(elRow);
-        YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
-        return;
-    }
-};
-
-/**
- * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.
- *
- * @method highlightCell
- * @param cell {HTMLElement | String} DOM element reference or ID string.
- */
-YAHOO.widget.DataTable.prototype.highlightCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-
-    if(elCell) {
-        // Make sure previous cell is unhighlighted
-        if(this._sLastHighlightedCellId) {
-            YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        if(bKeepBubbling === false) {
+            return;
+        }
+        else {
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.nodeName.toLowerCase();
+            }
         }
-        
-        var oRecord = this.getRecord(elCell);
-        YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this._sLastHighlightedCellId = elCell.id;
-        this.fireEvent("cellHighlightEvent", {record:oRecord,
-                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
-        return;
     }
-};
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
+},
 
-/**
- * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given cell.
+/*TODO undeprecate?
+ * Handles change events on SELECT elements within DataTable.
  *
- * @method unhighlightCell
- * @param cell {HTMLElement | String} DOM element reference or ID string.
+ * @method _onDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {DT} DataTable instance.
+ * @private
+ * @deprecated
  */
-YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
-    var elCell = this.getTdEl(cell);
-
-    if(elCell) {
-        var oRecord = this.getRecord(elCell);
-        YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
-        this.fireEvent("cellUnhighlightEvent", {record:oRecord,
-                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
-        return;
-    }
-};
-
-
-
-
-
-
-
+_onDropdownChange : function(e, oSelf) {
+    var elTarget = Ev.getTarget(e);
+    //TODO: pass what args?
+    //var value = elTarget[elTarget.selectedIndex].value;
+    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
+},
 
 
 
@@ -5450,510 +8280,131 @@ YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
 
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
 
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
 
+/**
+ * Returns unique id assigned to instance, which is a useful prefix for
+ * generating unique DOM ID strings.
+ *
+ * @method getId
+ * @return {String} Unique ID of the DataSource instance.
+ */
+getId : function() {
+    return this._sId;
+},
 
+/**
+ * DataSource instance name, for logging.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
 
+toString : function() {
+    return "DataTable instance " + this._sId;
+},
 
-// INLINE EDITING
+/**
+ * Returns the DataTable instance's DataSource instance.
+ *
+ * @method getDataSource
+ * @return {YAHOO.util.DataSource} DataSource instance.
+ */
+getDataSource : function() {
+    return this._oDataSource;
+},
 
-/*TODO: for TAB handling
- * Shows Cell Editor for next cell.
+/**
+ * Returns the DataTable instance's ColumnSet instance.
  *
- * @method editNextCell
- * @param elCell {HTMLElement} Cell element from which to edit next cell.
+ * @method getColumnSet
+ * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
  */
-//YAHOO.widget.DataTable.prototype.editNextCell = function(elCell) {
-//};
+getColumnSet : function() {
+    return this._oColumnSet;
+},
 
 /**
- * Shows Cell Editor for given cell.
+ * Returns the DataTable instance's RecordSet instance.
  *
- * @method showCellEditor
- * @param elCell {HTMLElement | String} Cell element to edit.
- * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
- * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ * @method getRecordSet
+ * @return {YAHOO.widget.RecordSet} RecordSet instance.
  */
-YAHOO.widget.DataTable.prototype.showCellEditor = function(elCell, oRecord, oColumn) {
-    elCell = YAHOO.util.Dom.get(elCell);
-    
-    if(elCell && (elCell.ownerDocument === document)) {
-        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
-            oRecord = this.getRecord(elCell);
-        }
-        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
-            oColumn = this.getColumn(elCell);
-        }
-        if(oRecord && oColumn) {
-            var oCellEditor = this._oCellEditor;
-            
-            // Clear previous Editor
-            if(oCellEditor.isActive) {
-                this.cancelCellEditor();
-            }
-
-            // Editor not defined
-            if(!oColumn.editor) {
-                return;
-            }
-            
-            // Update Editor values
-            oCellEditor.cell = elCell;
-            oCellEditor.record = oRecord;
-            oCellEditor.column = oColumn;
-            oCellEditor.validator = (oColumn.editorOptions &&
-                    YAHOO.lang.isFunction(oColumn.editorOptions.validator)) ?
-                    oColumn.editorOptions.validator : null;
-            oCellEditor.value = oRecord.getData(oColumn.key);
-
-            // Move Editor
-            var elContainer = oCellEditor.container;
-            var x = YAHOO.util.Dom.getX(elCell);
-            var y = YAHOO.util.Dom.getY(elCell);
-
-            // SF doesn't get xy for cells in scrolling table
-            // when tbody display is set to block
-            if(isNaN(x) || isNaN(y)) {
-                x = elCell.offsetLeft + // cell pos relative to table
-                        YAHOO.util.Dom.getX(this._elTable) - // plus table pos relative to document
-                        this._elTbody.scrollLeft; // minus tbody scroll
-                y = elCell.offsetTop + // cell pos relative to table
-                        YAHOO.util.Dom.getY(this._elTable) - // plus table pos relative to document
-                        this._elTbody.scrollTop + // minus tbody scroll
-                        this._elThead.offsetHeight; // account for fixed headers
-            }
-            
-            elContainer.style.left = x + "px";
-            elContainer.style.top = y + "px";
-
-            // Show Editor
-            elContainer.style.display = "";
-            
-            // Render Editor markup
-            var fnEditor;
-            if(YAHOO.lang.isString(oColumn.editor)) {
-                switch(oColumn.editor) {
-                    case "checkbox":
-                        fnEditor = YAHOO.widget.DataTable.editCheckbox;
-                        break;
-                    case "date":
-                        fnEditor = YAHOO.widget.DataTable.editDate;
-                        break;
-                    case "dropdown":
-                        fnEditor = YAHOO.widget.DataTable.editDropdown;
-                        break;
-                    case "radio":
-                        fnEditor = YAHOO.widget.DataTable.editRadio;
-                        break;
-                    case "textarea":
-                        fnEditor = YAHOO.widget.DataTable.editTextarea;
-                        break;
-                    case "textbox":
-                        fnEditor = YAHOO.widget.DataTable.editTextbox;
-                        break;
-                    default:
-                        fnEditor = null;
-                }
-            }
-            else if(YAHOO.lang.isFunction(oColumn.editor)) {
-                fnEditor = oColumn.editor;
-            }
-
-            if(fnEditor) {
-                // Create DOM input elements
-                fnEditor(this._oCellEditor, this);
-                
-                // Show Save/Cancel buttons
-                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
-                    this.showCellEditorBtns(elContainer);
-                }
-
-                // Hook to customize the UI
-                this.doBeforeShowCellEditor(this._oCellEditor);
-
-                oCellEditor.isActive = true;
-                
-                //TODO: verify which args to pass
-                this.fireEvent("editorShowEvent", {editor:oCellEditor});
-                return;
-            }
-        }
-    }
-};
+getRecordSet : function() {
+    return this._oRecordSet;
+},
 
 /**
- * Overridable abstract method to customize Cell Editor UI.
+ * Returns the DataTable instance's Cell Editor as an object literal with the
+ * following properties:
+ * <dl>
+ * <dt>cell</dt>
+ * <dd>{HTMLElement} Cell element being edited.</dd>
  *
- * @method doBeforeShowCellEditor
- * @param oCellEditor {Object} Cell Editor object literal.
- */
-YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor = function(oCellEditor) {
-};
-
-/**
- * Adds Save/Cancel buttons to Cell Editor.
+ * <dt>column</dt>
+ * <dd>{YAHOO.widget.Column} Associated Column instance.</dd>
  *
- * @method showCellEditorBtns
- * @param elContainer {HTMLElement} Cell Editor container.
- */
-YAHOO.widget.DataTable.prototype.showCellEditorBtns = function(elContainer) {
-    // Buttons
-    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
-    YAHOO.util.Dom.addClass(elBtnsDiv, YAHOO.widget.DataTable.CLASS_BUTTON);
-
-    // Save button
-    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
-    YAHOO.util.Dom.addClass(elSaveBtn, YAHOO.widget.DataTable.CLASS_DEFAULT);
-    elSaveBtn.innerHTML = "OK";
-    YAHOO.util.Event.addListener(elSaveBtn, "click", this.saveCellEditor, this, true);
-
-    // Cancel button
-    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
-    elCancelBtn.innerHTML = "Cancel";
-    YAHOO.util.Event.addListener(elCancelBtn, "click", this.cancelCellEditor, this, true);
-};
-
-/**
- * Clears Cell Editor of all state and UI.
+ * <dt>container</dt>
+ * <dd>{HTMLElement} Reference to editor's container DIV element.</dd>
  *
- * @method resetCellEditor
- */
-
-YAHOO.widget.DataTable.prototype.resetCellEditor = function() {
-    var elContainer = this._oCellEditor.container;
-    elContainer.style.display = "none";
-    YAHOO.util.Event.purgeElement(elContainer, true);
-    elContainer.innerHTML = "";
-    this._oCellEditor.value = null;
-    this._oCellEditor.isActive = false;
-};
-
-/**
- * Saves Cell Editor input to Record.
+ * <dt>isActive</dt>
+ * <dd>{Boolean} True if cell is currently being edited.</dd>
  *
- * @method saveCellEditor
- */
-YAHOO.widget.DataTable.prototype.saveCellEditor = function() {
-    //TODO: Copy the editor's values to pass to the event
-    if(this._oCellEditor.isActive) {
-        var newData = this._oCellEditor.value;
-        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
-
-        // Validate input data
-        if(this._oCellEditor.validator) {
-            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
-            if(this._oCellEditor.value === null ) {
-                this.resetCellEditor();
-                this.fireEvent("editorRevertEvent",
-                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
-                return;
-            }
-        }
-
-        // Update the Record
-        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
-
-        // Update the UI
-        this.formatCell(this._oCellEditor.cell);
-
-        // Clear out the Cell Editor
-        this.resetCellEditor();
-
-        this.fireEvent("editorSaveEvent",
-                {editor:this._oCellEditor, oldData:oldData, newData:newData});
-    }
-    else {
-    }
-};
-
-/**
- * Cancels Cell Editor.
+ * <dt>record</dt>
+ * <dd>{YAHOO.widget.Record} Associated Record instance.</dd>
  *
- * @method cancelCellEditor
- */
-YAHOO.widget.DataTable.prototype.cancelCellEditor = function() {
-    if(this._oCellEditor.isActive) {
-        this.resetCellEditor();
-        //TODO: preserve values for the event?
-        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
-    }
-    else {
-    }
-};
-
-/**
- * Enables CHECKBOX Editor.
- *
- * @method editCheckbox
- */
-//YAHOO.widget.DataTable.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) {
-YAHOO.widget.DataTable.editCheckbox = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var aCheckedValues = oRecord.getData(oColumn.key);
-    if(!YAHOO.lang.isArray(aCheckedValues)) {
-        aCheckedValues = [aCheckedValues];
-    }
-
-    // Checkboxes
-    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)) {
-        var checkboxOptions = oColumn.editorOptions.checkboxOptions;
-        var checkboxValue, checkboxId, elLabel, j, k;
-        // First create the checkbox buttons in an IE-friendly way
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxValue = YAHOO.lang.isValue(checkboxOptions[j].label) ?
-                    checkboxOptions[j].label : checkboxOptions[j];
-            checkboxId =  oSelf.id + "-editor-checkbox" + j;
-            elContainer.innerHTML += "<input type=\"checkbox\"" +
-                    " name=\"" + oSelf.id + "-editor-checkbox\"" +
-                    " value=\"" + checkboxValue + "\"" +
-                    " id=\"" +  checkboxId + "\">";
-            // Then create the labels in an IE-friendly way
-            elLabel = elContainer.appendChild(document.createElement("label"));
-            elLabel.htmlFor = checkboxId;
-            elLabel.innerHTML = checkboxValue;
-        }
-        var aCheckboxEls = [];
-        var checkboxEl;
-        // Loop through checkboxes to check them
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
-            aCheckboxEls.push(checkboxEl);
-            for(k=0; k<aCheckedValues.length; k++) {
-                if(checkboxEl.value === aCheckedValues[k]) {
-                    checkboxEl.checked = true;
-                }
-            }
-            // Focus the first checkbox
-            if(j===0) {
-                oSelf._focusEl(checkboxEl);
-            }
-        }
-        // Loop through checkboxes to assign click handlers
-        for(j=0; j<checkboxOptions.length; j++) {
-            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
-            YAHOO.util.Event.addListener(checkboxEl, "click", function(){
-                var aNewValues = [];
-                for(var m=0; m<aCheckboxEls.length; m++) {
-                    if(aCheckboxEls[m].checked) {
-                        aNewValues.push(aCheckboxEls[m].value);
-                    }
-                }
-                oSelf._oCellEditor.value = aNewValues;
-                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-            });
-        }
-    }
-};
-
-/**
- * Enables Date Editor.
+ * <dt>validator</dt>
+ * <dd>{HTMLFunction} Associated validator function called before new data is stored. Called
+ * within the scope of the DataTable instance, the function receieves the
+ * following arguments:
  *
- * @method editDate
- */
-YAHOO.widget.DataTable.editDate = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Calendar widget
-    if(YAHOO.widget.Calendar) {
-        var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
-        var calContainer = elContainer.appendChild(document.createElement("div"));
-        calContainer.id = "yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-dateContainer";
-        var calendar =
-                new YAHOO.widget.Calendar("yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-date",
-                calContainer.id,
-                {selected:selectedValue, pagedate:value});
-        calendar.render();
-        calContainer.style.cssFloat = "none";
-
-        //var calFloatClearer = elContainer.appendChild(document.createElement("br"));
-        //calFloatClearer.style.clear = "both";
-        
-        calendar.selectEvent.subscribe(function(type, args, obj) {
-            oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
-        });
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    }
-    else {
-        //TODO;
-    }
-};
-
-/**
- * Enables SELECT Editor.
+ * <dl>
+ *  <dt>oNewData</dt>
+ *  <dd>{Object} New data to validate.</dd>
  *
- * @method editDropdown
- */
-YAHOO.widget.DataTable.editDropdown = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Textbox
-    var elDropdown = elContainer.appendChild(document.createElement("select"));
-    var dropdownOptions = (oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
-            oColumn.editorOptions.dropdownOptions : [];
-    for(var j=0; j<dropdownOptions.length; j++) {
-        var dropdownOption = dropdownOptions[j];
-        var elOption = document.createElement("option");
-        elOption.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
-                dropdownOption.value : dropdownOption;
-        elOption.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
-                dropdownOption.text : dropdownOption;
-        elOption = elDropdown.appendChild(elOption);
-        if(value === elDropdown.options[j].value) {
-            elDropdown.options[j].selected = true;
-        }
-    }
-    
-    // Set up a listener on each check box to track the input value
-    YAHOO.util.Event.addListener(elDropdown, "change",
-        function(){
-            oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
-            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
-            
-    // Focus the dropdown
-    oSelf._focusEl(elDropdown);
-};
-
-/**
- * Enables INPUT TYPE=RADIO Editor.
- *
- * @method editRadio
- */
-YAHOO.widget.DataTable.editRadio = function(oEditor, oSelf) {
-    var elCell = oEditor.cell;
-    var oRecord = oEditor.record;
-    var oColumn = oEditor.column;
-    var elContainer = oEditor.container;
-    var value = oRecord.getData(oColumn.key);
-
-    // Radios
-    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)) {
-        var radioOptions = oColumn.editorOptions.radioOptions;
-        var radioValue, radioId, elLabel, j;
-        // First create the radio buttons in an IE-friendly way
-        for(j=0; j<radioOptions.length; j++) {
-            radioValue = YAHOO.lang.isValue(radioOptions[j].label) ?
-                    radioOptions[j].label : radioOptions[j];
-            radioId =  oSelf.id + "-editor-radio" + j;
-            elContainer.innerHTML += "<input type=\"radio\"" +
-                    " name=\"" + oSelf.id + "-editor-radio\"" +
-                    " value=\"" + radioValue + "\"" +
-                    " id=\"" +  radioId + "\">";
-            // Then create the labels in an IE-friendly way
-            elLabel = elContainer.appendChild(document.createElement("label"));
-            elLabel.htmlFor = radioId;
-            elLabel.innerHTML = radioValue;
-        }
-        // Then check one, and assign click handlers
-        for(j=0; j<radioOptions.length; j++) {
-            var radioEl = YAHOO.util.Dom.get(oSelf.id + "-editor-radio" + j);
-            if(value === radioEl.value) {
-                radioEl.checked = true;
-                oSelf._focusEl(radioEl);
-            }
-            YAHOO.util.Event.addListener(radioEl, "click",
-                function(){
-                    oSelf._oCellEditor.value = this.value;
-                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-            });
-        }
-    }
-};
-
-/**
- * Enables TEXTAREA Editor.
+ *  <dt>oOldData</dt>
+ *  <dd>{Object} Original data in case of reversion.</dd>
  *
- * @method editTextarea
- */
-YAHOO.widget.DataTable.editTextarea = function(oEditor, oSelf) {
-   var elCell = oEditor.cell;
-   var oRecord = oEditor.record;
-   var oColumn = oEditor.column;
-   var elContainer = oEditor.container;
-   var value = oRecord.getData(oColumn.key);
-
-    // Textarea
-    var elTextarea = elContainer.appendChild(document.createElement("textarea"));
-    elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
-    elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
-    elTextarea.value = YAHOO.lang.isValue(value) ? value : "";
-    
-    // Set up a listener on each check box to track the input value
-    YAHOO.util.Event.addListener(elTextarea, "keyup", function(){
-        //TODO: set on a timeout
-        oSelf._oCellEditor.value = elTextarea.value;
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
-    
-    // Select the text
-    elTextarea.focus();
-    elTextarea.select();
-};
-
-/**
- * Enables INPUT TYPE=TEXT Editor.
+ *  <dt>oCellEditor</dt>
+ *  <dd>{Object} Object literal representation of Editor values.</dd>
+ * </dl>
+ *
+ *  </dd>
+ *
+ * <dt>defaultValue</dt>
+ * <dd>Dynamically settable default value</dd>
+ * </dl>
+ *
+ * <dt>value</dt>
+ * <dd>Current input value</dd>
+ * </dl>
  *
- * @method editTextbox
+ *
+ *
+ *
+ *
+ * @method getCellEditor
+ * @return {Object} Cell Editor object literal values.
  */
-YAHOO.widget.DataTable.editTextbox = function(oEditor, oSelf) {
-   var elCell = oEditor.cell;
-   var oRecord = oEditor.record;
-   var oColumn = oEditor.column;
-   var elContainer = oEditor.container;
-   var value = YAHOO.lang.isValue(oRecord.getData(oColumn.key)) ? oRecord.getData(oColumn.key) : "";
+getCellEditor : function() {
+    return this._oCellEditor;
+},
 
-    // Textbox
-    var elTextbox = elContainer.appendChild(document.createElement("input"));
-    elTextbox.type = "text";
-    elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
-    //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
-    elTextbox.value = value;
 
-    // Set up a listener on each textbox to track the input value
-    YAHOO.util.Event.addListener(elTextbox, "keyup", function(){
-        //TODO: set on a timeout
-        oSelf._oCellEditor.value = elTextbox.value;
-        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
-    });
 
-    // Select the text
-    elTextbox.focus();
-    elTextbox.select();
-};
 
-/*
- * Validates Editor input value to type Number, doing type conversion as
- * necessary. A valid Number value is return, else the previous value is returned
- * if input value does not validate.
- * 
- *
- * @method validateNumber
- * @static
-*/
-YAHOO.widget.DataTable.validateNumber = function(oData) {
-    //Convert to number
-    var number = oData * 1;
 
-    // Validate
-    if(YAHOO.lang.isNumber(number)) {
-        return number;
-    }
-    else {
-        return null;
-    }
-};
 
 
 
@@ -5992,64 +8443,498 @@ YAHOO.widget.DataTable.validateNumber = function(oData) {
 
 
 
-// ABSTRACT METHODS
+// DOM ACCESSORS
 
 /**
- * Overridable method gives implementers a hook to access data before
- * it gets added to RecordSet and rendered to the TBODY.
+ * Returns DOM reference to the DataTable's container element.
  *
- * @method doBeforeLoadData
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @return {Boolean} Return true to continue loading data into RecordSet and
- * updating DataTable with new Records, false to cancel.
+ * @method getContainerEl
+ * @return {HTMLElement} Reference to DIV element.
  */
-YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse) {
-    return true;
-};
-
-
-
-
-
+getContainerEl : function() {
+    return this._elContainer;
+},
 
+/**
+ * Returns DOM reference to the DataTable's THEAD element.
+ *
+ * @method getTheadEl
+ * @return {HTMLElement} Reference to THEAD element.
+ */
+getTheadEl : function() {
+    return this._elThead;
+},
 
+/**
+ * Returns DOM reference to the DataTable's primary TBODY element.
+ *
+ * @method getTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+getTbodyEl : function() {
+    return this._elTbody;
+},
 
+/**
+ * Returns DOM reference to the DataTable's secondary TBODY element that is
+ * used to display messages.
+ *
+ * @method getMsgTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+getMsgTbodyEl : function() {
+    return this._elMsgTbody;
+},
 
+/**
+ * Returns DOM reference to the TD element within the secondary TBODY that is
+ * used to display messages.
+ *
+ * @method getMsgTdEl
+ * @return {HTMLElement} Reference to TD element.
+ */
+getMsgTdEl : function() {
+    return this._elMsgTd;
+},
 
+/**
+ * Returns the corresponding TR reference for a given DOM element, ID string or
+ * directly page row index. If the given identifier is a child of a TR element,
+ * then DOM tree is traversed until a parent TR element is returned, otherwise
+ * null.
+ *
+ * @method getTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
+ * get: by element reference, ID string, page row index, or Record.
+ * @return {HTMLElement} Reference to TR element, or null.
+ */
+getTrEl : function(row) {
+    var allRows = this._elTbody.rows;
 
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        var nTrIndex = this.getTrIndex(row);
+            if(nTrIndex !== null) {
+                return allRows[nTrIndex];
+            }
+            // Not a valid Record
+            else {
+                return null;
+            }
+    }
+    // By page row index
+    else if(lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
+        return allRows[row];
+    }
+    // By ID string or element reference
+    else {
+        var elRow;
+        var el = Dom.get(row);
 
+        // Validate HTML element
+        if(el && (el.ownerDocument == document)) {
+            // Validate TR element
+            if(el.nodeName.toLowerCase() != "tr") {
+                // Traverse up the DOM to find the corresponding TR element
+                elRow = Dom.getAncestorByTagName(el,"tr");
+            }
+            else {
+                elRow = el;
+            }
 
+            // Make sure the TR is in this TBODY
+            if(elRow && (elRow.parentNode == this._elTbody)) {
+                // Now we can return the TR element
+                return elRow;
+            }
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to the first TR element in the DataTable page, or null.
+ *
+ * @method getFirstTrEl
+ * @return {HTMLElement} Reference to TR element.
+ */
+getFirstTrEl : function() {
+    return this._elTbody.rows[0] || null;
+},
 
+/**
+ * Returns DOM reference to the last TR element in the DataTable page, or null.
+ *
+ * @method getLastTrEl
+ * @return {HTMLElement} Reference to last TR element.
+ */
+getLastTrEl : function() {
+    var allRows = this._elTbody.rows;
+        if(allRows.length > 0) {
+            return allRows[allRows.length-1] || null;
+        }
+},
 
+/**
+ * Returns DOM reference to the next TR element from the given TR element, or null.
+ *
+ * @method getNextTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element
+ * reference, ID string, page row index, or Record from which to get next TR element.
+ * @return {HTMLElement} Reference to next TR element.
+ */
+getNextTrEl : function(row) {
+    var nThisTrIndex = this.getTrIndex(row);
+    if(nThisTrIndex !== null) {
+        var allRows = this._elTbody.rows;
+        if(nThisTrIndex < allRows.length-1) {
+            return allRows[nThisTrIndex+1];
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to the previous TR element from the given TR element, or null.
+ *
+ * @method getPreviousTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element
+ * reference, ID string, page row index, or Record from which to get previous TR element.
+ * @return {HTMLElement} Reference to previous TR element.
+ */
+getPreviousTrEl : function(row) {
+    var nThisTrIndex = this.getTrIndex(row);
+    if(nThisTrIndex !== null) {
+        var allRows = this._elTbody.rows;
+        if(nThisTrIndex > 0) {
+            return allRows[nThisTrIndex-1];
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to a TD liner element.
+ *
+ * @method getTdLinerEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn}.
+ * @return {HTMLElement} Reference to TD liner element.
+ */
+getTdLinerEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    return elCell.firstChild || null;
+},
 
+/**
+ * Returns DOM reference to a TD element.
+ *
+ * @method getTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn}.
+ * @return {HTMLElement} Reference to TD element.
+ */
+getTdEl : function(cell) {
+    var elCell;
+    var el = Dom.get(cell);
 
+    // Validate HTML element
+    if(el && (el.ownerDocument == document)) {
+        // Validate TD element
+        if(el.nodeName.toLowerCase() != "td") {
+            // Traverse up the DOM to find the corresponding TR element
+            elCell = Dom.getAncestorByTagName(el, "td");
+        }
+        else {
+            elCell = el;
+        }
 
+        // Make sure the TD is in this TBODY
+        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
+            // Now we can return the TD element
+            return elCell;
+        }
+    }
+    else if(cell) {
+        var oRecord, nColKeyIndex;
 
+        if(lang.isString(cell.columnId) && lang.isString(cell.recordId)) {
+            oRecord = this.getRecord(cell.recordId);
+            var oColumn = this.getColumnById(cell.columnId);
+            if(oColumn) {
+                nColKeyIndex = oColumn.getKeyIndex();
+            }
 
+        }
+        if(cell.record && cell.column && cell.column.getKeyIndex) {
+            oRecord = cell.record;
+            nColKeyIndex = cell.column.getKeyIndex();
+        }
+        var elRow = this.getTrEl(oRecord);
+        if((nColKeyIndex !== null) && elRow && elRow.cells && elRow.cells.length > 0) {
+            return elRow.cells[nColKeyIndex] || null;
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns DOM reference to the first TD element in the DataTable page (by default),
+ * the first TD element of the optionally given row, or null.
+ *
+ * @method getFirstTdEl
+ * @param row {HTMLElement} (optional) row from which to get first TD
+ * @return {HTMLElement} Reference to TD element.
+ */
+getFirstTdEl : function(row) {
+    var elRow = this.getTrEl(row) || this.getFirstTrEl();
+    if(elRow && (elRow.cells.length > 0)) {
+        return elRow.cells[0];
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to the last TD element in the DataTable page (by default),
+ * the first TD element of the optionally given row, or null.
+ *
+ * @method getLastTdEl
+ * @return {HTMLElement} Reference to last TD element.
+ */
+getLastTdEl : function(row) {
+    var elRow = this.getTrEl(row) || this.getLastTrEl();
+    if(elRow && (elRow.cells.length > 0)) {
+        return elRow.cells[elRow.cells.length-1];
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to the next TD element from the given cell, or null.
+ *
+ * @method getNextTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.
+ * @return {HTMLElement} Reference to next TD element, or null.
+ */
+getNextTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var nThisTdIndex = elCell.yuiCellIndex;
+        var elRow = this.getTrEl(elCell);
+        if(nThisTdIndex < elRow.cells.length-1) {
+            return elRow.cells[nThisTdIndex+1];
+        }
+        else {
+            var elNextRow = this.getNextTrEl(elRow);
+            if(elNextRow) {
+                return elNextRow.cells[0];
+            }
+        }
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to the previous TD element from the given cell, or null.
+ *
+ * @method getPreviousTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.
+ * @return {HTMLElement} Reference to previous TD element, or null.
+ */
+getPreviousTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var nThisTdIndex = elCell.yuiCellIndex;
+        var elRow = this.getTrEl(elCell);
+        if(nThisTdIndex > 0) {
+            return elRow.cells[nThisTdIndex-1];
+        }
+        else {
+            var elPreviousRow = this.getPreviousTrEl(elRow);
+            if(elPreviousRow) {
+                return this.getLastTdEl(elPreviousRow);
+            }
+        }
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to the above TD element from the given cell, or null.
+ *
+ * @method getAboveTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.
+ * @return {HTMLElement} Reference to next TD element, or null.
+ */
+getAboveTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var elPreviousRow = this.getPreviousTrEl(elCell);
+        if(elPreviousRow) {
+            return elPreviousRow.cells[elCell.yuiCellIndex];
+        }
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to the below TD element from the given cell, or null.
+ *
+ * @method getBelowTdEl
+ * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or
+ * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.
+ * @return {HTMLElement} Reference to previous TD element, or null.
+ */
+getBelowTdEl : function(cell) {
+    var elCell = this.getTdEl(cell);
+    if(elCell) {
+        var elNextRow = this.getNextTrEl(elCell);
+        if(elNextRow) {
+            return elNextRow.cells[elCell.yuiCellIndex];
+        }
+    }
+    return null;
+},
 
+/**
+ * Returns DOM reference to a TH liner element.
+ *
+ * @method getThLinerEl
+ * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,
+ * DOM element reference, or string ID.
+ * @return {HTMLElement} Reference to TH liner element.
+ */
+getThLinerEl : function(theadCell) {
+    var elCell = this.getThEl(theadCell);
+    return elCell.firstChild || null;
+},
 
+/**
+ * Returns DOM reference to a TH element.
+ *
+ * @method getThEl
+ * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,
+ * DOM element reference, or string ID.
+ * @return {HTMLElement} Reference to TH element.
+ */
+getThEl : function(theadCell) {
+    var elTheadCell;
 
+    // Validate Column instance
+    if(theadCell instanceof YAHOO.widget.Column) {
+        var oColumn = theadCell;
+        elTheadCell = oColumn.getThEl();
+        if(elTheadCell) {
+            return elTheadCell;
+        }
+    }
+    // Validate HTML element
+    else {
+        var el = Dom.get(theadCell);
 
+        if(el && (el.ownerDocument == document)) {
+            // Validate TH element
+            if(el.nodeName.toLowerCase() != "th") {
+                // Traverse up the DOM to find the corresponding TR element
+                elTheadCell = Dom.getAncestorByTagName(el,"th");
+            }
+            else {
+                elTheadCell = el;
+            }
 
+            // Make sure the TH is in this THEAD
+            if(elTheadCell && (elTheadCell.parentNode.parentNode == this._elThead)) {
+                // Now we can return the TD element
+                return elTheadCell;
+            }
+        }
+    }
 
+    return null;
+},
 
+/**
+ * Returns the page row index of given row. Returns null if the row is not on the
+ * current DataTable page.
+ *
+ * @method getTrIndex
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
+ * string reference to an element within the DataTable page, a Record instance,
+ * or a Record's RecordSet index.
+ * @return {Number} Page row index, or null if row does not exist or is not on current page.
+ */
+getTrIndex : function(row) {
+    var nRecordIndex;
 
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        nRecordIndex = this._oRecordSet.getRecordIndex(row);
+        if(nRecordIndex === null) {
+            // Not a valid Record
+            return null;
+        }
+    }
+    // Calculate page row index from Record index
+    else if(lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    if(lang.isNumber(nRecordIndex)) {
+        // Validate the number
+        if((nRecordIndex > -1) && (nRecordIndex < this._oRecordSet.getLength())) {
+            // DataTable is paginated
+            var oPaginator = this.get('paginator');
+            if(oPaginator instanceof Pag || this.get('paginated')) {
+                // Get the first and last Record on current page
+                var startRecordIndex = 0,
+                    endRecordIndex   = 0;
+
+                if (oPaginator instanceof Pag) {
+                    var rng = oPaginator.getPageRecords();
+                    startRecordIndex = rng[0];
+                    endRecordIndex   = rng[1];
+                } else {
+                    startRecordIndex = oPaginator.startRecordIndex;
+                    endRecordIndex = startRecordIndex + oPaginator.rowsPerPage - 1;
+                }
 
+                // This Record is on current page
+                if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
+                    return nRecordIndex - startRecordIndex;
+                }
+                // This Record is not on current page
+                else {
+                    return null;
+                }
+            }
+            // Not paginated, just return the Record index
+            else {
+                return nRecordIndex;
+            }
+        }
+        // RecordSet index is out of range
+        else {
+            return null;
+        }
+    }
+    // By element reference or ID string
+    else {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow && (elRow.ownerDocument == document) &&
+                (elRow.parentNode == this._elTbody)) {
+            return elRow.sectionRowIndex;
+        }
+    }
 
+    return null;
+},
 
 
 
@@ -6070,830 +8955,438 @@ YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse
 
 
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public Custom Event Handlers
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Overridable custom event handler to sort Column.
- *
- * @method onEventSortColumn
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventSortColumn = function(oArgs) {
-//TODO: support nested header column sorting
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    YAHOO.util.Event.stopEvent(evt);
-    
-    var el = this.getThEl(target) || this.getTdEl(target);
-    if(el && YAHOO.lang.isNumber(el.yuiColumnId)) {
-        this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));
-    }
-    else {
-    }
-};
 
-/**
- * Overridable custom event handler to manage selection according to desktop paradigm.
- *
- * @method onEventSelectRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventSelectRow = function(oArgs) {
-    var sMode = this.get("selectionMode");
-    if ((sMode == "singlecell") || (sMode == "cellblock") || (sMode == "cellrange")) {
-        return;
-    }
 
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
 
-    var bSHIFT = evt.shiftKey;
-    var bCTRL = evt.ctrlKey;
-    var i, nAnchorTrIndex;
 
-    // Validate target row
-    var elTargetRow = this.getTrEl(elTarget);
-    if(elTargetRow) {
-        var allRows = this._elTbody.rows;
-        var nTargetTrIndex = elTargetRow.sectionRowIndex;
-        var elAnchorRow = YAHOO.util.Dom.get(this._sSelectionAnchorId);
-        
-        // Both SHIFT and CTRL
-        if((sMode != "single") && bSHIFT && bCTRL) {
-            // Validate anchor row
-            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
-                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
-                if(this.isSelected(elAnchorRow)) {
-                    // Select all rows between anchor row and target row, including target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex; i++) {
-                            if(!this.isSelected(allRows[i])) {
-                                this.selectRow(allRows[i]);
-                            }
-                        }
-                    }
-                    // Select all rows between target row and anchor row, including target row
-                    else {
-                        for(i=nAnchorTrIndex-1; i>=nTargetTrIndex; i--) {
-                            if(!this.isSelected(allRows[i])) {
-                                this.selectRow(allRows[i]);
-                            }
-                        }
-                    }
-                }
-                else {
-                    // Unselect all rows between anchor row and target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex-1; i++) {
-                            if(this.isSelected(allRows[i])) {
-                                this.unselectRow(allRows[i]);
-                            }
-                        }
-                    }
-                    // Unselect all rows between target row and anchor row
-                    else {
-                        for(i=nTargetTrIndex+1; i<=nAnchorTrIndex-1; i++) {
-                            if(this.isSelected(allRows[i])) {
-                                this.unselectRow(allRows[i]);
-                            }
-                        }
-                    }
-                    // Select the target row
-                    this.selectRow(elTargetRow);
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetRow.id;
 
-                // Toggle selection of target
-                if(this.isSelected(elTargetRow)) {
-                    this.unselectRow(elTargetRow);
-                }
-                else {
-                    this.selectRow(elTargetRow);
-                }
-            }
-        }
-        // Only SHIFT
-        else if((sMode != "single") && bSHIFT) {
-            this.unselectAllRows();
 
-            // Validate anchor
-            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
-                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
 
-                // Select all rows between anchor row and target row,
-                // including the anchor row and target row
-                if(nAnchorTrIndex < nTargetTrIndex) {
-                    for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                        this.selectRow(allRows[i]);
-                    }
-                }
-                // Select all rows between target row and anchor row,
-                // including the target row and anchor row
-                else {
-                    for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
-                        this.selectRow(allRows[i]);
-                    }
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetRow.id;
 
-                // Select target row only
-                this.selectRow(elTargetRow);
-            }
-        }
-        // Only CTRL
-        else if((sMode != "single") && bCTRL) {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetRow.id;
 
-            // Toggle selection of target
-            if(this.isSelected(elTargetRow)) {
-                this.unselectRow(elTargetRow);
-            }
-            else {
-                this.selectRow(elTargetRow);
-            }
-        }
-        // Neither SHIFT nor CTRL
-        else if(sMode == "single") {
-            this.unselectAllRows();
-            this.selectRow(elTargetRow);
-        }
-        // Neither SHIFT nor CTRL
-        else {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetRow.id;
 
-            // Select only target
-            this.unselectAllRows();
-            this.selectRow(elTargetRow);
-        }
-        YAHOO.util.Event.stopEvent(evt);
 
-        // Clear any selections that are a byproduct of the click or dblclick
-        var sel;
-        if(window.getSelection) {
-               sel = window.getSelection();
-        }
-        else if(document.getSelection) {
-               sel = document.getSelection();
-        }
-        else if(document.selection) {
-               sel = document.selection;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TABLE FUNCTIONS
+
+/**
+ * Resets a RecordSet with the given data and populates the page view
+ * with the new data. Any previous data and selection states are cleared.
+ * However, sort states are not cleared, so if the given data is in a particular
+ * sort order, implementers should take care to reset the sortedBy property. If
+ * pagination is enabled, the currentPage is shown and Paginator UI updated,
+ * otherwise all rows are displayed as a single page. For performance, existing
+ * DOM elements are reused when possible.
+ *
+ * @method initializeTable
+ */
+initializeTable : function() {
+    // Reset init flag
+    this._bInit = true;
+    
+    // Clear the RecordSet
+    this._oRecordSet.reset();
+
+    // Clear selections
+    this._unselectAllTrEls();
+    this._unselectAllTdEls();
+    this._aSelections = null;
+    this._oAnchorRecord = null;
+    this._oAnchorCell = null;
+},
+
+/**
+ * Renders the view with existing Records from the RecordSet while
+ * maintaining sort, pagination, and selection states. For performance, reuses
+ * existing DOM elements when possible while deleting extraneous elements.
+ *
+ * @method render
+ */
+render : function() {
+    this._oChain.stop();
+    this.showTableMessage(DT.MSG_LOADING, DT.CLASS_LOADING);
+
+    var i, j, k, l, len, allRecords;
+
+    // Paginator is enabled, show a subset of Records and update Paginator UI
+    var oPaginator = this.get('paginator');
+    var bPaginated = oPaginator instanceof Pag || this.get('paginated');
+    if(bPaginated) {
+        if (oPaginator instanceof Pag) {
+            allRecords = this._oRecordSet.getRecords(
+                            oPaginator.getStartIndex(),
+                            oPaginator.getRowsPerPage());
+            oPaginator.render();
         }
-        if(sel) {
-            if(sel.empty) {
-                sel.empty();
-            }
-            else if (sel.removeAllRanges) {
-                sel.removeAllRanges();
-            }
-            else if(sel.collapse) {
-                sel.collapse();
-            }
+        else {
+            // Backward compatibility
+            this.updatePaginator();
+            var rowsPerPage = oPaginator.rowsPerPage;
+            var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
+            allRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
+            this.formatPaginators();
         }
     }
+    // Show all records
     else {
+        allRecords = this._oRecordSet.getRecords();
     }
-};
 
-/**
- * Overridable custom event handler to select cell.
- *
- * @method onEventSelectCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventSelectCell = function(oArgs) {
-    var sMode = this.get("selectionMode");
-    if ((sMode == "standard") || (sMode == "single")) {
-        return;
-    }
+    var elTbody = this._elTbody;
+    var allRows = elTbody.rows;
 
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
+    // Should have rows
+    if(lang.isArray(allRecords) && (allRecords.length > 0)) {
+        // Keep track of selected rows
+        var allSelectedRows = this.getSelectedRows();
+        // Keep track of selected cells
+        var allSelectedCells = this.getSelectedCells();
+        // Anything to reinstate?
+        var bReselect = (allSelectedRows.length>0) || (allSelectedCells.length > 0);
 
-    var bSHIFT = evt.shiftKey;
-    var bCTRL = evt.ctrlKey;
-    var i, j, nAnchorTrIndex, nAnchorTdIndex, currentRow, startIndex, endIndex;
-    
-    var elTargetCell = this.getTdEl(elTarget);
-    if(elTargetCell) {
-        var elTargetRow = this.getTrEl(elTargetCell);
-        var allRows = this._elTbody.rows;
-        var nTargetTrIndex = elTargetRow.sectionRowIndex;
-        var nTargetTdIndex = elTarget.yuiCellIndex;
-        var elAnchorCell = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+        // Remove extra rows from the bottom so as to preserve ID order
+        while(elTbody.hasChildNodes() && (allRows.length > allRecords.length)) {
+            elTbody.deleteRow(-1);
+        }
 
-        // Both SHIFT and CTRL
-        if((sMode != "singlecell") && bSHIFT && bCTRL) {
-            // Validate anchor
-            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
-                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
-                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
-                
-                // Anchor is selected
-                if(this.isSelected(elAnchorCell)) {
-                    // All cells are on the same row
-                    if(nAnchorTrIndex == nTargetTrIndex) {
-                        // Select all cells between anchor cell and target cell, including target cell
-                        if(nAnchorTdIndex < nTargetTdIndex) {
-                            for(i=nAnchorTdIndex+1; i<=nTargetTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                        // Select all cells between target cell and anchor cell, including target cell
-                        else if(nTargetTdIndex < nAnchorTdIndex) {
-                            for(i=nTargetTdIndex; i<nAnchorTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                    }
-                    // Anchor row is above target row
-                    else if(nAnchorTrIndex < nTargetTrIndex) {
-                        if(sMode == "cellrange") {
-                            // Select all cells on anchor row from anchor cell to the end of the row
-                            for(i=nAnchorTdIndex+1; i<allRows[nAnchorTrIndex].cells.length; i++) {
-                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
-                            }
-                            
-                            // Select all cells on all rows between anchor row and target row
-                            for(i=nAnchorTrIndex+1; i<nTargetTrIndex; i++) {
-                                for(j=0; j<allRows[i].cells.length; j++){
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
+        // Unselect all TR and TD elements in the UI
+        if(bReselect) {
+            this._unselectAllTrEls();
+            this._unselectAllTdEls();
+        }
 
-                            // Select all cells on target row from first cell to the target cell
-                            for(i=0; i<=nTargetTdIndex; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
-                        }
-                        else if(sMode == "cellblock") {
-                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-                            
-                            // Select all cells from startIndex to endIndex on rows between anchor row and target row
-                            for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                                for(j=startIndex; j<=endIndex; j++) {
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    // Anchor row is below target row
-                    else {
-                        if(sMode == "cellrange") {
-                            // Select all cells on target row from target cell to the end of the row
-                            for(i=nTargetTdIndex; i<allRows[nTargetTrIndex].cells.length; i++) {
-                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
+        this.hideTableMessage();
 
-                            // Select all cells on all rows between target row and anchor row
-                            for(i=nTargetTrIndex+1; i<nAnchorTrIndex; i++) {
-                                for(j=0; j<allRows[i].cells.length; j++){
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
+        // How many rows to work with each loop
+        var loopN = this.get("renderLoopSize");
+        var loopStart,
+            loopEnd;
 
-                            // Select all cells on anchor row from first cell to the anchor cell
-                            for(i=0; i<nAnchorTdIndex; i++) {
-                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
-                            }
+        // From the top, update in-place existing rows, so as to reuse DOM elements
+        if(allRows.length > 0) {
+            loopEnd = allRows.length; // End at last row
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        var i = oArg.nCurrentRow,
+                            // Must reference allRows.length instead of loopEnd
+                            // here because loopEnd is reused below outside
+                            // this closure.
+                            len = loopN > 0 ? Math.min(i + loopN,allRows.length) : allRows.length;
+                        for(; i < len; ++i) {
+                            this._updateTrEl(allRows[i], allRecords[i]);
                         }
-                        else if(sMode == "cellblock") {
-                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-
-                            // Select all cells from startIndex to endIndex on rows between target row and anchor row
-                            for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
-                                for(j=endIndex; j>=startIndex; j--) {
-                                    this.selectCell(allRows[i].cells[j]);
-                                }
-                            }
+                        if (loopN > 0) {
+                            this._syncColWidths();
                         }
+                        oArg.nCurrentRow = i;
                     }
-                }
-                // Anchor cell is unselected
-                else {
-                    // All cells are on the same row
-                    if(nAnchorTrIndex == nTargetTrIndex) {
-                        // Unselect all cells between anchor cell and target cell
-                        if(nAnchorTdIndex < nTargetTdIndex) {
-                            for(i=nAnchorTdIndex+1; i<nTargetTdIndex; i++) {
-                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
+                },
+                iterations: (loopN > 0) ? Math.ceil(loopEnd/loopN) : 1,
+                argument: {nCurrentRow:0}, // Start at first row
+                scope: this,
+                timeout: (loopN > 0) ? 0 : -1
+            });
+        }
+
+        // Add more TR elements as necessary
+        loopStart = allRows.length; // where to start
+        loopEnd = allRecords.length; // where to end
+        var nRowsNeeded = (loopEnd - loopStart); // how many needed
+        if(nRowsNeeded > 0) {
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        var i = oArg.nCurrentRow,
+                            len = loopN > 0 ? Math.min(i + loopN,loopEnd) : loopEnd,
+                            df = document.createDocumentFragment(),
+                            tr;
+                        for(; i < len; ++i) {
+                            tr = this._createTrEl(allRecords[i]);
+                            tr.className = (i%2) ? DT.CLASS_ODD : DT.CLASS_EVEN;
+                            df.appendChild(tr);
                         }
-                        // Select all cells between target cell and anchor cell
-                        else if(nTargetTdIndex < nAnchorTdIndex) {
-                            for(i=nTargetTdIndex+1; i<nAnchorTdIndex; i++) {
-                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
-                            }
+                        this._elTbody.appendChild(df);
+                        if (loopN > 0) {
+                            this._syncColWidths();
                         }
+                        oArg.nCurrentRow = i;
                     }
-                    // Anchor row is above target row
-                    if(nAnchorTrIndex < nTargetTrIndex) {
-                        // Unselect all cells from anchor cell to target cell
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the anchor row, only unselect cells after the anchor cell
-                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j>nAnchorTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the target row, only unelect cells before the target cell
-                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j<nTargetTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
+                },
+                iterations: (loopN > 0) ? Math.ceil(nRowsNeeded/loopN) : 1,
+                argument: {nCurrentRow:loopStart}, // start at last row
+                scope: this,
+                timeout: (loopN > 0) ? 0 : -1
+            });
+        }
+
+        this._oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId) {
+                    this._setFirstRow();
+                    this._setLastRow();
+
+                    // Reinstate selected and sorted classes
+                    if(bReselect) {
+                        // Loop over each row
+                        for(j=0; j<allRows.length; j++) {
+                            var thisRow = allRows[j];
+                            var sMode = this.get("selectionMode");
+                            if ((sMode == "standard") || (sMode == "single")) {
+                                // Set SELECTED
+                                for(k=0; k<allSelectedRows.length; k++) {
+                                    if(allSelectedRows[k] === thisRow.yuiRecordId) {
+                                        Dom.addClass(thisRow, DT.CLASS_SELECTED);
+                                        if(j === allRows.length-1) {
+                                            this._oAnchorRecord = this.getRecord(thisRow.yuiRecordId);
+                                        }
                                     }
                                 }
-                                // Unselect all cells on this row
-                                else {
-                                    this.unselectCell(currentRow.cells[j]);
-                                }
                             }
-                        }
-                    }
-                    // Anchor row is below target row
-                    else {
-                        // Unselect all cells from target cell to anchor cell
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the target row, only unselect cells after the target cell
-                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j>nTargetTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the anchor row, only unselect cells before the anchor cell
-                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j<nAnchorTdIndex) {
-                                        this.unselectCell(currentRow.cells[j]);
+                            else {
+                                // Loop over each cell
+                                for(k=0; k<thisRow.cells.length; k++) {
+                                    var thisCell = thisRow.cells[k];
+                                    // Set SELECTED
+                                    for(l=0; l<allSelectedCells.length; l++) {
+                                        if((allSelectedCells[l].recordId === thisRow.yuiRecordId) &&
+                                                (allSelectedCells[l].columnId === thisCell.yuiColumnId)) {
+                                            Dom.addClass(thisCell, DT.CLASS_SELECTED);
+                                            if(k === thisRow.cells.length-1) {
+                                                this._oAnchorCell = {record:this.getRecord(thisRow.yuiRecordId), column:this.getColumnById(thisCell.yuiColumnId)};
+                                            }
+                                        }
                                     }
                                 }
-                                // Unselect all cells on this row
-                                else {
-                                    this.unselectCell(currentRow.cells[j]);
-                                }
                             }
                         }
                     }
-
-                    // Select the target cell
-                    this.selectCell(elTargetCell);
                 }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetCell.id;
-
-                // Toggle selection of target
-                if(this.isSelected(elTargetCell)) {
-                    this.unselectCell(elTargetCell);
+                
+                if(this._bInit) {
+                    this._oChain.add({
+                        method: function() {
+                            if((this instanceof DT) && this._sId && this._bInit) {
+                                this._bInit = false;
+                                this.fireEvent("initEvent");
+                            }
+                        },
+                        scope: this
+                    });
+                    this._oChain.run();
                 }
                 else {
-                    this.selectCell(elTargetCell);
+                    this.fireEvent("renderEvent");
+                    // Backward compatibility
+                    this.fireEvent("refreshEvent");
                 }
-            }
-        }
-        // Only SHIFT
-        else if((sMode != "singlecell") && bSHIFT) {
-            this.unselectAllCells();
-
-            // Validate anchor
-            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
-                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
-                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
-                
-                // All cells are on the same row
-                if(nAnchorTrIndex == nTargetTrIndex) {
-                    // Select all cells between anchor cell and target cell,
-                    // including the anchor cell and target cell
-                    if(nAnchorTdIndex < nTargetTdIndex) {
-                        for(i=nAnchorTdIndex; i<=nTargetTdIndex; i++) {
-                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                        }
-                    }
-                    // Select all cells between target cell and anchor cell
-                    // including the target cell and anchor cell
-                    else if(nTargetTdIndex < nAnchorTdIndex) {
-                        for(i=nTargetTdIndex; i<=nAnchorTdIndex; i++) {
-                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
-                        }
-                    }
-                }
-                // Anchor row is above target row
-                else if(nAnchorTrIndex < nTargetTrIndex) {
-                    if(sMode == "cellrange") {
-                        // Select all cells from anchor cell to target cell
-                        // including the anchor cell and target cell
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the anchor row, only select the anchor cell and after
-                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j>=nAnchorTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the target row, only select the target cell and before
-                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j<=nTargetTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Select all cells on this row
-                                else {
-                                    this.selectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
-                    }
-                    else if(sMode == "cellblock") {
-                        // Select the cellblock from anchor cell to target cell
-                        // including the anchor cell and the target cell
-                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-
-                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
-                            for(j=startIndex; j<=endIndex; j++) {
-                                this.selectCell(allRows[i].cells[j]);
-                            }
-                        }
-                        
-                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
-                    }
+            
+            
+            },
+            scope: this,
+            timeout: (loopN > 0) ? 0 : -1
+        }); 
+        
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId) {
+                    this._syncColWidths();
                 }
-                // Anchor row is below target row
-                else {
-                    if(sMode == "cellrange") {
-                        // Select all cells from target cell to anchor cell,
-                        // including the target cell and anchor cell
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            currentRow = allRows[i];
-                            for(j=0; j<currentRow.cells.length; j++) {
-                                // This is the target row, only select the target cell and after
-                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
-                                    if(j>=nTargetTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // This is the anchor row, only select the anchor cell and before
-                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
-                                    if(j<=nAnchorTdIndex) {
-                                        this.selectCell(currentRow.cells[j]);
-                                    }
-                                }
-                                // Select all cells on this row
-                                else {
-                                    this.selectCell(currentRow.cells[j]);
-                                }
-                            }
-                        }
+            },
+            scope: this
+        });
+        
+        // Bug 1741322: Force FF to redraw to fix squishy headers on wide tables
+        if(ua.gecko) {
+            this._oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId) {
+                        Dom.removeClass(this.getContainerEl(),"yui-dt-noop");
                     }
-                    else if(sMode == "cellblock") {
-                        // Select the cellblock from target cell to anchor cell
-                        // including the target cell and the anchor cell
-                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
-                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
-
-                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
-                            for(j=startIndex; j<=endIndex; j++) {
-                                this.selectCell(allRows[i].cells[j]);
-                            }
-                        }
-                        
-                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
+                },
+                scope: this
+            });
+            this._oChain.add({
+                method: function() {
+                    if((this instanceof DT) && this._sId) {
+                        Dom.addClass(this.getContainerEl(),"yui-dt-noop");
                     }
-                }
-            }
-            // Invalid anchor
-            else {
-                // Set anchor
-                this._sSelectionAnchorId = elTargetCell.id;
-
-                // Select target only
-                this.selectCell(elTargetCell);
-            }
-        }
-        // Only CTRL
-        else if((sMode != "singlecell") && bCTRL) {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetCell.id;
-
-            // Toggle selection of target
-            if(this.isSelected(elTargetCell)) {
-                this.unselectCell(elTargetCell);
-            }
-            else {
-                this.selectCell(elTargetCell);
-            }
+                },
+                scope:this
+            });
         }
-        // Neither SHIFT nor CTRL, or multi-selection has been disabled
-        else {
-            // Set anchor
-            this._sSelectionAnchorId = elTargetCell.id;
-
-            // Select only target
-            this.unselectAllCells();
-            this.selectCell(elTargetCell);
+            
+        this._oChain.run();  
+    }
+    // Empty
+    else {
+        // Remove all rows
+        while(elTbody.hasChildNodes()) {
+            elTbody.deleteRow(-1);
         }
 
-        YAHOO.util.Event.stopEvent(evt);
+        this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+    }
+},
 
-        // Clear any selections that are a byproduct of the click or dblclick
-        var sel;
-        if(window.getSelection) {
-               sel = window.getSelection();
-        }
-        else if(document.getSelection) {
-               sel = document.getSelection();
-        }
-        else if(document.selection) {
-               sel = document.selection;
-        }
-        if(sel) {
-            if(sel.empty) {
-                sel.empty();
-            }
-            else if (sel.removeAllRanges) {
-                sel.removeAllRanges();
-            }
-            else if(sel.collapse) {
-                sel.collapse();
-            }
+/**
+ * Nulls out the entire DataTable instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+destroy : function() {
+    this._oChain.stop();
+    
+    //TODO: destroy static resizer proxy and column proxy?
+    
+    var i;
+    // Destroy ColumnDDs
+    var aTree = this._oColumnSet.tree[0];
+    for(i=0; i<aTree.length; i++) {
+        if(aTree[i]._dd) {
+            aTree[i]._dd = aTree[i]._dd.unreg();
         }
     }
-    else {
-    }
-};
-
-
-
 
+    // Destroy ColumnResizers
+    var aKeys = this._oColumnSet.keys;
+    for(i=0; i<aKeys.length; i++) {
+        if(aKeys[i]._ddResizer) {
+            aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg();
+        }
+    }
+    
+    // Destroy Cell Editor
+    Ev.purgeElement(this._oCellEditor.container, true);
+    document.body.removeChild(this._oCellEditor.container);
 
+    var instanceName = this.toString();
+    var elContainer = this._elContainer;
 
+    // Unhook custom events
+    this._oRecordSet.unsubscribeAll();
+    this.unsubscribeAll();
 
+    // Unhook DOM events
+    Ev.purgeElement(elContainer, true);
+    Ev.removeListener(document, "click", this._onDocumentClick);
 
+    // Remove DOM elements
+    elContainer.innerHTML = "";
 
+    // Null out objects
+    for(var param in this) {
+        if(lang.hasOwnProperty(this, param)) {
+            this[param] = null;
+        }
+    }
+    
+    // Clean up static values
+    DT._nCurrentCount--;
+    
+    if(DT._nCurrentCount < 1) {
+        if(DT._elStylesheet) {
+            document.getElementsByTagName('head')[0].removeChild(DT._elStylesheet);
+            DT._elStylesheet = null;
+        }
+    }
 
+},
 
 /**
- * Overridable custom event handler to highlight row.
+ * Displays message within secondary TBODY.
  *
- * @method onEventHighlightRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method showTableMessage
+ * @param sHTML {String} (optional) Value for innerHTMlang.
+ * @param sClassName {String} (optional) Classname.
  */
-YAHOO.widget.DataTable.prototype.onEventHighlightRow = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.highlightRow(elTarget);
-};
+showTableMessage : function(sHTML, sClassName) {
+    var elCell = this._elMsgTd;
+    if(lang.isString(sHTML)) {
+        elCell.firstChild.innerHTML = sHTML;
+    }
+    if(lang.isString(sClassName)) {
+        Dom.addClass(elCell.firstChild, sClassName);
+    }
+
+    var elCellLiner = elCell.firstChild;
+    elCellLiner.style.width = ((this.getTheadEl().parentNode.offsetWidth) -
+        (parseInt(Dom.getStyle(elCellLiner,"paddingLeft"),10)) -
+        (parseInt(Dom.getStyle(elCellLiner,"paddingRight"),10))) + "px";
+
+    this._elMsgTbody.style.display = "";
+    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
+},
 
 /**
- * Overridable custom event handler to unhighlight row.
+ * Hides secondary TBODY.
  *
- * @method onEventUnhighlightRow
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method hideTableMessage
  */
-YAHOO.widget.DataTable.prototype.onEventUnhighlightRow = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.unhighlightRow(elTarget);
-};
+hideTableMessage : function() {
+    if(this._elMsgTbody.style.display != "none") {
+        this._elMsgTbody.style.display = "none";
+        this.fireEvent("tableMsgHideEvent");
+    }
+},
 
 /**
- * Overridable custom event handler to highlight cell.
+ * Brings focus to the TBODY element. Alias to focusTbodyEl.
  *
- * @method onEventHighlightCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method focus
  */
-YAHOO.widget.DataTable.prototype.onEventHighlightCell = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.highlightCell(elTarget);
-};
+focus : function() {
+    this.focusTbodyEl();
+},
 
 /**
- * Overridable custom event handler to unhighlight cell.
+ * Brings focus to the THEAD element.
  *
- * @method onEventUnhighlightCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method focusTheadEl
  */
-YAHOO.widget.DataTable.prototype.onEventUnhighlightCell = function(oArgs) {
-    var evt = oArgs.event;
-    var elTarget = oArgs.target;
-    this.unhighlightCell(elTarget);
-};
+focusTheadEl : function() {
+    this._focusEl(this._elThead);
+},
 
 /**
- * Overridable custom event handler to format cell.
+ * Brings focus to the TBODY element.
  *
- * @method onEventFormatCell
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
+ * @method focusTbodyEl
  */
-YAHOO.widget.DataTable.prototype.onEventFormatCell = function(oArgs) {
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    var elTag = target.tagName.toLowerCase();
+focusTbodyEl : function() {
+    this._focusEl(this._elTbody);
+},
 
-    var elCell = this.getTdEl(target);
-    if(elCell && YAHOO.lang.isNumber(elCell.yuiColumnId)) {
-        var oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
-        this.formatCell(elCell, this.getRecord(elCell), oColumn);
-    }
-    else {
-    }
-};
 
-/**
- * Overridable custom event handler to edit cell.
- *
- * @method onEventShowCellEditor
- * @param oArgs.event {HTMLEvent} Event object.
- * @param oArgs.target {HTMLElement} Target element.
- */
-YAHOO.widget.DataTable.prototype.onEventShowCellEditor = function(oArgs) {
-    var evt = oArgs.event;
-    var target = oArgs.target;
-    var elTag = target.tagName.toLowerCase();
 
-    var elCell = this.getTdEl(target);
-    if(elCell) {
-        this.showCellEditor(elCell);
-    }
-    else {
-    }
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.onEventEditCell = function(oArgs) {
-    this.onEventShowCellEditor(oArgs);
-};
 
-/**
- * Overridable custom event handler to save Cell Editor input.
- *
- * @method onEventSaveCellEditor
- * @param oArgs.editor {Object} Cell Editor object literal.
- */
-YAHOO.widget.DataTable.prototype.onEventSaveCellEditor = function(oArgs) {
-    this.saveCellEditor();
-};
 
-/**
- * Callback function for creating a progressively enhanced DataTable first
- * receives data from DataSource and populates the RecordSet, then initializes
- * DOM elements.
- *
- * @method _onDataReturnEnhanceTable
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- * @private
- */
-YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable = function(sRequest, oResponse) {
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
 
-    // Data ok to populate
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        // Update RecordSet
-        this._oRecordSet.addRecords(oResponse.results);
 
-        // Initialize DOM elements
-        this._initTableEl();
-        if(!this._elTable || !this._elThead || !this._elTbody) {
-            return;
-        }
 
-        // Call Element's constructor after DOM elements are created
-        // but *before* UI is updated with data
-        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
 
-        //HACK: Set the Paginator values
-        if(this._oConfigs.paginator) {
-            this.updatePaginator(this._oConfigs.paginator);
-        }
 
-        // Update the UI
-        this.refreshView();
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
-    }
-    // Empty
-    else if(ok){
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-    }
-};
-    
-/**
- * Callback function receives data from DataSource and populates an entire
- * DataTable with Records and TR elements, clearing previous Records, if any.
- *
- * @method onDataReturnInitializeTable
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- */
-YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
 
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
 
-    // Data ok to populate
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.initializeTable(oResponse.results);
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
-    }
-    // Empty
-    else if(ok){
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
-    }
-};
-// Backward compatibility
-YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows = function(sRequest, oResponse) {
-    this.onDataReturnInitializeTable(sRequest, oResponse);
-};
 
-/**
- * Callback function receives data from DataSource and appends to an existing
- * DataTable new Records and, if applicable, creates or updates
- * corresponding TR elements.
- *
- * @method onDataReturnAppendRows
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- */
-YAHOO.widget.DataTable.prototype.onDataReturnAppendRows = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
-    
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
-    
-    // Data ok to append
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.addRows(oResponse.results);
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
-    }
-};
 
-/**
- * Callback function receives data from DataSource and inserts into top of an
- * existing DataTable new Records and, if applicable, creates or updates
- * corresponding TR elements.
- *
- * @method onDataReturnInsertRows
- * @param sRequest {String} Original request.
- * @param oResponse {Object} Response object.
- * @param bError {Boolean} (optional) True if there was a data error.
- */
-YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oResponse) {
-    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
-    
-    // Pass data through abstract method for any transformations
-    var ok = this.doBeforeLoadData(sRequest, oResponse);
-    
-    // Data ok to append
-    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
-        this.addRows(oResponse.results, 0);
-    }
-    // Error
-    else if(ok && oResponse.error) {
-        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
-    }
-};
 
 
 
@@ -6929,500 +9422,129 @@ YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oRe
 
 
 
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Custom Events
-    //
-    /////////////////////////////////////////////////////////////////////////////
 
-    /**
-     * Fired when the DataTable instance's initialization is complete.
-     *
-     * @event initEvent
-     */
 
-    /**
-     * Fired when the DataTable's view is refreshed.
-     *
-     * @event refreshEvent
-     */
 
-    /**
-     * Fired when data is returned from DataSource.
-     *
-     * @event dataReturnEvent
-     * @param oArgs.request {String} Original request.
-     * @param oArgs.response {Object} Response object.
-     */
 
-    /**
-     * Fired when the DataTable has a focus.
-     *
-     * @event tableFocusEvent
-     */
 
-    /**
-     * Fired when the DataTable has a blur.
-     *
-     * @event tableBlurEvent
-     */
 
-    /**
-     * Fired when the DataTable has a mouseover.
-     *
-     * @event tableMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a mouseout.
-     *
-     * @event tableMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a mousedown.
-     *
-     * @event tableMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a click.
-     *
-     * @event tableClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when the DataTable has a dblclick.
-     *
-     * @event tableDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
-     *
-     */
 
-    /**
-     * Fired when a fixed scrolling DataTable has a scroll.
-     *
-     * @event tableScrollEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
-     * or the DataTable's TBODY element (everyone else).
-     *
-     */
 
-    /**
-     * Fired when a message is shown in the DataTable's message element.
-     *
-     * @event tableMsgShowEvent
-     * @param oArgs.html {String} The HTML displayed.
-     * @param oArgs.className {String} The className assigned.
-     *
-     */
 
-    /**
-     * Fired when the DataTable's message element is hidden.
-     *
-     * @event tableMsgHideEvent
-     */
 
-    /**
-     * Fired when a header row has a mouseover.
-     *
-     * @event headerRowMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a mouseout.
-     *
-     * @event headerRowMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
 
-    /**
-     * Fired when a header row has a mousedown.
-     *
-     * @event headerRowMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
+// RECORDSET FUNCTIONS
 
-    /**
-     * Fired when a header row has a click.
-     *
-     * @event headerRowClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
+/**
+ * Returns Record index for given TR element or page row index.
+ *
+ * @method getRecordIndex
+ * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
+ * element reference or page row index.
+ * @return {Number} Record's RecordSet index, or null.
+ */
+getRecordIndex : function(row) {
+    var nTrIndex;
 
-    /**
-     * Fired when a header row has a dblclick.
-     *
-     * @event headerRowDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
+    if(!lang.isNumber(row)) {
+        // By Record
+        if(row instanceof YAHOO.widget.Record) {
+            return this._oRecordSet.getRecordIndex(row);
+        }
+        // By element reference
+        else {
+            // Find the TR element
+            var el = this.getTrEl(row);
+            if(el) {
+                nTrIndex = el.sectionRowIndex;
+            }
+        }
+    }
+    // By page row index
+    else {
+        nTrIndex = row;
+    }
 
-    /**
-     * Fired when a header cell has a mouseover.
-     *
-     * @event headerCellMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     *
-     */
+    if(lang.isNumber(nTrIndex)) {
+        var oPaginator = this.get("paginator");
+        if(oPaginator instanceof Pag) {
+            return oPaginator.get('recordOffset') + nTrIndex;
+        }
+        else if (this.get('paginated')) {
+            return oPaginator.startRecordIndex + nTrIndex;
+        }
+        else {
+            return nTrIndex;
+        }
+    }
 
-    /**
-     * Fired when a header cell has a mouseout.
-     *
-     * @event headerCellMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     *
-     */
+    return null;
+},
 
-    /**
-     * Fired when a header cell has a mousedown.
-     *
-     * @event headerCellMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
+/**
+ * For the given identifier, returns the associated Record instance.
+ *
+ * @method getRecord
+ * @param row {HTMLElement | Number | String} DOM reference to a TR element (or
+ * child of a TR element), RecordSet position index, or Record ID.
+ * @return {YAHOO.widget.Record} Record instance.
+ */
+getRecord : function(row) {
+    var oRecord = this._oRecordSet.getRecord(row);
 
-    /**
-     * Fired when a header cell has a click.
-     *
-     * @event headerCellClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
+    if(!oRecord) {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow) {
+            oRecord = this._oRecordSet.getRecord(elRow.yuiRecordId);
+        }
+    }
 
-    /**
-     * Fired when a header cell has a dblclick.
-     *
-     * @event headerCellDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
+    if(oRecord instanceof YAHOO.widget.Record) {
+        return this._oRecordSet.getRecord(oRecord);
+    }
+    else {
+        return null;
+    }
+},
 
-    /**
-     * Fired when a header label has a mouseover.
-     *
-     * @event headerLabelMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     *
-     */
 
-    /**
-     * Fired when a header label has a mouseout.
-     *
-     * @event headerLabelMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     *
-     */
 
-    /**
-     * Fired when a header label has a mousedown.
-     *
-     * @event headerLabelMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a header label has a click.
-     *
-     * @event headerLabelClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a header label has a dblclick.
-     *
-     * @event headerLabelDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SPAN element.
-     */
 
-    /**
-     * Fired when a column is sorted.
-     *
-     * @event columnSortEvent
-     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
-     * @param oArgs.dir {String} Sort direction "asc" or "desc".
-     */
 
-    /**
-     * Fired when a column is resized.
-     *
-     * @event columnResizeEvent
-     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
-     * @param oArgs.target {HTMLElement} The TH element.
-     */
 
-    /**
-     * Fired when a row has a mouseover.
-     *
-     * @event rowMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
-
-    /**
-     * Fired when a row has a mouseout.
-     *
-     * @event rowMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
-
-    /**
-     * Fired when a row has a mousedown.
-     *
-     * @event rowMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
-
-    /**
-     * Fired when a row has a click.
-     *
-     * @event rowClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
-
-    /**
-     * Fired when a row has a dblclick.
-     *
-     * @event rowDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TR element.
-     */
-
-    /**
-     * Fired when a row is added.
-     *
-     * @event rowAddEvent
-     * @param oArgs.record {YAHOO.widget.Record} The added Record.
-     */
 
-    /**
-     * Fired when a row is updated.
-     *
-     * @event rowUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
-     * @param oArgs.oldData {Object} Object literal of the old data.
-     */
 
-    /**
-     * Fired when a row is deleted.
-     *
-     * @event rowDeleteEvent
-     * @param oArgs.oldData {Object} Object literal of the deleted data.
-     * @param oArgs.recordIndex {Number} Index of the deleted Record.
-     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if in view.
-     */
 
-    /**
-     * Fired when a row is selected.
-     *
-     * @event rowSelectEvent
-     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
-     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
-     */
 
-    /**
-     * Fired when a row is unselected.
-     *
-     * @event rowUnselectEvent
-     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
-     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
-     */
 
-    /*TODO: delete and use rowUnselectEvent?
-     * Fired when all row selections are cleared.
-     *
-     * @event unselectAllRowsEvent
-     */
 
-    /*
-     * Fired when a row is highlighted.
-     *
-     * @event rowHighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TR element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     */
 
-    /*
-     * Fired when a row is unhighlighted.
-     *
-     * @event rowUnhighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TR element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     */
 
-    /**
-     * Fired when a cell has a mouseover.
-     *
-     * @event cellMouseoverEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a mouseout.
-     *
-     * @event cellMouseoutEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a mousedown.
-     *
-     * @event cellMousedownEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a click.
-     *
-     * @event cellClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell has a dblclick.
-     *
-     * @event cellDblclickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The TD element.
-     */
 
-    /**
-     * Fired when a cell is formatted.
-     *
-     * @event cellFormatEvent
-     * @param oArgs.el {HTMLElement} The formatted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The formatted Record.
-     * @param oArgs.key {String} The key of the formatted cell.
-     */
 
-    /**
-     * Fired when a cell is selected.
-     *
-     * @event cellSelectEvent
-     * @param oArgs.el {HTMLElement} The selected TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
-     * @param oArgs.key {String} The key of the selected cell.
-     */
 
-    /**
-     * Fired when a cell is unselected.
-     *
-     * @event cellUnselectEvent
-     * @param oArgs.el {HTMLElement} The unselected TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
-     * @param oArgs.key {String} The key of the unselected cell.
-     */
 
-    /**
-     * Fired when a cell is highlighted.
-     *
-     * @event cellHighlightEvent
-     * @param oArgs.el {HTMLElement} The highlighted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
-     * @param oArgs.key {String} The key of the highlighted cell.
-     */
 
-    /**
-     * Fired when a cell is unhighlighted.
-     *
-     * @event cellUnhighlightEvent
-     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
-     * @param oArgs.record {YAHOO.widget.Record} The unhighlighted Record.
-     * @param oArgs.key {String} The key of the unhighlighted cell.
-     */
 
-    /*TODO: hide from doc and use cellUnselectEvent
-     * Fired when all cell selections are cleared.
-     *
-     * @event unselectAllCellsEvent
-     */
 
-    /*TODO: implement
-     * Fired when DataTable paginator is updated.
-     *
-     * @event paginatorUpdateEvent
-     * @param paginator {Object} Object literal of Paginator values.
-     */
 
-    /**
-     * Fired when an Editor is activated.
-     *
-     * @event editorShowEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
 
-    /**
-     * Fired when an active Editor has a keydown.
-     *
-     * @event editorKeydownEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.event {HTMLEvent} The event object.
-     */
 
-    /**
-     * Fired when Editor input is reverted.
-     *
-     * @event editorRevertEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.newData {Object} New data value.
-     * @param oArgs.oldData {Object} Old data value.
-     */
 
-    /**
-     * Fired when Editor input is saved.
-     *
-     * @event editorSaveEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     * @param oArgs.newData {Object} New data value.
-     * @param oArgs.oldData {Object} Old data value.
-     */
 
-    /**
-     * Fired when Editor input is canceled.
-     *
-     * @event editorCancelEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
 
-    /**
-     * Fired when an active Editor has a blur.
-     *
-     * @event editorBlurEvent
-     * @param oArgs.editor {Object} The Editor object literal.
-     */
 
 
 
@@ -7430,613 +9552,684 @@ YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oRe
 
 
 
-    /**
-     * Fired when a link is clicked.
-     *
-     * @event linkClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The A element.
-     */
 
-    /**
-     * Fired when a BUTTON element is clicked.
-     *
-     * @event buttonClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The BUTTON element.
-     */
 
-    /**
-     * Fired when a CHECKBOX element is clicked.
-     *
-     * @event checkboxClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The CHECKBOX element.
-     */
 
-    /*TODO
-     * Fired when a SELECT element is changed.
-     *
-     * @event dropdownChangeEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The SELECT element.
-     */
 
-    /**
-     * Fired when a RADIO element is clicked.
-     *
-     * @event radioClickEvent
-     * @param oArgs.event {HTMLEvent} The event object.
-     * @param oArgs.target {HTMLElement} The RADIO element.
-     */
 
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+// COLUMN FUNCTIONS
 
 /**
- * The ColumnSet class defines and manages a DataTable's Columns,
- * including nested hierarchies and access to individual Column instances.
+ * For the given identifier, returns the associated Column instance. Note: For
+ * getting Columns by Column ID string, please use the method getColumnById().
  *
- * @namespace YAHOO.widget
- * @class ColumnSet
- * @uses YAHOO.util.EventProvider
- * @constructor
- * @param aHeaders {Object[]} Array of object literals that define header cells.
+ * @method getColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ * @return {YAHOO.widget.Column} Column instance.
  */
-YAHOO.widget.ColumnSet = function(aHeaders) {
-    this._sName = "instance" + YAHOO.widget.ColumnSet._nCount;
-
-    // DOM tree representation of all Columns
-    var tree = [];
-    // Flat representation of all Columns
-    var flat = [];
-    // Flat representation of only Columns that are meant to display data
-    var keys = [];
-    // Array of HEADERS attribute values for all keys in the "keys" array
-    var headers = [];
-
-    // Tracks current node list depth being tracked
-    var nodeDepth = -1;
+getColumn : function(column) {
+    var oColumn = this._oColumnSet.getColumn(column);
 
-    // Internal recursive function to defined Column instances
-    var parseColumns = function(nodeList, parent) {
-        // One level down
-        nodeDepth++;
-
-        // Create corresponding tree node if not already there for this depth
-        if(!tree[nodeDepth]) {
-            tree[nodeDepth] = [];
+    if(!oColumn) {
+        // Validate TD element
+        var elCell = this.getTdEl(column);
+        if(elCell) {
+            oColumn = this._oColumnSet.getColumnById(elCell.yuiColumnId);
         }
+        // Validate TH element
+        else {
+            elCell = this.getThEl(column);
+            if(elCell) {
+                oColumn = this._oColumnSet.getColumnById(elCell.yuiColumnId);
+            }
+        }
+    }
+    if(!oColumn) {
+    }
+    return oColumn;
+},
 
+/**
+ * For the given Column ID, returns the associated Column instance. Note: For
+ * getting Columns by key, please use the method getColumn().
+ *
+ * @method getColumnById
+ * @param column {String} Column ID string.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+getColumnById : function(column) {
+    return this._oColumnSet.getColumnById(column);
+},
 
-        // Parse each node at this depth for attributes and any children
-        for(var j=0; j<nodeList.length; j++) {
-            var currentNode = nodeList[j];
-
-            // Instantiate a new Column for each node
-            var oColumn = new YAHOO.widget.Column(currentNode);
-
-            // Add the new Column to the flat list
-            flat.push(oColumn);
-
-            // Assign its parent as an attribute, if applicable
-            if(parent) {
-                oColumn.parent = parent;
-            }
+/**
+ * For the given Column instance, returns next direction to sort.
+ *
+ * @method getColumnSortDir
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @return {String} DataTable.widget.CLASS_ASC or DataTable.widget.CLASS_DESC.
+ */
+getColumnSortDir : function(oColumn) {
+    // Backward compatibility
+    if(oColumn.sortOptions && oColumn.sortOptions.defaultOrder) {
+        if(oColumn.sortOptions.defaultOrder == "asc") {
+            oColumn.sortOptions.defaultDir = DT.CLASS_ASC;
+        }
+        else if (oColumn.sortOptions.defaultOrder == "desc") {
+            oColumn.sortOptions.defaultDir = DT.CLASS_DESC;
+        }
+    }
+    
+    // What is the Column's default sort direction?
+    var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultDir) ? oColumn.sortOptions.defaultDir : DT.CLASS_ASC;
+
+    // Already sorted?
+    var bSorted = false;
+    var oSortedBy = this.get("sortedBy");
+    if(oSortedBy && (oSortedBy.key === oColumn.key)) {
+        bSorted = true;
+        if(oSortedBy.dir) {
+            sortDir = (oSortedBy.dir == DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
+        }
+        else {
+            sortDir = (sortDir == DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
+        }
+    }
+    return sortDir;
+},
 
-            // The Column has descendants
-            if(YAHOO.lang.isArray(currentNode.children)) {
-                oColumn.children = currentNode.children;
+/**
+ * Sorts given Column.
+ *
+ * @method sortColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param sDir {String} (Optional) DT.CLASS_ASC or
+ * DT.CLASS_DESC
+ */
+sortColumn : function(oColumn, sDir) {
+    if(oColumn && (oColumn instanceof YAHOO.widget.Column)) {
+        if(!oColumn.sortable) {
+            Dom.addClass(this.getThEl(oColumn), DT.CLASS_SORTABLE);
+        }
+        
+        // Validate given direction
+        if(sDir && (sDir !== DT.CLASS_ASC) && (sDir !== DT.CLASS_DESC)) {
+            sDir = null;
+        }
+        
+        // Get the sort dir
+        var sortDir = sDir || this.getColumnSortDir(oColumn);
 
-                // Determine COLSPAN value for this Column
-                var terminalChildNodes = 0;
-                var countTerminalChildNodes = function(ancestor) {
-                    var descendants = ancestor.children;
-                    // Drill down each branch and count terminal nodes
-                    for(var k=0; k<descendants.length; k++) {
-                        // Keep drilling down
-                        if(YAHOO.lang.isArray(descendants[k].children)) {
-                            countTerminalChildNodes(descendants[k]);
+        // Do the actual sort
+        var oSortedBy = this.get("sortedBy") || {};
+        var bSorted = (oSortedBy.key === oColumn.key) ? true : false;
+        if(!bSorted || sDir) {
+            // Is there a custom sort handler function defined?
+            var sortFnc = (oColumn.sortOptions && lang.isFunction(oColumn.sortOptions.sortFunction)) ?
+                    // Custom sort function
+                    oColumn.sortOptions.sortFunction :
+
+                    // Default sort function
+                    function(a, b, desc) {
+                        var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
+                        if(sorted === 0) {
+                            return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
                         }
-                        // Reached branch terminus
                         else {
-                            terminalChildNodes++;
+                            return sorted;
                         }
-                    }
-                };
-                countTerminalChildNodes(currentNode);
-                oColumn._colspan = terminalChildNodes;
-
-                // Cascade certain properties to children if not defined on their own
-                var currentChildren = currentNode.children;
-                for(var k=0; k<currentChildren.length; k++) {
-                    var child = currentChildren[k];
-                    if(oColumn.className && (child.className === undefined)) {
-                        child.className = oColumn.className;
-                    }
-                    if(oColumn.editor && (child.editor === undefined)) {
-                        child.editor = oColumn.editor;
-                    }
-                    if(oColumn.editorOptions && (child.editorOptions === undefined)) {
-                        child.editorOptions = oColumn.editorOptions;
-                    }
-                    if(oColumn.formatter && (child.formatter === undefined)) {
-                        child.formatter = oColumn.formatter;
-                    }
-                    if(oColumn.resizeable && (child.resizeable === undefined)) {
-                        child.resizeable = oColumn.resizeable;
-                    }
-                    if(oColumn.sortable && (child.sortable === undefined)) {
-                        child.sortable = oColumn.sortable;
-                    }
-                    if(oColumn.width && (child.width === undefined)) {
-                        child.width = oColumn.width;
-                    }
-                    // Backward compatibility
-                    if(oColumn.type && (child.type === undefined)) {
-                        child.type = oColumn.type;
-                    }
-                    if(oColumn.type && !oColumn.formatter) {
-                        oColumn.formatter = oColumn.type;
-                    }
-                    if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
-                        oColumn.label = oColumn.text;
-                    }
-                    if(oColumn.parser) {
-                    }
-                    if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
-                            (oColumn.sortOptions.descFunction))) {
-                    }
-                }
-
-                // The children themselves must also be parsed for Column instances
-                if(!tree[nodeDepth+1]) {
-                    tree[nodeDepth+1] = [];
-                }
-                parseColumns(currentChildren, oColumn);
-            }
-            // This Column does not have any children
-            else {
-                oColumn._nKeyIndex = keys.length;
-                oColumn._colspan = 1;
-                keys.push(oColumn);
-            }
+                    };
 
-            // Add the Column to the top-down tree
-            tree[nodeDepth].push(oColumn);
+            this._oRecordSet.sortRecords(sortFnc, ((sortDir == DT.CLASS_DESC) ? true : false));
+        }
+        else {
+            this._oRecordSet.reverseRecords();
         }
-        nodeDepth--;
-    };
 
-    // Parse out Column instances from the array of object literals
-    if(YAHOO.lang.isArray(aHeaders)) {
-        parseColumns(aHeaders);
-    }
+        // Update sortedBy tracker
+        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
 
-    // Determine ROWSPAN value for each Column in the tree
-    var parseTreeForRowspan = function(tree) {
-        var maxRowDepth = 1;
-        var currentRow;
-        var currentColumn;
+        // Reset to first page
+        //TODO: Keep selection in view
+        var oPaginator = this.get('paginator');
+        if (oPaginator instanceof Pag) {
+            // TODO : is this server-side op safe?  Will fire changeRequest
+            // event mechanism
+            oPaginator.setPage(1,true);
+        }
+        else if (this.get('paginated')) {
+            // Backward compatibility
+            this.updatePaginator({currentPage:1});
+        }
 
-        // Calculate the max depth of descendants for this row
-        var countMaxRowDepth = function(row, tmpRowDepth) {
-            tmpRowDepth = tmpRowDepth || 1;
+        // Update the UI
+        DT.formatTheadCell(oColumn.getThEl().firstChild.firstChild, oColumn, this);
+        this.render();
 
-            for(var n=0; n<row.length; n++) {
-                var col = row[n];
-                // Column has children, so keep counting
-                if(YAHOO.lang.isArray(col.children)) {
-                    tmpRowDepth++;
-                    countMaxRowDepth(col.children, tmpRowDepth);
-                    tmpRowDepth--;
-                }
-                // No children, is it the max depth?
-                else {
-                    if(tmpRowDepth > maxRowDepth) {
-                        maxRowDepth = tmpRowDepth;
-                    }
-                }
+        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
+    }
+    else {
+    }
+},
 
+/**
+ * Sets DOM elements of given Column to given pixel width. No validations
+ * against minimum width and no updating Column.width value.
+ *
+ * @method _setColumnWidth
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param sWidth {String} New width value.
+ * @private
+ */
+_setColumnWidth : function(oColumn, sWidth) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn) {
+        // Create STYLE node
+        if(!DT._bStylesheetFallback) {
+            var s;
+            if(!DT._elStylesheet) {
+                    s = document.createElement('style');
+                    s.type = 'text/css';
+                    DT._elStylesheet = document.getElementsByTagName('head').item(0).appendChild(s);
             }
-        };
-
-        // Count max row depth for each row
-        for(var m=0; m<tree.length; m++) {
-            currentRow = tree[m];
-            countMaxRowDepth(currentRow);
-
-            // Assign the right ROWSPAN values to each Column in the row
-            for(var p=0; p<currentRow.length; p++) {
-                currentColumn = currentRow[p];
-                if(!YAHOO.lang.isArray(currentColumn.children)) {
-                    currentColumn._rowspan = maxRowDepth;
+                
+            if(DT._elStylesheet) {
+                s = DT._elStylesheet;
+                
+                var sClassname = ".yui-dt-col-" + oColumn.getId();
+                
+                // Create rule for the Column
+                var rule = DT._oStylesheetRules[sClassname];
+                if (!rule) {
+                    if (s.styleSheet && s.styleSheet.addRule) {
+                        s.styleSheet.addRule(sClassname,"width:"+sWidth);
+                        rule = s.styleSheet.rules[s.styleSheet.rules.length-1];
+                    } else if (s.sheet && s.sheet.insertRule) {
+                        s.sheet.insertRule(sClassname+" {width:"+sWidth+";}",s.sheet.cssRules.length);
+                        rule = s.sheet.cssRules[s.sheet.cssRules.length];
+                    } else {
+                        DT._bStylesheetFallback = true;
+                    }
+                    DT._oStylesheetRules[sClassname] = rule;
                 }
+                
+                // Update existing rule for the Column
                 else {
-                    currentColumn._rowspan = 1;
+                    rule.style.width = sWidth;
                 }
+                
+                return;
             }
-
-            // Reset counter for next row
-            maxRowDepth = 1;
+            
+            DT._bStylesheetFallback = true;
         }
-    };
-    parseTreeForRowspan(tree);
-
-
-
+        // Do it the old fashioned way
+        if(DT._bStylesheetFallback) {
+            if(sWidth == "auto") {
+                sWidth = ""; 
+            }
 
+            if (!this._aFallbackColResizer[this._elTbody.rows.length]) {
+                /*
+                Compile a custom function to do all the cell width
+                assignments at the same time.  A new resizer function is created
+                for each new unique number of rows in _elTbody.  This will
+                result in a function declaration like:
+                function (oColumn,sWidth) {
+                    var colIdx = oColumn.getKeyIndex();
+                    oColumn.getThEl().firstChild.style.width =
+                    this._elTbody.rows[0].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[0].cells[colIdx].style.width =
+                    this._elTbody.rows[1].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[1].cells[colIdx].style.width =
+                    ... (for all row indices in this._elTbody.rows.length - 1)
+                    this._elTbody.rows[99].cells[colIdx].firstChild.style.width =
+                    this._elTbody.rows[99].cells[colIdx].style.width = sWidth;
+                    ending with the sWidth as the initial assignment   ^
+                }
+                */
+
+                var resizerDef = [
+                    'var colIdx=oColumn.getKeyIndex();',
+                    'oColumn.getThEl().firstChild.style.width='
+                ];
+                for (var i=this._elTbody.rows.length-1, j=2; i >= 0; --i) {
+                    resizerDef[j++] = 'this._elTbody.rows[';
+                    resizerDef[j++] = i;
+                    resizerDef[j++] = '].cells[colIdx].firstChild.style.width=';
+                    resizerDef[j++] = 'this._elTbody.rows[';
+                    resizerDef[j++] = i;
+                    resizerDef[j++] = '].cells[colIdx].style.width=';
+                }
+                resizerDef[j] = 'sWidth;';
+                this._aFallbackColResizer[this._elTbody.rows.length] =
+                    new Function('oColumn','sWidth',resizerDef.join(''));
+            }
+            var resizerFn = this._aFallbackColResizer[this._elTbody.rows.length];
 
-    // Store header relationships in an array for HEADERS attribute
-    var recurseAncestorsForHeaders = function(i, oColumn) {
-        headers[i].push(oColumn._nId);
-        if(oColumn.parent) {
-            recurseAncestorsForHeaders(i, oColumn.parent);
+            if (resizerFn) {
+                resizerFn.call(this,oColumn,sWidth);
+            }
         }
-    };
-    for(var i=0; i<keys.length; i++) {
-        headers[i] = [];
-        recurseAncestorsForHeaders(i, keys[i]);
-        headers[i] = headers[i].reverse();
-        headers[i] = headers[i].join(" ");
     }
-
-    // Save to the ColumnSet instance
-    this.tree = tree;
-    this.flat = flat;
-    this.keys = keys;
-    this.headers = headers;
-
-    YAHOO.widget.ColumnSet._nCount++;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+    else {
+    }
+},
 
 /**
- * Internal class variable to index multiple data table instances.
+ * Sets given Column to given pixel width. If new width is less than minimum
+ * width, sets to minimum width. Updates oColumn.width value.
  *
- * @property ColumnSet._nCount
- * @type number
- * @private
- * @static
+ * @method setColumnWidth
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param nWidth {Number} New width in pixels.
  */
-YAHOO.widget.ColumnSet._nCount = 0;
+setColumnWidth : function(oColumn, nWidth) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn) {
+        // Validate new width against minimum width
+        var sWidth = "";
+        if(lang.isNumber(nWidth)) {
+            sWidth = (nWidth > oColumn.minWidth) ? nWidth + "px" : oColumn.minWidth + "px";
+        }
 
-/**
- * Unique instance name.
- *
- * @property _sName
- * @type String
- * @private
- */
-YAHOO.widget.ColumnSet.prototype._sName = null;
+        // Save state
+        oColumn.width = parseInt(sWidth,10);
+        
+        // Resize the DOM elements
+        this._setColumnWidth(oColumn, sWidth);
+        
+        this._syncScrollPadding();
+        
+        this.fireEvent("columnSetWidthEvent",{column:oColumn,width:nWidth});
+    }
+    else {
+    }
+},
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Top-down tree representation of Column hierarchy.
+ * Hides given Column. NOTE: You cannot hide/show nested Columns. You can only
+ * hide/show non-nested Columns, and top-level parent Columns (which will
+ * hide/show all children Columns).
  *
- * @property tree
- * @type YAHOO.widget.Column[]
+ * @method hideColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
  */
-YAHOO.widget.ColumnSet.prototype.tree = null;
+hideColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && !oColumn.hidden) {
+        // Only top-level Columns can get hidden
+        if(oColumn.getTreeIndex() !== null) {
+            var allrows = this.getTbodyEl().rows;
+            var l = allrows.length;
+            var allDescendants = this._oColumnSet.getDescendants(oColumn);
+            for(var i=0; i<allDescendants.length; i++) {
+                var thisColumn = allDescendants[i];
+                thisColumn.hidden = true;
+
+                var elTheadCell = thisColumn.getThEl();
+                var elTheadCellLiner = elTheadCell.firstChild;
+                // Store to reinstate later
+                thisColumn._nLastWidth = elTheadCellLiner.offsetWidth - 
+                        (parseInt(Dom.getStyle(elTheadCellLiner,"paddingLeft"),10)|0) -
+                        (parseInt(Dom.getStyle(elTheadCellLiner,"paddingRight"),10)|0);
+                Dom.addClass(elTheadCell,DT.CLASS_HIDDEN);
+
+                // Adjust body cells (if key Column)
+                var thisKeyIndex = thisColumn.getKeyIndex();
+                if(thisKeyIndex !== null) {
+                    for(var j=0;j<l;j++) {
+                        Dom.addClass(allrows[j].cells[thisKeyIndex],DT.CLASS_HIDDEN);
+                    }
 
-/**
- * Flattened representation of all Columns.
- *
- * @property flat
- * @type YAHOO.widget.Column[]
- * @default []
- */
-YAHOO.widget.ColumnSet.prototype.flat = null;
+                    this._setColumnWidth(thisColumn, "1px");
+                    
+                    // Disable interactive features
+                    if(thisColumn.resizeable) {
+                        Dom.removeClass(thisColumn.getResizerEl(),DT.CLASS_RESIZER);
+                    }
+                    if(thisColumn.sortable) {
+                        Dom.removeClass(thisColumn.getThEl(),DT.CLASS_SORTABLE);
+                        thisColumn.getThEl().firstChild.firstChild.firstChild.style.display = "none";
+                    }
+                }
+                // Just set thead cell width directly for parent Column
+                else {
+                    elTheadCell.firstChild.style.width = "1px";
+                }
+                
+                this.fireEvent("columnHideEvent",{column:thisColumn});
+            }
+        }
+        else {
+        }
+    }
+},
 
 /**
- * Array of Columns that map one-to-one to a table column.
+ * Shows given Column. NOTE: You cannot hide/show nested Columns. You can only
+ * hide/show non-nested Columns, and top-level parent Columns (which will
+ * hide/show all children Columns).
  *
- * @property keys
- * @type YAHOO.widget.Column[]
- * @default []
+ * @method showColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
  */
-YAHOO.widget.ColumnSet.prototype.keys = null;
+showColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && oColumn.hidden) {
+        // Only top-level Columns can get hidden
+        if(oColumn.getTreeIndex() !== null) {
+            var allrows = this.getTbodyEl().rows;
+            var l = allrows.length;
+            var allDescendants = this._oColumnSet.getDescendants(oColumn);
+            for(var i=0; i<allDescendants.length; i++) {
+                var thisColumn = allDescendants[i];
+                thisColumn.hidden = false;
+                
+                var elTheadCell = thisColumn.getThEl();
+                Dom.removeClass(elTheadCell,DT.CLASS_HIDDEN);
+
+                // Adjust body cells (if key Column)
+                var thisKeyIndex = thisColumn.getKeyIndex();
+                if(thisKeyIndex !== null) {
+                    for(var j=0;j<l;j++) {
+                        Dom.removeClass(allrows[j].cells[thisKeyIndex],DT.CLASS_HIDDEN);
+                    }
+                    
+                    this.setColumnWidth(thisColumn, (thisColumn._nLastWidth || thisColumn.minWidth), true);
 
-/**
- * ID index of nested parent hierarchies for HEADERS accessibility attribute.
- *
- * @property headers
- * @type String[]
- * @default []
- */
-YAHOO.widget.ColumnSet.prototype.headers = null;
+                    // Enable interactive features
+                    if(thisColumn.sortable) {
+                        thisColumn.getThEl().firstChild.firstChild.firstChild.style.display = "";
+                        Dom.removeClass(thisColumn.getThEl(),DT.CLASS_SORTABLE);
+                    }
+                    if(thisColumn.resizeable) {
+                        thisColumn._ddResizer.resetResizerEl();
+                        Dom.addClass(thisColumn.getResizerEl(),DT.CLASS_RESIZER);
+                    }
+                }
+                else {
+                    elTheadCell.firstChild.style.width = "";
+                }
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+                thisColumn._nLastWidth = null;
+                this.fireEvent("columnShowEvent",{column:thisColumn});
+            }
+        }
+        else {
+        }
+    }
+},
 
 /**
- * Public accessor to the unique name of the ColumnSet instance.
+ * Removes given Column. NOTE: You cannot remove nested Columns. You can only remove
+ * non-nested Columns, and top-level parent Columns (which will remove all
+ * children Columns).
  *
- * @method toString
- * @return {String} Unique name of the ColumnSet instance.
+ * @method removeColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @return oColumn {YAHOO.widget.Column} Removed Column instance.
  */
+removeColumn : function(oColumn) {
+    var nColTreeIndex = oColumn.getTreeIndex();
+    if(nColTreeIndex !== null) {
+        this._oChain.stop();
+        var aOrigColumnDefs = this._oColumnSet.getDefinitions();
 
-YAHOO.widget.ColumnSet.prototype.toString = function() {
-    return "ColumnSet " + this._sName;
-};
+        oColumn = aOrigColumnDefs.splice(nColTreeIndex,1)[0];
+        this._initColumnSet(aOrigColumnDefs);
+        this._initTheadEls();
+
+        this.render();
+        this.fireEvent("columnRemoveEvent",{column:oColumn});
+        return oColumn;
+    }
+},
 
 /**
- * Returns Column instance with given ID number or key.
+ * Inserts given Column at the index if given, otherwise at the end. NOTE: You
+ * can only add non-nested Columns and top-level parent Columns. You cannot add
+ * a nested Column to an existing parent.
  *
- * @method getColumn
- * @param column {Number | String} ID number or unique key.
- * @return {YAHOO.widget.Column} Column instance.
+ * @method insertColumn
+ * @param oColumn {Object | YAHOO.widget.Column} Object literal Column
+ * definition or a Column instance.
+ * @param index {Number} (optional) Column key index.
  */
+insertColumn : function(oColumn, index) {
+    // Validate Column
+    if(oColumn instanceof YAHOO.widget.Column) {
+        oColumn = oColumn.getDefinition();
+    }
+    else if(oColumn.constructor !== Object) {
+        return;
+    }
+    
+    var oColumnSet = this._oColumnSet;
 
-YAHOO.widget.ColumnSet.prototype.getColumn = function(column) {
-    var allColumns = this.flat;
-    if(YAHOO.lang.isNumber(column)) {
-        for(var i=0; i<allColumns.length; i++) {
-            if(allColumns[i]._nId === column) {
-                return allColumns[i];
-            }
-        }
+    // Validate index
+    if(!lang.isValue(index) || !lang.isNumber(index)) {
+        index = oColumnSet.tree[0].length;
     }
-    else if(YAHOO.lang.isString(column)) {
-        for(i=0; i<allColumns.length; i++) {
-            if(allColumns[i].key === column) {
-                return allColumns[i];
-            }
+    
+    this._oChain.stop();
+    var aNewColumnDefs = this._oColumnSet.getDefinitions();
+    aNewColumnDefs.splice(index, 0, oColumn);
+    this._initColumnSet(aNewColumnDefs);
+    this._initTheadEls();
+    this.render();
+    this.fireEvent("columnInsertEvent",{column:oColumn,index:index});
+},
+
+/**
+ * Selects given Column. NOTE: You cannot select/unselect nested Columns. You can only
+ * select/unselect non-nested Columns, and bottom-level key Columns.
+ *
+ * @method selectColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+selectColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && !oColumn.selected) {
+        // Only bottom-level Columns can get hidden
+        if(oColumn.getKeyIndex() !== null) {
+            oColumn.selected = true;
+            
+            // Update head cell
+            var elTh = oColumn.getThEl();
+            Dom.addClass(elTh,DT.CLASS_SELECTED);
+
+            // Update body cells
+            var allRows = this.getTbodyEl().rows;
+            var oChain = this._oChain;
+            oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                        Dom.addClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_SELECTED);                    
+                    }
+                    oArg.rowIndex++;
+                },
+                scope: this,
+                iterations: allRows.length,
+                argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+            });
+            oChain.run();       
+            
+            this.fireEvent("columnSelectEvent",{column:oColumn});
+        }
+        else {
         }
     }
-    return null;
-};
-
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+},
 
 /**
- * The Column class defines and manages attributes of DataTable Columns
+ * Unselects given Column. NOTE: You cannot select/unselect nested Columns. You can only
+ * select/unselect non-nested Columns, and bottom-level key Columns.
  *
- * @namespace YAHOO.widget
- * @class Column
- * @constructor
- * @param oConfigs {Object} Object literal of configuration values.
+ * @method unSelectColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
  */
-YAHOO.widget.Column = function(oConfigs) {
-    // Internal variables
-    this._nId = YAHOO.widget.Column._nCount;
-    this._sName = "Column instance" + this._nId;
-
-    // Object literal defines Column attributes
-    if(oConfigs && (oConfigs.constructor == Object)) {
-        for(var sConfig in oConfigs) {
-            if(sConfig) {
-                this[sConfig] = oConfigs[sConfig];
-            }
+unselectColumn : function(oColumn) {
+    oColumn = this.getColumn(oColumn);
+    if(oColumn && oColumn.selected) {
+        // Only bottom-level Columns can get hidden
+        if(oColumn.getKeyIndex() !== null) {
+            oColumn.selected = false;
+            
+            // Update head cell
+            var elTh = oColumn.getThEl();
+            Dom.removeClass(elTh,DT.CLASS_SELECTED);
+
+            // Update body cells
+            var allRows = this.getTbodyEl().rows;
+            var oChain = this._oChain;
+            oChain.add({
+                method: function(oArg) {
+                    if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                        Dom.removeClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_SELECTED); 
+                    }                   
+                    oArg.rowIndex++;
+                },
+                scope: this,
+                iterations:allRows.length,
+                argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+            });
+            oChain.run();       
+            
+            this.fireEvent("columnUnselectEvent",{column:oColumn});
+        }
+        else {
         }
     }
-
-    if(!YAHOO.lang.isValue(this.key)) {
-        this.key = "yui-dt-column"+this._nId;
-    }
-    YAHOO.widget.Column._nCount++;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+},
 
 /**
- * Internal instance counter.
+ * Returns an array selected Column instances.
  *
- * @property Column._nCount
- * @type Number
- * @private
- * @static
- * @default 0
+ * @method getSelectedColumns
+ * @return {YAHOO.widget.Column[]} Array of Column instances.
  */
-YAHOO.widget.Column._nCount = 0;
+getSelectedColumns : function(oColumn) {
+    var selectedColumns = [];
+    var aKeys = this._oColumnSet.keys;
+    for(var i=0,len=aKeys.length; i<len; i++) {
+        if(aKeys[i].selected) {
+            selectedColumns[selectedColumns.length] = aKeys[i];
+        }
+    }
+    return selectedColumns;
+},
 
 /**
- * Unique instance name.
+ * Assigns the class DT.CLASS_HIGHLIGHTED to cells of the given Column.
+ * NOTE: You cannot highlight/unhighlight nested Columns. You can only
+ * highlight/unhighlight non-nested Columns, and bottom-level key Columns.
  *
- * @property _sName
- * @type String
- * @private
+ * @method highlightColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
  */
-YAHOO.widget.Column.prototype._sName = null;
+highlightColumn : function(column) {
+    var oColumn = this.getColumn(column);
+    // Only bottom-level Columns can get highlighted
+    if(oColumn && (oColumn.getKeyIndex() !== null)) {
+        /*// Make sure previous row is unhighlighted
+        var sId = oColumn.getId();
+        var sLastId = this._sLastHighlightedColumnId;
+        if(sLastId && (sLastId !== sId)) {
+            this.unhighlightColumn(this.getColumn(sLastId));
+        }*/
 
+        //this._sLastHighlightedColumnId = sId;
+            
+        // Update head cell
+        var elTh = oColumn.getThEl();
+        Dom.addClass(elTh,DT.CLASS_HIGHLIGHTED);
+
+        // Update body cells
+        var allRows = this.getTbodyEl().rows;
+        var oChain = this._oChain;
+        oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                    Dom.addClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_HIGHLIGHTED);   
+                }                 
+                oArg.rowIndex++;
+            },
+            scope: this,
+            iterations:allRows.length,
+            argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+        });
+        oChain.run();       
+            
+        this.fireEvent("columnHighlightEvent",{column:oColumn});
+    }
+    else {
+    }
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED to cells of the given Column.
+ * NOTE: You cannot highlight/unhighlight nested Columns. You can only
+ * highlight/unhighlight non-nested Columns, and bottom-level key Columns.
+ *
+ * @method unhighlightColumn
+ * @param column {HTMLElement | String | Number} DOM reference or ID string to a
+ * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
+ */
+unhighlightColumn : function(column) {
+    var oColumn = this.getColumn(column);
+    // Only bottom-level Columns can get highlighted
+    if(oColumn && (oColumn.getKeyIndex() !== null)) {
+        // Update head cell
+        var elTh = oColumn.getThEl();
+        Dom.removeClass(elTh,DT.CLASS_HIGHLIGHTED);
+
+        // Update body cells
+        var allRows = this.getTbodyEl().rows;
+        var oChain = this._oChain;
+        oChain.add({
+            method: function(oArg) {
+                if((this instanceof DT) && this._sId && allRows[oArg.rowIndex] && allRows[oArg.rowIndex].cells[oArg.cellIndex]) {
+                    Dom.removeClass(allRows[oArg.rowIndex].cells[oArg.cellIndex],DT.CLASS_HIGHLIGHTED);
+                }                 
+                oArg.rowIndex++;
+            },
+            scope: this,
+            iterations:allRows.length,
+            argument: {rowIndex:0,cellIndex:oColumn.getKeyIndex()}
+        });
+        oChain.run();       
+            
+        this.fireEvent("columnUnhighlightEvent",{column:oColumn});
+    }
+    else {
+    }
+},
 
-/**
- * Unique number assigned at instantiation, indicates original order within
- * ColumnSet.
- *
- * @property _nId
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._nId = null;
 
-/**
- * Reference to Column's index within its ColumnSet's keys array, or null if not applicable.
- *
- * @property _nKeyIndex
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._nKeyIndex = null;
 
-/**
- * Number of table cells the Column spans.
- *
- * @property _colspan
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._colspan = 1;
 
-/**
- * Number of table rows the Column spans.
- *
- * @property _rowspan
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._rowspan = 1;
 
-/**
- * Column's parent Column instance, or null.
- *
- * @property _parent
- * @type YAHOO.widget.Column
- * @private
- */
-YAHOO.widget.Column.prototype._parent = null;
 
-/**
- * Current offsetWidth of the Column (in pixels).
- *
- * @property _width
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._width = null;
 
-/**
- * Minimum width the Column can support (in pixels). Value is populated only if table
- * is fixedWidth, null otherwise.
- *
- * @property _minWidth
- * @type Number
- * @private
- */
-YAHOO.widget.Column.prototype._minWidth = null;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Associated database field, or null.
- *
- * @property key
- * @type String
- */
-YAHOO.widget.Column.prototype.key = null;
 
-/**
- * Text or HTML for display as Column's label in the TH element.
- *
- * @property label
- * @type String
- */
-YAHOO.widget.Column.prototype.label = null;
 
-/**
- * Column head cell ABBR for accessibility.
- *
- * @property abbr
- * @type String
- */
-YAHOO.widget.Column.prototype.abbr = null;
 
-/**
- * Array of object literals that define children (nested headers) of a Column.
- *
- * @property children
- * @type Object[]
- */
-YAHOO.widget.Column.prototype.children = null;
 
-/**
- * Column width.
- *
- * @property width
- * @type String
- */
-YAHOO.widget.Column.prototype.width = null;
 
-/**
- * Custom CSS class or array of classes to be applied to every cell in the Column.
- *
- * @property className
- * @type String || String[]
- */
-YAHOO.widget.Column.prototype.className = null;
 
-/**
- * Defines a format function.
- *
- * @property formatter
- * @type String || HTMLFunction
- */
-YAHOO.widget.Column.prototype.formatter = null;
 
-/**
- * Defines an editor function, otherwise Column is not editable.
- *
- * @property editor
- * @type String || HTMLFunction
- */
-YAHOO.widget.Column.prototype.editor = null;
 
-/**
- * Defines editor options for Column in an object literal of param:value pairs.
- *
- * @property editorOptions
- * @type Object
- */
-YAHOO.widget.Column.prototype.editorOptions = null;
 
-/**
- * True if Column is resizeable, false otherwise.
- *
- * @property resizeable
- * @type Boolean
- * @default false
- */
-YAHOO.widget.Column.prototype.resizeable = false;
 
-/**
- * True if Column is sortable, false otherwise.
- *
- * @property sortable
- * @type Boolean
- * @default false
- */
-YAHOO.widget.Column.prototype.sortable = false;
 
-/**
- * Default sort order for Column: "asc" or "desc".
- *
- * @property sortOptions.defaultOrder
- * @type String
- * @default null
- */
-/**
- * Custom sort handler.
- *
- * @property sortOptions.sortFunction
- * @type Function
- * @default null
- */
-YAHOO.widget.Column.prototype.sortOptions = null;
 
 
 
@@ -8052,892 +10245,4571 @@ YAHOO.widget.Column.prototype.sortOptions = null;
 
 
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
 
-/**
- * Public accessor to the unique name of the Column instance.
- *
- * @method toString
- * @return {String} Column's unique name.
- */
-YAHOO.widget.Column.prototype.toString = function() {
-    return this._sName;
-};
 
-/**
- * Returns unique number assigned at instantiation, indicates original order
- * within ColumnSet.
- *
- * @method getId
- * @return {Number} Column's unique ID number.
- */
-YAHOO.widget.Column.prototype.getId = function() {
-    return this._nId;
-};
 
-/**
- * Public accessor returns Column's key index within its ColumnSet's keys array, or
- * null if not applicable.
- *
- * @method getKeyIndex
- * @return {Number} Column's key index within its ColumnSet keys array, if applicable.
- */
-YAHOO.widget.Column.prototype.getKeyIndex = function() {
-    return this._nKeyIndex;
-};
 
-/**
- * Public accessor returns Column's parent instance if any, or null otherwise.
- *
- * @method getParent
- * @return {YAHOO.widget.Column} Column's parent instance.
- */
-YAHOO.widget.Column.prototype.getParent = function() {
-    return this._parent;
-};
 
-/**
- * Public accessor returns Column's calculated COLSPAN value.
- *
- * @method getColspan
- * @return {Number} Column's COLSPAN value.
- */
-YAHOO.widget.Column.prototype.getColspan = function() {
-    return this._colspan;
-};
-// Backward compatibility
-YAHOO.widget.Column.prototype.getColSpan = function() {
-    return this.getColspan();
-};
 
-/**
- * Public accessor returns Column's calculated ROWSPAN value.
- *
- * @method getRowspan
- * @return {Number} Column's ROWSPAN value.
- */
-YAHOO.widget.Column.prototype.getRowspan = function() {
-    return this._rowspan;
-};
 
-// Backward compatibility
-YAHOO.widget.Column.prototype.getIndex = function() {
-    return this.getKeyIndex();
-};
-YAHOO.widget.Column.prototype.format = function() {
-};
-YAHOO.widget.Column.formatCheckbox = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatCurrency = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatDate = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatEmail = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatNumber = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
-};
-YAHOO.widget.Column.formatSelect = function(elCell, oRecord, oColumn, oData) {
-    YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
-};
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+
+// ROW FUNCTIONS
+
 
 /**
- * Sort static utility to support Column sorting.
+ * Adds one new Record of data into the RecordSet at the index if given,
+ * otherwise at the end. If the new Record is in page view, the
+ * corresponding DOM elements are also updated.
  *
- * @namespace YAHOO.util
- * @class Sort
- * @static
+ * @method addRow
+ * @param oData {Object} Object literal of data for the row.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
  */
-YAHOO.util.Sort = {
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Public methods
-    //
-    /////////////////////////////////////////////////////////////////////////////
+addRow : function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._oRecordSet.addRecord(oData, index);
+        if(oRecord) {
+            var recIndex;
+            var oPaginator = this.get('paginator');
+
+            // Paginated
+            if (oPaginator instanceof Pag ||
+                this.get('paginated')) {
+                recIndex = this.getRecordIndex(oRecord);
+                var endRecIndex;
+                if (oPaginator instanceof Pag) {
+                    // Update the paginator's totalRecords
+                    var totalRecords = oPaginator.get('totalRecords');
+                    if (totalRecords !== Pag.VALUE_UNLIMITED) {
+                        oPaginator.set('totalRecords',totalRecords + 1);
+                    }
 
-    /**
-     * Comparator function for simple case-insensitive string sorting.
-     *
-     * @method compare
-     * @param a {Object} First sort argument.
-     * @param b {Object} Second sort argument.
-     * @param desc {Boolean} True if sort direction is descending, false if
-     * sort direction is ascending.
-     */
-    compare: function(a, b, desc) {
-        if((a === null) || (typeof a == "undefined")) {
-            if((b === null) || (typeof b == "undefined")) {
-                return 0;
+                    endRecIndex = (oPaginator.getPageRecords())[1];
+                }
+                // Backward compatibility
+                else {
+                    endRecIndex = oPaginator.startRecordIndex +
+                                  oPaginator.rowsPerPage - 1;
+                    this.updatePaginator();
+                }
+
+                // New record affects the view
+                if (recIndex <= endRecIndex) {
+                    this.render();
+                }
+                
+                // TODO: what args to pass?
+                this.fireEvent("rowAddEvent", {record:oRecord});
+        
+                // For log message
+                recIndex = (lang.isValue(recIndex))? recIndex : "n/a";
+        
+                
+                return;
             }
+            // Not paginated
             else {
-                return 1;
-            }
-        }
-        else if((b === null) || (typeof b == "undefined")) {
-            return -1;
-        }
+                recIndex = this.getTrIndex(oRecord);
+                if(lang.isNumber(recIndex)) {
+                    if((this instanceof DT) && this._sId) {
+                        // Add the TR element
+                        var elNewTr = this._createTrEl(oRecord);
+                        if(elNewTr) {
+                            if (recIndex >= 0 && recIndex < this._elTbody.rows.length) {
+                                this._elTbody.insertBefore(elNewTr,
+                                    this._elTbody.rows[recIndex]);
+                                if (!recIndex) {
+                                    this._setFirstRow();
+                                }
+                            } else {
+                                this._elTbody.appendChild(elNewTr);
+                                this._setLastRow();
+                                recIndex = this._elTbody.rows.length - 1;
+                            }
+                            this._setRowStripes(recIndex);
 
-        if(a.constructor == String) {
-            a = a.toLowerCase();
-        }
-        if(b.constructor == String) {
-            b = b.toLowerCase();
-        }
-        if(a < b) {
-            return (desc) ? 1 : -1;
-        }
-        else if (a > b) {
-            return (desc) ? -1 : 1;
-        }
-        else {
-            return 0;
+                            this._syncColWidths();
+                        }
+                        this.hideTableMessage();
+
+                        // TODO: what args to pass?
+                        this.fireEvent("rowAddEvent", {record:oRecord});
+
+                        // For log message
+                        recIndex = (lang.isValue(recIndex))? recIndex : "n/a";
+
+                    }
+                    return;
+                }
+            }            
         }
     }
-};
-
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+},
 
 /**
- * ColumnResizer subclasses DragDrop to support resizeable Columns.
+ * Convenience method to add multiple rows.
  *
- * @namespace YAHOO.util
- * @class ColumnResizer
- * @extends YAHOO.util.DragDrop
- * @constructor
- * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
- * @param oColumn {YAHOO.widget.Column} Column instance.
- * @param elThead {HTMLElement} TH element reference.
- * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
- * @param sGroup {String} Group name of related DragDrop items.
- * @param oConfig {Object} (Optional) Object literal of config values.
+ * @method addRows
+ * @param aData {Object[]} Array of object literal data for the rows.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
  */
-YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elThead, sHandleId, sGroup, oConfig) {
-    if(oDataTable && oColumn && elThead && sHandleId) {
-        this.datatable = oDataTable;
-        this.column = oColumn;
-        this.cell = elThead;
-        this.init(sHandleId, sGroup, oConfig);
-        //this.initFrame();
-        this.setYConstraint(0,0);
+addRows : function(aData, index) {
+    if(lang.isArray(aData)) {
+        var i;
+        if(lang.isNumber(index)) {
+            for(i=aData.length-1; i>-1; i--) {
+                this.addRow(aData[i], index);
+            }
+        }
+        else {
+            for(i=0; i<aData.length; i++) {
+                this.addRow(aData[i]);
+            }
+        }
     }
     else {
     }
-};
-
-if(YAHOO.util.DD) {
-    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DD);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public DOM event handlers
-//
-/////////////////////////////////////////////////////////////////////////////
+},
 
 /**
- * Handles mousedown events on the Column resizer.
+ * For the given row, updates the associated Record with the given data. If the
+ * row is on current page, the corresponding DOM elements are also updated.
  *
- * @method onMouseDown
- * @param e {string} The mousedown event
+ * @method updateRow
+ * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
+ * Which row to update: By Record instance, by Record's RecordSet
+ * position index, by HTMLElement reference to the TR element, or by ID string
+ * of the TR element.
+ * @param oData {Object} Object literal of data for the row.
  */
-YAHOO.util.ColumnResizer.prototype.onMouseDown = function(e) {
-    this.startWidth = this.cell.offsetWidth;
-    this.startPos = YAHOO.util.Dom.getX(this.getDragEl());
-
-    if(this.datatable.fixedWidth) {
-        var cellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];
-        this.minWidth = cellLabel.offsetWidth + 6;
-        var sib = this.cell.nextSibling;
-        var sibCellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];
-        this.sibMinWidth = sibCellLabel.offsetWidth + 6;
-//!!
-        var left = ((this.startWidth - this.minWidth) < 0) ? 0 : (this.startWidth - this.minWidth);
-        var right = ((sib.offsetWidth - this.sibMinWidth) < 0) ? 0 : (sib.offsetWidth - this.sibMinWidth);
-        this.setXConstraint(left, right);
-    }
+updateRow : function(row, oData) {
+    var oldRecord, oldData, updatedRecord, elRow;
 
-};
+    // Get the Record directly
+    if((row instanceof YAHOO.widget.Record) || (lang.isNumber(row))) {
+            // Get the Record directly
+            oldRecord = this._oRecordSet.getRecord(row);
 
-/**
- * Handles mouseup events on the Column resizer.
- *
- * @method onMouseUp
- * @param e {string} The mouseup event
- */
-YAHOO.util.ColumnResizer.prototype.onMouseUp = function(e) {
-    //TODO: replace the resizer where it belongs:
-    var resizeStyle = YAHOO.util.Dom.get(this.handleElId).style;
-    resizeStyle.left = "auto";
-    resizeStyle.right = 0;
-    resizeStyle.marginRight = "-6px";
-    resizeStyle.width = "6px";
-    //.yui-dt-headresizer {position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}
+            // Is this row on current page?
+            elRow = this.getTrEl(oldRecord);
+    }
+    // Get the Record by TR element
+    else {
+        elRow = this.getTrEl(row);
+        if(elRow) {
+            oldRecord = this.getRecord(elRow);
+        }
+    }
+
+    // Update the Record
+    if(oldRecord) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = oldRecord.getData();
+        oldData = YAHOO.widget.DataTable._cloneObject(oRecordData);
+
+        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
+    }
+    else {
+        return;
 
+    }
 
-    //var cells = this.datatable._elTable.tHead.rows[this.datatable._elTable.tHead.rows.length-1].cells;
-    //for(var i=0; i<cells.length; i++) {
-        //cells[i].style.width = "5px";
-    //}
+    // Update the TR only if row is on current page
+    if(elRow) {
+        this._oChain.add({
+            method: function() {
+                if((this instanceof DT) && this._sId) {
+                    this._updateTrEl(elRow, updatedRecord);
+                    this._syncColWidths();
+                    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+                }
+            },
+            scope: this,
+            timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
+        });
+        this._oChain.run();
+    }
+    else {
+        this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+    }
 
-    //TODO: set new ColumnSet width values
-    this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.cell});
-};
+},
 
 /**
- * Handles drag events on the Column resizer.
+ * Deletes the given row's Record from the RecordSet. If the row is on current page,
+ * the corresponding DOM elements are also deleted.
  *
- * @method onDrag
- * @param e {string} The drag event
+ * @method deleteRow
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
  */
-YAHOO.util.ColumnResizer.prototype.onDrag = function(e) {
-    var newPos = YAHOO.util.Dom.getX(this.getDragEl());
-    var offsetX = newPos - this.startPos;
-    var newWidth = this.startWidth + offsetX;
-
-    if(newWidth < this.minWidth) {
-        newWidth = this.minWidth;
+deleteRow : function(row) {
+    // Get the Record index...
+    var oRecord = null;
+    // ...by Record index
+    if(lang.isNumber(row)) {
+        oRecord = this._oRecordSet.getRecord(row);
+    }
+    // ...by element reference
+    else {
+        var elRow = Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            oRecord = this.getRecord(elRow);
+        }
     }
+    if(oRecord) {
+        var oPaginator = this.get('paginator');
+        var sRecordId = oRecord.getId();
+
+        // Remove from selection tracker if there
+        var tracker = this._aSelections || [];
+        for(var j=tracker.length-1; j>-1; j--) {
+            if((lang.isNumber(tracker[j]) && (tracker[j] === sRecordId)) ||
+                    ((tracker[j].constructor == Object) && (tracker[j].recordId === sRecordId))) {
+                tracker.splice(j,1);
+            }
+        }
 
-    // Resize the Column
-    var oDataTable = this.datatable;
-    var elCell = this.cell;
+        // Copy data from the Record for the event that gets fired later
+        var nTrIndex = this.getTrIndex(oRecord);
+        var nRecordIndex = this.getRecordIndex(oRecord);
+        var oRecordData = oRecord.getData();
+        var oData = YAHOO.widget.DataTable._cloneObject(oRecordData);
+
+        // Delete Record from RecordSet
+        this._oRecordSet.deleteRecord(nRecordIndex);
+
+        // If paginated and the deleted row was on this or a prior page, just
+        // re-render
+        if (oPaginator instanceof Pag ||
+            this.get('paginated')) {
+
+            var endRecIndex;
+            if (oPaginator instanceof Pag) {
+                // Update the paginator's totalRecords
+                var totalRecords = oPaginator.get('totalRecords');
+                if (totalRecords !== Pag.VALUE_UNLIMITED) {
+                    oPaginator.set('totalRecords',totalRecords - 1);
+                }
 
+                endRecIndex = (oPaginator.getPageRecords())[1];
+            } else {
+                // Backward compatibility
+                endRecIndex = oPaginator.startRecordIndex +
+                              oPaginator.rowsPerPage - 1;
 
-    // Resize the other Columns
-    if(oDataTable.fixedWidth) {
-        // Moving right or left?
-        var sib = elCell.nextSibling;
-        //var sibIndex = elCell.index + 1;
-        var sibnewwidth = sib.offsetWidth - offsetX;
-        if(sibnewwidth < this.sibMinWidth) {
-            sibnewwidth = this.sibMinWidth;
-        }
+                this.updatePaginator();
+            }
 
-        //TODO: how else to cycle through all the Columns without having to use an index property?
-        for(var i=0; i<oDataTable._oColumnSet.length; i++) {
-            //if((i != elCell.index) &&  (i!=sibIndex)) {
-            //    YAHOO.util.Dom.get(oDataTable._oColumnSet.keys[i].id).style.width = oDataTable._oColumnSet.keys[i].width + "px";
-            //}
+            // If the deleted record was on this or a prior page, re-render
+            if (nRecordIndex <= endRecIndex) {
+                this.render();
+            }
+        }
+        else {
+            if(lang.isNumber(nTrIndex)) {
+                this._oChain.add({
+                    method: function() {
+                        if((this instanceof DT) && this._sId) {
+                            var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex);
+                            this._deleteTrEl(nTrIndex);
+            
+                            // Empty body
+                            if(this._elTbody.rows.length === 0) {
+                                this.showTableMessage(DT.MSG_EMPTY, DT.CLASS_EMPTY);
+                            }
+                            // Update UI
+                            else {
+                                // Set FIRST/LAST
+                                if(nTrIndex === 0) {
+                                    this._setFirstRow();
+                                }
+                                if(isLast) {
+                                    this._setLastRow();
+                                }
+                                // Set EVEN/ODD
+                                if(nTrIndex != this._elTbody.rows.length) {
+                                    this._setRowStripes(nTrIndex);
+                                }                                
+                            }
+            
+                            this._syncColWidths();
+                            
+                            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                                    oldData:oData, trElIndex:nTrIndex});
+                        }
+                    },
+                    scope: this,
+                    timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
+                });
+                this._oChain.run();
+                return;
+            }
         }
-        sib.style.width = sibnewwidth;
-        elCell.style.width = newWidth + "px";
-        //oDataTable._oColumnSet.flat[sibIndex].width = sibnewwidth;
-        //oDataTable._oColumnSet.flat[elCell.index].width = newWidth;
 
+        this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                oldData:oData, trElIndex:nTrIndex});
     }
     else {
-        elCell.style.width = newWidth + "px";
     }
-};
+},
+
+/**
+ * Convenience method to delete multiple rows.
+ *
+ * @method deleteRows
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ * @param count {Number} (optional) How many rows to delete. A negative value
+ * will delete towards the beginning.
+ */
+deleteRows : function(row, count) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        if(count && lang.isNumber(count)) {
+            // Start with highest index and work down
+            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
+            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
+            for(var i=startIndex; i>endIndex-1; i--) {
+                this.deleteRow(i);
+            }
+        }
+        else {
+            this.deleteRow(nRecordIndex);
+        }
+    }
+    else {
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CELL FUNCTIONS
 
 /**
- * A RecordSet defines and manages a set of Records.
+ * Outputs markup into the given TD based on given Record.
  *
- * @namespace YAHOO.widget
- * @class RecordSet
- * @param data {Object || Object[]} An object literal or an array of data.
- * @constructor
+ * @method formatCell
+ * @param elCell {HTMLElement} The liner DIV element within the TD.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
  */
-YAHOO.widget.RecordSet = function(data) {
-    // Internal variables
-    this._sName = "RecordSet instance" + YAHOO.widget.RecordSet._nCount;
-    YAHOO.widget.RecordSet._nCount++;
-    this._records = [];
-    this._length = 0;
-    
-    if(data) {
-        if(YAHOO.lang.isArray(data)) {
-            this.addRecords(data);
+formatCell : function(elCell, oRecord, oColumn) {
+    if(!(oRecord instanceof YAHOO.widget.Record)) {
+        oRecord = this.getRecord(elCell);
+    }
+    if(!(oColumn instanceof YAHOO.widget.Column)) {
+        oColumn = this._oColumnSet.getColumn(elCell.parentNode.yuiColumnKey);
+    }
+
+    if(oRecord && oColumn) {
+        var sKey = oColumn.key;
+        var oData = oRecord.getData(sKey);
+
+        // Add classNames
+        var aClasses;
+        if(lang.isString(oColumn.className)) {
+            aClasses = [oColumn.className];
         }
-        else if(data.constructor == Object) {
-            this.addRecord(data);
+        else if(lang.isArray(oColumn.className)) {
+            aClasses = oColumn.className;
+        }
+        else {
+            aClasses = [];
+        }
+
+        //TODO: document special keys will get stripped here
+        aClasses[aClasses.length] = "yui-dt-col-"+sKey.replace(/[^\w\-.:]/g,"");
+        
+        aClasses[aClasses.length] = "yui-dt-col-"+oColumn.getId();
+        
+        aClasses[aClasses.length] = DT.CLASS_LINER;
+
+        if(oColumn.sortable) {
+            aClasses[aClasses.length] = DT.CLASS_SORTABLE;
+        }
+        if(oColumn.resizeable) {
+            aClasses[aClasses.length] = DT.CLASS_RESIZEABLE;
+        }
+        if(oColumn.editor) {
+            aClasses[aClasses.length] = DT.CLASS_EDITABLE;
+        }
+
+        elCell.className = "";
+        Dom.addClass(elCell, aClasses.join(" "));
+
+
+        var fnFormatter = typeof oColumn.formatter === 'function' ?
+                          oColumn.formatter :
+                          DT.Formatter[oColumn.formatter+''];
+
+        // Apply special formatter
+        if(fnFormatter) {
+            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
+        }
+        else {
+            elCell.innerHTML = oData === undefined ||
+                               oData === null ||
+                               (typeof oData === 'number' && isNaN(oData)) ?
+                                "" : oData.toString();
         }
+
+        this.fireEvent("cellFormatEvent", {record:oRecord, column:oColumn, key:sKey, el:elCell});
+    }
+    else {
     }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// PAGINATION
+
+/**
+ * Delegates the Pag changeRequest events to the configured
+ * handler.
+ * @method onPaginatorChange
+ * @param {Object} an object literal describing the proposed pagination state
+ */
+onPaginatorChange : function (oState) {
+    var handler = this.get('paginationEventHandler');
+
+    handler(oState,this);
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// SELECTION/HIGHLIGHTING
+
+/**
+ * ID string of last highlighted cell element
+ *
+ * @property _sLastHighlightedTdElId
+ * @type String
+ * @private
+ */
+//_sLastHighlightedTdElId : null,
+
+/**
+ * ID string of last highlighted row element
+ *
+ * @property _sLastHighlightedTrElId
+ * @type String
+ * @private
+ */
+//_sLastHighlightedTrElId : null,
+
+/**
+ * Array to track row selections (by sRecordId) and/or cell selections
+ * (by {recordId:sRecordId, columnId:sColumnId})
+ *
+ * @property _aSelections
+ * @type Object[]
+ * @private
+ */
+_aSelections : null,
+
+/**
+ * Record instance of the row selection anchor.
+ *
+ * @property _oAnchorRecord
+ * @type YAHOO.widget.Record
+ * @private
+ */
+_oAnchorRecord : null,
+
+/**
+ * Object literal representing cell selection anchor:
+ * {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @property _oAnchorCell
+ * @type Object
+ * @private
+ */
+_oAnchorCell : null,
+
+/**
+ * Convenience method to remove the class DT.CLASS_SELECTED
+ * from all TR elements on the page.
+ *
+ * @method _unselectAllTrEls
+ * @private
+ */
+_unselectAllTrEls : function() {
+    var selectedRows = Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
+    Dom.removeClass(selectedRows, DT.CLASS_SELECTED);
+},
+
+/**
+ * Returns object literal of values that represent the selection trigger. Used
+ * to determine selection behavior resulting from a key event.
+ *
+ * @method _getSelectionTrigger
+ * @private
+ */
+_getSelectionTrigger : function() {
+    var sMode = this.get("selectionMode");
+    var oTrigger = {};
+    var oTriggerCell, oTriggerRecord, nTriggerRecordIndex, elTriggerRow, nTriggerTrIndex;
+
+    // Cell mode
+    if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+        oTriggerCell = this.getLastSelectedCell();
+        // No selected cells found
+        if(!oTriggerCell) {
+            return null;
+        }
+        else {
+            oTriggerRecord = this.getRecord(oTriggerCell.recordId);
+            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
+            elTriggerRow = this.getTrEl(oTriggerRecord);
+            nTriggerTrIndex = this.getTrIndex(elTriggerRow);
+
+            // Selected cell not found on this page
+            if(nTriggerTrIndex === null) {
+                return null;
+            }
+            else {
+                oTrigger.record = oTriggerRecord;
+                oTrigger.recordIndex = nTriggerRecordIndex;
+                oTrigger.el = this.getTdEl(oTriggerCell);
+                oTrigger.trIndex = nTriggerTrIndex;
+                oTrigger.column = this.getColumnById(oTriggerCell.columnId);
+                oTrigger.colKeyIndex = oTrigger.column.getKeyIndex();
+                oTrigger.cell = oTriggerCell;
+                return oTrigger;
+            }
+        }
+    }
+    // Row mode
+    else {
+        oTriggerRecord = this.getLastSelectedRecord();
+        // No selected rows found
+        if(!oTriggerRecord) {
+                return null;
+        }
+        else {
+            // Selected row found, but is it on current page?
+            oTriggerRecord = this.getRecord(oTriggerRecord);
+            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
+            elTriggerRow = this.getTrEl(oTriggerRecord);
+            nTriggerTrIndex = this.getTrIndex(elTriggerRow);
+
+            // Selected row not found on this page
+            if(nTriggerTrIndex === null) {
+                return null;
+            }
+            else {
+                oTrigger.record = oTriggerRecord;
+                oTrigger.recordIndex = nTriggerRecordIndex;
+                oTrigger.el = elTriggerRow;
+                oTrigger.trIndex = nTriggerTrIndex;
+                return oTrigger;
+            }
+        }
+    }
+},
+
+/**
+ * Returns object literal of values that represent the selection anchor. Used
+ * to determine selection behavior resulting from a user event.
+ *
+ * @method _getSelectionAnchor
+ * @param oTrigger {Object} (Optional) Object literal of selection trigger values
+ * (for key events).
+ * @private
+ */
+_getSelectionAnchor : function(oTrigger) {
+    var sMode = this.get("selectionMode");
+    var oAnchor = {};
+    var oAnchorRecord, nAnchorRecordIndex, nAnchorTrIndex;
+
+    // Cell mode
+    if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+        // Validate anchor cell
+        var oAnchorCell = this._oAnchorCell;
+        if(!oAnchorCell) {
+            if(oTrigger) {
+                oAnchorCell = this._oAnchorCell = oTrigger.cell;
+            }
+            else {
+                return null;
+            }
+        }
+        oAnchorRecord = this._oAnchorCell.record;
+        nAnchorRecordIndex = this._oRecordSet.getRecordIndex(oAnchorRecord);
+        nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
+        // If anchor cell is not on this page...
+        if(nAnchorTrIndex === null) {
+            // ...set TR index equal to top TR
+            if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
+                nAnchorTrIndex = 0;
+            }
+            // ...set TR index equal to bottom TR
+            else {
+                nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
+            }
+        }
+
+        oAnchor.record = oAnchorRecord;
+        oAnchor.recordIndex = nAnchorRecordIndex;
+        oAnchor.trIndex = nAnchorTrIndex;
+        oAnchor.column = this._oAnchorCell.column;
+        oAnchor.colKeyIndex = oAnchor.column.getKeyIndex();
+        oAnchor.cell = oAnchorCell;
+        return oAnchor;
+    }
+    // Row mode
+    else {
+        oAnchorRecord = this._oAnchorRecord;
+        if(!oAnchorRecord) {
+            if(oTrigger) {
+                oAnchorRecord = this._oAnchorRecord = oTrigger.record;
+            }
+            else {
+                return null;
+            }
+        }
+
+        nAnchorRecordIndex = this.getRecordIndex(oAnchorRecord);
+        nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
+        // If anchor row is not on this page...
+        if(nAnchorTrIndex === null) {
+            // ...set TR index equal to top TR
+            if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
+                nAnchorTrIndex = 0;
+            }
+            // ...set TR index equal to bottom TR
+            else {
+                nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
+            }
+        }
+
+        oAnchor.record = oAnchorRecord;
+        oAnchor.recordIndex = nAnchorRecordIndex;
+        oAnchor.trIndex = nAnchorTrIndex;
+        return oAnchor;
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "standard".
+ *
+ * @method _handleStandardSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleStandardSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var i;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+            // Validate anchor
+            if(oAnchor) {
+                if(this.isSelected(oAnchor.record)) {
+                    // Select all rows between anchor row and target row, including target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex; i++) {
+                            if(!this.isSelected(i)) {
+                                this.selectRow(i);
+                            }
+                        }
+                    }
+                    // Select all rows between target row and anchor row, including target row
+                    else {
+                        for(i=oAnchor.recordIndex-1; i>=nTargetRecordIndex; i--) {
+                            if(!this.isSelected(i)) {
+                                this.selectRow(i);
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Unselect all rows between anchor row and target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex-1; i++) {
+                            if(this.isSelected(i)) {
+                                this.unselectRow(i);
+                            }
+                        }
+                    }
+                    // Unselect all rows between target row and anchor row
+                    else {
+                        for(i=nTargetRecordIndex+1; i<=oAnchor.recordIndex-1; i++) {
+                            if(this.isSelected(i)) {
+                                this.unselectRow(i);
+                            }
+                        }
+                    }
+                    // Select the target row
+                    this.selectRow(oTargetRecord);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorRecord = oTargetRecord;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetRecord)) {
+                    this.unselectRow(oTargetRecord);
+                }
+                else {
+                    this.selectRow(oTargetRecord);
+                }
+            }
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+            this.unselectAllRows();
+
+            // Validate anchor
+            if(oAnchor) {
+                // Select all rows between anchor row and target row,
+                // including the anchor row and target row
+                if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    for(i=oAnchor.recordIndex; i<=nTargetRecordIndex; i++) {
+                        this.selectRow(i);
+                    }
+                }
+                // Select all rows between target row and anchor row,
+                // including the target row and anchor row
+                else {
+                    for(i=oAnchor.recordIndex; i>=nTargetRecordIndex; i--) {
+                        this.selectRow(i);
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorRecord = oTargetRecord;
+
+                // Select target row only
+                this.selectRow(oTargetRecord);
+            }
+        }
+        // Only CTRL
+        else if(bCTRL) {
+            // Set anchor
+            this._oAnchorRecord = oTargetRecord;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetRecord)) {
+                this.unselectRow(oTargetRecord);
+            }
+            else {
+                this.selectRow(oTargetRecord);
+            }
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleSelectionByMouse(oArgs);
+            return;
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "standard".
+ *
+ * @method _handleStandardSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleStandardSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+
+    if((nKey == 38) || (nKey == 40)) {
+        var bSHIFT = e.shiftKey;
+
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        // Determine which direction we're going to
+        if(bSHIFT) {
+            // Selecting down away from anchor row
+            if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
+                this.selectRow(this.getNextTrEl(oTrigger.el));
+            }
+            // Selecting up away from anchor row
+            else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
+                this.selectRow(this.getPreviousTrEl(oTrigger.el));
+            }
+            // Unselect trigger
+            else {
+                this.unselectRow(oTrigger.el);
+            }
+        }
+        else {
+            this._handleSingleSelectionByKey(e);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "single".
+ *
+ * @method _handleSingleSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleSingleSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var oTargetRecord = this.getRecord(elTargetRow);
+
+        // Set anchor
+        this._oAnchorRecord = oTargetRecord;
+
+        // Select only target
+        this.unselectAllRows();
+        this.selectRow(oTargetRecord);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "single".
+ *
+ * @method _handleSingleSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleSingleSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+
+    if((nKey == 38) || (nKey == 40)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Determine the new row to select
+        var elNew;
+        if(nKey == 38) { // arrow up
+            elNew = this.getPreviousTrEl(oTrigger.el);
+
+            // Validate new row
+            if(elNew === null) {
+                //TODO: wrap around to last tr on current page
+                //elNew = this.getLastTrEl();
+
+                //TODO: wrap back to last tr of previous page
+
+                // Top row selection is sticky
+                elNew = this.getFirstTrEl();
+            }
+        }
+        else if(nKey == 40) { // arrow down
+            elNew = this.getNextTrEl(oTrigger.el);
+
+            // Validate new row
+            if(elNew === null) {
+                //TODO: wrap around to first tr on current page
+                //elNew = this.getFirstTrEl();
+
+                //TODO: wrap forward to first tr of previous page
+
+                // Bottom row selection is sticky
+                elNew = this.getLastTrEl();
+            }
+        }
+
+        // Unselect all rows
+        this.unselectAllRows();
+
+        // Select the new row
+        this.selectRow(elNew);
+
+        // Set new anchor
+        this._oAnchorRecord = this.getRecord(elNew);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "cellblock".
+ *
+ * @method _handleCellBlockSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleCellBlockSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var nTargetTrIndex = this.getTrIndex(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var nTargetColKeyIndex = oTargetColumn.getKeyIndex();
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var allRows = this.getTbodyEl().rows;
+        var startIndex, endIndex, currentRow, i, j;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+
+            // Validate anchor
+            if(oAnchor) {
+                // Anchor is selected
+                if(this.isSelected(oAnchor.cell)) {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<=nTargetColKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex; i<oAnchor.colKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                        endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                        // Select all cells from startIndex to endIndex on rows between anchor row and target row
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        startIndex = Math.min(oAnchor.trIndex, nTargetColKeyIndex);
+                        endIndex = Math.max(oAnchor.trIndex, nTargetColKeyIndex);
+
+                        // Select all cells from startIndex to endIndex on rows between target row and anchor row
+                        for(i=oAnchor.trIndex; i>=nTargetTrIndex; i--) {
+                            for(j=endIndex; j>=startIndex; j--) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<nTargetColKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex+1; i<oAnchor.colKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex === oAnchor.trIndex) {
+                                    if(j>oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex === nTargetTrIndex) {
+                                    if(j<nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                    if(j<oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetCell)) {
+                    this.unselectCell(oTargetCell);
+                }
+                else {
+                    this.selectCell(oTargetCell);
+                }
+            }
+
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(oAnchor) {
+                // All cells are on the same row
+                if(oAnchor.recordIndex === nTargetRecordIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                        for(i=oAnchor.colKeyIndex; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                        for(i=nTargetColKeyIndex; i<=oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    // Select the cellblock from anchor cell to target cell
+                    // including the anchor cell and the target cell
+                    startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                    endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                    for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                        for(j=startIndex; j<=endIndex; j++) {
+                            this.selectCell(allRows[i].cells[j]);
+                        }
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    // Select the cellblock from target cell to anchor cell
+                    // including the target cell and the anchor cell
+                    startIndex = Math.min(oAnchor.colKeyIndex, nTargetColKeyIndex);
+                    endIndex = Math.max(oAnchor.colKeyIndex, nTargetColKeyIndex);
+
+                    for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                        for(j=startIndex; j<=endIndex; j++) {
+                            this.selectCell(allRows[i].cells[j]);
+                        }
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Select target only
+                this.selectCell(oTargetCell);
+            }
+        }
+        // Only CTRL
+        else if(bCTRL) {
+
+            // Set anchor
+            this._oAnchorCell = oTargetCell;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetCell)) {
+                this.unselectCell(oTargetCell);
+            }
+            else {
+                this.selectCell(oTargetCell);
+            }
+
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleCellSelectionByMouse(oArgs);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "cellblock".
+ *
+ * @method _handleCellBlockSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleCellBlockSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    var bSHIFT = e.shiftKey;
+    if((nKey == 9) || !bSHIFT) {
+        this._handleSingleCellSelectionByKey(e);
+        return;
+    }
+
+    if((nKey > 36) && (nKey < 41)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        var i, startIndex, endIndex, elNew, elNewRow;
+        var allRows = this.getTbodyEl().rows;
+        var elThisRow = oTrigger.el.parentNode;
+
+        // Determine which direction we're going to
+
+        if(nKey == 40) { // arrow down
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex <= oTrigger.recordIndex) {
+                // Select the horiz block on the next row...
+                // ...making sure there is room below the trigger row
+                elNewRow = this.getNextTrEl(oTrigger.el);
+                if(elNewRow) {
+                    startIndex = oAnchor.colKeyIndex;
+                    endIndex = oTrigger.colKeyIndex;
+                    // ...going left
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going right
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                startIndex = Math.min(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                endIndex = Math.max(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                // Unselect the horiz block on this row towards the next row
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+            }
+        }
+        // Arrow up
+        else if(nKey == 38) {
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex >= oTrigger.recordIndex) {
+                // Select the horiz block on the previous row...
+                // ...making sure there is room
+                elNewRow = this.getPreviousTrEl(oTrigger.el);
+                if(elNewRow) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.colKeyIndex;
+                    endIndex = oTrigger.colKeyIndex;
+                    // ...going left
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going right
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = elNewRow.cells[i];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                startIndex = Math.min(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                endIndex = Math.max(oAnchor.colKeyIndex, oTrigger.colKeyIndex);
+                // Unselect the horiz block on this row towards the previous row
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+            }
+        }
+        // Arrow right
+        else if(nKey == 39) {
+            // Selecting away from anchor cell
+            if(oAnchor.colKeyIndex <= oTrigger.colKeyIndex) {
+                // Select the next vert block to the right...
+                // ...making sure there is room
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.trIndex;
+                    endIndex = oTrigger.trIndex;
+                    // ...going up
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex+1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going down
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex+1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect the vert block on this column towards the right
+                startIndex = Math.min(oAnchor.trIndex, oTrigger.trIndex);
+                endIndex = Math.max(oAnchor.trIndex, oTrigger.trIndex);
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(allRows[i].cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+        // Arrow left
+        else if(nKey == 37) {
+            // Selecting away from anchor cell
+            if(oAnchor.colKeyIndex >= oTrigger.colKeyIndex) {
+                //Select the previous vert block to the left
+                if(oTrigger.colKeyIndex > 0) {
+                    // Select in order from anchor to trigger...
+                    startIndex = oAnchor.trIndex;
+                    endIndex = oTrigger.trIndex;
+                    // ...going up
+                    if(startIndex > endIndex) {
+                        for(i=startIndex; i>=endIndex; i--) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex-1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                    // ... going down
+                    else {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            elNew = allRows[i].cells[oTrigger.colKeyIndex-1];
+                            this.selectCell(elNew);
+                        }
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect the vert block on this column towards the left
+                startIndex = Math.min(oAnchor.trIndex, oTrigger.trIndex);
+                endIndex = Math.max(oAnchor.trIndex, oTrigger.trIndex);
+                for(i=startIndex; i<=endIndex; i++) {
+                    this.unselectCell(allRows[i].cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "cellrange".
+ *
+ * @method _handleCellRangeSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleCellRangeSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var e = oArgs.event;
+        var bSHIFT = e.shiftKey;
+        var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
+
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var nTargetTrIndex = this.getTrIndex(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var nTargetColKeyIndex = oTargetColumn.getKeyIndex();
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        var oAnchor = this._getSelectionAnchor();
+
+        var allRows = this.getTbodyEl().rows;
+        var currentRow, i, j;
+
+        // Both SHIFT and CTRL
+        if(bSHIFT && bCTRL) {
+
+            // Validate anchor
+            if(oAnchor) {
+                // Anchor is selected
+                if(this.isSelected(oAnchor.cell)) {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<=nTargetColKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex; i<oAnchor.colKeyIndex; i++) {
+                                this.selectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Select all cells on anchor row from anchor cell to the end of the row
+                        for(i=oAnchor.colKeyIndex+1; i<elTargetRow.cells.length; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+
+                        // Select all cells on all rows between anchor row and target row
+                        for(i=oAnchor.trIndex+1; i<nTargetTrIndex; i++) {
+                            for(j=0; j<allRows[i].cells.length; j++){
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+
+                        // Select all cells on target row from first cell to the target cell
+                        for(i=0; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Select all cells on target row from target cell to the end of the row
+                        for(i=nTargetColKeyIndex; i<elTargetRow.cells.length; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+
+                        // Select all cells on all rows between target row and anchor row
+                        for(i=nTargetTrIndex+1; i<oAnchor.trIndex; i++) {
+                            for(j=0; j<allRows[i].cells.length; j++){
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+
+                        // Select all cells on anchor row from first cell to the anchor cell
+                        for(i=0; i<oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(oAnchor.recordIndex === nTargetRecordIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                            for(i=oAnchor.colKeyIndex+1; i<nTargetColKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                            for(i=nTargetColKeyIndex+1; i<oAnchor.colKeyIndex; i++) {
+                                this.unselectCell(elTargetRow.cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(oAnchor.recordIndex < nTargetRecordIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex === oAnchor.trIndex) {
+                                    if(j>oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex === nTargetTrIndex) {
+                                    if(j<nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetColKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                    if(j<oAnchor.colKeyIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Toggle selection of target
+                if(this.isSelected(oTargetCell)) {
+                    this.unselectCell(oTargetCell);
+                }
+                else {
+                    this.selectCell(oTargetCell);
+                }
+            }
+        }
+         // Only SHIFT
+        else if(bSHIFT) {
+
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(oAnchor) {
+                // All cells are on the same row
+                if(oAnchor.recordIndex === nTargetRecordIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(oAnchor.colKeyIndex < nTargetColKeyIndex) {
+                        for(i=oAnchor.colKeyIndex; i<=nTargetColKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetColKeyIndex < oAnchor.colKeyIndex) {
+                        for(i=nTargetColKeyIndex; i<=oAnchor.colKeyIndex; i++) {
+                            this.selectCell(elTargetRow.cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(oAnchor.recordIndex < nTargetRecordIndex) {
+                    // Select all cells from anchor cell to target cell
+                    // including the anchor cell and target cell
+                    for(i=oAnchor.trIndex; i<=nTargetTrIndex; i++) {
+                        currentRow = allRows[i];
+                        for(j=0; j<currentRow.cells.length; j++) {
+                            // This is the anchor row, only select the anchor cell and after
+                            if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                if(j>=oAnchor.colKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // This is the target row, only select the target cell and before
+                            else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                if(j<=nTargetColKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // Select all cells on this row
+                            else {
+                                this.selectCell(currentRow.cells[j]);
+                            }
+                        }
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    // Select all cells from target cell to anchor cell,
+                    // including the target cell and anchor cell
+                    for(i=nTargetTrIndex; i<=oAnchor.trIndex; i++) {
+                        currentRow = allRows[i];
+                        for(j=0; j<currentRow.cells.length; j++) {
+                            // This is the target row, only select the target cell and after
+                            if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                if(j>=nTargetColKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // This is the anchor row, only select the anchor cell and before
+                            else if(currentRow.sectionRowIndex == oAnchor.trIndex) {
+                                if(j<=oAnchor.colKeyIndex) {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                            // Select all cells on this row
+                            else {
+                                this.selectCell(currentRow.cells[j]);
+                            }
+                        }
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._oAnchorCell = oTargetCell;
+
+                // Select target only
+                this.selectCell(oTargetCell);
+            }
+
+
+        }
+        // Only CTRL
+        else if(bCTRL) {
+
+            // Set anchor
+            this._oAnchorCell = oTargetCell;
+
+            // Toggle selection of target
+            if(this.isSelected(oTargetCell)) {
+                this.unselectCell(oTargetCell);
+            }
+            else {
+                this.selectCell(oTargetCell);
+            }
+
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            this._handleSingleCellSelectionByMouse(oArgs);
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "cellrange".
+ *
+ * @method _handleCellRangeSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleCellRangeSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    var bSHIFT = e.shiftKey;
+    if((nKey == 9) || !bSHIFT) {
+        this._handleSingleCellSelectionByKey(e);
+        return;
+    }
+
+    if((nKey > 36) && (nKey < 41)) {
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        Ev.stopEvent(e);
+
+        // Validate anchor
+        var oAnchor = this._getSelectionAnchor(oTrigger);
+
+        var i, elNewRow, elNew;
+        var allRows = this.getTbodyEl().rows;
+        var elThisRow = oTrigger.el.parentNode;
+
+        // Arrow down
+        if(nKey == 40) {
+            elNewRow = this.getNextTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex <= oTrigger.recordIndex) {
+                // Select all cells to the end of this row
+                for(i=oTrigger.colKeyIndex+1; i<elThisRow.cells.length; i++){
+                    elNew = elThisRow.cells[i];
+                    this.selectCell(elNew);
+                }
+
+                // Select some of the cells on the next row down
+                if(elNewRow) {
+                    for(i=0; i<=oTrigger.colKeyIndex; i++){
+                        elNew = elNewRow.cells[i];
+                        this.selectCell(elNew);
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect all cells to the end of this row
+                for(i=oTrigger.colKeyIndex; i<elThisRow.cells.length; i++){
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+
+                // Unselect some of the cells on the next row down
+                if(elNewRow) {
+                    for(i=0; i<oTrigger.colKeyIndex; i++){
+                        this.unselectCell(elNewRow.cells[i]);
+                    }
+                }
+            }
+        }
+        // Arrow up
+        else if(nKey == 38) {
+            elNewRow = this.getPreviousTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex >= oTrigger.recordIndex) {
+                // Select all the cells to the beginning of this row
+                for(i=oTrigger.colKeyIndex-1; i>-1; i--){
+                    elNew = elThisRow.cells[i];
+                    this.selectCell(elNew);
+                }
+
+                // Select some of the cells from the end of the previous row
+                if(elNewRow) {
+                    for(i=elThisRow.cells.length-1; i>=oTrigger.colKeyIndex; i--){
+                        elNew = elNewRow.cells[i];
+                        this.selectCell(elNew);
+                    }
+                }
+            }
+            // Unselecting towards anchor cell
+            else {
+                // Unselect all the cells to the beginning of this row
+                for(i=oTrigger.colKeyIndex; i>-1; i--){
+                    this.unselectCell(elThisRow.cells[i]);
+                }
+
+                // Unselect some of the cells from the end of the previous row
+                if(elNewRow) {
+                    for(i=elThisRow.cells.length-1; i>oTrigger.colKeyIndex; i--){
+                        this.unselectCell(elNewRow.cells[i]);
+                    }
+                }
+            }
+        }
+        // Arrow right
+        else if(nKey == 39) {
+            elNewRow = this.getNextTrEl(oTrigger.el);
+
+            // Selecting away from anchor cell
+            if(oAnchor.recordIndex < oTrigger.recordIndex) {
+                // Select the next cell to the right
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                    elNew = elThisRow.cells[oTrigger.colKeyIndex+1];
+                    this.selectCell(elNew);
+                }
+                // Select the first cell of the next row
+                else if(elNewRow) {
+                    elNew = elNewRow.cells[0];
+                    this.selectCell(elNew);
+                }
+            }
+            // Unselecting towards anchor cell
+            else if(oAnchor.recordIndex > oTrigger.recordIndex) {
+                this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                // Unselect this cell towards the right
+                if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                }
+                // Unselect this cells towards the first cell of the next row
+                else {
+                }
+            }
+            // Anchor is on this row
+            else {
+                // Selecting away from anchor
+                if(oAnchor.colKeyIndex <= oTrigger.colKeyIndex) {
+                    // Select the next cell to the right
+                    if(oTrigger.colKeyIndex < elThisRow.cells.length-1) {
+                        elNew = elThisRow.cells[oTrigger.colKeyIndex+1];
+                        this.selectCell(elNew);
+                    }
+                    // Select the first cell on the next row
+                    else if(oTrigger.trIndex < allRows.length-1){
+                        elNew = elNewRow.cells[0];
+                        this.selectCell(elNew);
+                    }
+                }
+                // Unselecting towards anchor
+                else {
+                    // Unselect this cell towards the right
+                    this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+                }
+            }
+        }
+        // Arrow left
+        else if(nKey == 37) {
+            elNewRow = this.getPreviousTrEl(oTrigger.el);
+
+            // Unselecting towards the anchor
+            if(oAnchor.recordIndex < oTrigger.recordIndex) {
+                this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                // Unselect this cell towards the left
+                if(oTrigger.colKeyIndex > 0) {
+                }
+                // Unselect this cell towards the last cell of the previous row
+                else {
+                }
+            }
+            // Selecting towards the anchor
+            else if(oAnchor.recordIndex > oTrigger.recordIndex) {
+                // Select the next cell to the left
+                if(oTrigger.colKeyIndex > 0) {
+                    elNew = elThisRow.cells[oTrigger.colKeyIndex-1];
+                    this.selectCell(elNew);
+                }
+                // Select the last cell of the previous row
+                else if(oTrigger.trIndex > 0){
+                    elNew = elNewRow.cells[elNewRow.cells.length-1];
+                    this.selectCell(elNew);
+                }
+            }
+            // Anchor is on this row
+            else {
+                // Selecting away from anchor cell
+                if(oAnchor.colKeyIndex >= oTrigger.colKeyIndex) {
+                    // Select the next cell to the left
+                    if(oTrigger.colKeyIndex > 0) {
+                        elNew = elThisRow.cells[oTrigger.colKeyIndex-1];
+                        this.selectCell(elNew);
+                    }
+                    // Select the last cell of the previous row
+                    else if(oTrigger.trIndex > 0){
+                        elNew = elNewRow.cells[elNewRow.cells.length-1];
+                        this.selectCell(elNew);
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    this.unselectCell(elThisRow.cells[oTrigger.colKeyIndex]);
+
+                    // Unselect this cell towards the left
+                    if(oTrigger.colKeyIndex > 0) {
+                    }
+                    // Unselect this cell towards the last cell of the previous row
+                    else {
+                    }
+                }
+            }
+        }
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a mouse event when selection mode
+ * is set to "singlecell".
+ *
+ * @method _handleSingleCellSelectionByMouse
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ * @private
+ */
+_handleSingleCellSelectionByMouse : function(oArgs) {
+    var elTarget = oArgs.target;
+
+    // Validate target cell
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var oTargetRecord = this.getRecord(elTargetRow);
+        var oTargetColumn = this.getColumn(elTargetCell);
+        var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
+
+        // Set anchor
+        this._oAnchorCell = oTargetCell;
+
+        // Select only target
+        this.unselectAllCells();
+        this.selectCell(oTargetCell);
+    }
+},
+
+/**
+ * Determines selection behavior resulting from a key event when selection mode
+ * is set to "singlecell".
+ *
+ * @method _handleSingleCellSelectionByKey
+ * @param e {HTMLEvent} Event object.
+ * @private
+ */
+_handleSingleCellSelectionByKey : function(e) {
+    var nKey = Ev.getCharCode(e);
+    if((nKey == 9) || ((nKey > 36) && (nKey < 41))) {
+        var bSHIFT = e.shiftKey;
+
+        // Validate trigger
+        var oTrigger = this._getSelectionTrigger();
+        // Arrow selection only works if last selected row is on current page
+        if(!oTrigger) {
+            return null;
+        }
+
+        // Determine the new cell to select
+        var elNew;
+        if(nKey == 40) { // Arrow down
+            elNew = this.getBelowTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to first tr on current page
+
+                //TODO: wrap forward to first tr of next page
+
+                // Bottom selection is sticky
+                elNew = oTrigger.el;
+            }
+        }
+        else if(nKey == 38) { // Arrow up
+            elNew = this.getAboveTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to last tr on current page
+
+                //TODO: wrap back to last tr of previous page
+
+                // Top selection is sticky
+                elNew = oTrigger.el;
+            }
+        }
+        else if((nKey == 39) || (!bSHIFT && (nKey == 9))) { // Arrow right or tab
+            elNew = this.getNextTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to first td on current page
+
+                //TODO: wrap forward to first td of next page
+
+                // Top-left selection is sticky, and release TAB focus
+                //elNew = oTrigger.el;
+                return;
+            }
+        }
+        else if((nKey == 37) || (bSHIFT && (nKey == 9))) { // Arrow left or shift-tab
+            elNew = this.getPreviousTdEl(oTrigger.el);
+
+            // Validate new cell
+            if(elNew === null) {
+                //TODO: wrap around to last td on current page
+
+                //TODO: wrap back to last td of previous page
+
+                // Bottom-right selection is sticky, and release TAB focus
+                //elNew = oTrigger.el;
+                return;
+            }
+        }
+
+        Ev.stopEvent(e);
+        
+        // Unselect all cells
+        this.unselectAllCells();
+
+        // Select the new cell
+        this.selectCell(elNew);
+
+        // Set new anchor
+        this._oAnchorCell = {record:this.getRecord(elNew), column:this.getColumn(elNew)};
+    }
+},
+
+/**
+ * Returns array of selected TR elements on the page.
+ *
+ * @method getSelectedTrEls
+ * @return {HTMLElement[]} Array of selected TR elements.
+ */
+getSelectedTrEls : function() {
+    return Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
+},
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method selectRow
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element
+ * reference or ID string, Record instance, or RecordSet position index.
+ */
+selectRow : function(row) {
+    var oRecord, elRow;
+
+    if(row instanceof YAHOO.widget.Record) {
+        oRecord = this._oRecordSet.getRecord(row);
+        elRow = this.getTrEl(oRecord);
+    }
+    else if(lang.isNumber(row)) {
+        oRecord = this.getRecord(row);
+        elRow = this.getTrEl(oRecord);
+    }
+    else {
+        elRow = this.getTrEl(row);
+        oRecord = this.getRecord(elRow);
+    }
+
+    if(oRecord) {
+        // Update selection trackers
+        var tracker = this._aSelections || [];
+        var sRecordId = oRecord.getId();
+        var index = -1;
+
+        // Remove if already there:
+        // Use Array.indexOf if available...
+        /*if(tracker.indexOf && (tracker.indexOf(sRecordId) >  -1)) {
+            tracker.splice(tracker.indexOf(sRecordId),1);
+        }*/
+        if(tracker.indexOf) {
+            index = tracker.indexOf(sRecordId);
+            
+        }
+        // ...or do it the old-fashioned way
+        else {
+            for(var j=tracker.length-1; j>-1; j--) {
+                if(tracker[j] === sRecordId){
+                    index = j;
+                    break;
+                }
+            }
+        }
+        if(index > -1) {
+            tracker.splice(index,1);
+        }
+        
+        // Add to the end
+        tracker.push(sRecordId);
+        this._aSelections = tracker;
+
+        // Update trackers
+        if(!this._oAnchorRecord) {
+            this._oAnchorRecord = oRecord;
+        }
+
+        // Update UI
+        if(elRow) {
+            Dom.addClass(elRow, DT.CLASS_SELECTED);
+        }
+
+        this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
+    }
+    else {
+    }
+},
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method unselectRow
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element
+ * reference or ID string, Record instance, or RecordSet position index.
+ */
+unselectRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    var oRecord;
+    if(row instanceof YAHOO.widget.Record) {
+        oRecord = this._oRecordSet.getRecord(row);
+    }
+    else if(lang.isNumber(row)) {
+        oRecord = this.getRecord(row);
+    }
+    else {
+        oRecord = this.getRecord(elRow);
+    }
+
+    if(oRecord) {
+        // Update selection trackers
+        var tracker = this._aSelections || [];
+        var sRecordId = oRecord.getId();
+        var index = -1;
+
+        // Remove if found
+        var bFound = false;
+
+        // Use Array.indexOf if available...
+        if(tracker.indexOf) {
+            index = tracker.indexOf(sRecordId);
+        }
+        // ...or do it the old-fashioned way
+        else {
+            for(var j=tracker.length-1; j>-1; j--) {
+                if(tracker[j] === sRecordId){
+                    index = j;
+                    break;
+                }
+            }
+        }
+        if(index > -1) {
+            tracker.splice(index,1);
+        }
+
+        if(bFound) {
+            // Update tracker
+            this._aSelections = tracker;
+
+            // Update the UI
+            Dom.removeClass(elRow, DT.CLASS_SELECTED);
+
+            this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+
+            return;
+        }
+
+        // Update the UI
+        Dom.removeClass(elRow, DT.CLASS_SELECTED);
+
+        this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+    }
+},
+
+/**
+ * Clears out all row selections.
+ *
+ * @method unselectAllRows
+ */
+unselectAllRows : function() {
+    // Remove all rows from tracker
+    var tracker = this._aSelections || [];
+    for(var j=tracker.length-1; j>-1; j--) {
+       if(lang.isString(tracker[j])){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTrEls();
+
+    //TODO: send an array of [{el:el,record:record}]
+    //TODO: or convert this to an unselectRows method
+    //TODO: that takes an array of rows or unselects all if none given
+    this.fireEvent("unselectAllRowsEvent");
+},
+
+/**
+ * Convenience method to remove the class DT.CLASS_SELECTED
+ * from all TD elements in the internal tracker.
+ *
+ * @method _unselectAllTdEls
+ * @private
+ */
+_unselectAllTdEls : function() {
+    var selectedCells = Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
+    Dom.removeClass(selectedCells, DT.CLASS_SELECTED);
+},
+
+/**
+ * Returns array of selected TD elements on the page.
+ *
+ * @method getSelectedTdEls
+ * @return {HTMLElement[]} Array of selected TD elements.
+ */
+getSelectedTdEls : function() {
+    return Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
+},
+
+/**
+ * Sets given cell to the selected state.
+ *
+ * @method selectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+selectCell : function(cell) {
+/*TODO:
+accept {record}
+*/
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+
+        if(oRecord && sColumnId) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var sRecordId = oRecord.getId();
+
+            // Remove if there
+            for(var j=tracker.length-1; j>-1; j--) {
+               if((tracker[j].recordId === sRecordId) && (tracker[j].columnId === sColumnId)){
+                    tracker.splice(j,1);
+                    break;
+                }
+            }
+
+            // Add to the end
+            tracker.push({recordId:sRecordId, columnId:sColumnId});
+
+            // Update trackers
+            this._aSelections = tracker;
+            if(!this._oAnchorCell) {
+                this._oAnchorCell = {record:oRecord, column:this.getColumnById(sColumnId)};
+            }
+
+            // Update the UI
+            Dom.addClass(elCell, DT.CLASS_SELECTED);
+
+            this.fireEvent("cellSelectEvent", {record:oRecord, column:this.getColumnById(sColumnId), key: elCell.yuiColumnKey, el:elCell});
+            return;
+        }
+    }
+},
+
+/**
+ * Sets given cell to the unselected state.
+ *
+ * @method unselectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+unselectCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+
+        if(oRecord && sColumnId) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var id = oRecord.getId();
+
+            // Is it selected?
+            for(var j=tracker.length-1; j>-1; j--) {
+                if((tracker[j].recordId === id) && (tracker[j].columnId === sColumnId)){
+                    // Remove from tracker
+                    tracker.splice(j,1);
+
+                    // Update tracker
+                    this._aSelections = tracker;
+
+                    // Update the UI
+                    Dom.removeClass(elCell, DT.CLASS_SELECTED);
+
+                    this.fireEvent("cellUnselectEvent", {record:oRecord, column: this.getColumnById(sColumnId), key:elCell.yuiColumnKey, el:elCell});
+                    return;
+                }
+            }
+        }
+    }
+},
+
+/**
+ * Clears out all cell selections.
+ *
+ * @method unselectAllCells
+ */
+unselectAllCells: function() {
+    // Remove all cells from tracker
+    var tracker = this._aSelections || [];
+    for(var j=tracker.length-1; j>-1; j--) {
+       if(tracker[j].constructor == Object){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTdEls();
+
+    //TODO: send data
+    //TODO: or fire individual cellUnselectEvent
+    this.fireEvent("unselectAllCellsEvent");
+},
+
+/**
+ * Returns true if given item is selected, false otherwise.
+ *
+ * @method isSelected
+ * @param o {String | HTMLElement | YAHOO.widget.Record | Number
+ * {record:YAHOO.widget.Record, column:YAHOO.widget.Column} } TR or TD element by
+ * reference or ID string, a Record instance, a RecordSet position index,
+ * or an object literal representation
+ * of a cell.
+ * @return {Boolean} True if item is selected.
+ */
+isSelected : function(o) {
+    var oRecord, sRecordId, j;
+
+    var el = this.getTrEl(o) || this.getTdEl(o);
+    if(el) {
+        return Dom.hasClass(el,DT.CLASS_SELECTED);
+    }
+    else {
+        var tracker = this._aSelections;
+        if(tracker && tracker.length > 0) {
+            // Looking for a Record?
+            if(o instanceof YAHOO.widget.Record) {
+                oRecord = o;
+            }
+            else if(lang.isNumber(o)) {
+                oRecord = this.getRecord(o);
+            }
+            if(oRecord) {
+                sRecordId = oRecord.getId();
+
+                // Is it there?
+                // Use Array.indexOf if available...
+                if(tracker.indexOf) {
+                    if(tracker.indexOf(sRecordId) >  -1) {
+                        return true;
+                    }
+                }
+                // ...or do it the old-fashioned way
+                else {
+                    for(j=tracker.length-1; j>-1; j--) {
+                       if(tracker[j] === sRecordId){
+                        return true;
+                       }
+                    }
+                }
+            }
+            // Looking for a cell
+            else if(o.record && o.column){
+                sRecordId = o.record.getId();
+                var sColumnId = o.column.getId();
+
+                for(j=tracker.length-1; j>-1; j--) {
+                    if((tracker[j].recordId === sRecordId) && (tracker[j].columnId === sColumnId)){
+                        return true;
+                    }
+                }
+            }
+        }
+    }
+    return false;
+},
+
+/**
+ * Returns selected rows as an array of Record IDs.
+ *
+ * @method getSelectedRows
+ * @return {String[]} Array of selected rows by Record ID.
+ */
+getSelectedRows : function() {
+    var aSelectedRows = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(lang.isString(tracker[j])){
+            aSelectedRows.push(tracker[j]);
+        }
+    }
+    return aSelectedRows;
+},
+
+/**
+ * Returns selected cells as an array of object literals:
+ *     {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @method getSelectedCells
+ * @return {Object[]} Array of selected cells by Record ID and Column ID.
+ */
+getSelectedCells : function() {
+    var aSelectedCells = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j] && (tracker[j].constructor == Object)){
+            aSelectedCells.push(tracker[j]);
+        }
+    }
+    return aSelectedCells;
+},
+
+/**
+ * Returns last selected Record ID.
+ *
+ * @method getLastSelectedRecord
+ * @return {String} Record ID of last selected row.
+ */
+getLastSelectedRecord : function() {
+    var tracker = this._aSelections;
+    if(tracker && tracker.length > 0) {
+        for(var i=tracker.length-1; i>-1; i--) {
+           if(lang.isString(tracker[i])){
+                return tracker[i];
+            }
+        }
+    }
+},
+
+/**
+ * Returns last selected cell as an object literal:
+ *     {recordId:sRecordId, columnId:sColumnId}.
+ *
+ * @method getLastSelectedCell
+ * @return {Object} Object literal representation of a cell.
+ */
+getLastSelectedCell : function() {
+    var tracker = this._aSelections;
+    if(tracker && tracker.length > 0) {
+        for(var i=tracker.length-1; i>-1; i--) {
+           if(tracker[i].recordId && tracker[i].columnId){
+                return tracker[i];
+            }
+        }
+    }
+},
+
+/**
+ * Assigns the class DT.CLASS_HIGHLIGHTED to the given row.
+ *
+ * @method highlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+highlightRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        // Make sure previous row is unhighlighted
+/*        if(this._sLastHighlightedTrElId) {
+            Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);
+        }*/
+        var oRecord = this.getRecord(elRow);
+        Dom.addClass(elRow,DT.CLASS_HIGHLIGHTED);
+        //this._sLastHighlightedTrElId = elRow.id;
+        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
+        return;
+    }
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED from the given row.
+ *
+ * @method unhighlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+unhighlightRow : function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        Dom.removeClass(elRow,DT.CLASS_HIGHLIGHTED);
+        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
+        return;
+    }
+},
+
+/**
+ * Assigns the class DT.CLASS_HIGHLIGHTED to the given cell.
+ *
+ * @method highlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+highlightCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        // Make sure previous cell is unhighlighted
+        /*if(this._sLastHighlightedTdElId) {
+            Dom.removeClass(this._sLastHighlightedTdElId,DT.CLASS_HIGHLIGHTED);
+        }*/
+
+        var oRecord = this.getRecord(elCell);
+        var sColumnId = elCell.yuiColumnId;
+        Dom.addClass(elCell,DT.CLASS_HIGHLIGHTED);
+        //this._sLastHighlightedTdElId = elCell.id;
+        this.fireEvent("cellHighlightEvent", {record:oRecord, column:this.getColumnById(sColumnId), key:elCell.yuiColumnKey, el:elCell});
+        return;
+    }
+},
+
+/**
+ * Removes the class DT.CLASS_HIGHLIGHTED from the given cell.
+ *
+ * @method unhighlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+unhighlightCell : function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        Dom.removeClass(elCell,DT.CLASS_HIGHLIGHTED);
+        this.fireEvent("cellUnhighlightEvent", {record:oRecord, column:this.getColumnById(elCell.yuiColumnId), key:elCell.yuiColumnKey, el:elCell});
+        return;
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// INLINE EDITING
+
+/**
+ * Shows Cell Editor for given cell.
+ *
+ * @method showCellEditor
+ * @param elCell {HTMLElement | String} Cell to edit.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ */
+showCellEditor : function(elCell, oRecord, oColumn) {
+    elCell = Dom.get(elCell);
+
+    if(elCell && (elCell.ownerDocument === document)) {
+        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
+            oRecord = this.getRecord(elCell);
+        }
+        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
+            oColumn = this.getColumn(elCell);
+        }
+        if(oRecord && oColumn) {
+            var oCellEditor = this._oCellEditor;
+
+            // Clear previous Editor
+            if(oCellEditor.isActive) {
+                this.cancelCellEditor();
+            }
+
+            // Editor not defined
+            if(!oColumn.editor) {
+                return;
+            }
+
+            // Update Editor values
+            oCellEditor.cell = elCell;
+            oCellEditor.record = oRecord;
+            oCellEditor.column = oColumn;
+            oCellEditor.validator = (oColumn.editorOptions &&
+                    lang.isFunction(oColumn.editorOptions.validator)) ?
+                    oColumn.editorOptions.validator : null;
+            oCellEditor.value = oRecord.getData(oColumn.key);
+            oCellEditor.defaultValue = null;
+
+            // Move Editor
+            var elContainer = oCellEditor.container;
+            var x = Dom.getX(elCell);
+            var y = Dom.getY(elCell);
+
+            // SF doesn't get xy for cells in scrolling table
+            // when tbody display is set to block
+            if(isNaN(x) || isNaN(y)) {
+                x = elCell.offsetLeft + // cell pos relative to table
+                        Dom.getX(this._elTbody.parentNode) - // plus table pos relative to document
+                        this._elTbody.scrollLeft; // minus tbody scroll
+                y = elCell.offsetTop + // cell pos relative to table
+                        Dom.getY(this._elTbody.parentNode) - // plus table pos relative to document
+                        this._elTbody.scrollTop + // minus tbody scroll
+                        this._elThead.offsetHeight; // account for fixed THEAD cells
+            }
+
+            elContainer.style.left = x + "px";
+            elContainer.style.top = y + "px";
+
+            // Hook to customize the UI
+            this.doBeforeShowCellEditor(this._oCellEditor);
+
+            //TODO: This is temporarily up here due so elements can be focused
+            // Show Editor
+            elContainer.style.display = "";
+
+            // Handle ESC key
+            Ev.addListener(elContainer, "keydown", function(e, oSelf) {
+                // ESC hides Cell Editor
+                if((e.keyCode == 27)) {
+                    oSelf.cancelCellEditor();
+                    oSelf.focusTbodyEl();
+                }
+                else {
+                    oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
+                }
+            }, this);
+
+            // Render Editor markup
+            var fnEditor;
+            if(lang.isString(oColumn.editor)) {
+                switch(oColumn.editor) {
+                    case "checkbox":
+                        fnEditor = DT.editCheckbox;
+                        break;
+                    case "date":
+                        fnEditor = DT.editDate;
+                        break;
+                    case "dropdown":
+                        fnEditor = DT.editDropdown;
+                        break;
+                    case "radio":
+                        fnEditor = DT.editRadio;
+                        break;
+                    case "textarea":
+                        fnEditor = DT.editTextarea;
+                        break;
+                    case "textbox":
+                        fnEditor = DT.editTextbox;
+                        break;
+                    default:
+                        fnEditor = null;
+                }
+            }
+            else if(lang.isFunction(oColumn.editor)) {
+                fnEditor = oColumn.editor;
+            }
+
+            if(fnEditor) {
+                // Create DOM input elements
+                fnEditor(this._oCellEditor, this);
+
+                // Show Save/Cancel buttons
+                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
+                    this.showCellEditorBtns(elContainer);
+                }
+
+                oCellEditor.isActive = true;
+
+                //TODO: verify which args to pass
+                this.fireEvent("editorShowEvent", {editor:oCellEditor});
+                return;
+            }
+        }
+    }
+},
+
+/**
+ * Overridable abstract method to customize Cell Editor UI.
+ *
+ * @method doBeforeShowCellEditor
+ * @param oCellEditor {Object} Cell Editor object literal.
+ */
+doBeforeShowCellEditor : function(oCellEditor) {
+},
+
+/**
+ * Adds Save/Cancel buttons to Cell Editor.
+ *
+ * @method showCellEditorBtns
+ * @param elContainer {HTMLElement} Cell Editor container.
+ */
+showCellEditorBtns : function(elContainer) {
+    // Buttons
+    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
+    Dom.addClass(elBtnsDiv, DT.CLASS_BUTTON);
+
+    // Save button
+    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    Dom.addClass(elSaveBtn, DT.CLASS_DEFAULT);
+    elSaveBtn.innerHTML = "OK";
+    Ev.addListener(elSaveBtn, "click", function(oArgs, oSelf) {
+        oSelf.onEventSaveCellEditor(oArgs, oSelf);
+        oSelf.focusTbodyEl();
+    }, this, true);
+
+    // Cancel button
+    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    elCancelBtn.innerHTML = "Cancel";
+    Ev.addListener(elCancelBtn, "click", function(oArgs, oSelf) {
+        oSelf.onEventCancelCellEditor(oArgs, oSelf);
+        oSelf.focusTbodyEl();
+    }, this, true);
+},
+
+/**
+ * Clears Cell Editor of all state and UI.
+ *
+ * @method resetCellEditor
+ */
+
+resetCellEditor : function() {
+    var elContainer = this._oCellEditor.container;
+    elContainer.style.display = "none";
+    Ev.purgeElement(elContainer, true);
+    elContainer.innerHTML = "";
+    this._oCellEditor.value = null;
+    this._oCellEditor.isActive = false;
+},
+
+/**
+ * Saves Cell Editor input to Record.
+ *
+ * @method saveCellEditor
+ */
+saveCellEditor : function() {
+    if(this._oCellEditor.isActive) {
+        var newData = this._oCellEditor.value;
+        // Copy the data to pass to the event
+        var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));
+
+        // Validate input data
+        if(this._oCellEditor.validator) {
+            newData = this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData, this._oCellEditor);
+            if(newData === null ) {
+                this.resetCellEditor();
+                this.fireEvent("editorRevertEvent",
+                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
+                return;
+            }
+        }
+
+        // Update the Record
+        this._oRecordSet.updateRecordValue(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
+
+        // Update the UI
+        this.formatCell(this._oCellEditor.cell.firstChild);
+        this._syncColWidths();
+
+        // Clear out the Cell Editor
+        this.resetCellEditor();
+
+        this.fireEvent("editorSaveEvent",
+                {editor:this._oCellEditor, oldData:oldData, newData:newData});
+    }
+    else {
+    }
+},
+
+/**
+ * Cancels Cell Editor.
+ *
+ * @method cancelCellEditor
+ */
+cancelCellEditor : function() {
+    if(this._oCellEditor.isActive) {
+        this.resetCellEditor();
+        //TODO: preserve values for the event?
+        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
+    }
+    else {
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ABSTRACT METHODS
+
+/**
+ * Overridable method gives implementers a hook to access data before
+ * it gets added to RecordSet and rendered to the TBODY.
+ *
+ * @method doBeforeLoadData
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} additional arguments
+ * @return {Boolean} Return true to continue loading data into RecordSet and
+ * updating DataTable with new Records, false to cancel.
+ */
+doBeforeLoadData : function(sRequest, oResponse, oPayload) {
+    return true;
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public Custom Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Overridable custom event handler to sort Column.
+ *
+ * @method onEventSortColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSortColumn : function(oArgs) {
+//TODO: support form elements in sortable columns
+    var evt = oArgs.event;
+    var target = oArgs.target;
+
+    var el = this.getThEl(target) || this.getTdEl(target);
+    if(el && el.yuiColumnKey) {
+        var oColumn = this.getColumn(el.yuiColumnKey);
+        if(oColumn.sortable) {
+            Ev.stopEvent(evt);
+            this.sortColumn(oColumn);
+        }
+    }
+    else {
+    }
+},
+
+/**
+ * Overridable custom event handler to select Column.
+ *
+ * @method onEventSelectColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectColumn : function(oArgs) {
+    this.selectColumn(oArgs.target);
+},
+
+/**
+ * Overridable custom event handler to highlight Column. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightColumn : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightColumn(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to unhighlight Column. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightColumn : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightColumn(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to manage selection according to desktop paradigm.
+ *
+ * @method onEventSelectRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectRow : function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if(sMode == "single") {
+        this._handleSingleSelectionByMouse(oArgs);
+    }
+    else {
+        this._handleStandardSelectionByMouse(oArgs);
+    }
+},
+
+/**
+ * Overridable custom event handler to select cell.
+ *
+ * @method onEventSelectCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventSelectCell : function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if(sMode == "cellblock") {
+        this._handleCellBlockSelectionByMouse(oArgs);
+    }
+    else if(sMode == "cellrange") {
+        this._handleCellRangeSelectionByMouse(oArgs);
+    }
+    else {
+        this._handleSingleCellSelectionByMouse(oArgs);
+    }
+},
+
+/**
+ * Overridable custom event handler to highlight row. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightRow : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightRow(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to unhighlight row. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightRow : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightRow(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to highlight cell. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventHighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventHighlightCell : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.highlightCell(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to unhighlight cell. Accounts for spurious
+ * caused-by-child events. 
+ *
+ * @method onEventUnhighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventUnhighlightCell : function(oArgs) {
+    //TODO: filter for all spurious events at a lower level
+    if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
+        this.unhighlightCell(oArgs.target);
+    }
+},
+
+/**
+ * Overridable custom event handler to format cell.
+ *
+ * @method onEventFormatCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventFormatCell : function(oArgs) {
+    var target = oArgs.target;
+
+    var elCell = this.getTdEl(target);
+    if(elCell && elCell.yuiColumnKey) {
+        var oColumn = this.getColumn(elCell.yuiColumnKey);
+        this.formatCell(elCell.firstChild, this.getRecord(elCell), oColumn);
+    }
+    else {
+    }
+},
+
+/**
+ * Overridable custom event handler to edit cell.
+ *
+ * @method onEventShowCellEditor
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+onEventShowCellEditor : function(oArgs) {
+    var target = oArgs.target;
+
+    var elCell = this.getTdEl(target);
+    if(elCell) {
+        this.showCellEditor(elCell);
+    }
+    else {
+    }
+},
+
+/**
+ * Overridable custom event handler to save Cell Editor input.
+ *
+ * @method onEventSaveCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+onEventSaveCellEditor : function(oArgs) {
+    this.saveCellEditor();
+},
+
+/**
+ * Overridable custom event handler to cancel Cell Editor.
+ *
+ * @method onEventCancelCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+onEventCancelCellEditor : function(oArgs) {
+    this.cancelCellEditor();
+},
+
+/**
+ * Callback function receives data from DataSource and populates an entire
+ * DataTable with Records and TR elements, clearing previous Records, if any.
+ *
+ * @method onDataReturnInitializeTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnInitializeTable : function(sRequest, oResponse, oPayload) {
+    this.initializeTable();
+
+    this.onDataReturnSetRecords(sRequest,oResponse,oPayload);
+},
+
+/**
+ * Callback function receives data from DataSource and appends to an existing
+ * DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
+ *
+ * @method onDataReturnAppendRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnAppendRows : function(sRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
+
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results);
+
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(sRequest,oResponse,oPayload);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
+
+/**
+ * Callback function receives data from DataSource and inserts new records
+ * starting at the index specified in oPayload.insertIndex.  If applicable,
+ * creates or updates corresponding TR elements.
+ *
+ * @method onDataReturnInsertRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnInsertRows : function(sRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
+
+    oPayload = oPayload || { insertIndex : 0 };
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
+
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results, oPayload.insertIndex || 0);
+
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(sRequest,oResponse,oPayload);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
+
+/**
+ * Receives reponse from DataSource and populates the RecordSet with the
+ * results.
+ * @method onDataReturnSetRecords
+ * @param oRequest {MIXED} Original generated request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} (optional) Additional argument(s)
+ */
+onDataReturnSetRecords : function(oRequest, oResponse, oPayload) {
+    this.fireEvent("dataReturnEvent", {request:oRequest,response:oResponse,payload:oPayload});
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(oRequest, oResponse, oPayload);
+
+    // Data ok to set
+    if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
+        var oPaginator = this.get('paginator');
+        var startIndex = oPayload && lang.isNumber(oPayload.startIndex) ?
+                            oPayload.startIndex : 0;
+
+        // If paginating, set the number of total records if provided
+        if (oPaginator instanceof Pag) {
+            if (lang.isNumber(oResponse.totalRecords)) {
+                oPaginator.setTotalRecords(oResponse.totalRecords,true);
+            } else {
+                oPaginator.setTotalRecords(oResponse.results.length,true);
+            }
+        }
+
+        this._oRecordSet.setRecords(oResponse.results, startIndex);
+
+        // Update the instance with any payload data
+        this._handleDataReturnPayload(oRequest,oResponse,oPayload);
+
+        this.render();
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(DT.MSG_ERROR, DT.CLASS_ERROR);
+    }
+},
+
+/**
+ * Updates the DataTable with data sent in an onDataReturn* payload
+ * @method _handleDataReturnPayload
+ * @param oRequest {MIXED} Original generated request.
+ * @param oResponse {Object} Response object.
+ * @param oPayload {MIXED} Additional argument(s)
+ * @private
+ */
+_handleDataReturnPayload : function (oRequest, oResponse, oPayload) {
+    if (oPayload) {
+        // Update with any pagination information
+        var oState = oPayload.pagination;
+
+        if (oState) {
+            // Set the paginator values in preparation for refresh
+            var oPaginator = this.get('paginator');
+            if (oPaginator && oPaginator instanceof Pag) {
+                oPaginator.setStartIndex(oState.recordOffset,true);
+                oPaginator.setRowsPerPage(oState.rowsPerPage,true);
+            }
+
+        }
+
+        // Update with any sorting information
+        oState = oPayload.sorting;
+
+        if (oState) {
+            // Set the sorting values in preparation for refresh
+            this.set('sortedBy', oState);
+        }
+    }
+},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Fired when the DataTable instance's initialization is complete.
+     *
+     * @event initEvent
+     */
+
+    /**
+     * Fired when the DataTable's view is rendered.
+     *
+     * @event renderEvent
+     */
+
+    /**
+     * Fired when data is returned from DataSource but before it is consumed by
+     * DataTable.
+     *
+     * @event dataReturnEvent
+     * @param oArgs.request {String} Original request.
+     * @param oArgs.response {Object} Response object.
+     */
+
+    /**
+     * Fired when the DataTable has a focus event.
+     *
+     * @event tableFocusEvent
+     */
+
+    /**
+     * Fired when the DataTable THEAD element has a focus event.
+     *
+     * @event theadFocusEvent
+     */
+
+    /**
+     * Fired when the DataTable TBODY element has a focus event.
+     *
+     * @event tbodyFocusEvent
+     */
+
+    /**
+     * Fired when the DataTable has a blur event.
+     *
+     * @event tableBlurEvent
+     */
+
+    /*TODO
+     * Fired when the DataTable THEAD element has a blur event.
+     *
+     * @event theadBlurEvent
+     */
+
+    /*TODO
+     * Fired when the DataTable TBODY element has a blur event.
+     *
+     * @event tbodyBlurEvent
+     */
+
+    /**
+     * Fired when the DataTable has a key event.
+     *
+     * @event tableKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
+
+    /**
+     * Fired when the DataTable THEAD element has a key event.
+     *
+     * @event theadKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
+
+    /**
+     * Fired when the DataTable TBODY element has a key event.
+     *
+     * @event tbodyKeyEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     */
+
+    /**
+     * Fired when the DataTable has a mouseover.
+     *
+     * @event tableMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mouseout.
+     *
+     * @event tableMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mousedown.
+     *
+     * @event tableMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a click.
+     *
+     * @event tableClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a dblclick.
+     *
+     * @event tableDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when a fixed scrolling DataTable has a scroll.
+     *
+     * @event tableScrollEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
+     * or the DataTable's TBODY element (everyone else).
+     *
+     */
+
+    /**
+     * Fired when a message is shown in the DataTable's message element.
+     *
+     * @event tableMsgShowEvent
+     * @param oArgs.html {String} The HTML displayed.
+     * @param oArgs.className {String} The className assigned.
+     *
+     */
+
+    /**
+     * Fired when the DataTable's message element is hidden.
+     *
+     * @event tableMsgHideEvent
+     */
+
+    /**
+     * Fired when a THEAD row has a mouseover.
+     *
+     * @event theadRowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a THEAD row has a mouseout.
+     *
+     * @event theadRowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a THEAD row has a mousedown.
+     *
+     * @event theadRowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a THEAD row has a click.
+     *
+     * @event theadRowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a THEAD row has a dblclick.
+     *
+     * @event theadRowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a THEAD cell has a mouseover.
+     *
+     * @event theadCellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a THEAD cell has a mouseout.
+     *
+     * @event theadCellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a THEAD cell has a mousedown.
+     *
+     * @event theadCellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a THEAD cell has a click.
+     *
+     * @event theadCellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a THEAD cell has a dblclick.
+     *
+     * @event theadCellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a THEAD label has a mouseover.
+     *
+     * @event theadLabelMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a THEAD label has a mouseout.
+     *
+     * @event theadLabelMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a THEAD label has a mousedown.
+     *
+     * @event theadLabelMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a THEAD label has a click.
+     *
+     * @event theadLabelClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a THEAD label has a dblclick.
+     *
+     * @event theadLabelDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a column is sorted.
+     *
+     * @event columnSortEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.dir {String} Sort direction: YAHOO.widget.DataTable.CLASS_ASC
+     * or YAHOO.widget.DataTable.CLASS_DESC.
+     */
+
+    /**
+     * Fired when a column width is set.
+     *
+     * @event columnSetWidthEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.width {Number} The width in pixels.
+     */
+
+    /**
+     * Fired when a column is drag-resized.
+     *
+     * @event columnResizeEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a column is hidden.
+     *
+     * @event columnHideEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+
+    /**
+     * Fired when a column is shown.
+     *
+     * @event columnShowEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+
+    /**
+     * Fired when a column is selected.
+     *
+     * @event columnSelectEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+
+    /**
+     * Fired when a column is unselected.
+     *
+     * @event columnUnselectEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+    /**
+     * Fired when a column is removed.
+     *
+     * @event columnRemoveEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     */
+
+    /**
+     * Fired when a column is inserted.
+     *
+     * @event columnInsertEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.index {Number} The index position.
+     */
+
+    /**
+     * Fired when a column is highlighted.
+     *
+     * @event columnHighlightEvent
+     * @param oArgs.column {YAHOO.widget.Column} The highlighted Column.
+     */
+
+    /**
+     * Fired when a column is unhighlighted.
+     *
+     * @event columnUnhighlightEvent
+     * @param oArgs.column {YAHOO.widget.Column} The unhighlighted Column.
+     */
+
+
+    /**
+     * Fired when a row has a mouseover.
+     *
+     * @event rowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mouseout.
+     *
+     * @event rowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mousedown.
+     *
+     * @event rowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a click.
+     *
+     * @event rowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a dblclick.
+     *
+     * @event rowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row is added.
+     *
+     * @event rowAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The added Record.
+     */
+
+    /**
+     * Fired when a row is updated.
+     *
+     * @event rowUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
+     * @param oArgs.oldData {Object} Object literal of the old data.
+     */
+
+    /**
+     * Fired when a row is deleted.
+     *
+     * @event rowDeleteEvent
+     * @param oArgs.oldData {Object} Object literal of the deleted data.
+     * @param oArgs.recordIndex {Number} Index of the deleted Record.
+     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if on current page.
+     */
+
+    /**
+     * Fired when a row is selected.
+     *
+     * @event rowSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     */
+
+    /**
+     * Fired when a row is unselected.
+     *
+     * @event rowUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     */
+
+    /**
+     * Fired when all row selections are cleared.
+     *
+     * @event unselectAllRowsEvent
+     */
+
+    /**
+     * Fired when a row is highlighted.
+     *
+     * @event rowHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /**
+     * Fired when a row is unhighlighted.
+     *
+     * @event rowUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /**
+     * Fired when a cell has a mouseover.
+     *
+     * @event cellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mouseout.
+     *
+     * @event cellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mousedown.
+     *
+     * @event cellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a click.
+     *
+     * @event cellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a dblclick.
+     *
+     * @event cellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell is formatted.
+     *
+     * @event cellFormatEvent
+     * @param oArgs.el {HTMLElement} The formatted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the formatted cell.
+     */
+
+    /**
+     * Fired when a cell is selected.
+     *
+     * @event cellSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the selected cell.
+     */
+
+    /**
+     * Fired when a cell is unselected.
+     *
+     * @event cellUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the unselected cell.
+
+     */
+
+    /**
+     * Fired when a cell is highlighted.
+     *
+     * @event cellHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the highlighted cell.
+
+     */
+
+    /**
+     * Fired when a cell is unhighlighted.
+     *
+     * @event cellUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.
+     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.
+     * @param oArgs.key {String} (deprecated) The key of the unhighlighted cell.
+
+     */
+
+    /**
+     * Fired when all cell selections are cleared.
+     *
+     * @event unselectAllCellsEvent
+     */
+
+    /**
+     * Fired when an Editor is activated.
+     *
+     * @event editorShowEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
 
     /**
-     * Fired when a new Record is added to the RecordSet.
+     * Fired when an active Editor has a keydown.
      *
-     * @event recordAddEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.data {Object} Data added.
+     * @event editorKeydownEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.event {HTMLEvent} The event object.
      */
-    this.createEvent("recordAddEvent");
 
     /**
-     * Fired when multiple Records are added to the RecordSet at once.
+     * Fired when Editor input is reverted.
      *
-     * @event recordsAddEvent
-     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
-     * @param oArgs.data {Object[]} Data added.
+     * @event editorRevertEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value from form input field.
+     * @param oArgs.oldData {Object} Old data value.
      */
-    this.createEvent("recordsAddEvent");
 
     /**
-     * Fired when a Record is updated with new data.
+     * Fired when Editor input is saved.
      *
-     * @event recordUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.newData {Object} New data.
-     * @param oArgs.oldData {Object} Old data.
+     * @event editorSaveEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value from form input field.
+     * @param oArgs.oldData {Object} Old data value.
      */
-    this.createEvent("recordUpdateEvent");
-    
+
     /**
-     * Fired when a Record is deleted from the RecordSet.
+     * Fired when Editor input is canceled.
      *
-     * @event recordDeleteEvent
-     * @param oArgs.data {Object} A copy of the data held by the Record,
-     * or an array of data object literals if multiple Records were deleted at once.
-     * @param oArgs.index {Object} Index of the deleted Record.
+     * @event editorCancelEvent
+     * @param oArgs.editor {Object} The Editor object literal.
      */
-    this.createEvent("recordDeleteEvent");
 
     /**
-     * Fired when multiple Records are deleted from the RecordSet at once.
+     * Fired when an active Editor has a blur.
      *
-     * @event recordsDeleteEvent
-     * @param oArgs.data {Object[]} An array of data object literals copied
-     * from the Records.
-     * @param oArgs.index {Object} Index of the first deleted Record.
+     * @event editorBlurEvent
+     * @param oArgs.editor {Object} The Editor object literal.
      */
-    this.createEvent("recordsDeleteEvent");
-    
+
+
+
+
+
+
+
     /**
-     * Fired when all Records are deleted from the RecordSet at once.
+     * Fired when a link is clicked.
      *
-     * @event resetEvent
+     * @event linkClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The A element.
+     */
+
+    /**
+     * Fired when a BUTTON element is clicked.
+     *
+     * @event buttonClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The BUTTON element.
      */
-    this.createEvent("resetEvent");
 
     /**
-     * Fired when a Record Key is updated with new data.
+     * Fired when a CHECKBOX element is clicked.
      *
-     * @event keyUpdateEvent
-     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
-     * @param oArgs.key {String} The updated key.
-     * @param oArgs.newData {Object} New data.
-     * @param oArgs.oldData {Object} Old data.
+     * @event checkboxClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The CHECKBOX element.
+     */
+
+    /*TODO
+     * Fired when a SELECT element is changed.
      *
+     * @event dropdownChangeEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SELECT element.
      */
-    this.createEvent("keyUpdateEvent");
 
-};
+    /**
+     * Fired when a RADIO element is clicked.
+     *
+     * @event radioClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The RADIO element.
+     */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-if(YAHOO.util.EventProvider) {
-    YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
-}
-else {
-}
 
 /////////////////////////////////////////////////////////////////////////////
 //
-// Private member variables
+// Deprecated APIs
 //
 /////////////////////////////////////////////////////////////////////////////
+
 /**
- * Internal class variable to name multiple Recordset instances.
- *
- * @property RecordSet._nCount
- * @type Number
- * @private
- * @static
+ * @method getBody
+ * @deprecated Use getTbodyEl().
  */
-YAHOO.widget.RecordSet._nCount = 0;
+getBody : function() {
+    // Backward compatibility
+    return this.getTbodyEl();
+},
 
 /**
- * Unique instance name.
- *
- * @property _sName
- * @type String
- * @private
+ * @method getCell
+ * @deprecated Use getTdEl().
  */
-YAHOO.widget.RecordSet.prototype._sName = null;
+getCell : function(index) {
+    // Backward compatibility
+    return this.getTdEl(index);
+},
 
 /**
- * Internal variable to give unique indexes to Record instances.
- *
- * @property _nCount
- * @type Number
- * @private
+ * @method getRow
+ * @deprecated Use getTrEl().
  */
-YAHOO.widget.RecordSet.prototype._nRecordCount = 0;
+getRow : function(index) {
+    // Backward compatibility
+    return this.getTrEl(index);
+},
 
 /**
- * Internal counter of how many Records are in the RecordSet.
- *
- * @property _length
- * @type Number
- * @private
+ * @method refreshView
+ * @deprecated Use render.
  */
-YAHOO.widget.RecordSet.prototype._length = null;
+refreshView : function() {
+    // Backward compatibility
+    this.render();
+},
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private methods
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @method select
+ * @deprecated Use selectRow.
+ */
+select : function(els) {
+    // Backward compatibility
+    if(!lang.isArray(els)) {
+        els = [els];
+    }
+    for(var i=0; i<els.length; i++) {
+        this.selectRow(els[i]);
+    }
+},
 
 /**
- * Adds one Record to the RecordSet at the given index. If index is null,
- * then adds the Record to the end of the RecordSet.
- *
- * @method _addRecord
- * @param oData {Object} An object literal of data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record} A Record instance.
- * @private
+ * @method updatePaginator
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype._addRecord = function(oData, index) {
-    var oRecord = new YAHOO.widget.Record(oData);
-    oRecord._nId = this._nRecordCount;
-    this._nRecordCount++;
-    
-    if(YAHOO.lang.isNumber(index) && (index > -1)) {
-        this._records.splice(index,0,oRecord);
+updatePaginator : function(oNewValues) {
+    // Complete the set (default if not present)
+    var oValidPaginator = this.get("paginator");
+
+    var nOrigCurrentPage = oValidPaginator.currentPage;
+    for(var param in oNewValues) {
+        if(lang.hasOwnProperty(oValidPaginator, param)) {
+            oValidPaginator[param] = oNewValues[param];
+        }
     }
-    else {
-        index = this.getLength();
-        this._records.push(oRecord);
+
+    oValidPaginator.totalRecords = this._oRecordSet.getLength();
+    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
+    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
+    if(isNaN(oValidPaginator.totalPages)) {
+        oValidPaginator.totalPages = 0;
+    }
+    if(oValidPaginator.currentPage > oValidPaginator.totalPages) {
+        if(oValidPaginator.totalPages < 1) {
+            oValidPaginator.currentPage = 1;
+        }
+        else {
+            oValidPaginator.currentPage = oValidPaginator.totalPages;
+        }
+    }
+
+    if(oValidPaginator.currentPage !== nOrigCurrentPage) {
+        oValidPaginator.startRecordIndex = (oValidPaginator.currentPage-1)*oValidPaginator.rowsPerPage;
+    }
+
+
+    this.set("paginator", oValidPaginator);
+    return this.get("paginator");
+},
+
+/**
+ * @method showPage
+ * @deprecated Use Paginator class APIs.
+ */
+showPage : function(nPage) {
+    var oPaginator = this.get('paginator');
+    // Validate input
+    if(!lang.isNumber(nPage) || (nPage < 1)) {
+        if (oPaginator instanceof Pag) {
+            if (!oPaginator.hasPage(nPage)) {
+                nPage = 1;
+            }
+        } else if (nPage > oPaginator.totalPages) {
+            nPage = 1;
+        }
+    }
+
+    if (oPaginator instanceof Pag) {
+        oPaginator.setPage(nPage);
+    } else {
+        this.updatePaginator({currentPage:nPage});
+        this.render();
+    }
+},
+
+/**
+ * @method formatPaginators
+ * @deprecated Use Paginator class APIs.
+ */
+formatPaginators : function() {
+    var pag = this.get("paginator");
+    if (pag instanceof Pag) {
+        pag.update();
+        return;
+    }
+
+    var i;
+
+    // For Opera workaround
+    var dropdownEnabled = false;
+
+    // Links are enabled
+    if(pag.pageLinks > -1) {
+        for(i=0; i<pag.links.length; i++) {
+            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
+        }
+    }
+
+    // Dropdown is enabled
+    for(i=0; i<pag.dropdowns.length; i++) {
+         if(pag.dropdownOptions) {
+            dropdownEnabled = true;
+            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
+        }
+        else {
+            pag.dropdowns[i].style.display = "none";
+        }
+    }
+
+    // For Opera artifacting in dropdowns
+    if(dropdownEnabled && ua.opera) {
+        document.body.style += '';
+    }
+},
+
+/**
+ * @method formatPaginatorDropdown
+ * @deprecated Use Paginator class APIs.
+ */
+formatPaginatorDropdown : function(elDropdown, dropdownOptions) {
+    if(elDropdown && (elDropdown.ownerDocument == document)) {
+        // Clear OPTION elements
+        while (elDropdown.firstChild) {
+            elDropdown.removeChild(elDropdown.firstChild);
+        }
+
+        // Create OPTION elements
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var optionEl = document.createElement("option");
+            optionEl.value = (lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            optionEl.innerHTML = (lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            optionEl = elDropdown.appendChild(optionEl);
+        }
+
+        var options = elDropdown.options;
+        // Update dropdown's "selected" value
+        if(options.length) {
+            for(var i=options.length-1; i>-1; i--) {
+                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
+                    options[i].selected = true;
+                }
+            }
+        }
+
+        // Show the dropdown
+        elDropdown.style.display = "";
+        return;
     }
-    this._length++;
-    return oRecord;
-};
+},
 
 /**
- * Deletes Records from the RecordSet at the given index. If range is null,
- * then only one Record is deleted.
- *
- * @method _deleteRecord
- * @param index {Number} Position index.
- * @param range {Number} (optional) How many Records to delete
- * @private
+ * @method formatPaginatorLinks
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype._deleteRecord = function(index, range) {
-    if(!YAHOO.lang.isNumber(range) || (range < 0)) {
-        range = 1;
-    }
-    this._records.splice(index, range);
-    this._length = this._length - range;
-};
+formatPaginatorLinks : function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
+    if(elContainer && (elContainer.ownerDocument == document) &&
+            lang.isNumber(nCurrentPage) && lang.isNumber(nPageLinksStart) &&
+            lang.isNumber(nTotalPages)) {
+        // Set up markup for first/last/previous/next
+        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
+        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
+        var sFirstLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_FIRST + "\">&lt;&lt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_FIRST + "\">&lt;&lt;</a> ";
+        var sPrevLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_PREVIOUS + "\">&lt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_PREVIOUS + "\">&lt;</a> " ;
+        var sNextLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_NEXT + "\">&gt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_NEXT + "\">&gt;</a> " ;
+        var sLastLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + DT.CLASS_DISABLED +
+                " " + DT.CLASS_LAST +  "\">&gt;&gt;</span> " :
+                " <a href=\"#\" class=\"" + DT.CLASS_LAST + "\">&gt;&gt;</a> ";
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+        // Start with first and previous
+        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
 
-/**
- * Public accessor to the unique name of the RecordSet instance.
- *
- * @method toString
- * @return {String} Unique name of the RecordSet instance.
- */
-YAHOO.widget.RecordSet.prototype.toString = function() {
-    return this._sName;
-};
+        // Ok to show all links
+        var nMaxLinks = nTotalPages;
+        var nFirstLink = 1;
+        var nLastLink = nTotalPages;
 
-/**
- * Returns the number of Records held in the RecordSet.
- *
- * @method getLength
- * @return {Number} Number of records in the RecordSet.
- */
-YAHOO.widget.RecordSet.prototype.getLength = function() {
-        return this._length;
-};
+        if(nPageLinksLength > 0) {
+        // Calculate how many links to show
+            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
+                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
 
-/**
- * Returns Record at given position index.
- *
- * @method getRecord
- * @param index {Number} Record's Recordset position index.
- * @return {YAHOO.widget.Record} Record object.
- */
-YAHOO.widget.RecordSet.prototype.getRecord = function(index) {
-    if(YAHOO.lang.isNumber(index)) {
-        return this._records[index];
-    }
-    /*else if(YAHOO.lang.isString(identifier)) {
-        for(var i=0; i<this._records.length; i++) {
-            if(this._records[i].yuiRecordId == identifier) {
-                return this._records[i];
+            // Try to keep the current page in the middle
+            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
+            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
+
+            // Keep the last link in range
+            if(nFirstLink === 1) {
+                nLastLink = nMaxLinks;
+            }
+            // Keep the first link in range
+            else if(nLastLink === nTotalPages) {
+                nFirstLink = nTotalPages - nMaxLinks + 1;
             }
-        }
-    }*/
-    return null;
 
-};
+            // An even number of links can get funky
+            if(nLastLink - nFirstLink === nMaxLinks) {
+                nLastLink--;
+            }
+      }
 
-/*
- * Returns an array of Records from the RecordSet.
- *
- * @method getRecords
- * @param index {Number} (optional) Recordset position index of which Record to
- * start at.
- * @param range {Number} (optional) Number of Records to get.
- * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
- * length equal to given range. If index is not given, all Records are returned.
- */
-YAHOO.widget.RecordSet.prototype.getRecords = function(index, range) {
-    if(!YAHOO.lang.isNumber(index)) {
-        return this._records;
-    }
-    if(!YAHOO.lang.isNumber(range)) {
-        return this._records.slice(index);
+        // Generate markup for each page
+        for(var i=nFirstLink; i<=nLastLink; i++) {
+            if(i != nCurrentPage) {
+                sMarkup += " <a href=\"#\" class=\"" + DT.CLASS_PAGE + "\">" + i + "</a> ";
+            }
+            else {
+                sMarkup += " <span class=\"" + DT.CLASS_SELECTED + "\">" + i + "</span>";
+            }
+        }
+        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
+        elContainer.innerHTML = sMarkup;
+        return;
     }
-    return this._records.slice(index, index+range);
-};
+},
 
 /**
- * Returns position index for the given Record.
- *
- * @method getRecordIndex
- * @param oRecord {YAHOO.widget.Record} Record instance.
- * @return {Number} Record's RecordSet position index.
+ * @method _onPaginatorLinkClick
+ * @private
+ * @deprecated Use Paginator class APIs.
  */
+_onPaginatorLinkClick : function(e, oSelf) {
+    // Backward compatibility
+    var elTarget = Ev.getTarget(e);
+    var elTag = elTarget.nodeName.toLowerCase();
 
-YAHOO.widget.RecordSet.prototype.getRecordIndex = function(oRecord) {
-    for(var i=this._records.length-1; i>-1; i--) {
-        if(oRecord.getId() === this._records[i].getId()) {
-            return i;
-        }
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
     }
-    return null;
 
-};
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                Ev.stopEvent(e);
+                //TODO: after the showPage call, figure out which link
+                //TODO: was clicked and reset focus to the new version of it
+                //TODO: support multiple custom classnames
+                switch(elTarget.className) {
+                    case DT.CLASS_PAGE:
+                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
+                        return;
+                    case DT.CLASS_FIRST:
+                        oSelf.showPage(1);
+                        return;
+                    case DT.CLASS_LAST:
+                        oSelf.showPage(oSelf.get("paginator").totalPages);
+                        return;
+                    case DT.CLASS_PREVIOUS:
+                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
+                        return;
+                    case DT.CLASS_NEXT:
+                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
+                        return;
+                }
+                break;
+            default:
+                return;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.nodeName.toLowerCase();
+        }
+        else {
+            return;
+        }
+    }
+},
 
 /**
- * Adds one Record to the RecordSet at the given index. If index is null,
- * then adds the Record to the end of the RecordSet.
- *
- * @method addRecord
- * @param oData {Object} An object literal of data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record} A Record instance.
+ * @method _onPaginatorDropdownChange
+ * @private
+ * @deprecated Use Paginator class APIs.
  */
-YAHOO.widget.RecordSet.prototype.addRecord = function(oData, index) {
-    if(oData && (oData.constructor == Object)) {
-        var oRecord = this._addRecord(oData, index);
-        this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
-        return oRecord;
+_onPaginatorDropdownChange : function(e, oSelf) {
+    // Backward compatibility
+    var elTarget = Ev.getTarget(e);
+    var newValue = elTarget[elTarget.selectedIndex].value;
+
+    var newRowsPerPage = lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
+    if(newRowsPerPage !== null) {
+        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
+        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
+        oSelf.render();
     }
     else {
-        return null;
     }
-};
+},
 
 /**
- * Adds multiple Records at once to the RecordSet at the given index with the
- * given data. If index is null, then the new Records are added to the end of
- * the RecordSet.
- *
- * @method addRecords
- * @param aData {Object[]} An array of object literal data.
- * @param index {Number} (optional) Position index.
- * @return {YAHOO.widget.Record[]} An array of Record instances.
+ * @method onEventEditCell
+ * @deprecated Use onEventShowCellEditor.
  */
-YAHOO.widget.RecordSet.prototype.addRecords = function(aData, index) {
-    if(YAHOO.lang.isArray(aData)) {
-        var newRecords = [];
-        // Can't go backwards bc we need to preserve order
-        for(var i=0; i<aData.length; i++) {
-            if(aData[i] && (aData[i].constructor == Object)) {
-                var record = this._addRecord(aData[i], index);
-                newRecords.push(record);
-            }
-       }
-        this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
-       return newRecords;
-    }
-    else if(aData && (aData.constructor == Object)) {
-        var oRecord = this._addRecord(aData);
-        this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
-        return oRecord;
-    }
-    else {
-    }
-};
+onEventEditCell : function(oArgs) {
+    // Backward compatibility
+    this.onEventShowCellEditor(oArgs);
+},
 
 /**
- * Updates given Record with given data.
- *
- * @method updateRecord
- * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
- * RecordSet position index.
- * @param oData {Object) Object literal of new data.
- * @return {YAHOO.widget.Record} Updated Record, or null.
+ * @method onDataReturnReplaceRows
+ * @deprecated Use onDataReturnInitializeTable.
  */
-YAHOO.widget.RecordSet.prototype.updateRecord = function(record, oData) {
-    var oRecord = null;
-    if(YAHOO.lang.isNumber(record)) {
-        oRecord = this._records[record];
-    }
-    else if(record instanceof YAHOO.widget.Record) {
-        oRecord = record;
-    }
-    if(oRecord && oData && (oData.constructor == Object)) {
-        // Copy data from the Record for the event that gets fired later
-        var oldData = {};
-        for(var key in oRecord._oData) {
-            oldData[key] = oRecord._oData[key];
-        }
-        oRecord._oData = oData;
-        this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
-        return oRecord;
-    }
-    else {
-        return null;
-    }
-};
+onDataReturnReplaceRows : function(sRequest, oResponse) {
+    // Backward compatibility
+    this.onDataReturnInitializeTable(sRequest, oResponse);
+}
 
 /**
- * Updates given Record at given key with given data.
- *
- * @method updateKey
- * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
- * RecordSet position index.
- * @param sKey {String} Key name.
- * @param oData {Object) New data.
+ * @event headerRowMouseoverEvent
+ * @deprecated Use theadRowMouseoverEvent.
  */
-YAHOO.widget.RecordSet.prototype.updateKey = function(record, sKey, oData) {
-    var oRecord;
-    
-    if(YAHOO.lang.isNumber(record)) {
-        oRecord = this._records[record];
-    }
-    if(record instanceof YAHOO.widget.Record) {
-        oRecord = record;
-
-        var oldData = null;
-        var keyValue = oRecord._oData[sKey];
-        // Copy data from the Record for the event that gets fired later
-        if(keyValue && keyValue.constructor == Object) {
-            oldData = {};
-            for(var key in keyValue) {
-                oldData[key] = keyValue[key];
-            }
-        }
-        // Copy by value
-        else {
-            oldData = keyValue;
-        }
-
-        oRecord._oData[sKey] = oData;
-        this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
-    }
-    else {
-    }
-};
 
 /**
- * Replaces all Records in RecordSet with new data.
- *
- * @method replaceRecords
- * @param data {Object || Object[]} An object literal of data or an array of
- * object literal data.
- * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
- * an array of Records.
+ * @event headerRowMouseoutEvent
+ * @deprecated Use theadRowMouseoutEvent.
  */
-YAHOO.widget.RecordSet.prototype.replaceRecords = function(data) {
-    this.reset();
-    return this.addRecords(data);
-};
 
 /**
- * Sorts all Records by given function.
- *
- * @method sortRecords
- * @param fnSort {Function} Reference to a sort function.
- * @param desc {Boolean} True if sort direction is descending, false if sort
- * direction is ascending.
- * @return {YAHOO.widget.Record[]} Sorted array of Records.
+ * @event headerRowMousedownEvent
+ * @deprecated Use theadRowMousedownEvent.
  */
-YAHOO.widget.RecordSet.prototype.sortRecords = function(fnSort, desc) {
-    return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
-};
-
 
 /**
- * Removes the Record at the given position index from the RecordSet. If a range
- * is also provided, removes that many Records, starting from the index. Length
- * of RecordSet is correspondingly shortened.
- *
- * @method deleteRecord
- * @param index {Number} Record's RecordSet position index.
- * @param range {Number} (optional) How many Records to delete.
- * @return {Object} A copy of the data held by the deleted Record.
+ * @event headerRowClickEvent
+ * @deprecated Use theadRowClickEvent.
  */
-YAHOO.widget.RecordSet.prototype.deleteRecord = function(index) {
-    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
-        // Copy data from the Record for the event that gets fired later
-        var oRecordData = this.getRecord(index).getData();
-        var oData = {};
-        for(var key in oRecordData) {
-            oData[key] = oRecordData[key];
-        }
-        
-        this._deleteRecord(index);
-        this.fireEvent("recordDeleteEvent",{data:oData,index:index});
-        return oData;
-    }
-    else {
-        return null;
-    }
-};
 
 /**
- * Removes the Record at the given position index from the RecordSet. If a range
- * is also provided, removes that many Records, starting from the index. Length
- * of RecordSet is correspondingly shortened.
- *
- * @method deleteRecords
- * @param index {Number} Record's RecordSet position index.
- * @param range {Number} (optional) How many Records to delete.
+ * @event headerRowDblclickEvent
+ * @deprecated Use theadRowDblclickEvent.
  */
-YAHOO.widget.RecordSet.prototype.deleteRecords = function(index, range) {
-    if(!YAHOO.lang.isNumber(range)) {
-        range = 1;
-    }
-    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
-        var recordsToDelete = this.getRecords(index, range);
-        // Copy data from each Record for the event that gets fired later
-        var deletedData = [];
-        for(var i=0; i<recordsToDelete.length; i++) {
-            var oData = {};
-            for(var key in recordsToDelete[i]) {
-                oData[key] = recordsToDelete[i][key];
-            }
-            deletedData.push(oData);
-        }
-        this._deleteRecord(index, range);
-
-        this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
-
-    }
-    else {
-    }
-};
 
 /**
- * Deletes all Records from the RecordSet.
- *
- * @method reset
+ * @event headerCellMouseoverEvent
+ * @deprecated Use theadCellMouseoverEvent.
  */
-YAHOO.widget.RecordSet.prototype.reset = function() {
-    this._records = [];
-    this._length = 0;
-    this.fireEvent("resetEvent");
-};
 
+/**
+ * @event headerCellMouseoutEvent
+ * @deprecated Use theadCellMouseoutEvent.
+ */
 
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
+/**
+ * @event headerCellMousedownEvent
+ * @deprecated Use theadCellMousedownEvent.
+ */
 
 /**
- * The Record class defines a DataTable record.
- *
- * @namespace YAHOO.widget
- * @class Record
- * @constructor
- * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ * @event headerCellClickEvent
+ * @deprecated Use theadCellClickEvent.
  */
-YAHOO.widget.Record = function(oLiteral) {
-    this._oData = {};
-    if(oLiteral && (oLiteral.constructor == Object)) {
-        for(var sKey in oLiteral) {
-            this._oData[sKey] = oLiteral[sKey];
-        }
-    }
-};
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Private member variables
-//
-/////////////////////////////////////////////////////////////////////////////
 /**
- * Unique number assigned at instantiation, indicates original order within
- * RecordSet.
- *
- * @property _nId
- * @type Number
- * @private
+ * @event headerCellDblclickEvent
+ * @deprecated Use theadCellDblclickEvent.
  */
-YAHOO.widget.Record.prototype._nId = null;
 
 /**
- * Holds data for the Record in an object literal.
- *
- * @property _oData
- * @type Object
- * @private
+ * @event headerLabelMouseoverEvent
+ * @deprecated Use theadLabelMouseoverEvent.
  */
-YAHOO.widget.Record.prototype._oData = null;
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public member variables
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @event headerLabelMouseoutEvent
+ * @deprecated Use theadLabelMouseoutEvent.
+ */
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-/////////////////////////////////////////////////////////////////////////////
+/**
+ * @event headerLabelMousedownEvent
+ * @deprecated Use theadLabelMousedownEvent.
+ */
 
 /**
- * Returns unique number assigned at instantiation, indicates original order
- * within RecordSet.
- *
- * @method getId
- * @return Number
+ * @event headerLabelClickEvent
+ * @deprecated Use theadLabelClickEvent.
  */
-YAHOO.widget.Record.prototype.getId = function() {
-    return this._nId;
-};
 
 /**
- * Returns data for the Record for a key if given, or the entire object
- * literal otherwise.
- *
- * @method getData
- * @param sKey {String} (Optional) The key to retrieve a single data value.
- * @return Object
+ * @event headerLabelDbllickEvent
+ * @deprecated Use theadLabelDblclickEvent.
  */
-YAHOO.widget.Record.prototype.getData = function(sKey) {
-    if(YAHOO.lang.isString(sKey)) {
-        return this._oData[sKey];
-    }
-    else {
-        return this._oData;
-    }
-};
 
+});
+})();
 
-YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.3.0", build: "442"});
+YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.5.0", build: "895"});
index 777503c0896dc442475bec8b35248f77a8ca4fd4..7363a1a6007c031aceb39e1ce59892c8c8cad5a5 100755 (executable)
@@ -1,5 +1,24 @@
 Dom Release Notes
 
+** Known Issues **
+* margin/padding/borders on HTML element cause getXY to misreport
+* margin/borders on BODY element may cause getXY to misreport
+* Fixed postioning causes getXY to misreport in some cases
+
+----------------------------
+
+*** version 2.5.0 ***
+* get() now correctly handles textNodes
+
+*** version 2.4.0 ***
+* no longer accounting for safari body margin when offsetParent == body
+* isAncestor and inDocument no longer use batch
+* added getClientRegion()
+
+*** version 2.3.1 ***
+* allow batch() to work on array-like object
+* return null from Dom.get(undefined)
+
 *** version 2.3.0 ***
 * added getAncestorBy methods
 * added getChildren methods
@@ -7,10 +26,12 @@ Dom Release Notes
 * trimming added for class mgmt methods
 * fixed getXY inside table for Opera 
 
-** Known Issues **
-* margin/padding/borders on HTML element cause getXY to misreport
-* margin on BODY causes Safari to misreport getXY
-* Fixed postioning causes getXY to misreport in some cases
+*** version 2.3.0 ***
+* added getAncestorBy methods
+* added getChildren methods
+* added getSibling methods
+* trimming added for class mgmt methods
+* fixed getXY inside table for Opera 
 
 *** version 2.2.2 ***
 
index b0e2283c53f6bfda0078ae10ea2b001f75c07f52..40b622a3e26aaff0e4c9bb1770ff0d4a20196c10 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -14,10 +14,12 @@ version: 2.3.0
     var Y = YAHOO.util,     // internal shorthand
         getStyle,           // for load time browser branching
         setStyle,           // ditto
-        id_counter = 0,     // for use with generateId
         propertyCache = {}, // for faster hyphen converts
-        reClassNameCache = {}; // cache regexes for className
+        reClassNameCache = {},          // cache regexes for className
+        document = window.document;     // cache for faster lookups
     
+    YAHOO.env._id_counter = YAHOO.env._id_counter || 0;     // for use with generateId (global to save state if Dom is overwritten)
+
     // brower detection
     var isOpera = YAHOO.env.ua.opera,
         isSafari = YAHOO.env.ua.webkit, 
@@ -131,7 +133,7 @@ version: 2.3.0
             el.style[property] = val;
         };
     }
-    
+
     var testElement = function(node, method) {
         return node && node.nodeType == 1 && ( !method || method(node) );
     };
@@ -149,15 +151,15 @@ version: 2.3.0
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (!el || el.tagName || el.item) { // null, HTMLElement, or HTMLCollection
+            if (el && (el.nodeType || el.item)) { // Node, or NodeList
                 return el;
             }
 
-            if (YAHOO.lang.isString(el)) { // HTMLElement or null
+            if (YAHOO.lang.isString(el) || !el) { // id or null
                 return document.getElementById(el);
             }
             
-            if (el.splice) { // Array of HTMLElements/IDs
+            if (el.length !== undefined) { // array-like 
                 var c = [];
                 for (var i = 0, len = el.length; i < len; ++i) {
                     c[c.length] = Y.Dom.get(el[i]);
@@ -213,65 +215,15 @@ version: 2.3.0
          */
         getXY: function(el) {
             var f = function(el) {
-    
-            // has to be part of document to have pageXY
+                // has to be part of document to have pageXY
                 if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
                     YAHOO.log('getXY failed: element not available', 'error', 'Dom');
                     return false;
                 }
                 
-                var parentNode = null;
-                var pos = [];
-                var box;
-                var doc = el.ownerDocument; 
-
-                if (el.getBoundingClientRect) { // IE
-                    box = el.getBoundingClientRect();
-                    return [box.left + Y.Dom.getDocumentScrollLeft(el.ownerDocument), box.top + Y.Dom.getDocumentScrollTop(el.ownerDocument)];
-                }
-                else { // safari, opera, & gecko
-                    pos = [el.offsetLeft, el.offsetTop];
-                    parentNode = el.offsetParent;
-
-                    // safari: if el is abs or any parent is abs, subtract body offsets
-                    var hasAbs = this.getStyle(el, 'position') == 'absolute';
-
-                    if (parentNode != el) {
-                        while (parentNode) {
-                            pos[0] += parentNode.offsetLeft;
-                            pos[1] += parentNode.offsetTop;
-                            if (isSafari && !hasAbs && 
-                                    this.getStyle(parentNode,'position') == 'absolute' ) {
-                                hasAbs = true; // we need to offset if any parent is absolutely positioned
-                            }
-                            parentNode = parentNode.offsetParent;
-                        }
-                    }
-
-                    if (isSafari && hasAbs) { //safari doubles in this case
-                        pos[0] -= el.ownerDocument.body.offsetLeft;
-                        pos[1] -= el.ownerDocument.body.offsetTop;
-                    } 
-                }
-                
-                parentNode = el.parentNode;
-
-                // account for any scrolled ancestors
-                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
-                {
-                   // work around opera inline/table scrollLeft/Top bug
-                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
-                        pos[0] -= parentNode.scrollLeft;
-                        pos[1] -= parentNode.scrollTop;
-                    }
-                    
-                    parentNode = parentNode.parentNode; 
-                }
-       
-                YAHOO.log('getXY returning ' + pos, 'info', 'Dom');
-                
-                return pos;
+                YAHOO.log('getXY returning ' + getXY(el), 'info', 'Dom');
+                return getXY(el);
             };
             
             return Y.Dom.batch(el, f, Y.Dom, true);
@@ -479,6 +431,7 @@ version: 2.3.0
          * @method addClass         
          * @param {String | HTMLElement | Array} el The element or collection to add the class to
          * @param {String} className the class name to add to the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         addClass: function(el, className) {
             var f = function(el) {
@@ -500,12 +453,13 @@ version: 2.3.0
          * @method removeClass         
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} className the class name to remove from the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         removeClass: function(el, className) {
             var re = getClassRegEx(className);
             
             var f = function(el) {
-                if (!this.hasClass(el, className)) {
+                if (!className || !this.hasClass(el, className)) {
                     return false; // not present
                 }                 
 
@@ -531,6 +485,7 @@ version: 2.3.0
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} oldClassName the class name to be replaced
          * @param {String} newClassName the class name that will be replacing the old class name
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         replaceClass: function(el, oldClassName, newClassName) {
             if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
@@ -576,7 +531,7 @@ version: 2.3.0
                     return el.id;
                 } 
 
-                var id = prefix + id_counter++;
+                var id = prefix + YAHOO.env._id_counter++;
                 YAHOO.log('generateId generating ' + id, 'info', 'Dom');
 
                 if (el) {
@@ -599,27 +554,27 @@ version: 2.3.0
          */
         isAncestor: function(haystack, needle) {
             haystack = Y.Dom.get(haystack);
-            if (!haystack || !needle) { return false; }
+            needle = Y.Dom.get(needle);
             
-            var f = function(node) {
-                if (haystack.contains && node.nodeType && !isSafari) { // safari contains is broken
-                    YAHOO.log('isAncestor returning ' + haystack.contains(node), 'info', 'Dom');
-                    return haystack.contains(node);
-                }
-                else if ( haystack.compareDocumentPosition && node.nodeType ) {
-                    YAHOO.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(node) & 16), 'info', 'Dom');
-                    return !!(haystack.compareDocumentPosition(node) & 16);
-                } else if (node.nodeType) {
-                    // fallback to crawling up (safari)
-                    return !!this.getAncestorBy(node, function(el) {
-                        return el == haystack; 
-                    }); 
-                }
-                YAHOO.log('isAncestor failed; most likely needle is not an HTMLElement', 'error', 'Dom');
+            if (!haystack || !needle) {
                 return false;
-            };
-            
-            return Y.Dom.batch(needle, f, Y.Dom, true);      
+            }
+
+            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
+                YAHOO.log('isAncestor returning ' + haystack.contains(needle), 'info', 'Dom');
+                return haystack.contains(needle);
+            }
+            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
+                YAHOO.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(needle) & 16), 'info', 'Dom');
+                return !!(haystack.compareDocumentPosition(needle) & 16);
+            } else if (needle.nodeType) {
+                // fallback to crawling up (safari)
+                return !!this.getAncestorBy(needle, function(el) {
+                    return el == haystack; 
+                }); 
+            }
+            YAHOO.log('isAncestor failed; most likely needle is not an HTMLElement', 'error', 'Dom');
+            return false;
         },
         
         /**
@@ -629,19 +584,7 @@ version: 2.3.0
          * @return {Boolean} Whether or not the element is present in the current document
          */
         inDocument: function(el) {
-            var f = function(el) { // safari contains fails for body so crawl up
-                if (isSafari) {
-                    while (el = el.parentNode) { // note assignment
-                        if (el == document.documentElement) {
-                            return true;
-                        }
-                    }
-                    return false;
-                }
-                return this.isAncestor(document.documentElement, el);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return this.isAncestor(document.documentElement, el);
         },
         
         /**
@@ -680,17 +623,17 @@ version: 2.3.0
         },
         
         /**
-         * Returns an the method(s) return value(s).
+         * Runs the supplied method against each item in the Collection/Array.
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
          * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
-         * @return {Any | Array} The return value(s) from the supplied methods
+         * @return {Any | Array} The return value(s) from the supplied method
          */
         batch: function(el, method, o, override) {
-            el = (el && el.tagName) ? el : Y.Dom.get(el); // skip get() when possible
+            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
 
             if (!el || !method) {
                 YAHOO.log('batch failed: invalid arguments', 'error', 'Dom');
@@ -698,7 +641,7 @@ version: 2.3.0
             } 
             var scope = (override) ? o : window;
             
-            if (el.tagName || (!el.item && !el.slice)) { // not a collection or array, just run the method
+            if (el.tagName || el.length === undefined) { // element or not array-like 
                 return method.call(scope, el, o);
             } 
 
@@ -1058,8 +1001,76 @@ version: 2.3.0
             } else {
                 return referenceNode.parentNode.appendChild(newNode);
             }
+        },
+
+        /**
+         * Creates a Region based on the viewport relative to the document. 
+         * @method getClientRegion
+         * @return {Region} A Region object representing the viewport which accounts for document scroll
+         */
+        getClientRegion: function() {
+            var t = Y.Dom.getDocumentScrollTop(),
+                l = Y.Dom.getDocumentScrollLeft(),
+                r = Y.Dom.getViewportWidth() + l,
+                b = Y.Dom.getViewportHeight() + t;
+
+            return new Y.Region(t, r, b, l);
         }
     };
+    
+    var getXY = function() {
+        if (document.documentElement.getBoundingClientRect) { // IE
+            return function(el) {
+                var box = el.getBoundingClientRect();
+
+                var rootNode = el.ownerDocument;
+                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
+                        Y.Dom.getDocumentScrollTop(rootNode)];
+            };
+        } else {
+            return function(el) { // manually calculate by crawling up offsetParents
+                var pos = [el.offsetLeft, el.offsetTop];
+                var parentNode = el.offsetParent;
+
+                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
+                var accountForBody = (isSafari &&
+                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
+                        el.offsetParent == el.ownerDocument.body);
+
+                if (parentNode != el) {
+                    while (parentNode) {
+                        pos[0] += parentNode.offsetLeft;
+                        pos[1] += parentNode.offsetTop;
+                        if (!accountForBody && isSafari && 
+                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) { 
+                            accountForBody = true;
+                        }
+                        parentNode = parentNode.offsetParent;
+                    }
+                }
+
+                if (accountForBody) { //safari doubles in this case
+                    pos[0] -= el.ownerDocument.body.offsetLeft;
+                    pos[1] -= el.ownerDocument.body.offsetTop;
+                } 
+                parentNode = el.parentNode;
+
+                // account for any scrolled ancestors
+                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
+                {
+                   // work around opera inline/table scrollLeft/Top bug
+                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
+                        pos[0] -= parentNode.scrollLeft;
+                        pos[1] -= parentNode.scrollTop;
+                    }
+                    
+                    parentNode = parentNode.parentNode; 
+                }
+
+                return pos;
+            };
+        }
+    }() // NOTE: Executing for loadtime branching
 })();
 /**
  * A region is a representation of an object on a grid.  It is defined
@@ -1247,4 +1258,4 @@ YAHOO.util.Point = function(x, y) {
 
 YAHOO.util.Point.prototype = new YAHOO.util.Region();
 
-YAHOO.register("dom", YAHOO.util.Dom, {version: "2.3.0", build: "442"});
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.5.0", build: "895"});
index ecece476d4165a34576515994f2735230bba8289..51f1ddb2b8808054d66108d9a17dd11ad8a4abe5 100755 (executable)
@@ -1,74 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
-if(propertyCache[property]){return propertyCache[property];}
-var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
-propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
-return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
-var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
-return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
-if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
-break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
-el.style[property]=val;};}
-var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
-if(YAHOO.lang.isString(el)){return document.getElementById(el);}
-if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
-return c;}
-return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
-else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
-parentNode=parentNode.offsetParent;}}
-if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
-parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
-{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
-parentNode=parentNode.parentNode;}
-return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
-var pageXY=this.getXY(el);if(pageXY===false){return false;}
-var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
-if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
-if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
-if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
-return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
-el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
-var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
-var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
-el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
-var id=prefix+id_counter++;if(el){el.id=id;}
-return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
-var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
-else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
-return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
-return false;}
-return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
-return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
-var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
-var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
-return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
-return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
-return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
-return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
-return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
-var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
-return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
-return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
-this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=M.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=M.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;
+}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(B.Dom.getStyle(Q,"display").search(/^inline|table-row.*$/i)){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 19b54650ae7ccd0613e43561fef7adaed3637136..76a3702bf6d8c87cd105dae585b23edb2bb9386e 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -14,10 +14,12 @@ version: 2.3.0
     var Y = YAHOO.util,     // internal shorthand
         getStyle,           // for load time browser branching
         setStyle,           // ditto
-        id_counter = 0,     // for use with generateId
         propertyCache = {}, // for faster hyphen converts
-        reClassNameCache = {}; // cache regexes for className
+        reClassNameCache = {},          // cache regexes for className
+        document = window.document;     // cache for faster lookups
     
+    YAHOO.env._id_counter = YAHOO.env._id_counter || 0;     // for use with generateId (global to save state if Dom is overwritten)
+
     // brower detection
     var isOpera = YAHOO.env.ua.opera,
         isSafari = YAHOO.env.ua.webkit, 
@@ -129,7 +131,7 @@ version: 2.3.0
             el.style[property] = val;
         };
     }
-    
+
     var testElement = function(node, method) {
         return node && node.nodeType == 1 && ( !method || method(node) );
     };
@@ -147,15 +149,15 @@ version: 2.3.0
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (!el || el.tagName || el.item) { // null, HTMLElement, or HTMLCollection
+            if (el && (el.nodeType || el.item)) { // Node, or NodeList
                 return el;
             }
 
-            if (YAHOO.lang.isString(el)) { // HTMLElement or null
+            if (YAHOO.lang.isString(el) || !el) { // id or null
                 return document.getElementById(el);
             }
             
-            if (el.splice) { // Array of HTMLElements/IDs
+            if (el.length !== undefined) { // array-like 
                 var c = [];
                 for (var i = 0, len = el.length; i < len; ++i) {
                     c[c.length] = Y.Dom.get(el[i]);
@@ -210,63 +212,13 @@ version: 2.3.0
          */
         getXY: function(el) {
             var f = function(el) {
-    
-            // has to be part of document to have pageXY
+                // has to be part of document to have pageXY
                 if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
                     return false;
                 }
                 
-                var parentNode = null;
-                var pos = [];
-                var box;
-                var doc = el.ownerDocument; 
-
-                if (el.getBoundingClientRect) { // IE
-                    box = el.getBoundingClientRect();
-                    return [box.left + Y.Dom.getDocumentScrollLeft(el.ownerDocument), box.top + Y.Dom.getDocumentScrollTop(el.ownerDocument)];
-                }
-                else { // safari, opera, & gecko
-                    pos = [el.offsetLeft, el.offsetTop];
-                    parentNode = el.offsetParent;
-
-                    // safari: if el is abs or any parent is abs, subtract body offsets
-                    var hasAbs = this.getStyle(el, 'position') == 'absolute';
-
-                    if (parentNode != el) {
-                        while (parentNode) {
-                            pos[0] += parentNode.offsetLeft;
-                            pos[1] += parentNode.offsetTop;
-                            if (isSafari && !hasAbs && 
-                                    this.getStyle(parentNode,'position') == 'absolute' ) {
-                                hasAbs = true; // we need to offset if any parent is absolutely positioned
-                            }
-                            parentNode = parentNode.offsetParent;
-                        }
-                    }
-
-                    if (isSafari && hasAbs) { //safari doubles in this case
-                        pos[0] -= el.ownerDocument.body.offsetLeft;
-                        pos[1] -= el.ownerDocument.body.offsetTop;
-                    } 
-                }
-                
-                parentNode = el.parentNode;
-
-                // account for any scrolled ancestors
-                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
-                {
-                   // work around opera inline/table scrollLeft/Top bug
-                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
-                        pos[0] -= parentNode.scrollLeft;
-                        pos[1] -= parentNode.scrollTop;
-                    }
-                    
-                    parentNode = parentNode.parentNode; 
-                }
-       
-                
-                return pos;
+                return getXY(el);
             };
             
             return Y.Dom.batch(el, f, Y.Dom, true);
@@ -469,6 +421,7 @@ version: 2.3.0
          * @method addClass         
          * @param {String | HTMLElement | Array} el The element or collection to add the class to
          * @param {String} className the class name to add to the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         addClass: function(el, className) {
             var f = function(el) {
@@ -489,12 +442,13 @@ version: 2.3.0
          * @method removeClass         
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} className the class name to remove from the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         removeClass: function(el, className) {
             var re = getClassRegEx(className);
             
             var f = function(el) {
-                if (!this.hasClass(el, className)) {
+                if (!className || !this.hasClass(el, className)) {
                     return false; // not present
                 }                 
 
@@ -519,6 +473,7 @@ version: 2.3.0
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} oldClassName the class name to be replaced
          * @param {String} newClassName the class name that will be replacing the old class name
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         replaceClass: function(el, oldClassName, newClassName) {
             if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
@@ -562,7 +517,7 @@ version: 2.3.0
                     return el.id;
                 } 
 
-                var id = prefix + id_counter++;
+                var id = prefix + YAHOO.env._id_counter++;
 
                 if (el) {
                     el.id = id;
@@ -584,24 +539,24 @@ version: 2.3.0
          */
         isAncestor: function(haystack, needle) {
             haystack = Y.Dom.get(haystack);
-            if (!haystack || !needle) { return false; }
+            needle = Y.Dom.get(needle);
             
-            var f = function(node) {
-                if (haystack.contains && node.nodeType && !isSafari) { // safari contains is broken
-                    return haystack.contains(node);
-                }
-                else if ( haystack.compareDocumentPosition && node.nodeType ) {
-                    return !!(haystack.compareDocumentPosition(node) & 16);
-                } else if (node.nodeType) {
-                    // fallback to crawling up (safari)
-                    return !!this.getAncestorBy(node, function(el) {
-                        return el == haystack; 
-                    }); 
-                }
+            if (!haystack || !needle) {
                 return false;
-            };
-            
-            return Y.Dom.batch(needle, f, Y.Dom, true);      
+            }
+
+            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
+                return haystack.contains(needle);
+            }
+            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
+                return !!(haystack.compareDocumentPosition(needle) & 16);
+            } else if (needle.nodeType) {
+                // fallback to crawling up (safari)
+                return !!this.getAncestorBy(needle, function(el) {
+                    return el == haystack; 
+                }); 
+            }
+            return false;
         },
         
         /**
@@ -611,19 +566,7 @@ version: 2.3.0
          * @return {Boolean} Whether or not the element is present in the current document
          */
         inDocument: function(el) {
-            var f = function(el) { // safari contains fails for body so crawl up
-                if (isSafari) {
-                    while (el = el.parentNode) { // note assignment
-                        if (el == document.documentElement) {
-                            return true;
-                        }
-                    }
-                    return false;
-                }
-                return this.isAncestor(document.documentElement, el);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return this.isAncestor(document.documentElement, el);
         },
         
         /**
@@ -661,24 +604,24 @@ version: 2.3.0
         },
         
         /**
-         * Returns an the method(s) return value(s).
+         * Runs the supplied method against each item in the Collection/Array.
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
          * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
-         * @return {Any | Array} The return value(s) from the supplied methods
+         * @return {Any | Array} The return value(s) from the supplied method
          */
         batch: function(el, method, o, override) {
-            el = (el && el.tagName) ? el : Y.Dom.get(el); // skip get() when possible
+            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
 
             if (!el || !method) {
                 return false;
             } 
             var scope = (override) ? o : window;
             
-            if (el.tagName || (!el.item && !el.slice)) { // not a collection or array, just run the method
+            if (el.tagName || el.length === undefined) { // element or not array-like 
                 return method.call(scope, el, o);
             } 
 
@@ -1023,8 +966,76 @@ version: 2.3.0
             } else {
                 return referenceNode.parentNode.appendChild(newNode);
             }
+        },
+
+        /**
+         * Creates a Region based on the viewport relative to the document. 
+         * @method getClientRegion
+         * @return {Region} A Region object representing the viewport which accounts for document scroll
+         */
+        getClientRegion: function() {
+            var t = Y.Dom.getDocumentScrollTop(),
+                l = Y.Dom.getDocumentScrollLeft(),
+                r = Y.Dom.getViewportWidth() + l,
+                b = Y.Dom.getViewportHeight() + t;
+
+            return new Y.Region(t, r, b, l);
         }
     };
+    
+    var getXY = function() {
+        if (document.documentElement.getBoundingClientRect) { // IE
+            return function(el) {
+                var box = el.getBoundingClientRect();
+
+                var rootNode = el.ownerDocument;
+                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
+                        Y.Dom.getDocumentScrollTop(rootNode)];
+            };
+        } else {
+            return function(el) { // manually calculate by crawling up offsetParents
+                var pos = [el.offsetLeft, el.offsetTop];
+                var parentNode = el.offsetParent;
+
+                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
+                var accountForBody = (isSafari &&
+                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
+                        el.offsetParent == el.ownerDocument.body);
+
+                if (parentNode != el) {
+                    while (parentNode) {
+                        pos[0] += parentNode.offsetLeft;
+                        pos[1] += parentNode.offsetTop;
+                        if (!accountForBody && isSafari && 
+                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) { 
+                            accountForBody = true;
+                        }
+                        parentNode = parentNode.offsetParent;
+                    }
+                }
+
+                if (accountForBody) { //safari doubles in this case
+                    pos[0] -= el.ownerDocument.body.offsetLeft;
+                    pos[1] -= el.ownerDocument.body.offsetTop;
+                } 
+                parentNode = el.parentNode;
+
+                // account for any scrolled ancestors
+                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
+                {
+                   // work around opera inline/table scrollLeft/Top bug
+                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
+                        pos[0] -= parentNode.scrollLeft;
+                        pos[1] -= parentNode.scrollTop;
+                    }
+                    
+                    parentNode = parentNode.parentNode; 
+                }
+
+                return pos;
+            };
+        }
+    }() // NOTE: Executing for loadtime branching
 })();
 /**
  * A region is a representation of an object on a grid.  It is defined
@@ -1211,4 +1222,4 @@ YAHOO.util.Point = function(x, y) {
 
 YAHOO.util.Point.prototype = new YAHOO.util.Region();
 
-YAHOO.register("dom", YAHOO.util.Dom, {version: "2.3.0", build: "442"});
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.5.0", build: "895"});
index 1f5c7becc76c35c5d479f544fb538e933e4935e9..9ee166e567719e705bad7c818f369cfe244903cd 100755 (executable)
@@ -1,5 +1,25 @@
 Drag and Drop Release Notes
 
+2.5.0
+    * Added CustomEvents in addition to method overrides
+        (See API Docs for more information)
+    * Added an IFRAME element to the proxy div (only in IE) to keep select
+        elements and other object from bleeding through
+
+2.4.0
+  * Added configuration option called "dragOnly". If dragOnly is set to true,
+    all event in the fireEvents method will not fire. These events are:
+        onInvalidDrop
+        b4DragOut & onDragOut
+        onDragEnter
+        b4DragOver & onDragOver
+        b4DragDrop & onDragDrop
+    This config option should be used to drag elements that have no need for
+        drop interaction. They are elements that just need to move.
+
+2.3.1
+  * No change
+
 2.3.0
   * YAHOO.util.DragDropMgr.stopDrag is now public, and can be used to cancel
     a drag in progress.  An optional "silent" flag was added to skip the
index a969e143ba6c6413e98901344554c756f847dd08..8cdd977c0d8e66a383565b9cb556c2a741b4d807 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The drag and drop utility provides a framework for building drag and drop
@@ -33,7 +33,6 @@ YAHOO.util.DragDropMgr = function() {
     var Event = YAHOO.util.Event;
 
     return {
-
         /**
          * Two dimensional Array of registered DragDrop objects.  The first 
          * dimension is the DragDrop item group, the second the DragDrop 
@@ -346,6 +345,16 @@ YAHOO.util.DragDropMgr = function() {
          */
         startY: 0,
 
+        /**
+         * Flag to determine if the drag event was fired from the click timeout and
+         * not the mouse move threshold.
+         * @property fromTimeout
+         * @type boolean
+         * @private
+         * @static
+         */
+        fromTimeout: false,
+
         /**
          * Each DragDrop instance must be registered with the DragDropMgr.  
          * This is executed in DragDrop.init()
@@ -439,7 +448,7 @@ YAHOO.util.DragDropMgr = function() {
         getRelated: function(p_oDD, bTargetsOnly) {
             var oDDs = [];
             for (var i in p_oDD.groups) {
-                for (j in this.ids[i]) {
+                for (var j in this.ids[i]) {
                     var dd = this.ids[i][j];
                     if (! this.isTypeOfDD(dd)) {
                         continue;
@@ -548,7 +557,8 @@ YAHOO.util.DragDropMgr = function() {
             this.clickTimeout = setTimeout( 
                     function() { 
                         var DDM = YAHOO.util.DDM;
-                        DDM.startDrag(DDM.startX, DDM.startY); 
+                        DDM.startDrag(DDM.startX, DDM.startY);
+                        DDM.fromTimeout = true;
                     }, 
                     this.clickTimeThresh );
         },
@@ -565,11 +575,13 @@ YAHOO.util.DragDropMgr = function() {
             YAHOO.log("firing drag start events", "info", "DragDropMgr");
             clearTimeout(this.clickTimeout);
             var dc = this.dragCurrent;
-            if (dc) {
+            if (dc && dc.events.b4StartDrag) {
                 dc.b4StartDrag(x, y);
+                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
             }
-            if (dc) {
+            if (dc && dc.events.startDrag) {
                 dc.startDrag(x, y);
+                dc.fireEvent('startDragEvent', { x: x, y: y });
             }
             this.dragThreshMet = true;
         },
@@ -588,6 +600,11 @@ YAHOO.util.DragDropMgr = function() {
 
                 if (this.dragThreshMet) {
                     YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
+                    if (this.fromTimeout) {
+                        YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseMove so we can get the dragOver event', 'info', 'DragDropMgr');
+                        this.handleMouseMove(e);
+                    }
+                    this.fromTimeout = false;
                     this.fireEvents(e, true);
                 } else {
                     YAHOO.log("drag threshold not met", "info", "DragDropMgr");
@@ -635,17 +652,25 @@ YAHOO.util.DragDropMgr = function() {
          */
         stopDrag: function(e, silent) {
             // YAHOO.log("mouseup - removing event handlers");
-
+            var dc = this.dragCurrent;
             // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent && !silent) {
+            if (dc && !silent) {
                 if (this.dragThreshMet) {
                     YAHOO.log("firing endDrag events", "info", "DragDropMgr");
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
+                    if (dc.events.b4EndDrag) {
+                        dc.b4EndDrag(e);
+                        dc.fireEvent('b4EndDragEvent', { e: e });
+                    }
+                    if (dc.events.endDrag) {
+                        dc.endDrag(e);
+                        dc.fireEvent('endDragEvent', { e: e });
+                    }
+                }
+                if (dc.events.mouseUp) {
+                    YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr");
+                    dc.onMouseUp(e);
+                    dc.fireEvent('mouseUpEvent', { e: e });
                 }
-
-                YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr");
-                this.dragCurrent.onMouseUp(e);
             }
 
             this.dragCurrent = null;
@@ -681,6 +706,14 @@ YAHOO.util.DragDropMgr = function() {
                     YAHOO.log("button failure", "info", "DragDropMgr");
                     this.stopEvent(e);
                     return this.handleMouseUp(e);
+                } else {
+                    if (e.clientX < 0 || e.clientY < 0) {
+                        //This will stop the element from leaving the viewport in FF, Opera & Safari
+                        //Not turned on yet
+                        //YAHOO.log("Either clientX or clientY is negative, stop the event.", "info", "DragDropMgr");
+                        //this.stopEvent(e);
+                        //return false;
+                    }
                 }
 
                 if (!this.dragThreshMet) {
@@ -695,9 +728,13 @@ YAHOO.util.DragDropMgr = function() {
                 }
 
                 if (this.dragThreshMet) {
-                    dc.b4Drag(e);
-                    if (dc) {
+                    if (dc && dc.events.b4Drag) {
+                        dc.b4Drag(e);
+                        dc.fireEvent('b4DragEvent', { e: e});
+                    }
+                    if (dc && dc.events.drag) {
                         dc.onDrag(e);
+                        dc.fireEvent('dragEvent', { e: e});
                     }
                     if (dc) {
                         this.fireEvents(e, false);
@@ -707,7 +744,7 @@ YAHOO.util.DragDropMgr = function() {
                 this.stopEvent(e);
             }
         },
-
+        
         /**
          * Iterates over all of the DragDrop elements to find ones we are 
          * hovering over or dropping on
@@ -722,26 +759,31 @@ YAHOO.util.DragDropMgr = function() {
 
             // If the user did the mouse up outside of the window, we could 
             // get here even though we have ended the drag.
-            if (!dc || dc.isLocked()) {
+            // If the config option dragOnly is true, bail out and don't fire the events
+            if (!dc || dc.isLocked() || dc.dragOnly) {
                 return;
             }
 
-            var x = YAHOO.util.Event.getPageX(e);
-            var y = YAHOO.util.Event.getPageY(e);
-            var pt = new YAHOO.util.Point(x,y);
-            var pos = dc.getTargetCoord(pt.x, pt.y);
-            var el = dc.getDragEl();
-            curRegion = new YAHOO.util.Region( pos.y, 
+            var x = YAHOO.util.Event.getPageX(e),
+                y = YAHOO.util.Event.getPageY(e),
+                pt = new YAHOO.util.Point(x,y),
+                pos = dc.getTargetCoord(pt.x, pt.y),
+                el = dc.getDragEl(),
+                events = ['out', 'over', 'drop', 'enter'],
+                curRegion = new YAHOO.util.Region( pos.y, 
                                                pos.x + el.offsetWidth,
                                                pos.y + el.offsetHeight, 
-                                               pos.x );
-            // cache the previous dragOver array
-            var oldOvers = [];
-
-            var outEvts   = [];
-            var overEvts  = [];
-            var dropEvts  = [];
-            var enterEvts = [];
+                                               pos.x ),
+            
+                oldOvers = [], // cache the previous dragOver array
+                inGroupsObj  = {},
+                inGroups  = [],
+                data = {
+                    outEvts: [],
+                    overEvts: [],
+                    dropEvts: [],
+                    enterEvts: []
+                };
 
 
             // Check to see if the object(s) we were hovering over is no longer 
@@ -753,9 +795,8 @@ YAHOO.util.DragDropMgr = function() {
                 if (! this.isTypeOfDD(ddo)) {
                     continue;
                 }
-
                 if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
-                    outEvts.push( ddo );
+                    data.outEvts.push( ddo );
                 }
 
                 oldOvers[i] = true;
@@ -777,18 +818,19 @@ YAHOO.util.DragDropMgr = function() {
 
                     if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
                         if (this.isOverTarget(pt, oDD, this.mode, curRegion)) {
+                            inGroupsObj[sGroup] = true;
                             // look for drop interactions
                             if (isDrop) {
-                                dropEvts.push( oDD );
+                                data.dropEvts.push( oDD );
                             // look for drag enter and drag over interactions
                             } else {
 
                                 // initial drag over: dragEnter fires
                                 if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
+                                    data.enterEvts.push( oDD );
                                 // subsequent drag overs: dragOver fires
                                 } else {
-                                    overEvts.push( oDD );
+                                    data.overEvts.push( oDD );
                                 }
 
                                 this.dragOvers[oDD.id] = oDD;
@@ -799,106 +841,67 @@ YAHOO.util.DragDropMgr = function() {
             }
 
             this.interactionInfo = {
-                out:       outEvts,
-                enter:     enterEvts,
-                over:      overEvts,
-                drop:      dropEvts,
+                out:       data.outEvts,
+                enter:     data.enterEvts,
+                over:      data.overEvts,
+                drop:      data.dropEvts,
                 point:     pt,
                 draggedRegion:    curRegion,
                 sourceRegion: this.locationCache[dc.id],
                 validDrop: isDrop
             };
 
+            
+            for (var inG in inGroupsObj) {
+                inGroups.push(inG);
+            }
+
             // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
+            if (isDrop && !data.dropEvts.length) {
                 YAHOO.log(dc.id + " dropped, but not on a target", "info", "DragDropMgr");
                 this.interactionInfo.validDrop = false;
-                dc.onInvalidDrop(e);
-            }
-
-
-            if (this.mode) {
-                if (outEvts.length) {
-                    YAHOO.log(dc.id+" onDragOut: " + outEvts, "info", "DragDropMgr");
-                    dc.b4DragOut(e, outEvts);
-                    if (dc) {
-                        dc.onDragOut(e, outEvts);
-                    }
-                }
-
-                if (enterEvts.length) {
-                    YAHOO.log(dc.id+" onDragEnter: " + enterEvts, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts);
-                    }
-                }
-
-                if (overEvts.length) {
-                    YAHOO.log(dc.id+" onDragOver: " + overEvts, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts);
-                    }
-
-                    if (dc) {
-                        dc.onDragOver(e, overEvts);
-                    }
-                }
-
-                if (dropEvts.length) {
-                    YAHOO.log(dc.id+" onDragDrop: " + dropEvts, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts);
-                    }
-                }
-
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id+" onDragOut: " + outEvts[i].id, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOut(e, outEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragOut(e, outEvts[i].id);
-                    }
+                if (dc.events.invalidDrop) {
+                    dc.onInvalidDrop(e);
+                    dc.fireEvent('invalidDropEvent', { e: e });
                 }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " onDragEnter " + enterEvts[i].id, "info", "DragDropMgr");
-                    // dc.b4DragEnter(e, oDD.id);
+            }
 
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts[i].id);
-                    }
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " onDragOver " + overEvts[i].id, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragOver(e, overEvts[i].id);
-                    }
+            for (i = 0; i < events.length; i++) {
+                var tmp = null;
+                if (data[events[i] + 'Evts']) {
+                    tmp = data[events[i] + 'Evts'];
                 }
-
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " dropped on " + dropEvts[i].id, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts[i].id);
+                if (tmp && tmp.length) {
+                    var type = events[i].charAt(0).toUpperCase() + events[i].substr(1),
+                        ev = 'onDrag' + type,
+                        b4 = 'b4Drag' + type,
+                        cev = 'drag' + type + 'Event',
+                        check = 'drag' + type;
+                    
+                    if (this.mode) {
+                        YAHOO.log(dc.id + ' ' + ev + ': ' + tmp, "info", "DragDropMgr");
+                        if (dc.events[b4]) {
+                            dc[b4](e, tmp, inGroups);
+                            dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups });
+                        }
+                        if (dc.events[check]) {
+                            dc[ev](e, tmp, inGroups);
+                            dc.fireEvent(cev, { event: e, info: tmp, group: inGroups });
+                        }
+                    } else {
+                        for (var b = 0, len = tmp.length; b < len; ++b) {
+                            YAHOO.log(dc.id + ' ' + ev + ': ' + tmp[b].id, "info", "DragDropMgr");
+                            if (dc.events[b4]) {
+                                dc[b4](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                            if (dc.events[check]) {
+                                dc[ev](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                        }
                     }
                 }
-
             }
         },
 
@@ -1151,11 +1154,11 @@ YAHOO.log("Could not get the loc for " + oDD.id, "warn", "DragDropMgr");
 
             this._execOnAll("unreg", []);
 
-            for (i in this.elementCache) {
-                delete this.elementCache[i];
-            }
+            //for (var i in this.elementCache) {
+                //delete this.elementCache[i];
+            //}
+            //this.elementCache = {};
 
-            this.elementCache = {};
             this.ids = {};
         },
 
@@ -1164,6 +1167,7 @@ YAHOO.log("Could not get the loc for " + oDD.id, "warn", "DragDropMgr");
          * @property elementCache
          * @private
          * @static
+         * @deprecated elements are not cached now
          */
         elementCache: {},
         
@@ -1507,7 +1511,20 @@ YAHOO.util.DragDrop = function(id, sGroup, config) {
 };
 
 YAHOO.util.DragDrop.prototype = {
-
+    /**
+     * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop
+     * By setting any of these to false, then event will not be fired.
+     * @property events
+     * @type object
+     */
+    events: null,
+    /**
+    * @method on
+    * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a>
+    */
+    on: function() {
+        this.subscribe.apply(this, arguments);
+    },
     /**
      * The id of the element associated with this object.  This is what we 
      * refer to as the "linked element" because the size and position of 
@@ -1620,7 +1637,7 @@ YAHOO.util.DragDrop.prototype = {
     /**
      * By default, all instances can be a drop target.  This can be disabled by
      * setting isTarget to false.
-     * @method isTarget
+     * @property isTarget
      * @type boolean
      */
     isTarget: true,
@@ -1628,10 +1645,16 @@ YAHOO.util.DragDrop.prototype = {
     /**
      * The padding configured for this drag and drop object for calculating
      * the drop zone intersection with this object.
-     * @method padding
+     * @property padding
      * @type int[]
      */
     padding: null,
+    /**
+     * If this flag is true, do not fire drop events. The element is a drag only element (for movement not dropping)
+     * @property dragOnly
+     * @type Boolean
+     */
+    dragOnly: false,
 
     /**
      * Cached reference to the linked element
@@ -1978,7 +2001,12 @@ YAHOO.util.DragDrop.prototype = {
         this.initTarget(id, sGroup, config);
         Event.on(this._domRef || this.id, "mousedown", 
                         this.handleMouseDown, this, true);
+
         // Event.on(this.id, "selectstart", Event.preventDefault);
+        for (var i in this.events) {
+            this.createEvent(i + 'Event');
+        }
+        
     },
 
     /**
@@ -1994,6 +2022,8 @@ YAHOO.util.DragDrop.prototype = {
         // configuration attributes 
         this.config = config || {};
 
+        this.events = {};
+
         // create a local reference to the drag and drop manager
         this.DDM = YAHOO.util.DDM;
 
@@ -2045,6 +2075,34 @@ YAHOO.util.DragDrop.prototype = {
      * @method applyConfig
      */
     applyConfig: function() {
+        this.events = {
+            mouseDown: true,
+            b4MouseDown: true,
+            mouseUp: true,
+            b4StartDrag: true,
+            startDrag: true,
+            b4EndDrag: true,
+            endDrag: true,
+            drag: true,
+            b4Drag: true,
+            invalidDrop: true,
+            b4DragOut: true,
+            dragOut: true,
+            dragEnter: true,
+            b4DragOver: true,
+            dragOver: true,
+            b4DragDrop: true,
+            dragDrop: true
+        };
+        
+        if (this.config.events) {
+            for (var i in this.config.events) {
+                if (this.config.events[i] === false) {
+                    this.events[i] = false;
+                }
+            }
+        }
+
 
         // configurable properties: 
         //    padding, isTarget, maintainOffset, primaryButtonOnly
@@ -2052,7 +2110,7 @@ YAHOO.util.DragDrop.prototype = {
         this.isTarget          = (this.config.isTarget !== false);
         this.maintainOffset    = (this.config.maintainOffset);
         this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
-
+        this.dragOnly = ((this.config.dragOnly === true) ? true : false);
     },
 
     /**
@@ -2101,7 +2159,11 @@ YAHOO.util.DragDrop.prototype = {
         var el = this.getEl();
 
         if (!this.DDM.verifyEl(el)) {
-            this.logger.log(this.id + " element is broken");
+            if (el && el.style && (el.style.display == 'none')) {
+                this.logger.log(this.id + " can not get initial position, element style is display: none");
+            } else {
+                this.logger.log(this.id + " element is broken");
+            }
             return;
         }
 
@@ -2264,8 +2326,19 @@ YAHOO.util.DragDrop.prototype = {
         this.logger.log("firing onMouseDown events");
 
         // firing the mousedown events prior to calculating positions
-        this.b4MouseDown(e);
-        this.onMouseDown(e);
+        var b4Return = this.b4MouseDown(e);
+        if (this.events.b4MouseDown) {
+            b4Return = this.fireEvent('b4MouseDownEvent', e);
+        }
+        var mDownReturn = this.onMouseDown(e);
+        if (this.events.mouseDown) {
+            mDownReturn = this.fireEvent('mouseDownEvent', e);
+        }
+
+        if ((b4Return === false) || (mDownReturn === false)) {
+            this.logger.log('b4MouseDown or onMouseDown returned false, exiting drag');
+            return;
+        }
 
         this.DDM.refreshCache(this.groups);
         // var self = this;
@@ -2302,8 +2375,14 @@ this.logger.log("clickValidator returned false, drag not initiated");
         }
     },
 
+    /**
+     * @method clickValidator
+     * @description Method validates that the clicked element
+     * was indeed the handle or a valid child of the handle
+     * @param {Event} e 
+     */
     clickValidator: function(e) {
-        var target = Event.getTarget(e);
+        var target = YAHOO.util.Event.getTarget(e);
         return ( this.isValidHandleChild(target) &&
                     (this.id == this.handleElId || 
                         this.DDM.handleWasClicked(target, this.id)) );
@@ -2669,7 +2748,100 @@ this.logger.log("clickValidator returned false, drag not initiated");
     }
 
 };
+YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider);
+
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 })();
 /**
  * A DragDrop implementation where the linked element follows the 
@@ -2772,7 +2944,10 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
         }
         
         this.cachePosition(oCoord.x, oCoord.y);
-        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        var self = this;
+        setTimeout(function() {
+            self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        }, 0);
     },
 
     /**
@@ -2943,6 +3118,98 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
 
     */
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 });
 /**
  * A DragDrop implementation that inserts an empty, bordered div into
@@ -3039,6 +3306,27 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
             Dom.setStyle(_data, 'opacity', '0');
             div.appendChild(_data);
 
+            /**
+            * It seems that IE will fire the mouseup event if you pass a proxy element over a select box
+            * Placing the IFRAME element inside seems to stop this issue
+            */
+            if (YAHOO.env.ua.ie) {
+                //Only needed for Internet Explorer
+                var ifr = document.createElement('iframe');
+                ifr.setAttribute('src', 'about:blank');
+                ifr.setAttribute('scrolling', 'no');
+                ifr.setAttribute('frameborder', '0');
+                div.insertBefore(ifr, div.firstChild);
+                Dom.setStyle(ifr, 'height', '100%');
+                Dom.setStyle(ifr, 'width', '100%');
+                Dom.setStyle(ifr, 'position', 'absolute');
+                Dom.setStyle(ifr, 'top', '0');
+                Dom.setStyle(ifr, 'left', '0');
+                Dom.setStyle(ifr, 'opacity', '0');
+                Dom.setStyle(ifr, 'zIndex', '-1');
+                Dom.setStyle(ifr.nextSibling, 'zIndex', '2');
+            }
+
             // appendChild can blow up IE if invoked prior to the window load event
             // while rendering a table.  It is possible there are other scenarios 
             // that would cause this to happen as well.
@@ -3175,6 +3463,98 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
     toString: function() {
         return ("DDProxy " + this.id);
     }
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
 });
 /**
@@ -3204,4 +3584,4 @@ YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {
         return ("DDTarget " + this.id);
     }
 });
-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.3.0", build: "442"});
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.5.0", build: "895"});
index d28b4d621393b27f12db81323a18d2e2615dfbdb..013ed4c912c024087323fc115807a511007cee95 100755 (executable)
@@ -1,99 +1,10 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
-oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
-if(!this.ids[sGroup]){this.ids[sGroup]={};}
-this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
-var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}
-delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}
-this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}
-if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
-return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
-return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
-return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc){dc.b4StartDrag(x,y);}
-if(dc){dc.startDrag(x,y);}
-this.dragThreshMet=true;},handleMouseUp:function(e){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
-this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
-if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent){if(this.dragCurrent&&!silent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
-this.dragCurrent.onMouseUp(e);}
-this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){var dc=this.dragCurrent;if(dc){if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
-if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
-if(this.dragThreshMet){dc.b4Drag(e);if(dc){dc.onDrag(e);}
-if(dc){this.fireEvents(e,false);}}
-this.stopEvent(e);}},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
-var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
-if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);}
-oldOvers[i]=true;delete this.dragOvers[i];}
-for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
-for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
-if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
-this.dragOvers[oDD.id]=oDD;}}}}}
-this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);}
-if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);if(dc){dc.onDragOut(e,outEvts);}}
-if(enterEvts.length){if(dc){dc.onDragEnter(e,enterEvts);}}
-if(overEvts.length){if(dc){dc.b4DragOver(e,overEvts);}
-if(dc){dc.onDragOver(e,overEvts);}}
-if(dropEvts.length){if(dc){dc.b4DragDrop(e,dropEvts);}
-if(dc){dc.onDragDrop(e,dropEvts);}}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){if(dc){dc.b4DragOut(e,outEvts[i].id);}
-if(dc){dc.onDragOut(e,outEvts[i].id);}}
-for(i=0,len=enterEvts.length;i<len;++i){if(dc){dc.onDragEnter(e,enterEvts[i].id);}}
-for(i=0,len=overEvts.length;i<len;++i){if(dc){dc.b4DragOver(e,overEvts[i].id);}
-if(dc){dc.onDragOver(e,overEvts[i].id);}}
-for(i=0,len=dropEvts.length;i<len;++i){if(dc){dc.b4DragDrop(e,dropEvts[i].id);}
-if(dc){dc.onDragDrop(e,dropEvts[i].id);}}}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
-return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
-for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
-return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
-var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
-if(!pos){return null;}
-x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
-if(!loc){return false;}
-oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
-oTarget.overlap=null;if(!curRegion){var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
-var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
-this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
-this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
-return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
-return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
-return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
-(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
-return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
-this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
-var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
-this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
-if(this.isLocked()){return;}
-this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
-if(x>this.maxX){x=this.maxX;}}
-if(this.constrainY){if(y<this.minY){y=this.minY;}
-if(y>this.maxY){y=this.maxY;}}
-x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
-valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
-return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
-this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
-this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
-if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
-if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
-return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
-this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
-if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
-if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
-if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
-var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');Dom.setStyle(_data,'height','100%');Dom.setStyle(_data,'width','100%');Dom.setStyle(_data,'background-color','#ccc');Dom.setStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
-this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
-if(isNaN(br)){br=0;}
-if(isNaN(bb)){bb=0;}
-if(isNaN(bl)){bl=0;}
-var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.3.0",build:"442"});
\ No newline at end of file
+if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});}}}}}},getBestMatch:function(D){var F=null;
+var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;
+this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");
+YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","about:blank");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 1cb2857fa2cb7e9b1c427785f2b26c1a9e6c0b77..b9ca8ed9d528023ccdd6f127e45233e848510e36 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The drag and drop utility provides a framework for building drag and drop
@@ -33,7 +33,6 @@ YAHOO.util.DragDropMgr = function() {
     var Event = YAHOO.util.Event;
 
     return {
-
         /**
          * Two dimensional Array of registered DragDrop objects.  The first 
          * dimension is the DragDrop item group, the second the DragDrop 
@@ -344,6 +343,16 @@ YAHOO.util.DragDropMgr = function() {
          */
         startY: 0,
 
+        /**
+         * Flag to determine if the drag event was fired from the click timeout and
+         * not the mouse move threshold.
+         * @property fromTimeout
+         * @type boolean
+         * @private
+         * @static
+         */
+        fromTimeout: false,
+
         /**
          * Each DragDrop instance must be registered with the DragDropMgr.  
          * This is executed in DragDrop.init()
@@ -436,7 +445,7 @@ YAHOO.util.DragDropMgr = function() {
         getRelated: function(p_oDD, bTargetsOnly) {
             var oDDs = [];
             for (var i in p_oDD.groups) {
-                for (j in this.ids[i]) {
+                for (var j in this.ids[i]) {
                     var dd = this.ids[i][j];
                     if (! this.isTypeOfDD(dd)) {
                         continue;
@@ -545,7 +554,8 @@ YAHOO.util.DragDropMgr = function() {
             this.clickTimeout = setTimeout( 
                     function() { 
                         var DDM = YAHOO.util.DDM;
-                        DDM.startDrag(DDM.startX, DDM.startY); 
+                        DDM.startDrag(DDM.startX, DDM.startY);
+                        DDM.fromTimeout = true;
                     }, 
                     this.clickTimeThresh );
         },
@@ -561,11 +571,13 @@ YAHOO.util.DragDropMgr = function() {
         startDrag: function(x, y) {
             clearTimeout(this.clickTimeout);
             var dc = this.dragCurrent;
-            if (dc) {
+            if (dc && dc.events.b4StartDrag) {
                 dc.b4StartDrag(x, y);
+                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
             }
-            if (dc) {
+            if (dc && dc.events.startDrag) {
                 dc.startDrag(x, y);
+                dc.fireEvent('startDragEvent', { x: x, y: y });
             }
             this.dragThreshMet = true;
         },
@@ -583,6 +595,10 @@ YAHOO.util.DragDropMgr = function() {
                 clearTimeout(this.clickTimeout);
 
                 if (this.dragThreshMet) {
+                    if (this.fromTimeout) {
+                        this.handleMouseMove(e);
+                    }
+                    this.fromTimeout = false;
                     this.fireEvents(e, true);
                 } else {
                 }
@@ -628,15 +644,23 @@ YAHOO.util.DragDropMgr = function() {
          * @static
          */
         stopDrag: function(e, silent) {
-
+            var dc = this.dragCurrent;
             // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent && !silent) {
+            if (dc && !silent) {
                 if (this.dragThreshMet) {
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
+                    if (dc.events.b4EndDrag) {
+                        dc.b4EndDrag(e);
+                        dc.fireEvent('b4EndDragEvent', { e: e });
+                    }
+                    if (dc.events.endDrag) {
+                        dc.endDrag(e);
+                        dc.fireEvent('endDragEvent', { e: e });
+                    }
+                }
+                if (dc.events.mouseUp) {
+                    dc.onMouseUp(e);
+                    dc.fireEvent('mouseUpEvent', { e: e });
                 }
-
-                this.dragCurrent.onMouseUp(e);
             }
 
             this.dragCurrent = null;
@@ -668,6 +692,13 @@ YAHOO.util.DragDropMgr = function() {
                 if (YAHOO.util.Event.isIE && !e.button) {
                     this.stopEvent(e);
                     return this.handleMouseUp(e);
+                } else {
+                    if (e.clientX < 0 || e.clientY < 0) {
+                        //This will stop the element from leaving the viewport in FF, Opera & Safari
+                        //Not turned on yet
+                        //this.stopEvent(e);
+                        //return false;
+                    }
                 }
 
                 if (!this.dragThreshMet) {
@@ -680,9 +711,13 @@ YAHOO.util.DragDropMgr = function() {
                 }
 
                 if (this.dragThreshMet) {
-                    dc.b4Drag(e);
-                    if (dc) {
+                    if (dc && dc.events.b4Drag) {
+                        dc.b4Drag(e);
+                        dc.fireEvent('b4DragEvent', { e: e});
+                    }
+                    if (dc && dc.events.drag) {
                         dc.onDrag(e);
+                        dc.fireEvent('dragEvent', { e: e});
                     }
                     if (dc) {
                         this.fireEvents(e, false);
@@ -692,7 +727,7 @@ YAHOO.util.DragDropMgr = function() {
                 this.stopEvent(e);
             }
         },
-
+        
         /**
          * Iterates over all of the DragDrop elements to find ones we are 
          * hovering over or dropping on
@@ -707,26 +742,31 @@ YAHOO.util.DragDropMgr = function() {
 
             // If the user did the mouse up outside of the window, we could 
             // get here even though we have ended the drag.
-            if (!dc || dc.isLocked()) {
+            // If the config option dragOnly is true, bail out and don't fire the events
+            if (!dc || dc.isLocked() || dc.dragOnly) {
                 return;
             }
 
-            var x = YAHOO.util.Event.getPageX(e);
-            var y = YAHOO.util.Event.getPageY(e);
-            var pt = new YAHOO.util.Point(x,y);
-            var pos = dc.getTargetCoord(pt.x, pt.y);
-            var el = dc.getDragEl();
-            curRegion = new YAHOO.util.Region( pos.y, 
+            var x = YAHOO.util.Event.getPageX(e),
+                y = YAHOO.util.Event.getPageY(e),
+                pt = new YAHOO.util.Point(x,y),
+                pos = dc.getTargetCoord(pt.x, pt.y),
+                el = dc.getDragEl(),
+                events = ['out', 'over', 'drop', 'enter'],
+                curRegion = new YAHOO.util.Region( pos.y, 
                                                pos.x + el.offsetWidth,
                                                pos.y + el.offsetHeight, 
-                                               pos.x );
-            // cache the previous dragOver array
-            var oldOvers = [];
-
-            var outEvts   = [];
-            var overEvts  = [];
-            var dropEvts  = [];
-            var enterEvts = [];
+                                               pos.x ),
+            
+                oldOvers = [], // cache the previous dragOver array
+                inGroupsObj  = {},
+                inGroups  = [],
+                data = {
+                    outEvts: [],
+                    overEvts: [],
+                    dropEvts: [],
+                    enterEvts: []
+                };
 
 
             // Check to see if the object(s) we were hovering over is no longer 
@@ -738,9 +778,8 @@ YAHOO.util.DragDropMgr = function() {
                 if (! this.isTypeOfDD(ddo)) {
                     continue;
                 }
-
                 if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
-                    outEvts.push( ddo );
+                    data.outEvts.push( ddo );
                 }
 
                 oldOvers[i] = true;
@@ -761,18 +800,19 @@ YAHOO.util.DragDropMgr = function() {
 
                     if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
                         if (this.isOverTarget(pt, oDD, this.mode, curRegion)) {
+                            inGroupsObj[sGroup] = true;
                             // look for drop interactions
                             if (isDrop) {
-                                dropEvts.push( oDD );
+                                data.dropEvts.push( oDD );
                             // look for drag enter and drag over interactions
                             } else {
 
                                 // initial drag over: dragEnter fires
                                 if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
+                                    data.enterEvts.push( oDD );
                                 // subsequent drag overs: dragOver fires
                                 } else {
-                                    overEvts.push( oDD );
+                                    data.overEvts.push( oDD );
                                 }
 
                                 this.dragOvers[oDD.id] = oDD;
@@ -783,97 +823,64 @@ YAHOO.util.DragDropMgr = function() {
             }
 
             this.interactionInfo = {
-                out:       outEvts,
-                enter:     enterEvts,
-                over:      overEvts,
-                drop:      dropEvts,
+                out:       data.outEvts,
+                enter:     data.enterEvts,
+                over:      data.overEvts,
+                drop:      data.dropEvts,
                 point:     pt,
                 draggedRegion:    curRegion,
                 sourceRegion: this.locationCache[dc.id],
                 validDrop: isDrop
             };
 
-            // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
-                this.interactionInfo.validDrop = false;
-                dc.onInvalidDrop(e);
+            
+            for (var inG in inGroupsObj) {
+                inGroups.push(inG);
             }
 
-
-            if (this.mode) {
-                if (outEvts.length) {
-                    dc.b4DragOut(e, outEvts);
-                    if (dc) {
-                        dc.onDragOut(e, outEvts);
-                    }
-                }
-
-                if (enterEvts.length) {
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts);
-                    }
-                }
-
-                if (overEvts.length) {
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts);
-                    }
-
-                    if (dc) {
-                        dc.onDragOver(e, overEvts);
-                    }
-                }
-
-                if (dropEvts.length) {
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts);
-                    }
-                }
-
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragOut(e, outEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragOut(e, outEvts[i].id);
-                    }
+            // notify about a drop that did not find a target
+            if (isDrop && !data.dropEvts.length) {
+                this.interactionInfo.validDrop = false;
+                if (dc.events.invalidDrop) {
+                    dc.onInvalidDrop(e);
+                    dc.fireEvent('invalidDropEvent', { e: e });
                 }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    // dc.b4DragEnter(e, oDD.id);
+            }
 
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts[i].id);
-                    }
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragOver(e, overEvts[i].id);
-                    }
+            for (i = 0; i < events.length; i++) {
+                var tmp = null;
+                if (data[events[i] + 'Evts']) {
+                    tmp = data[events[i] + 'Evts'];
                 }
-
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts[i].id);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts[i].id);
+                if (tmp && tmp.length) {
+                    var type = events[i].charAt(0).toUpperCase() + events[i].substr(1),
+                        ev = 'onDrag' + type,
+                        b4 = 'b4Drag' + type,
+                        cev = 'drag' + type + 'Event',
+                        check = 'drag' + type;
+                    
+                    if (this.mode) {
+                        if (dc.events[b4]) {
+                            dc[b4](e, tmp, inGroups);
+                            dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups });
+                        }
+                        if (dc.events[check]) {
+                            dc[ev](e, tmp, inGroups);
+                            dc.fireEvent(cev, { event: e, info: tmp, group: inGroups });
+                        }
+                    } else {
+                        for (var b = 0, len = tmp.length; b < len; ++b) {
+                            if (dc.events[b4]) {
+                                dc[b4](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                            if (dc.events[check]) {
+                                dc[ev](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                        }
                     }
                 }
-
             }
         },
 
@@ -1115,11 +1122,11 @@ YAHOO.util.DragDropMgr = function() {
 
             this._execOnAll("unreg", []);
 
-            for (i in this.elementCache) {
-                delete this.elementCache[i];
-            }
+            //for (var i in this.elementCache) {
+                //delete this.elementCache[i];
+            //}
+            //this.elementCache = {};
 
-            this.elementCache = {};
             this.ids = {};
         },
 
@@ -1128,6 +1135,7 @@ YAHOO.util.DragDropMgr = function() {
          * @property elementCache
          * @private
          * @static
+         * @deprecated elements are not cached now
          */
         elementCache: {},
         
@@ -1465,7 +1473,20 @@ YAHOO.util.DragDrop = function(id, sGroup, config) {
 };
 
 YAHOO.util.DragDrop.prototype = {
-
+    /**
+     * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop
+     * By setting any of these to false, then event will not be fired.
+     * @property events
+     * @type object
+     */
+    events: null,
+    /**
+    * @method on
+    * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a>
+    */
+    on: function() {
+        this.subscribe.apply(this, arguments);
+    },
     /**
      * The id of the element associated with this object.  This is what we 
      * refer to as the "linked element" because the size and position of 
@@ -1578,7 +1599,7 @@ YAHOO.util.DragDrop.prototype = {
     /**
      * By default, all instances can be a drop target.  This can be disabled by
      * setting isTarget to false.
-     * @method isTarget
+     * @property isTarget
      * @type boolean
      */
     isTarget: true,
@@ -1586,10 +1607,16 @@ YAHOO.util.DragDrop.prototype = {
     /**
      * The padding configured for this drag and drop object for calculating
      * the drop zone intersection with this object.
-     * @method padding
+     * @property padding
      * @type int[]
      */
     padding: null,
+    /**
+     * If this flag is true, do not fire drop events. The element is a drag only element (for movement not dropping)
+     * @property dragOnly
+     * @type Boolean
+     */
+    dragOnly: false,
 
     /**
      * Cached reference to the linked element
@@ -1935,7 +1962,12 @@ YAHOO.util.DragDrop.prototype = {
         this.initTarget(id, sGroup, config);
         Event.on(this._domRef || this.id, "mousedown", 
                         this.handleMouseDown, this, true);
+
         // Event.on(this.id, "selectstart", Event.preventDefault);
+        for (var i in this.events) {
+            this.createEvent(i + 'Event');
+        }
+        
     },
 
     /**
@@ -1951,6 +1983,8 @@ YAHOO.util.DragDrop.prototype = {
         // configuration attributes 
         this.config = config || {};
 
+        this.events = {};
+
         // create a local reference to the drag and drop manager
         this.DDM = YAHOO.util.DDM;
 
@@ -1998,6 +2032,34 @@ YAHOO.util.DragDrop.prototype = {
      * @method applyConfig
      */
     applyConfig: function() {
+        this.events = {
+            mouseDown: true,
+            b4MouseDown: true,
+            mouseUp: true,
+            b4StartDrag: true,
+            startDrag: true,
+            b4EndDrag: true,
+            endDrag: true,
+            drag: true,
+            b4Drag: true,
+            invalidDrop: true,
+            b4DragOut: true,
+            dragOut: true,
+            dragEnter: true,
+            b4DragOver: true,
+            dragOver: true,
+            b4DragDrop: true,
+            dragDrop: true
+        };
+        
+        if (this.config.events) {
+            for (var i in this.config.events) {
+                if (this.config.events[i] === false) {
+                    this.events[i] = false;
+                }
+            }
+        }
+
 
         // configurable properties: 
         //    padding, isTarget, maintainOffset, primaryButtonOnly
@@ -2005,7 +2067,7 @@ YAHOO.util.DragDrop.prototype = {
         this.isTarget          = (this.config.isTarget !== false);
         this.maintainOffset    = (this.config.maintainOffset);
         this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
-
+        this.dragOnly = ((this.config.dragOnly === true) ? true : false);
     },
 
     /**
@@ -2053,6 +2115,9 @@ YAHOO.util.DragDrop.prototype = {
         var el = this.getEl();
 
         if (!this.DDM.verifyEl(el)) {
+            if (el && el.style && (el.style.display == 'none')) {
+            } else {
+            }
             return;
         }
 
@@ -2203,8 +2268,18 @@ YAHOO.util.DragDrop.prototype = {
 
 
         // firing the mousedown events prior to calculating positions
-        this.b4MouseDown(e);
-        this.onMouseDown(e);
+        var b4Return = this.b4MouseDown(e);
+        if (this.events.b4MouseDown) {
+            b4Return = this.fireEvent('b4MouseDownEvent', e);
+        }
+        var mDownReturn = this.onMouseDown(e);
+        if (this.events.mouseDown) {
+            mDownReturn = this.fireEvent('mouseDownEvent', e);
+        }
+
+        if ((b4Return === false) || (mDownReturn === false)) {
+            return;
+        }
 
         this.DDM.refreshCache(this.groups);
         // var self = this;
@@ -2238,8 +2313,14 @@ YAHOO.util.DragDrop.prototype = {
         }
     },
 
+    /**
+     * @method clickValidator
+     * @description Method validates that the clicked element
+     * was indeed the handle or a valid child of the handle
+     * @param {Event} e 
+     */
     clickValidator: function(e) {
-        var target = Event.getTarget(e);
+        var target = YAHOO.util.Event.getTarget(e);
         return ( this.isValidHandleChild(target) &&
                     (this.id == this.handleElId || 
                         this.DDM.handleWasClicked(target, this.id)) );
@@ -2581,7 +2662,100 @@ YAHOO.util.DragDrop.prototype = {
     }
 
 };
+YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider);
+
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 })();
 /**
  * A DragDrop implementation where the linked element follows the 
@@ -2681,7 +2855,10 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
         }
         
         this.cachePosition(oCoord.x, oCoord.y);
-        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        var self = this;
+        setTimeout(function() {
+            self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        }, 0);
     },
 
     /**
@@ -2841,6 +3018,98 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
 
     */
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 });
 /**
  * A DragDrop implementation that inserts an empty, bordered div into
@@ -2937,6 +3206,27 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
             Dom.setStyle(_data, 'opacity', '0');
             div.appendChild(_data);
 
+            /**
+            * It seems that IE will fire the mouseup event if you pass a proxy element over a select box
+            * Placing the IFRAME element inside seems to stop this issue
+            */
+            if (YAHOO.env.ua.ie) {
+                //Only needed for Internet Explorer
+                var ifr = document.createElement('iframe');
+                ifr.setAttribute('src', 'about:blank');
+                ifr.setAttribute('scrolling', 'no');
+                ifr.setAttribute('frameborder', '0');
+                div.insertBefore(ifr, div.firstChild);
+                Dom.setStyle(ifr, 'height', '100%');
+                Dom.setStyle(ifr, 'width', '100%');
+                Dom.setStyle(ifr, 'position', 'absolute');
+                Dom.setStyle(ifr, 'top', '0');
+                Dom.setStyle(ifr, 'left', '0');
+                Dom.setStyle(ifr, 'opacity', '0');
+                Dom.setStyle(ifr, 'zIndex', '-1');
+                Dom.setStyle(ifr.nextSibling, 'zIndex', '2');
+            }
+
             // appendChild can blow up IE if invoked prior to the window load event
             // while rendering a table.  It is possible there are other scenarios 
             // that would cause this to happen as well.
@@ -3067,6 +3357,98 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
     toString: function() {
         return ("DDProxy " + this.id);
     }
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
 });
 /**
@@ -3096,4 +3478,4 @@ YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {
         return ("DDTarget " + this.id);
     }
 });
-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.3.0", build: "442"});
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.5.0", build: "895"});
index 2190c19ee6f3066ce674debde2dbceba14cdbdc7..9fdc64af1d19070e7def06ab26428e59af8bc910 100755 (executable)
@@ -1,3 +1,109 @@
+**** version 2.5.0 ***
+
+    *Examples:
+        1. [1687273] - [SF 1861119 ] Flickr Example code is incorrect
+
+    *Config
+        1. [1556954] - [SF 1816784 ] tabbing troubles...
+            Added a new config option called plainText. (See API docs for more information)
+        2. Removed the requirement for a textarea. If you pass the config as the first argument to the constructor
+            the Editor will create the textarea for you.
+
+    *Internet Explorer
+        1. [1515145] - [SF 1807057 ] RTE _setDesignMode reloads page content
+        2. [1687267] - [SF 1861514 ] editorContentLoaded fires early in IE6/7
+        3. [1687244] - [SF 1866217 ] Editor in frameset causes "unspecified error" in IE6
+        4. [1687278] - [SF 1859031 ] Change Font Color on IE
+        5. [1687283] - [SF 1857798 ] IE7 RTE HTTPS problem
+        6. [1687316] - [SF 1854657 ] IE bullet/number strange behaviour
+    
+    *All
+        1. [1687258] - [SF 1862824 ] Problem with <script> tags in editor content
+        2. [1687292] - [SF 1857235 ] cleanHTML function stripping closing tags
+        3. [1687322] - [SF 1849730 ] Multiple Editors' toolbars conflict
+        4. [1688270] - [SF 1867927] Editor dynamic height adjust
+        5. [1693656] - [SF 1870215] handleSubmit hijacks the value of the submit button
+        6. [1693686] - [SF 1869619] Image Modification Dialog
+        7. [1693719] - [SF 1850814] Editor produces faulty code
+
+
+**** version 2.4.0 ***
+
+* Performance enhancements and bug fixes.
+* Created a new base class called SimpleEditor. Editor now extends SimpleEditor
+* Created 2 new Toolbar Buttons
+    YAHOO.widget.ToolbarButton - No requirement for Button or Menu
+    YAHOO.widget.ToolbarButtonAdvanced - Still Required Button and Menu
+
+    *All
+        1. [1423860] - [SF 1774823] Change text size removes selection highlight
+        2. [1487601] - [SF 1796897] Font size issue
+        3. [1508412] - [SF 1799379] setEditorHTML strips title attribute
+        4. [1528759] - [SF 1810162] [example] Link Options Window appears behind the editor
+            Added a config option "limitCommands" when set to true, the editor will not execute a command that is not bound to a button.
+
+        5. [1544149] - [SF 1808154] add non-editable snippets to YUI-RTE
+            Added a config option "allowNoEdit", when set to true the "_isNonEditalble method is called at the beginning of all event handlers to check if this element or
+                a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied. If it does, then this method will stop the event and return true. The event handlers
+                will then return false and stop the nodeChange from occurring. This method will also disable and enable the Editor's toolbar based on the noedit state.
+
+        6. [1544160] - [SF 1808102] Keep the content of invalidHTML
+            If you set the value of a key in this.invalidHTML to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when 
+                cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However, all of
+                these tags will be removed in the cleanHTML routine
+
+        7. [1560982] - [SF 1818681] RTE converts input tags to emnput
+        8. [1508390] - [SF 1787357] Split into separate modules
+            Split the Editor into Editor and SimpleEditor. Also split out the execCommand support into several methods for easier overriding and extending.
+
+        9. [1508403] - [SF 1779516] Dirty flag for editor
+            You can now check the editorDirty property on the Editor instance. It will be default false and be set to true when something important happens.
+            You will need to manually change it back to false when you check it.
+
+    *Internet Explorer
+        1. [1508413] - [SF 1804028, 1810362] Omission of DocType at top of page
+            It appears that Internet Explorer doesn't like the page containing the Editor to not have a doctype if the page inside the editor does.
+                The Editor will now check for compatMode and if it is not in standards mode, it will omit the doctype from the editable area.
+                
+        2. [1528733] - [SF 1808818] IE6 reports security violation on secure pages
+        3. [1528766] - [SF 1810362] Will Not Work Without DTD header
+        4. [1496536] - yui editor indentation problem
+        5. [1465375] - [SF 1789702] RTE Image insertion creates timer error
+
+    *Firefox
+        1. [1492573] - Can not get focus on edit box in FF 1.5 on FreeBSD
+
+**** version 2.3.1 ***
+
+* Performance enhancements and bug fixes.
+
+    *All
+        1. [1406169] - Fixed Toolbar performance issues
+        2. [1406176] - You can now set the height and width of the editor after it has been rendered       
+        3. [1413456] - Group Labels can now be turned off after the editor has been rendered
+        4. [1413750] - Editor now supports delayed render (script block above the textarea markup)
+        5. [1416349] - cleanHTML now supports markup config options better (added xhtml option)
+        6. [1422334] - Added a link field to the image property editor
+        7. [1425540] - [SF 1775187] Fixed adding a link to an LI
+        8. [1406370] - [SF 1767246 ] Using Back button causes breaking behavior. Fixed.
+        9. [1435809] - Base href config fails when on a page with a port number. Fixed.
+
+    *Safari
+        1. [1390926] - Fixed Safari handleSubmit issue
+        2. [1433563] - Editor becomes unstable when rendered inside an element set to display: none (added show() method)
+
+    *Opera
+        1. [1396921] - Fixed clicking the Toolbar while typing loses insertion point
+        2. [1406700] - [SF 1767251] Background color can not be overridden in Opera.. Fixed.
+
+    *Gecko
+        1. [1411911] - [SF 1769657] RTE looks strange on Firefox when base.css - Fixed style collisions
+        2. [1433563] - Editor becomes unstable when rendered inside an element set to display: none (added show() method)
+
+    *Internet Explorer
+        1. [1396921] - Fixed clicking the Toolbar while typing loses insertion point
+
+
 **** version 2.3.0 ***
 
 * Beta release.
index 4f304513fa3b3cec856abed5d578bf17ce270bc8..d59331e17e0f39bb85dd76fc1d29df43bf275de9 100755 (executable)
@@ -1,14 +1,23 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+/* Set the cursor to busy when we are doing something */
+.yui-busy {
+    cursor: wait !important;
+}
+
 /* Setup the container with some padding and zoom it for IE's hasLayout */
 .yui-toolbar-container .yui-toolbar-subcont {
     padding: .25em 0;
     zoom: 1;
 }
+/* When collapsed set the toolbars container to display none */
+.yui-toolbar-container-collapsed .yui-toolbar-subcont {
+    display: none;
+}
 /* Setup the :after so that compliant browsers don't loose the bounding box */
 .yui-toolbar-container .yui-toolbar-subcont:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
 
@@ -37,6 +46,7 @@ version: 2.3.0
 /* Toolbar's titlebar styles */
 .yui-toolbar-container .yui-toolbar-titlebar h2 {
     font-weight: bold;
+    letter-spacing: 0;
     border: none;
     color: #000;
     margin: 0;
@@ -57,14 +67,11 @@ version: 2.3.0
 /* Grouped title styles */
 .yui-toolbar-container .yui-toolbar-group h3 {
     font-size: 75%;
-    color: #999;
-    padding-left: .25em;
+    padding: 0 0 0 .25em;
+    margin: 0;
 }
 /* Style the separators with a left border */
 .yui-toolbar-container span.yui-toolbar-separator {
-    border-left: 1px solid #999;
-    overflow: hidden;
-    text-indent: 77777px;
     width: 2px;
     height: 18px;
     margin: .2em 0 .2em .1em;
@@ -85,94 +92,53 @@ version: 2.3.0
 /* Kill the default styles of the list */
 .yui-toolbar-container ul li {
     margin: 0;
-    float: left;
+    padding: 0;
+    list-style-type: none;
+}
+/* Hide the group labels when the .yui-toolbar-nogrouplabels class is applied */
+.yui-toolbar-container .yui-toolbar-nogrouplabels h3 {
+    display: none;
 }
 
 /* Setup the default style of a button in the toolbar */
-.yui-toolbar-container .yui-button {
-    border: 1px solid #999999;
-    background: none;
-    padding: 0;
-    cursor: pointer;
-    height: 20px;
-    width: 30px;
-    overflow: hidden;
-    display: block;
-    float: left;
-    margin: 0 1px;
+.yui-toolbar-container .yui-push-button,
+.yui-toolbar-container .yui-color-button,
+.yui-toolbar-container .yui-menu-button {
+/*.yui-toolbar-container .yui-button {*/
     position: relative;
-    filter: none; /* UNDO Button filter..*/
+    cursor: pointer;
 }
 
 /* setup the default style of the A inside of the toolbar button */
 .yui-toolbar-container .yui-button .first-child, .yui-toolbar-container .yui-button .first-child a {
-    margin: 0;
-    border: 0;
-    display: block;
-    text-indent: 50px !important; /* IE Fix */
-    width: 200px;
-    overflow:hidden;
+    height: 100%;
+    width: 100%;
+    overflow: hidden;
 }
 
 /* Setup the disabled state of a button */
 .yui-toolbar-container .yui-button-disabled {
+    cursor: default;
+}
+/* Disable the icon too */
+.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon {
+    opacity: .5;
+    filter: alpha(opacity=50);
+}
+/*Disabled Spin button arrows*/
+.yui-toolbar-container .yui-button-disabled .up,
+.yui-toolbar-container .yui-button-disabled .down {
     opacity: .5;
     filter: alpha(opacity=50);
-    cursor: default;
 }
 /* remove any padding from the A */
 .yui-toolbar-container .yui-button a {
-    padding: 0;
-}
-/* Fix a style inherited from the Button widget for IE */
-.yui-toolbar-container .yui-button.ie6.hover {
-    background-color: #98D5FC !important;
-}
-
-/* Select Button Emulation */
-.yui-toolbar-container .yui-toolbar-select {
-    height: 20px;
-    width: auto;
+    overflow: hidden;
 }
 
 /* Override the default Button style for select menu*/
-.yui-toolbar-container .yui-toolbar-select a {
-    border: none;
-    background-color: transparent;
-    height: 19px;
-    width: 100%;
-    text-align: left;
-    cursor: pointer;
-    opacity: 1;
-    filter: none;
-}
-/* Fix IE */
-.yui-toolbar-container .yui-toolbar-select .first-child {
-    width: 100% !important; /* For IE */
-}
-/* Reset the text-indent because we want to see the text of a select menu */
 .yui-toolbar-container .yui-toolbar-select .first-child a {
-    text-indent: 3px !important;
-    width: 100% !important; /* For IE */
-}
-
-/* Fix styles inherited from Button  */
-.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a {
-    cursor: default;
-    opacity: 1;
-    filter: none;
-    display: block;
-}
-
-
-/* Font Family Drop Down */
-.yui-toolbar-container .yui-toolbar-fontname {
-    width: 125px;
-}
-
-/* Header Drop Down */
-.yui-toolbar-container .yui-toolbar-heading {
-    width: 80px;
+    cursor: pointer;
 }
 
 /* Font Family Menu Style - This styles the menu items and the selected menu item */
@@ -187,46 +153,26 @@ version: 2.3.0
 .yui-toolbar-fontname-tahoma { font-family: Tahoma; }
 .yui-toolbar-fontname-trebuchet-ms { font-family: Trebuchet MS; }
 
-/* Put a fake border around buttons that have focus */
-.yui-toolbar-container .yui-push-button-focus {
-    border: 1px dotted #999;
-}
-
 /* Spin Button */
 .yui-toolbar-container .yui-toolbar-spinbutton {
     position: relative;
-    width: 35px;
 }
 
-/* Set a default width */
-.yui-toolbar-container .yui-toolbar-spinbutton .first-child {
-    width: 35px;
-}
 /* Setup the default style for the A */
 .yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
-    border: none;
-    background-color: transparent;
-    background-image: none;
-    background-repeat: no-repeat;
-    width: 28px;
-    height: 20px;
-    text-align: left;
-    text-indent: 2px !important;
     z-index: 0;
     opacity: 1;
-    filter: none;
 }
 
 /* Setup the position and style for the up and down arrows */
-.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up, .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down {
+.yui-toolbar-container .yui-toolbar-spinbutton a.up, .yui-toolbar-container .yui-toolbar-spinbutton a.down {
     position: absolute;
     display: block
     right: 0;
     cursor: pointer;
-    text-indent: 999px;
-    overflow: hidden;
     z-index: 1;
-    border: none;
+    padding: 0;
+    margin: 0;
 }
 /* Position all panels/overlays as absolute by default */
 .yui-toolbar-container .yui-overlay {
@@ -234,76 +180,8 @@ version: 2.3.0
 }
 /* Smash the default style for lists */
 .yui-toolbar-container .yui-overlay ul li {
-    float: none;
-}
-
-/* Setup the default look of a color menu and Zoom it for IE */
-.yui-toolbar-colors {
-    width: 133px;
-    zoom: 1;
-    display: none;
-    z-index: 100;
-    overflow: hidden;
-}
-
-/* Setup the :after so that compliant browsers don't loose the bounding box */
-.yui-toolbar-colors:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
-/* Style all of the A's so the float properly */
-.yui-toolbar-colors a {
-    height: 9px;
-    width: 9px;
-    float: left;
-    display: block;
-    overflow: hidden;
-    text-indent: 999px;
     margin: 0;
-    cursor: pointer;
-    border: 1px solid #F6F7EE;
-}
-/* Put a little border around one that is hovered over */
-.yui-toolbar-colors a:hover {
-    border: 1px solid black;
-}
-
-/* Smash the inhertited Menu style */
-.yui-color-button-menu {
-    overflow: hidden;
-    background-color: transparent;
-}
-
-/* This is the preview box at the bottom of the menu - Zoom it for IE */
-.yui-toolbar-colors span {
-    position: relative;
-    display: block;
-    padding: 3px;
-    overflow: hidden;
-    float: left;
-    width: 100%;
-    zoom: 1;
-}
-/* Setup the :after so that compliant browsers don't loose the bounding box */
-.yui-toolbar-colors span:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
-
-/* This is the box with the color preview in it */
-.yui-toolbar-colors span em {
-    height: 35px;
-    width: 30px;
-    float: left;
-    display: block;
-    overflow: hidden;
-    text-indent: 999px;
-    margin: 0.75px;
-    border: 1px solid black;
-}
-
-/* The container for the name and hex code */
-.yui-toolbar-colors span strong {
-    font-weight: normal;
-    padding-left: 3px;
-    display: block;
-    font-size: 85%;
-    float: left;
-    width: 65%;
+    list-style-type: none;
 }
 
 /* Reset the z-index of the toolbar container so that menu's appear over the iframe in IE and Safari */
@@ -315,16 +193,19 @@ version: 2.3.0
 .yui-editor-container .yui-editor-editable-container {
     position: relative;
     z-index: 0;
+    width: 100%;
 }
 /* The disbled state of the Editor */
 .yui-editor-container .yui-editor-masked {
     background-color: #CCC;
 }
-/* Style the eidtable iframe to hide it */
+/* Style the editable iframe to hide it */
 .yui-editor-container iframe {
     border: 0px;
     padding: 0;
     margin: 0;
+    zoom: 1;
+    display: block;
 }
 /* Reset some padding on the editable iframes container */
 .yui-editor-container .yui-editor-editable {
@@ -333,11 +214,8 @@ version: 2.3.0
 }
 /* Style the dom path box at the bottom of the editor */
 .yui-editor-container .dompath {
-    height: 1em;
-    padding:0.25em;
     font-size: 85%;
 }
-
 /* Header styles for the Property Editor */
 .yui-editor-panel .hd {
     text-align: left;
@@ -347,6 +225,7 @@ version: 2.3.0
 .yui-editor-panel .hd h3 {
     font-weight: bold;
     padding: 0.25em 0pt 0.25em 0.25em;
+    margin: 0;
 }
 
 /* set it to relative so we can position the close button - Zoom it for IE */
@@ -376,9 +255,8 @@ version: 2.3.0
 .yui-editor-panel .ft span.tip {
     display: block;
     position: relative;
-    padding-left:23px;
+    padding: .5em .5em .5em 23px;
     text-align:left;
-    margin: .5em;
     zoom: 1;
 }
 
@@ -388,12 +266,14 @@ version: 2.3.0
     clear: both;
     float: left;
     padding: 0;
-    overflow: auto; /* This fixes the caret issue in Firefox */
     width: 100%;
-    zoom: 1;
     text-align: left;
+    zoom: 1;
+}
+/* This fixes the caret issue in Firefox */
+.yui-editor-panel .gecko label {
+    overflow: auto; 
 }
-
 /* more form fields */
 .yui-editor-panel label strong {
     float: left;
@@ -414,29 +294,22 @@ version: 2.3.0
 
 /* Image Padding in the Property Editor */
 .yui-editor-panel .yui-toolbar-group-padding {
-    width: 100px;
 }
 
 /* Image Border in the Property Editor */
 .yui-editor-panel .yui-toolbar-group-border {
-    width: 175px;
-    *width: 190px;
 }
 
 /* Image Text Flow in the Property Editor */
 .yui-editor-panel .yui-toolbar-group-textflow {
-    width: 150px;
-    *width: 180px;
 }
 
 /* Image Height/Width in the Property Editor */
 .yui-editor-panel .height-width {
     float: left;
-    width: 68%;
 }
 /* Image Height/Width title */
 .yui-editor-panel .height-width h3 {
-    padding-right: 11px;
 }
 /* Image Height/Width container */
 .yui-editor-panel .height-width span {
@@ -452,7 +325,6 @@ version: 2.3.0
 
 /* Border Size/Type button widths */
 .yui-editor-panel .yui-toolbar-bordersize, .yui-editor-panel .yui-toolbar-bordertype {
-    width: 50px;
     font-size: 75%;
 }
 
@@ -461,165 +333,121 @@ version: 2.3.0
     border: none;
 }
 
-/* Undo the floats on the a's */
-.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a {
-    float: none;
-}
-
 /* Border Type solid */
-.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid {
-    border-bottom: 1px solid black;
-    text-indent: 777px;
-    overflow: hidden;
+.yui-editor-panel .yui-toolbar-bordersize span a span,
+.yui-editor-panel .yui-toolbar-bordertype span a span {
     display: block;
-    width: 22px;
     height: 8px;
+    left: 4px;
     position: absolute;
-    left: 2px;
+    top: 3px;
+    *top: -5px;
+    width: 24px;
+}
+/* Border Type solid */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid {
+    border-bottom: 1px solid black;
 }
 /* Border Type dotted */
 .yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted {
     border-bottom: 1px dotted black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 /* Border Type dashed */
 .yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed {
     border-bottom: 1px dashed black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
+}
+/* Border Size 0 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0 {
+    *top: 0px;
 }
 /* Border Size 1 */
 .yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1 {
     border-bottom: 1px solid black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 /* Border Size 2 */
 .yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2 {
     border-bottom: 2px solid black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 /* Border Size 3 */
 .yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3 {
+    top: 2px;
+    *top: -5px;
     border-bottom: 3px solid black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 /* Border Size 4 */
 .yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4 {
+    top: 1px;
+    *top: -5px;
     border-bottom: 4px solid black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 /* Border Size 5 */
 .yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5 {
+    top: 1px;
+    *top: -5px;
     border-bottom: 5px solid black;
-    text-indent: 777px;
-    overflow: hidden;
-    display: block;
-    width: 22px;
-    height: 8px;
-    position: absolute;
-    left: 2px;
 }
 
 /* Border Size menu size */
-.yui-toolbar-container .yui-toolbar-bordersize-menu {
-    width: 30px;
+.yui-toolbar-container .yui-toolbar-bordersize-menu,
+.yui-toolbar-container .yui-toolbar-bordertype-menu {
+    width: 95px !important;
 }
 /* Border Size menu styles */
-.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel {
-    display: block;
-    width: 50px;
-    color: #ffffff;
-    position: relative;
-    margin-left: 20px;
-    padding: 0;
+.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel, 
+.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel:hover {
+    margin:0px 3px 7px 17px;
 }
 /* Border Size menu styles - Checked */
 .yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator, .yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator {
     position: absolute;
-    left: -14px;
-}
-/* Border Size menu styles - Selected */
-.yui-toolbar-bordersize-menu .yuimenuitem a.selected, .yui-toolbar-bordertype-menu .yuimenuitem a.selected {
-    color: #B3D4FF;
+    left: -12px;
+    *top: 14px;
+    *left: 0px;
 }
 
-/* Border Size 0 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a {
-    color: #000;
-}
-/* Border Size 0 - Selected Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected {
-    color: #fff;
-}
 /* Border Size 1 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a {
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a {
     border-bottom: 1px solid black;
+    height: 14px;
 }
 /* Border Size 2 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a {
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a {
     border-bottom: 2px solid black;
+    height: 14px;
 }
 /* Border Size 3 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a {
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a {
     border-bottom: 3px solid black;
+    height: 14px;
 }
 /* Border Size 4 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a {
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a {
     border-bottom: 4px solid black;
+    height: 14px;
 }
 /* Border Size 5 - Menu Item */
-div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a {
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a {
     border-bottom: 5px solid black;
+    height: 14px;
 }
 
 
 /* Border Type Solid - Menu Item */
-div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a {
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a {
     border-bottom: 1px solid black;
+    height: 14px;
 }
 /* Border Type Dashed - Menu Item */
-div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a {
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a {
     border-bottom: 1px dashed black;
+    height: 14px;
 }
 /* Border Type Dotted - Menu Item */
-div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a {
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a {
     border-bottom: 1px dotted black;
+    height: 14px;
 }
+
 /* Hidden Headers for Accessibility */
 h2.yui-editor-skipheader, h3.yui-editor-skipheader {
     height: 0;
@@ -631,3 +459,71 @@ h2.yui-editor-skipheader, h3.yui-editor-skipheader {
     position: absolute;
 }
 
+/* Setup the default look of a color menu and Zoom it for IE */
+.yui-toolbar-colors {
+    width: 133px;
+    zoom: 1;
+    display: none;
+    z-index: 100;
+    overflow: hidden;
+}
+
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+/* Style all of the A's so the float properly */
+.yui-toolbar-colors a {
+    height: 9px;
+    width: 9px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0;
+    cursor: pointer;
+    border: 1px solid #F6F7EE;
+}
+/* Put a little border around one that is hovered over */
+.yui-toolbar-colors a:hover {
+    border: 1px solid black;
+}
+
+/* Smash the inhertited Menu style */
+.yui-color-button-menu {
+    overflow: visible;
+    background-color: transparent;
+}
+
+/* This is the preview box at the bottom of the menu - Zoom it for IE */
+.yui-toolbar-colors span {
+    position: relative;
+    display: block;
+    padding: 3px;
+    overflow: hidden;
+    float: left;
+    width: 100%;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors span:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* This is the box with the color preview in it */
+.yui-toolbar-colors span em {
+    height: 35px;
+    width: 30px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0.75px;
+    border: 1px solid black;
+}
+
+/* The container for the name and hex code */
+.yui-toolbar-colors span strong {
+    font-weight: normal;
+    padding-left: 3px;
+    display: block;
+    font-size: 85%;
+    float: left;
+    width: 65%;
+}
diff --git a/lib/yui/editor/assets/simpleeditor-core.css b/lib/yui/editor/assets/simpleeditor-core.css
new file mode 100644 (file)
index 0000000..d59331e
--- /dev/null
@@ -0,0 +1,529 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/* Set the cursor to busy when we are doing something */
+.yui-busy {
+    cursor: wait !important;
+}
+
+/* Setup the container with some padding and zoom it for IE's hasLayout */
+.yui-toolbar-container .yui-toolbar-subcont {
+    padding: .25em 0;
+    zoom: 1;
+}
+/* When collapsed set the toolbars container to display none */
+.yui-toolbar-container-collapsed .yui-toolbar-subcont {
+    display: none;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-container .yui-toolbar-subcont:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* Drag handle for the toolbar's draggable property */
+.yui-toolbar-container span.yui-toolbar-draghandle {
+    cursor: move;
+    border-left: 1px solid #999;
+    border-right: 1px solid #999;
+    overflow: hidden;
+    text-indent: 77777px;
+    width: 2px;
+    height: 20px;
+    display: block;
+    clear: none;
+    float: left;
+    margin: 0 0 0 .2em;
+}
+/* If the titlebar is draggable, the set the cursor */
+.yui-toolbar-container .yui-toolbar-titlebar.draggable {
+    cursor: move;
+}
+/* Set the titlebar to relative so we can position the collapse button */
+.yui-toolbar-container .yui-toolbar-titlebar {
+    position: relative;
+}
+/* Toolbar's titlebar styles */
+.yui-toolbar-container .yui-toolbar-titlebar h2 {
+    font-weight: bold;
+    letter-spacing: 0;
+    border: none;
+    color: #000;
+    margin: 0;
+    padding: .2em;
+}
+/* If the toolbar is grouped the draghandle needs to be bigger */
+.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle {
+    height: 40px;
+}
+
+/* Float the groups so they position nicely and zoom them for IE */
+.yui-toolbar-container .yui-toolbar-group {
+    float: left;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-container .yui-toolbar-group:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+/* Grouped title styles */
+.yui-toolbar-container .yui-toolbar-group h3 {
+    font-size: 75%;
+    padding: 0 0 0 .25em;
+    margin: 0;
+}
+/* Style the separators with a left border */
+.yui-toolbar-container span.yui-toolbar-separator {
+    width: 2px;
+    height: 18px;
+    margin: .2em 0 .2em .1em;
+    display: block;
+    clear: none;
+    float: left;
+}
+/* Set the height of a grouped separator to a little bit bigger */
+.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator {
+    height: 35px;
+}
+
+/* Reset the height of a separator inside of a group */
+.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator {
+    height: 18px;
+}
+
+/* Kill the default styles of the list */
+.yui-toolbar-container ul li {
+    margin: 0;
+    padding: 0;
+    list-style-type: none;
+}
+/* Hide the group labels when the .yui-toolbar-nogrouplabels class is applied */
+.yui-toolbar-container .yui-toolbar-nogrouplabels h3 {
+    display: none;
+}
+
+/* Setup the default style of a button in the toolbar */
+.yui-toolbar-container .yui-push-button,
+.yui-toolbar-container .yui-color-button,
+.yui-toolbar-container .yui-menu-button {
+/*.yui-toolbar-container .yui-button {*/
+    position: relative;
+    cursor: pointer;
+}
+
+/* setup the default style of the A inside of the toolbar button */
+.yui-toolbar-container .yui-button .first-child, .yui-toolbar-container .yui-button .first-child a {
+    height: 100%;
+    width: 100%;
+    overflow: hidden;
+}
+
+/* Setup the disabled state of a button */
+.yui-toolbar-container .yui-button-disabled {
+    cursor: default;
+}
+/* Disable the icon too */
+.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon {
+    opacity: .5;
+    filter: alpha(opacity=50);
+}
+/*Disabled Spin button arrows*/
+.yui-toolbar-container .yui-button-disabled .up,
+.yui-toolbar-container .yui-button-disabled .down {
+    opacity: .5;
+    filter: alpha(opacity=50);
+}
+/* remove any padding from the A */
+.yui-toolbar-container .yui-button a {
+    overflow: hidden;
+}
+
+/* Override the default Button style for select menu*/
+.yui-toolbar-container .yui-toolbar-select .first-child a {
+    cursor: pointer;
+}
+
+/* Font Family Menu Style - This styles the menu items and the selected menu item */
+.yui-toolbar-fontname-arial { font-family: Arial; }
+.yui-toolbar-fontname-arial-black { font-family: Arial Black; }
+.yui-toolbar-fontname-comic-sans-ms { font-family: Comic Sans MS; }
+.yui-toolbar-fontname-courier-new { font-family: Courier New; }
+.yui-toolbar-fontname-times-new-roman { font-family: Times New Roman; }
+.yui-toolbar-fontname-verdana { font-family: Verdana; }
+.yui-toolbar-fontname-impact { font-family: Impact; }
+.yui-toolbar-fontname-lucida-console { font-family: Lucida Console; }
+.yui-toolbar-fontname-tahoma { font-family: Tahoma; }
+.yui-toolbar-fontname-trebuchet-ms { font-family: Trebuchet MS; }
+
+/* Spin Button */
+.yui-toolbar-container .yui-toolbar-spinbutton {
+    position: relative;
+}
+
+/* Setup the default style for the A */
+.yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
+    z-index: 0;
+    opacity: 1;
+}
+
+/* Setup the position and style for the up and down arrows */
+.yui-toolbar-container .yui-toolbar-spinbutton a.up, .yui-toolbar-container .yui-toolbar-spinbutton a.down {
+    position: absolute;
+    display: block
+    right: 0;
+    cursor: pointer;
+    z-index: 1;
+    padding: 0;
+    margin: 0;
+}
+/* Position all panels/overlays as absolute by default */
+.yui-toolbar-container .yui-overlay {
+    position: absolute;
+}
+/* Smash the default style for lists */
+.yui-toolbar-container .yui-overlay ul li {
+    margin: 0;
+    list-style-type: none;
+}
+
+/* Reset the z-index of the toolbar container so that menu's appear over the iframe in IE and Safari */
+.yui-toolbar-container {
+    z-index: 1;
+}
+
+/* The div around the iFrame */
+.yui-editor-container .yui-editor-editable-container {
+    position: relative;
+    z-index: 0;
+    width: 100%;
+}
+/* The disbled state of the Editor */
+.yui-editor-container .yui-editor-masked {
+    background-color: #CCC;
+}
+/* Style the editable iframe to hide it */
+.yui-editor-container iframe {
+    border: 0px;
+    padding: 0;
+    margin: 0;
+    zoom: 1;
+    display: block;
+}
+/* Reset some padding on the editable iframes container */
+.yui-editor-container .yui-editor-editable {
+    padding: 0;
+    margin: 0;
+}
+/* Style the dom path box at the bottom of the editor */
+.yui-editor-container .dompath {
+    font-size: 85%;
+}
+/* Header styles for the Property Editor */
+.yui-editor-panel .hd {
+    text-align: left;
+    position: relative;
+}
+/* Setup some padding around the h3 */
+.yui-editor-panel .hd h3 {
+    font-weight: bold;
+    padding: 0.25em 0pt 0.25em 0.25em;
+    margin: 0;
+}
+
+/* set it to relative so we can position the close button - Zoom it for IE */
+.yui-editor-panel .bd {
+    width: 100%;
+    zoom: 1;
+    position: relative;
+}
+/* Setup some padding for the body container - Zoom it for IE */
+.yui-editor-panel .bd div.yui-editor-body-cont {
+    padding: .25em .1em;
+    zoom: 1;
+}
+
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-editor-panel .bd div.yui-editor-body-cont:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* style the footer of the property editor */
+.yui-editor-panel .ft {
+    text-align: right;
+    width: 99%;
+    float: left;
+    clear: both;
+}
+
+/* Style the "tip" icon */
+.yui-editor-panel .ft span.tip {
+    display: block;
+    position: relative;
+    padding: .5em .5em .5em 23px;
+    text-align:left;
+    zoom: 1;
+}
+
+
+/* setup some form fields */
+.yui-editor-panel label {
+    clear: both;
+    float: left;
+    padding: 0;
+    width: 100%;
+    text-align: left;
+    zoom: 1;
+}
+/* This fixes the caret issue in Firefox */
+.yui-editor-panel .gecko label {
+    overflow: auto; 
+}
+/* more form fields */
+.yui-editor-panel label strong {
+    float: left;
+    width: 6em;
+}
+
+/* The remove link in the Link Property Editor */
+.yui-editor-panel .removeLink {
+    width: 80%;
+    text-align: right;
+}
+
+/* More form styling */
+.yui-editor-panel label input {
+    margin-left: .25em;
+    float: left;
+}
+
+/* Image Padding in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-padding {
+}
+
+/* Image Border in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-border {
+}
+
+/* Image Text Flow in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-textflow {
+}
+
+/* Image Height/Width in the Property Editor */
+.yui-editor-panel .height-width {
+    float: left;
+}
+/* Image Height/Width title */
+.yui-editor-panel .height-width h3 {
+}
+/* Image Height/Width container */
+.yui-editor-panel .height-width span {
+    font-style: italic;
+    display: block;
+    float: left;
+    overflow:auto;
+}
+/* Image Height/Width original info container */
+.yui-editor-panel .height-width span.info {
+    font-size: 70%;
+}
+
+/* Border Size/Type button widths */
+.yui-editor-panel .yui-toolbar-bordersize, .yui-editor-panel .yui-toolbar-bordertype {
+    font-size: 75%;
+}
+
+/* Kill the separators in the Property Editor */
+.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator {
+    border: none;
+}
+
+/* Border Type solid */
+.yui-editor-panel .yui-toolbar-bordersize span a span,
+.yui-editor-panel .yui-toolbar-bordertype span a span {
+    display: block;
+    height: 8px;
+    left: 4px;
+    position: absolute;
+    top: 3px;
+    *top: -5px;
+    width: 24px;
+}
+/* Border Type solid */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid {
+    border-bottom: 1px solid black;
+}
+/* Border Type dotted */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted {
+    border-bottom: 1px dotted black;
+}
+/* Border Type dashed */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed {
+    border-bottom: 1px dashed black;
+}
+/* Border Size 0 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0 {
+    *top: 0px;
+}
+/* Border Size 1 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1 {
+    border-bottom: 1px solid black;
+}
+/* Border Size 2 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2 {
+    border-bottom: 2px solid black;
+}
+/* Border Size 3 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3 {
+    top: 2px;
+    *top: -5px;
+    border-bottom: 3px solid black;
+}
+/* Border Size 4 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4 {
+    top: 1px;
+    *top: -5px;
+    border-bottom: 4px solid black;
+}
+/* Border Size 5 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5 {
+    top: 1px;
+    *top: -5px;
+    border-bottom: 5px solid black;
+}
+
+/* Border Size menu size */
+.yui-toolbar-container .yui-toolbar-bordersize-menu,
+.yui-toolbar-container .yui-toolbar-bordertype-menu {
+    width: 95px !important;
+}
+/* Border Size menu styles */
+.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel, 
+.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel:hover {
+    margin:0px 3px 7px 17px;
+}
+/* Border Size menu styles - Checked */
+.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator, .yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator {
+    position: absolute;
+    left: -12px;
+    *top: 14px;
+    *left: 0px;
+}
+
+/* Border Size 1 - Menu Item */
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a {
+    border-bottom: 1px solid black;
+    height: 14px;
+}
+/* Border Size 2 - Menu Item */
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a {
+    border-bottom: 2px solid black;
+    height: 14px;
+}
+/* Border Size 3 - Menu Item */
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a {
+    border-bottom: 3px solid black;
+    height: 14px;
+}
+/* Border Size 4 - Menu Item */
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a {
+    border-bottom: 4px solid black;
+    height: 14px;
+}
+/* Border Size 5 - Menu Item */
+.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a {
+    border-bottom: 5px solid black;
+    height: 14px;
+}
+
+
+/* Border Type Solid - Menu Item */
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a {
+    border-bottom: 1px solid black;
+    height: 14px;
+}
+/* Border Type Dashed - Menu Item */
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a {
+    border-bottom: 1px dashed black;
+    height: 14px;
+}
+/* Border Type Dotted - Menu Item */
+.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a {
+    border-bottom: 1px dotted black;
+    height: 14px;
+}
+
+/* Hidden Headers for Accessibility */
+h2.yui-editor-skipheader, h3.yui-editor-skipheader {
+    height: 0;
+    margin: 0;
+    padding: 0;
+    border: none;
+    width: 0;
+    overflow: hidden;
+    position: absolute;
+}
+
+/* Setup the default look of a color menu and Zoom it for IE */
+.yui-toolbar-colors {
+    width: 133px;
+    zoom: 1;
+    display: none;
+    z-index: 100;
+    overflow: hidden;
+}
+
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+/* Style all of the A's so the float properly */
+.yui-toolbar-colors a {
+    height: 9px;
+    width: 9px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0;
+    cursor: pointer;
+    border: 1px solid #F6F7EE;
+}
+/* Put a little border around one that is hovered over */
+.yui-toolbar-colors a:hover {
+    border: 1px solid black;
+}
+
+/* Smash the inhertited Menu style */
+.yui-color-button-menu {
+    overflow: visible;
+    background-color: transparent;
+}
+
+/* This is the preview box at the bottom of the menu - Zoom it for IE */
+.yui-toolbar-colors span {
+    position: relative;
+    display: block;
+    padding: 3px;
+    overflow: hidden;
+    float: left;
+    width: 100%;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors span:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* This is the box with the color preview in it */
+.yui-toolbar-colors span em {
+    height: 35px;
+    width: 30px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0.75px;
+    border: 1px solid black;
+}
+
+/* The container for the name and hex code */
+.yui-toolbar-colors span strong {
+    font-weight: normal;
+    padding-left: 3px;
+    display: block;
+    font-size: 85%;
+    float: left;
+    width: 65%;
+}
index 249ea98242566eeb6e1ae6d2d2609fabe471d7c1..37438d07ad0138132b852a98282bb66d7d21354f 100755 (executable)
@@ -1,17 +1,21 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+/* Place the border around the editor */
+.yui-skin-sam .yui-editor-container {
+    border: 1px solid #808080;
+}
 /* Color the border of the container */
 .yui-skin-sam .yui-toolbar-container {
-    border: 1px solid #808080;
     zoom: 1;
 }
 /* Load the background image on the Toolbars titlebar */
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar {
     background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+    position: relative;
 }
 
 /* Give the titlebar some color and padding */
@@ -28,7 +32,7 @@ version: 2.3.0
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3 {
     color: #808080;
     font-size: 75%;
-    margin: 1em 0 0.25em;
+    margin: 1em 0 0;
     padding-bottom: 0;
     padding-left: 0.25em;
     text-align: left;
@@ -37,6 +41,9 @@ version: 2.3.0
 /* Hide all of the sepatators borders */
 .yui-toolbar-container span.yui-toolbar-separator {
     border: none;
+    text-indent: 33px;
+    overflow: hidden;
+    margin: .25em;
 }
 
 /* Background color of the toolbar */
@@ -47,6 +54,11 @@ version: 2.3.0
 /* Add some padding to the toolbars sub container */
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont {
     padding: 0 1em 0.35em;
+    border-bottom:1px solid #808080;
+}
+/* When the collapsed class is added, add a border to the bottom of the titlebar (since the toolbar itself is display none) */
+.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar {
+    border-bottom:1px solid #808080;
 }
 
 /* Remove the shadows from the menus in the toolbar - Menu.css override */
@@ -62,23 +74,22 @@ version: 2.3.0
 }
 /* Remove padding/margin from list items */
 .yui-skin-sam .yui-editor-container ul li {
+    list-style-type: none;
     margin: 0;
     padding: 0;
 }
-
-/* Place a border around the right/left/bottom of the Editors container (Toolbar provides the top border..) */
-.yui-skin-sam .yui-editor-container .yui-editor-editable-container {
-    border: 1px solid #808080;
-    border-top: none;
+/* Float the LI's that wrap the buttons */
+.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem {
+    float: left;
 }
 
 /* Set the color and the border of the dompath container at the bottom of the editor */
 .yui-skin-sam .yui-editor-container .dompath {
     background-color: #F2F2F2;
-    border:1px solid #808080;
-    border-top: none;
+    border-top:1px solid #808080;
     color: #999;
     text-align: left;
+    padding: 0.25em;
 }
 
 /* Set the image for the collapse button on the toolbar */
@@ -89,7 +100,7 @@ version: 2.3.0
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse {
     cursor: pointer;
     position: absolute;
-    top: 2px;
+    top: 4px;
     right: 2px;
     display: block;
     overflow: hidden;
@@ -98,23 +109,74 @@ version: 2.3.0
     text-indent: 9999px;
 }
 
-/* Remove some padding on the top of the select lists */
-.yui-toolbar-container .yui-toolbar-select .first-child a {
-    padding-top: 0;
-}
-
 /* Set the default styles for the buttons */
-.yui-skin-sam .yui-toolbar-container .yui-button {
+.yui-skin-sam .yui-toolbar-container .yui-push-button,
+.yui-skin-sam .yui-toolbar-container .yui-color-button,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button {
     background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
-    border: 1px solid #808080;
-    cursor: pointer;
+    position: relative;
+    display: block;
     height: 22px;
+    width: 30px;
     margin: 0;
+    border-color: #808080;
+    border-style: solid;
+    border-width: 1px 0;
+}
+/* Set the height of the buttons and pad them on the left for the icon */
+.yui-skin-sam .yui-toolbar-container .yui-push-button a,
+.yui-skin-sam .yui-toolbar-container .yui-color-button a,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button a {
+    padding-left: 35px;
+    height: 20px;
+    text-decoration: none;
+    font-size: 93%;
+    line-height: 2;
+    display: block;
+    color: #000000;
     overflow: hidden;
-    /*padding: 2px 5px;*/
-    position: relative;
+}
+/* Set the height of the buttons and pad them on the left for the icon */
+.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child {
+    border-color: #808080;
+    border-style: solid;
+    border-width: 0 1px;
+    margin: 0 -1px;
     display: block;
 }
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child {
+    border-color: #ccc;
+}
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a {
+    color: #A6A6A6;
+    cursor: default;
+}
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled {
+    border-color: #ccc;
+}
+/* IE needs a little help positioning the first child */
+.yui-skin-sam .yui-toolbar-container .yui-button .first-child {
+    *left: 0px;
+}
+
+/* Font Family Drop Down */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname {
+    width: 135px;
+}
+
+/* Header Drop Down */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading {
+    width: 92px;
+}
+
 /* Handle the hover state of the buttons */
 .yui-skin-sam .yui-toolbar-container .yui-button-hover {
     background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;
@@ -123,38 +185,51 @@ version: 2.3.0
 
 /* Handle the selected state of the buttons */
 .yui-skin-sam .yui-toolbar-container .yui-button-selected {
-    background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -1700px;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;
     border-color: #808080;
 }
+/* When the nogrouplabels class is applied, set the h3's to display none */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3 {
+    display: none;
+}
+/* When not showing the h3 group labels, add some margin to make up for them*/
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group {
+       margin-top: .75em;
+}
 
 
-/* Handle the icon placeholder for the buttons */
-.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon {
+/* Handle the icon placeholder for the buttons
+    This is very important - position of this must be absolute.
+    If it is not positioned absolute, IE will place it over the a in the Toolbar
+    Doing this will cause the editor to loose focus and loose the selection.
+*/
+.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,
+.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon {
     display: block;
     position: absolute;
     top: 2px;
     height: 18px;
     width: 18px;
     overflow: hidden;
-    background-image: url( editor-sprite.gif );
-    background-repeat: no-repeat;
-    background-position: 30px 30px;
+    background: url(editor-sprite.gif) no-repeat 30px 30px;
 }
 
 /* Swap out the image to an active image */
 .yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon, .yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon {
     background-image: url(editor-sprite-active.gif);
 }
-
-.yui-skin-sam .visible .yuimenuitemlabel {
-    text-align:left;
+/* Change the defaults to make them look more like the editor */
+.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel {
+    cursor: pointer;
+    color: #000;
+    *position: relative;
 }
 
 /* Set the background color of all menu containers */
-.yui-skin-sam .yui-button-menu {
-    background-color: #ffffff;
+.yui-skin-sam .yui-toolbar-container .yui-button-menu {
+    background-color: #fff;
 }
-
 /* Set the background of all menu items that are selected */
 .yui-skin-sam div.yuimenu li.selected {
     background-color: #B3D4FF;
@@ -163,7 +238,6 @@ version: 2.3.0
 .yui-skin-sam div.yuimenu li.selected a.selected {
     color: #000;
 }
-
 /* Setting the background position of the sprite */
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon {
     background-position: 0 0;
@@ -284,77 +358,56 @@ version: 2.3.0
     background-position: 0 -504px;
     left: 5px;
 }
-/* Remove the right border on these icons so they appear to be in a "group" together */
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype
-{
-    border-right: none;
-}
-/* Set the width of the href to be very large so we can style it and hide the text */
-.yui-skin-sam .yui-toolbar-container .yui-button .first-child, .yui-skin-sam .yui-toolbar-container .yui-button .first-child a {
-    width: 500px;
-    position: absolute;
-    _position: static;
-    top: -1px;
-}
-/* Reset the position of the first child so the iframe in IE will not move above the menu */
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child, .yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child {
-    position: static;
+/* Set the width of the spin buttons */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child {
+    width: 35px;
 }
-/* Set the height of the first-child element so we get the buttons area back */
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a, .yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
-    height: 19px;
-    left: 0;
+/* Pad the first child */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
+    padding-left: 2px;
+    text-align: left;    
 }
 
-
 /* Spin Buttons - Remove the icon holder, they don't need it */
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon {
     display: none;
 }
 
-/* Spin Buttons - The up arrow */
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up {
-    top: 0;
-    right: 0;
-    background-image: url( editor-sprite.gif );
-    background-position: 0 -1221px;
+/* Spin Buttons - Prep the arrows */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down {
+    right: 2px;
+    background: url(editor-sprite.gif) no-repeat 0 -1222px;
     overflow: hidden;
-    height: 8px;
-    width: 8px;
+    height: 6px;
+    width: 7px;
     min-height: 0;
+    padding: 0;
+}
+/* Spin Buttons - The up arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up {
+    top: 2px;
+    background-position: 0 -1222px;
 }
 /* Spin Buttons - The down arrow */
-.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down {
-    bottom: 0;
-    right: 0;
-    background-image: url( editor-sprite.gif );
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down {
+    bottom: 2px;
     background-position: 0 -1187px;
-    overflow: hidden;
-    height: 8px;
-    width: 8px;
-    min-height: 0;
+}
+/* Handle plain Select Elements */
+.yui-skin-sam .yui-toolbar-container select {
+    height: 22px;
+    border: 1px solid #808080;
+}
+/* Pad and align the Select Menus */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a {
+    padding-left: 5px;
+    text-align: left;    
 }
 /* Set the icon of the select menu for the drop down arrow */
 .yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon {
-    background-image: url( editor-sprite.gif );
-    background-position: 0px -1144px;
+    background: url( editor-sprite.gif ) no-repeat 0 -1144px;
     overflow: hidden;
     right: -2px;
     top: 0px;
@@ -371,13 +424,10 @@ version: 2.3.0
 .yui-skin-sam .yui-color-button-menu .yui-toolbar-colors {
     border: 1px solid #808080;
 }
-/* Color the input yellow if it has the warning class applied */
-.yui-editor-panel label input.warning {
-    background-color: #FFEE69;
-}
+
 
 /* Property Editor Panel styles */
-.yui-skin-sam .yui-editor-panel .yui-panel {
+.yui-skin-sam .yui-editor-panel {
     padding: 0;
     margin: 0;
     border: none;
@@ -385,19 +435,9 @@ version: 2.3.0
     overflow: visible;
 }
 
-/* Image Properties - Border container size */
-.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border {
-    width: 190px;
-    *width: 195px;
-}
-/* Image Properties - Text flow container size */
-.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow {
-    width: 185px;
-}
-
 /* Margins on the header of the Property Editor */
 .yui-skin-sam .yui-editor-panel .hd {
-    margin: 13px 0 0;
+    margin: 10px 0 0;
     padding: 0;
     border: none;
 }
@@ -412,7 +452,7 @@ version: 2.3.0
     width: 99%;
     position: relative;
     margin: 0;
-    padding: 0;
+    padding: 3px 0 0 0;
     font-size: 93%;
     text-indent: 5px;
     height: 20px;
@@ -424,7 +464,6 @@ version: 2.3.0
     border-right: 1px solid #808080;
     width: 99%;
     margin: 0;
-    *margin-left: -1px;
     padding: 0;
     overflow: visible;
 }
@@ -440,11 +479,99 @@ version: 2.3.0
     margin: 0;
     padding: 0;
 }
+/* IE is havig trouble with our menu sizes here */
+.yui-skin-sam .yui-editor-panel .yuimenu {
+    /**width: 90px !important;*/
+}
+/* Remove the border from the toolbar's container and add some margin to it */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont {
+    padding: 0;
+    border: none;
+    margin-top: 0.35em;
+}
+/* Set the width of the bordersize and bordertype menu buttons */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize, .yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype {
+    width: 50px;
+}
 
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label {
+    display: block;
+    float: none;
+    padding: 4px 0;
+    margin-bottom: 7px;
+}
 /* Form styling */
 .yui-skin-sam .yui-editor-panel label strong {
     font-weight: normal;
     font-size: 93%;
+    text-align: right;
+    padding-top: 2px;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label input {
+    width: 75%;
+}
+/* Form styling */
+.yui-skin-sam .yui-editor-panel #createlink_target,
+.yui-skin-sam .yui-editor-panel #insertimage_target {
+    width: auto;
+    margin-right: 5px;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel .removeLink {
+    width: 98%;
+}
+/* Color the input yellow if it has the warning class applied */
+.yui-skin-sam .yui-editor-panel label input.warning {
+    background-color: #FFEE69;
+}
+
+/* Style the titles of the toolbar groups */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3 {
+    color: #000;
+    float: left;
+    font-weight: normal;
+    font-size: 93%;
+    margin: 5px 0 0 0;
+    padding: 0 3px 0 0;
+    text-align: right;
+}
+/* Style the header for the Height and Width boxes */
+.yui-skin-sam .yui-editor-panel .height-width h3 {
+    margin: 3px 0 0 10px;
+}
+/* Style the height and width container */
+.yui-skin-sam .yui-editor-panel .height-width {
+    margin: 3px 0 0 35px;
+    *margin-left: 14px;
+    width: 42%;
+    *width: 44%;
+}
+/* Give the border group a width */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border {
+    width: 190px;
+}
+.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border {
+    width: 210px;
+}
+/* Give the padding group a width */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding {
+    width: 203px;
+}
+.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding {
+    width: 172px;
+}
+/* Fix some margins for the H3's */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3 {
+    margin-left: 25px;
+    *margin-left: 12px;
+}
+/* Image Properties - Text flow container size */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow {
+    width: 182px;
 }
 
 /* Remove the background image set in Panel.css */
@@ -458,8 +585,7 @@ version: 2.3.0
     border: 1px solid #808080;
     border-top: none;
     padding: 0;
-    margin: 0;
-    z-index: -1;
+    margin: 0 0 2px 0;
 }
 
 /* Style the close button in the Property Editor */
@@ -475,16 +601,28 @@ version: 2.3.0
     top:2px;
     width:26px;
 }
+/* Style the tip in the footer */
+.yui-skin-sam .yui-editor-panel .ft span.tip {
+    background-color: #EDF5FF;
+    border-top: 1px solid #808080;
+    font-size: 85%;
+}
+/* Style the tip in the footer */
+.yui-skin-sam .yui-editor-panel .ft span.tip strong {
+    display: block;
+    float: left;
+    margin: 0 2px 8px 0;
+}
+
 
 /* Setup the icon for a tip */
 .yui-skin-sam .yui-editor-panel .ft span.tip span.icon {
-    background-image: url( editor-sprite.gif );
-    background-position: 0 -1260px;
+    background: url( editor-sprite.gif ) no-repeat 0 -1260px;
     display: block;
     height: 20px;
-    left: 0;
+    left: 2px;
     position: absolute;
-    top: 0;
+    top: 8px;
     width: 20px;
 }
 /* Setup the background image for an info icon */
@@ -505,8 +643,7 @@ version: 2.3.0
     left: 25px;
     text-indent: 9999px;
     overflow: hidden;
-    background-image: url( editor-knob.gif );
-    background-repeat: no-repeat;
+    background: url( editor-knob.gif ) no-repeat 0 0;
 }
 /* Reset some styles from the editor toolbar, when a toolbar is inside the Property Editor */
 .yui-skin-sam .yui-editor-panel .yui-toolbar-container {
@@ -518,14 +655,6 @@ version: 2.3.0
 /* Reset styles for menu buttons inside the Property Editor */
 .yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd {
     background-color: #ffffff;
-    border-bottom: 1px solid #808080;
-}
-
-/* Style the titles of the toolbar groups */
-.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3 {
-    color: #000;
-    float: left;
-    padding-top: 5px;
 }
 
 /* This image is the one used to place the blankimage placeholder into the editor when you click on Insert an Image */
index 1c96eba7cf94fee2647da031f941d1bffdcff45f..e063cd0bbbc388484428a07ff65161fd2fb0e42c 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
diff --git a/lib/yui/editor/assets/skins/sam/simpleeditor-skin.css b/lib/yui/editor/assets/skins/sam/simpleeditor-skin.css
new file mode 100644 (file)
index 0000000..37438d0
--- /dev/null
@@ -0,0 +1,663 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/* Place the border around the editor */
+.yui-skin-sam .yui-editor-container {
+    border: 1px solid #808080;
+}
+/* Color the border of the container */
+.yui-skin-sam .yui-toolbar-container {
+    zoom: 1;
+}
+/* Load the background image on the Toolbars titlebar */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar {
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+    position: relative;
+}
+
+/* Give the titlebar some color and padding */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2 {
+    color: #000000;
+    font-weight: bold;
+    margin: 0;
+    padding: 0.3em 1em;
+    font-size: 100%;
+    text-align: left;
+}
+
+/* Give the toolbars groups titles some color and padding */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3 {
+    color: #808080;
+    font-size: 75%;
+    margin: 1em 0 0;
+    padding-bottom: 0;
+    padding-left: 0.25em;
+    text-align: left;
+}
+
+/* Hide all of the sepatators borders */
+.yui-toolbar-container span.yui-toolbar-separator {
+    border: none;
+    text-indent: 33px;
+    overflow: hidden;
+    margin: .25em;
+}
+
+/* Background color of the toolbar */
+.yui-skin-sam .yui-toolbar-container {
+    background-color: #F2F2F2;
+}
+
+/* Add some padding to the toolbars sub container */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont {
+    padding: 0 1em 0.35em;
+    border-bottom:1px solid #808080;
+}
+/* When the collapsed class is added, add a border to the bottom of the titlebar (since the toolbar itself is display none) */
+.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar {
+    border-bottom:1px solid #808080;
+}
+
+/* Remove the shadows from the menus in the toolbar - Menu.css override */
+.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow, .yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow {
+    display: none;
+}
+
+/* Remove padding/margin from lists */
+.yui-skin-sam .yui-editor-container ul {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+/* Remove padding/margin from list items */
+.yui-skin-sam .yui-editor-container ul li {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+/* Float the LI's that wrap the buttons */
+.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem {
+    float: left;
+}
+
+/* Set the color and the border of the dompath container at the bottom of the editor */
+.yui-skin-sam .yui-editor-container .dompath {
+    background-color: #F2F2F2;
+    border-top:1px solid #808080;
+    color: #999;
+    text-align: left;
+    padding: 0.25em;
+}
+
+/* Set the image for the collapse button on the toolbar */
+.yui-skin-sam .yui-toolbar-container .collapse {
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;
+}
+/* Position the image and the container */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse {
+    cursor: pointer;
+    position: absolute;
+    top: 4px;
+    right: 2px;
+    display: block;
+    overflow: hidden;
+    height: 15px;
+    width: 15px;
+    text-indent: 9999px;
+}
+
+/* Set the default styles for the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-push-button,
+.yui-skin-sam .yui-toolbar-container .yui-color-button,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button {
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+    position: relative;
+    display: block;
+    height: 22px;
+    width: 30px;
+    margin: 0;
+    border-color: #808080;
+    border-style: solid;
+    border-width: 1px 0;
+}
+/* Set the height of the buttons and pad them on the left for the icon */
+.yui-skin-sam .yui-toolbar-container .yui-push-button a,
+.yui-skin-sam .yui-toolbar-container .yui-color-button a,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button a {
+    padding-left: 35px;
+    height: 20px;
+    text-decoration: none;
+    font-size: 93%;
+    line-height: 2;
+    display: block;
+    color: #000000;
+    overflow: hidden;
+}
+/* Set the height of the buttons and pad them on the left for the icon */
+.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child {
+    border-color: #808080;
+    border-style: solid;
+    border-width: 0 1px;
+    margin: 0 -1px;
+    display: block;
+}
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child {
+    border-color: #ccc;
+}
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a {
+    color: #A6A6A6;
+    cursor: default;
+}
+.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,
+.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled {
+    border-color: #ccc;
+}
+/* IE needs a little help positioning the first child */
+.yui-skin-sam .yui-toolbar-container .yui-button .first-child {
+    *left: 0px;
+}
+
+/* Font Family Drop Down */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname {
+    width: 135px;
+}
+
+/* Header Drop Down */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading {
+    width: 92px;
+}
+
+/* Handle the hover state of the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button-hover {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;
+    border-color: #808080;
+}
+
+/* Handle the selected state of the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button-selected {
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;
+    border-color: #808080;
+}
+/* When the nogrouplabels class is applied, set the h3's to display none */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3 {
+    display: none;
+}
+/* When not showing the h3 group labels, add some margin to make up for them*/
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group {
+       margin-top: .75em;
+}
+
+
+/* Handle the icon placeholder for the buttons
+    This is very important - position of this must be absolute.
+    If it is not positioned absolute, IE will place it over the a in the Toolbar
+    Doing this will cause the editor to loose focus and loose the selection.
+*/
+.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,
+.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,
+.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon {
+    display: block;
+    position: absolute;
+    top: 2px;
+    height: 18px;
+    width: 18px;
+    overflow: hidden;
+    background: url(editor-sprite.gif) no-repeat 30px 30px;
+}
+
+/* Swap out the image to an active image */
+.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon, .yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon {
+    background-image: url(editor-sprite-active.gif);
+}
+/* Change the defaults to make them look more like the editor */
+.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel {
+    cursor: pointer;
+    color: #000;
+    *position: relative;
+}
+
+/* Set the background color of all menu containers */
+.yui-skin-sam .yui-toolbar-container .yui-button-menu {
+    background-color: #fff;
+}
+/* Set the background of all menu items that are selected */
+.yui-skin-sam div.yuimenu li.selected {
+    background-color: #B3D4FF;
+}
+/* Set the color of the hrefs in a selected menu item */
+.yui-skin-sam div.yuimenu li.selected a.selected {
+    color: #000;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon {
+    background-position: 0 0;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon {
+    background-position: 0 -36px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon {
+    background-position: 0 -72px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon {
+    background-position: 0 -180px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon {
+    background-position: 0 -144px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon {
+    background-position: 0 -216px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon {
+    background-position: 0 -288px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon {
+    background-position: 0 -324px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon {
+    background-position: 0 -360px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon {
+    background-position: 0 -396px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon {
+    background-position: 0 -432px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon {
+    background-position: 0 -720px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon {
+    background-position: 0 -684px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon {
+    background-position: 0 -792px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon {
+    background-position: 1px -756px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon {
+    background-position: 0 -972px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon {
+    background-position: 0 -936px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon {
+    background-position: 0 -900px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon {
+    background-position: 0 -864px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon {
+    background-position: 0 -252px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon {
+    background-position: 0 -1080px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon {
+    background-position: 0 -1044px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon {
+    background-position: 0 -468px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon {
+    background-position: 0 -504px;
+    left: 5px;
+}
+/* Set the width of the spin buttons */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child {
+    width: 35px;
+}
+/* Pad the first child */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
+    padding-left: 2px;
+    text-align: left;    
+}
+
+/* Spin Buttons - Remove the icon holder, they don't need it */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon {
+    display: none;
+}
+
+/* Spin Buttons - Prep the arrows */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down {
+    right: 2px;
+    background: url(editor-sprite.gif) no-repeat 0 -1222px;
+    overflow: hidden;
+    height: 6px;
+    width: 7px;
+    min-height: 0;
+    padding: 0;
+}
+/* Spin Buttons - The up arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up {
+    top: 2px;
+    background-position: 0 -1222px;
+}
+/* Spin Buttons - The down arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down {
+    bottom: 2px;
+    background-position: 0 -1187px;
+}
+/* Handle plain Select Elements */
+.yui-skin-sam .yui-toolbar-container select {
+    height: 22px;
+    border: 1px solid #808080;
+}
+/* Pad and align the Select Menus */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a {
+    padding-left: 5px;
+    text-align: left;    
+}
+/* Set the icon of the select menu for the drop down arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon {
+    background: url( editor-sprite.gif ) no-repeat 0 -1144px;
+    overflow: hidden;
+    right: -2px;
+    top: 0px;
+    height: 20px;
+}
+/* Fix the color menu background if it's inside a Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd {
+    background-color: transparent;
+    border: none;
+    width: 135px;
+}
+
+/* Place a border around the color menu */
+.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors {
+    border: 1px solid #808080;
+}
+
+
+/* Property Editor Panel styles */
+.yui-skin-sam .yui-editor-panel {
+    padding: 0;
+    margin: 0;
+    border: none;
+    background-color: transparent;
+    overflow: visible;
+}
+
+/* Margins on the header of the Property Editor */
+.yui-skin-sam .yui-editor-panel .hd {
+    margin: 10px 0 0;
+    padding: 0;
+    border: none;
+}
+/* Setup the background image on the title bar
+    We are styling the h3 instead if the div so we can make room
+    for the "knob" that floats on the top of the window.
+*/
+.yui-skin-sam .yui-editor-panel .hd h3 {
+    color: #000;
+    border: 1px solid #808080;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+    width: 99%;
+    position: relative;
+    margin: 0;
+    padding: 3px 0 0 0;
+    font-size: 93%;
+    text-indent: 5px;
+    height: 20px;
+}
+/* Style the body of the Property Editor */
+.yui-skin-sam .yui-editor-panel .bd {
+    background-color: #F2F2F2;
+    border-left: 1px solid #808080;
+    border-right: 1px solid #808080;
+    width: 99%;
+    margin: 0;
+    padding: 0;
+    overflow: visible;
+}
+/* Remove the padding/margin on lists in the Property Editor */
+.yui-skin-sam .yui-editor-panel ul {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+
+/* Remove the padding/margin on list items in the Property Editor */
+.yui-skin-sam .yui-editor-panel ul li {
+    margin: 0;
+    padding: 0;
+}
+/* IE is havig trouble with our menu sizes here */
+.yui-skin-sam .yui-editor-panel .yuimenu {
+    /**width: 90px !important;*/
+}
+/* Remove the border from the toolbar's container and add some margin to it */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont {
+    padding: 0;
+    border: none;
+    margin-top: 0.35em;
+}
+/* Set the width of the bordersize and bordertype menu buttons */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize, .yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype {
+    width: 50px;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label {
+    display: block;
+    float: none;
+    padding: 4px 0;
+    margin-bottom: 7px;
+}
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label strong {
+    font-weight: normal;
+    font-size: 93%;
+    text-align: right;
+    padding-top: 2px;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label input {
+    width: 75%;
+}
+/* Form styling */
+.yui-skin-sam .yui-editor-panel #createlink_target,
+.yui-skin-sam .yui-editor-panel #insertimage_target {
+    width: auto;
+    margin-right: 5px;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel .removeLink {
+    width: 98%;
+}
+/* Color the input yellow if it has the warning class applied */
+.yui-skin-sam .yui-editor-panel label input.warning {
+    background-color: #FFEE69;
+}
+
+/* Style the titles of the toolbar groups */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3 {
+    color: #000;
+    float: left;
+    font-weight: normal;
+    font-size: 93%;
+    margin: 5px 0 0 0;
+    padding: 0 3px 0 0;
+    text-align: right;
+}
+/* Style the header for the Height and Width boxes */
+.yui-skin-sam .yui-editor-panel .height-width h3 {
+    margin: 3px 0 0 10px;
+}
+/* Style the height and width container */
+.yui-skin-sam .yui-editor-panel .height-width {
+    margin: 3px 0 0 35px;
+    *margin-left: 14px;
+    width: 42%;
+    *width: 44%;
+}
+/* Give the border group a width */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border {
+    width: 190px;
+}
+.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border {
+    width: 210px;
+}
+/* Give the padding group a width */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding {
+    width: 203px;
+}
+.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding {
+    width: 172px;
+}
+/* Fix some margins for the H3's */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3 {
+    margin-left: 25px;
+    *margin-left: 12px;
+}
+/* Image Properties - Text flow container size */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow {
+    width: 182px;
+}
+
+/* Remove the background image set in Panel.css */
+.yui-skin-sam .yui-editor-panel .hd {
+    background: none;
+}
+
+/* Give the footer som color and a border */
+.yui-skin-sam .yui-editor-panel .ft {
+    background-color: #F2F2F2;
+    border: 1px solid #808080;
+    border-top: none;
+    padding: 0;
+    margin: 0 0 2px 0;
+}
+
+/* Style the close button in the Property Editor */
+.yui-skin-sam .yui-editor-panel .hd span.close {
+    background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;
+    cursor:pointer;
+    display:block;
+    height:16px;
+    overflow:hidden;
+    position:absolute;
+    right:5px;
+    text-indent:500px;
+    top:2px;
+    width:26px;
+}
+/* Style the tip in the footer */
+.yui-skin-sam .yui-editor-panel .ft span.tip {
+    background-color: #EDF5FF;
+    border-top: 1px solid #808080;
+    font-size: 85%;
+}
+/* Style the tip in the footer */
+.yui-skin-sam .yui-editor-panel .ft span.tip strong {
+    display: block;
+    float: left;
+    margin: 0 2px 8px 0;
+}
+
+
+/* Setup the icon for a tip */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon {
+    background: url( editor-sprite.gif ) no-repeat 0 -1260px;
+    display: block;
+    height: 20px;
+    left: 2px;
+    position: absolute;
+    top: 8px;
+    width: 20px;
+}
+/* Setup the background image for an info icon */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info {
+    background-position: 2px -1260px;
+}
+/* Setup the background image for a warning icon */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn {
+    background-position: 2px -1296px;
+}
+
+/* Handle the knob that floats on top of the panel */
+.yui-skin-sam .yui-editor-panel .hd span.knob {
+    position: absolute;
+    height: 10px;
+    width: 28px;
+    top: -10px;
+    left: 25px;
+    text-indent: 9999px;
+    overflow: hidden;
+    background: url( editor-knob.gif ) no-repeat 0 0;
+}
+/* Reset some styles from the editor toolbar, when a toolbar is inside the Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container {
+    float: left;
+    width: 100%;
+    background-image: none;
+    border: none;
+}
+/* Reset styles for menu buttons inside the Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd {
+    background-color: #ffffff;
+}
+
+/* This image is the one used to place the blankimage placeholder into the editor when you click on Insert an Image */
+.yui-editor-blankimage {
+    background-image: url( blankimage.png );
+}
diff --git a/lib/yui/editor/assets/skins/sam/simpleeditor.css b/lib/yui/editor/assets/skins/sam/simpleeditor.css
new file mode 100644 (file)
index 0000000..e063cd0
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-busy{cursor:wait !important;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;*top:-5px;width:24px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:.25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;margin:0;border-color:#808080;border-style:solid;border-width:1px 0;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:93%;line-height:2;display:block;color:#000000;overflow:hidden;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel #createlink_target,.yui-skin-sam .yui-editor-panel #insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}
index 266453f804a8de7b5953fd44b7b351b350e19293..ddc72b7ecfa23cbe92e60f7328c9247eb8f6cd69 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
-*/
-/*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
 */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+    /**
+     * @description <p>Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButtonAdvanced
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event, container_core, menu, button
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    if (YAHOO.widget.Button) {
+        YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button;
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich';
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) {
+            var _menuItems = this.getMenu().getItems();
+            if (_menuItems.length === 0) {
+                this.getMenu()._onBeforeShow();
+                _menuItems = this.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }      
+        };
+    } else {
+        YAHOO.widget.ToolbarButtonAdvanced = function() {};
+    }
+
+
+    /**
+     * @description <p>Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButton
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event
+     * @Extends YAHOO.util.Element
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    YAHOO.widget.ToolbarButton = function(el, attrs) {
+        YAHOO.log('ToolbarButton Initalizing', 'info', 'ToolbarButton');
+        YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar');
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+
+        if (!oConfig.attributes.type) {
+            oConfig.attributes.type = 'push';
+        }
+        
+        oConfig.element = document.createElement('span');
+        oConfig.element.setAttribute('unselectable', 'on');
+        oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button';
+        oConfig.element.innerHTML = '<span class="first-child"><a href="#">LABEL</a></span>';
+        oConfig.attributes.id = Dom.generateId();
+
+        YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, {
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        buttonType: 'normal',
+        /**
+        * @method _handleMouseOver
+        * @private
+        * @description Adds classes to the button elements on mouseover (hover)
+        */
+        _handleMouseOver: function() {
+            if (!this.get('disabled')) {
+                this.addClass('yui-button-hover');
+                this.addClass('yui-' + this.get('type') + '-button-hover');
+            }
+        },
+        /**
+        * @method _handleMouseOut
+        * @private
+        * @description Removes classes from the button elements on mouseout (hover)
+        */
+        _handleMouseOut: function() {
+            this.removeClass('yui-button-hover');
+            this.removeClass('yui-' + this.get('type') + '-button-hover');
+        },
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        checkValue: function(value) {
+            if (this.get('type') == 'menu') {
+                var opts = this._button.options;
+                for (var i = 0; i < opts.length; i++) {
+                    if (opts[i].value == value) {
+                        opts.selectedIndex = i;
+                    }
+                }
+            }
+        },
+        /** 
+        * @method init
+        * @description The ToolbarButton class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.on('mouseover', this._handleMouseOver, this, true);
+            this.on('mouseout', this._handleMouseOut, this, true);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */        
+        initAttributes: function(attr) {
+            YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute value
+            * @description The value of the button
+            * @type String
+            */            
+            this.setAttributeConfig('value', {
+                value: attr.value
+            });
+            /**
+            * @attribute menu
+            * @description The menu attribute, see YAHOO.widget.Button
+            * @type Object
+            */            
+            this.setAttributeConfig('menu', {
+                value: attr.menu || false
+            });
+            /**
+            * @attribute type
+            * @description The type of button to create: push, menu, color, select, spin
+            * @type String
+            */            
+            this.setAttributeConfig('type', {
+                value: attr.type,
+                writeOnce: true,
+                method: function(type) {
+                    var el, opt;
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    switch (type) {
+                        case 'select':
+                        case 'menu':
+                            el = document.createElement('select');
+                            var menu = this.get('menu');
+                            for (var i = 0; i < menu.length; i++) {
+                                opt = document.createElement('option');
+                                opt.innerHTML = menu[i].text;
+                                opt.value = menu[i].value;
+                                if (menu[i].checked) {
+                                    opt.selected = true;
+                                }
+                                el.appendChild(opt);
+                            }
+                            this._button.parentNode.replaceChild(el, this._button);
+                            Event.on(el, 'change', this._handleSelect, this, true);
+                            this._button = el;
+                            break;
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Set the button into a disabled state
+            * @type String
+            */            
+            this.setAttributeConfig('disabled', {
+                value: attr.disabled || false,
+                method: function(disabled) {
+                    if (disabled) {
+                        this.addClass('yui-button-disabled');
+                        this.addClass('yui-' + this.get('type') + '-button-disabled');
+                    } else {
+                        this.removeClass('yui-button-disabled');
+                        this.removeClass('yui-' + this.get('type') + '-button-disabled');
+                    }
+                    if (this.get('type') == 'menu') {
+                        this._button.disabled = disabled;
+                    }
+                }
+            });
+
+            /**
+            * @attribute label
+            * @description The text label for the button
+            * @type String
+            */            
+            this.setAttributeConfig('label', {
+                value: attr.label,
+                method: function(label) {
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    if (this.get('type') == 'push') {
+                        this._button.innerHTML = label;
+                    }
+                }
+            });
+
+            /**
+            * @attribute title
+            * @description The title of the button
+            * @type String
+            */            
+            this.setAttributeConfig('title', {
+                value: attr.title
+            });
+
+            /**
+            * @config container
+            * @description The container that the button is rendered to, handled by Toolbar
+            * @type String
+            */            
+            this.setAttributeConfig('container', {
+                value: null,
+                writeOnce: true,
+                method: function(cont) {
+                    this.appendTo(cont);
+                }
+            });
+
+        },
+        /** 
+        * @private
+        * @method _handleSelect
+        * @description The event fired when a change event gets fired on a select element
+        * @param {Event} ev The change event.
+        */        
+        _handleSelect: function(ev) {
+            var tar = Event.getTarget(ev);
+            var value = tar.options[tar.selectedIndex].value;
+            this.fireEvent('change', {type: 'change', value: value });
+        },
+        /** 
+        * @method getMenu
+        * @description A stub function to mimic YAHOO.widget.Button's getMenu method
+        */        
+        getMenu: function() {
+            return this.get('menu');
+        },
+        /** 
+        * @method fireEvent
+        * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled.
+        */        
+        fireEvent: function (p_sType , p_aArgs) {
+            //  Disabled buttons should not respond to DOM events
+            if (this.DOM_EVENTS[p_sType] && this.get('disabled')) {
+                return;
+            }
+        
+            YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs);
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */        
+        toString: function() {
+            return 'ToolbarButton (' + this.get('id') + ')';
+        }
+        
+    });
+})();
 /**
  * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
- * @class Toolbar
  * @namespace YAHOO.widget
- * @requires yahoo, dom, element, event
- * @optional container, menu, button, dragdrop
+ * @requires yahoo, dom, element, event, toolbarbutton
+ * @optional container_core, dragdrop
  * @beta
  */
 (function() {
@@ -28,6 +327,8 @@ var Dom = YAHOO.util.Dom,
     /**
      * Provides a rich toolbar widget based on the button and menu widgets
      * @constructor
+     * @class Toolbar
+     * @extends YAHOO.util.Element
      * @param {String/HTMLElement} el The element to turn into a toolbar.
      * @param {Object} attrs Object liternal containing configuration parameters.
     */
@@ -36,14 +337,14 @@ var Dom = YAHOO.util.Dom,
         YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar');
         
         if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
-            var attrs = el;
+            attrs = el;
         }
         var local_attrs = (attrs || {});
 
         var oConfig = {
             element: null,
             attributes: local_attrs
-        }
+        };
         
         
         if (Lang.isString(el) && Dom.get(el)) {
@@ -73,16 +374,15 @@ var Dom = YAHOO.util.Dom,
         
         var cont = document.createElement('DIV');
         oConfig.attributes.cont = cont;
-        Dom.addClass(cont, 'yui-toolbar-subcont')
+        Dom.addClass(cont, 'yui-toolbar-subcont');
         oConfig.element.appendChild(cont);
         
         oConfig.attributes.element = oConfig.element;
         oConfig.attributes.id = oConfig.element.id;
 
         YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
-        
-        
-    }
+         
+    };
 
     /**
     * @method _addMenuClasses
@@ -103,10 +403,15 @@ var Dom = YAHOO.util.Dom,
             Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
             Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
         }
-        this._setWidth();
-    };
+    }
 
     YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property buttonType
+        * @description The default button to use
+        * @type Object
+        */
+        buttonType: YAHOO.widget.ToolbarButton,
         /** 
         * @property dd
         * @description The DragDrop instance associated with the Toolbar
@@ -303,12 +608,6 @@ var Dom = YAHOO.util.Dom,
         */
         _titlebar: null,
         /** 
-        * @property _disabled
-        * @description Object to track button status when enabling/disabling the toolbar
-        * @type Object
-        */
-        _disabled: null,
-        /** 
         * @property browser
         * @description Standard browser detection
         * @type Object
@@ -407,12 +706,41 @@ var Dom = YAHOO.util.Dom,
         */
         initAttributes: function(attr) {
             YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
-            var el = this.get('element');
             this.addClass(this.CLASS_CONTAINER);
 
+            /**
+            * @attribute buttonType
+            * @description The buttonType to use (advanced or basic)
+            * @type String
+            */
+            this.setAttributeConfig('buttonType', {
+                value: attr.buttonType || 'basic',
+                writeOnce: true,
+                validator: function(type) {
+                    switch (type) {
+                        case 'advanced':
+                        case 'basic':
+                            return true;
+                    }
+                    return false;
+                },
+                method: function(type) {
+                    if (type == 'advanced') {
+                        if (YAHOO.widget.Button) {
+                            this.buttonType = YAHOO.widget.ToolbarButtonAdvanced;
+                        } else {
+                            YAHOO.log('Can not find YAHOO.widget.Button', 'error', 'Toolbar');
+                            this.buttonType = YAHOO.widget.ToolbarButton;
+                        }
+                    } else {
+                        this.buttonType = YAHOO.widget.ToolbarButton;
+                    }
+                }
+            });
+
 
             /**
-            * @config buttons
+            * @attribute buttons
             * @description Object specifying the buttons to include in the toolbar
             * Example:
             * <code><pre>
@@ -428,7 +756,7 @@ var Dom = YAHOO.util.Dom,
             *   }
             * }
             * </pre></code>
-            * @type Object
+            * @type Array
             */
             
             this.setAttributeConfig('buttons', {
@@ -439,7 +767,7 @@ var Dom = YAHOO.util.Dom,
                         if (Lang.hasOwnProperty(data, i)) {
                             if (data[i].type == 'separator') {
                                 this.addSeparator();
-                            } else if (data[i].group != undefined) {
+                            } else if (data[i].group !== undefined) {
                                 this.addButtonGroup(data[i]);
                             } else {
                                 this.addButton(data[i]);
@@ -450,7 +778,7 @@ var Dom = YAHOO.util.Dom,
             });
 
             /**
-            * @config disabled
+            * @attribute disabled
             * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
             * @default false
             * @type Boolean
@@ -458,78 +786,53 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('disabled', {
                 value: false,
                 method: function(disabled) {
-                    if (!Lang.isObject(this._disabled)) {
-                        this._disabled = {};
+                    if (this.get('disabled') === disabled) {
+                        return false;
                     }
                     if (disabled) {
                         this.addClass(this.CLASS_DISABLED);
                         this.set('draggable', false);
+                        this.disableAllButtons();
                     } else {
                         this.removeClass(this.CLASS_DISABLED);
                         if (this._configs.draggable._initialConfig.value) {
                             //Draggable by default, set it back
                             this.set('draggable', true);
                         }
-                    }
-                    var len = this._buttonList.length;
-                    for (var i = 0; i < len; i++) {
-                        if (disabled) {
-                            //If it's already disabled, flag it
-                            if (this._buttonList[i].get('disabled')) {
-                                this._disabled[i] = true;
-                            } else {
-                                this._disabled[i] = null;
-                            }
-                            this.disableButton(this._buttonList[i].get('id'));
-                        } else {
-                            //Check to see if it was disabled by default and skip it
-                            var _button = this._buttonList[i];
-                            var _check = _button._configs.disabled._initialConfig.value;
-                            if (this._disabled[i]) {
-                                _check = true;
-                            }
-                            if (!_check) {
-                                this.enableButton(_button.get('id'));
-                            }
-                        }
+                        this.resetAllButtons();
                     }
                 }
             });
 
-            /**
-            * @config grouplabels
-            * @description Boolean indicating if the toolbar should show the group label's text string.
-            * @default true
-            * @type Boolean
-            */
-            this.setAttributeConfig('grouplabels', {
-                value: true,
-                writeOnce: true
-            });
-
             /**
             * @config cont
-            * @description Boolean indicating if the toolbar should show the group label's text string.
-            * @default true
-            * @type Boolean
+            * @description The container for the toolbar.
+            * @type HTMLElement
             */
             this.setAttributeConfig('cont', {
                 value: attr.cont,
                 readOnly: true
             });
 
+
             /**
-            * @config collapse
-            * @description Boolean indicating if the the titlebar should have a collapse button.
-            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
-            * @default false
+            * @attribute grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
             * @type Boolean
             */
-            this.setAttributeConfig('collapse', {
-                value: false
+            this.setAttributeConfig('grouplabels', {
+                value: ((attr.grouplabels === false) ? false : true),
+                method: function(grouplabels) {
+                    if (grouplabels) {
+                        Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    } else {
+                        Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    }
+                }
             });
             /**
-            * @config titlebar
+            * @attribute titlebar
             * @description Boolean indicating if the toolbar should have a titlebar. If
             * passed a string, it will use that as the titlebar text
             * @default false
@@ -550,35 +853,14 @@ var Dom = YAHOO.util.Dom,
                             h2.innerHTML = titlebar;
                             this._titlebar.appendChild(h2);
                         }
-                        if (this.get('collapse')) {
-                            var collapse = document.createElement('SPAN');
-                            collapse.innerHTML = 'X';
-                            collapse.title = this.STR_COLLAPSE;
-
-                            Dom.addClass(collapse, 'collapse');
-                            this._titlebar.appendChild(collapse);
-                            Event.addListener(collapse, 'click', function() {
-                                if (Dom.getStyle(this.get('cont'), 'display') == 'none') {
-                                    Dom.setStyle(this.get('cont'), 'display', 'block');
-                                    Dom.removeClass(collapse, 'collapsed');
-                                    this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
-                                } else {
-                                    Dom.setStyle(this.get('cont'), 'display', 'none');
-                                    Dom.addClass(collapse, 'collapsed');
-                                    this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
-                                }
-                            }, this, true);
-                        }
-                        if (this.get('draggable')) {
-                            this.dd = new YAHOO.util.DD(this.get('id'));
-                            this.dd.setHandleElId(this._titlebar);
-                            Dom.addClass(this._titlebar, 'draggable');
-                        }
                         if (this.get('firstChild')) {
                             this.insertBefore(this._titlebar, this.get('firstChild'));
                         } else {
                             this.appendChild(this._titlebar);
                         }
+                        if (this.get('collapse')) {
+                            this.set('collapse', true);
+                        }
                     } else if (this._titlebar) {
                         if (this._titlebar && this._titlebar.parentNode) {
                             this._titlebar.parentNode.removeChild(this._titlebar);
@@ -589,7 +871,52 @@ var Dom = YAHOO.util.Dom,
 
 
             /**
-            * @config draggable
+            * @attribute collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false,
+                method: function(collapse) {
+                    if (this._titlebar) {
+                        var collapseEl = null;
+                        var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                        if (collapse) {
+                            if (el.length > 0) {
+                                //There is already a collapse button
+                                return true;
+                            }
+                            collapseEl = document.createElement('SPAN');
+                            collapseEl.innerHTML = 'X';
+                            collapseEl.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapseEl, 'collapse');
+                            this._titlebar.appendChild(collapseEl);
+                            Event.addListener(collapseEl, 'click', function() {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    this.collapse(false); //Expand Toolbar
+                                } else {
+                                    this.collapse(); //Collapse Toolbar
+                                }
+                            }, this, true);
+                        } else {
+                            collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                            if (collapseEl[0]) {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    //We are closed, reopen the titlebar..
+                                    this.collapse(false); //Expand Toolbar
+                                }
+                                collapseEl[0].parentNode.removeChild(collapseEl[0]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute draggable
             * @description Boolean indicating if the toolbar should be draggable.  
             * @default false
             * @type Boolean
@@ -598,8 +925,6 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('draggable', {
                 value: (attr.draggable || false),
                 method: function(draggable) {
-                    var el = this.get('element');
-
                     if (draggable && !this.get('titlebar')) {
                         YAHOO.log('Dragging enabled', 'info', 'Toolbar');
                         if (!this._dragHandle) {
@@ -671,11 +996,15 @@ var Dom = YAHOO.util.Dom,
             var div = document.createElement('DIV');
             Dom.addClass(div, this.CLASS_PREFIX + '-group');
             Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
-            if (oGroup.label && this.get('grouplabels')) {
+            //if (oGroup.label && this.get('grouplabels')) {
+            if (oGroup.label) {
                 var label = document.createElement('h3');
                 label.innerHTML = oGroup.label;
                 div.appendChild(label);
             }
+            if (!this.get('grouplabels')) {
+                Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels');
+            }
 
             this.get('cont').appendChild(div);
 
@@ -691,8 +1020,9 @@ var Dom = YAHOO.util.Dom,
 
             for (var i = 0; i < oGroup.buttons.length; i++) {
                 var li = document.createElement('li');
+                li.className = this.CLASS_PREFIX + '-groupitem';
                 ul.appendChild(li);
-                if ((oGroup.buttons[i].type != undefined) && oGroup.buttons[i].type == 'separator') {
+                if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') {
                     this.addSeparator(li);
                 } else {
                     oGroup.buttons[i].container = li;
@@ -711,6 +1041,7 @@ var Dom = YAHOO.util.Dom,
         addButtonToGroup: function(oButton, group, after) {
             var groupCont = this._buttonGroupList[group];
             var li = document.createElement('li');
+            li.className = this.CLASS_PREFIX + '-groupitem';
             oButton.container = li;
             this.addButton(oButton, after);
             groupCont.appendChild(li);
@@ -730,8 +1061,6 @@ var Dom = YAHOO.util.Dom,
             if (!this._buttonList) {
                 this._buttonList = [];
             }
-            //Add to .get('buttons') manually
-            this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
             YAHOO.log('Adding button of type: ' + oButton.type, 'info', 'Toolbar');
             if (!oButton.container) {
                 oButton.container = this.get('cont');
@@ -747,22 +1076,19 @@ var Dom = YAHOO.util.Dom,
                                         oButton.menucmd = oButton.value;
                                     }
                                     oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
-                                    //This line made Opera fire the click event and the mousedown,
-                                    //  so events for menus where firing twice.
-                                    //this._buttonClick('click', oButton);
                                 },
                                 scope: this
-                            }
+                            };
                             oButton.menu[i].onclick = funcObject;
                         }
                     }
                 }
             }
-            var _oButton = {};
-            for (var i in oButton) {
-                if (Lang.hasOwnProperty(oButton, i)) {
-                    if (!this._toolbarConfigs[i]) {
-                        _oButton[i] = oButton[i];
+            var _oButton = {}, skip = false;
+            for (var o in oButton) {
+                if (Lang.hasOwnProperty(oButton, o)) {
+                    if (!this._toolbarConfigs[o]) {
+                        _oButton[o] = oButton[o];
                     }
                 }
             }
@@ -773,17 +1099,21 @@ var Dom = YAHOO.util.Dom,
                 _oButton.type = 'push';
             }
             if (_oButton.type == 'color') {
-                _oButton = this._makeColorButton(_oButton);
+                if (YAHOO.widget.Overlay) {
+                    _oButton = this._makeColorButton(_oButton);
+                } else {
+                    skip = true;
+                }
             }
             if (_oButton.menu) {
-                if (oButton.menu instanceof YAHOO.widget.Overlay) {
+                if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) {
                     oButton.menu.showEvent.subscribe(function() {
                         this._button = _oButton;
                     });
                 } else {
-                    for (var i = 0; i < _oButton.menu.length; i++) {
-                        if (!_oButton.menu[i].value) {
-                            _oButton.menu[i].value = _oButton.menu[i].text;
+                    for (var m = 0; m < _oButton.menu.length; m++) {
+                        if (!_oButton.menu[m].value) {
+                            _oButton.menu[m].value = _oButton.menu[m].text;
                         }
                     }
                     if (this.browser.webkit) {
@@ -791,81 +1121,162 @@ var Dom = YAHOO.util.Dom,
                     }
                 }
             }
-            var tmp = new YAHOO.widget.Button(_oButton);
-            if (this.get('disabled')) {
-                //Toolbar is disabled, disable the new button too!
-                tmp.set('disabled', true);
-            }
-            if (!oButton.id) {
-                oButton.id = tmp.get('id');
-            }
-            YAHOO.log('Button created (' + oButton.type + ')', 'info', 'Toolbar');
-            
-            if (after) {
-                var el = tmp.get('element');
-                var nextSib = null;
-                if (after.get) {
-                    nextSib = after.get('element').nextSibling;
-                } else if (after.nextSibling) {
-                    nextSib = after.nextSibling;
+            if (skip) {
+                oButton = false;
+            } else {
+                //Add to .get('buttons') manually
+                this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+                
+                var tmp = new this.buttonType(_oButton);
+                if (!tmp.buttonType) {
+                    tmp.buttonType = 'rich';
+                    tmp.checkValue = function(value) {
+                        var _menuItems = this.getMenu().getItems();
+                        if (_menuItems.length === 0) {
+                            this.getMenu()._onBeforeShow();
+                            _menuItems = this.getMenu().getItems();
+                        }
+                        for (var i = 0; i < _menuItems.length; i++) {
+                            _menuItems[i].cfg.setProperty('checked', false);
+                            if (_menuItems[i].value == value) {
+                                _menuItems[i].cfg.setProperty('checked', true);
+                            }
+                        }      
+                    };
                 }
-                if (nextSib) {
-                    nextSib.parentNode.insertBefore(el, nextSib);
-                }
-            }
-            tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
-            var icon = document.createElement('span');
-            icon.className = this.CLASS_PREFIX + '-icon';
-            tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
-            //Replace the Button HTML Element with an a href
-            var a = document.createElement('a');
-            a.innerHTML = tmp._button.innerHTML;
-            a.href = '#';
-            Event.on(a, 'click', function(ev) {
-                Event.stopEvent(ev);
-            });
-            tmp._button.parentNode.replaceChild(a, tmp._button);
-            tmp._button = a;
-
-            if (oButton.type == 'select') {
-                tmp.addClass(this.CLASS_PREFIX + '-select');
-            }
-            if (oButton.type == 'spin') {
-                if (!Lang.isArray(oButton.range)) {
-                    oButton.range = [ 10, 100 ];
+                
+                if (this.get('disabled')) {
+                    //Toolbar is disabled, disable the new button too!
+                    tmp.set('disabled', true);
+                }
+                if (!oButton.id) {
+                    oButton.id = tmp.get('id');
+                }
+                YAHOO.log('Button created (' + oButton.type + ')', 'info', 'Toolbar');
+                
+                if (after) {
+                    var el = tmp.get('element');
+                    var nextSib = null;
+                    if (after.get) {
+                        nextSib = after.get('element').nextSibling;
+                    } else if (after.nextSibling) {
+                        nextSib = after.nextSibling;
+                    }
+                    if (nextSib) {
+                        nextSib.parentNode.insertBefore(el, nextSib);
+                    }
+                }
+                tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+
+                var icon = document.createElement('span');
+                icon.className = this.CLASS_PREFIX + '-icon';
+                tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+                if (tmp._button.tagName.toLowerCase() == 'button') {
+                    tmp.get('element').setAttribute('unselectable', 'on');
+                    //Replace the Button HTML Element with an a href if it exists
+                    var a = document.createElement('a');
+                    a.innerHTML = tmp._button.innerHTML;
+                    a.href = '#';
+                    Event.on(a, 'click', function(ev) {
+                        Event.stopEvent(ev);
+                    });
+                    tmp._button.parentNode.replaceChild(a, tmp._button);
+                    tmp._button = a;
                 }
-                this._makeSpinButton(tmp, oButton);
-            }
-
-            tmp.get('element').setAttribute('title', tmp.get('label'));
 
-            if (oButton.type != 'spin') {
-                if (_oButton.menu instanceof YAHOO.widget.Overlay) {
-                    var showPicker = function(ev) {
-                        var exec = true;
-                        if (ev.keyCode && (ev.keyCode == 9)) {
-                            exec = false;
-                        }
-                        if (exec) {
-                            this._colorPicker._button = oButton.value;
-                            var menuEL = tmp.getMenu().element;
-                            if (menuEL.style.visibility == 'hidden') {
-                                tmp.getMenu().show();
-                            } else {
-                                tmp.getMenu().hide();
+                if (oButton.type == 'select') {
+                    if (tmp._button.tagName.toLowerCase() == 'select') {
+                        icon.parentNode.removeChild(icon);
+                        var iel = tmp._button;
+                        var parEl = tmp.get('element');
+                        parEl.parentNode.replaceChild(iel, parEl);
+                    } else {
+                        //Don't put a class on it if it's a real select element
+                        tmp.addClass(this.CLASS_PREFIX + '-select');
+                    }
+                }
+                if (oButton.type == 'spin') {
+                    if (!Lang.isArray(oButton.range)) {
+                        oButton.range = [ 10, 100 ];
+                    }
+                    this._makeSpinButton(tmp, oButton);
+                }
+                tmp.get('element').setAttribute('title', tmp.get('label'));
+                if (oButton.type != 'spin') {
+                    if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) {
+                        var showPicker = function(ev) {
+                            var exec = true;
+                            if (ev.keyCode && (ev.keyCode == 9)) {
+                                exec = false;
+                            }
+                            if (exec) {
+                                if (this._colorPicker) {
+                                    this._colorPicker._button = oButton.value;
+                                }
+                                var menuEL = tmp.getMenu().element;
+                                if (Dom.getStyle(menuEL, 'visibility') == 'hidden') {
+                                    tmp.getMenu().show();
+                                } else {
+                                    tmp.getMenu().hide();
+                                }
+                            }
+                            YAHOO.util.Event.stopEvent(ev);
+                        };
+                        tmp.on('mousedown', showPicker, oButton, this);
+                        tmp.on('keydown', showPicker, oButton, this);
+                        
+                    } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                        tmp.on('keypress', this._buttonClick, oButton, this);
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                            this._buttonClick(ev, oButton);
+                        }, oButton, this);
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                    } else {
+                        //Stop the mousedown event so we can trap the selection in the editor!
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('change', function(ev) {
+                            if (!oButton.menucmd) {
+                                oButton.menucmd = oButton.value;
                             }
+                            oButton.value = ev.value;
+                            this._buttonClick(ev, oButton);
+                        }, this, true);
+
+                        var self = this;
+                        //Hijack the mousedown event in the menu and make it fire a button click..
+                        if (tmp.getMenu().mouseDownEvent) {
+                            tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                                YAHOO.log('mouseDownEvent', 'warn', 'Toolbar');
+                                var oMenu = args[1];
+                                YAHOO.util.Event.stopEvent(args[0]);
+                                tmp._onMenuClick(args[0], tmp);
+                                if (!oButton.menucmd) {
+                                    oButton.menucmd = oButton.value;
+                                }
+                                oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                self._buttonClick.call(self, args[1], oButton);
+                                tmp._hideMenu();
+                                return false;
+                            });
+                            tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                                YAHOO.log('clickEvent', 'warn', 'Toolbar');
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                            tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) {
+                                YAHOO.log('mouseUpEvent', 'warn', 'Toolbar');
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
                         }
-                        YAHOO.util.Event.stopEvent(ev);
-                    };
-                    tmp.on('mousedown', showPicker, oButton, this);
-                    tmp.on('keydown', showPicker, oButton, this);
-                    
-                } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
-                    tmp.on('keypress', this._buttonClick, oButton, this);
-                    tmp.on('mousedown', function(ev) {
-                        this._buttonClick(ev, oButton);
-                        YAHOO.util.Event.stopEvent(ev);
-                    }, oButton, this);
+                        
+                    }
                 } else {
                     //Stop the mousedown event so we can trap the selection in the editor!
                     tmp.on('mousedown', function(ev) {
@@ -874,67 +1285,42 @@ var Dom = YAHOO.util.Dom,
                     tmp.on('click', function(ev) {
                         YAHOO.util.Event.stopEvent(ev);
                     });
-                    var self = this;
-                    //Hijack the mousedown event in the menu and make it fire a button click..
-                    tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
-                        YAHOO.log('mouseDownEvent', 'warn', 'Toolbar');
-                        var oMenu = args[1];
-                        YAHOO.util.Event.stopEvent(args[0]);
-                        tmp._onMenuClick(args[0], tmp);
-                        if (!oButton.menucmd) {
-                            oButton.menucmd = oButton.value;
-                        }
-                        oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
-                        self._buttonClick.call(self, args[1], oButton);
-                        tmp._hideMenu();
-                        return false;
-                    });
-                    tmp.getMenu().clickEvent.subscribe(function(ev, args) {
-                        YAHOO.log('clickEvent', 'warn', 'Toolbar');
-                        YAHOO.util.Event.stopEvent(args[0]);
-                    });
                 }
-            } else {
-                //Stop the mousedown event so we can trap the selection in the editor!
-                tmp.on('mousedown', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                });
-                tmp.on('click', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                });
-            }
-            if (this.browser.ie) {
-                //Add a couple of new events for IE
-                tmp.DOM_EVENTS.focusin = true;
-                tmp.DOM_EVENTS.focusout = true;
-                
-                //Stop them so we don't loose focus in the Editor
-                tmp.on('focusin', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-                
-                tmp.on('focusout', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-                tmp.on('click', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-            }
-            if (this.browser.webkit) {
-                //This will keep the document from gaining focus and the editor from loosing it..
-                //Forcefully remove the focus calls in button!
-                tmp.hasFocus = function() {
-                    return true;
+                if (this.browser.ie) {
+                    //Add a couple of new events for IE
+                    tmp.DOM_EVENTS.focusin = true;
+                    tmp.DOM_EVENTS.focusout = true;
+                    
+                    //Stop them so we don't loose focus in the Editor
+                    tmp.on('focusin', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    
+                    tmp.on('focusout', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
                 }
-            }
-            this._buttonList[this._buttonList.length] = tmp;
-            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
-                if (Lang.isArray(oButton.menu)) {
-                    YAHOO.log('Button type is (' + oButton.type + '), doing extra renderer work.', 'info', 'Toolbar');
-                    var menu = tmp.getMenu();
-                    menu.renderEvent.subscribe(_addMenuClasses, tmp);
-                    if (oButton.renderer) {
-                        menu.renderEvent.subscribe(oButton.renderer, tmp);
+                if (this.browser.webkit) {
+                    //This will keep the document from gaining focus and the editor from loosing it..
+                    //Forcefully remove the focus calls in button!
+                    tmp.hasFocus = function() {
+                        return true;
+                    };
+                }
+                this._buttonList[this._buttonList.length] = tmp;
+                if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                    if (Lang.isArray(oButton.menu)) {
+                        YAHOO.log('Button type is (' + oButton.type + '), doing extra renderer work.', 'info', 'Toolbar');
+                        var menu = tmp.getMenu();
+                        if (menu.renderEvent) {
+                            menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                            if (oButton.renderer) {
+                                menu.renderEvent.subscribe(oButton.renderer, tmp);
+                            }
+                        }
                     }
                 }
             }
@@ -956,7 +1342,7 @@ var Dom = YAHOO.util.Dom,
                 this._queue[this._queue.length] = ['addSeparator', arguments];
                 return false;
             }
-            if (this._sepCount == null) {
+            if (this._sepCount === null) {
                 this._sepCount = 0;
             }
             if (!this._sep) {
@@ -1017,11 +1403,14 @@ var Dom = YAHOO.util.Dom,
                 }
             }
             html += '<span><em>X</em><strong></strong></span>';
-            picker.innerHTML = html;
-            var em = picker.getElementsByTagName('em')[0];
-            var strong = picker.getElementsByTagName('strong')[0];
+            window.setTimeout(function() {
+                picker.innerHTML = html;
+            }, 0);
 
             Event.on(picker, 'mouseover', function(ev) {
+                var picker = this._colorPicker;
+                var em = picker.getElementsByTagName('em')[0];
+                var strong = picker.getElementsByTagName('strong')[0];
                 var tar = Event.getTarget(ev);
                 if (tar.tagName.toLowerCase() == 'a') {
                     em.style.backgroundColor = tar.style.backgroundColor;
@@ -1038,7 +1427,16 @@ var Dom = YAHOO.util.Dom,
                 Event.stopEvent(ev);
                 var tar = Event.getTarget(ev);
                 if (tar.tagName.toLowerCase() == 'a') {
-                    this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    if (retVal !== false) {
+                        var info = {
+                            color: tar.innerHTML,
+                            colorName: this._colorData['#' + tar.innerHTML],
+                            value: this._colorPicker._button 
+                        };
+                    
+                        this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                    }
                     this.getButtonByValue(this._colorPicker._button).getMenu().hide();
                 }
             }, this, true);
@@ -1058,16 +1456,18 @@ var Dom = YAHOO.util.Dom,
         * @method _makeColorButton
         * @private
         * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
-        * @param {Object} _oButton <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} _oButton <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
         */
         _makeColorButton: function(_oButton) {
             if (!this._colorPicker) {   
                 this._createColorPicker(this.get('id'));
             }
             _oButton.type = 'color';
-            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visbile: false, position: 'absolute' });
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true });
             _oButton.menu.setBody('');
             _oButton.menu.render(this.get('cont'));
+            Dom.addClass(_oButton.menu.element, 'yui-button-menu');
+            Dom.addClass(_oButton.menu.element, 'yui-color-button-menu');
             _oButton.menu.beforeShowEvent.subscribe(function() {
                 _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
                 _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
@@ -1075,9 +1475,7 @@ var Dom = YAHOO.util.Dom,
                 this._resetColorPicker();
                 var _p = this._colorPicker;
                 if (_p.parentNode) {
-                    //if (_p.parentNode != _oButton.menu.body) {
-                        _p.parentNode.removeChild(_p);
-                    //}
+                    _p.parentNode.removeChild(_p);
                 }
                 _oButton.menu.setBody('');
                 _oButton.menu.appendToBody(_p);
@@ -1089,7 +1487,7 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _makeSpinButton
         * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
-        * @param {Object} _button <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} _button <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
         * @param {Object} oButton Object literal containing the buttons initial config
         */
         _makeSpinButton: function(_button, oButton) {
@@ -1133,7 +1531,7 @@ var Dom = YAHOO.util.Dom,
             var _intUp = function(ev) {
                 YAHOO.util.Event.stopEvent(ev);
                 if (!_button.get('disabled') && (ev.keyCode != 9)) {
-                    var value = parseInt(_button.get('label'));
+                    var value = parseInt(_button.get('label'), 10);
                     value++;
                     value = cleanVal(value);
                     _button.set('label', ''+value);
@@ -1150,7 +1548,7 @@ var Dom = YAHOO.util.Dom,
             var _intDown = function(ev) {
                 YAHOO.util.Event.stopEvent(ev);
                 if (!_button.get('disabled') && (ev.keyCode != 9)) {
-                    var value = parseInt(_button.get('label'));
+                    var value = parseInt(_button.get('label'), 10);
                     value--;
                     value = cleanVal(value);
 
@@ -1204,42 +1602,53 @@ var Dom = YAHOO.util.Dom,
             if (ev && ev.type == 'keypress') {
                 if (ev.keyCode == 9) {
                     doEvent = false;
-                } else if ((ev.keyCode == 13) || (ev.keyCode == 0) || (ev.keyCode == 32)) {
+                } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) {
                 } else {
                     doEvent = false;
                 }
             }
 
             if (doEvent) {
+                var fireNextEvent = true,
+                    retValue = false;
                 if (info.value) {
                     YAHOO.log('fireEvent::' + info.value + 'Click', 'info', 'Toolbar');
-                    this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
                 }
                 
-                if (info.menucmd) {
+                if (info.menucmd && fireNextEvent) {
                     YAHOO.log('fireEvent::' + info.menucmd + 'Click', 'info', 'Toolbar');
-                    this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                    retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                if (fireNextEvent) {
+                    YAHOO.log('fireEvent::buttonClick', 'info', 'Toolbar');
+                    this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
                 }
-                
-                YAHOO.log('fireEvent::buttonClick', 'info', 'Toolbar');
-                this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
 
                 if (info.type == 'select') {
                     var button = this.getButtonById(info.id);
-                    var txt = info.value;
-                    for (var i = 0; i < info.menu.length; i++) {
-                        if (info.menu[i].value == info.value) {
-                            txt = info.menu[i].text;
-                            break;
+                    if (button.buttonType == 'rich') {
+                        var txt = info.value;
+                        for (var i = 0; i < info.menu.length; i++) {
+                            if (info.menu[i].value == info.value) {
+                                txt = info.menu[i].text;
+                                break;
+                            }
                         }
-                    }
-                    button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
-                    var _items = button.getMenu().getItems();
-                    for (var m = 0; m < _items.length; m++) {
-                        if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
-                            _items[m].cfg.setProperty('checked', true);
-                        } else {
-                            _items[m].cfg.setProperty('checked', false);
+                        button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                                _items[m].cfg.setProperty('checked', true);
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
                         }
                     }
                 }
@@ -1252,7 +1661,7 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonById
         * @description Gets a button instance from the toolbar by is Dom id.
         * @param {String} id The Dom id to query for.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
         */
         getButtonById: function(id) {
             var len = this._buttonList.length;
@@ -1267,13 +1676,13 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonByValue
         * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
         * @param {String} value The button value to query for.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
         */
         getButtonByValue: function(value) {
             var _buttons = this.get('buttons');
             var len = _buttons.length;
             for (var i = 0; i < len; i++) {
-                if (_buttons[i].group != undefined) {
+                if (_buttons[i].group !== undefined) {
                     for (var m = 0; m < _buttons[i].buttons.length; m++) {
                         if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
                             return this.getButtonById(_buttons[i].buttons[m].id);
@@ -1291,8 +1700,8 @@ var Dom = YAHOO.util.Dom,
                         return this.getButtonById(_buttons[i].id);
                     }
                     if (_buttons[i].menu) { //Menu Button, loop through the values
-                        for (var s = 0; s < _buttons[i].menu.length; s++) {
-                            if (_buttons[i].menu[s].value == value) {
+                        for (var j = 0; j < _buttons[i].menu.length; j++) {
+                            if (_buttons[i].menu[j].value == value) {
                                 return this.getButtonById(_buttons[i].id);
                             }
                         }
@@ -1305,7 +1714,7 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonByIndex
         * @description Gets a button instance from the toolbar by is index in _buttonList.
         * @param {Number} index The index of the button in _buttonList.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
         */
         getButtonByIndex: function(index) {
             if (this._buttonList[index]) {
@@ -1325,17 +1734,21 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method disableButton
         * @description Disables a button in the toolbar.
-        * @param {String/Number} button Disable a button by it's id or index.
+        * @param {String/Number} id Disable a button by it's id, index or value.
         * @return {Boolean}
         */
-        disableButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        disableButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                 button.set('disabled', true);
             } else {
                 return false;
@@ -1344,18 +1757,27 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method enableButton
         * @description Enables a button in the toolbar.
-        * @param {String/Number} button Enable a button by it's id or index.
+        * @param {String/Number} id Enable a button by it's id, index or value.
         * @return {Boolean}
         */
-        enableButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        enableButton: function(id) {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
-                button.set('disabled', false);
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                if (button.get('disabled')) {
+                    button.set('disabled', false);
+                }
             } else {
                 return false;
             }
@@ -1363,28 +1785,34 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method selectButton
         * @description Selects a button in the toolbar.
-        * @param {String/Number} button select a button by it's id or index.
+        * @param {String/Number} id Select a button by it's id, index or value.
         * @return {Boolean}
         */
-        selectButton: function(button, value) {
-            if (button) {
-                if (Lang.isString(button)) {
-                    var button = this.getButtonById(button);
+        selectButton: function(id, value) {
+            var button = id;
+            if (id) {
+                if (Lang.isString(id)) {
+                    button = this.getButtonById(id);
                 }
-                if (Lang.isNumber(button)) {
-                    var button = this.getButtonByIndex(button);
+                if (Lang.isNumber(id)) {
+                    button = this.getButtonByIndex(id);
                 }
-                if (button instanceof YAHOO.widget.Button) {
+                if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                    button = this.getButtonByValue(id);
+                }
+                if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                     button.addClass('yui-button-selected');
                     button.addClass('yui-button-' + button.get('value') + '-selected');
                     if (value) {
-                        var _items = button.getMenu().getItems();
-                        for (var m = 0; m < _items.length; m++) {
-                            if (_items[m].value == value) {
-                                _items[m].cfg.setProperty('checked', true);
-                                button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
-                            } else {
-                                _items[m].cfg.setProperty('checked', false);
+                        if (button.buttonType == 'rich') {
+                            var _items = button.getMenu().getItems();
+                            for (var m = 0; m < _items.length; m++) {
+                                if (_items[m].value == value) {
+                                    _items[m].cfg.setProperty('checked', true);
+                                    button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                                } else {
+                                    _items[m].cfg.setProperty('checked', false);
+                                }
                             }
                         }
                     }
@@ -1396,17 +1824,21 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method deselectButton
         * @description Deselects a button in the toolbar.
-        * @param {String/Number} button Deselect a button by it's id or index.
+        * @param {String/Number} id Deselect a button by it's id, index or value.
         * @return {Boolean}
         */
-        deselectButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        deselectButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                 button.removeClass('yui-button-selected');
                 button.removeClass('yui-button-' + button.get('value') + '-selected');
                 button.removeClass('yui-button-hover');
@@ -1426,25 +1858,87 @@ var Dom = YAHOO.util.Dom,
             }
         },
         /**
+        * @method disableAllButtons
+        * @description Disables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        disableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.disableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method enableAllButtons
+        * @description Enables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        enableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.enableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method resetAllButtons
+        * @description Resets all buttons to their initial state.
+        * @param {Object} _ex Except these buttons
+        * @return {Boolean}
+        */
+        resetAllButtons: function(_ex) {
+            if (!Lang.isObject(_ex)) {
+                _ex = {};
+            }
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                var _button = this._buttonList[i];
+                var disabled = _button._configs.disabled._initialConfig.value;
+                if (_ex[_button.get('id')]) {
+                    this.enableButton(_button);
+                    this.selectButton(_button);
+                } else {
+                    if (disabled) {
+                        this.disableButton(_button);
+                    } else {
+                        this.enableButton(_button);
+                    }
+                    this.deselectButton(_button);
+                }
+            }
+        },
+        /**
         * @method destroyButton
         * @description Destroy a button in the toolbar.
-        * @param {String/Number} button Destroy a button by it's id or index.
+        * @param {String/Number} id Destroy a button by it's id or index.
         * @return {Boolean}
         */
-        destroyButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        destroyButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
-                var id = button.get('id');
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                var thisID = button.get('id');
                 button.destroy();
 
                 var len = this._buttonList.length;
                 for (var i = 0; i < len; i++) {
-                    if (this._buttonList[i].get('id') == id) {
+                    if (this._buttonList[i].get('id') == thisID) {
                         this._buttonList[i] = null;
                     }
                 }
@@ -1470,6 +1964,27 @@ var Dom = YAHOO.util.Dom,
             return true;
         },
         /**
+        * @method collapse
+        * @description Programatically collapse the toolbar.
+        * @param {Boolean} collapse True to collapse, false to expand.
+        */
+        collapse: function(collapse) {
+            var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+            if (collapse === false) {
+                Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                if (el[0]) {
+                    Dom.removeClass(el[0], 'collapsed');
+                }
+                this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+            } else {
+                if (el[0]) {
+                    Dom.addClass(el[0], 'collapsed');
+                }
+                Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+            }
+        },
+        /**
         * @method toString
         * @description Returns a string representing the toolbar.
         * @return {String}
@@ -1510,17 +2025,11 @@ var Dom = YAHOO.util.Dom,
 * @type YAHOO.util.CustomEvent
 */
 })();
-/*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-*/
 /**
- * @module editor
  * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
  * @namespace YAHOO.widget
- * @requires yahoo, dom, element, event, toolbar, container, menu, button
- * @optional dragdrop, animation
+ * @requires yahoo, dom, element, event, toolbar
+ * @optional animation, container_core
  * @beta
  */
 
@@ -1528,106 +2037,179 @@ http://developer.yahoo.net/yui/license.txt
 var Dom = YAHOO.util.Dom,
     Event = YAHOO.util.Event,
     Lang = YAHOO.lang,
-    DD = YAHOO.util.DD,
     Toolbar = YAHOO.widget.Toolbar;
 
-
     /**
      * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
      * @constructor
-     * @class Editor
+     * @class SimpleEditor
      * @extends YAHOO.util.Element
      * @param {String/HTMLElement} el The textarea element to turn into an editor.
      * @param {Object} attrs Object liternal containing configuration parameters.
     */
     
-    YAHOO.widget.Editor = function(el, attrs) {
-        YAHOO.log('Editor Initalizing', 'info', 'Editor');
+    YAHOO.widget.SimpleEditor = function(el, attrs) {
+        YAHOO.log('SimpleEditor Initalizing', 'info', 'SimpleEditor');
+        
+        var o = {};
+        if (Lang.isObject(el) && (!el.tagName) && !attrs) {
+            Lang.augmentObject(o, el); //Break the config reference
+            el = document.createElement('textarea');
+            this.DOMReady = true;
+            if (o.container) {
+                var c = Dom.get(o.container);
+                c.appendChild(el);
+            } else {
+                document.body.appendChild(el);
+            }
+        } else {
+            Lang.augmentObject(o, attrs); //Break the config reference
+        }
 
         var oConfig = {
             element: null,
-            attributes: (attrs || {})
-        }
+            attributes: o
+        }, id = null;
 
         if (Lang.isString(el)) {
-            oConfig.attributes.textarea = Dom.get(el);
+            id = el;
+        } else {
+            if (oConfig.attributes.id) {
+                id = oConfig.attributes.id;
+            } else {
+                id = Dom.generateId(el);
+            }
         }
-        
+        oConfig.element = el;
+
         var element_cont = document.createElement('DIV');
         oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
-            id: oConfig.attributes.textarea.id + '_container'
+            id: id + '_container'
         });
-        oConfig.attributes.element_cont.setStyle('display', 'none');
-
-        oConfig.element = oConfig.attributes.textarea;
-
         var div = document.createElement('div');
+        Dom.addClass(div, 'first-child');
         oConfig.attributes.element_cont.appendChild(div);
         
         if (!oConfig.attributes.toolbar_cont) {
             oConfig.attributes.toolbar_cont = document.createElement('DIV');
-            oConfig.attributes.toolbar_cont.id = oConfig.attributes.textarea.id + '_toolbar';
+            oConfig.attributes.toolbar_cont.id = id + '_toolbar';
             div.appendChild(oConfig.attributes.toolbar_cont);
         }
-        
-        if (!oConfig.attributes.iframe) {
-            oConfig.attributes.iframe = _createIframe(oConfig.attributes.textarea.id);
-            var editorWrapper = document.createElement('DIV');
-            editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));
-            div.appendChild(editorWrapper);
-        }
-
-        Event.onDOMReady(function() {
-            this.DOMReady = true;
-            this.fireQueue();
-        }, this, true);
+        var editorWrapper = document.createElement('DIV');
+        div.appendChild(editorWrapper);
+        oConfig.attributes.editor_wrapper = editorWrapper;
 
-        YAHOO.widget.Editor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
-    }
+        YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
 
     /**
-    * @private _cleanClassName
+    * @private
+    * @method _cleanClassName
     * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
     * @param {String} str The classname to clean up
-    * @returns {String}
+    * @return {String}
     */
     function _cleanClassName(str) {
         return str.replace(/ /g, '-').toLowerCase();
     }
 
-    /**
-    * @private _createIframe
-    * @description Creates the DOM and YUI Element for the iFrame editor area.
-    * @param {String} id The string ID to prefix the iframe with
-    * @returns {Object} iFrame object
-    */
-    function _createIframe(id) {
-        var ifrmID = id + '_editor';
-        var ifrmDom = document.createElement('iframe');
-        ifrmDom.id = ifrmID;
-        var config = {
-            border: '0',
-            frameBorder: '0',
-            marginWidth: '0',
-            marginHeight: '0',
-            leftMargin: '0',
-            topMargin: '0',
-            allowTransparency: 'true',
-            width: '100%',
-            src: 'javascript:false'
-        }
-        for (var i in config) {
-            if (Lang.hasOwnProperty(config, i)) {
-                ifrmDom.setAttribute(i, config[i]);
-            }
-        }
-
-        var ifrm = new YAHOO.util.Element(ifrmDom);
-        ifrm.setStyle('zIndex', '-1');
-        return ifrm;
-    }
 
-    YAHOO.extend(YAHOO.widget.Editor, YAHOO.util.Element, {
+    YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, {
+        /**
+        * @property _docType
+        * @description The DOCTYPE to use in the editable container.
+        * @type String
+        */
+        _docType: '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',
+        /**
+        * @property editorDirty
+        * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed.
+        * @type Boolean
+        */
+        editorDirty: null,
+        /**
+        * @property _defaultCSS
+        * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' }
+        * @type String
+        */
+        _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }',
+        /**
+        * @property _defaultToolbar
+        * @private
+        * @description Default toolbar config.
+        * @type Object
+        */
+        _defaultToolbar: null,
+        /**
+        * @property _lastButton
+        * @private
+        * @description The last button pressed, so we don't disable it.
+        * @type Object
+        */
+        _lastButton: null,
+        /**
+        * @property _baseHREF
+        * @private
+        * @description The base location of the editable page (this page) so that relative paths for image work.
+        * @type String
+        */
+        _baseHREF: function() {
+            var href = document.location.href;
+            if (href.indexOf('?') !== -1) { //Remove the query string
+                href = href.substring(0, href.indexOf('?'));
+            }
+            href = href.substring(0, href.lastIndexOf('/')) + '/';
+            return href;
+        }(),
+        /**
+        * @property _lastImage
+        * @private
+        * @description Safari reference for the last image selected (for styling as selected).
+        * @type HTMLElement
+        */
+        _lastImage: null,
+        /**
+        * @property _blankImageLoaded
+        * @private
+        * @description Don't load the blank image more than once..
+        * @type Boolean
+        */
+        _blankImageLoaded: null,
+        /**
+        * @property _fixNodesTimer
+        * @private
+        * @description Holder for the fixNodes timer
+        * @type Date
+        */
+        _fixNodesTimer: null,
+        /**
+        * @property _nodeChangeTimer
+        * @private
+        * @description Holds a reference to the nodeChange setTimeout call
+        * @type Number
+        */
+        _nodeChangeTimer: null,
+        /**
+        * @property _lastNodeChangeEvent
+        * @private
+        * @description Flag to determine the last event that fired a node change
+        * @type Event
+        */
+        _lastNodeChangeEvent: null,
+        /**
+        * @property _lastNodeChange
+        * @private
+        * @description Flag to determine when the last node change was fired
+        * @type Date
+        */
+        _lastNodeChange: 0,
+        /**
+        * @property _rendered
+        * @private
+        * @description Flag to determine if editor has been rendered or not
+        * @type Boolean
+        */
+        _rendered: null,
         /**
         * @property DOMReady
         * @private
@@ -1686,7 +2268,7 @@ var Dom = YAHOO.util.Dom,
         * @description A reference to the current working element in the editor
         * @type Array
         */
-        currentElement: [],
+        currentElement: null,
         /**
         * @property dompath
         * @description A reference to the dompath container for writing the current working dom path to.
@@ -1707,7 +2289,7 @@ var Dom = YAHOO.util.Dom,
         afterElement: null,
         /**
         * @property invalidHTML
-        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine.
         * @type Object
         */
         invalidHTML: {
@@ -1718,6 +2300,7 @@ var Dom = YAHOO.util.Dom,
             link: true,
             html: true,
             body: true,
+            iframe: true,
             script: true,
             style: true,
             textarea: true
@@ -1747,7 +2330,7 @@ var Dom = YAHOO.util.Dom,
         * @description The Toolbar items that should be disabled if there is no selection present in the editor.
         * @type Array
         */
-        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent', 'outdent' ],
+        _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ],
         /**
         * @private
         * @property _alwaysDisabled
@@ -1761,7 +2344,7 @@ var Dom = YAHOO.util.Dom,
         * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
         * @type Object
         */
-        _alwaysEnabled: { hiddenelements: true },
+        _alwaysEnabled: { },
         /**
         * @private
         * @property _semantic
@@ -1781,24 +2364,97 @@ var Dom = YAHOO.util.Dom,
             'i': 'italic',
             'em': 'italic',
             'u': 'underline',
-            'blockquote': 'formatblock',
             'sup': 'superscript',
             'sub': 'subscript',
             'img': 'insertimage',
             'a' : 'createlink',
             'ul' : 'insertunorderedlist',
-            'ol' : 'insertorderedlist',
-            'indent' : 'indent',
-            'outdent' : 'outdent'
+            'ol' : 'insertorderedlist'
         },
+
         /**
-        * @private
-        * @method _getDoc
-        * @description Get the Document of the IFRAME
-        * @return {Object}
+        * @private _createIframe
+        * @description Creates the DOM and YUI Element for the iFrame editor area.
+        * @param {String} id The string ID to prefix the iframe with
+        * @return {Object} iFrame object
+        */
+        _createIframe: function() {
+            var ifrmDom = document.createElement('iframe');
+            ifrmDom.id = this.get('id') + '_editor';
+            var config = {
+                border: '0',
+                frameBorder: '0',
+                marginWidth: '0',
+                marginHeight: '0',
+                leftMargin: '0',
+                topMargin: '0',
+                allowTransparency: 'true',
+                width: '100%'
+            };
+            if (this.get('autoHeight')) {
+                config.scrolling = 'no';
+            }
+            for (var i in config) {
+                if (Lang.hasOwnProperty(config, i)) {
+                    ifrmDom.setAttribute(i, config[i]);
+                }
+            }
+            var isrc = 'javascript:;';
+            if (this.browser.ie) {
+                isrc = 'about:blank';
+            }
+            ifrmDom.setAttribute('src', isrc);
+            var ifrm = new YAHOO.util.Element(ifrmDom);
+            //ifrm.setStyle('zIndex', '-1');
+            return ifrm;
+        },
+        /**
+        * @private _isElement
+        * @description Checks to see if an Element reference is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return {Boolean}
+        */
+        _isElement: function(el, tag) {
+            if (el && el.tagName && (el.tagName.toLowerCase() == tag)) {
+                return true;
+            }
+            if (el && el.getAttribute && (el.getAttribute('tag') == tag)) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private _hasParent
+        * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return HTMLElement
+        */
+        _hasParent: function(el, tag) {
+            if (!el || !el.parentNode) {
+                return false;
+            }
+            
+            while (el.parentNode) {
+                if (this._isElement(el, tag)) {
+                    return el;
+                }
+                if (el.parentNode) {
+                    el = el.parentNode;
+                } else {
+                    return false;
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
         */
         _getDoc: function() {
-            //if (this.get && this.get('iframe') && this.get('iframe').get && this.get('iframe').get('element') && this.get('iframe').get('element').contentWindow && this.get('iframe').get('element').contentWindow.document) {
             var value = false;
             if (this.get) {
                 if (this.get('iframe')) {
@@ -1808,6 +2464,7 @@ var Dom = YAHOO.util.Dom,
                                 if (this.get('iframe').get('element').contentWindow) {
                                     if (this.get('iframe').get('element').contentWindow.document) {
                                         value = this.get('iframe').get('element').contentWindow.document;
+                                        return value;
                                     }
                                 }
                             } catch (e) {}
@@ -1815,7 +2472,7 @@ var Dom = YAHOO.util.Dom,
                     }
                 }
             }
-            return value;
+            return false;
         },
         /**
         * @private
@@ -1841,17 +2498,21 @@ var Dom = YAHOO.util.Dom,
                     * @description Can't get Safari to place the cursor at the beginning of the text..
                     * This workaround at least set's the toolbar into the proper state.
                     */
-                    this._getSelection().setBaseAndExtent(this._getDoc().body, 0, this._getDoc().body, 1);
-                    this._getSelection().collapse(false);   
+                    this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild, 0, this._getDoc().body.firstChild, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
                 } else {
                     this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
-                    this._getSelection().collapse(false);   
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
                 }
                 this._getWindow().focus();
-                //Check for.webkit3
-                if (this._getDoc().queryCommandEnabled('insertimage')) {
-                    this.browser.webkit3 = true;
-                }
             } else {
                 this._getWindow().focus();
             }
@@ -1860,13 +2521,17 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _hasSelection
         * @description Determines if there is a selection in the editor document.
-        * @returns {Boolean}
+        * @return {Boolean}
         */
         _hasSelection: function() {
             var sel = this._getSelection();
             var range = this._getRange();
             var hasSel = false;
 
+            if (!sel || !range) {
+                return hasSel;
+            }
+
             //Internet Explorer
             if (this.browser.ie || this.browser.opera) {
                 if (range.text) {
@@ -1876,8 +2541,14 @@ var Dom = YAHOO.util.Dom,
                     hasSel = true;
                 }
             } else {
-                if ((sel != '') && (sel != undefined)) {
-                    hasSel = true;
+                if (this.browser.webkit) {
+                    if (sel+'' !== '') {
+                        hasSel = true;
+                    }
+                } else {
+                    if (sel && (sel.toString() !== '') && (sel !== undefined)) {
+                        hasSel = true;
+                    }
                 }
             }
             return hasSel;
@@ -1886,7 +2557,7 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getSelection
         * @description Handles the different selection objects across the A-Grade list.
-        * @returns {Object} Selection Object
+        * @return {Object} Selection Object
         */
         _getSelection: function() {
             var _sel = null;
@@ -1899,19 +2570,18 @@ var Dom = YAHOO.util.Dom,
                 //Handle Safari's lack of Selection Object
                 if (this.browser.webkit) {
                     if (_sel.baseNode) {
-                            this._selection = new Object();
+                            this._selection = {};
                             this._selection.baseNode = _sel.baseNode;
                             this._selection.baseOffset = _sel.baseOffset;
                             this._selection.extentNode = _sel.extentNode;
                             this._selection.extentOffset = _sel.extentOffset;
-                    } else if (this._selection != null) {
+                    } else if (this._selection !== null) {
                         _sel = this._getWindow().getSelection();
                         _sel.setBaseAndExtent(
                             this._selection.baseNode,
                             this._selection.baseOffset,
                             this._selection.extentNode,
-                            this._selection.extentOffset
-                        );
+                            this._selection.extentOffset);
                         this._selection = null;
                     }
                 }
@@ -1920,14 +2590,50 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @private
+        * @method _selectNode
+        * @description Places the highlight around a given node
+        * @param {HTMLElement} node The node to select
+        */
+        _selectNode: function(node) {
+            if (!node) {
+                return false;
+            }
+            var sel = this._getSelection(),
+                range = null;
+
+            if (this.browser.ie) {
+                try { //IE freaks out here sometimes..
+                    range = this._getDoc().body.createTextRange();
+                    range.moveToElementText(node);
+                    range.select();
+                } catch (e) {
+                    YAHOO.log('IE failed to select element: ' + node.tagName, 'warn', 'SimpleEditor');
+                }
+            } else if (this.browser.webkit) {
+                               sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+            } else if (this.browser.opera) {
+                sel = this._getWindow().getSelection();
+                range = this._getDoc().createRange();
+                range.selectNode(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            } else {
+                range = this._getDoc().createRange();
+                range.selectNodeContents(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            }
+        },
+        /**
+        * @private
         * @method _getRange
         * @description Handles the different range objects across the A-Grade list.
-        * @returns {Object} Range Object
+        * @return {Object} Range Object
         */
-        _getRange: function(sel) {
+        _getRange: function() {
             var sel = this._getSelection();
 
-            if (sel == null) {
+            if (sel === null) {
                 return null;
             }
 
@@ -1943,7 +2649,11 @@ var Dom = YAHOO.util.Dom,
             }
 
             if (this.browser.ie || this.browser.opera) {
-                return sel.createRange();
+                try {
+                    return sel.createRange();
+                } catch (e) {
+                    return null;
+                }
             }
 
             if (sel.rangeCount > 0) {
@@ -1959,17 +2669,24 @@ var Dom = YAHOO.util.Dom,
         */
         _setDesignMode: function(state) {
             try {
-                this._getDoc().designMode = state;
+                var set = true;
+                //SourceForge Bug #1807057
+                if (this.browser.ie && (state.toLowerCase() == 'off')) {
+                    set = false;
+                }
+                if (set) {
+                    this._getDoc().designMode = state;
+                }
             } catch(e) { }
         },
         /**
         * @private
         * @method _toggleDesignMode
         * @description Toggles the designMode of the iFrame document on and off.
-        * @returns {String} The state that it was set to.
+        * @return {String} The state that it was set to.
         */
         _toggleDesignMode: function() {
-            var _dMode = this._getDoc().designMode,
+            var _dMode = this._getDoc().designMode.toLowerCase(),
                 _state = 'on';
             if (_dMode == 'on') {
                 _state = 'off';
@@ -1983,29 +2700,45 @@ var Dom = YAHOO.util.Dom,
         * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
         */
         _initEditor: function() {
-            YAHOO.log('editorLoaded', 'info', 'Editor');
             if (this.browser.ie) {
                 this._getDoc().body.style.margin = '0';
             }
-            this._setDesignMode('on');
+            if (!this.get('disabled')) {
+                if (this._getDoc().designMode.toLowerCase() != 'on') {
+                    this._setDesignMode('on');
+                    this._contentTimerCounter = 0;
+                }
+            }
+            if (!this._getDoc().body) {
+                YAHOO.log('Body is null, check again', 'error', 'SimpleEditor');
+                this._contentTimerCounter = 0;
+                this._checkLoaded();
+                return false;
+            }
             
+            YAHOO.log('editorLoaded', 'info', 'SimpleEditor');
             this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
             //Setup Listeners on iFrame
-            Event.addListener(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
-            Event.addListener(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
-            Event.addListener(this._getDoc(), 'click', this._handleClick, this, true);
-            Event.addListener(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
-            Event.addListener(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
-            Event.addListener(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
-            Event.addListener(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
-            this.toolbar.set('disabled', false);
+            Event.on(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.on(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.on(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.on(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.on(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.on(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.on(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            if (!this.get('disabled')) {
+                this.toolbar.set('disabled', false);
+            }
             this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
             if (this.get('dompath')) {
+                YAHOO.log('Delayed DomPath write', 'info', 'SimpleEditor');
                 var self = this;
-                window.setTimeout(function() {
+                setTimeout(function() {
                     self._writeDomPath.call(self);
                 }, 150);
             }
+            this.nodeChange(true);
+            this._setBusy(true);
         },
         /**
         * @private
@@ -2015,25 +2748,36 @@ var Dom = YAHOO.util.Dom,
         _checkLoaded: function() {
             this._contentTimerCounter++;
             if (this._contentTimer) {
-                window.clearTimeout(this._contentTimer);
+                clearTimeout(this._contentTimer);
             }
-            if (this._contentTimerCounter > 250) {
-                alert('ERROR: Body Did Not load');
+            if (this._contentTimerCounter > 500) {
+                YAHOO.log('ERROR: Body Did Not load', 'error', 'SimpleEditor');
                 return false;
             }
-            if (this._getDoc() && this._getDoc().body && (this._getDoc().body._rteLoaded == true)) {
-                //The onload event has fired, clean up after ourselves and fire the _initEditor method
-                /*
-                if (!this.browser.ie) {
-                    //IE Doesn't like this..
-                    delete this._getDoc().body._rteLoaded;
-                    this._getDoc().body.removeAttribute('onload');
+            var init = false;
+            try {
+                if (this._getDoc() && this._getDoc().body) {
+                    if (this.browser.ie) {
+                        if (this._getDoc().body.readyState == 'complete') {
+                            init = true;
+                        }
+                    } else {
+                        if (this._getDoc().body._rteLoaded === true) {
+                            init = true;
+                        }
+                    }
                 }
-                */
+            } catch (e) {
+                init = false;
+                YAHOO.log('checking body (e)' + e, 'error', 'SimpleEditor');
+            }
+
+            if (init === true) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
                 this._initEditor();
             } else {
                 var self = this;
-                this._contentTimer = window.setTimeout(function() {
+                this._contentTimer = setTimeout(function() {
                     self._checkLoaded.call(self);
                 }, 20);
             }
@@ -2044,19 +2788,40 @@ var Dom = YAHOO.util.Dom,
         * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
         */
         _setInitialContent: function() {
-            YAHOO.log('Body of editor populated with contents of the text area', 'info', 'Editor');
-            var title = this.STR_TITLE;
-            var html = this.get('html');
-            html = html.replace('{TITLE}', title);
-            html = html.replace('{CONTENT}', this.get('textarea').value);
-            html = html.replace('{CSS}', this.get('css'));
-            html = html.replace('{HIDDEN_CSS}', this.get('hiddencss'));
-
-            this._getDoc().open();
-            this._getDoc().write(html);
-            this._getDoc().close();
-            
-            this._checkLoaded();   
+            YAHOO.log('Populating editor body with contents of the text area', 'info', 'SimpleEditor');
+            var html = Lang.substitute(this.get('html'), {
+                TITLE: this.STR_TITLE,
+                CONTENT: this._cleanIncomingHTML(this.get('element').value),
+                CSS: this.get('css'),
+                HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'),
+                EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */')
+            }),
+            check = true;
+            if (document.compatMode != 'BackCompat') {
+                YAHOO.log('Adding Doctype to editable area', 'info', 'SimpleEditor');
+                html = this._docType + "\n" + html;
+            } else {
+                YAHOO.log('DocType skipped because we are in BackCompat Mode.', 'warn', 'SimpleEditor');
+            }
+
+            if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) {
+                //Firefox 1.5 doesn't like setting designMode on an document created with a data url
+                try {
+                    this._getDoc().open();
+                    this._getDoc().write(html);
+                    this._getDoc().close();
+                } catch (e) {
+                    YAHOO.log('Setting doc failed.. (_setInitialContent)', 'error', 'SimpleEditor');
+                    //Safari will only be here if we are hidden
+                    check = false;
+                }
+            } else {
+                //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality
+                this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html);
+            }
+            if (check) {
+                this._checkLoaded();
+            }
         },
         /**
         * @private
@@ -2073,6 +2838,7 @@ var Dom = YAHOO.util.Dom,
                     this._setEditorStyle(false);
                     break;
                 case 'semantic':
+                case 'xhtml':
                     if (this._semantic[action]) {
                         this._setEditorStyle(false);
                     } else {
@@ -2095,26 +2861,34 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getSelectedElement
         * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
-        * @returns {HTMLElement} The currently selected element.
+        * @return {HTMLElement} The currently selected element.
         */
         _getSelectedElement: function() {
-            var doc = this._getDoc();
+            var doc = this._getDoc(),
+                range = null,
+                sel = null,
+                elm = null;
+
             if (this.browser.ie) {
-                var range = this._getRange(), elm = null;
+                this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event;
+                range = this._getRange();
                 if (range) {
                     elm = range.item ? range.item(0) : range.parentElement();
                     if (elm == doc.body) {
                         elm = null;
                     }
                 }
+                if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
             } else {
-                var sel = this._getSelection(),
-                    range = this._getRange(),
-                    elm = null;
+                sel = this._getSelection();
+                range = this._getRange();
+
                 if (!sel || !range) {
                     return null;
                 }
-                if (sel != '') {
+                if (!this._hasSelection()) {
                     if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
                         if (sel.anchorNode.parentNode) { //next check parentNode
                             elm = sel.anchorNode.parentNode;
@@ -2123,11 +2897,9 @@ var Dom = YAHOO.util.Dom,
                             elm = sel.anchorNode.nextSibling;
                         }
                     }
-                    
-                    if (elm && elm.tagName && (elm.tagName.toLowerCase() == 'br')) {
+                    if (this._isElement(elm, 'br')) {
                         elm = null;
                     }
-                
                     if (!elm) {
                         elm = range.commonAncestorContainer;
                         if (!range.collapsed) {
@@ -2140,67 +2912,79 @@ var Dom = YAHOO.util.Dom,
                             }
                         }
                     }
-                    //Safari Fix
-                    if (!elm) {
-                        if (this.currentEvent) {
-                            //elm = Event.getTarget(this.currentEvent);
-                        }
-                    }
                 }
             }
-            if (!elm && (this.currentElement[0] || this.currentEvent)) {
-                if (this.currentEvent && (this.currentEvent.keyCode == undefined) && Event.getTarget(this.currentEvent)) {
-                    elm = Event.getTarget(this.currentEvent);
-                } else if (this.currentEvent && (this.currentEvent.keyCode != undefined) && Event.getTarget(this.currentEvent)) {
-                } else {
-                    elm = this.currentElement[0];
+            if (this.currentEvent !== null) {
+                try {
+                    switch (this.currentEvent.type) {
+                        case 'click':
+                        case 'mousedown':
+                        case 'mouseup':
+                            elm = Event.getTarget(this.currentEvent);
+                            break;
+                        default:
+                            //Do nothing
+                            break;
+                    }
+                } catch (e) {
+                    YAHOO.log('Firefox 1.5 errors here: ' + e, 'error', 'SimpleEditor');
                 }
-            } else if ((elm == this._getDoc().body) && this.currentElement[0] && !this._hasSelection()) {
+            } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) {
                 elm = this.currentElement[0];
             }
-
             if (this.browser.opera || this.browser.webkit) {
                 if (this.currentEvent && !elm) {
-                    elm = Event.getTarget(this.currentEvent);
+                    elm = YAHOO.util.Event.getTarget(this.currentEvent);
                 }
             }
-
             if (!elm || !elm.tagName) {
                 elm = doc.body;
             }
-            if (elm && elm.tagName && elm.tagName.toLowerCase() == 'html') {
+            if (this._isElement(elm, 'html')) {
                 //Safari sometimes gives us the HTML node back..
                 elm = doc.body;
             }
-            
+            if (this._isElement(elm, 'body')) {
+                //make sure that body means this body not the parent..
+                elm = doc.body;
+            }
+            if (elm && !elm.parentNode) { //Not in document
+                elm = doc.body;
+            }
+            if (elm === undefined) {
+                elm = null;
+            }
             return elm;
         },
         /**
         * @private
         * @method _getDomPath
         * @description This method will attempt to build the DOM path from the currently selected element.
-        * @returns {Array} An array of node references that will create the DOM Path.
+        * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used
+        * @return {Array} An array of node references that will create the DOM Path.
         */
-        _getDomPath: function() {
-                       var el = this._getSelectedElement();
+        _getDomPath: function(el) {
+            if (!el) {
+                           el = this._getSelectedElement();
+            }
                        var domPath = [];
-                       
-                       while (el!= null) {
+            while (el !== null) {
                 if (el.ownerDocument != this._getDoc()) {
-                    return false;
+                    el = null;
+                    break;
                 }
                 //Check to see if we get el.nodeName and nodeType
-                if (el.nodeName && (el.nodeType == 1)) {
+                if (el.nodeName && el.nodeType && (el.nodeType == 1)) {
                     domPath[domPath.length] = el;
                 }
 
-                if (el.nodeName.toUpperCase() == "BODY") {
-                                   break;
+                if (this._isElement(el, 'body')) {
+                    break;
                 }
 
-                               el = el.parentNode;
-                       }
-            if (domPath.length == 0) {
+                el = el.parentNode;
+            }
+            if (domPath.length === 0) {
                 if (this._getDoc() && this._getDoc().body) {
                     domPath[0] = this._getDoc().body;
                 }
@@ -2214,7 +2998,9 @@ var Dom = YAHOO.util.Dom,
         */
         _writeDomPath: function() { 
             var path = this._getDomPath(),
-                pathArr = [];
+                pathArr = [],
+                classPath = '',
+                pathStr = '';
             for (var i = 0; i < path.length; i++) {
                 var tag = path[i].tagName.toLowerCase();
                 if ((tag == 'ol') && (path[i].type)) {
@@ -2223,7 +3009,7 @@ var Dom = YAHOO.util.Dom,
                 if (Dom.hasClass(path[i], 'yui-tag')) {
                     tag = path[i].getAttribute('tag');
                 }
-                if ((this.get('markup') == 'semantic')) {
+                if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) {
                     switch (tag) {
                         case 'b': tag = 'strong'; break;
                         case 'i': tag = 'em'; break;
@@ -2231,21 +3017,37 @@ var Dom = YAHOO.util.Dom,
                 }
                 if (!Dom.hasClass(path[i], 'yui-non')) {
                     if (Dom.hasClass(path[i], 'yui-tag')) {
-                        var pathStr = tag;
-                        if (tag == 'a') {
-                            if (path[i].getAttribute('href')) {
-                                pathStr += ':' + path[i].getAttribute('href').replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
-                            }
-                        }
+                        pathStr = tag;
                     } else {
-                        var classPath = ((path[i].className != '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : '');
                         if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
                             classPath = '';
                         }
-                        var pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                        pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
                     }
+                    switch (tag) {
+                        case 'a':
+                            if (path[i].getAttribute('href', 2)) {
+                                pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                            break;
+                        case 'img':
+                            var h = path[i].height;
+                            var w = path[i].width;
+                            if (path[i].style.height) {
+                                h = parseInt(path[i].style.height, 10);
+                            }
+                            if (path[i].style.width) {
+                                w = parseInt(path[i].style.width, 10);
+                            }
+                            pathStr += '(' + h + 'x' + w + ')';
+                        break;
+                    }
+
                     if (pathStr.length > 10) {
-                        pathStr = pathStr.substring(0, 10) + '...';
+                        pathStr = '<span title="' + pathStr + '">' + pathStr.substring(0, 10) + '...' + '</span>';
+                    } else {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr + '</span>';
                     }
                     pathArr[pathArr.length] = pathStr;
                 }
@@ -2262,76 +3064,74 @@ var Dom = YAHOO.util.Dom,
         * @description Fix href and imgs as well as remove invalid HTML.
         */
         _fixNodes: function() {
-            for (var i in this.invalidHTML) {
-                if (Lang.hasOwnProperty(this.invalidHTML, i)) {
-                    var tags = this._getDoc().body.getElementsByTagName(i);
-                    for (var h = 0; h < tags.length; h++) {
-                        if (tags[h].parentNode) {
-                            tags[h].parentNode.removeChild(tags[h]);
+            var doc = this._getDoc(),
+                els = [];
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (v.toLowerCase() != 'span') {
+                        var tags = doc.body.getElementsByTagName(v);
+                        if (tags.length) {
+                            for (var i = 0; i < tags.length; i++) {
+                                els.push(tags[i]);
+                            }
                         }
                     }
                 }
             }
-            var as = this._getDoc().body.getElementsByTagName('a');
-            if (as.length) {
-                YAHOO.log('Found an A tag in the document, converting to span holder', 'info', 'Editor');
-                for (var i = 0; i < as.length; i++) {
-                    var el = this._getDoc().createElement('span');
-                    Dom.addClass(el, 'yui-tag-a');
-                    Dom.addClass(el, 'yui-tag');
-                    el.innerHTML = as[i].innerHTML;
-                    el.setAttribute('tag', 'a');
-                    el.setAttribute('href', as[i].getAttribute('href'));
-                    if (as[i].getAttribute('target') != null) {
-                        el.setAttribute('target', as[i].getAttribute('target'));
-                    }
-                    as[i].parentNode.replaceChild(el, as[i]);
-                    as[i] = null;
-                }
-            }
-            var imgs = this._getDoc().getElementsByTagName('img');
-            Dom.addClass(imgs, 'yui-img');
-
-            for (var i = 0; i < imgs.length; i++) {
-                if (imgs[i].getAttribute('href', 2)) {
-                    var url = imgs[i].getAttribute('src', 2);
-                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                        Dom.addClass(imgs[i], this.CLASS_LOCAL_FILE);
-                    } else {
-                        Dom.removeClass(imgs[i], this.CLASS_LOCAL_FILE);
-                    }
-                }
-            }
-
-            var fakeAs = this._getDoc().body.getElementsByTagName('span');
-            for (var i = 0; i < fakeAs.length; i++) {
-                if (fakeAs[i].getAttribute('href', 2)) {
-                    var url = fakeAs[i].getAttribute('href', 2);
-                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                        Dom.addClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+            for (var h = 0; h < els.length; h++) {
+                if (els[h].parentNode) {
+                    if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) {
+                        this._swapEl(els[h], 'span', function(el) {
+                            el.className = 'yui-non';
+                        });
                     } else {
-                        Dom.removeClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                        els[h].parentNode.removeChild(els[h]);
                     }
                 }
             }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');   
         },
         /**
         * @private
-        * @method _showHidden
-        * @description Toggle on/off the hidden.css file.
-        */
-        _showHidden: function() {
-            if (this._showingHiddenElements) {
-                YAHOO.log('Enabling hidden CSS File', 'info', 'Editor');
-                this._showingHiddenElements = false;
-                this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));
-                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
-            } else {
-                YAHOO.log('Disabling hidden CSS File', 'info', 'Editor');
-                this._showingHiddenElements = true;
-                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
-                this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));
+        * @method _isNonEditable
+        * @param Event ev The Dom event being checked
+        * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied.
+        * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also
+        * disable and enable the Editor's toolbar based on the noedit state.
+        * @return Boolean
+        */
+        _isNonEditable: function(ev) {
+            if (this.get('allowNoEdit')) {
+                var el = Event.getTarget(ev);
+                if (this._isElement(el, 'html')) {
+                    el = null;
+                }
+                var path = this._getDomPath(el);
+                for (var i = (path.length - 1); i > -1; i--) {
+                    if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) {
+                        //if (this.toolbar.get('disabled') === false) {
+                        //    this.toolbar.set('disabled', true);
+                        //}
+                        try {
+                             this._getDoc().execCommand('enableObjectResizing', false, 'false');
+                        } catch (e) {}
+                        this.nodeChange();
+                        Event.stopEvent(ev);
+                        YAHOO.log('CLASS_NOEDIT found in DOM Path, stopping event', 'info', 'SimpleEditor');
+                        return true;
+                    }
+                }
+                //if (this.toolbar.get('disabled') === true) {
+                    //Should only happen once..
+                    //this.toolbar.set('disabled', false);
+                    try {
+                         this._getDoc().execCommand('enableObjectResizing', false, 'true');
+                    } catch (e) {}
+                //}
             }
+            return false;
         },
         /**
         * @private
@@ -2340,9 +3140,6 @@ var Dom = YAHOO.util.Dom,
         * @description Sets the current event property
         */
         _setCurrentEvent: function(ev) {
-            if (ev && ev.type) {
-                YAHOO.log('Event: ' + ev.type, 'info', 'Editor');
-            }
             this.currentEvent = ev;
         },
         /**
@@ -2352,11 +3149,23 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all click events inside the iFrame document.
         */
         _handleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             if (this.currentWindow) {
                 this.closeWindow();
             }
-            if (!this.browser.webkit) {
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this.browser.webkit) {
+                var tar =Event.getTarget(ev);
+                if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) {
+                    Event.stopEvent(ev);
+                    this.nodeChange();
+                }
+            } else {
                 this.nodeChange();
             }
         },
@@ -2367,7 +3176,13 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all mouseup events inside the iFrame document.
         */
         _handleMouseUp: function(ev) {
-            this._setCurrentEvent(ev);
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            //Don't set current event for mouseup.
+            //It get's fired after a menu is closed and gives up a bogus event to work with
+            //this._setCurrentEvent(ev);
+            var self = this;
             if (this.browser.opera) {
                 /**
                 * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
@@ -2375,9 +3190,8 @@ var Dom = YAHOO.util.Dom,
                 * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
                 */
                 var sel = Event.getTarget(ev);
-                if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                if (this._isElement(sel, 'img')) {
                     this.nodeChange();
-                    var self = this;
                     if (this.operaEvent) {
                         clearTimeout(this.operaEvent);
                         this.operaEvent = null;
@@ -2385,7 +3199,7 @@ var Dom = YAHOO.util.Dom,
                     } else {
                         this.operaEvent = window.setTimeout(function() {
                             self.operaEvent = false;
-                        }, 200);
+                        }, 700);
                     }
                 }
             }
@@ -2394,7 +3208,7 @@ var Dom = YAHOO.util.Dom,
                 if (this.browser.webkit) {
                     Event.stopEvent(ev);
                 }
-            }            
+            }
             this.nodeChange();
             this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
         },
@@ -2405,15 +3219,33 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all mousedown events inside the iFrame document.
         */
         _handleMouseDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             var sel = Event.getTarget(ev);
-            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+            if (this.browser.webkit && this._hasSelection()) {
+                var _sel = this._getSelection();
+                if (!this.browser.webkit3) {
+                    _sel.collapse(true);
+                } else {
+                    _sel.collapseToStart();
+                }
+            }
+            if (this.browser.webkit && this._lastImage) {
+                Dom.removeClass(this._lastImage, 'selected');
+                this._lastImage = null;
+            }
+            if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) {
                 if (this.browser.webkit) {
-                    this.nodeChange();
                     Event.stopEvent(ev);
+                    if (this._isElement(sel, 'img')) {
+                        Dom.addClass(sel, 'selected');
+                        this._lastImage = sel;
+                    }
                 }
+                this.nodeChange();
             }
-            //this.nodeChange();
             this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
         },
         /**
@@ -2423,18 +3255,22 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all doubleclick events inside the iFrame document.
         */
         _handleDoubleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             var sel = Event.getTarget(ev);
-            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+            if (this._isElement(sel, 'img')) {
                 this.currentElement[0] = sel;
                 this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
                 this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-            } else if (sel && sel.getAttribute && sel.getAttribute('tag') && (sel.getAttribute('tag').toLowerCase() == 'a')) {
-                this.currentElement[0] = sel;
+            } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a
+                this.currentElement[0] = this._hasParent(sel, 'a');
                 this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
                 this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
             }
             this.nodeChange();
+            this.editorDirty = false;
             this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
         },
         /**
@@ -2444,6 +3280,9 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all keyup events inside the iFrame document.
         */
         _handleKeyUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             switch (ev.keyCode) {
                 case 37: //Left Arrow
@@ -2452,12 +3291,24 @@ var Dom = YAHOO.util.Dom,
                 case 40: //Down Arrow
                 case 46: //Forward Delete
                 case 8: //Delete
-                case 65: //The letter a (for ctrl + a and cmd + a)
-                case 27: //Escape key if window is open
-                    if ((ev.keyCode == 27) && this.currentWindow) {
+                case 87: //W key if window is open
+                    if ((ev.keyCode == 87) && this.currentWindow && ev.shiftKey && ev.ctrlKey) {
                         this.closeWindow();
+                    } else {
+                        if (!this.browser.ie) {
+                            if (this._nodeChangeTimer) {
+                                clearTimeout(this._nodeChangeTimer);
+                            }
+                            var self = this;
+                            this._nodeChangeTimer = setTimeout(function() {
+                                self._nodeChangeTimer = null;
+                                self.nodeChange.call(self);
+                            }, 100);
+                        } else {
+                            this.nodeChange();
+                        }
+                        this.editorDirty = true;
                     }
-                    this.nodeChange();
                     break;
             }
             this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
@@ -2469,56 +3320,237 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all keypress events inside the iFrame document.
         */
         _handleKeyPress: function(ev) {
+            if (this.get('allowNoEdit')) {
+                if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) {
+                    //Forward delete key
+                    YAHOO.log('allowNoEdit is set, forward delete key has been disabled', 'warn', 'SimpleEditor');
+                    Event.stopEvent(ev);
+                }
+            }
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
+            if (this.browser.webkit) {
+                if (!this.browser.webkit3) {
+                    if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) {
+                        //This is CMD + z (for undo)
+                        if (this._hasParent(this._getSelectedElement(), 'li')) {
+                            YAHOO.log('We are in an LI and we found CMD + z, stopping the event', 'warn', 'SimpleEditor');
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+                /* This was removed because it crashes Safari 2.x in some cases
+                if (ev.keyCode && (ev.keyCode == 8)) {
+                    //Delete Key
+                    if (this._isElement(this._getSelectedElement(), 'br')) {
+                        var el = this._getSelectedElement();
+                        el.parentNode.removeChild(el);
+                    }
+                }
+                */
+                this._listFix(ev);
+            }
             this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
         },
         /**
         * @private
-        * @method _handleKeyDown
+        * @method _listFix
         * @param {Event} ev The event we are working on.
-        * @description Handles all keydown events inside the iFrame document.
+        * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items.
         */
-        _handleKeyDown: function(ev) {
-            this._setCurrentEvent(ev);
-            if (this.currentWindow) {
-                this.closeWindow();
-            }
-            var doExec = false;
-            var action = null;
-            //if (ev.ctrlKey) {
-            if (ev.shiftKey && ev.ctrlKey) {
-                doExec = true;
-            }
-            switch (ev.keyCode) {
-                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
-                    if (ev.shiftKey && ev.ctrlKey) {
-                        this.toolbar._titlebar.firstChild.focus();
+        _listFix: function(ev) {
+            //YAHOO.log('Lists Fix (' + ev.keyCode + ')', 'info', 'SimpleEditor');
+            var testLi = null, par = null, preContent = false, range = null;
+            //Enter Key
+            if (this.browser.webkit) {
+                if (ev.keyCode && (ev.keyCode == 13)) {
+                    if (this._hasParent(this._getSelectedElement(), 'li')) {
+                        var tar = this._hasParent(this._getSelectedElement(), 'li');
+                        var li = this._getDoc().createElement('li');
+                        li.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        if (tar.nextSibling) {
+                            tar.parentNode.insertBefore(li, tar.nextSibling);
+                        } else {
+                            tar.parentNode.appendChild(li);
+                        }
+                        this.currentElement[0] = li;
+                        this._selectNode(li.firstChild);
+                        if (!this.browser.webkit3) {
+                            tar.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                tar.parentNode.style.display = 'block';
+                            }, 1);
+                        }
                         Event.stopEvent(ev);
-                        doExec = false;
                     }
-                    break;
-                case 27: //Focus After Element - Ctrl + Shift + Esc
-                    if (ev.shiftKey) {
-                        this.afterElement.focus();
-                        Event.stopEvent(ev);
-                        exec = false;
+                }
+            }
+            //Shift + Tab Key
+            if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) {
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    testLi = this._hasParent(testLi, 'li');
+                    YAHOO.log('We have a SHIFT tab in an LI, reverse it..', 'info', 'SimpleEditor');
+                    if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) {
+                        YAHOO.log('We have a double parent, move up a level', 'info', 'SimpleEditor');
+                        par = this._hasParent(testLi, 'ul');
+                        if (!par) {
+                            par = this._hasParent(testLi, 'ol');
+                        }
+                        //YAHOO.log(par.previousSibling + ' :: ' + par.previousSibling.innerHTML);
+                        if (this._isElement(par.previousSibling, 'li')) {
+                            par.removeChild(testLi);
+                            par.parentNode.insertBefore(testLi, par.nextSibling);
+                            if (this.browser.ie) {
+                                range = this._getDoc().body.createTextRange();
+                                range.moveToElementText(testLi);
+                                range.collapse(false);
+                                range.select();
+                            }
+                            if (this.browser.webkit) {
+                                if (!this.browser.webkit3) {
+                                    par.style.display = 'list-item';
+                                    par.parentNode.style.display = 'list-item';
+                                    setTimeout(function() {
+                                        par.style.display = 'block';
+                                        par.parentNode.style.display = 'block';
+                                    }, 1);
+                                }
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+            }
+            //Tab Key
+            if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) {
+                YAHOO.log('List Fix - Tab', 'info', 'SimpleEditor');
+                var preLi = this._getSelectedElement();
+                if (this._hasParent(preLi, 'li')) {
+                    preContent = this._hasParent(preLi, 'li').innerHTML;
+                }
+                //YAHOO.log('preLI: ' + preLi.tagName + ' :: ' + preLi.innerHTML);
+                if (this.browser.webkit) {
+                    this._getDoc().execCommand('inserttext', false, '\t');
+                }
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    YAHOO.log('We have a tab in an LI', 'info', 'SimpleEditor');
+                    par = this._hasParent(testLi, 'li');
+                    YAHOO.log('parLI: ' + par.tagName + ' :: ' + par.innerHTML);
+                    var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase());
+                    if (this.browser.webkit) {
+                        var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par);
+                        //Remove the span element that Safari puts in
+                        if (span[0]) {
+                            par.removeChild(span[0]);
+                            par.innerHTML = Lang.trim(par.innerHTML);
+                            //Put the HTML from the LI into this new LI
+                            if (preContent) {
+                                par.innerHTML = '<span class="yui-non">' + preContent + '</span>&nbsp;';
+                            } else {
+                                par.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                            }
+                        }
+                    } else {
+                        if (preContent) {
+                            par.innerHTML = preContent + '&nbsp;';
+                        } else {
+                            par.innerHTML = '&nbsp;';
+                        }
+                    }
+
+                    par.parentNode.replaceChild(newUl, par);
+                    newUl.appendChild(par);
+                    if (this.browser.webkit) {
+                        this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length);
+                        if (!this.browser.webkit3) {
+                            par.parentNode.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                par.parentNode.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                    } else if (this.browser.ie) {
+                        range = this._getDoc().body.createTextRange();
+                        range.moveToElementText(par);
+                        range.collapse(false);
+                        range.select();
+                    } else {
+                        this._selectNode(par);
+                    }
+                    Event.stopEvent(ev);
+                }
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
                     }
                     break;
-                case 219: //Left
-                    action = 'justifyleft';
-                    break;
-                case 220: //Center
-                    action = 'justifycenter';
-                    break;
-                case 221: //Right
-                    action = 'justifyright';
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
                     break;
                 case 76: //L
                     if (this._hasSelection()) {
-                        this.execCommand('createlink', '');
-                        this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
-                        this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-                        doExec = false;
+                        if (ev.shiftKey && ev.ctrlKey) {
+                            var makeLink = true;
+                            if (this.get('limitCommands')) {
+                                if (!this.toolbar.getButtonByValue('createlink')) {
+                                    YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor');
+                                    makeLink = false;
+                                }
+                            }
+                            if (makeLink) {
+                                this.execCommand('createlink', '');
+                                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                                doExec = false;
+                            }
+                        }
+                    }
+                    break;
+                case 65:
+                    if (ev.metaKey && this.browser.webkit) {
+                        Event.stopEvent(ev);
+                        //Override Safari's select all and select the contents of the editor not the iframe as Safari would by default.
+                        this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, this._getDoc().body.innerHTML.length);
                     }
                     break;
                 case 66: //B
@@ -2530,18 +3562,12 @@ var Dom = YAHOO.util.Dom,
                 case 85: //U
                     action = 'underline';
                     break;
-                case 9: //Tab Key
-                    if (this.browser.safari) {
-                        this._getDoc().execCommand('inserttext', false, '\t');
-                        Event.stopEvent(ev);
-                    }
-                    break;
                 case 13:
                     if (this.browser.ie) {
                         //Insert a <br> instead of a <p></p> in Internet Explorer
                         var _range = this._getRange();
                         var tar = this._getSelectedElement();
-                        if (tar && tar.tagName && (tar.tagName.toLowerCase() != 'li')) {
+                        if (!this._isElement(tar, 'li')) {
                             if (_range) {
                                 _range.pasteHTML('<br>');
                                 _range.collapse(false);
@@ -2551,6 +3577,10 @@ var Dom = YAHOO.util.Dom,
                         }
                     }
             }
+            //if (!this.browser.gecko && !this.browser.webkit) {
+            if (this.browser.ie) {
+                this._listFix(ev);
+            }
             if (doExec && action) {
                 this.execCommand(action, null);
                 Event.stopEvent(ev);
@@ -2560,12 +3590,34 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @method nodeChange
+        * @param {Boolean} force Optional paramenter to skip the threshold counter
         * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
         */
-        nodeChange: function() {
-            this._fixNodes();
+        nodeChange: function(force) {
+            var threshold = parseInt(this.get('nodeChangeThreshold'), 10);
+            var thisNodeChange = Math.round(new Date().getTime() / 1000);
+            if (force === true) {
+                this._lastNodeChange = 0;
+            }
+            
+            if ((this._lastNodeChange + threshold) < thisNodeChange) {
+                var self = this;
+                if (this._fixNodesTimer === null) {
+                    this._fixNodesTimer = window.setTimeout(function() {
+                        self._fixNodes.call(self);
+                        self._fixNodesTimer = null;
+                    }, 0);
+                }
+            }
+            this._lastNodeChange = thisNodeChange;
+            if (this.currentEvent) {
+                this._lastNodeChangeEvent = this.currentEvent.type;
+            }
 
-            this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (beforeNodeChange === false) {
+                return false;
+            }
             if (this.get('dompath')) {
                 this._writeDomPath();
             }
@@ -2576,66 +3628,87 @@ var Dom = YAHOO.util.Dom,
                     this.STOP_NODE_CHANGE = false;
                     return false;
                 } else {
-                    var sel = this._getSelection();
-                    var range = this._getRange();
+                    var sel = this._getSelection(),
+                        range = this._getRange(),
+                        el = this._getSelectedElement(),
+                        fn_button = this.toolbar.getButtonByValue('fontname'),
+                        fs_button = this.toolbar.getButtonByValue('fontsize');
+
+                    if (force !== true) {
+                        this.editorDirty = true;
+                    }
+
+                    //Handle updating the toolbar with active buttons
+                    var _ex = {};
+                    if (this._lastButton) {
+                        _ex[this._lastButton.id] = true;
+                    }
+                    if (!this._isElement(el, 'body')) {
+                        if (fn_button) {
+                            _ex[fn_button.get('id')] = true;
+                        }
+                        if (fs_button) {
+                            _ex[fs_button.get('id')] = true;
+                        }
+                    }
+                    this.toolbar.resetAllButtons(_ex);
 
                     //Handle disabled buttons
-                    for (var i = 0; i < this._disabled.length; i++) {
-                        var _button = this.toolbar.getButtonByValue(this._disabled[i]);
+                    for (var d = 0; d < this._disabled.length; d++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[d]);
                         if (_button && _button.get) {
-                            if (!this._hasSelection()) {
-                                //No Selection - disable
-                                this.toolbar.disableButton(_button.get('id'));
+                            if (this._lastButton && (_button.get('id') === this._lastButton.id)) {
+                                //Skip
                             } else {
-                                if (!this._alwaysDisabled[this._disabled[i]]) {
-                                    this.toolbar.enableButton(_button.get('id'));
+                                if (!this._hasSelection()) {
+                                    switch (this._disabled[d]) {
+                                        case 'fontname':
+                                        case 'fontsize':
+                                            break;
+                                        default:
+                                            //No Selection - disable
+                                            this.toolbar.disableButton(_button);
+                                    }
+                                } else {
+                                    if (!this._alwaysDisabled[this._disabled[d]]) {
+                                        this.toolbar.enableButton(_button);
+                                    }
+                                }
+                                if (!this._alwaysEnabled[this._disabled[d]]) {
+                                    this.toolbar.deselectButton(_button);
                                 }
                             }
-                            if (!this._alwaysEnabled[this._disabled[i]]) {
-                                this.toolbar.deselectButton(_button);
-                            }
-                        }
-                    }
-                    //Handle updating the toolbar with active buttons
-                    for (var i = 0; i < this.toolbar._buttonList.length; i++) {
-                        if (!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]) {
-                            this.toolbar.deselectButton(this.toolbar._buttonList[i]);
                         }
                     }
                     var path = this._getDomPath();
-                    var olType = null;
+                    var tag = null, cmd = null;
                     for (var i = 0; i < path.length; i++) {
-                        var tag = path[i].tagName.toLowerCase();
+                        tag = path[i].tagName.toLowerCase();
                         if (path[i].getAttribute('tag')) {
-                            var tag = path[i].getAttribute('tag').toLowerCase();
+                            tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        cmd = this._tag2cmd[tag];
+                        if (cmd === undefined) {
+                            cmd = [];
+                        }
+                        if (!Lang.isArray(cmd)) {
+                            cmd = [cmd];
                         }
-                        var cmd = this._tag2cmd[tag];
 
                         //Bold and Italic styles
                         if (path[i].style.fontWeight.toLowerCase() == 'bold') {
-                            cmd = 'bold';
+                            cmd[cmd.length] = 'bold';
                         }
                         if (path[i].style.fontStyle.toLowerCase() == 'italic') {
-                            cmd = 'italic';
+                            cmd[cmd.length] = 'italic';
                         }
                         if (path[i].style.textDecoration.toLowerCase() == 'underline') {
-                            cmd = 'underline';
-                        }
-                        if (tag == 'ol') {
-                            if (path[i].type) {
-                                olType = path[i].type;
-                            } else {
-                                olType = 'A';
-                            }
+                            cmd[cmd.length] = 'underline';
                         }
-                        if (cmd) {
-                            if (!Lang.isArray(cmd)) {
-                                cmd = [cmd];
-                            }
+                        if (cmd.length > 0) {
                             for (var j = 0; j < cmd.length; j++) {
-                                var button = this.toolbar.getButtonByValue(cmd[j]);
-                                this.toolbar.selectButton(button);
-                                this.toolbar.enableButton(button);
+                                this.toolbar.selectButton(cmd[j]);
+                                this.toolbar.enableButton(cmd[j]);
                             }
                         }
                         //Handle Alignment
@@ -2648,25 +3721,20 @@ var Dom = YAHOO.util.Dom,
                                 if (path[i].style.textAlign.toLowerCase() == 'justify') {
                                     alignType = 'full';
                                 }
-                                var button = this.toolbar.getButtonByValue('justify' + alignType);
-                                this.toolbar.selectButton(button);
-                                this.toolbar.enableButton(button);
+                                this.toolbar.selectButton('justify' + alignType);
+                                this.toolbar.enableButton('justify' + alignType);
                                 break;
                         }
-                        //Handle Ordered List Drop Down - it will reset if olType is null
-                        //this._updateMenuChecked('insertorderedlist', olType);
                     }
                     //After for loop
 
                     //Reset Font Family and Size to the inital configs
-                    var fn_button = this.toolbar.getButtonByValue('fontname');
                     if (fn_button) {
                         var family = fn_button._configs.label._initialConfig.value;
                         fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
                         this._updateMenuChecked('fontname', family);
                     }
 
-                    var fs_button = this.toolbar.getButtonByValue('fontsize');
                     if (fs_button) {
                         fs_button.set('label', fs_button._configs.label._initialConfig.value);
                     }
@@ -2676,6 +3744,10 @@ var Dom = YAHOO.util.Dom,
                         hd_button.set('label', hd_button._configs.label._initialConfig.value);
                         this._updateMenuChecked('heading', 'none');
                     }
+                    var img_button = this.toolbar.getButtonByValue('insertimage');
+                    if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) {
+                        this.toolbar.disableButton(img_button);
+                    }
                 }
             }
 
@@ -2694,17 +3766,7 @@ var Dom = YAHOO.util.Dom,
                 tbar = this.toolbar;
             }
             var _button = tbar.getButtonByValue(button);
-            var _menuItems = _button.getMenu().getItems();
-            if (_menuItems.length == 0) {
-                _button.getMenu()._onBeforeShow();
-                _menuItems = _button.getMenu().getItems();
-            }
-            for (var i = 0; i < _menuItems.length; i++) {
-                _menuItems[i].cfg.setProperty('checked', false);
-                if (_menuItems[i].value == value) {
-                    _menuItems[i].cfg.setProperty('checked', true);
-                }
-            }
+            _button.checkValue(value);
         },
         /**
         * @private
@@ -2720,13 +3782,20 @@ var Dom = YAHOO.util.Dom,
                 value = cmd;
                 cmd = ev.button.menucmd;
             }
+            this._lastButton = ev.button;
             if (this.STOP_EXEC_COMMAND) {
-                YAHOO.log('execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true', 'warn', 'Editor');
-                YAHOO.log('NOEXEC::execCommand::(' + cmd + '), (' + value + ')', 'warn', 'Editor');
+                YAHOO.log('execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true', 'warn', 'SimpleEditor');
+                YAHOO.log('NOEXEC::execCommand::(' + cmd + '), (' + value + ')', 'warn', 'SimpleEditor');
                 this.STOP_EXEC_COMMAND = false;
                 return false;
             } else {
                 this.execCommand(cmd, value);
+                if (!this.browser.webkit) {
+                     var self = this;
+                     setTimeout(function() {
+                         self._focusWindow.call(self);
+                     }, 5);
+                 }
             }
             Event.stopEvent(ev);
         },
@@ -2736,6 +3805,13 @@ var Dom = YAHOO.util.Dom,
         * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
         */
         _setupAfterElement: function() {
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
             if (!this.afterElement) {
                 this.afterElement = document.createElement('h2');
                 this.afterElement.className = 'yui-editor-skipheader';
@@ -2745,6 +3821,47 @@ var Dom = YAHOO.util.Dom,
             }
         },
         /**
+        * @private
+        * @method _disableEditor
+        * @param {Boolean} disabled Pass true to disable, false to enable
+        * @description Creates a mask to place over the Editor.
+        */
+        _disableEditor: function(disabled) {
+            if (disabled) {
+                if (!this._mask) {
+                    if (!!this.browser.ie) {
+                        this._setDesignMode('off');
+                    }
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', true);
+                    }
+                    this._mask = document.createElement('DIV');
+                    Dom.setStyle(this._mask, 'height', '100%');
+                    Dom.setStyle(this._mask, 'width', '100%');
+                    Dom.setStyle(this._mask, 'position', 'absolute');
+                    Dom.setStyle(this._mask, 'top', '0');
+                    Dom.setStyle(this._mask, 'left', '0');
+                    Dom.setStyle(this._mask, 'opacity', '.5');
+                    Dom.addClass(this._mask, 'yui-editor-masked');
+                    this.get('iframe').get('parentNode').appendChild(this._mask);
+                }
+            } else {
+                if (this._mask) {
+                    this._mask.parentNode.removeChild(this._mask);
+                    this._mask = null;
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', false);
+                    }
+                    this._setDesignMode('on');
+                    this._focusWindow();
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.nodeChange.call(self);
+                    }, 100);
+                }
+            }
+        },
+        /**
         * @property EDITOR_PANEL_ID
         * @description HTML id to give the properties window in the DOM.
         * @type String
@@ -2767,19 +3884,7 @@ var Dom = YAHOO.util.Dom,
         * @description The accessibility string for the element before the iFrame
         * @type String
         */
-        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',
-        /**
-        * @property STR_CLOSE_WINDOW
-        * @description The Title of the close button in the Editor Window
-        * @type String
-        */
-        STR_CLOSE_WINDOW: 'Close Window',
-        /**
-        * @property STR_CLOSE_WINDOW_NOTE
-        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
-        * @type String
-        */
-        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Escape key',
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',
         /**
         * @property STR_TITLE
         * @description The Title of the HTML document that is created in the iFrame
@@ -2793,96 +3898,12 @@ var Dom = YAHOO.util.Dom,
         */
         STR_IMAGE_HERE: 'Image Url Here',
         /**
-        * @property STR_IMAGE_PROP_TITLE
-        * @description The title for the Image Property Editor Window
-        * @type String
-        */
-        STR_IMAGE_PROP_TITLE: 'Image Options',
-        /**
-        * @property STR_IMAGE_URL
-        * @description The label string for Image URL
-        * @type String
-        */
-        STR_IMAGE_URL: 'Image Url',
-        /**
-        * @property STR_IMAGE_TITLE
-        * @description The label string for Image Description
-        * @type String
-        */
-        STR_IMAGE_TITLE: 'Description',
-        /**
-        * @property STR_IMAGE_SIZE
-        * @description The label string for Image Size
-        * @type String
-        */
-        STR_IMAGE_SIZE: 'Size',
-        /**
-        * @property STR_IMAGE_ORIG_SIZE
-        * @description The label string for Original Image Size
-        * @type String
-        */
-        STR_IMAGE_ORIG_SIZE: 'Original Size',
-        /**
-        * @property STR_IMAGE_COPY
-        * @description The label string for the image copy and paste message for Opera and Safari
-        * @type String
-        */
-        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
-        /**
-        * @property STR_IMAGE_PADDING
-        * @description The label string for the image padding.
-        * @type String
-        */
-        STR_IMAGE_PADDING: 'Padding',
-        /**
-        * @property STR_IMAGE_BORDER
-        * @description The label string for the image border.
-        * @type String
-        */
-        STR_IMAGE_BORDER: 'Border',
-        /**
-        * @property STR_IMAGE_TEXTFLOW
-        * @description The label string for the image text flow.
-        * @type String
-        */
-        STR_IMAGE_TEXTFLOW: 'Text Flow',
-        /**
-        * @property STR_LOCAL_FILE_WARNING
-        * @description The label string for the local file warning.
-        * @type String
-        */
-        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
-        /**
-        * @property STR_LINK_PROP_TITLE
-        * @description The label string for the Link Property Editor Window.
-        * @type String
-        */
-        STR_LINK_PROP_TITLE: 'Link Options',
-        /**
-        * @property STR_LINK_PROP_REMOVE
-        * @description The label string for the Remove link from text link inside the property editor.
-        * @type String
-        */
-        STR_LINK_PROP_REMOVE: 'Remove link from text',
-        /**
         * @property STR_LINK_URL
         * @description The label string for the Link URL.
         * @type String
         */
         STR_LINK_URL: 'Link URL',
         /**
-        * @property STR_LINK_NEW_WINDOW
-        * @description The string for the open in a new window label.
-        * @type String
-        */
-        STR_LINK_NEW_WINDOW: 'Open in a new window.',
-        /**
-        * @property STR_LINK_TITLE
-        * @description The string for the link description.
-        * @type String
-        */
-        STR_LINK_TITLE: 'Description',
-        /**
         * @protected
         * @property STOP_EXEC_COMMAND
         * @description Set to true when you want the default execCommand function to not process anything
@@ -2898,18 +3919,11 @@ var Dom = YAHOO.util.Dom,
         STOP_NODE_CHANGE: false,
         /**
         * @protected
-        * @property CLASS_HIDDEN
-        * @description CSS class applied to the body when the hiddenelements button is pressed.
-        * @type String
-        */
-        CLASS_HIDDEN: 'hidden',
-        /**
-        * @protected
-        * @property CLASS_LOCAL_FILE
-        * @description CSS class applied to an element when it's found to have a local url.
+        * @property CLASS_NOEDIT
+        * @description CSS class applied to elements that are not editable.
         * @type String
         */
-        CLASS_LOCAL_FILE: 'warning-localfile',
+        CLASS_NOEDIT: 'yui-noedit',
         /**
         * @protected
         * @property CLASS_CONTAINER
@@ -2943,121 +3957,331 @@ var Dom = YAHOO.util.Dom,
         * @description Standard browser detection
         * @type Object
         */
-        browser: YAHOO.env.ua,
+        browser: function() {
+            var br = YAHOO.env.ua;
+            //Check for webkit3
+            if (br.webkit > 420) {
+                br.webkit3 = br.webkit;
+            } else {
+                br.webkit3 = 0;
+            }
+            return br;
+        }(),
         /** 
         * @method init
         * @description The Editor class' initialization method
         */
         init: function(p_oElement, p_oAttributes) {
-            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
-            this.get('element_cont').addClass(this.CLASS_CONTAINER);
-            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
-            this.get('iframe').addClass(this.CLASS_EDITABLE);
-        },
-        /**
-        * @method initAttributes
-        * @description Initializes all of the configuration attributes used to create 
-        * the editor.
-        * @param {Object} attr Object literal specifying a set of 
-        * configuration attributes used to create the editor.
-        */
-        initAttributes: function(attr) {
-            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
-            var self = this;
+            YAHOO.log('init', 'info', 'SimpleEditor');
 
-            /**
+            if (!this._defaultToolbar) {
+                this._defaultToolbar = {
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }
+                                
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Lists',
+                            buttons: [
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                };
+            }
+
+            YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes);
+            YAHOO.widget.EditorInfo._instances[this.get('id')] = this;
+
+
+            this.currentElement = [];
+            this.on('contentReady', function() {
+                this.DOMReady = true;
+                this.fireQueue();
+            }, this, true);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr);
+            var self = this;
+
+            /**
+            * @config container
+            * @description Used when dynamically creating the Editor from Javascript with no default textarea.
+            * We will create one and place it in this container. If no container is passed we will append to document.body.
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                writeOnce: true,
+                value: attr.container || false
+            });
+            /**
+            * @config plainText
+            * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('plainText', {
+                writeOnce: true,
+                value: attr.plainText || false
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('iframe', {
+                value: null
+            });
+            /**
             * @private
+            * @depreciated
             * @config textarea
-            * @description A reference to the textarea element that we are replacing
+            * @description Internal config for holding the textarea element (replaced with element).
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('textarea', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @private
+            * @config container
+            * @description Internal config for holding a reference to the container to append a dynamic editor to.
             * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                readOnly: true,
+                value: null
+            });
+            /**
+            * @config nodeChangeThreshold
+            * @description The number of seconds that need to be in between nodeChange processing
+            * @default 3
+            * @type Number
+            */            
+            this.setAttributeConfig('nodeChangeThreshold', {
+                value: attr.nodeChangeThreshold || 3,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @config allowNoEdit
+            * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes.
+            * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key.
+            * @default false
             * @type Boolean
             */            
-            this.setAttributeConfig('textarea', {
-                value: attr.textarea,
+            this.setAttributeConfig('allowNoEdit', {
+                value: attr.allowNoEdit || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config limitCommands
+            * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('limitCommands', {
+                value: attr.limitCommands || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('element_cont', {
+                value: attr.element_cont
+            });
+            /**
+            * @private
+            * @config editor_wrapper
+            * @description The outter wrapper for the entire editor.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('editor_wrapper', {
+                value: attr.editor_wrapper || null,
                 writeOnce: true
             });
             /**
-            * @config height
+            * @attribute height
             * @description The height of the editor iframe container, not including the toolbar..
             * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
             * @type String
             */
             this.setAttributeConfig('height', {
-                value: attr.height || Dom.getStyle(self.get('textarea'), 'height'),
-                writeOnce: true
+                value: attr.height || Dom.getStyle(self.get('element'), 'height'),
+                method: function(height) {
+                    if (this._rendered) {
+                        //We have been rendered, change the height
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), {
+                                height: {
+                                    to: parseInt(height, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height);
+                        }
+                    }
+                }
+            });
+            /**
+            * @config autoHeight
+            * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height.
+            * @default false
+            * @type Boolean || Number
+            */
+            this.setAttributeConfig('autoHeight', {
+                value: attr.autoHeight || false,
+                method: function(a) {
+                    if (a) {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'no');
+                        }
+                        this.on('afterNodeChange', this._handleAutoHeight, this, true);
+                        this.on('editorKeyDown', this._handleAutoHeight, this, true);
+                        this.on('editorKeyPress', this._handleAutoHeight, this, true);
+                    } else {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'auto');
+                        }
+                        this.unsubscribe('afterNodeChange', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyDown', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyPress', this._handleAutoHeight);
+                    }
+                }
             });
             /**
-            * @config width
+            * @attribute width
             * @description The width of the editor container.
             * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
             * @type String
             */            
             this.setAttributeConfig('width', {
-                value: attr.width || Dom.getStyle(this.get('textarea'), 'width'),
-                writeOnce: true
+                value: attr.width || Dom.getStyle(this.get('element'), 'width'),
+                method: function(width) {
+                    if (this._rendered) {
+                        //We have been rendered, change the width
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), {
+                                width: {
+                                    to: parseInt(width, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            this.get('element_cont').setStyle('width', width);
+                        }
+                    }
+                }
             });
                         
             /**
-            * @config blankimage
-            * @description The CSS used to show/hide hidden elements on the page
-            * @default 'assets/blankimage.png'
+            * @attribute blankimage
+            * @description The URL for the image placeholder to put in when inserting an image.
+            * @default The yahooapis.com address for the current release + 'assets/blankimage.png'
             * @type String
             */            
             this.setAttributeConfig('blankimage', {
                 value: attr.blankimage || this._getBlankImage()
             });
             /**
-            * @config hiddencss
-            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
-            * @default <code><pre>
-            .hidden div, .hidden p, .hidden span, .hidden img {
-                border: 1px dotted #ccc;
-            }
-            .hidden .yui-non {
-                border: none;
-            }
-            .hidden img {
-                padding: 2px;
-            }</pre></code>
-            * @type String
-            */            
-            this.setAttributeConfig('hiddencss', {
-                value: attr.hiddencss || '.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',
-                writeOnce: true
-            });
-            /**
-            * @config css
+            * @attribute css
             * @description The Base CSS used to format the content of the editor
-            * @default <code><pre>body {
-                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            * @default <code><pre>html {
+                height: 95%;
             }
-            span.yui-tag-a {
-                color: blue; text-decoration: underline;
-            }
-            span.yui-tag-blockquote {
-                margin: 1em; display: block;
+            body {
+                height: 100%;
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
             }
-            span.yui-tag-indent {
-                margin-left: 1em; display: block;
+            a {
+                color: blue;
+                text-decoration: underline;
+                cursor: pointer;
             }
             .warning-localfile {
                 border-bottom: 1px dashed red !important;
-            }</pre></code>
+            }
+            .yui-busy {
+                cursor: wait !important;
+            }
+            img.selected { //Safari image selection
+                border: 2px dotted #808080;
+            }
+            img {
+                cursor: pointer !important;
+                border: none;
+            }
+            </pre></code>
             * @type String
             */            
             this.setAttributeConfig('css', {
-                value: attr.css || 'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',
+                value: attr.css || this._defaultCSS,
                 writeOnce: true
             });
             /**
-            * @config html
-            * @description The default HTML to be written to the iframe document before the contents are loaded
+            * @attribute html
+            * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item)
             * @default This HTML requires a few things if you are to override:
-                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
                 <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
                 <code>
                 <pre>
-                &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
                 &lt;html&gt;
                     &lt;head&gt;
                         &lt;title&gt;{TITLE}&lt;/title&gt;
@@ -3068,6 +4292,9 @@ var Dom = YAHOO.util.Dom,
                         &lt;style&gt;
                         {HIDDEN_CSS}
                         &lt;/style&gt;
+                        &lt;style&gt;
+                        {EXTRA_CSS}
+                        &lt;/style&gt;
                     &lt;/head&gt;
                 &lt;body onload="document.body._rteLoaded = true;"&gt;
                 {CONTENT}
@@ -3078,12 +4305,23 @@ var Dom = YAHOO.util.Dom,
             * @type String
             */            
             this.setAttributeConfig('html', {
-                value: attr.html || '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                value: attr.html || '<html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><base href="' + this._baseHREF + '"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute extracss
+            * @description Extra user defined css to load after the default SimpleEditor CSS
+            * @default ''
+            * @type String
+            */            
+            this.setAttributeConfig('extracss', {
+                value: attr.css || '',
                 writeOnce: true
             });
 
             /**
-            * @config handleSubmit
+            * @attribute handleSubmit
             * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
             If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
             Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
@@ -3091,32 +4329,33 @@ var Dom = YAHOO.util.Dom,
             * @type Boolean
             */            
             this.setAttributeConfig('handleSubmit', {
-                value: false,
-                writeOnce: true,
+                value: attr.handleSubmit || false,
                 method: function(exec) {
-                    if (exec) {
-                        var ta = this.get('textarea');
-                        if (ta.form) {
-                            Event.addListener(ta.form, 'submit', function() {
-                                this.saveHTML();
-                            }, this, true);
+                    if (this.get('element').form) {
+                        if (!this._formButtons) {
+                            this._formButtons = [];
+                        }
+                        if (exec) {
+                            Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true);
+                            var i = this.get('element').form.getElementsByTagName('input');
+                            for (var s = 0; s < i.length; s++) {
+                                var type = i[s].getAttribute('type');
+                                if (type && (type.toLowerCase() == 'submit')) {
+                                    Event.on(i[s], 'click', this._handleFormButtonClick, this, true);
+                                    this._formButtons[this._formButtons.length] = i[s];
+                                }
+                            }
+                        } else {
+                            Event.unsubscribe(this.get('element').form, 'submit', this._handleFormSubmit);
+                            if (this._formButtons) {
+                                Event.unsubscribe(this._formButtons, 'click', this._handleFormButtonClick);
+                            }
                         }
                     }
                 }
             });
             /**
-            * @private
-            * @config iframe
-            * @description Internal config for holding the iframe element.
-            * @default null
-            * @type Boolean
-            */
-            this.setAttributeConfig('iframe', {
-                value: null,
-                writeOnce: true
-            });
-            /**
-            * @config disabled
+            * @attribute disabled
             * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
             All Toolbar buttons are also disabled so they cannot be used.
             * @default false
@@ -3126,42 +4365,12 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('disabled', {
                 value: false,
                 method: function(disabled) {
-                    if (disabled) {
-                        if (!this._mask) {
-                            this._setDesignMode('off');
-                            this.toolbar.set('disabled', true);
-                            this._mask = document.createElement('DIV');
-                            Dom.setStyle(this._mask, 'height', '100%');
-                            Dom.setStyle(this._mask, 'width', '100%');
-                            Dom.setStyle(this._mask, 'position', 'absolute');
-                            Dom.setStyle(this._mask, 'top', '0');
-                            Dom.setStyle(this._mask, 'left', '0');
-                            Dom.setStyle(this._mask, 'opacity', '.5');
-                            Dom.addClass(this._mask, 'yui-editor-masked');
-                            this.get('iframe').get('parentNode').appendChild(this._mask);
-                        }
-                    } else {
-                        if (this._mask) {
-                            this._mask.parentNode.removeChild(this._mask);
-                            this._mask = null;
-                            this.toolbar.set('disabled', false);
-                            this._setDesignMode('on');
-                            this._focusWindow();
-                        }
+                    if (this._rendered) {
+                        this._disableEditor(disabled);
                     }
                 }
             });
             /**
-            * @config element_cont
-            * @description Internal config for the editors container
-            * @default false
-            * @type Boolean
-            */
-            this.setAttributeConfig('element_cont', {
-                value: null,
-                writeOnce: true
-            });
-            /**
             * @config toolbar_cont
             * @description Internal config for the toolbars container
             * @default false
@@ -3172,127 +4381,35 @@ var Dom = YAHOO.util.Dom,
                 writeOnce: true
             });
             /**
-            * @config toolbar
+            * @attribute toolbar
             * @description The default toolbar config.
-            * @default This config is too large to display here, view the code to see it: <a href="editor.js.html"></a>
             * @type Object
             */            
             this.setAttributeConfig('toolbar', {
-                value: attr.toolbar || {
-                    /* {{{ Defaut Toolbar Config */
-                    collapse: true,
-                    titlebar: 'Text Editing Tools',
-                    draggable: false,
-                    buttons: [
-                        { group: 'fontstyle', label: 'Font Name and Size',
-                            buttons: [
-                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
-                                    menu: [
-                                        { text: 'Arial', checked: true },
-                                        { text: 'Arial Black' },
-                                        { text: 'Comic Sans MS' },
-                                        { text: 'Courier New' },
-                                        { text: 'Lucida Console' },
-                                        { text: 'Tahoma' },
-                                        { text: 'Times New Roman' },
-                                        { text: 'Trebuchet MS' },
-                                        { text: 'Verdana' }
-                                    ]
-                                },
-                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'textstyle', label: 'Font Style',
-                            buttons: [
-                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
-                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
-                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
-                                { type: 'separator' },
-                                { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
-                                { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
-                                { type: 'separator' },
-                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
-                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
-                                { type: 'separator' },
-                                { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
-                                { type: 'push', label: 'Hidden Elements', value: 'hiddenelements' }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'alignment', label: 'Alignment',
-                            buttons: [
-                                { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
-                                { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
-                                { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
-                                { type: 'push', label: 'Justify', value: 'justifyfull' }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'parastyle', label: 'Paragraph Style',
-                            buttons: [
-                            { type: 'select', label: 'Normal', value: 'heading', disabled: true,
-                                menu: [
-                                    { text: 'Normal', value: 'none', checked: true },
-                                    { text: 'Header 1', value: 'h1' },
-                                    { text: 'Header 2', value: 'h2' },
-                                    { text: 'Header 3', value: 'h3' },
-                                    { text: 'Header 4', value: 'h4' },
-                                    { text: 'Header 5', value: 'h5' },
-                                    { text: 'Header 6', value: 'h6' }
-                                ]
-                            }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'indentlist', label: 'Indenting and Lists',
-                            buttons: [
-                                { type: 'push', label: 'Indent', value: 'indent', disabled: true },
-                                { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
-                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
-                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
-                                /*
-                                { type: 'menu', label: 'Create an Ordered List', value: 'insertorderedlist',
-                                    menu: [
-                                        { text: '1,2,3,4', value: '1', checked: true },
-                                        { text: 'A,B,C,D', value: 'A' },
-                                        { text: 'a,b,c,d', value: 'a' },
-                                        { text: 'I,II,III,IV', value: 'I' },
-                                        { text: 'i,ii,iii,iv', value: 'i' }
-                                    ]
-                                }
-                                */
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'insertitem', label: 'Insert Item',
-                            buttons: [
-                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
-                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
-                            ]
-                        }
-                    ]
-                    /* }}} */
-                },
+                value: attr.toolbar || this._defaultToolbar,
                 writeOnce: true,
                 method: function(toolbar) {
+                    if (!toolbar.buttonType) {
+                        toolbar.buttonType = this._defaultToolbar.buttonType;
+                    }
+                    this._defaultToolbar = toolbar;
                 }
             });
             /**
-            * @config animate
+            * @attribute animate
             * @description Should the editor animate window movements
             * @default false unless Animation is found, then true
             * @type Boolean
             */            
             this.setAttributeConfig('animate', {
-                value: false,
+                value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false),
                 validator: function(value) {
                     var ret = true;
                     if (!YAHOO.util.Anim) {
                         ret = false;
                     }
                     return ret;
-                }               
+                }
             });
             /**
             * @config panel
@@ -3305,29 +4422,39 @@ var Dom = YAHOO.util.Dom,
                 writeOnce: true,
                 validator: function(value) {
                     var ret = true;
-                    if (!YAHOO.widget.Panel) {
+                    if (!YAHOO.widget.Overlay) {
                         ret = false;
                     }
                     return ret;
                 }               
             });
             /**
-            * @config localFileWarning
-            * @description Should we throw the warning if we detect a file that is local to their machine?
-            * @default true
+            * @attribute focusAtStart
+            * @description Should we focus the window when the content is ready?
+            * @default false
             * @type Boolean
             */            
-            this.setAttributeConfig('localFileWarning', {
-                value: true
+            this.setAttributeConfig('focusAtStart', {
+                value: attr.focusAtStart || false,
+                writeOnce: true,
+                method: function() {
+                    this.on('editorContentLoaded', function() {
+                        var self = this;
+                        setTimeout(function() {
+                            self._focusWindow.call(self, true);
+                            self.editorDirty = false;
+                        }, 400);
+                    }, this, true);
+                }
             });
             /**
-            * @config dompath
+            * @attribute dompath
             * @description Toggle the display of the current Dom path below the editor
             * @default false
             * @type Boolean
             */            
             this.setAttributeConfig('dompath', {
-                value: false,
+                value: attr.dompath || false,
                 method: function(dompath) {
                     if (dompath && !this.dompath) {
                         this.dompath = document.createElement('DIV');
@@ -3341,28 +4468,38 @@ var Dom = YAHOO.util.Dom,
                         this.dompath.parentNode.removeChild(this.dompath);
                         this.dompath = null;
                     }
-                    this._setupAfterElement();
                 }
             });
             /**
-            * @config markup
-            * @description Should we try to adjust the markup for the following types: semantic, css or default
+            * @attribute markup
+            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml
             * @default "semantic"
-            * @type Boolean
+            * @type String
             */            
             this.setAttributeConfig('markup', {
-                value: 'semantic',
+                value: attr.markup || 'semantic',
                 validator: function(markup) {
                     switch (markup.toLowerCase()) {
                         case 'semantic':
                         case 'css':
                         case 'default':
+                        case 'xhtml':
                         return true;
-                        break;
                     }
                     return false;
                 }
             });
+            /**
+            * @attribute removeLineBreaks
+            * @description Should we remove linebreaks and extra spaces on cleanup
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('removeLineBreaks', {
+                value: attr.removeLineBreaks || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            
 
             this.on('afterRender', function() {
                 this._renderPanel();
@@ -3372,26 +4509,121 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getBlankImage
         * @description Retrieves the full url of the image to use as the blank image.
-        * @returns {String} The URL to the blank image
+        * @return {String} The URL to the blank image
         */
         _getBlankImage: function() {
             if (!this.DOMReady) {
                 this._queue[this._queue.length] = ['_getBlankImage', arguments];
                 return '';
-            }      
-            var div = document.createElement('div');
-            div.style.position = 'absolute';
-            div.style.top = '-9999px';
-            div.style.left = '-9999px';
-            div.className = this.CLASS_PREFIX + '-blankimage';
-            document.body.appendChild(div);
-            var img = YAHOO.util.Dom.getStyle(div, 'background-image');
-            img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
-            this.set('blankimage', img);            
+            }
+            var img = '';
+            if (!this._blankImageLoaded) {
+                var div = document.createElement('div');
+                div.style.position = 'absolute';
+                div.style.top = '-9999px';
+                div.style.left = '-9999px';
+                div.className = this.CLASS_PREFIX + '-blankimage';
+                document.body.appendChild(div);
+                img = YAHOO.util.Dom.getStyle(div, 'background-image');
+                img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+                this.set('blankimage', img);
+                this._blankImageLoaded = true;
+            } else {
+                img = this.get('blankimage');
+            }
             return img;
         },
         /**
         * @private
+        * @method _handleAutoHeight
+        * @description Handles resizing the editor's height based on the content
+        */
+        _handleAutoHeight: function() {
+            var doc = this._getDoc(),
+                body = doc.body,
+                docEl = doc.documentElement;
+
+            var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10);
+            var newHeight = body.scrollHeight;
+            if (this.browser.webkit) {
+                newHeight = docEl.scrollHeight;
+            }
+            if (newHeight < parseInt(this.get('height'), 10)) {
+                newHeight = parseInt(this.get('height'), 10);
+            }
+            if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) {   
+                Dom.setStyle(this.get('editor_wrapper'), 'height', newHeight + 'px');
+                if (this.browser.ie) {
+                    //Internet Explorer needs this
+                    this.get('iframe').setStyle('height', '99%');
+                    this.get('iframe').setStyle('zoom', '1');
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.get('iframe').setStyle('height', '100%');
+                    }, 1);
+                }
+            }
+        },
+        _formButtons: null,
+        _formButtonClicked: null,
+        _handleFormButtonClick: function(ev) {
+            var tar = Event.getTarget(ev);
+            this._formButtonClicked = tar;
+        },
+        /**
+        * @private
+        * @method _handleFormSubmit
+        * @description Handles the form submission.
+        * @param {Object} ev The Form Submit Event
+        */
+        _handleFormSubmit: function(ev) {
+            Event.stopEvent(ev);
+            YAHOO.log('Button: ' + this._formButtonClicked.id, 'info', 'SimpleEditor');
+            
+            this.saveHTML();
+            var form = this.get('element').form;
+            var tar = this._formButtonClicked || false;
+            var self = this;
+
+            window.setTimeout(function() {
+                YAHOO.util.Event.removeListener(form, 'submit', self._handleFormSubmit);
+                if (YAHOO.env.ua.ie) {
+                    form.fireEvent("onsubmit");
+                    if (tar) {
+                        tar.click();
+                    }
+                } else {  // Gecko, Opera, and Safari
+                    if (tar) {
+                        tar.click();
+                    } else {
+                        var oEvent = document.createEvent("HTMLEvents");
+                        oEvent.initEvent("submit", true, true);
+                        form.dispatchEvent(oEvent);
+                        if (YAHOO.env.ua.webkit) {
+                            if (YAHOO.lang.isFunction(form.submit)) {
+                                form.submit();
+                            }
+                        }
+                    }
+                }
+                /*
+                if (YAHOO.env.ua.ie || YAHOO.env.ua.webkit) {
+                    if (YAHOO.lang.isFunction(form.submit)) {
+                        form.submit();
+                    } else {
+                        if (YAHOO.lang.isObject(form.submit)) {
+                            form.submit.click();
+                        } else {
+                            YAHOO.log('Form submit failed because form.submit was not a function. Please change the submit buttons name and id.', 'error', 'SimpleEditor');
+                        }
+                    }
+                }
+                */
+            }, 200);
+            
+        },
+        /**
+        * @private
         * @method _handleFontSize
         * @description Handles the font size button in the toolbar.
         * @param {Object} o Object returned from Toolbar's buttonClick Event
@@ -3404,7 +4636,6 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @private
-        * @method _handleColorPicker
         * @description Handles the colorpicker buttons in the toolbar.
         * @param {Object} o Object returned from Toolbar's buttonClick Event
         */
@@ -3422,7 +4653,6 @@ var Dom = YAHOO.util.Dom,
         * @param {Object} o Object returned from Toolbar's buttonClick Event
         */
         _handleAlign: function(o) {
-            var button = this.toolbar.getButtonById(o.button.id);
             var cmd = null;
             for (var i = 0; i < o.button.menu.length; i++) {
                 if (o.button.menu[i].value == o.button.value) {
@@ -3440,13 +4670,20 @@ var Dom = YAHOO.util.Dom,
         * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
         */
         _handleAfterNodeChange: function() {
-            var path = this._getDomPath();
+            var path = this._getDomPath(),
+                elm = null,
+                family = null,
+                fontsize = null,
+                validFont = false;
+            var fn_button = this.toolbar.getButtonByValue('fontname');
+            var fs_button = this.toolbar.getButtonByValue('fontsize');
+            var hd_button = this.toolbar.getButtonByValue('heading');
+
             for (var i = 0; i < path.length; i++) {
-                var elm = path[i],
-                    tag = elm.tagName.toLowerCase(),
-                    family = null,
-                    fontsize = null,
-                    validFont = false;
+                elm = path[i];
+
+                var tag = elm.tagName.toLowerCase();
+
 
                 if (elm.getAttribute('tag')) {
                     tag = elm.getAttribute('tag');
@@ -3456,69 +4693,94 @@ var Dom = YAHOO.util.Dom,
                 if (Dom.getStyle(elm, 'font-family')) {
                     family = Dom.getStyle(elm, 'font-family');
                 }
-                var fn_button = this.toolbar.getButtonByValue('fontname');
-                if (fn_button) {
-                    for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
-                        if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
-                            validFont = true;
-                            family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
-                        }
-                    }
-                    if (!validFont) {
-                        family = fn_button._configs.label._initialConfig.value;
-                    }
-                    fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
-                    this._updateMenuChecked('fontname', family);
-                }
-
-                var fs_button = this.toolbar.getButtonByValue('fontsize');
-                if (fs_button) {
-                    fontsize = parseInt(Dom.getStyle(elm, 'fontSize'));
-                    if ((fontsize == null) || isNaN(fontsize)) {
-                        fontsize = fs_button._configs.label._initialConfig.value;
-                    }
-                    fs_button.set('label', ''+fontsize);
-                }
 
                 if (tag.substring(0, 1) == 'h') {
-                    var hd_button = this.toolbar.getButtonByValue('heading');
                     if (hd_button) {
-                        for (var b = 0; b < hd_button._configs.menu.value.length; b++) {
-                            if (hd_button._configs.menu.value[b].value.toLowerCase() == tag) {
-                                hd_button.set('label', hd_button._configs.menu.value[b].text);
+                        for (var h = 0; h < hd_button._configs.menu.value.length; h++) {
+                            if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[h].text);
                             }
                         }
                         this._updateMenuChecked('heading', tag);
                     }
                 }
             }
+
+            if (fn_button) {
+                for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                    if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                        validFont = true;
+                        family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                    }
+                }
+                if (!validFont) {
+                    family = fn_button._configs.label._initialConfig.value;
+                }
+                var familyLabel = '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>';
+                if (fn_button.get('label') != familyLabel) {
+                    fn_button.set('label', familyLabel);
+                    this._updateMenuChecked('fontname', family);
+                }
+            }
+
+            if (fs_button) {
+                fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10);
+                if ((fontsize === null) || isNaN(fontsize)) {
+                    fontsize = fs_button._configs.label._initialConfig.value;
+                }
+                fs_button.set('label', ''+fontsize);
+            }
             
-            if (elm && elm.tagName && (elm.tagName.toLowerCase() != 'body')) {
+            if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) {
                 this.toolbar.enableButton(fn_button);
                 this.toolbar.enableButton(fs_button);
+                this.toolbar.enableButton('forecolor');
+                this.toolbar.enableButton('backcolor');
+            }
+            if (this._isElement(elm, 'img')) {
+                if (YAHOO.widget.Overlay) {
+                    this.toolbar.enableButton('createlink');
+                }
+            }
+            if (this._isElement(elm, 'blockquote')) {
+                this.toolbar.selectButton('indent');
+                this.toolbar.disableButton('indent');
+                this.toolbar.enableButton('outdent');
+            }
+            if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) {
+                this.toolbar.disableButton('indent');
             }
+            this._lastButton = null;
             
         },
+        _setBusy: function(off) {
+            /*
+            if (off) {
+                Dom.removeClass(document.body, 'yui-busy');
+                Dom.removeClass(this._getDoc().body, 'yui-busy');
+            } else {
+                Dom.addClass(document.body, 'yui-busy');
+                Dom.addClass(this._getDoc().body, 'yui-busy');
+            }
+            */
+        },
         /**
         * @private
         * @method _handleInsertImageClick
         * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
         */
         _handleInsertImageClick: function() {
-            //this.toolbar.disableButton(this.toolbar.getButtonByValue('insertimage'));
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    YAHOO.log('Toolbar Button for (insertimage) was not found, skipping exec.', 'info', 'SimpleEditor');
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
             this.on('afterExecCommand', function() {
                 var el = this.currentElement[0],
-                    title = '',
-                    src = '',
-                    align = '',
-                    height = 75,
-                    width = 75,
-                    padding = 0,
-                    blankimage = false,
-                    win = new YAHOO.widget.EditorWindow('insertimage', {
-                        width: '415px'
-                    });
-
+                    src = 'http://';
                 if (!el) {
                     el = this._getSelectedElement();
                 }
@@ -3527,402 +4789,87 @@ var Dom = YAHOO.util.Dom,
                         src = el.getAttribute('src', 2);
                         if (src.indexOf(this.get('blankimage')) != -1) {
                             src = this.STR_IMAGE_HERE;
-                            blankimage = true;
                         }
                     }
-                    if (el.getAttribute('alt', 2)) {
-                        title = el.getAttribute('alt', 2);
-                    }
-                    if (el.getAttribute('title', 2)) {
-                        title = el.getAttribute('title', 2);
-                    }
-                    height = parseInt(el.height);
-                    width = parseInt(el.width);
-                    if (el.style.height) {
-                        height = parseInt(el.style.height);
-                    }
-                    if (el.style.width) {
-                        width = parseInt(el.style.width);
-                    }
-                    if (el.style.margin) {
-                        padding = parseInt(el.style.margin);
-                    }
-                    if (!el._height) {
-                        el._height = height;
-                    }
-                    if (!el._width) {
-                        el._width = width;
-                    }
-                    var oheight = el._height;
-                    var owidth = el._width;
-                }
-                if (!win.cache) {
-                    var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
-                    var body = document.createElement('div');
-                    body.innerHTML = str;
-
-                    var tbarCont = document.createElement('div');
-                    tbarCont.id = 'img_toolbar';
-                    body.appendChild(tbarCont);
-
-                    var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
-                    var div = document.createElement('div');
-                    div.innerHTML = str2;
-                    body.appendChild(div);
-                    win.cache = body;
-                } else {
-                    body = win.cache;
-                }
-
-                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
-                    /* {{{ */ 
-                    buttons: [
-                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
-                            buttons: [
-                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
-                            buttons: [
-                                { type: 'select', label: 'Border Size', value: 'bordersize',
-                                    menu: [
-                                        { text: 'none', value: '0', checked: true },
-                                        { text: '----', value: '1' },
-                                        { text: '----', value: '2' },
-                                        { text: '----', value: '3' },
-                                        { text: '----', value: '4' },
-                                        { text: '----', value: '5' }
-                                    ]
-                                },
-                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
-                                    menu: [
-                                        { text: '----', value: 'solid', checked: true },
-                                        { text: '----', value: 'dashed' },
-                                        { text: '----', value: 'dotted' }
-                                    ]
-                                },
-                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
-                            buttons: [
-                                { type: 'push', label: 'Left', value: 'left' },
-                                { type: 'push', label: 'Inline', value: 'inline' },
-                                { type: 'push', label: 'Block', value: 'block' },
-                                { type: 'push', label: 'Right', value: 'right' }
-                            ]
-                        }
-                    ]
-                    /* }}} */
-                });
-                
-                var bsize = '0';
-                var btype = 'solid';
-                if (el.style.borderLeftWidth) {
-                    bsize = parseInt(el.style.borderLeftWidth);
                 }
-                if (el.style.borderLeftStyle) {
-                    btype = el.style.borderLeftStyle;
+                var str = prompt(this.STR_LINK_URL + ': ', src);
+                if ((str !== '') && (str !== null)) {
+                    el.setAttribute('src', str);
+                } else if (str === null) {
+                    el.parentNode.removeChild(el);
+                    this.currentElement = [];
+                    this.nodeChange();
                 }
-                var bs_button = tbar.getButtonByValue('bordersize');
-                var bSizeStr = ((parseInt(bsize) > 0) ? '----' : 'none');
-                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
-                this._updateMenuChecked('bordersize', bsize, tbar);
-
-                var bs_button = tbar.getButtonByValue('bordertype');
-                bs_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '">----</span>');
-                this._updateMenuChecked('bordertype', btype, tbar);
-                if (parseInt(bsize) > 0) {
-                    tbar.enableButton(tbar.getButtonByValue('bordertype'));
-                    tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            }, this, true);
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            this.nodeChange();
+        },
+        /**
+        * @private
+        * @method _isLocalFile
+        * @param {String} url THe url/string to check
+        * @description Checks to see if a string (href or img src) is possibly a local file reference..
+        */
+        _isLocalFile: function(url) {
+            if ((url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor');
+                    return false;
                 }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    url = '';
 
-                var cont = tbar.get('cont');
-                var hw = document.createElement('div');
-                hw.className = 'yui-toolbar-group yui-toolbar-group-padding height-width';
-                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
-                var orgSize = '';
-                if ((height != oheight) || (width != owidth)) {
-                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                    }
                 }
-                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
-                cont.insertBefore(hw, cont.firstChild);
-
-                Event.onAvailable('insertimage_width', function() {
-                    Event.on('insertimage_width', 'blur', function() {
-                        var value = parseInt(Dom.get('insertimage_width').value);
-                        if (value > 5) {
-                            el.style.width = value + 'px';
-                            this.moveWindow();
-                        }
-                    }, this, true);
-                }, this, true);
-                Event.onAvailable('insertimage_height', function() {
-                    Event.on('insertimage_height', 'blur', function() {
-                        var value = parseInt(Dom.get('insertimage_height').value);
-                        if (value > 5) {
-                            el.style.height = value + 'px';
-                            this.moveWindow();
+                var str = prompt(this.STR_LINK_URL + ': ', url);
+                if ((str !== '') && (str !== null)) {
+                    var urlValue = str;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            if (urlValue.substring(0, 1) != '#') {
+                                urlValue = 'http:/'+'/' + urlValue;
+                            }
                         }
-                    }, this, true);
-                }, this, true);
-
-                if (el.align == 'right') {
-                    tbar.selectButton(tbar.getButtonByValue('right'));
-                } else if (el.align == 'left') {
-                    tbar.selectButton(tbar.getButtonByValue('left'));
-                } else if (el.style.display == 'block') {
-                    tbar.selectButton(tbar.getButtonByValue('block'));
-                } else {
-                    tbar.selectButton(tbar.getButtonByValue('inline'));
-                }
-                if (parseInt(el.style.marginLeft) > 0) {
-                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft));
+                    }
+                    el.setAttribute('href', urlValue);
+                } else if (str !== null) {
+                    var _span = this._getDoc().createElement('span');
+                    _span.innerHTML = el.innerHTML;
+                    Dom.addClass(_span, 'yui-non');
+                    el.parentNode.replaceChild(_span, el);
                 }
-                if (el.style.borderSize) {
-                    tbar.selectButton(tbar.getButtonByValue('bordersize'));
-                    tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));
-                }
-
-                tbar.on('colorPickerClicked', function(o) {
-                    var size = '1', type = 'solid', color = 'black';
-
-                    if (el.style.borderLeftWidth) {
-                        size = parseInt(el.style.borderLeftWidth);
-                    }
-                    if (el.style.borderLeftStyle) {
-                        type = el.style.borderLeftStyle;
-                    }
-                    if (el.style.borderLeftColor) {
-                        color = el.style.borderLeftColor;
-                    }
-                    var borderString = size + 'px ' + type + ' #' + o.color;
-                    el.style.border = borderString;
-                }, this.toolbar, true);
-
-                tbar.on('buttonClick', function(o) {
-                    var value = o.button.value;
-                    if (o.button.menucmd) {
-                        value = o.button.menucmd
-                    }
-                    var size = '1', type = 'solid', color = 'black';
-
-                    /* All border calcs are done on the left border
-                        since our default interface only supports
-                        one border size/type and color */
-                    if (el.style.borderLeftWidth) {
-                        size = parseInt(el.style.borderLeftWidth);
-                    }
-                    if (el.style.borderLeftStyle) {
-                        type = el.style.borderLeftStyle;
-                    }
-                    if (el.style.borderLeftColor) {
-                        color = el.style.borderLeftColor;
-                    }
-                    switch(value) {
-                        case 'bordersize':
-                            var borderString = parseInt(o.button.value) + 'px ' + type + ' ' + color;
-                            el.style.border = borderString;
-                            if (parseInt(o.button.value) > 0) {
-                                tbar.enableButton(tbar.getButtonByValue('bordertype'));
-                                tbar.enableButton(tbar.getButtonByValue('bordercolor'));
-                            } else {
-                                tbar.disableButton(tbar.getButtonByValue('bordertype'));
-                                tbar.disableButton(tbar.getButtonByValue('bordercolor'));
-                            }
-                            break;
-                        case 'bordertype':
-                            var borderString = size + 'px ' + o.button.value + ' ' + color;
-                            el.style.border = borderString;
-                            break;
-                        case 'right':
-                        case 'left':
-                            tbar.deselectAllButtons();
-                            el.style.display = '';
-                            el.align = o.button.value;
-                            break;
-                        case 'inline':
-                            tbar.deselectAllButtons();
-                            el.style.display = '';
-                            el.align = '';
-                            break;
-                        case 'block':
-                            tbar.deselectAllButtons();
-                            el.style.display = 'block';
-                            el.align = 'center';
-                            break;
-                        case 'padding':
-                            var _button = tbar.getButtonById(o.button.id);
-                            el.style.margin = _button.get('label') + 'px';
-                            break;
-                    }
-                    tbar.selectButton(tbar.getButtonByValue(o.button.value));
-                    this.moveWindow();
-                }, this, true);
-
-                win.setHeader(this.STR_IMAGE_PROP_TITLE);
-                win.setBody(body);
-                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
-                    var str = this.STR_IMAGE_COPY;
-                    win.setFooter(str);
-                }
-                this.openWindow(win);
-
-
-                //Set event after openWindow..
-                Event.onAvailable('insertimage_url', function() {
-                    window.setTimeout(function() {
-                        YAHOO.util.Dom.get('insertimage_url').focus();
-                        if (blankimage) {
-                            YAHOO.util.Dom.get('insertimage_url').select();
-                        }
-                    }, 50);
-                    
-                    if (this.get('localFileWarning')) {
-                        Event.on('insertimage_url', 'blur', function() {
-                            var url = Dom.get('insertimage_url');
-                            if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
-                                //Local File throw Warning
-                                Dom.addClass(url, 'warning');
-                                YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
-                                var str = this.STR_LOCAL_FILE_WARNING;
-                                this.get('panel').setFooter(str);
-                            } else {
-                                Dom.removeClass(url, 'warning');
-                                this.get('panel').setFooter(' ');
-                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
-                                    var str = this.STR_IMAGE_COPY;
-                                    this.get('panel').setFooter(str);
-                                }
-                                
-                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
-                                    this.currentElement[0].setAttribute('src', url.value);
-                                    var img = new Image();
-                                    var self = this;
-                                    window.setTimeout(function() {
-                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
-                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
-                                        if (!self.currentElement[0]._height) {
-                                            self.currentElement[0]._height = img.height;
-                                        }
-                                        if (!self.currentElement[0]._width) {
-                                            self.currentElement[0]._width = img.width;
-                                        }
-                                        self.moveWindow();
-                                    }, 200);
-
-                                    img.src = url.value;
-                                }
-                            }
-                        }, this, true);
-                    }
-                }, this, true);
-            });
-        },
-        /**
-        * @private
-        * @method _handleInsertImageWindowClose
-        * @description Handles the closing of the Image Properties Window.
-        */
-        _handleInsertImageWindowClose: function() {
-            var url = Dom.get('insertimage_url');
-            var title = Dom.get('insertimage_title');
-            var el = this.currentElement[0];
-            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
-                el.setAttribute('src', url.value);
-                el.setAttribute('title', title.value);
-                el.setAttribute('alt', title.value);
-                //this.toolbar.enableButton(this.toolbar.getButtonByValue('insertimage'));
-            } else {
-                //No url/src given, remove the node from the document
-                el.parentNode.removeChild(el);
-            }
-        },
-        /**
-        * @private
-        * @method _handleCreateLinkClick
-        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
-        */
-        _handleCreateLinkClick: function() {
-            this.on('afterExecCommand', function() {
-
-                var win = new YAHOO.widget.EditorWindow('createlink', {
-                    width: '300px'
-                });
-                
-                var el = this.currentElement[0],
-                    url = '',
-                    title = '',
-                    target = '',
-                    localFile = false;
-                if (el) {
-                    if (el.getAttribute('href') != null) {
-                        url = el.getAttribute('href');
-                        if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                            //Local File throw Warning
-                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
-                            var str = this.STR_LOCAL_FILE_WARNING;
-                            win.setFooter(str);
-                            localFile = true;
-                        } else {
-                            win.setFooter(' ');
-                        }
-                    }
-                    if (el.getAttribute('title') != null) {
-                        title = el.getAttribute('title');
-                    }
-                    if (el.getAttribute('target') != null) {
-                        target = el.getAttribute('target');
-                    }
-                }
-                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
-                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
-                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
-                
-                var body = document.createElement('div');
-                body.innerHTML = str;
-
-                var unlinkCont = document.createElement('div');
-                unlinkCont.className = 'removeLink';
-                var unlink = document.createElement('a');
-                unlink.href = '#';
-                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
-                unlink.title = this.STR_LINK_PROP_REMOVE;
-                Event.on(unlink, 'click', function(ev) {
-                    Event.stopEvent(ev);
-                    this.execCommand('unlink');
-                    this.closeWindow();
-                }, this, true);
-                unlinkCont.appendChild(unlink);
-                body.appendChild(unlinkCont);
-
-                win.setHeader(this.STR_LINK_PROP_TITLE);
-                win.setBody(body);
-
-                Event.onAvailable('createlink_url', function() {
-                    window.setTimeout(function() {
-                        try {
-                            YAHOO.util.Dom.get('createlink_url').focus();
-                        } catch (e) {}
-                    }, 50);
-                    Event.on('createlink_url', 'blur', function() {
-                        var url = Dom.get('createlink_url');
-                        if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
-                            //Local File throw Warning
-                            Dom.addClass(url, 'warning');
-                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
-                            var str = this.STR_LOCAL_FILE_WARNING;
-                            this.get('panel').setFooter(str);
-                        } else {
-                            Dom.removeClass(url, 'warning');
-                            this.get('panel').setFooter(' ');
-                        }
-                    }, this, true);
-                }, this, true);
-
-                this.openWindow(win);
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
             });
         },
         /**
@@ -3931,53 +4878,65 @@ var Dom = YAHOO.util.Dom,
         * @description Handles the closing of the Link Properties Window.
         */
         _handleCreateLinkWindowClose: function() {
-            var url = Dom.get('createlink_url');
-            var target = Dom.get('createlink_target');
-            var title = Dom.get('createlink_title');
-            var el = this.currentElement[0];
-            if (url && url.value) {
-                var urlValue = url.value;
-                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
-                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
-                        //Found an @ sign, prefix with mailto:
-                        urlValue = 'mailto:' + urlValue;
-                    } else {
-                        /* :// not found adding */
-                        urlValue = 'http:/'+'/' + urlValue;
-                    }
-                }
-                el.setAttribute('href', urlValue);
-                if (target.checked) {
-                    el.setAttribute('target', target.value);
-                } else {
-                    el.setAttribute('target', '');
-                }
-                el.setAttribute('title', ((title.value) ? title.value : ''));
-
-            } else {
-                el.removeAttribute('tag');
-                Dom.removeClass(el, 'yui-tag-a');
-                Dom.removeClass(el, 'yui-tag');
-                Dom.addClass(el, 'yui-non');
-            }
             this.nodeChange();
+            this.currentElement = [];
         },
         /**
         * @method render
-        * @description Causes the toolbar and the editor to render and replace the textarea.
+        * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load.
         */
         render: function() {
+            if (this._rendered) {
+                return false;
+            }
+            YAHOO.log('Render', 'info', 'SimpleEditor');
             if (!this.DOMReady) {
                 this._queue[this._queue.length] = ['render', arguments];
                 return false;
             }
+            this._rendered = true;
+            var self = this;
+            window.setTimeout(function() {
+                self._render.call(self);
+            }, 4);
+        },
+        /**
+        * @private
+        * @method _render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        _render: function() {
+            this._setBusy();
             var self = this;
+            this.set('textarea', this.get('element'));
+
+            this.get('element_cont').setStyle('display', 'none');
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+
+            this.set('iframe', this._createIframe());
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+
+            this.get('editor_wrapper').appendChild(this.get('iframe').get('element'));
+
+            if (this.get('disabled')) {
+                this._disableEditor(true);
+            }
+
             var tbarConf = this.get('toolbar');
-            //Set the toolbar to disabled until content is loaded
-            tbarConf.disabled = true;
             //Create Toolbar instance
-            this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
-            YAHOO.log('fireEvent::toolbarLoaded', 'info', 'Editor');
+            if (tbarConf instanceof Toolbar) {
+                this.toolbar = tbarConf;
+                //Set the toolbar to disabled until content is loaded
+                this.toolbar.set('disabled', true);
+            } else {
+                //Set the toolbar to disabled until content is loaded
+                tbarConf.disabled = true;
+                this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            }
+
+            YAHOO.log('fireEvent::toolbarLoaded', 'info', 'SimpleEditor');
             this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
 
             
@@ -3997,6 +4956,7 @@ var Dom = YAHOO.util.Dom,
             
             this.toolbar.on('colorPickerClicked', function(o) {
                 this._handleColorPicker(o);
+                return false; //Stop the buttonClick event
             }, this, true);
 
             this.toolbar.on('alignClick', function(o) {
@@ -4017,40 +4977,33 @@ var Dom = YAHOO.util.Dom,
             this.on('windowcreatelinkClose', function() {
                 this._handleCreateLinkWindowClose();
             }, this, true);
-
+            
 
             //Replace Textarea with editable area
-            
             this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
 
+            
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            this.get('element_cont').appendChild(this.get('element'));
+            this.get('element_cont').setStyle('display', 'block');
 
-            if (!this.beforeElement) {
-                this.beforeElement = document.createElement('h2');
-                this.beforeElement.className = 'yui-editor-skipheader';
-                this.beforeElement.tabIndex = '-1';
-                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
-                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
-            }
-            
-            Dom.setStyle(this.get('textarea'), 'display', 'none');
-            this.get('element_cont').appendChild(this.get('element'));
-            this.get('element_cont').setStyle('display', 'block');
 
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
 
             //Set height and width of editor container
             this.get('element_cont').setStyle('width', this.get('width'));
             Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
 
             this.get('iframe').setStyle('width', '100%'); //WIDTH
-            //this.get('iframe').setStyle('_width', '99%'); //WIDTH
             this.get('iframe').setStyle('height', '100%');
 
-
-            var self = this;
             window.setTimeout(function() {
-                self._setInitialContent.call(self);
-            }, 10);
-            
+                self._setupAfterElement.call(self);
+            }, 0);
             this.fireEvent('afterRender', { type: 'afterRender', target: this });
         },
         /**
@@ -4060,8 +5013,8 @@ var Dom = YAHOO.util.Dom,
         * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
         */
         execCommand: function(action, value) {
-            this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
-            if (this.STOP_EXEC_COMMAND) {
+            var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) {
                 this.STOP_EXEC_COMMAND = false;
                 return false;
             }
@@ -4070,602 +5023,2162 @@ var Dom = YAHOO.util.Dom,
                 this._getWindow().focus();
             }
             var exec = true;
-            var _sel = this._getSelection();
-            var _range = this._getRange();
-            var _selEl = this._getSelectedElement();
-            if (_selEl) {
-                _sel = _selEl;
+            
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue(action)) {
+                    YAHOO.log('Toolbar Button for (' + action + ') was not found, skipping exec.', 'info', 'SimpleEditor');
+                    exec = false;
+                }
             }
-            switch (action.toLowerCase()) {
-                case 'heading':
-                    if (this.browser.ie) {
-                        action = 'formatblock';
-                    }
-                    if (value == 'none') {
-                        if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
-                            if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
-                                _sel = _sel.parentNode;
-                            }
-                            var _span = this._getDoc().createElement('span');
-                            _span.className = 'yui-non';
-                            _span.innerHTML = _sel.innerHTML;
-                            _sel.parentNode.replaceChild(_span, _sel);
+
+            this.editorDirty = true;
+            
+            if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) {
+                YAHOO.log('Found execCommand override method: (cmd_' + action.toLowerCase() + ')', 'info', 'SimpleEditor');
+                var retValue = this['cmd_' + action.toLowerCase()](value);
+                exec = retValue[0];
+                if (retValue[1]) {
+                    action = retValue[1];
+                }
+                if (retValue[2]) {
+                    value = retValue[2];
+                }
+            }
+            if (exec) {
+                YAHOO.log('execCommand::(' + action + '), (' + value + ')', 'info', 'SimpleEditor');
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                    YAHOO.log('execCommand Failed', 'error', 'SimpleEditor');
+                }
+            } else {
+                YAHOO.log('OVERRIDE::execCommand::(' + action + '),(' + value + ') skipped', 'warn', 'SimpleEditor');
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+    /* {{{  Command Overrides */
+
+        /**
+        * @method cmd_backcolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used.
+        */
+        cmd_backcolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement(),
+                action = 'backcolor';
+
+            if (this.browser.gecko || this.browser.opera) {
+                this._setEditorStyle(true);
+                action = 'hilitecolor';
+            }
+            /**
+            * @browser opera
+            * @knownissue - Opera fails to assign a background color on an element that already has one.
+            *
+            if (this.browser.opera) {
+                if (!this._isElement(el, 'body') && Dom.getStyle(el, 'background-color')) {
+                    Dom.setStyle(el, 'background-color', value);
+                } else {
+                    this._createCurrentElement('span', { backgroundColor: value });
+                }
+                exec = false;
+            //} else if (!this._hasSelection()) {
+            } else if (el !== this._getDoc().body) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }*/
+
+            if (!this._isElement(el, 'body')) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }
+
+            return [exec, action];
+        },
+        /**
+        * @method cmd_forecolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used.
+        */
+        cmd_forecolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement();
+
+                if (!this._isElement(el, 'body')) {
+                    Dom.setStyle(el, 'color', value);
+                    this._selectNode(el);
+                    exec = false;
+                } else {
+                    this._createCurrentElement('span', { color: value });
+                    this._selectNode(this.currentElement[0]);
+                    exec = false;
+                }
+                return [exec];
+        },
+        /**
+        * @method cmd_unlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used.
+        */
+        cmd_unlink: function(value) {
+            this._swapEl(this.currentElement[0], 'span', function(el) {
+                el.className = 'yui-non';
+            });
+            return [false];
+        },
+        /**
+        * @method cmd_createlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used.
+        */
+        cmd_createlink: function(value) {
+            var el = this._getSelectedElement(), _a = null;
+            if (this._hasParent(el, 'a')) {
+                this.currentElement[0] = this._hasParent(el, 'a');
+            } else if (!this._isElement(el, 'a')) {
+                this._createCurrentElement('a');
+                _a = this._swapEl(this.currentElement[0], 'a');
+                this.currentElement[0] = _a;
+            } else {
+                this.currentElement[0] = el;
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_insertimage
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used.
+        */
+        cmd_insertimage: function(value) {
+            var exec = true, _img = null, action = 'insertimage',
+                el = this._getSelectedElement();
+
+            if (value === '') {
+                value = this.get('blankimage');
+            }
+
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            
+            YAHOO.log('InsertImage: ' + el.tagName, 'info', 'SimpleEditor');
+            if (this._isElement(el, 'img')) {
+                this.currentElement[0] = el;
+                exec = false;
+            } else {
+                if (this._getDoc().queryCommandEnabled(action)) {
+                    this._getDoc().execCommand('insertimage', false, value);
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                            YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                            this.currentElement[0] = imgs[i];
                         }
-                        exec = false;
+                    }
+                    exec = false;
+                } else {
+                    if (el == this._getDoc().body) {
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this._getDoc().body.appendChild(_img);
                     } else {
-                        if (this.browser.ie || this.browser.webkit || this.browser.opera) {
-                            this._createCurrentElement(value);
-                            exec = false;
+                        this._createCurrentElement('img');
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                    }
+                    this.currentElement[0] = _img;
+                    exec = false;
+                }
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_inserthtml
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used.
+        */
+        cmd_inserthtml: function(value) {
+            var exec = true, action = 'inserthtml', _span = null, _range = null;
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                YAHOO.log('More Safari DOM tricks (inserthtml)', 'info', 'EditorSafari');
+                this._createCurrentElement('img');
+                _span = this._getDoc().createElement('span');
+                _span.innerHTML = value;
+                this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                exec = false;
+            } else if (this.browser.ie) {
+                _range = this._getRange();
+                if (_range.item) {
+                    _range.item(0).outerHTML = value;
+                } else {
+                    _range.pasteHTML(value);
+                }
+                exec = false;                    
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_list
+        * @param tag The tag of the list you want to create (eg, ul or ol)
+        * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods.
+        */
+        cmd_list: function(tag) {
+            var exec = true, list = null, li = 0, el = null, str = '',
+                selEl = this._getSelectedElement(), action = 'insertorderedlist';
+                if (tag == 'ul') {
+                    action = 'insertunorderedlist';
+                }
+            /**
+            * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+            * @browser Safari 2.x
+            * The issue with this workaround is that when applied to a set of text
+            * that has BR's in it, Safari may or may not pick up the individual items as
+            * list items. This is fixed in WebKit (Safari 3)
+            */
+            if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) {
+                    YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor');
+                    el = selEl.parentNode;
+                    list = this._getDoc().createElement('span');
+                    YAHOO.util.Dom.addClass(list, 'yui-non');
+                    str = '';
+                    var lis = el.getElementsByTagName('li');
+                    for (li = 0; li < lis.length; li++) {
+                        str += '<div>' + lis[li].innerHTML + '</div>';
+                    }
+                    list.innerHTML = str;
+                    this.currentElement[0] = el;
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                } else {
+                    YAHOO.log('Create list item', 'info', 'SimpleEditor');
+                    this._createCurrentElement(tag.toLowerCase());
+                    list = this._getDoc().createElement(tag);
+                    for (li = 0; li < this.currentElement.length; li++) {
+                        var newli = this._getDoc().createElement('li');
+                        newli.innerHTML = this.currentElement[li].innerHTML + '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        list.appendChild(newli);
+                        if (li > 0) {
+                            this.currentElement[li].parentNode.removeChild(this.currentElement[li]);
                         }
                     }
-                    break;
-                case 'backcolor':
-                    if (this.browser.gecko || this.browser.opera) {
-                        this._setEditorStyle(true);
-                        action = 'hilitecolor';
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                    this.currentElement[0] = list;
+                    var _h = this.currentElement[0].firstChild;
+                    _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0];
+                    this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length);
+                }
+                exec = false;
+            } else {
+                el = this._getSelectedElement();
+                YAHOO.log(el.tagName);
+                if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list..
+                    YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor');
+                    if (this.browser.ie) {
+                        if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) {
+                            el = el.getElementsByTagName('li')[0];
+                        }
+                        YAHOO.log('Undo IE', 'info', 'SimpleEditor');
+                        str = '';
+                        var lis2 = el.parentNode.getElementsByTagName('li');
+                        for (var j = 0; j < lis2.length; j++) {
+                            str += lis2[j].innerHTML + '<br>';
+                        }
+                        var newEl = this._getDoc().createElement('span');
+                        newEl.innerHTML = str;
+                        el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    } else {
+                        this.nodeChange();
+                        this._getDoc().execCommand(action, '', el.parentNode);
+                        this.nodeChange();
                     }
-                    break;
-                case 'hiddenelements':
-                    this._showHidden();
                     exec = false;
-                    break;
-                case 'unlink':
-                    //var el = this._getSelectedElement();
-                    var el = this.currentElement[0];
-                    el.removeAttribute('title');
-                    el.removeAttribute('tag');
-                    el.removeAttribute('target');
-                    el.removeAttribute('href');
-                    YAHOO.util.Dom.addClass(el, 'yui-non');
-                    YAHOO.util.Dom.removeClass(el, 'yui-tag-a');
-                    YAHOO.util.Dom.removeClass(el, 'yui-tag');
-                    exec = false;
-                    break;
-                case 'createlink':
-                    var el = this._getSelectedElement();
-                    if (!el || (el.getAttribute('tag') != 'a')) {
-                        this._createCurrentElement('a');
+                }
+                if (this.browser.opera) {
+                    var self = this;
+                    window.setTimeout(function() {
+                        var liso = self._getDoc().getElementsByTagName('li');
+                        for (var i = 0; i < liso.length; i++) {
+                            if (liso[i].innerHTML.toLowerCase() == '<br>') {
+                                liso[i].parentNode.parentNode.removeChild(liso[i].parentNode);
+                            }
+                        }
+                    },30);
+                }
+                if (this.browser.ie && exec) {
+                    var html = '';
+                    if (this._getRange().html) {
+                        html = '<li>' + this._getRange().html+ '</li>';
                     } else {
-                        this.currentElement[0] = el;
+                        var t = this._getRange().text.split('\n');
+                        if (t.length > 1) {
+                            html = '';
+                            for (var ie = 0; ie < t.length; ie++) {
+                                html += '<li>' + t[ie] + '</li>';
+                            }
+                        } else {
+                            html = '<li>' + this._getRange().text + '</li>';
+                        }
                     }
+
+                    this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
                     exec = false;
-                    break;
-                case 'insertimage':
-                    if (value == '') {
-                        value = this.get('blankimage');
-                    }
-                    /**
-                    * @knownissue
-                    * @browser Safari 2.x
-                    * @description The issue here is that we have no way of knowing where the cursor position is
-                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
-                    */
-                    
-                    var el = this._getSelectedElement();
+                }
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_insertorderedlist
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used.
+        */
+        cmd_insertorderedlist: function(value) {
+            return [this.cmd_list('ol')];
+        },
+        /**
+        * @method cmd_insertunorderedlist 
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used.
+        */
+        cmd_insertunorderedlist: function(value) {
+            return [this.cmd_list('ul')];
+        },
+        /**
+        * @method cmd_fontname
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used.
+        */
+        cmd_fontname: function(value) {
+            var exec = true,
+                selEl = this._getSelectedElement();
 
-                    if (el && el.tagName && (el.tagName.toLowerCase() == 'img')) {
-                        this.currentElement[0] = el;
-                        exec = false;
-                    } else {
-                        if (this._getDoc().queryCommandEnabled(action)) {
-                            this._getDoc().execCommand('insertimage', false, value);
-                            var imgs = this._getDoc().getElementsByTagName('img');
-                            for (var i = 0; i < imgs.length; i++) {
-                                if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
-                                    YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
-                                    this.currentElement[0] = imgs[i];
-                                }
+            this.currentFont = value;
+            if (selEl && selEl.tagName && !this._hasSelection()) {
+                YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_fontsize
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used.
+        */
+        cmd_fontsize: function(value) {
+            if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection())) {
+                YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+            } else if (!this._isElement(this._getSelectedElement(), 'body')) {
+                var el = this._getSelectedElement();
+                YAHOO.util.Dom.setStyle(el, 'fontSize', value);
+                this._selectNode(el);
+            } else {
+                this._createCurrentElement('span', {'fontSize': value });
+                this._selectNode(this.currentElement[0]);
+            }
+            return [false];
+        },
+    /* }}} */
+        /**
+        * @private
+        * @method _swapEl
+        * @param {HTMLElement} el The element to swap with
+        * @param {String} tagName The tagname of the element that you wish to create
+        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.
+        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place.
+        */
+        _swapEl: function(el, tagName, callback) {
+            var _el = this._getDoc().createElement(tagName);
+            _el.innerHTML = el.innerHTML;
+            if (typeof callback == 'function') {
+                callback.call(this, _el);
+            }
+            el.parentNode.replaceChild(_el, el);
+            return _el;
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for an element with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to the 
+        * <code>this.currentElement</code> array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            tagName = ((tagName) ? tagName : 'a');
+            var tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                var el = null;
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+
+                        for (var k in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, k)) {
+                                el.style[k] = tagStyle[k];
                             }
-                            exec = false;
-                        } else {
-                            this._createCurrentElement('img');
-                            var _img = this._getDoc().createElement('img');
-                            _img.setAttribute('src', value);
-                            YAHOO.util.Dom.addClass(_img, 'yui-img');
-                            this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
-                            this.currentElement[0] = _img;
-                            exec = false;
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var j = 0; j < imgs.length; j++) {
+                        if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[j].parentNode.replaceChild(el, imgs[j]);
+                            this.currentElement[this.currentElement.length] = el;
                         }
                     }
-                    
-                    break;
-                case 'inserthtml':
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
                     /**
                     * @knownissue
                     * @browser Safari 2.x
                     * @description The issue here is that we have no way of knowing where the cursor position is
                     * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
                     */
-                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
-                        YAHOO.log('More Safari DOM tricks (inserthtml)', 'info', 'EditorSafari');
-                        this._createCurrentElement('img');
-                        var _span = this._getDoc().createElement('span');
-                        _span.innerHTML = value;
-                        this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
-                        exec = false;
-                    } else if (this.browser.ie) {
-                        var _range = this._getRange();
-                        if (_range.item) {
-                            _range.item(0).outerHTML = value;
-                        } else {
-                            _range.pasteHTML(value);
+                    el = _elCreate();
+                    if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) {
+                        if (this._isElement(tar, 'html')) {
+                            tar = this._getDoc().body;
                         }
-                        exec = false;                    
-                    }
-                    break;
-                case 'removeformat':
-                    /**
-                    * @knownissue Remove Format issue
-                    * @browser Safari 2.x
-                    * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
-                    * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
-                    * So here we are making the best possible guess and acting on it.
-                    */
-                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
-                        this._createCurrentElement('span');
-                        YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
-                        var re= /<\S[^><]*>/g;
-                        var str = this.currentElement[0].innerHTML.replace(re, '');
-                        var _txt = this._getDoc().createTextNode(str);
-                        this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
-                        
-                        exec = false;
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
                     }
-                    break;
-                case 'superscript':
-                case 'subscript':
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
                     if (this.browser.webkit) {
-                        YAHOO.log('Safari dom fun again (' + action + ')..', 'info', 'EditorSafari');
-                        var tag = action.toLowerCase().substring(0, 3);
-                        this._createCurrentElement(tag);
-                        if (this.currentElement[0].parentNode.tagName.toLowerCase() == tag) {
-                            YAHOO.log('we are a child of tag (' + tag + '), reverse process', 'info', 'EditorSafari');
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = this.currentElement[0].innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        if (this.browser.webkit3) {
+                            this._getSelection().collapseToStart();
                         } else {
-                            var _sub = this._getDoc().createElement(tag);
-                            _sub.innerHTML = this.currentElement[0].innerHTML;
-                            this.currentElement[0].parentNode.replaceChild(_sub, this.currentElement[0]);
-                        }
-                        exec = false;
-                    }
-                    break;
-                case 'formatblock':
-                    value = 'blockquote';
-                    if (this.browser.webkit) {
-                        this._createCurrentElement('blockquote');
-                        if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-blockquote')) {
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = this.currentElement[0].innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-                        }
-                        exec = false;
-                    } else {
-                        var tar = Event.getTarget(this.currentEvent);
-                        if (tar && tar.tagName && (tar.tagName.toLowerCase() == 'blockquote')) {
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = tar.innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            tar.parentNode.replaceChild(span, tar);
-                            exec = false;
+                            this._getSelection().collapse(true);
                         }
                     }
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                var _tmp6 = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);
+                for (var e1 = 0; e1 < _tmp1.length; e1++) {
+                    _tmp[_tmp.length] = _tmp1[e1];
+                }
+                for (var e6 = 0; e6 < _tmp6.length; e6++) {
+                    _tmp[_tmp.length] = _tmp6[e6];
+                }
+                for (var e2 = 0; e2 < _tmp2.length; e2++) {
+                    _tmp[_tmp.length] = _tmp2[e2];
+                }
+                for (var e3 = 0; e3 < _tmp3.length; e3++) {
+                    _tmp[_tmp.length] = _tmp3[e3];
+                }
+                for (var e4 = 0; e4 < _tmp4.length; e4++) {
+                    _tmp[_tmp.length] = _tmp4[e4];
+                }
+                for (var e5 = 0; e5 < _tmp5.length; e5++) {
+                    _tmp[_tmp.length] = _tmp5[e5];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) {
+                            var fc = _tmp[i].getElementsByTagName('li')[0];
+                            _tmp[i].style.fontFamily = 'inherit';
+                            fc.style.fontFamily = 'inherit';
+                            el.innerHTML = fc.innerHTML;
+                            fc.innerHTML = '';
+                            fc.appendChild(el);
+                            this.currentElement[this.currentElement.length] = el;
+                        } else if (this._isElement(_tmp[i], 'li')) {
+                            _tmp[i].innerHTML = '';
+                            _tmp[i].appendChild(el);
+                            _tmp[i].style.fontFamily = 'inherit';
+                            this.currentElement[this.currentElement.length] = el;
+                        } else {
+                            if (_tmp[i].parentNode) {
+                                _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                                this.currentElement[this.currentElement.length] = el;
+                                this.currentEvent = null;
+                                if (this.browser.webkit) {
+                                    //Force Safari to focus the new element
+                                    this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                    if (this.browser.webkit3) {
+                                        this._getSelection().collapseToStart();
+                                    } else {
+                                        this._getSelection().collapse(true);
+                                    }
+                                }
+                                if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                    this._getSelection().empty();
+                                }
+                                if (this.browser.gecko) {
+                                    this._getSelection().collapseToStart();
+                                }
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var e = 0; e < len; e++) {
+                    if ((e + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[e] && this.currentElement[e].nextSibling) {
+                            if (this._isElement(this.currentElement[e], 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[e].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        * @return String
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('element').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            html = this._cleanIncomingHTML(html);
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            var b = this._getDoc().body;
+            if (b === null) {
+                YAHOO.log('Body is null, returning null.', 'error', 'SimpleEditor');
+                return null;
+            }
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method show
+        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.
+        */
+        show: function() {
+            if (this.browser.gecko) {
+                this._setDesignMode('on');
+                this._focusWindow();
+            }
+            if (this.browser.webkit) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._setInitialContent.call(self);
+                }, 10);
+            }
+            //Adding this will close all other Editor window's when showing this one.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            //Put the iframe back in place
+            this.get('iframe').setStyle('position', 'static');
+            this.get('iframe').setStyle('left', '');
+        },
+        /**
+        * @method hide
+        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.
+        */
+        hide: function() {
+            //Adding this will close all other Editor window's.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this._fixNodesTimer) {
+                clearTimeout(this._fixNodesTimer);
+                this._fixNodesTimer = null;
+            }
+            if (this._nodeChangeTimer) {
+                clearTimeout(this._nodeChangeTimer);
+                this._nodeChangeTimer = null;
+            }
+            this._lastNodeChange = 0;
+            //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.
+            this.get('iframe').setStyle('position', 'absolute');
+            this.get('iframe').setStyle('left', '-9999px');
+        },
+        /**
+        * @method _cleanIncomingHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the input
+        * @return {String} The filtered HTML
+        */
+        _cleanIncomingHTML: function(html) {
+            html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+            html = html.replace(/<\/strong>/gi, '</b>');   
+
+            //replace embed before em check
+            html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+            html = html.replace(/<\/embed>/gi, '</YUI_EMBED>');
+
+            html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+            html = html.replace(/<\/em>/gi, '</i>');
+            
+            //Put embed tags back in..
+            html = html.replace(/<YUI_EMBED([^>]*)>/gi, '<embed$1>');
+            html = html.replace(/<\/YUI_EMBED>/gi, '</embed>');
+            if (this.get('plainText')) {
+                YAHOO.log('Filtering as plain text', 'info', 'SimpleEditor');
+                html = html.replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+                html = html.replace(/  /gi, '&nbsp;&nbsp;'); //Replace all double spaces
+                html = html.replace(/\t/gi, '&nbsp;&nbsp;&nbsp;&nbsp;'); //Replace all tabs
+            }
+            //Removing Script Tags from the Editor
+            html = html.replace(/<script([^>]*)>/gi, '<bad>');
+            html = html.replace(/<\/script([^>]*)>/gi, '</bad>');
+            html = html.replace(/&lt;script([^>]*)&gt;/gi, '<bad>');
+            html = html.replace(/&lt;\/script([^>]*)&gt;/gi, '</bad>');
+            //Replace the line feeds
+            html = html.replace(/\n/g, '<YUI_LF>').replace(/\r/g, '<YUI_LF>');
+            //Remove Bad HTML elements (used to be script nodes)
+            html = html.replace(new RegExp('<bad([^>]*)>(.*?)<\/bad>', 'gi'), '');
+            //Replace the lines feeds
+            html = html.replace(/<YUI_LF>/g, '\n');
+            return html;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @return {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                html = this.getEditorHTML();
+            }
+            var markup = this.get('markup');
+            //Make some backups...
+            html = this.pre_filter_linebreaks(html, markup);
+
+                   html = html.replace(/<img([^>]*)\/>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+
+                   html = html.replace(/<input([^>]*)\/>/gi, '<YUI_INPUT$1>');
+                   html = html.replace(/<input([^>]*)>/gi, '<YUI_INPUT$1>');
+
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+                   html = html.replace(/<blockquote([^>]*)>/gi, '<YUI_BQ$1>');
+                   html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>');
+
+                   html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+                   html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>');
+
+            //Convert b and i tags to strong and em tags
+            if ((markup == 'semantic') || (markup == 'xhtml')) {
+                html = html.replace(/<i(\s+[^>]*)?>/gi, '<em$1>');
+                html = html.replace(/<\/i>/gi, '</em>');
+                html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                html = html.replace(/<\/b>/gi, '</strong>');
+            }
+            
+            //Case Changing
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+            if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) {
+                html = html.replace(new RegExp('<font([^>]*)face="([^>]*)">(.*?)<\/font>', 'gi'), '<span $1 style="font-family: $2;">$3</span>');
+                html = html.replace(/<u/gi, '<span style="text-decoration: underline;"');
+                html = html.replace(/\/u>/gi, '/span>');
+                if (markup == 'css') {
+                    html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+                    html = html.replace(/<\/em>/gi, '</i>');
+                    html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+                    html = html.replace(/<\/strong>/gi, '</b>');
+                    html = html.replace(/<b/gi, '<span style="font-weight: bold;"');
+                    html = html.replace(/\/b>/gi, '/span>');
+                    html = html.replace(/<i/gi, '<span style="font-style: italic;"');
+                    html = html.replace(/\/i>/gi, '/span>');
+                }
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            } else {
+                       html = html.replace(/<u/gi, '<u');
+                       html = html.replace(/\/u>/gi, '/u>');
+            }
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+            html = this.filter_safari(html);
+
+            html = this.filter_internals(html);
+
+            html = this.filter_all_rgb(html);
+
+            //Replace our backups with the real thing
+            html = this.post_filter_linebreaks(html, markup);
+
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1 />');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1 />');
+            } else {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1>');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1>');
+            }
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            html = this.filter_invalid_lists(html);
+
+                   html = html.replace(/<YUI_BQ([^>]*)>/g, '<blockquote$1>');
+                   html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>');
+
+                   html = html.replace(/<YUI_EMBED([^>]*)>/g, '<embed$1>');
+                   html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>');
+
+            //Trim the output, removing whitespace from the beginning and end
+            html = YAHOO.lang.trim(html);
+
+            if (this.get('removeLineBreaks')) {
+                html = html.replace(/\n/g, '').replace(/\r/g, '');
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            }
+            
+            //First empty span
+            if (html.substring(0, 6).toLowerCase() == '<span>')  {
+                html = html.substring(6);
+                //Last empty span
+                if (html.substring(html.length - 7, html.length).toLowerCase() == '</span>')  {
+                    html = html.substring(0, html.length - 7);
+                }
+            }
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (Lang.isObject(v) && v.keepContents) {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1');
+                    } else {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '');
+                    }
+                }
+            }
+
+            this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html });
+
+            return html;
+        },
+        /**
+        * @method filter_invalid_lists
+        * @param String html The HTML string to filter
+        * @description Filters invalid ol and ul list markup, converts this: <li></li><ol>..</ol> to this: <li></li><li><ol>..</ol></li>
+        */
+        filter_invalid_lists: function(html) {
+            html = html.replace(/<\/li>\n/gi, '</li>');
+
+            html = html.replace(/<\/li><ol>/gi, '</li><li><ol>');
+            html = html.replace(/<\/ol>/gi, '</ol></li>');
+            html = html.replace(/<\/ol><\/li>\n/gi, "</ol>\n");
+
+            html = html.replace(/<\/li><ul>/gi, '</li><li><ul>');
+            html = html.replace(/<\/ul>/gi, '</ul></li>');
+            html = html.replace(/<\/ul><\/li>\n/gi, "</ul>\n");
+
+            html = html.replace(/<\/li>/gi, "</li>\n");
+            html = html.replace(/<\/ol>/gi, "</ol>\n");
+            html = html.replace(/<ol>/gi, "<ol>\n");
+            html = html.replace(/<ul>/gi, "<ul>\n");
+            return html;
+        },
+        /**
+        * @method filter_safari
+        * @param String html The HTML string to filter
+        * @description Filters strings specific to Safari
+        * @return String
+        */
+        filter_safari: function(html) {
+            if (this.browser.webkit) {
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+                //Remove bogus LI's
+                html = html.replace(/<li><\/li>/gi, '');
+                html = html.replace(/<li> <\/li>/gi, '');
+                html = html.replace(/<li>  <\/li>/gi, '');
+                //Remove bogus DIV's
+                html = html.replace(/<div><\/div>/gi, '');
+                html = html.replace(/<div> <\/div>/gi, '');
+            }
+            return html;
+        },
+        /**
+        * @method filter_internals
+        * @param String html The HTML string to filter
+        * @description Filters internal RTE strings and bogus attrs we don't want
+        * @return String
+        */
+        filter_internals: function(html) {
+                   html = html.replace(/\r/g, '');
+            //Fix stuff we don't want
+               html = html.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+            //Fix last BR in LI
+                   html = html.replace(/<YUI_BR><\/li>/gi, '</li>');
+
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ style=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            if (this.browser.ie) {
+                       html = html.replace(/ class= /gi, '');
+                       html = html.replace(/ class= >/gi, '');
+                       html = html.replace(/_height="([^>])"/gi, '');
+                       html = html.replace(/_width="([^>])"/gi, '');
+            }
+            
+            return html;
+        },
+        /**
+        * @method filter_all_rgb
+        * @param String str The HTML string to filter
+        * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00"
+        * @return String
+        */
+        filter_all_rgb: function(str) {
+            var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi");
+            var arr = str.match(exp);
+            if (Lang.isArray(arr)) {
+                for (var i = 0; i < arr.length; i++) {
+                    var color = this.filter_rgb(arr[i]);
+                    str = str.replace(arr[i].toString(), color);
+                }
+            }
+            
+            return str;
+        },
+        /**
+        * @method filter_rgb
+        * @param String css The CSS string containing rgb(#,#,#);
+        * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00
+        * @return String
+        */
+        filter_rgb: function(css) {
+            if (css.toLowerCase().indexOf('rgb') != -1) {
+                var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+                var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(',');
+            
+                if (rgb.length == 5) {
+                    var r = parseInt(rgb[1], 10).toString(16);
+                    var g = parseInt(rgb[2], 10).toString(16);
+                    var b = parseInt(rgb[3], 10).toString(16);
+
+                    r = r.length == 1 ? '0' + r : r;
+                    g = g.length == 1 ? '0' + g : g;
+                    b = b.length == 1 ? '0' + b : b;
+
+                    css = "#" + r + g + b;
+                }
+            }
+            return css;
+        },
+        /**
+        * @method pre_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        pre_filter_linebreaks: function(html, markup) {
+            if (this.browser.webkit) {
+                       html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                       html = html.replace(/<br class="webkit-block-placeholder">/gi, '<YUI_BR>');
+            }
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br (.*?)>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<br \/>/gi, '<YUI_BR>');
+                   html = html.replace(/<div><YUI_BR><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+            //Fix last BR
+               html = html.replace(/<YUI_BR>$/, '');
+            //Fix last BR in P
+               html = html.replace(/<YUI_BR><\/p>/g, '</p>');
+            return html;
+        },
+        /**
+        * @method post_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        post_filter_linebreaks: function(html, markup) {
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_BR>/g, '<br />');
+            } else {
+                       html = html.replace(/<YUI_BR>/g, '<br>');
+            }
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Override Method for Advanced Editor
+        */
+        _renderPanel: function() {
+        },
+        /**
+        * @method openWindow
+        * @description Override Method for Advanced Editor
+        */
+        openWindow: function(win) {
+        },
+        /**
+        * @method moveWindow
+        * @description Override Method for Advanced Editor
+        */
+        moveWindow: function() {
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        _closeWindow: function() {
+        },
+        /**
+        * @method closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        closeWindow: function() {
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.resetAllButtons();
+            this._focusWindow();        
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            var textArea = this.get('element');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            this.set('handleSubmit', false); //Remove the submit handler
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'SimpleEditor';
+            if (this.get && this.get('element_cont')) {
+                str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event cleanHTML
+* @description Event is fired after the cleanHTML method is called.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property _instances
+        * @description A reference to all editors on the page.
+        * @type Object
+        */
+        _instances: {},
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>
+        */
+        panel: null,
+        /**
+        * @method getEditorById
+        * @description Returns a reference to the Editor object associated with the given textarea
+        * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of
+        * @return Object <a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a>
+        */
+        getEditorById: function(id) {
+            if (!YAHOO.lang.isString(id)) {
+                //Not a string, assume a node Reference
+                id = id.id;
+            }
+            if (this._instances[id]) {
+                return this._instances[id];
+            }
+            return false;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorInfo.
+        * @return {String}
+        */
+        toString: function() {
+            var len = 0;
+            for (var i in this._instances) {
+                len++;
+            }
+            return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')';
+        }
+    };
+
+
+
+    
+})();
+/**
+ * @module editor
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, container_core, simpleeditor
+ * @optional dragdrop, animation, menu, button
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    Toolbar = YAHOO.widget.Toolbar;
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class Editor
+     * @extends YAHOO.widget.SimpleEditor
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.Editor = function(el, attrs) {
+        YAHOO.log('Editor Initalizing', 'info', 'Editor');
+        YAHOO.widget.Editor.superclass.constructor.call(this, el, attrs);
+    };
+
+    /**
+    * @private
+    * @method _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @return {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+
+    YAHOO.extend(YAHOO.widget.Editor, YAHOO.widget.SimpleEditor, {
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',    
+        /**
+        * @property STR_CLOSE_WINDOW
+        * @description The Title of the close button in the Editor Window
+        * @type String
+        */
+        STR_CLOSE_WINDOW: 'Close Window',
+        /**
+        * @property STR_CLOSE_WINDOW_NOTE
+        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
+        * @type String
+        */
+        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Control + Shift + W key',
+        /**
+        * @property STR_IMAGE_PROP_TITLE
+        * @description The title for the Image Property Editor Window
+        * @type String
+        */
+        STR_IMAGE_PROP_TITLE: 'Image Options',
+        /**
+        * @property STR_IMAGE_URL
+        * @description The label string for Image URL
+        * @type String
+        */
+        STR_IMAGE_URL: 'Image Url',
+        /**
+        * @property STR_IMAGE_TITLE
+        * @description The label string for Image Description
+        * @type String
+        */
+        STR_IMAGE_TITLE: 'Description',
+        /**
+        * @property STR_IMAGE_SIZE
+        * @description The label string for Image Size
+        * @type String
+        */
+        STR_IMAGE_SIZE: 'Size',
+        /**
+        * @property STR_IMAGE_ORIG_SIZE
+        * @description The label string for Original Image Size
+        * @type String
+        */
+        STR_IMAGE_ORIG_SIZE: 'Original Size',
+        /**
+        * @property STR_IMAGE_COPY
+        * @description The label string for the image copy and paste message for Opera and Safari
+        * @type String
+        */
+        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
+        /**
+        * @property STR_IMAGE_PADDING
+        * @description The label string for the image padding.
+        * @type String
+        */
+        STR_IMAGE_PADDING: 'Padding',
+        /**
+        * @property STR_IMAGE_BORDER
+        * @description The label string for the image border.
+        * @type String
+        */
+        STR_IMAGE_BORDER: 'Border',
+        /**
+        * @property STR_IMAGE_TEXTFLOW
+        * @description The label string for the image text flow.
+        * @type String
+        */
+        STR_IMAGE_TEXTFLOW: 'Text Flow',
+        /**
+        * @property STR_LOCAL_FILE_WARNING
+        * @description The label string for the local file warning.
+        * @type String
+        */
+        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
+        /**
+        * @property STR_LINK_PROP_TITLE
+        * @description The label string for the Link Property Editor Window.
+        * @type String
+        */
+        STR_LINK_PROP_TITLE: 'Link Options',
+        /**
+        * @property STR_LINK_PROP_REMOVE
+        * @description The label string for the Remove link from text link inside the property editor.
+        * @type String
+        */
+        STR_LINK_PROP_REMOVE: 'Remove link from text',
+        /**
+        * @property STR_LINK_NEW_WINDOW
+        * @description The string for the open in a new window label.
+        * @type String
+        */
+        STR_LINK_NEW_WINDOW: 'Open in a new window.',
+        /**
+        * @property STR_LINK_TITLE
+        * @description The string for the link description.
+        * @type String
+        */
+        STR_LINK_TITLE: 'Description',
+        /**
+        * @protected
+        * @property CLASS_LOCAL_FILE
+        * @description CSS class applied to an element when it's found to have a local url.
+        * @type String
+        */
+        CLASS_LOCAL_FILE: 'warning-localfile',
+        /**
+        * @protected
+        * @property CLASS_HIDDEN
+        * @description CSS class applied to the body when the hiddenelements button is pressed.
+        * @type String
+        */
+        CLASS_HIDDEN: 'yui-hidden',
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'Editor');
+
+            this._defaultToolbar = {
+                collapse: true,
+                titlebar: 'Text Editing Tools',
+                draggable: false,
+                buttonType: 'advanced',
+                buttons: [
+                    { group: 'fontstyle', label: 'Font Name and Size',
+                        buttons: [
+                            { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                menu: [
+                                    { text: 'Arial', checked: true },
+                                    { text: 'Arial Black' },
+                                    { text: 'Comic Sans MS' },
+                                    { text: 'Courier New' },
+                                    { text: 'Lucida Console' },
+                                    { text: 'Tahoma' },
+                                    { text: 'Times New Roman' },
+                                    { text: 'Trebuchet MS' },
+                                    { text: 'Verdana' }
+                                ]
+                            },
+                            { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'textstyle', label: 'Font Style',
+                        buttons: [
+                            { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                            { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                            { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                            { type: 'separator' },
+                            { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
+                            { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
+                            { type: 'separator' },
+                            { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                            { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
+                            { type: 'separator' },
+                            { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
+                            { type: 'push', label: 'Show/Hide Hidden Elements', value: 'hiddenelements' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'alignment', label: 'Alignment',
+                        buttons: [
+                            { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
+                            { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
+                            { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
+                            { type: 'push', label: 'Justify', value: 'justifyfull' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'parastyle', label: 'Paragraph Style',
+                        buttons: [
+                        { type: 'select', label: 'Normal', value: 'heading', disabled: true,
+                            menu: [
+                                { text: 'Normal', value: 'none', checked: true },
+                                { text: 'Header 1', value: 'h1' },
+                                { text: 'Header 2', value: 'h2' },
+                                { text: 'Header 3', value: 'h3' },
+                                { text: 'Header 4', value: 'h4' },
+                                { text: 'Header 5', value: 'h5' },
+                                { text: 'Header 6', value: 'h6' }
+                            ]
+                        }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'indentlist', label: 'Indenting and Lists',
+                        buttons: [
+                            { type: 'push', label: 'Indent', value: 'indent', disabled: true },
+                            { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
+                            { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                            { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'insertitem', label: 'Insert Item',
+                        buttons: [
+                            { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                            { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                        ]
+                    }
+                ]
+            };
+
+            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute localFileWarning
+            * @description Should we throw the warning if we detect a file that is local to their machine?
+            * @default true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('localFileWarning', {
+                value: attr.locaFileWarning || true
+            });
+
+            /**
+            * @attribute hiddencss
+            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
+            * @default <code><pre>
+            .yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div, .yui-hidden p, .yui-hidden span, .yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table {
+                border: 1px dotted #ccc;
+            }
+            .yui-hidden .yui-non {
+                border: none;
+            }
+            .yui-hidden img {
+                padding: 2px;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('hiddencss', {
+                value: attr.hiddencss || '.yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }',
+                writeOnce: true
+            });
+           
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            YAHOO.widget.Editor.superclass._fixNodes.call(this);
+            var url = '';
+
+            var imgs = this._getDoc().getElementsByTagName('img');
+            for (var im = 0; im < imgs.length; im++) {
+                if (imgs[im].getAttribute('href', 2)) {
+                    url = imgs[im].getAttribute('src', 2);
+                    if (this._isLocalFile(url)) {
+                        Dom.addClass(imgs[im], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(imgs[im], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+            var fakeAs = this._getDoc().body.getElementsByTagName('a');
+            for (var a = 0; a < fakeAs.length; a++) {
+                if (fakeAs[a].getAttribute('href', 2)) {
+                    url = fakeAs[a].getAttribute('href', 2);
+                    if (this._isLocalFile(url)) {
+                        Dom.addClass(fakeAs[a], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(fakeAs[a], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { 'outdent': true },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { hiddenelements: true },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Override method that handles some new keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            YAHOO.widget.Editor.superclass._handleKeyDown.call(this, ev);
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 219: //Left
+                    action = 'justifyleft';
                     break;
-                case 'indent':
-                case 'outdent':
-                    this._createCurrentElement(action.toLowerCase());
-                    if (this.currentElement[0].parentNode) {
-                        if (action.toLowerCase() == 'outdent') {
-                            if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-indent')) {
-                                var span = this._getDoc().createElement('span');
-                                span.innerHTML = this.currentElement[0].innerHTML;
-                                YAHOO.util.Dom.addClass(span, 'yui-non');
-                                this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-                            }
+                case 220: //Center
+                    action = 'justifycenter';
+                    break;
+                case 221: //Right
+                    action = 'justifyright';
+                    break;
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+        },        
+        _handleCreateLinkClick: function() {
+            var el = this._getSelectedElement();
+            if (this._isElement(el, 'img')) {
+                this.STOP_EXEC_COMMAND = true;
+                this.currentElement[0] = el;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                return false;
+            }
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'Editor');
+                    return false;
+                }
+            }
+            
+            this.on('afterExecCommand', function() {
+
+                var win = new YAHOO.widget.EditorWindow('createlink', {
+                    width: '350px'
+                });
+                
+                var el = this.currentElement[0],
+                    url = '',
+                    title = '',
+                    target = '',
+                    localFile = false;
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                        if (this._isLocalFile(url)) {
+                            //Local File throw Warning
+                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                            win.setFooter(this.STR_LOCAL_FILE_WARNING);
+                            localFile = true;
+                        } else {
+                            win.setFooter(' ');
+                        }
+                    }
+                    if (el.getAttribute('title') !== null) {
+                        title = el.getAttribute('title');
+                    }
+                    if (el.getAttribute('target') !== null) {
+                        target = el.getAttribute('target');
+                    }
+                }
+                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
+                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
+                
+                var body = document.createElement('div');
+                body.innerHTML = str;
+
+                var unlinkCont = document.createElement('div');
+                unlinkCont.className = 'removeLink';
+                var unlink = document.createElement('a');
+                unlink.href = '#';
+                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
+                unlink.title = this.STR_LINK_PROP_REMOVE;
+                Event.on(unlink, 'click', function(ev) {
+                    Event.stopEvent(ev);
+                    this.execCommand('unlink');
+                    this.closeWindow();
+                }, this, true);
+                unlinkCont.appendChild(unlink);
+                body.appendChild(unlinkCont);
+
+                win.setHeader(this.STR_LINK_PROP_TITLE);
+                win.setBody(body);
+
+                Event.onAvailable('createlink_url', function() {
+                    window.setTimeout(function() {
+                        try {
+                            YAHOO.util.Dom.get('createlink_url').focus();
+                        } catch (e) {}
+                    }, 50);
+                    Event.on('createlink_url', 'blur', function() {
+                        var url = Dom.get('createlink_url');
+                        if (this._isLocalFile(url.value)) {
+                            //Local File throw Warning
+                            Dom.addClass(url, 'warning');
+                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                            this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
+                        } else {
+                            Dom.removeClass(url, 'warning');
+                            this.get('panel').setFooter(' ');
+                        }
+                    }, this, true);
+                }, this, true);
+
+                this.openWindow(win);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            var url = Dom.get('createlink_url'),
+                target = Dom.get('createlink_target'),
+                title = Dom.get('createlink_title'),
+                el = this.currentElement[0],
+                a = el;
+            if (url && url.value) {
+                var urlValue = url.value;
+                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        //Found an @ sign, prefix with mailto:
+                        urlValue = 'mailto:' + urlValue;
+                    } else {
+                        /* :// not found adding */
+                        if (urlValue.substring(0, 1) != '#') {
+                            urlValue = 'http:/'+'/' + urlValue;
+                        }
+                        
+                    }
+                }
+                el.setAttribute('href', urlValue);
+                if (target.checked) {
+                    el.setAttribute('target', target.value);
+                } else {
+                    el.setAttribute('target', '');
+                }
+                el.setAttribute('title', ((title.value) ? title.value : ''));
+
+            } else {
+                var _span = this._getDoc().createElement('span');
+                _span.innerHTML = el.innerHTML;
+                Dom.addClass(_span, 'yui-non');
+                el.parentNode.replaceChild(_span, el);
+            }
+            this.nodeChange();
+            this.currentElement = [];
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    YAHOO.log('Toolbar Button for (insertimage) was not found, skipping exec.', 'info', 'Editor');
+                    return false;
+                }
+            }
+            this._setBusy();
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    body = null,
+                    link = '',
+                    target = '',
+                    title = '',
+                    src = '',
+                    align = '',
+                    height = 75,
+                    width = 75,
+                    padding = 0,
+                    oheight = 0,
+                    owidth = 0,
+                    blankimage = false,
+                    win = new YAHOO.widget.EditorWindow('insertimage', {
+                        width: '415px'
+                    });
+
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                            blankimage = true;
                         }
                     }
-                    exec = false;
-                    break;
-                case 'insertorderedlist':
-                case 'insertunorderedlist':
-                    /**
-                    * @knownissue Safari 2.+ doesn't support ordered and unordered lists
-                    * @browser Safari 2.x
-                    * The issue with this workaround is that when applied to a set of text
-                    * that has BR's in it, Safari may or may not pick up the individual items as
-                    * list items. This is fixed in WebKit (Safari 3)
-                    */
-                    var tag = ((action.toLowerCase() == 'insertorderedlist') ? 'ol' : 'ul');
-                    //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) || this.browser.opera) {
-                    if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
-                        var selEl = this._getSelectedElement();
-                        if ((selEl.tagName.toLowerCase() == 'li') && (selEl.parentNode.tagName.toLowerCase() == tag)) {
-                            YAHOO.log('We already have a list, undo it', 'info', 'Editor');
-                            var el = selEl.parentNode;
-                            var list = this._getDoc().createElement('span');
-                            YAHOO.util.Dom.addClass(list, 'yui-non');
-                            var str = '';
-                            var lis = el.getElementsByTagName('li');
-                            for (var i = 0; i < lis.length; i++) {
-                                str += lis[i].innerHTML + '<br>';
+                    if (el.getAttribute('alt', 2)) {
+                        title = el.getAttribute('alt', 2);
+                    }
+                    if (el.getAttribute('title', 2)) {
+                        title = el.getAttribute('title', 2);
+                    }
+
+                    if (el.parentNode && this._isElement(el.parentNode, 'a')) {
+                        link = el.parentNode.getAttribute('href', 2);
+                        if (el.parentNode.getAttribute('target') !== null) {
+                            target = el.parentNode.getAttribute('target');
+                        }
+                    }
+                    height = parseInt(el.height, 10);
+                    width = parseInt(el.width, 10);
+                    if (el.style.height) {
+                        height = parseInt(el.style.height, 10);
+                    }
+                    if (el.style.width) {
+                        width = parseInt(el.style.width, 10);
+                    }
+                    if (el.style.margin) {
+                        padding = parseInt(el.style.margin, 10);
+                    }
+                    if (!el._height) {
+                        el._height = height;
+                    }
+                    if (!el._width) {
+                        el._width = width;
+                    }
+                    oheight = el._height;
+                    owidth = el._width;
+                }
+                var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
+                body = document.createElement('div');
+                body.innerHTML = str;
+
+                var tbarCont = document.createElement('div');
+                tbarCont.id = 'img_toolbar';
+                body.appendChild(tbarCont);
+
+                var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
+                str2 += '<label for="insertimage_link"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="insertimage_link" id="insertimage_link" value="' + link + '"></label>';
+                str2 += '<label for="insertimage_target"><strong>&nbsp;</strong><input type="checkbox" name="insertimage_target_" id="insertimage_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                var div = document.createElement('div');
+                div.innerHTML = str2;
+                body.appendChild(div);
+                win.cache = body;
+
+                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
+                    /* {{{ */ 
+                    buttonType: this._defaultToolbar.buttonType,
+                    buttons: [
+                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
+                            buttons: [
+                                { type: 'push', label: 'Left', value: 'left' },
+                                { type: 'push', label: 'Inline', value: 'inline' },
+                                { type: 'push', label: 'Block', value: 'block' },
+                                { type: 'push', label: 'Right', value: 'right' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
+                            buttons: [
+                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
+                            buttons: [
+                                { type: 'select', label: 'Border Size', value: 'bordersize',
+                                    menu: [
+                                        { text: 'none', value: '0', checked: true },
+                                        { text: '1px', value: '1' },
+                                        { text: '2px', value: '2' },
+                                        { text: '3px', value: '3' },
+                                        { text: '4px', value: '4' },
+                                        { text: '5px', value: '5' }
+                                    ]
+                                },
+                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
+                                    menu: [
+                                        { text: 'Solid', value: 'solid', checked: true },
+                                        { text: 'Dashed', value: 'dashed' },
+                                        { text: 'Dotted', value: 'dotted' }
+                                    ]
+                                },
+                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                });
+                
+                var bsize = '0';
+                var btype = 'solid';
+                if (el.style.borderLeftWidth) {
+                    bsize = parseInt(el.style.borderLeftWidth, 10);
+                }
+                if (el.style.borderLeftStyle) {
+                    btype = el.style.borderLeftStyle;
+                }
+                var bs_button = tbar.getButtonByValue('bordersize');
+                var bSizeStr = ((parseInt(bsize, 10) > 0) ? '' : 'none');
+                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
+                this._updateMenuChecked('bordersize', bsize, tbar);
+
+                var bt_button = tbar.getButtonByValue('bordertype');
+                bt_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '"></span>');
+                this._updateMenuChecked('bordertype', btype, tbar);
+                if (parseInt(bsize, 10) > 0) {
+                    tbar.enableButton(bt_button);
+                    tbar.enableButton(bs_button);
+                }
+
+                var cont = tbar.get('cont');
+                var hw = document.createElement('div');
+                hw.className = 'yui-toolbar-group yui-toolbar-group-height-width height-width';
+                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
+                var orgSize = '';
+                if ((height != oheight) || (width != owidth)) {
+                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                }
+                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
+                cont.insertBefore(hw, cont.firstChild);
+
+                Event.onAvailable('insertimage_width', function() {
+                    Event.on('insertimage_width', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_width').value, 10);
+                        if (value > 5) {
+                            el.style.width = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+                Event.onAvailable('insertimage_height', function() {
+                    Event.on('insertimage_height', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_height').value, 10);
+                        if (value > 5) {
+                            el.style.height = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+
+                if ((el.align == 'right') || (el.align == 'left')) {
+                    tbar.selectButton(el.align);
+                } else if (el.style.display == 'block') {
+                    tbar.selectButton('block');
+                } else {
+                    tbar.selectButton('inline');
+                }
+                if (parseInt(el.style.marginLeft, 10) > 0) {
+                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft, 10));
+                }
+                if (el.style.borderSize) {
+                    tbar.selectButton('bordersize');
+                    tbar.selectButton(parseInt(el.style.borderSize, 10));
+                }
+
+                tbar.on('colorPickerClicked', function(o) {
+                    var size = '1', type = 'solid', color = 'black';
+
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth, 10);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    var borderString = size + 'px ' + type + ' #' + o.color;
+                    el.style.border = borderString;
+                }, this.toolbar, true);
+
+                tbar.on('buttonClick', function(o) {
+                    var value = o.button.value,
+                        borderString = '';
+                    if (o.button.menucmd) {
+                        value = o.button.menucmd;
+                    }
+                    var size = '1', type = 'solid', color = 'black';
+
+                    /* All border calcs are done on the left border
+                        since our default interface only supports
+                        one border size/type and color */
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth, 10);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    switch(value) {
+                        case 'bordersize':
+                            if (this.browser.webkit && this._lastImage) {
+                                Dom.removeClass(this._lastImage, 'selected');
+                                this._lastImage = null;
                             }
-                            list.innerHTML = str;
 
-                        } else {
-                            YAHOO.log('Create list item', 'info', 'Editor');
-                            this._createCurrentElement(tag.toLowerCase());
-                            var el = this.currentElement[0];
-                            var list = this._getDoc().createElement(tag);
-                            if (tag == 'ol') {
-                                list.type = value;
+                            borderString = parseInt(o.button.value, 10) + 'px ' + type + ' ' + color;
+                            el.style.border = borderString;
+                            if (parseInt(o.button.value, 10) > 0) {
+                                tbar.enableButton('bordertype');
+                                tbar.enableButton('bordercolor');
+                            } else {
+                                tbar.disableButton('bordertype');
+                                tbar.disableButton('bordercolor');
+                            }
+                            break;
+                        case 'bordertype':
+                            if (this.browser.webkit && this._lastImage) {
+                                Dom.removeClass(this._lastImage, 'selected');
+                                this._lastImage = null;
                             }
-                            var li = this._getDoc().createElement('li');
-                            li.innerHTML = el.innerHTML + '&nbsp;';
-                            list.appendChild(li);
+                            borderString = size + 'px ' + o.button.value + ' ' + color;
+                            el.style.border = borderString;
+                            break;
+                        case 'right':
+                        case 'left':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = o.button.value;
+                            break;
+                        case 'inline':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = '';
+                            break;
+                        case 'block':
+                            tbar.deselectAllButtons();
+                            el.style.display = 'block';
+                            el.align = 'center';
+                            break;
+                        case 'padding':
+                            var _button = tbar.getButtonById(o.button.id);
+                            el.style.margin = _button.get('label') + 'px';
+                            break;
+                    }
+                    tbar.selectButton(o.button.value);
+                    this.moveWindow();
+                }, this, true);
+
+                win.setHeader(this.STR_IMAGE_PROP_TITLE);
+                win.setBody(body);
+                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                    win.setFooter(this.STR_IMAGE_COPY);
+                }
+                this.openWindow(win);
+
+                //Set event after openWindow..
+                Event.onAvailable('insertimage_url', function() {
+
+                    this.toolbar.selectButton('insertimage');
+
+                    window.setTimeout(function() {
+                        YAHOO.util.Dom.get('insertimage_url').focus();
+                        if (blankimage) {
+                            YAHOO.util.Dom.get('insertimage_url').select();
                         }
-                        el.parentNode.replaceChild(list, el);
-                        exec = false;
-                    } else {
-                        var el = this._getSelectedElement();
-                        if ((el.tagName.toLowerCase() == 'li') && (el.parentNode.tagName.toLowerCase() == tag) || (this.browser.ie && this._getRange().parentElement && this._getRange().parentElement.tagName && (this._getRange().parentElement.tagName.toLowerCase() == 'li'))) { //we are in a list..
-                            YAHOO.log('We already have a list, undo it', 'info', 'Editor');
-                            if (this.browser.ie) {
-                                YAHOO.log('Undo IE', 'info', 'Editor');
-                                exec = false;
-                                var str = '';
-                                var lis = el.parentNode.getElementsByTagName('li');
-                                for (var i = 0; i < lis.length; i++) {
-                                    str += lis[i].innerHTML + '<br>';
-                                }
-                                var newEl = this._getDoc().createElement('span');
-                                newEl.innerHTML = str;
-                                el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    }, 50);
+                    
+                    if (this.get('localFileWarning')) {
+                        Event.on('insertimage_link', 'blur', function() {
+                            var url = Dom.get('insertimage_link');
+                            if (this._isLocalFile(url.value)) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                                this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
                             } else {
-                                this.nodeChange();
-                                this._getDoc().execCommand(action, '', el.parentNode);
-                                this.nodeChange();
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    this.get('panel').setFooter(this.STR_IMAGE_COPY);
+                                }
                             }
-                        }
-                        if (this.browser.opera) {
-                            var self = this;
-                            window.setTimeout(function() {
-                                var lis = self._getDoc().getElementsByTagName('li');
-                                for (var i = 0; i < lis.length; i++) {
-                                    if (lis[i].innerHTML.toLowerCase() == '<br>') {
-                                        lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);
+                        }, this, true);
+
+                        Event.on('insertimage_url', 'blur', function() {
+                            var url = Dom.get('insertimage_url');
+                            if (this._isLocalFile(url.value)) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                                this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
+                            } else if (this.currentElement[0]) {
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    this.get('panel').setFooter(this.STR_IMAGE_COPY);
+                                }
+                                
+                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                                    this.currentElement[0].setAttribute('src', url.value);
+                                    var self = this,
+                                        img = new Image();
+
+                                    img.onerror = function() {
+                                        url.value = self.STR_IMAGE_HERE;
+                                        img.setAttribute('src', self.get('blankimage'));
+                                        self.currentElement[0].setAttribute('src', self.get('blankimage'));
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                    };
+                                    window.setTimeout(function() {
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                        if (self.currentElement && self.currentElement[0]) {
+                                            if (!self.currentElement[0]._height) {
+                                                self.currentElement[0]._height = img.height;
+                                            }
+                                            if (!self.currentElement[0]._width) {
+                                                self.currentElement[0]._width = img.width;
+                                            }
+                                        }
+                                        self.moveWindow();
+                                    }, 200);
+
+                                    if (url.value != this.STR_IMAGE_HERE) {
+                                        img.src = url.value;
                                     }
                                 }
-                            },30);
-                        }
-                        if (this.browser.ie && exec) {
-                            var html = '';
-                            if (this._getRange().html) {
-                                html = '<li>' + this._getRange().html+ '</li>';
-                            } else {
-                                html = '<li>' + this._getRange().text + '</li>';
                             }
-
-                            this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
-                            exec = false;
-                        }
-                    }
-                    break;
-                case 'fontname':
-                    var selEl = this._getSelectedElement();
-                    this.currentFont = value;
-                    if (selEl && selEl.tagName && !this._hasSelection()) {
-                        YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
-                        exec = false;
-                    }
-                    break;
-                case 'fontsize':
-                    if ((this.currentElement.length > 0) && (!this._hasSelection())) {
-                        YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
-                    } else {
-                        this._createCurrentElement('span', {'fontSize': value });
+                        }, this, true);
                     }
-                    exec = false;
-                    break;
-            }
-            if (exec) {
-                YAHOO.log('execCommand::(' + action + '), (' + value + ')', 'info', 'Editor');
-                try {
-                    this._getDoc().execCommand(action, false, value);
-                } catch(e) {
-                    YAHOO.log('execCommand Failed', 'error', 'Editor');
-                }
-            } else {
-                YAHOO.log('OVERRIDE::execCommand skipped', 'warn', 'Editor');
-            }
-            this.on('afterExecCommand', function() {
-                this.unsubscribeAll('afterExecCommand');
-                this.nodeChange();
+                }, this, true);
             });
-            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-            
         },
         /**
         * @private
-        * @method _createCurrentElement
-        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
-        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
-        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
-        * It will then search the document for a span with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to
-        * <code>this.currentElement</code>, so we now have an element reference to the element that was just modified. At this point we can use standard DOM manipulation to change it as we see fit.
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
         */
-        _createCurrentElement: function(tagName, tagStyle) {
-            var tagName = ((tagName) ? tagName : 'a'),
-                sel = this._getSelection(),
-                tar = null,
-                el = [],
-                _doc = this._getDoc();
-            
-            if (this.currentFont) {
-                if (!tagStyle) {
-                    tagStyle = {};
-                }
-                tagStyle.fontFamily = this.currentFont;
-                this.currentFont = null;
-            }
-            this.currentElement = [];
-
-            var _elCreate = function() {
-                switch (tagName) {
-                    case 'h1':
-                    case 'h2':
-                    case 'h3':
-                    case 'h4':
-                    case 'h5':
-                    case 'h6':
-                        var el = _doc.createElement(tagName);
-                        break;
-                    default:
-                        var el = _doc.createElement('span');
-                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
-                        YAHOO.util.Dom.addClass(el, 'yui-tag');
-                        el.setAttribute('tag', tagName);
-                        el.tabIndex = 1;
-
-                        for (var i in tagStyle) {
-                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, i)) {
-                                el.style[i] = tagStyle[i];
-                            }
-                        }
-                        break;
-                }
-                return el;
-            };
-
-            if (!this._hasSelection()) {
-                if (this._getDoc().queryCommandEnabled('insertimage')) {
-                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
-                    var imgs = this._getDoc().getElementsByTagName('img');
-                    for (var i = 0; i < imgs.length; i++) {
-                        if (imgs[i].getAttribute('src', 2) == 'yui-tmp-img') {
-                            el = _elCreate();
-                            imgs[i].parentNode.replaceChild(el, imgs[i]);
-                            this.currentElement[this.currentElement.length] = el;
-                            //this.currentElement = el;
+        _handleInsertImageWindowClose: function() {
+            var url = Dom.get('insertimage_url');
+            var title = Dom.get('insertimage_title');
+            var link = Dom.get('insertimage_link');
+            var target = Dom.get('insertimage_target');
+            var el = this.currentElement[0];
+            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                el.setAttribute('src', url.value);
+                el.setAttribute('title', title.value);
+                el.setAttribute('alt', title.value);
+                var par = el.parentNode;
+                if (link.value) {
+                    var urlValue = link.value;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            urlValue = 'http:/'+'/' + urlValue;
                         }
                     }
-                } else {
-                    if (this.currentEvent) {
-                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
-                    } else {
-                        //For Safari..
-                        tar = this._getDoc().body;                        
-                    }
-                }
-                if (tar) {
-                    /**
-                    * @knownissue
-                    * @browser Safari 2.x
-                    * @description The issue here is that we have no way of knowing where the cursor position is
-                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
-                    */
-                    el = _elCreate();
-                    if (tar.tagName.toLowerCase() == 'body') {
-                        tar.appendChild(el);
-                    } else if (tar.nextSibling) {
-                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    if (par && this._isElement(par, 'a')) {
+                        par.setAttribute('href', urlValue);
+                        if (target.checked) {
+                            par.setAttribute('target', target.value);
+                        } else {
+                            par.setAttribute('target', '');
+                        }
                     } else {
-                        tar.parentNode.appendChild(el);
-                    }
-                    //this.currentElement = el;
-                    this.currentElement[this.currentElement.length] = el;
-                    this.currentEvent = null;
-                    if (this.browser.webkit) {
-                        //Force Safari to focus the new element
-                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
-                        this._getSelection().collapse(true);   
-                    }
-                }
-            } else {
-                //Force CSS Styling for this action...
-                this._setEditorStyle(true);
-                this._getDoc().execCommand('fontname', false, 'yui-tmp');
-                var _tmp = [];
-                /* TODO: This needs to be cleaned up.. */
-                var _tmp1 = this._getDoc().getElementsByTagName('font');
-                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
-                var _tmp3 = this._getDoc().getElementsByTagName('span');
-                var _tmp4 = this._getDoc().getElementsByTagName('i');
-                var _tmp5 = this._getDoc().getElementsByTagName('b');
-                for (var e = 0; e < _tmp1.length; e++) {
-                    _tmp[_tmp.length] = _tmp1[e];
-                }
-                for (var e = 0; e < _tmp2.length; e++) {
-                    _tmp[_tmp.length] = _tmp2[e];
-                }
-                for (var e = 0; e < _tmp3.length; e++) {
-                    _tmp[_tmp.length] = _tmp3[e];
-                }
-                for (var e = 0; e < _tmp4.length; e++) {
-                    _tmp[_tmp.length] = _tmp4[e];
-                }
-                for (var e = 0; e < _tmp5.length; e++) {
-                    _tmp[_tmp.length] = _tmp5[e];
-                }
-                for (var i = 0; i < _tmp.length; i++) {
-                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
-                        var el = _elCreate();
-                        el.innerHTML = _tmp[i].innerHTML;
-                        if (_tmp[i].parentNode) {
-                            _tmp[i].parentNode.replaceChild(el, _tmp[i]);
-                            //this.currentElement = el;
-                            this.currentElement[this.currentElement.length] = el;
-                            this.currentEvent = null;
-                            if (this.browser.webkit) {
-                                //Force Safari to focus the new element
-                                this._getSelection().setBaseAndExtent(el, 0, el, 0);
-                                this._getSelection().collapse(true);   
-                            }
-                            if (this.browser.ie && tagStyle && tagStyle.fontSize) {
-                                this._getSelection().empty();
-                            }
-                            if (this.browser.gecko) {
-                                this._getSelection().collapseToStart();
-                            }
+                        var _a = this._getDoc().createElement('a');
+                        _a.setAttribute('href', urlValue);
+                        if (target.checked) {
+                            _a.setAttribute('target', target.value);
+                        } else {
+                            _a.setAttribute('target', '');
                         }
+                        el.parentNode.replaceChild(_a, el);
+                        _a.appendChild(el);
                     }
-                }
-                var len = this.currentElement.length;
-                for (var i = 0; i < len; i++) {
-                    if ((i + 1) != len) { //Skip the last one in the list
-                        if (this.currentElement[i] && this.currentElement[i].nextSibling) {
-                            if (this.currentElement[i].tagName && (this.currentElement[i].tagName.toLowerCase() != 'br')) {
-                                this.currentElement[this.currentElement.length] = this.currentElement[i].nextSibling;
-                            }
-                        }
+                } else {
+                    if (par && this._isElement(par, 'a')) {
+                        par.parentNode.replaceChild(el, par);
                     }
                 }
+            } else {
+                //No url/src given, remove the node from the document
+                el.parentNode.removeChild(el);
             }
-        },
-        /**
-        * @method saveHTML
-        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
-        */
-        saveHTML: function() {
-            var html = this.cleanHTML();
-            this.get('textarea').value = html;
-            return html;
-        },
-        /**
-        * @method setEditorHTML
-        * @param {String} html The html content to load into the editor
-        * @description Loads HTML into the editors body
-        */
-        setEditorHTML: function(html) {
-            this._getDoc().body.innerHTML = html;
+            this.currentElement = [];
             this.nodeChange();
         },
         /**
-        * @method getEditorHTML
-        * @description Gets the unprocessed/unfiltered HTML from the editor
-        */
-        getEditorHTML: function() {
-            return this._getDoc().body.innerHTML;
-        },
-        /**
-        * @method cleanHTML
-        * @param {String} html The unfiltered HTML
-        * @description Process the HTML with a few regexes to clean it up and stabilize the output
-        * @returns {String} The filtered HTML
-        */
-        cleanHTML: function(html) {
-            //Start Filtering Output
-            //Begin RegExs..
-            if (!html) { 
-                var html = this.getEditorHTML();
-            }
-            //Make some backups...
-                   html = html.replace(/<div><br><\/div>/gi, '<YUI_BR>');
-                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
-                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
-                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
-                   html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
-                   html = html.replace(/<br>/gi, '<YUI_BR>');
-                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
-                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
-                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
-                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
-
-            //Convert b and i tags to strong and em tags
-                   html = html.replace(/<i([^>]*)>/gi, '<em$1>');
-                   html = html.replace(/<\/i>/gi, '</em>');
-                   html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
-                   html = html.replace(/<\/b>/gi, '</strong>');
-
-                   html = html.replace(/<font/gi, '<font');
-                   html = html.replace(/<\/font>/gi, '</font>');
-                   html = html.replace(/<span/gi, '<span');
-                   html = html.replace(/<\/span>/gi, '</span>');
-                   html = html.replace(/<u/gi, '<u');
-                   html = html.replace(/\/u>/gi, '/u>');
-
-                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
-                   html = html.replace(/\/ol>/gi, '/ol>');
-                   html = html.replace(/<li/gi, '<li');
-                   html = html.replace(/\/li>/gi, '/li>');
-
-            //Handle the sudo A tags
-            html = html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>', 'gi'), '<a $1 $2>$3</a>');
-
-            //Safari only regexes
-            if (this.browser.webkit) {
-                //<DIV><SPAN class="Apple-style-span" style="line-height: normal;">Test THis</SPAN></DIV>
-                html = html.replace(/Apple-style-span/gi, '');
-                html = html.replace(/style="line-height: normal;"/gi, '');
-            }
-
-            //yui-tag-a yui-tag yui-non yui-img
-                   html = html.replace(/yui-tag-a/gi, '');
-                   html = html.replace(/yui-tag-span/gi, '');
-                   html = html.replace(/yui-tag/gi, '');
-                   html = html.replace(/yui-non/gi, '');
-                   html = html.replace(/yui-img/gi, '');
-                   html = html.replace(/ tag="span"/gi, '');
-                   html = html.replace(/ class=""/gi, '');
-                   html = html.replace(/ class=" "/gi, '');
-                   html = html.replace(/ class="  "/gi, '');
-                   html = html.replace(/ target=""/gi, '');
-                   html = html.replace(/ title=""/gi, '');
-
-            //Other string cleanup
-                   html = html.replace(/<br><li/gi, '<li');
-            //<P><br>&nbsp;</P>
-                   //html = html.replace(/<span >([^>]*)<\/span>/gi, '$1');
-                   //html = html.replace(/<div>([^>]*)<\/div>/gi, '$1');
-            
-            
-            //Replace our backups with the real thing
-                   html = html.replace(/<YUI_BR>/g, '<br>');
-                   html = html.replace(/<YUI_IMG([^>]*)>/g, '<img$1>');
-                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
-                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
-
-            return html;
-        },
-        /**
-        * @method clearEditorDoc
-        * @description Clear the doc of the Editor
-        */
-        clearEditorDoc: function() {
-            this._getDoc().body.innerHTML = '&nbsp;';
-        },
-        /**
         * @private
         * @method _renderPanel
         * @description Renders the panel used for Editor Windows to the document so we can start using it..
-        * @returns {<a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>}
+        * @return {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>}
         */
         _renderPanel: function() {
+            var panel = null;
             if (!YAHOO.widget.EditorInfo.panel) {
-                var panel = new YAHOO.widget.Panel(this.EDITOR_PANEL_ID, {
+                panel = new YAHOO.widget.Overlay(this.EDITOR_PANEL_ID, {
                     width: '300px',
                     iframe: true,
                     visible: false,
@@ -4675,7 +7188,7 @@ var Dom = YAHOO.util.Dom,
                 });
                 YAHOO.widget.EditorInfo.panel = panel;
             } else {
-                var panel = YAHOO.widget.EditorInfo.panel;
+                panel = YAHOO.widget.EditorInfo.panel;
             }
             this.set('panel', panel);
 
@@ -4702,8 +7215,9 @@ var Dom = YAHOO.util.Dom,
         * @description Opens a new "window/panel"
         */
         openWindow: function(win) {
+            YAHOO.log('openWindow: ' + win.name, 'info', 'Editor');
             this.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open..
-            Event.addListener(document, 'keypress', this._closeWindow, this, true);
+            Event.on(document, 'keypress', this._closeWindow, this, true);
             if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
                 YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
             }
@@ -4715,13 +7229,21 @@ var Dom = YAHOO.util.Dom,
                 elXY = Dom.getXY(this.get('iframe').get('element')),
                 panel = this.get('panel'),
                 newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
-                wWidth = (parseInt(win.attrs.width) / 2),
-                align = 'center';
+                wWidth = (parseInt(win.attrs.width, 10) / 2),
+                align = 'center',
+                body = null;
 
             this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel });
 
             body = document.createElement('div');
             body.className = this.CLASS_PREFIX + '-body-cont';
+            for (var b in this.browser) {
+                if (this.browser[b]) {
+                    Dom.addClass(body, b);
+                    break;
+                }
+            }
+            Dom.addClass(body, ((YAHOO.widget.Button && (this._defaultToolbar.buttonType == 'advanced')) ? 'good-button' : 'no-button'));
 
             var _note = document.createElement('h3');
             _note.className = 'yui-editor-skipheader';
@@ -4730,14 +7252,13 @@ var Dom = YAHOO.util.Dom,
             form = document.createElement('form');
             form.setAttribute('method', 'GET');
             var windowName = win.name;
-            Event.addListener(form, 'submit', function(ev) {
+            Event.on(form, 'submit', function(ev) {
                 var evName = 'window' + windowName + 'Submit';
                 self.fireEvent(evName, { type: evName, target: this });
                 Event.stopEvent(ev);
             }, this, true);
             body.appendChild(form);
 
-            Dom.setStyle(panel.element.firstChild, 'width', win.attrs.width);
             if (Lang.isObject(win.body)) { //Assume it's a reference
                 form.appendChild(win.body);
             } else { //Assume it's a string
@@ -4749,7 +7270,7 @@ var Dom = YAHOO.util.Dom,
             _close.innerHTML = 'X';
             _close.title = this.STR_CLOSE_WINDOW;
             _close.className = 'close';
-            Event.addListener(_close, 'click', function() {
+            Event.on(_close, 'click', function() {
                 this.closeWindow();
             }, this, true);
             var _knob = document.createElement('span');
@@ -4767,21 +7288,29 @@ var Dom = YAHOO.util.Dom,
             _header.appendChild(_knob);
             panel.setBody(' '); //Clear the current body
             panel.setFooter(' '); //Clear the current footer
-            if (win.footer != null) {
+            if (win.footer !== null) {
                 panel.setFooter(win.footer);
+                Dom.addClass(panel.footer, 'open');
+            } else {
+                Dom.removeClass(panel.footer, 'open');
             }
             panel.appendToBody(body); //Append the new DOM node to it
-            panel.showEvent.subscribe(function() {
-                Event.addListener(panel.element, 'click', function(ev) {
+            var fireShowEvent = function() {
+                panel.bringToTop();
+                Event.on(panel.element, 'click', function(ev) {
                     Event.stopPropagation(ev);
                 });
-            }, this, true);
-            panel.hideEvent.subscribe(function() {
+                this._setBusy(true);
+                panel.showEvent.unsubscribe(fireShowEvent);
+            };
+            panel.showEvent.subscribe(fireShowEvent, this, true);
+            var fireCloseEvent = function() {
                 this.currentWindow = null;
                 var evName = 'window' + windowName + 'Close';
-                this.fireEvent(evName, { type: evName, target: this });
-
-            }, this, true);
+                this.fireEvent(evName, { type: evName, target: this });
+                panel.hideEvent.unsubscribe(fireCloseEvent);
+            };
+            panel.hideEvent.subscribe(fireCloseEvent, this, true);
             this.currentWindow = win;
             this.moveWindow(true);
             panel.show();
@@ -4802,32 +7331,35 @@ var Dom = YAHOO.util.Dom,
                 panel = this.get('panel'),
                 //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
                 newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])],
-                wWidth = (parseInt(win.attrs.width) / 2),
+                wWidth = (parseInt(win.attrs.width, 10) / 2),
                 align = 'center',
                 orgXY = panel.cfg.getProperty('xy'),
-                _knob = win._knob;
+                _knob = win._knob,
+                xDiff = 0,
+                yDiff = 0,
+                anim = false;
+
 
             newXY[0] = ((newXY[0] - wWidth) + 20);
             //Account for the Scroll bars in a scrolled editor window.
             newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc());
             newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc());
             
-
-
-            if (this.currentElement[0].tagName && (this.currentElement[0].tagName.toLowerCase() == 'img')) {
+            if (this._isElement(this.currentElement[0], 'img')) {
                 if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) {
                     newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size
                     newXY[1] = (newXY[1] + 75); //Placeholder sizea
                 } else {
-                    var w = parseInt(this.currentElement[0].width);
-                    var h = parseInt(this.currentElement[0].height);
+                    var w = parseInt(this.currentElement[0].width, 10);
+                    var h = parseInt(this.currentElement[0].height, 10);
                     newXY[0] = (newXY[0] + (w / 2));
                     newXY[1] = (newXY[1] + h);
                 }
                 newXY[1] = newXY[1] + 15;
             } else {
-                if (Dom.getStyle(this.currentElement[0], 'fontSize').indexOf('px') != -1) {
-                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize')) + 5;
+                var fs = Dom.getStyle(this.currentElement[0], 'fontSize');
+                if (fs && fs.indexOf && fs.indexOf('px') != -1) {
+                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize'), 10) + 5;
                 } else {
                     newXY[1] = newXY[1] + 20;
                 }
@@ -4837,17 +7369,24 @@ var Dom = YAHOO.util.Dom,
                 align = 'left';
             }
 
-            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth))) {
-                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth)) - (wWidth * 2) - 5);
+            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10))) {
+                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10)) - (wWidth * 2) - 5);
                 align = 'right';
             }
             
             try {
-                var xDiff = (newXY[0] - orgXY[0]);
-                var yDiff = (newXY[1] - orgXY[1]);
-            } catch (e) {
-                var xDiff = 0;
-                var yDiff = 0;
+                xDiff = (newXY[0] - orgXY[0]);
+                yDiff = (newXY[1] - orgXY[1]);
+            } catch (e) {}
+
+
+            var iTop = elXY[1] + parseInt(this.get('height'), 10);
+            var iLeft = elXY[0] + parseInt(this.get('width'), 10);
+            if (newXY[1] > iTop) {
+                newXY[1] = iTop;
+            }
+            if (newXY[0] > iLeft) {
+                newXY[0] = (iLeft / 2);
             }
             
             //Convert negative numbers to positive so we can get the difference in distance
@@ -4859,19 +7398,19 @@ var Dom = YAHOO.util.Dom,
                     elW = 0;
 
                 if (this.currentElement[0].width) {
-                    elW = (parseInt(this.currentElement[0].width) / 2);
+                    elW = (parseInt(this.currentElement[0].width, 10) / 2);
                 }
 
                 var leftOffset = xy[0] + elXY[0] + elW;
                 _knobLeft = leftOffset - newXY[0];
                 //Check to see if the knob will go off either side & reposition it
-                if (_knobLeft > (parseInt(win.attrs.width) - 40)) {
-                    _knobLeft = parseInt(win.attrs.width) - 40;
+                if (_knobLeft > (parseInt(win.attrs.width, 10) - 1)) {
+                    _knobLeft = parseInt(win.attrs.width, 10) - 1;
                 } else if (_knobLeft < 40) {
-                    _knobLeft = 40;
+                    _knobLeft = 1;
                 }
                 if (isNaN(_knobLeft)) {
-                    _knobLeft = 40;
+                    _knobLeft = 1;
                 }
                 if (force) {
                     if (_knob) {
@@ -4879,12 +7418,12 @@ var Dom = YAHOO.util.Dom,
                     }
                     if (this.get('animate')) {
                         Dom.setStyle(panel.element, 'opacity', '0');
-                        var anim = new YAHOO.util.Anim(panel.element, {
+                        anim = new YAHOO.util.Anim(panel.element, {
                             opacity: {
                                 from: 0,
                                 to: 1
                             }
-                        }, .1, YAHOO.util.Easing.easeOut);
+                        }, 0.1, YAHOO.util.Easing.easeOut);
                         panel.cfg.setProperty('xy', newXY);
                         anim.onComplete.subscribe(function() {
                             if (this.browser.ie) {
@@ -4897,7 +7436,7 @@ var Dom = YAHOO.util.Dom,
                     }
                 } else {
                     if (this.get('animate')) {
-                        var anim = new YAHOO.util.Anim(panel.element, {}, .5, YAHOO.util.Easing.easeOut);
+                        anim = new YAHOO.util.Anim(panel.element, {}, 0.5, YAHOO.util.Easing.easeOut);
                         anim.attributes = {
                             top: {
                                 to: newXY[1]
@@ -4905,18 +7444,18 @@ var Dom = YAHOO.util.Dom,
                             left: {
                                 to: newXY[0]
                             }
-                        }
+                        };
                         anim.onComplete.subscribe(function() {
                             panel.cfg.setProperty('xy', newXY);
                         });
                         //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed ..
-                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, .5, YAHOO.util.Easing.easeOut)
+                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, 0.5, YAHOO.util.Easing.easeOut);
 
                         var _knobAnim = new YAHOO.util.Anim(_knob, {
                             left: {
                                 to: _knobLeft
                             }
-                        }, .75, YAHOO.util.Easing.easeOut);
+                        }, 0.6, YAHOO.util.Easing.easeOut);
                         anim.animate();
                         iframeAnim.animate();
                         _knobAnim.animate();
@@ -4934,7 +7473,7 @@ var Dom = YAHOO.util.Dom,
         * @param {Event} ev The keypress Event that we are trapping
         */
         _closeWindow: function(ev) {
-            if (ev.keyCode == 27) {
+            if ((ev.charCode == 87) && ev.shiftKey && ev.ctrlKey) {
                 if (this.currentWindow) {
                     this.closeWindow();
                 }
@@ -4945,6 +7484,7 @@ var Dom = YAHOO.util.Dom,
         * @description Close the currently open EditorWindow.
         */
         closeWindow: function() {
+            YAHOO.log('closeWindow: ' + this.currentWindow.name, 'info', 'Editor');
             YAHOO.widget.EditorInfo.window = {};
             this.fireEvent('closeWindow', { type: 'closeWindow', win: this.currentWindow });
             this.currentWindow = null;
@@ -4953,29 +7493,220 @@ var Dom = YAHOO.util.Dom,
             this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel
             this.unsubscribeAll('afterExecCommand');
             this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed
+            this.toolbar.resetAllButtons();
             this._focusWindow();
             Event.removeListener(document, 'keypress', this._closeWindow);
         },
+        /* {{{  Command Overrides - These commands are only over written when we are using the advanced version */
         /**
-        * @method destroy
-        * @description Destroys the editor, all of it's elements and objects.
-        * @return {Boolean}
+        * @method cmd_heading
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('heading') is used.
         */
-        destroy: function() {
-            this.saveHTML();
-            this.toolbar.destroy();
-            Dom.setStyle(this.get('textarea'), 'display', 'block');
-            var textArea = this.get('textarea');
-            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
-            this.get('element_cont').get('element').innerHTML = '';
-            //Brutal Object Destroy
-            for (var i in this) {
-                if (Lang.hasOwnProperty(this, i)) {
-                    this[i] = null;
+        cmd_heading: function(value) {
+            var exec = true,
+                el = null,
+                action = 'heading',
+                _sel = this._getSelection(),
+                _selEl = this._getSelectedElement();
+
+            if (_selEl) {
+                _sel = _selEl;
+            }
+            
+            if (this.browser.ie) {
+                action = 'formatblock';
+            }
+            if (value == 'none') {
+                if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
+                    if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
+                        _sel = _sel.parentNode;
+                    }
+                    if (this._isElement(_sel, 'html')) {
+                        return [false];
+                    }
+                    el = this._swapEl(_selEl, 'span', function(el) {
+                        el.className = 'yui-non';
+                    });
+                    this._selectNode(el);
+                    this.currentElement[0] = el;
                 }
+                exec = false;
+            } else {
+                if (this._isElement(_selEl, 'h1') || this._isElement(_selEl, 'h2') || this._isElement(_selEl, 'h3') || this._isElement(_selEl, 'h4') || this._isElement(_selEl, 'h5') || this._isElement(_selEl, 'h6')) {
+                    el = this._swapEl(_selEl, value);
+                    this._selectNode(el);
+                    this.currentElement[0] = el;
+                } else {
+                    this._createCurrentElement(value);
+                    this._selectNode(this.currentElement[0]);
+                }
+                exec = false;
             }
-            return true;
-        },        
+            return [exec, action];
+        },
+        /**
+        * @method cmd_hiddenelements
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('hiddenelements') is used.
+        */
+        cmd_hiddenelements: function(value) {
+            if (this._showingHiddenElements) {
+                //Don't auto highlight the hidden button
+                this._lastButton = null;
+                YAHOO.log('Enabling hidden CSS File', 'info', 'SimpleEditor');
+                this._showingHiddenElements = false;
+                this.toolbar.deselectButton('hiddenelements');
+                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
+            } else {
+                YAHOO.log('Disabling hidden CSS File', 'info', 'SimpleEditor');
+                this._showingHiddenElements = true;
+                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
+                this.toolbar.selectButton('hiddenelements');
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_removeformat
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('removeformat') is used.
+        */
+        cmd_removeformat: function(value) {
+            var exec = true;
+            /**
+            * @knownissue Remove Format issue
+            * @browser Safari 2.x
+            * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
+            * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
+            * So here we are making the best possible guess and acting on it.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled('removeformat')) {
+                var _txt = this._getSelection()+'';
+                this._createCurrentElement('span');
+                this.currentElement[0].className = 'yui-non';
+                this.currentElement[0].innerHTML = _txt;
+                for (var i = 1; i < this.currentElement.length; i++) {
+                    this.currentElement[i].parentNode.removeChild(this.currentElement[i]);
+                }
+                /*
+                this._createCurrentElement('span');
+                YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
+                var re= /<\S[^><]*>/g;
+                var str = this.currentElement[0].innerHTML.replace(re, '');
+                var _txt = this._getDoc().createTextNode(str);
+                this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
+                */
+                
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_script
+        * @param action action passed from the execCommand method
+        * @param value Value passed from the execCommand method
+        * @description This is a combined execCommand override method. It is called from the cmd_superscript and cmd_subscript methods.
+        */
+        cmd_script: function(action, value) {
+            var exec = true, tag = action.toLowerCase().substring(0, 3),
+                _span = null, _selEl = this._getSelectedElement();
+
+            if (this.browser.webkit) {
+                YAHOO.log('Safari dom fun again (' + action + ')..', 'info', 'EditorSafari');
+                if (this._isElement(_selEl, tag)) {
+                    YAHOO.log('we are a child of tag (' + tag + '), reverse process', 'info', 'EditorSafari');
+                    _span = this._swapEl(this.currentElement[0], 'span', function(el) {
+                        el.className = 'yui-non';
+                    });
+                    this._selectNode(_span);
+                } else {
+                    this._createCurrentElement(tag);
+                    var _sub = this._swapEl(this.currentElement[0], tag);
+                    this._selectNode(_sub);
+                    this.currentElement[0] = _sub;
+                }
+                exec = false;
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_superscript
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('superscript') is used.
+        */
+        cmd_superscript: function(value) {
+            return [this.cmd_script('superscript', value)];
+        },
+        /**
+        * @method cmd_subscript
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('subscript') is used.
+        */
+        cmd_subscript: function(value) {
+            return [this.cmd_script('subscript', value)];
+        },
+        /**
+        * @method cmd_indent
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('indent') is used.
+        */
+        cmd_indent: function(value) {
+            var exec = true, selEl = this._getSelectedElement(), _bq = null;
+
+            if (this.browser.webkit || this.browser.ie || this.browser.gecko) {
+                if (this._isElement(selEl, 'blockquote')) {
+                    _bq = this._getDoc().createElement('blockquote');
+                    _bq.innerHTML = selEl.innerHTML;
+                    selEl.innerHTML = '';
+                    selEl.appendChild(_bq);
+                    this._selectNode(_bq);
+                } else {
+                    this._createCurrentElement('blockquote');
+                    for (var i = 0; i < this.currentElement.length; i++) {
+                        _bq = this._getDoc().createElement('blockquote');
+                        _bq.innerHTML = this.currentElement[i].innerHTML;
+                        this.currentElement[i].parentNode.replaceChild(_bq, this.currentElement[i]);
+                        this.currentElement[i] = _bq;
+                    }
+                    this._selectNode(this.currentElement[0]);
+                }
+                exec = false;
+            } else {
+                value = 'blockquote';
+            }
+            return [exec, 'indent', value];
+        },
+        /**
+        * @method cmd_outdent
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('outdent') is used.
+        */
+        cmd_outdent: function(value) {
+            var exec = true, selEl = this._getSelectedElement(), _bq = null, _span = null;
+            if (this.browser.webkit || this.browser.ie || this.browser.gecko) {
+                selEl = this._getSelectedElement();
+                if (this._isElement(selEl, 'blockquote')) {
+                    var par = selEl.parentNode;
+                    if (this._isElement(selEl.parentNode, 'blockquote')) {
+                        par.innerHTML = selEl.innerHTML;
+                        this._selectNode(par);
+                    } else {
+                        _span = this._getDoc().createElement('span');
+                        _span.innerHTML = selEl.innerHTML;
+                        YAHOO.util.Dom.addClass(_span, 'yui-non');
+                        par.replaceChild(_span, selEl);
+                        this._selectNode(_span);
+                    }
+                } else {
+                    YAHOO.log('Can not outdent, we are not inside a blockquote', 'warn', 'Editor');
+                }
+                exec = false;
+            } else {
+                value = 'blockquote';
+            }
+            return [exec, 'indent', value];
+        },
+        /* }}}*/        
         /**
         * @method toString
         * @description Returns a string representing the editor.
@@ -4989,135 +7720,6 @@ var Dom = YAHOO.util.Dom,
             return str;
         }
     });
-
-/**
-* @event toolbarLoaded
-* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterRender
-* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorContentLoaded
-* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorMouseUp
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorMouseDown
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorDoubleClick
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyUp
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyPress
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyDown
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeNodeChange
-* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterNodeChange
-* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeExecCommand
-* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterExecCommand
-* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeOpenWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterOpenWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event closeWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event windowCMDOpen
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event windowCMDClose
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-
-/**
-     * @description Singleton object used to track the open window objects and panels across the various open editors
-     * @class EditorInfo
-     * @static
-    */
-    YAHOO.widget.EditorInfo = {
-        /**
-        * @private
-        * @property window
-        * @description A reference to the currently open window object in any editor on the page.
-        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
-        */
-        window: {},
-        /**
-        * @private
-        * @property panel
-        * @description A reference to the currently open panel in any editor on the page.
-        * @type Object <a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>
-        */
-        panel: null
-    }
-
     /**
      * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown.
      * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor.
@@ -5138,7 +7740,7 @@ var Dom = YAHOO.util.Dom,
         * @description The window attributes
         */
         this.attrs = attrs;
-    }
+    };
 
     YAHOO.widget.EditorWindow.prototype = {
         /**
@@ -5198,8 +7800,40 @@ var Dom = YAHOO.util.Dom,
             return 'Editor Window (' + this.name + ')';
         }
     };
+/**
+* @event beforeOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event closeWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDOpen
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDClose
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
 
-
-    
 })();
-YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.3.0", build: "442"});
+YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.5.0", build: "895"});
index 38662e2cc7f5694cec1607f326a6e6ab8a41fe5e..942a6cd7c5f69cda941991f4e1b5eca947f772f1 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang;YAHOO.widget.Toolbar=function(el,attrs){if(Lang.isObject(arguments[0])&&!Dom.get(el).nodeType){var attrs=el;}
-var local_attrs=(attrs||{});var oConfig={element:null,attributes:local_attrs}
-if(Lang.isString(el)&&Dom.get(el)){oConfig.element=Dom.get(el);}else if(Lang.isObject(el)&&Dom.get(el)&&Dom.get(el).nodeType){oConfig.element=Dom.get(el);}
-if(!oConfig.element){oConfig.element=document.createElement('DIV');oConfig.element.id=Dom.generateId();if(local_attrs.container&&Dom.get(local_attrs.container)){Dom.get(local_attrs.container).appendChild(oConfig.element);}}
-if(!oConfig.element.id){oConfig.element.id=((Lang.isString(el))?el:Dom.generateId());}
-var cont=document.createElement('DIV');oConfig.attributes.cont=cont;Dom.addClass(cont,'yui-toolbar-subcont')
-oConfig.element.appendChild(cont);oConfig.attributes.element=oConfig.element;oConfig.attributes.id=oConfig.element.id;YAHOO.widget.Toolbar.superclass.constructor.call(this,oConfig.element,oConfig.attributes);}
-function _addMenuClasses(ev,na,o){Dom.addClass(this.element,'yui-toolbar-'+o.get('value')+'-menu');if(Dom.hasClass(o._button.parentNode.parentNode,'yui-toolbar-select')){Dom.addClass(this.element,'yui-toolbar-select-menu');}
-var items=this.getItems();for(var i=0;i<items.length;i++){Dom.addClass(items[i].element,'yui-toolbar-'+o.get('value')+'-'+((items[i].value)?items[i].value.replace(/ /g,'-').toLowerCase():items[i]._oText.nodeValue.replace(/ /g,'-').toLowerCase()));Dom.addClass(items[i].element,'yui-toolbar-'+o.get('value')+'-'+((items[i].value)?items[i].value.replace(/ /g,'-'):items[i]._oText.nodeValue.replace(/ /g,'-')));}
-this._setWidth();};YAHOO.extend(YAHOO.widget.Toolbar,YAHOO.util.Element,{dd:null,_colorData:{'#111111':'Obsidian','#2D2D2D':'Dark Gray','#434343':'Shale','#5B5B5B':'Flint','#737373':'Gray','#8B8B8B':'Concrete','#A2A2A2':'Gray','#B9B9B9':'Titanium','#000000':'Black','#D0D0D0':'Light Gray','#E6E6E6':'Silver','#FFFFFF':'White','#BFBF00':'Pumpkin','#FFFF00':'Yellow','#FFFF40':'Banana','#FFFF80':'Pale Yellow','#FFFFBF':'Butter','#525330':'Raw Siena','#898A49':'Mildew','#AEA945':'Olive','#7F7F00':'Paprika','#C3BE71':'Earth','#E0DCAA':'Khaki','#FCFAE1':'Cream','#60BF00':'Cactus','#80FF00':'Chartreuse','#A0FF40':'Green','#C0FF80':'Pale Lime','#DFFFBF':'Light Mint','#3B5738':'Green','#668F5A':'Lime Gray','#7F9757':'Yellow','#407F00':'Clover','#8A9B55':'Pistachio','#B7C296':'Light Jade','#E6EBD5':'Breakwater','#00BF00':'Spring Frost','#00FF80':'Pastel Green','#40FFA0':'Light Emerald','#80FFC0':'Sea Foam','#BFFFDF':'Sea Mist','#033D21':'Dark Forrest','#438059':'Moss','#7FA37C':'Medium Green','#007F40':'Pine','#8DAE94':'Yellow Gray Green','#ACC6B5':'Aqua Lung','#DDEBE2':'Sea Vapor','#00BFBF':'Fog','#00FFFF':'Cyan','#40FFFF':'Turquoise Blue','#80FFFF':'Light Aqua','#BFFFFF':'Pale Cyan','#033D3D':'Dark Teal','#347D7E':'Gray Turquoise','#609A9F':'Green Blue','#007F7F':'Seaweed','#96BDC4':'Green Gray','#B5D1D7':'Soapstone','#E2F1F4':'Light Turquoise','#0060BF':'Summer Sky','#0080FF':'Sky Blue','#40A0FF':'Electric Blue','#80C0FF':'Light Azure','#BFDFFF':'Ice Blue','#1B2C48':'Navy','#385376':'Biscay','#57708F':'Dusty Blue','#00407F':'Sea Blue','#7792AC':'Sky Blue Gray','#A8BED1':'Morning Sky','#DEEBF6':'Vapor','#0000BF':'Deep Blue','#0000FF':'Blue','#4040FF':'Cerulean Blue','#8080FF':'Evening Blue','#BFBFFF':'Light Blue','#212143':'Deep Indigo','#373E68':'Sea Blue','#444F75':'Night Blue','#00007F':'Indigo Blue','#585E82':'Dockside','#8687A4':'Blue Gray','#D2D1E1':'Light Blue Gray','#6000BF':'Neon Violet','#8000FF':'Blue Violet','#A040FF':'Violet Purple','#C080FF':'Violet Dusk','#DFBFFF':'Pale Lavender','#302449':'Cool Shale','#54466F':'Dark Indigo','#655A7F':'Dark Violet','#40007F':'Violet','#726284':'Smoky Violet','#9E8FA9':'Slate Gray','#DCD1DF':'Violet White','#BF00BF':'Royal Violet','#FF00FF':'Fuchsia','#FF40FF':'Magenta','#FF80FF':'Orchid','#FFBFFF':'Pale Magenta','#4A234A':'Dark Purple','#794A72':'Medium Purple','#936386':'Cool Granite','#7F007F':'Purple','#9D7292':'Purple Moon','#C0A0B6':'Pale Purple','#ECDAE5':'Pink Cloud','#BF005F':'Hot Pink','#FF007F':'Deep Pink','#FF409F':'Grape','#FF80BF':'Electric Pink','#FFBFDF':'Pink','#451528':'Purple Red','#823857':'Purple Dino','#A94A76':'Purple Gray','#7F003F':'Rose','#BC6F95':'Antique Mauve','#D8A5BB':'Cool Marble','#F7DDE9':'Pink Granite','#C00000':'Apple','#FF0000':'Fire Truck','#FF4040':'Pale Red','#FF8080':'Salmon','#FFC0C0':'Warm Pink','#441415':'Sepia','#82393C':'Rust','#AA4D4E':'Brick','#800000':'Brick Red','#BC6E6E':'Mauve','#D8A3A4':'Shrimp Pink','#F8DDDD':'Shell Pink','#BF5F00':'Dark Orange','#FF7F00':'Orange','#FF9F40':'Grapefruit','#FFBF80':'Canteloupe','#FFDFBF':'Wax','#482C1B':'Dark Brick','#855A40':'Dirt','#B27C51':'Tan','#7F3F00':'Nutmeg','#C49B71':'Mustard','#E1C4A8':'Pale Tan','#FDEEE0':'Marble'},_colorPicker:null,STR_COLLAPSE:'Collapse Toolbar',STR_SPIN_LABEL:'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',STR_SPIN_UP:'Click to increase the value of this input',STR_SPIN_DOWN:'Click to decrease the value of this input',_titlebar:null,_disabled:null,browser:YAHOO.env.ua,_buttonList:null,_buttonGroupList:null,_sep:null,_sepCount:null,_dragHandle:null,_toolbarConfigs:{renderer:true},CLASS_CONTAINER:'yui-toolbar-container',CLASS_DRAGHANDLE:'yui-toolbar-draghandle',CLASS_SEPARATOR:'yui-toolbar-separator',CLASS_DISABLED:'yui-toolbar-disabled',CLASS_PREFIX:'yui-toolbar',init:function(p_oElement,p_oAttributes){YAHOO.widget.Toolbar.superclass.init.call(this,p_oElement,p_oAttributes);},initAttributes:function(attr){YAHOO.widget.Toolbar.superclass.initAttributes.call(this,attr);var el=this.get('element');this.addClass(this.CLASS_CONTAINER);this.setAttributeConfig('buttons',{value:[],writeOnce:true,method:function(data){for(var i in data){if(Lang.hasOwnProperty(data,i)){if(data[i].type=='separator'){this.addSeparator();}else if(data[i].group!=undefined){this.addButtonGroup(data[i]);}else{this.addButton(data[i]);}}}}});this.setAttributeConfig('disabled',{value:false,method:function(disabled){if(!Lang.isObject(this._disabled)){this._disabled={};}
-if(disabled){this.addClass(this.CLASS_DISABLED);this.set('draggable',false);}else{this.removeClass(this.CLASS_DISABLED);if(this._configs.draggable._initialConfig.value){this.set('draggable',true);}}
-var len=this._buttonList.length;for(var i=0;i<len;i++){if(disabled){if(this._buttonList[i].get('disabled')){this._disabled[i]=true;}else{this._disabled[i]=null;}
-this.disableButton(this._buttonList[i].get('id'));}else{var _button=this._buttonList[i];var _check=_button._configs.disabled._initialConfig.value;if(this._disabled[i]){_check=true;}
-if(!_check){this.enableButton(_button.get('id'));}}}}});this.setAttributeConfig('grouplabels',{value:true,writeOnce:true});this.setAttributeConfig('cont',{value:attr.cont,readOnly:true});this.setAttributeConfig('collapse',{value:false});this.setAttributeConfig('titlebar',{value:false,method:function(titlebar){if(titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}
-this._titlebar=document.createElement('DIV');Dom.addClass(this._titlebar,this.CLASS_PREFIX+'-titlebar');if(Lang.isString(titlebar)){var h2=document.createElement('h2');h2.tabIndex='-1';h2.innerHTML=titlebar;this._titlebar.appendChild(h2);}
-if(this.get('collapse')){var collapse=document.createElement('SPAN');collapse.innerHTML='X';collapse.title=this.STR_COLLAPSE;Dom.addClass(collapse,'collapse');this._titlebar.appendChild(collapse);Event.addListener(collapse,'click',function(){if(Dom.getStyle(this.get('cont'),'display')=='none'){Dom.setStyle(this.get('cont'),'display','block');Dom.removeClass(collapse,'collapsed');this.fireEvent('toolbarExpanded',{type:'toolbarExpanded',target:this});}else{Dom.setStyle(this.get('cont'),'display','none');Dom.addClass(collapse,'collapsed');this.fireEvent('toolbarCollapsed',{type:'toolbarCollapsed',target:this});}},this,true);}
-if(this.get('draggable')){this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._titlebar);Dom.addClass(this._titlebar,'draggable');}
-if(this.get('firstChild')){this.insertBefore(this._titlebar,this.get('firstChild'));}else{this.appendChild(this._titlebar);}}else if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}});this.setAttributeConfig('draggable',{value:(attr.draggable||false),method:function(draggable){var el=this.get('element');if(draggable&&!this.get('titlebar')){if(!this._dragHandle){this._dragHandle=document.createElement('SPAN');this._dragHandle.innerHTML='|';this._dragHandle.setAttribute('title','Click to drag the toolbar');this._dragHandle.id=this.get('id')+'_draghandle';Dom.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get('cont').hasChildNodes()){this.get('cont').insertBefore(this._dragHandle,this.get('cont').firstChild);}else{this.get('cont').appendChild(this._dragHandle);}
-this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}
-if(this._titlebar){if(draggable){this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._titlebar);Dom.addClass(this._titlebar,'draggable');}else{Dom.removeClass(this._titlebar,'draggable');if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(value){var ret=true;if(!YAHOO.util.DD){ret=false;}
-return ret;}});},addButtonGroup:function(oGroup){if(!this.get('element')){this._queue[this._queue.length]=['addButtonGroup',arguments];return false;}
-if(!this.hasClass(this.CLASS_PREFIX+'-grouped')){this.addClass(this.CLASS_PREFIX+'-grouped');}
-var div=document.createElement('DIV');Dom.addClass(div,this.CLASS_PREFIX+'-group');Dom.addClass(div,this.CLASS_PREFIX+'-group-'+oGroup.group);if(oGroup.label&&this.get('grouplabels')){var label=document.createElement('h3');label.innerHTML=oGroup.label;div.appendChild(label);}
-this.get('cont').appendChild(div);var ul=document.createElement('ul');div.appendChild(ul);if(!this._buttonGroupList){this._buttonGroupList={};}
-this._buttonGroupList[oGroup.group]=ul;for(var i=0;i<oGroup.buttons.length;i++){var li=document.createElement('li');ul.appendChild(li);if((oGroup.buttons[i].type!=undefined)&&oGroup.buttons[i].type=='separator'){this.addSeparator(li);}else{oGroup.buttons[i].container=li;this.addButton(oGroup.buttons[i]);}}},addButtonToGroup:function(oButton,group,after){var groupCont=this._buttonGroupList[group];var li=document.createElement('li');oButton.container=li;this.addButton(oButton,after);groupCont.appendChild(li);},addButton:function(oButton,after){if(!this.get('element')){this._queue[this._queue.length]=['addButton',arguments];return false;}
-if(!this._buttonList){this._buttonList=[];}
-this._configs.buttons.value[this._configs.buttons.value.length]=oButton;if(!oButton.container){oButton.container=this.get('cont');}
-if((oButton.type=='menu')||(oButton.type=='split')||(oButton.type=='select')){if(Lang.isArray(oButton.menu)){for(var i in oButton.menu){if(Lang.hasOwnProperty(oButton.menu,i)){var funcObject={fn:function(ev,x,oMenu){if(!oButton.menucmd){oButton.menucmd=oButton.value;}
-oButton.value=((oMenu.value)?oMenu.value:oMenu._oText.nodeValue);},scope:this}
-oButton.menu[i].onclick=funcObject;}}}}
-var _oButton={};for(var i in oButton){if(Lang.hasOwnProperty(oButton,i)){if(!this._toolbarConfigs[i]){_oButton[i]=oButton[i];}}}
-if(oButton.type=='select'){_oButton.type='menu';}
-if(oButton.type=='spin'){_oButton.type='push';}
-if(_oButton.type=='color'){_oButton=this._makeColorButton(_oButton);}
-if(_oButton.menu){if(oButton.menu instanceof YAHOO.widget.Overlay){oButton.menu.showEvent.subscribe(function(){this._button=_oButton;});}else{for(var i=0;i<_oButton.menu.length;i++){if(!_oButton.menu[i].value){_oButton.menu[i].value=_oButton.menu[i].text;}}
-if(this.browser.webkit){_oButton.focusmenu=false;}}}
-var tmp=new YAHOO.widget.Button(_oButton);if(this.get('disabled')){tmp.set('disabled',true);}
-if(!oButton.id){oButton.id=tmp.get('id');}
-if(after){var el=tmp.get('element');var nextSib=null;if(after.get){nextSib=after.get('element').nextSibling;}else if(after.nextSibling){nextSib=after.nextSibling;}
-if(nextSib){nextSib.parentNode.insertBefore(el,nextSib);}}
-tmp.addClass(this.CLASS_PREFIX+'-'+tmp.get('value'));var icon=document.createElement('span');icon.className=this.CLASS_PREFIX+'-icon';tmp.get('element').insertBefore(icon,tmp.get('firstChild'));var a=document.createElement('a');a.innerHTML=tmp._button.innerHTML;a.href='#';Event.on(a,'click',function(ev){Event.stopEvent(ev);});tmp._button.parentNode.replaceChild(a,tmp._button);tmp._button=a;if(oButton.type=='select'){tmp.addClass(this.CLASS_PREFIX+'-select');}
-if(oButton.type=='spin'){if(!Lang.isArray(oButton.range)){oButton.range=[10,100];}
-this._makeSpinButton(tmp,oButton);}
-tmp.get('element').setAttribute('title',tmp.get('label'));if(oButton.type!='spin'){if(_oButton.menu instanceof YAHOO.widget.Overlay){var showPicker=function(ev){var exec=true;if(ev.keyCode&&(ev.keyCode==9)){exec=false;}
-if(exec){this._colorPicker._button=oButton.value;var menuEL=tmp.getMenu().element;if(menuEL.style.visibility=='hidden'){tmp.getMenu().show();}else{tmp.getMenu().hide();}}
-YAHOO.util.Event.stopEvent(ev);};tmp.on('mousedown',showPicker,oButton,this);tmp.on('keydown',showPicker,oButton,this);}else if((oButton.type!='menu')&&(oButton.type!='select')){tmp.on('keypress',this._buttonClick,oButton,this);tmp.on('mousedown',function(ev){this._buttonClick(ev,oButton);YAHOO.util.Event.stopEvent(ev);},oButton,this);}else{tmp.on('mousedown',function(ev){YAHOO.util.Event.stopEvent(ev);});tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);});var self=this;tmp.getMenu().mouseDownEvent.subscribe(function(ev,args){var oMenu=args[1];YAHOO.util.Event.stopEvent(args[0]);tmp._onMenuClick(args[0],tmp);if(!oButton.menucmd){oButton.menucmd=oButton.value;}
-oButton.value=((oMenu.value)?oMenu.value:oMenu._oText.nodeValue);self._buttonClick.call(self,args[1],oButton);tmp._hideMenu();return false;});tmp.getMenu().clickEvent.subscribe(function(ev,args){YAHOO.util.Event.stopEvent(args[0]);});}}else{tmp.on('mousedown',function(ev){YAHOO.util.Event.stopEvent(ev);});tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);});}
-if(this.browser.ie){tmp.DOM_EVENTS.focusin=true;tmp.DOM_EVENTS.focusout=true;tmp.on('focusin',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);tmp.on('focusout',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);}
-if(this.browser.webkit){tmp.hasFocus=function(){return true;}}
-this._buttonList[this._buttonList.length]=tmp;if((oButton.type=='menu')||(oButton.type=='split')||(oButton.type=='select')){if(Lang.isArray(oButton.menu)){var menu=tmp.getMenu();menu.renderEvent.subscribe(_addMenuClasses,tmp);if(oButton.renderer){menu.renderEvent.subscribe(oButton.renderer,tmp);}}}
-return oButton;},addSeparator:function(cont,after){if(!this.get('element')){this._queue[this._queue.length]=['addSeparator',arguments];return false;}
-var sepCont=((cont)?cont:this.get('cont'));if(!this.get('element')){this._queue[this._queue.length]=['addSeparator',arguments];return false;}
-if(this._sepCount==null){this._sepCount=0;}
-if(!this._sep){this._sep=document.createElement('SPAN');Dom.addClass(this._sep,this.CLASS_SEPARATOR);this._sep.innerHTML='|';}
-var _sep=this._sep.cloneNode(true);this._sepCount++;Dom.addClass(_sep,this.CLASS_SEPARATOR+'-'+this._sepCount);if(after){var nextSib=null;if(after.get){nextSib=after.get('element').nextSibling;}else if(after.nextSibling){nextSib=after.nextSibling;}else{nextSib=after;}
-if(nextSib){if(nextSib==after){nextSib.parentNode.appendChild(_sep);}else{nextSib.parentNode.insertBefore(_sep,nextSib);}}}else{sepCont.appendChild(_sep);}
-return _sep;},_createColorPicker:function(id){if(Dom.get(id+'_colors')){Dom.get(id+'_colors').parentNode.removeChild(Dom.get(id+'_colors'));}
-var picker=document.createElement('div');picker.className='yui-toolbar-colors';picker.id=id+'_colors';picker.style.display='none';Event.on(window,'load',function(){document.body.appendChild(picker);},this,true);this._colorPicker=picker;var html='';for(var i in this._colorData){if(Lang.hasOwnProperty(this._colorData,i)){html+='<a style="background-color: '+i+'" href="#">'+i.replace('#','')+'</a>';}}
-html+='<span><em>X</em><strong></strong></span>';picker.innerHTML=html;var em=picker.getElementsByTagName('em')[0];var strong=picker.getElementsByTagName('strong')[0];Event.on(picker,'mouseover',function(ev){var tar=Event.getTarget(ev);if(tar.tagName.toLowerCase()=='a'){em.style.backgroundColor=tar.style.backgroundColor;strong.innerHTML=this._colorData['#'+tar.innerHTML]+'<br>'+tar.innerHTML;}},this,true);Event.on(picker,'focus',function(ev){Event.stopEvent(ev);});Event.on(picker,'click',function(ev){Event.stopEvent(ev);});Event.on(picker,'mousedown',function(ev){Event.stopEvent(ev);var tar=Event.getTarget(ev);if(tar.tagName.toLowerCase()=='a'){this.fireEvent('colorPickerClicked',{type:'colorPickerClicked',target:this,button:this._colorPicker._button,color:tar.innerHTML,colorName:this._colorData['#'+tar.innerHTML]});this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var em=this._colorPicker.getElementsByTagName('em')[0];var strong=this._colorPicker.getElementsByTagName('strong')[0];em.style.backgroundColor='transparent';strong.innerHTML='';},_makeColorButton:function(_oButton){if(!this._colorPicker){this._createColorPicker(this.get('id'));}
-_oButton.type='color';_oButton.menu=new YAHOO.widget.Overlay(this.get('id')+'_'+_oButton.value+'_menu',{visbile:false,position:'absolute'});_oButton.menu.setBody('');_oButton.menu.render(this.get('cont'));_oButton.menu.beforeShowEvent.subscribe(function(){_oButton.menu.cfg.setProperty('zindex',5);_oButton.menu.cfg.setProperty('context',[this.getButtonById(_oButton.id).get('element'),'tl','bl']);this._resetColorPicker();var _p=this._colorPicker;if(_p.parentNode){_p.parentNode.removeChild(_p);}
-_oButton.menu.setBody('');_oButton.menu.appendToBody(_p);this._colorPicker.style.display='block';},this,true);return _oButton;},_makeSpinButton:function(_button,oButton){_button.addClass(this.CLASS_PREFIX+'-spinbutton');var self=this,_par=_button._button.parentNode.parentNode,range=oButton.range,_b1=document.createElement('a'),_b2=document.createElement('a');_b1.href='#';_b2.href='#';_b1.className='up';_b1.title=this.STR_SPIN_UP;_b1.innerHTML=this.STR_SPIN_UP;_b2.className='down';_b2.title=this.STR_SPIN_DOWN;_b2.innerHTML=this.STR_SPIN_DOWN;_par.appendChild(_b1);_par.appendChild(_b2);var label=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:_button.get('label')});_button.set('title',label);var cleanVal=function(value){value=((value<range[0])?range[0]:value);value=((value>range[1])?range[1]:value);return value;};var br=this.browser;var tbar=false;var strLabel=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){tbar=this._titlebar.firstChild;}
-var _intUp=function(ev){YAHOO.util.Event.stopEvent(ev);if(!_button.get('disabled')&&(ev.keyCode!=9)){var value=parseInt(_button.get('label'));value++;value=cleanVal(value);_button.set('label',''+value);var label=YAHOO.lang.substitute(strLabel,{VALUE:_button.get('label')});_button.set('title',label);if(!br.webkit&&tbar){}
-self._buttonClick(ev,oButton);}};var _intDown=function(ev){YAHOO.util.Event.stopEvent(ev);if(!_button.get('disabled')&&(ev.keyCode!=9)){var value=parseInt(_button.get('label'));value--;value=cleanVal(value);_button.set('label',''+value);var label=YAHOO.lang.substitute(strLabel,{VALUE:_button.get('label')});_button.set('title',label);if(!br.webkit&&tbar){}
-self._buttonClick(ev,oButton);}};var _intKeyUp=function(ev){if(ev.keyCode==38){_intUp(ev);}else if(ev.keyCode==40){_intDown(ev);}else if(ev.keyCode==107&&ev.shiftKey){_intUp(ev);}else if(ev.keyCode==109&&ev.shiftKey){_intDown(ev);}};_button.on('keydown',_intKeyUp,this,true);Event.on(_b1,'mousedown',function(ev){Event.stopEvent(ev);},this,true);Event.on(_b2,'mousedown',function(ev){Event.stopEvent(ev);},this,true);Event.on(_b1,'click',_intUp,this,true);Event.on(_b2,'click',_intDown,this,true);},_buttonClick:function(ev,info){var doEvent=true;if(ev&&ev.type=='keypress'){if(ev.keyCode==9){doEvent=false;}else if((ev.keyCode==13)||(ev.keyCode==0)||(ev.keyCode==32)){}else{doEvent=false;}}
-if(doEvent){if(info.value){this.fireEvent(info.value+'Click',{type:info.value+'Click',target:this.get('element'),button:info});}
-if(info.menucmd){this.fireEvent(info.menucmd+'Click',{type:info.menucmd+'Click',target:this.get('element'),button:info});}
-this.fireEvent('buttonClick',{type:'buttonClick',target:this.get('element'),button:info});if(info.type=='select'){var button=this.getButtonById(info.id);var txt=info.value;for(var i=0;i<info.menu.length;i++){if(info.menu[i].value==info.value){txt=info.menu[i].text;break;}}
-button.set('label','<span class="yui-toolbar-'+info.menucmd+'-'+(info.value).replace(/ /g,'-').toLowerCase()+'">'+txt+'</span>');var _items=button.getMenu().getItems();for(var m=0;m<_items.length;m++){if(_items[m].value.toLowerCase()==info.value.toLowerCase()){_items[m].cfg.setProperty('checked',true);}else{_items[m].cfg.setProperty('checked',false);}}}}
-if(ev){Event.stopEvent(ev);}},getButtonById:function(id){var len=this._buttonList.length;for(var i=0;i<len;i++){if(this._buttonList[i].get('id')==id){return this._buttonList[i];}}
-return false;},getButtonByValue:function(value){var _buttons=this.get('buttons');var len=_buttons.length;for(var i=0;i<len;i++){if(_buttons[i].group!=undefined){for(var m=0;m<_buttons[i].buttons.length;m++){if((_buttons[i].buttons[m].value==value)||(_buttons[i].buttons[m].menucmd==value)){return this.getButtonById(_buttons[i].buttons[m].id);}
-if(_buttons[i].buttons[m].menu){for(var s=0;s<_buttons[i].buttons[m].menu.length;s++){if(_buttons[i].buttons[m].menu[s].value==value){return this.getButtonById(_buttons[i].buttons[m].id);}}}}}else{if((_buttons[i].value==value)||(_buttons[i].menucmd==value)){return this.getButtonById(_buttons[i].id);}
-if(_buttons[i].menu){for(var s=0;s<_buttons[i].menu.length;s++){if(_buttons[i].menu[s].value==value){return this.getButtonById(_buttons[i].id);}}}}}
-return false;},getButtonByIndex:function(index){if(this._buttonList[index]){return this._buttonList[index];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
-if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
-if(button instanceof YAHOO.widget.Button){button.set('disabled',true);}else{return false;}},enableButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
-if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
-if(button instanceof YAHOO.widget.Button){button.set('disabled',false);}else{return false;}},selectButton:function(button,value){if(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
-if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
-if(button instanceof YAHOO.widget.Button){button.addClass('yui-button-selected');button.addClass('yui-button-'+button.get('value')+'-selected');if(value){var _items=button.getMenu().getItems();for(var m=0;m<_items.length;m++){if(_items[m].value==value){_items[m].cfg.setProperty('checked',true);button.set('label','<span class="yui-toolbar-'+button.get('value')+'-'+(value).replace(/ /g,'-').toLowerCase()+'">'+_items[m]._oText.nodeValue+'</span>');}else{_items[m].cfg.setProperty('checked',false);}}}}else{return false;}}},deselectButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
-if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
-if(button instanceof YAHOO.widget.Button){button.removeClass('yui-button-selected');button.removeClass('yui-button-'+button.get('value')+'-selected');button.removeClass('yui-button-hover');}else{return false;}},deselectAllButtons:function(){var len=this._buttonList.length;for(var i=0;i<len;i++){this.deselectButton(this._buttonList[i]);}},destroyButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
-if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
-if(button instanceof YAHOO.widget.Button){var id=button.get('id');button.destroy();var len=this._buttonList.length;for(var i=0;i<len;i++){if(this._buttonList[i].get('id')==id){this._buttonList[i]=null;}}}else{return false;}},destroy:function(){this.get('element').innerHTML='';this.get('element').className='';for(var i in this){if(Lang.hasOwnProperty(this,i)){this[i]=null;}}
-return true;},toString:function(){return'Toolbar (#'+this.get('element').id+') with '+this._buttonList.length+' buttons.';}});})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,DD=YAHOO.util.DD,Toolbar=YAHOO.widget.Toolbar;YAHOO.widget.Editor=function(el,attrs){var oConfig={element:null,attributes:(attrs||{})}
-if(Lang.isString(el)){oConfig.attributes.textarea=Dom.get(el);}
-var element_cont=document.createElement('DIV');oConfig.attributes.element_cont=new YAHOO.util.Element(element_cont,{id:oConfig.attributes.textarea.id+'_container'});oConfig.attributes.element_cont.setStyle('display','none');oConfig.element=oConfig.attributes.textarea;var div=document.createElement('div');oConfig.attributes.element_cont.appendChild(div);if(!oConfig.attributes.toolbar_cont){oConfig.attributes.toolbar_cont=document.createElement('DIV');oConfig.attributes.toolbar_cont.id=oConfig.attributes.textarea.id+'_toolbar';div.appendChild(oConfig.attributes.toolbar_cont);}
-if(!oConfig.attributes.iframe){oConfig.attributes.iframe=_createIframe(oConfig.attributes.textarea.id);var editorWrapper=document.createElement('DIV');editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));div.appendChild(editorWrapper);}
-Event.onDOMReady(function(){this.DOMReady=true;this.fireQueue();},this,true);YAHOO.widget.Editor.superclass.constructor.call(this,oConfig.element,oConfig.attributes);}
-function _cleanClassName(str){return str.replace(/ /g,'-').toLowerCase();}
-function _createIframe(id){var ifrmID=id+'_editor';var ifrmDom=document.createElement('iframe');ifrmDom.id=ifrmID;var config={border:'0',frameBorder:'0',marginWidth:'0',marginHeight:'0',leftMargin:'0',topMargin:'0',allowTransparency:'true',width:'100%',src:'javascript:false'}
-for(var i in config){if(Lang.hasOwnProperty(config,i)){ifrmDom.setAttribute(i,config[i]);}}
-var ifrm=new YAHOO.util.Element(ifrmDom);ifrm.setStyle('zIndex','-1');return ifrm;}
-YAHOO.extend(YAHOO.widget.Editor,YAHOO.util.Element,{DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:[],dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerCounter:0,_disabled:['createlink','forecolor','backcolor','fontname','fontsize','superscript','subscript','removeformat','heading','indent','outdent'],_alwaysDisabled:{},_alwaysEnabled:{hiddenelements:true},_semantic:{'bold':true,'italic':true,'underline':true},_tag2cmd:{'b':'bold','strong':'bold','i':'italic','em':'italic','u':'underline','blockquote':'formatblock','sup':'superscript','sub':'subscript','img':'insertimage','a':'createlink','ul':'insertunorderedlist','ol':'insertorderedlist','indent':'indent','outdent':'outdent'},_getDoc:function(){var value=false;if(this.get){if(this.get('iframe')){if(this.get('iframe').get){if(this.get('iframe').get('element')){try{if(this.get('iframe').get('element').contentWindow){if(this.get('iframe').get('element').contentWindow.document){value=this.get('iframe').get('element').contentWindow.document;}}}catch(e){}}}}}
-return value;},_getWindow:function(){return this.get('iframe').get('element').contentWindow;},_focusWindow:function(onLoad){if(this.browser.webkit){if(onLoad){this._getSelection().setBaseAndExtent(this._getDoc().body,0,this._getDoc().body,1);this._getSelection().collapse(false);}else{this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,1);this._getSelection().collapse(false);}
-this._getWindow().focus();if(this._getDoc().queryCommandEnabled('insertimage')){this.browser.webkit3=true;}}else{this._getWindow().focus();}},_hasSelection:function(){var sel=this._getSelection();var range=this._getRange();var hasSel=false;if(this.browser.ie||this.browser.opera){if(range.text){hasSel=true;}
-if(range.html){hasSel=true;}}else{if((sel!='')&&(sel!=undefined)){hasSel=true;}}
-return hasSel;},_getSelection:function(){var _sel=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){_sel=this._getDoc().selection;}else{_sel=this._getWindow().getSelection();}
-if(this.browser.webkit){if(_sel.baseNode){this._selection=new Object();this._selection.baseNode=_sel.baseNode;this._selection.baseOffset=_sel.baseOffset;this._selection.extentNode=_sel.extentNode;this._selection.extentOffset=_sel.extentOffset;}else if(this._selection!=null){_sel=this._getWindow().getSelection();_sel.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}
-return _sel;},_getRange:function(sel){var sel=this._getSelection();if(sel==null){return null;}
-if(this.browser.webkit&&!sel.getRangeAt){var _range=this._getDoc().createRange();try{_range.setStart(sel.anchorNode,sel.anchorOffset);_range.setEnd(sel.focusNode,sel.focusOffset);}catch(e){_range=this._getWindow().getSelection()+'';}
-return _range;}
-if(this.browser.ie||this.browser.opera){return sel.createRange();}
-if(sel.rangeCount>0){return sel.getRangeAt(0);}
-return null;},_setDesignMode:function(state){try{this._getDoc().designMode=state;}catch(e){}},_toggleDesignMode:function(){var _dMode=this._getDoc().designMode,_state='on';if(_dMode=='on'){_state='off';}
-this._setDesignMode(_state);return _state;},_initEditor:function(){if(this.browser.ie){this._getDoc().body.style.margin='0';}
-this._setDesignMode('on');this.toolbar.on('buttonClick',this._handleToolbarClick,this,true);Event.addListener(this._getDoc(),'mouseup',this._handleMouseUp,this,true);Event.addListener(this._getDoc(),'mousedown',this._handleMouseDown,this,true);Event.addListener(this._getDoc(),'click',this._handleClick,this,true);Event.addListener(this._getDoc(),'dblclick',this._handleDoubleClick,this,true);Event.addListener(this._getDoc(),'keypress',this._handleKeyPress,this,true);Event.addListener(this._getDoc(),'keyup',this._handleKeyUp,this,true);Event.addListener(this._getDoc(),'keydown',this._handleKeyDown,this,true);this.toolbar.set('disabled',false);this.fireEvent('editorContentLoaded',{type:'editorLoaded',target:this});if(this.get('dompath')){var self=this;window.setTimeout(function(){self._writeDomPath.call(self);},150);}},_checkLoaded:function(){this._contentTimerCounter++;if(this._contentTimer){window.clearTimeout(this._contentTimer);}
-if(this._contentTimerCounter>250){alert('ERROR: Body Did Not load');return false;}
-if(this._getDoc()&&this._getDoc().body&&(this._getDoc().body._rteLoaded==true)){this._initEditor();}else{var self=this;this._contentTimer=window.setTimeout(function(){self._checkLoaded.call(self);},20);}},_setInitialContent:function(){var title=this.STR_TITLE;var html=this.get('html');html=html.replace('{TITLE}',title);html=html.replace('{CONTENT}',this.get('textarea').value);html=html.replace('{CSS}',this.get('css'));html=html.replace('{HIDDEN_CSS}',this.get('hiddencss'));this._getDoc().open();this._getDoc().write(html);this._getDoc().close();this._checkLoaded();},_setMarkupType:function(action){switch(this.get('markup')){case'css':this._setEditorStyle(true);break;case'default':this._setEditorStyle(false);break;case'semantic':if(this._semantic[action]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}
-break;}},_setEditorStyle:function(stat){try{this._getDoc().execCommand('useCSS',false,!stat);}catch(ex){}},_getSelectedElement:function(){var doc=this._getDoc();if(this.browser.ie){var range=this._getRange(),elm=null;if(range){elm=range.item?range.item(0):range.parentElement();if(elm==doc.body){elm=null;}}}else{var sel=this._getSelection(),range=this._getRange(),elm=null;if(!sel||!range){return null;}
-if(sel!=''){if(sel.anchorNode&&(sel.anchorNode.nodeType==3)){if(sel.anchorNode.parentNode){elm=sel.anchorNode.parentNode;}
-if(sel.anchorNode.nextSibling!=sel.focusNode.nextSibling){elm=sel.anchorNode.nextSibling;}}
-if(elm&&elm.tagName&&(elm.tagName.toLowerCase()=='br')){elm=null;}
-if(!elm){elm=range.commonAncestorContainer;if(!range.collapsed){if(range.startContainer==range.endContainer){if(range.startOffset-range.endOffset<2){if(range.startContainer.hasChildNodes()){elm=range.startContainer.childNodes[range.startOffset];}}}}}
-if(!elm){if(this.currentEvent){}}}}
-if(!elm&&(this.currentElement[0]||this.currentEvent)){if(this.currentEvent&&(this.currentEvent.keyCode==undefined)&&Event.getTarget(this.currentEvent)){elm=Event.getTarget(this.currentEvent);}else if(this.currentEvent&&(this.currentEvent.keyCode!=undefined)&&Event.getTarget(this.currentEvent)){}else{elm=this.currentElement[0];}}else if((elm==this._getDoc().body)&&this.currentElement[0]&&!this._hasSelection()){elm=this.currentElement[0];}
-if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!elm){elm=Event.getTarget(this.currentEvent);}}
-if(!elm||!elm.tagName){elm=doc.body;}
-if(elm&&elm.tagName&&elm.tagName.toLowerCase()=='html'){elm=doc.body;}
-return elm;},_getDomPath:function(){var el=this._getSelectedElement();var domPath=[];while(el!=null){if(el.ownerDocument!=this._getDoc()){return false;}
-if(el.nodeName&&(el.nodeType==1)){domPath[domPath.length]=el;}
-if(el.nodeName.toUpperCase()=="BODY"){break;}
-el=el.parentNode;}
-if(domPath.length==0){if(this._getDoc()&&this._getDoc().body){domPath[0]=this._getDoc().body;}}
-return domPath.reverse();},_writeDomPath:function(){var path=this._getDomPath(),pathArr=[];for(var i=0;i<path.length;i++){var tag=path[i].tagName.toLowerCase();if((tag=='ol')&&(path[i].type)){tag+=':'+path[i].type;}
-if(Dom.hasClass(path[i],'yui-tag')){tag=path[i].getAttribute('tag');}
-if((this.get('markup')=='semantic')){switch(tag){case'b':tag='strong';break;case'i':tag='em';break;}}
-if(!Dom.hasClass(path[i],'yui-non')){if(Dom.hasClass(path[i],'yui-tag')){var pathStr=tag;if(tag=='a'){if(path[i].getAttribute('href')){pathStr+=':'+path[i].getAttribute('href').replace('mailto:','').replace('http:/'+'/','').replace('https:/'+'/','');}}}else{var classPath=((path[i].className!='')?'.'+path[i].className.replace(/ /g,'.'):'');if((classPath.indexOf('yui')!=-1)||(classPath.toLowerCase().indexOf('apple-style-span')!=-1)){classPath='';}
-var pathStr=tag+((path[i].id)?'#'+path[i].id:'')+classPath;}
-if(pathStr.length>10){pathStr=pathStr.substring(0,10)+'...';}
-pathArr[pathArr.length]=pathStr;}}
-var str=pathArr.join(' '+this.SEP_DOMPATH+' ');if(this.dompath.innerHTML!=str){this.dompath.innerHTML=str;}},_fixNodes:function(){for(var i in this.invalidHTML){if(Lang.hasOwnProperty(this.invalidHTML,i)){var tags=this._getDoc().body.getElementsByTagName(i);for(var h=0;h<tags.length;h++){if(tags[h].parentNode){tags[h].parentNode.removeChild(tags[h]);}}}}
-var as=this._getDoc().body.getElementsByTagName('a');if(as.length){for(var i=0;i<as.length;i++){var el=this._getDoc().createElement('span');Dom.addClass(el,'yui-tag-a');Dom.addClass(el,'yui-tag');el.innerHTML=as[i].innerHTML;el.setAttribute('tag','a');el.setAttribute('href',as[i].getAttribute('href'));if(as[i].getAttribute('target')!=null){el.setAttribute('target',as[i].getAttribute('target'));}
-as[i].parentNode.replaceChild(el,as[i]);as[i]=null;}}
-var imgs=this._getDoc().getElementsByTagName('img');Dom.addClass(imgs,'yui-img');for(var i=0;i<imgs.length;i++){if(imgs[i].getAttribute('href',2)){var url=imgs[i].getAttribute('src',2);if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){Dom.addClass(imgs[i],this.CLASS_LOCAL_FILE);}else{Dom.removeClass(imgs[i],this.CLASS_LOCAL_FILE);}}}
-var fakeAs=this._getDoc().body.getElementsByTagName('span');for(var i=0;i<fakeAs.length;i++){if(fakeAs[i].getAttribute('href',2)){var url=fakeAs[i].getAttribute('href',2);if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){Dom.addClass(fakeAs[i],this.CLASS_LOCAL_FILE);}else{Dom.removeClass(fakeAs[i],this.CLASS_LOCAL_FILE);}}}},_showHidden:function(){if(this._showingHiddenElements){this._showingHiddenElements=false;this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));Dom.removeClass(this._getDoc().body,this.CLASS_HIDDEN);}else{this._showingHiddenElements=true;Dom.addClass(this._getDoc().body,this.CLASS_HIDDEN);this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));}},_setCurrentEvent:function(ev){if(ev&&ev.type){}
-this.currentEvent=ev;},_handleClick:function(ev){this._setCurrentEvent(ev);if(this.currentWindow){this.closeWindow();}
-if(!this.browser.webkit){this.nodeChange();}},_handleMouseUp:function(ev){this._setCurrentEvent(ev);if(this.browser.opera){var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){this.nodeChange();var self=this;if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(ev);}else{this.operaEvent=window.setTimeout(function(){self.operaEvent=false;},200);}}}
-if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){Event.stopEvent(ev);}}
-this.nodeChange();this.fireEvent('editorMouseUp',{type:'editorMouseUp',target:this,ev:ev});},_handleMouseDown:function(ev){this._setCurrentEvent(ev);var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){if(this.browser.webkit){this.nodeChange();Event.stopEvent(ev);}}
-this.fireEvent('editorMouseDown',{type:'editorMouseDown',target:this,ev:ev});},_handleDoubleClick:function(ev){this._setCurrentEvent(ev);var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){this.currentElement[0]=sel;this.toolbar.fireEvent('insertimageClick',{type:'insertimageClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});}else if(sel&&sel.getAttribute&&sel.getAttribute('tag')&&(sel.getAttribute('tag').toLowerCase()=='a')){this.currentElement[0]=sel;this.toolbar.fireEvent('createlinkClick',{type:'createlinkClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});}
-this.nodeChange();this.fireEvent('editorDoubleClick',{type:'editorDoubleClick',target:this,ev:ev});},_handleKeyUp:function(ev){this._setCurrentEvent(ev);switch(ev.keyCode){case 37:case 38:case 39:case 40:case 46:case 8:case 65:case 27:if((ev.keyCode==27)&&this.currentWindow){this.closeWindow();}
-this.nodeChange();break;}
-this.fireEvent('editorKeyUp',{type:'editorKeyUp',target:this,ev:ev});},_handleKeyPress:function(ev){this._setCurrentEvent(ev);this.fireEvent('editorKeyPress',{type:'editorKeyPress',target:this,ev:ev});},_handleKeyDown:function(ev){this._setCurrentEvent(ev);if(this.currentWindow){this.closeWindow();}
-var doExec=false;var action=null;if(ev.shiftKey&&ev.ctrlKey){doExec=true;}
-switch(ev.keyCode){case 84:if(ev.shiftKey&&ev.ctrlKey){this.toolbar._titlebar.firstChild.focus();Event.stopEvent(ev);doExec=false;}
-break;case 27:if(ev.shiftKey){this.afterElement.focus();Event.stopEvent(ev);exec=false;}
-break;case 219:action='justifyleft';break;case 220:action='justifycenter';break;case 221:action='justifyright';break;case 76:if(this._hasSelection()){this.execCommand('createlink','');this.toolbar.fireEvent('createlinkClick',{type:'createlinkClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});doExec=false;}
-break;case 66:action='bold';break;case 73:action='italic';break;case 85:action='underline';break;case 9:if(this.browser.safari){this._getDoc().execCommand('inserttext',false,'\t');Event.stopEvent(ev);}
-break;case 13:if(this.browser.ie){var _range=this._getRange();var tar=this._getSelectedElement();if(tar&&tar.tagName&&(tar.tagName.toLowerCase()!='li')){if(_range){_range.pasteHTML('<br>');_range.collapse(false);_range.select();}
-Event.stopEvent(ev);}}}
-if(doExec&&action){this.execCommand(action,null);Event.stopEvent(ev);this.nodeChange();}
-this.fireEvent('editorKeyDown',{type:'editorKeyDown',target:this,ev:ev});},nodeChange:function(){this._fixNodes();this.fireEvent('beforeNodeChange',{type:'beforeNodeChange',target:this});if(this.get('dompath')){this._writeDomPath();}
-if(!this.get('disabled')){if(this.STOP_NODE_CHANGE){this.STOP_NODE_CHANGE=false;return false;}else{var sel=this._getSelection();var range=this._getRange();for(var i=0;i<this._disabled.length;i++){var _button=this.toolbar.getButtonByValue(this._disabled[i]);if(_button&&_button.get){if(!this._hasSelection()){this.toolbar.disableButton(_button.get('id'));}else{if(!this._alwaysDisabled[this._disabled[i]]){this.toolbar.enableButton(_button.get('id'));}}
-if(!this._alwaysEnabled[this._disabled[i]]){this.toolbar.deselectButton(_button);}}}
-for(var i=0;i<this.toolbar._buttonList.length;i++){if(!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]){this.toolbar.deselectButton(this.toolbar._buttonList[i]);}}
-var path=this._getDomPath();var olType=null;for(var i=0;i<path.length;i++){var tag=path[i].tagName.toLowerCase();if(path[i].getAttribute('tag')){var tag=path[i].getAttribute('tag').toLowerCase();}
-var cmd=this._tag2cmd[tag];if(path[i].style.fontWeight.toLowerCase()=='bold'){cmd='bold';}
-if(path[i].style.fontStyle.toLowerCase()=='italic'){cmd='italic';}
-if(path[i].style.textDecoration.toLowerCase()=='underline'){cmd='underline';}
-if(tag=='ol'){if(path[i].type){olType=path[i].type;}else{olType='A';}}
-if(cmd){if(!Lang.isArray(cmd)){cmd=[cmd];}
-for(var j=0;j<cmd.length;j++){var button=this.toolbar.getButtonByValue(cmd[j]);this.toolbar.selectButton(button);this.toolbar.enableButton(button);}}
-switch(path[i].style.textAlign.toLowerCase()){case'left':case'right':case'center':case'justify':var alignType=path[i].style.textAlign.toLowerCase();if(path[i].style.textAlign.toLowerCase()=='justify'){alignType='full';}
-var button=this.toolbar.getButtonByValue('justify'+alignType);this.toolbar.selectButton(button);this.toolbar.enableButton(button);break;}}
-var fn_button=this.toolbar.getButtonByValue('fontname');if(fn_button){var family=fn_button._configs.label._initialConfig.value;fn_button.set('label','<span class="yui-toolbar-fontname-'+_cleanClassName(family)+'">'+family+'</span>');this._updateMenuChecked('fontname',family);}
-var fs_button=this.toolbar.getButtonByValue('fontsize');if(fs_button){fs_button.set('label',fs_button._configs.label._initialConfig.value);}
-var hd_button=this.toolbar.getButtonByValue('heading');if(hd_button){hd_button.set('label',hd_button._configs.label._initialConfig.value);this._updateMenuChecked('heading','none');}}}
-this.fireEvent('afterNodeChange',{type:'afterNodeChange',target:this});},_updateMenuChecked:function(button,value,tbar){if(!tbar){tbar=this.toolbar;}
-var _button=tbar.getButtonByValue(button);var _menuItems=_button.getMenu().getItems();if(_menuItems.length==0){_button.getMenu()._onBeforeShow();_menuItems=_button.getMenu().getItems();}
-for(var i=0;i<_menuItems.length;i++){_menuItems[i].cfg.setProperty('checked',false);if(_menuItems[i].value==value){_menuItems[i].cfg.setProperty('checked',true);}}},_handleToolbarClick:function(ev){var value='';var str='';var cmd=ev.button.value;if(ev.button.menucmd){value=cmd;cmd=ev.button.menucmd;}
-if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(cmd,value);}
-Event.stopEvent(ev);},_setupAfterElement:function(){if(!this.afterElement){this.afterElement=document.createElement('h2');this.afterElement.className='yui-editor-skipheader';this.afterElement.tabIndex='-1';this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get('element_cont').get('firstChild').appendChild(this.afterElement);}},EDITOR_PANEL_ID:'yui-editor-panel',SEP_DOMPATH:'<',STR_LEAVE_EDITOR:'You have left the Rich Text Editor.',STR_BEFORE_EDITOR:'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',STR_CLOSE_WINDOW:'Close Window',STR_CLOSE_WINDOW_NOTE:'To close this window use the Escape key',STR_TITLE:'Rich Text Area.',STR_IMAGE_HERE:'Image Url Here',STR_IMAGE_PROP_TITLE:'Image Options',STR_IMAGE_URL:'Image Url',STR_IMAGE_TITLE:'Description',STR_IMAGE_SIZE:'Size',STR_IMAGE_ORIG_SIZE:'Original Size',STR_IMAGE_COPY:'<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',STR_IMAGE_PADDING:'Padding',STR_IMAGE_BORDER:'Border',STR_IMAGE_TEXTFLOW:'Text Flow',STR_LOCAL_FILE_WARNING:'<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',STR_LINK_PROP_TITLE:'Link Options',STR_LINK_PROP_REMOVE:'Remove link from text',STR_LINK_URL:'Link URL',STR_LINK_NEW_WINDOW:'Open in a new window.',STR_LINK_TITLE:'Description',STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_HIDDEN:'hidden',CLASS_LOCAL_FILE:'warning-localfile',CLASS_CONTAINER:'yui-editor-container',CLASS_EDITABLE:'yui-editor-editable',CLASS_EDITABLE_CONT:'yui-editor-editable-container',CLASS_PREFIX:'yui-editor',browser:YAHOO.env.ua,init:function(p_oElement,p_oAttributes){YAHOO.widget.Editor.superclass.init.call(this,p_oElement,p_oAttributes);this.get('element_cont').addClass(this.CLASS_CONTAINER);Dom.addClass(this.get('iframe').get('parentNode'),this.CLASS_EDITABLE_CONT);this.get('iframe').addClass(this.CLASS_EDITABLE);},initAttributes:function(attr){YAHOO.widget.Editor.superclass.initAttributes.call(this,attr);var self=this;this.setAttributeConfig('textarea',{value:attr.textarea,writeOnce:true});this.setAttributeConfig('height',{value:attr.height||Dom.getStyle(self.get('textarea'),'height'),writeOnce:true});this.setAttributeConfig('width',{value:attr.width||Dom.getStyle(this.get('textarea'),'width'),writeOnce:true});this.setAttributeConfig('blankimage',{value:attr.blankimage||this._getBlankImage()});this.setAttributeConfig('hiddencss',{value:attr.hiddencss||'.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',writeOnce:true});this.setAttributeConfig('css',{value:attr.css||'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',writeOnce:true});this.setAttributeConfig('html',{value:attr.html||'<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',writeOnce:true});this.setAttributeConfig('handleSubmit',{value:false,writeOnce:true,method:function(exec){if(exec){var ta=this.get('textarea');if(ta.form){Event.addListener(ta.form,'submit',function(){this.saveHTML();},this,true);}}}});this.setAttributeConfig('iframe',{value:null,writeOnce:true});this.setAttributeConfig('disabled',{value:false,method:function(disabled){if(disabled){if(!this._mask){this._setDesignMode('off');this.toolbar.set('disabled',true);this._mask=document.createElement('DIV');Dom.setStyle(this._mask,'height','100%');Dom.setStyle(this._mask,'width','100%');Dom.setStyle(this._mask,'position','absolute');Dom.setStyle(this._mask,'top','0');Dom.setStyle(this._mask,'left','0');Dom.setStyle(this._mask,'opacity','.5');Dom.addClass(this._mask,'yui-editor-masked');this.get('iframe').get('parentNode').appendChild(this._mask);}}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;this.toolbar.set('disabled',false);this._setDesignMode('on');this._focusWindow();}}}});this.setAttributeConfig('element_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar',{value:attr.toolbar||{collapse:true,titlebar:'Text Editing Tools',draggable:false,buttons:[{group:'fontstyle',label:'Font Name and Size',buttons:[{type:'select',label:'Arial',value:'fontname',disabled:true,menu:[{text:'Arial',checked:true},{text:'Arial Black'},{text:'Comic Sans MS'},{text:'Courier New'},{text:'Lucida Console'},{text:'Tahoma'},{text:'Times New Roman'},{text:'Trebuchet MS'},{text:'Verdana'}]},{type:'spin',label:'13',value:'fontsize',range:[9,75],disabled:true}]},{type:'separator'},{group:'textstyle',label:'Font Style',buttons:[{type:'push',label:'Bold CTRL + SHIFT + B',value:'bold'},{type:'push',label:'Italic CTRL + SHIFT + I',value:'italic'},{type:'push',label:'Underline CTRL + SHIFT + U',value:'underline'},{type:'separator'},{type:'push',label:'Subscript',value:'subscript',disabled:true},{type:'push',label:'Superscript',value:'superscript',disabled:true},{type:'separator'},{type:'color',label:'Font Color',value:'forecolor',disabled:true},{type:'color',label:'Background Color',value:'backcolor',disabled:true},{type:'separator'},{type:'push',label:'Remove Formatting',value:'removeformat',disabled:true},{type:'push',label:'Hidden Elements',value:'hiddenelements'}]},{type:'separator'},{group:'alignment',label:'Alignment',buttons:[{type:'push',label:'Align Left CTRL + SHIFT + [',value:'justifyleft'},{type:'push',label:'Align Center CTRL + SHIFT + |',value:'justifycenter'},{type:'push',label:'Align Right CTRL + SHIFT + ]',value:'justifyright'},{type:'push',label:'Justify',value:'justifyfull'}]},{type:'separator'},{group:'parastyle',label:'Paragraph Style',buttons:[{type:'select',label:'Normal',value:'heading',disabled:true,menu:[{text:'Normal',value:'none',checked:true},{text:'Header 1',value:'h1'},{text:'Header 2',value:'h2'},{text:'Header 3',value:'h3'},{text:'Header 4',value:'h4'},{text:'Header 5',value:'h5'},{text:'Header 6',value:'h6'}]}]},{type:'separator'},{group:'indentlist',label:'Indenting and Lists',buttons:[{type:'push',label:'Indent',value:'indent',disabled:true},{type:'push',label:'Outdent',value:'outdent',disabled:true},{type:'push',label:'Create an Unordered List',value:'insertunorderedlist'},{type:'push',label:'Create an Ordered List',value:'insertorderedlist'}]},{type:'separator'},{group:'insertitem',label:'Insert Item',buttons:[{type:'push',label:'HTML Link CTRL + SHIFT + L',value:'createlink',disabled:true},{type:'push',label:'Insert Image',value:'insertimage'}]}]},writeOnce:true,method:function(toolbar){}});this.setAttributeConfig('animate',{value:false,validator:function(value){var ret=true;if(!YAHOO.util.Anim){ret=false;}
-return ret;}});this.setAttributeConfig('panel',{value:null,writeOnce:true,validator:function(value){var ret=true;if(!YAHOO.widget.Panel){ret=false;}
-return ret;}});this.setAttributeConfig('localFileWarning',{value:true});this.setAttributeConfig('dompath',{value:false,method:function(dompath){if(dompath&&!this.dompath){this.dompath=document.createElement('DIV');this.dompath.id=this.get('id')+'_dompath';Dom.addClass(this.dompath,'dompath');this.get('element_cont').get('firstChild').appendChild(this.dompath);if(this.get('iframe')){this._writeDomPath();}}else if(!dompath&&this.dompath){this.dompath.parentNode.removeChild(this.dompath);this.dompath=null;}
-this._setupAfterElement();}});this.setAttributeConfig('markup',{value:'semantic',validator:function(markup){switch(markup.toLowerCase()){case'semantic':case'css':case'default':return true;break;}
-return false;}});this.on('afterRender',function(){this._renderPanel();});},_getBlankImage:function(){if(!this.DOMReady){this._queue[this._queue.length]=['_getBlankImage',arguments];return'';}
-var div=document.createElement('div');div.style.position='absolute';div.style.top='-9999px';div.style.left='-9999px';div.className=this.CLASS_PREFIX+'-blankimage';document.body.appendChild(div);var img=YAHOO.util.Dom.getStyle(div,'background-image');img=img.replace('url(','').replace(')','').replace(/"/g,'');this.set('blankimage',img);return img;},_handleFontSize:function(o){var button=this.toolbar.getButtonById(o.button.id);var value=button.get('label')+'px';this.execCommand('fontsize',value);this.STOP_EXEC_COMMAND=true;},_handleColorPicker:function(o){var cmd=o.button;var value='#'+o.color;if((cmd=='forecolor')||(cmd=='backcolor')){this.execCommand(cmd,value);}},_handleAlign:function(o){var button=this.toolbar.getButtonById(o.button.id);var cmd=null;for(var i=0;i<o.button.menu.length;i++){if(o.button.menu[i].value==o.button.value){cmd=o.button.menu[i].value;}}
-var value=this._getSelection();this.execCommand(cmd,value);this.STOP_EXEC_COMMAND=true;},_handleAfterNodeChange:function(){var path=this._getDomPath();for(var i=0;i<path.length;i++){var elm=path[i],tag=elm.tagName.toLowerCase(),family=null,fontsize=null,validFont=false;if(elm.getAttribute('tag')){tag=elm.getAttribute('tag');}
-family=elm.getAttribute('face');if(Dom.getStyle(elm,'font-family')){family=Dom.getStyle(elm,'font-family');}
-var fn_button=this.toolbar.getButtonByValue('fontname');if(fn_button){for(var b=0;b<fn_button._configs.menu.value.length;b++){if(family&&fn_button._configs.menu.value[b].text.toLowerCase()==family.toLowerCase()){validFont=true;family=fn_button._configs.menu.value[b].text;}}
-if(!validFont){family=fn_button._configs.label._initialConfig.value;}
-fn_button.set('label','<span class="yui-toolbar-fontname-'+_cleanClassName(family)+'">'+family+'</span>');this._updateMenuChecked('fontname',family);}
-var fs_button=this.toolbar.getButtonByValue('fontsize');if(fs_button){fontsize=parseInt(Dom.getStyle(elm,'fontSize'));if((fontsize==null)||isNaN(fontsize)){fontsize=fs_button._configs.label._initialConfig.value;}
-fs_button.set('label',''+fontsize);}
-if(tag.substring(0,1)=='h'){var hd_button=this.toolbar.getButtonByValue('heading');if(hd_button){for(var b=0;b<hd_button._configs.menu.value.length;b++){if(hd_button._configs.menu.value[b].value.toLowerCase()==tag){hd_button.set('label',hd_button._configs.menu.value[b].text);}}
-this._updateMenuChecked('heading',tag);}}}
-if(elm&&elm.tagName&&(elm.tagName.toLowerCase()!='body')){this.toolbar.enableButton(fn_button);this.toolbar.enableButton(fs_button);}},_handleInsertImageClick:function(){this.on('afterExecCommand',function(){var el=this.currentElement[0],title='',src='',align='',height=75,width=75,padding=0,blankimage=false,win=new YAHOO.widget.EditorWindow('insertimage',{width:'415px'});if(!el){el=this._getSelectedElement();}
-if(el){if(el.getAttribute('src')){src=el.getAttribute('src',2);if(src.indexOf(this.get('blankimage'))!=-1){src=this.STR_IMAGE_HERE;blankimage=true;}}
-if(el.getAttribute('alt',2)){title=el.getAttribute('alt',2);}
-if(el.getAttribute('title',2)){title=el.getAttribute('title',2);}
-height=parseInt(el.height);width=parseInt(el.width);if(el.style.height){height=parseInt(el.style.height);}
-if(el.style.width){width=parseInt(el.style.width);}
-if(el.style.margin){padding=parseInt(el.style.margin);}
-if(!el._height){el._height=height;}
-if(!el._width){el._width=width;}
-var oheight=el._height;var owidth=el._width;}
-if(!win.cache){var str='<label for="insertimage_url"><strong>'+this.STR_IMAGE_URL+':</strong> <input type="text" id="insertimage_url" value="'+src+'" size="40"></label>';var body=document.createElement('div');body.innerHTML=str;var tbarCont=document.createElement('div');tbarCont.id='img_toolbar';body.appendChild(tbarCont);var str2='<label for="insertimage_title"><strong>'+this.STR_IMAGE_TITLE+':</strong> <input type="text" id="insertimage_title" value="'+title+'" size="40"></label>';var div=document.createElement('div');div.innerHTML=str2;body.appendChild(div);win.cache=body;}else{body=win.cache;}
-var tbar=new YAHOO.widget.Toolbar(tbarCont,{buttons:[{group:'padding',label:this.STR_IMAGE_PADDING+':',buttons:[{type:'spin',label:''+padding,value:'padding',range:[0,50]}]},{type:'separator'},{group:'border',label:this.STR_IMAGE_BORDER+':',buttons:[{type:'select',label:'Border Size',value:'bordersize',menu:[{text:'none',value:'0',checked:true},{text:'----',value:'1'},{text:'----',value:'2'},{text:'----',value:'3'},{text:'----',value:'4'},{text:'----',value:'5'}]},{type:'select',label:'Border Type',value:'bordertype',disabled:true,menu:[{text:'----',value:'solid',checked:true},{text:'----',value:'dashed'},{text:'----',value:'dotted'}]},{type:'color',label:'Border Color',value:'bordercolor',disabled:true}]},{type:'separator'},{group:'textflow',label:this.STR_IMAGE_TEXTFLOW+':',buttons:[{type:'push',label:'Left',value:'left'},{type:'push',label:'Inline',value:'inline'},{type:'push',label:'Block',value:'block'},{type:'push',label:'Right',value:'right'}]}]});var bsize='0';var btype='solid';if(el.style.borderLeftWidth){bsize=parseInt(el.style.borderLeftWidth);}
-if(el.style.borderLeftStyle){btype=el.style.borderLeftStyle;}
-var bs_button=tbar.getButtonByValue('bordersize');var bSizeStr=((parseInt(bsize)>0)?'----':'none');bs_button.set('label','<span class="yui-toolbar-bordersize-'+bsize+'">'+bSizeStr+'</span>');this._updateMenuChecked('bordersize',bsize,tbar);var bs_button=tbar.getButtonByValue('bordertype');bs_button.set('label','<span class="yui-toolbar-bordertype-'+btype+'">----</span>');this._updateMenuChecked('bordertype',btype,tbar);if(parseInt(bsize)>0){tbar.enableButton(tbar.getButtonByValue('bordertype'));tbar.enableButton(tbar.getButtonByValue('bordercolor'));}
-var cont=tbar.get('cont');var hw=document.createElement('div');hw.className='yui-toolbar-group yui-toolbar-group-padding height-width';hw.innerHTML='<h3>'+this.STR_IMAGE_SIZE+':</h3>';var orgSize='';if((height!=oheight)||(width!=owidth)){orgSize='<span class="info">'+this.STR_IMAGE_ORIG_SIZE+'<br>'+owidth+' x '+oheight+'</span>';}
-hw.innerHTML+='<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>'+orgSize;cont.insertBefore(hw,cont.firstChild);Event.onAvailable('insertimage_width',function(){Event.on('insertimage_width','blur',function(){var value=parseInt(Dom.get('insertimage_width').value);if(value>5){el.style.width=value+'px';this.moveWindow();}},this,true);},this,true);Event.onAvailable('insertimage_height',function(){Event.on('insertimage_height','blur',function(){var value=parseInt(Dom.get('insertimage_height').value);if(value>5){el.style.height=value+'px';this.moveWindow();}},this,true);},this,true);if(el.align=='right'){tbar.selectButton(tbar.getButtonByValue('right'));}else if(el.align=='left'){tbar.selectButton(tbar.getButtonByValue('left'));}else if(el.style.display=='block'){tbar.selectButton(tbar.getButtonByValue('block'));}else{tbar.selectButton(tbar.getButtonByValue('inline'));}
-if(parseInt(el.style.marginLeft)>0){tbar.getButtonByValue('padding').set('label',''+parseInt(el.style.marginLeft));}
-if(el.style.borderSize){tbar.selectButton(tbar.getButtonByValue('bordersize'));tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));}
-tbar.on('colorPickerClicked',function(o){var size='1',type='solid',color='black';if(el.style.borderLeftWidth){size=parseInt(el.style.borderLeftWidth);}
-if(el.style.borderLeftStyle){type=el.style.borderLeftStyle;}
-if(el.style.borderLeftColor){color=el.style.borderLeftColor;}
-var borderString=size+'px '+type+' #'+o.color;el.style.border=borderString;},this.toolbar,true);tbar.on('buttonClick',function(o){var value=o.button.value;if(o.button.menucmd){value=o.button.menucmd}
-var size='1',type='solid',color='black';if(el.style.borderLeftWidth){size=parseInt(el.style.borderLeftWidth);}
-if(el.style.borderLeftStyle){type=el.style.borderLeftStyle;}
-if(el.style.borderLeftColor){color=el.style.borderLeftColor;}
-switch(value){case'bordersize':var borderString=parseInt(o.button.value)+'px '+type+' '+color;el.style.border=borderString;if(parseInt(o.button.value)>0){tbar.enableButton(tbar.getButtonByValue('bordertype'));tbar.enableButton(tbar.getButtonByValue('bordercolor'));}else{tbar.disableButton(tbar.getButtonByValue('bordertype'));tbar.disableButton(tbar.getButtonByValue('bordercolor'));}
-break;case'bordertype':var borderString=size+'px '+o.button.value+' '+color;el.style.border=borderString;break;case'right':case'left':tbar.deselectAllButtons();el.style.display='';el.align=o.button.value;break;case'inline':tbar.deselectAllButtons();el.style.display='';el.align='';break;case'block':tbar.deselectAllButtons();el.style.display='block';el.align='center';break;case'padding':var _button=tbar.getButtonById(o.button.id);el.style.margin=_button.get('label')+'px';break;}
-tbar.selectButton(tbar.getButtonByValue(o.button.value));this.moveWindow();},this,true);win.setHeader(this.STR_IMAGE_PROP_TITLE);win.setBody(body);if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){var str=this.STR_IMAGE_COPY;win.setFooter(str);}
-this.openWindow(win);Event.onAvailable('insertimage_url',function(){window.setTimeout(function(){YAHOO.util.Dom.get('insertimage_url').focus();if(blankimage){YAHOO.util.Dom.get('insertimage_url').select();}},50);if(this.get('localFileWarning')){Event.on('insertimage_url','blur',function(){var url=Dom.get('insertimage_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){var str=this.STR_IMAGE_COPY;this.get('panel').setFooter(str);}
-if(url&&url.value&&(url.value!=this.STR_IMAGE_HERE)){this.currentElement[0].setAttribute('src',url.value);var img=new Image();var self=this;window.setTimeout(function(){YAHOO.util.Dom.get('insertimage_height').value=img.height;YAHOO.util.Dom.get('insertimage_width').value=img.width;if(!self.currentElement[0]._height){self.currentElement[0]._height=img.height;}
-if(!self.currentElement[0]._width){self.currentElement[0]._width=img.width;}
-self.moveWindow();},200);img.src=url.value;}}},this,true);}},this,true);});},_handleInsertImageWindowClose:function(){var url=Dom.get('insertimage_url');var title=Dom.get('insertimage_title');var el=this.currentElement[0];if(url&&url.value&&(url.value!=this.STR_IMAGE_HERE)){el.setAttribute('src',url.value);el.setAttribute('title',title.value);el.setAttribute('alt',title.value);}else{el.parentNode.removeChild(el);}},_handleCreateLinkClick:function(){this.on('afterExecCommand',function(){var win=new YAHOO.widget.EditorWindow('createlink',{width:'300px'});var el=this.currentElement[0],url='',title='',target='',localFile=false;if(el){if(el.getAttribute('href')!=null){url=el.getAttribute('href');if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){var str=this.STR_LOCAL_FILE_WARNING;win.setFooter(str);localFile=true;}else{win.setFooter(' ');}}
-if(el.getAttribute('title')!=null){title=el.getAttribute('title');}
-if(el.getAttribute('target')!=null){target=el.getAttribute('target');}}
-var str='<label for="createlink_url"><strong>'+this.STR_LINK_URL+':</strong> <input type="text" name="createlink_url" id="createlink_url" value="'+url+'"'+((localFile)?' class="warning"':'')+'></label>';str+='<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"'+((target)?' checked':'')+'> '+this.STR_LINK_NEW_WINDOW+'</label>';str+='<label for="createlink_title"><strong>'+this.STR_LINK_TITLE+':</strong> <input type="text" name="createlink_title" id="createlink_title" value="'+title+'"></label>';var body=document.createElement('div');body.innerHTML=str;var unlinkCont=document.createElement('div');unlinkCont.className='removeLink';var unlink=document.createElement('a');unlink.href='#';unlink.innerHTML=this.STR_LINK_PROP_REMOVE;unlink.title=this.STR_LINK_PROP_REMOVE;Event.on(unlink,'click',function(ev){Event.stopEvent(ev);this.execCommand('unlink');this.closeWindow();},this,true);unlinkCont.appendChild(unlink);body.appendChild(unlinkCont);win.setHeader(this.STR_LINK_PROP_TITLE);win.setBody(body);Event.onAvailable('createlink_url',function(){window.setTimeout(function(){try{YAHOO.util.Dom.get('createlink_url').focus();}catch(e){}},50);Event.on('createlink_url','blur',function(){var url=Dom.get('createlink_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');}},this,true);},this,true);this.openWindow(win);});},_handleCreateLinkWindowClose:function(){var url=Dom.get('createlink_url');var target=Dom.get('createlink_target');var title=Dom.get('createlink_title');var el=this.currentElement[0];if(url&&url.value){var urlValue=url.value;if((urlValue.indexOf(':/'+'/')==-1)&&(urlValue.substring(0,1)!='/')&&(urlValue.substring(0,6).toLowerCase()!='mailto')){if((urlValue.indexOf('@')!=-1)&&(urlValue.substring(0,6).toLowerCase()!='mailto')){urlValue='mailto:'+urlValue;}else{urlValue='http:/'+'/'+urlValue;}}
-el.setAttribute('href',urlValue);if(target.checked){el.setAttribute('target',target.value);}else{el.setAttribute('target','');}
-el.setAttribute('title',((title.value)?title.value:''));}else{el.removeAttribute('tag');Dom.removeClass(el,'yui-tag-a');Dom.removeClass(el,'yui-tag');Dom.addClass(el,'yui-non');}
-this.nodeChange();},render:function(){if(!this.DOMReady){this._queue[this._queue.length]=['render',arguments];return false;}
-var self=this;var tbarConf=this.get('toolbar');tbarConf.disabled=true;this.toolbar=new Toolbar(this.get('toolbar_cont'),tbarConf);this.fireEvent('toolbarLoaded',{type:'toolbarLoaded',target:this.toolbar});this.toolbar.on('toolbarCollapsed',function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on('toolbarExpanded',function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on('fontsizeClick',function(o){this._handleFontSize(o);},this,true);this.toolbar.on('colorPickerClicked',function(o){this._handleColorPicker(o);},this,true);this.toolbar.on('alignClick',function(o){this._handleAlign(o);},this,true);this.on('afterNodeChange',function(){this._handleAfterNodeChange();},this,true);this.toolbar.on('insertimageClick',function(){this._handleInsertImageClick();},this,true);this.on('windowinsertimageClose',function(){this._handleInsertImageWindowClose();},this,true);this.toolbar.on('createlinkClick',function(){this._handleCreateLinkClick();},this,true);this.on('windowcreatelinkClose',function(){this._handleCreateLinkWindowClose();},this,true);this.get('parentNode').replaceChild(this.get('element_cont').get('element'),this.get('element'));if(!this.beforeElement){this.beforeElement=document.createElement('h2');this.beforeElement.className='yui-editor-skipheader';this.beforeElement.tabIndex='-1';this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get('element_cont').get('firstChild').insertBefore(this.beforeElement,this.toolbar.get('nextSibling'));}
-Dom.setStyle(this.get('textarea'),'display','none');this.get('element_cont').appendChild(this.get('element'));this.get('element_cont').setStyle('display','block');this.get('element_cont').setStyle('width',this.get('width'));Dom.setStyle(this.get('iframe').get('parentNode'),'height',this.get('height'));this.get('iframe').setStyle('width','100%');this.get('iframe').setStyle('height','100%');var self=this;window.setTimeout(function(){self._setInitialContent.call(self);},10);this.fireEvent('afterRender',{type:'afterRender',target:this});},execCommand:function(action,value){this.fireEvent('beforeExecCommand',{type:'beforeExecCommand',target:this,args:arguments});if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}
-this._setMarkupType(action);if(this.browser.ie){this._getWindow().focus();}
-var exec=true;var _sel=this._getSelection();var _range=this._getRange();var _selEl=this._getSelectedElement();if(_selEl){_sel=_selEl;}
-switch(action.toLowerCase()){case'heading':if(this.browser.ie){action='formatblock';}
-if(value=='none'){if((_sel&&_sel.tagName&&(_sel.tagName.toLowerCase().substring(0,1)=='h'))||(_sel&&_sel.parentNode&&_sel.parentNode.tagName&&(_sel.parentNode.tagName.toLowerCase().substring(0,1)=='h'))){if(_sel.parentNode.tagName.toLowerCase().substring(0,1)=='h'){_sel=_sel.parentNode;}
-var _span=this._getDoc().createElement('span');_span.className='yui-non';_span.innerHTML=_sel.innerHTML;_sel.parentNode.replaceChild(_span,_sel);}
-exec=false;}else{if(this.browser.ie||this.browser.webkit||this.browser.opera){this._createCurrentElement(value);exec=false;}}
-break;case'backcolor':if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);action='hilitecolor';}
-break;case'hiddenelements':this._showHidden();exec=false;break;case'unlink':var el=this.currentElement[0];el.removeAttribute('title');el.removeAttribute('tag');el.removeAttribute('target');el.removeAttribute('href');YAHOO.util.Dom.addClass(el,'yui-non');YAHOO.util.Dom.removeClass(el,'yui-tag-a');YAHOO.util.Dom.removeClass(el,'yui-tag');exec=false;break;case'createlink':var el=this._getSelectedElement();if(!el||(el.getAttribute('tag')!='a')){this._createCurrentElement('a');}else{this.currentElement[0]=el;}
-exec=false;break;case'insertimage':if(value==''){value=this.get('blankimage');}
-var el=this._getSelectedElement();if(el&&el.tagName&&(el.tagName.toLowerCase()=='img')){this.currentElement[0]=el;exec=false;}else{if(this._getDoc().queryCommandEnabled(action)){this._getDoc().execCommand('insertimage',false,value);var imgs=this._getDoc().getElementsByTagName('img');for(var i=0;i<imgs.length;i++){if(!YAHOO.util.Dom.hasClass(imgs[i],'yui-img')){YAHOO.util.Dom.addClass(imgs[i],'yui-img');this.currentElement[0]=imgs[i];}}
-exec=false;}else{this._createCurrentElement('img');var _img=this._getDoc().createElement('img');_img.setAttribute('src',value);YAHOO.util.Dom.addClass(_img,'yui-img');this.currentElement[0].parentNode.replaceChild(_img,this.currentElement[0]);this.currentElement[0]=_img;exec=false;}}
-break;case'inserthtml':if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(action)){this._createCurrentElement('img');var _span=this._getDoc().createElement('span');_span.innerHTML=value;this.currentElement[0].parentNode.replaceChild(_span,this.currentElement[0]);exec=false;}else if(this.browser.ie){var _range=this._getRange();if(_range.item){_range.item(0).outerHTML=value;}else{_range.pasteHTML(value);}
-exec=false;}
-break;case'removeformat':if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(action)){this._createCurrentElement('span');YAHOO.util.Dom.addClass(this.currentElement[0],'yui-non');var re=/<\S[^><]*>/g;var str=this.currentElement[0].innerHTML.replace(re,'');var _txt=this._getDoc().createTextNode(str);this.currentElement[0].parentNode.parentNode.replaceChild(_txt,this.currentElement[0].parentNode);exec=false;}
-break;case'superscript':case'subscript':if(this.browser.webkit){var tag=action.toLowerCase().substring(0,3);this._createCurrentElement(tag);if(this.currentElement[0].parentNode.tagName.toLowerCase()==tag){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}else{var _sub=this._getDoc().createElement(tag);_sub.innerHTML=this.currentElement[0].innerHTML;this.currentElement[0].parentNode.replaceChild(_sub,this.currentElement[0]);}
-exec=false;}
-break;case'formatblock':value='blockquote';if(this.browser.webkit){this._createCurrentElement('blockquote');if(YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode,'yui-tag-blockquote')){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}
-exec=false;}else{var tar=Event.getTarget(this.currentEvent);if(tar&&tar.tagName&&(tar.tagName.toLowerCase()=='blockquote')){var span=this._getDoc().createElement('span');span.innerHTML=tar.innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');tar.parentNode.replaceChild(span,tar);exec=false;}}
-break;case'indent':case'outdent':this._createCurrentElement(action.toLowerCase());if(this.currentElement[0].parentNode){if(action.toLowerCase()=='outdent'){if(YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode,'yui-tag-indent')){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}}}
-exec=false;break;case'insertorderedlist':case'insertunorderedlist':var tag=((action.toLowerCase()=='insertorderedlist')?'ol':'ul');if((this.browser.webkit&&!this._getDoc().queryCommandEnabled(action))){var selEl=this._getSelectedElement();if((selEl.tagName.toLowerCase()=='li')&&(selEl.parentNode.tagName.toLowerCase()==tag)){var el=selEl.parentNode;var list=this._getDoc().createElement('span');YAHOO.util.Dom.addClass(list,'yui-non');var str='';var lis=el.getElementsByTagName('li');for(var i=0;i<lis.length;i++){str+=lis[i].innerHTML+'<br>';}
-list.innerHTML=str;}else{this._createCurrentElement(tag.toLowerCase());var el=this.currentElement[0];var list=this._getDoc().createElement(tag);if(tag=='ol'){list.type=value;}
-var li=this._getDoc().createElement('li');li.innerHTML=el.innerHTML+'&nbsp;';list.appendChild(li);}
-el.parentNode.replaceChild(list,el);exec=false;}else{var el=this._getSelectedElement();if((el.tagName.toLowerCase()=='li')&&(el.parentNode.tagName.toLowerCase()==tag)||(this.browser.ie&&this._getRange().parentElement&&this._getRange().parentElement.tagName&&(this._getRange().parentElement.tagName.toLowerCase()=='li'))){if(this.browser.ie){exec=false;var str='';var lis=el.parentNode.getElementsByTagName('li');for(var i=0;i<lis.length;i++){str+=lis[i].innerHTML+'<br>';}
-var newEl=this._getDoc().createElement('span');newEl.innerHTML=str;el.parentNode.parentNode.replaceChild(newEl,el.parentNode);}else{this.nodeChange();this._getDoc().execCommand(action,'',el.parentNode);this.nodeChange();}}
-if(this.browser.opera){var self=this;window.setTimeout(function(){var lis=self._getDoc().getElementsByTagName('li');for(var i=0;i<lis.length;i++){if(lis[i].innerHTML.toLowerCase()=='<br>'){lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);}}},30);}
-if(this.browser.ie&&exec){var html='';if(this._getRange().html){html='<li>'+this._getRange().html+'</li>';}else{html='<li>'+this._getRange().text+'</li>';}
-this._getRange().pasteHTML('<'+tag+'>'+html+'</'+tag+'>');exec=false;}}
-break;case'fontname':var selEl=this._getSelectedElement();this.currentFont=value;if(selEl&&selEl.tagName&&!this._hasSelection()){YAHOO.util.Dom.setStyle(selEl,'font-family',value);exec=false;}
-break;case'fontsize':if((this.currentElement.length>0)&&(!this._hasSelection())){YAHOO.util.Dom.setStyle(this.currentElement,'fontSize',value);}else{this._createCurrentElement('span',{'fontSize':value});}
-exec=false;break;}
-if(exec){try{this._getDoc().execCommand(action,false,value);}catch(e){}}else{}
-this.on('afterExecCommand',function(){this.unsubscribeAll('afterExecCommand');this.nodeChange();});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});},_createCurrentElement:function(tagName,tagStyle){var tagName=((tagName)?tagName:'a'),sel=this._getSelection(),tar=null,el=[],_doc=this._getDoc();if(this.currentFont){if(!tagStyle){tagStyle={};}
-tagStyle.fontFamily=this.currentFont;this.currentFont=null;}
-this.currentElement=[];var _elCreate=function(){switch(tagName){case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':var el=_doc.createElement(tagName);break;default:var el=_doc.createElement('span');YAHOO.util.Dom.addClass(el,'yui-tag-'+tagName);YAHOO.util.Dom.addClass(el,'yui-tag');el.setAttribute('tag',tagName);el.tabIndex=1;for(var i in tagStyle){if(YAHOO.util.Lang.hasOwnProperty(tagStyle,i)){el.style[i]=tagStyle[i];}}
-break;}
-return el;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled('insertimage')){this._getDoc().execCommand('insertimage',false,'yui-tmp-img');var imgs=this._getDoc().getElementsByTagName('img');for(var i=0;i<imgs.length;i++){if(imgs[i].getAttribute('src',2)=='yui-tmp-img'){el=_elCreate();imgs[i].parentNode.replaceChild(el,imgs[i]);this.currentElement[this.currentElement.length]=el;}}}else{if(this.currentEvent){tar=YAHOO.util.Event.getTarget(this.currentEvent);}else{tar=this._getDoc().body;}}
-if(tar){el=_elCreate();if(tar.tagName.toLowerCase()=='body'){tar.appendChild(el);}else if(tar.nextSibling){tar.parentNode.insertBefore(el,tar.nextSibling);}else{tar.parentNode.appendChild(el);}
-this.currentElement[this.currentElement.length]=el;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(el,0,el,0);this._getSelection().collapse(true);}}}else{this._setEditorStyle(true);this._getDoc().execCommand('fontname',false,'yui-tmp');var _tmp=[];var _tmp1=this._getDoc().getElementsByTagName('font');var _tmp2=this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);var _tmp3=this._getDoc().getElementsByTagName('span');var _tmp4=this._getDoc().getElementsByTagName('i');var _tmp5=this._getDoc().getElementsByTagName('b');for(var e=0;e<_tmp1.length;e++){_tmp[_tmp.length]=_tmp1[e];}
-for(var e=0;e<_tmp2.length;e++){_tmp[_tmp.length]=_tmp2[e];}
-for(var e=0;e<_tmp3.length;e++){_tmp[_tmp.length]=_tmp3[e];}
-for(var e=0;e<_tmp4.length;e++){_tmp[_tmp.length]=_tmp4[e];}
-for(var e=0;e<_tmp5.length;e++){_tmp[_tmp.length]=_tmp5[e];}
-for(var i=0;i<_tmp.length;i++){if((YAHOO.util.Dom.getStyle(_tmp[i],'font-family')=='yui-tmp')||(_tmp[i].face&&(_tmp[i].face=='yui-tmp'))){var el=_elCreate();el.innerHTML=_tmp[i].innerHTML;if(_tmp[i].parentNode){_tmp[i].parentNode.replaceChild(el,_tmp[i]);this.currentElement[this.currentElement.length]=el;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(el,0,el,0);this._getSelection().collapse(true);}
-if(this.browser.ie&&tagStyle&&tagStyle.fontSize){this._getSelection().empty();}
-if(this.browser.gecko){this._getSelection().collapseToStart();}}}}
-var len=this.currentElement.length;for(var i=0;i<len;i++){if((i+1)!=len){if(this.currentElement[i]&&this.currentElement[i].nextSibling){if(this.currentElement[i].tagName&&(this.currentElement[i].tagName.toLowerCase()!='br')){this.currentElement[this.currentElement.length]=this.currentElement[i].nextSibling;}}}}}},saveHTML:function(){var html=this.cleanHTML();this.get('textarea').value=html;return html;},setEditorHTML:function(html){this._getDoc().body.innerHTML=html;this.nodeChange();},getEditorHTML:function(){return this._getDoc().body.innerHTML;},cleanHTML:function(html){if(!html){var html=this.getEditorHTML();}
-html=html.replace(/<div><br><\/div>/gi,'<YUI_BR>');html=html.replace(/<p>(&nbsp;|&#160;)<\/p>/g,'<YUI_BR>');html=html.replace(/<p><br>&nbsp;<\/p>/gi,'<YUI_BR>');html=html.replace(/<p>&nbsp;<\/p>/gi,'<YUI_BR>');html=html.replace(/<br class="khtml-block-placeholder">/gi,'<YUI_BR>');html=html.replace(/<br>/gi,'<YUI_BR>');html=html.replace(/<br\/>/gi,'<YUI_BR>');html=html.replace(/<img([^>]*)>/gi,'<YUI_IMG$1>');html=html.replace(/<ul([^>]*)>/gi,'<YUI_UL$1>');html=html.replace(/<\/ul>/gi,'<\/YUI_UL>');html=html.replace(/<i([^>]*)>/gi,'<em$1>');html=html.replace(/<\/i>/gi,'</em>');html=html.replace(/<b([^>]*)>/gi,'<strong$1>');html=html.replace(/<\/b>/gi,'</strong>');html=html.replace(/<font/gi,'<font');html=html.replace(/<\/font>/gi,'</font>');html=html.replace(/<span/gi,'<span');html=html.replace(/<\/span>/gi,'</span>');html=html.replace(/<u/gi,'<u');html=html.replace(/\/u>/gi,'/u>');html=html.replace(/<ol([^>]*)>/gi,'<ol$1>');html=html.replace(/\/ol>/gi,'/ol>');html=html.replace(/<li/gi,'<li');html=html.replace(/\/li>/gi,'/li>');html=html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>','gi'),'<a $1 $2>$3</a>');if(this.browser.webkit){html=html.replace(/Apple-style-span/gi,'');html=html.replace(/style="line-height: normal;"/gi,'');}
-html=html.replace(/yui-tag-a/gi,'');html=html.replace(/yui-tag-span/gi,'');html=html.replace(/yui-tag/gi,'');html=html.replace(/yui-non/gi,'');html=html.replace(/yui-img/gi,'');html=html.replace(/ tag="span"/gi,'');html=html.replace(/ class=""/gi,'');html=html.replace(/ class=" "/gi,'');html=html.replace(/ class="  "/gi,'');html=html.replace(/ target=""/gi,'');html=html.replace(/ title=""/gi,'');html=html.replace(/<br><li/gi,'<li');html=html.replace(/<YUI_BR>/g,'<br>');html=html.replace(/<YUI_IMG([^>]*)>/g,'<img$1>');html=html.replace(/<YUI_UL([^>]*)>/g,'<ul$1>');html=html.replace(/<\/YUI_UL>/g,'<\/ul>');return html;},clearEditorDoc:function(){this._getDoc().body.innerHTML='&nbsp;';},_renderPanel:function(){if(!YAHOO.widget.EditorInfo.panel){var panel=new YAHOO.widget.Panel(this.EDITOR_PANEL_ID,{width:'300px',iframe:true,visible:false,underlay:'none',draggable:false,close:false});YAHOO.widget.EditorInfo.panel=panel;}else{var panel=YAHOO.widget.EditorInfo.panel;}
-this.set('panel',panel);this.get('panel').setBody('---');this.get('panel').setHeader(' ');this.get('panel').setFooter(' ');if(this.DOMReady){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');}else{Event.onDOMReady(function(){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');},this,true);}
-this.get('panel').showEvent.subscribe(function(){YAHOO.util.Dom.setStyle(this.element,'display','block');});return this.get('panel');},openWindow:function(win){this.toolbar.set('disabled',true);Event.addListener(document,'keypress',this._closeWindow,this,true);if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}
-YAHOO.widget.EditorInfo.window.win=win;YAHOO.widget.EditorInfo.window.scope=this;var self=this,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]-20),(xy[1]+elXY[1]+10)],wWidth=(parseInt(win.attrs.width)/2),align='center';this.fireEvent('beforeOpenWindow',{type:'beforeOpenWindow',win:win,panel:panel});body=document.createElement('div');body.className=this.CLASS_PREFIX+'-body-cont';var _note=document.createElement('h3');_note.className='yui-editor-skipheader';_note.innerHTML=this.STR_CLOSE_WINDOW_NOTE;body.appendChild(_note);form=document.createElement('form');form.setAttribute('method','GET');var windowName=win.name;Event.addListener(form,'submit',function(ev){var evName='window'+windowName+'Submit';self.fireEvent(evName,{type:evName,target:this});Event.stopEvent(ev);},this,true);body.appendChild(form);Dom.setStyle(panel.element.firstChild,'width',win.attrs.width);if(Lang.isObject(win.body)){form.appendChild(win.body);}else{var _tmp=document.createElement('div');_tmp.innerHTML=win.body;form.appendChild(_tmp);}
-var _close=document.createElement('span');_close.innerHTML='X';_close.title=this.STR_CLOSE_WINDOW;_close.className='close';Event.addListener(_close,'click',function(){this.closeWindow();},this,true);var _knob=document.createElement('span');_knob.innerHTML='^';_knob.className='knob';win._knob=_knob;var _header=document.createElement('h3');_header.innerHTML=win.header;panel.cfg.setProperty('width',win.attrs.width);panel.setHeader(' ');panel.appendToHeader(_header);_header.appendChild(_close);_header.appendChild(_knob);panel.setBody(' ');panel.setFooter(' ');if(win.footer!=null){panel.setFooter(win.footer);}
-panel.appendToBody(body);panel.showEvent.subscribe(function(){Event.addListener(panel.element,'click',function(ev){Event.stopPropagation(ev);});},this,true);panel.hideEvent.subscribe(function(){this.currentWindow=null;var evName='window'+windowName+'Close';this.fireEvent(evName,{type:evName,target:this});},this,true);this.currentWindow=win;this.moveWindow(true);panel.show();this.fireEvent('afterOpenWindow',{type:'afterOpenWindow',win:win,panel:panel});},moveWindow:function(force){if(!this.currentWindow){return false;}
-var win=this.currentWindow,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]),(xy[1]+elXY[1])],wWidth=(parseInt(win.attrs.width)/2),align='center',orgXY=panel.cfg.getProperty('xy'),_knob=win._knob;newXY[0]=((newXY[0]-wWidth)+20);newXY[0]=newXY[0]-Dom.getDocumentScrollLeft(this._getDoc());newXY[1]=newXY[1]-Dom.getDocumentScrollTop(this._getDoc());if(this.currentElement[0].tagName&&(this.currentElement[0].tagName.toLowerCase()=='img')){if(this.currentElement[0].src.indexOf(this.get('blankimage'))!=-1){newXY[0]=(newXY[0]+(75/2));newXY[1]=(newXY[1]+75);}else{var w=parseInt(this.currentElement[0].width);var h=parseInt(this.currentElement[0].height);newXY[0]=(newXY[0]+(w/2));newXY[1]=(newXY[1]+h);}
-newXY[1]=newXY[1]+15;}else{if(Dom.getStyle(this.currentElement[0],'fontSize').indexOf('px')!=-1){newXY[1]=newXY[1]+parseInt(Dom.getStyle(this.currentElement[0],'fontSize'))+5;}else{newXY[1]=newXY[1]+20;}}
-if(newXY[0]<elXY[0]){newXY[0]=elXY[0]+5;align='left';}
-if((newXY[0]+(wWidth*2))>(elXY[0]+parseInt(this.get('iframe').get('element').clientWidth))){newXY[0]=((elXY[0]+parseInt(this.get('iframe').get('element').clientWidth))-(wWidth*2)-5);align='right';}
-try{var xDiff=(newXY[0]-orgXY[0]);var yDiff=(newXY[1]-orgXY[1]);}catch(e){var xDiff=0;var yDiff=0;}
-xDiff=((xDiff<0)?(xDiff*-1):xDiff);yDiff=((yDiff<0)?(yDiff*-1):yDiff);if(((xDiff>10)||(yDiff>10))||force){var _knobLeft=0,elW=0;if(this.currentElement[0].width){elW=(parseInt(this.currentElement[0].width)/2);}
-var leftOffset=xy[0]+elXY[0]+elW;_knobLeft=leftOffset-newXY[0];if(_knobLeft>(parseInt(win.attrs.width)-40)){_knobLeft=parseInt(win.attrs.width)-40;}else if(_knobLeft<40){_knobLeft=40;}
-if(isNaN(_knobLeft)){_knobLeft=40;}
-if(force){if(_knob){_knob.style.left=_knobLeft+'px';}
-if(this.get('animate')){Dom.setStyle(panel.element,'opacity','0');var anim=new YAHOO.util.Anim(panel.element,{opacity:{from:0,to:1}},.1,YAHOO.util.Easing.easeOut);panel.cfg.setProperty('xy',newXY);anim.onComplete.subscribe(function(){if(this.browser.ie){panel.element.style.filter='none';}},this,true);anim.animate();}else{panel.cfg.setProperty('xy',newXY);}}else{if(this.get('animate')){var anim=new YAHOO.util.Anim(panel.element,{},.5,YAHOO.util.Easing.easeOut);anim.attributes={top:{to:newXY[1]},left:{to:newXY[0]}}
-anim.onComplete.subscribe(function(){panel.cfg.setProperty('xy',newXY);});var iframeAnim=new YAHOO.util.Anim(panel.iframe,anim.attributes,.5,YAHOO.util.Easing.easeOut)
-var _knobAnim=new YAHOO.util.Anim(_knob,{left:{to:_knobLeft}},.75,YAHOO.util.Easing.easeOut);anim.animate();iframeAnim.animate();_knobAnim.animate();}else{_knob.style.left=_knobLeft+'px';panel.cfg.setProperty('xy',newXY);}}}},_closeWindow:function(ev){if(ev.keyCode==27){if(this.currentWindow){this.closeWindow();}}},closeWindow:function(){YAHOO.widget.EditorInfo.window={};this.fireEvent('closeWindow',{type:'closeWindow',win:this.currentWindow});this.currentWindow=null;this.get('panel').hide();this.get('panel').cfg.setProperty('xy',[-900,-900]);this.get('panel').syncIframe();this.unsubscribeAll('afterExecCommand');this.toolbar.set('disabled',false);this._focusWindow();Event.removeListener(document,'keypress',this._closeWindow);},destroy:function(){this.saveHTML();this.toolbar.destroy();Dom.setStyle(this.get('textarea'),'display','block');var textArea=this.get('textarea');this.get('element_cont').get('parentNode').replaceChild(textArea,this.get('element_cont').get('element'));this.get('element_cont').get('element').innerHTML='';for(var i in this){if(Lang.hasOwnProperty(this,i)){this[i]=null;}}
-return true;},toString:function(){var str='Editor';if(this.get&&this.get('element_cont')){str='Editor (#'+this.get('element_cont').get('id')+')'+((this.get('disabled')?' Disabled':''));}
-return str;}});YAHOO.widget.EditorInfo={window:{},panel:null}
-YAHOO.widget.EditorWindow=function(name,attrs){this.name=name.replace(' ','_');this.attrs=attrs;}
-YAHOO.widget.EditorWindow.prototype={_cache:null,header:null,body:null,footer:null,setHeader:function(str){this.header=str;},setBody:function(str){this.body=str;},setFooter:function(str){this.footer=str;},toString:function(){return'Editor Window ('+this.name+')';}};})();YAHOO.register("editor",YAHOO.widget.Editor,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;if(YAHOO.widget.Button){YAHOO.widget.ToolbarButtonAdvanced=YAHOO.widget.Button;YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType="rich";YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue=function(F){var E=this.getMenu().getItems();if(E.length===0){this.getMenu()._onBeforeShow();E=this.getMenu().getItems();}for(var D=0;D<E.length;D++){E[D].cfg.setProperty("checked",false);if(E[D].value==F){E[D].cfg.setProperty("checked",true);}}};}else{YAHOO.widget.ToolbarButtonAdvanced=function(){};}YAHOO.widget.ToolbarButton=function(E,D){if(C.isObject(arguments[0])&&!B.get(E).nodeType){D=E;}var G=(D||{});var F={element:null,attributes:G};if(!F.attributes.type){F.attributes.type="push";}F.element=document.createElement("span");F.element.setAttribute("unselectable","on");F.element.className="yui-button yui-"+F.attributes.type+"-button";F.element.innerHTML="<span class=\"first-child\"><a href=\"#\">LABEL</a></span>";F.attributes.id=B.generateId();YAHOO.widget.ToolbarButton.superclass.constructor.call(this,F.element,F.attributes);};YAHOO.extend(YAHOO.widget.ToolbarButton,YAHOO.util.Element,{buttonType:"normal",_handleMouseOver:function(){if(!this.get("disabled")){this.addClass("yui-button-hover");this.addClass("yui-"+this.get("type")+"-button-hover");}},_handleMouseOut:function(){this.removeClass("yui-button-hover");this.removeClass("yui-"+this.get("type")+"-button-hover");},checkValue:function(F){if(this.get("type")=="menu"){var E=this._button.options;for(var D=0;D<E.length;D++){if(E[D].value==F){E.selectedIndex=D;}}}},init:function(E,D){YAHOO.widget.ToolbarButton.superclass.init.call(this,E,D);this.on("mouseover",this._handleMouseOver,this,true);this.on("mouseout",this._handleMouseOut,this,true);},initAttributes:function(D){YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this,D);this.setAttributeConfig("value",{value:D.value});this.setAttributeConfig("menu",{value:D.menu||false});this.setAttributeConfig("type",{value:D.type,writeOnce:true,method:function(H){var G,F;if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0];}switch(H){case"select":case"menu":G=document.createElement("select");var I=this.get("menu");for(var E=0;E<I.length;E++){F=document.createElement("option");F.innerHTML=I[E].text;F.value=I[E].value;if(I[E].checked){F.selected=true;}G.appendChild(F);}this._button.parentNode.replaceChild(G,this._button);A.on(G,"change",this._handleSelect,this,true);this._button=G;break;}}});this.setAttributeConfig("disabled",{value:D.disabled||false,method:function(E){if(E){this.addClass("yui-button-disabled");this.addClass("yui-"+this.get("type")+"-button-disabled");}else{this.removeClass("yui-button-disabled");this.removeClass("yui-"+this.get("type")+"-button-disabled");}if(this.get("type")=="menu"){this._button.disabled=E;}}});this.setAttributeConfig("label",{value:D.label,method:function(E){if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0];}if(this.get("type")=="push"){this._button.innerHTML=E;}}});this.setAttributeConfig("title",{value:D.title});this.setAttributeConfig("container",{value:null,writeOnce:true,method:function(E){this.appendTo(E);}});},_handleSelect:function(E){var D=A.getTarget(E);var F=D.options[D.selectedIndex].value;this.fireEvent("change",{type:"change",value:F});},getMenu:function(){return this.get("menu");},fireEvent:function(E,D){if(this.DOM_EVENTS[E]&&this.get("disabled")){return ;}YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this,E,D);},toString:function(){return"ToolbarButton ("+this.get("id")+")";}});})();(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;YAHOO.widget.Toolbar=function(G,F){if(D.isObject(arguments[0])&&!B.get(G).nodeType){F=G;}var I=(F||{});var H={element:null,attributes:I};if(D.isString(G)&&B.get(G)){H.element=B.get(G);}else{if(D.isObject(G)&&B.get(G)&&B.get(G).nodeType){H.element=B.get(G);}}if(!H.element){H.element=document.createElement("DIV");H.element.id=B.generateId();if(I.container&&B.get(I.container)){B.get(I.container).appendChild(H.element);}}if(!H.element.id){H.element.id=((D.isString(G))?G:B.generateId());}var E=document.createElement("DIV");H.attributes.cont=E;B.addClass(E,"yui-toolbar-subcont");H.element.appendChild(E);H.attributes.element=H.element;H.attributes.id=H.element.id;YAHOO.widget.Toolbar.superclass.constructor.call(this,H.element,H.attributes);};function C(H,E,I){B.addClass(this.element,"yui-toolbar-"+I.get("value")+"-menu");if(B.hasClass(I._button.parentNode.parentNode,"yui-toolbar-select")){B.addClass(this.element,"yui-toolbar-select-menu");}var F=this.getItems();for(var G=0;G<F.length;G++){B.addClass(F[G].element,"yui-toolbar-"+I.get("value")+"-"+((F[G].value)?F[G].value.replace(/ /g,"-").toLowerCase():F[G]._oText.nodeValue.replace(/ /g,"-").toLowerCase()));B.addClass(F[G].element,"yui-toolbar-"+I.get("value")+"-"+((F[G].value)?F[G].value.replace(/ /g,"-"):F[G]._oText.nodeValue.replace(/ /g,"-")));}}YAHOO.extend(YAHOO.widget.Toolbar,YAHOO.util.Element,{buttonType:YAHOO.widget.ToolbarButton,dd:null,_colorData:{"#111111":"Obsidian","#2D2D2D":"Dark Gray","#434343":"Shale","#5B5B5B":"Flint","#737373":"Gray","#8B8B8B":"Concrete","#A2A2A2":"Gray","#B9B9B9":"Titanium","#000000":"Black","#D0D0D0":"Light Gray","#E6E6E6":"Silver","#FFFFFF":"White","#BFBF00":"Pumpkin","#FFFF00":"Yellow","#FFFF40":"Banana","#FFFF80":"Pale Yellow","#FFFFBF":"Butter","#525330":"Raw Siena","#898A49":"Mildew","#AEA945":"Olive","#7F7F00":"Paprika","#C3BE71":"Earth","#E0DCAA":"Khaki","#FCFAE1":"Cream","#60BF00":"Cactus","#80FF00":"Chartreuse","#A0FF40":"Green","#C0FF80":"Pale Lime","#DFFFBF":"Light Mint","#3B5738":"Green","#668F5A":"Lime Gray","#7F9757":"Yellow","#407F00":"Clover","#8A9B55":"Pistachio","#B7C296":"Light Jade","#E6EBD5":"Breakwater","#00BF00":"Spring Frost","#00FF80":"Pastel Green","#40FFA0":"Light Emerald","#80FFC0":"Sea Foam","#BFFFDF":"Sea Mist","#033D21":"Dark Forrest","#438059":"Moss","#7FA37C":"Medium Green","#007F40":"Pine","#8DAE94":"Yellow Gray Green","#ACC6B5":"Aqua Lung","#DDEBE2":"Sea Vapor","#00BFBF":"Fog","#00FFFF":"Cyan","#40FFFF":"Turquoise Blue","#80FFFF":"Light Aqua","#BFFFFF":"Pale Cyan","#033D3D":"Dark Teal","#347D7E":"Gray Turquoise","#609A9F":"Green Blue","#007F7F":"Seaweed","#96BDC4":"Green Gray","#B5D1D7":"Soapstone","#E2F1F4":"Light Turquoise","#0060BF":"Summer Sky","#0080FF":"Sky Blue","#40A0FF":"Electric Blue","#80C0FF":"Light Azure","#BFDFFF":"Ice Blue","#1B2C48":"Navy","#385376":"Biscay","#57708F":"Dusty Blue","#00407F":"Sea Blue","#7792AC":"Sky Blue Gray","#A8BED1":"Morning Sky","#DEEBF6":"Vapor","#0000BF":"Deep Blue","#0000FF":"Blue","#4040FF":"Cerulean Blue","#8080FF":"Evening Blue","#BFBFFF":"Light Blue","#212143":"Deep Indigo","#373E68":"Sea Blue","#444F75":"Night Blue","#00007F":"Indigo Blue","#585E82":"Dockside","#8687A4":"Blue Gray","#D2D1E1":"Light Blue Gray","#6000BF":"Neon Violet","#8000FF":"Blue Violet","#A040FF":"Violet Purple","#C080FF":"Violet Dusk","#DFBFFF":"Pale Lavender","#302449":"Cool Shale","#54466F":"Dark Indigo","#655A7F":"Dark Violet","#40007F":"Violet","#726284":"Smoky Violet","#9E8FA9":"Slate Gray","#DCD1DF":"Violet White","#BF00BF":"Royal Violet","#FF00FF":"Fuchsia","#FF40FF":"Magenta","#FF80FF":"Orchid","#FFBFFF":"Pale Magenta","#4A234A":"Dark Purple","#794A72":"Medium Purple","#936386":"Cool Granite","#7F007F":"Purple","#9D7292":"Purple Moon","#C0A0B6":"Pale Purple","#ECDAE5":"Pink Cloud","#BF005F":"Hot Pink","#FF007F":"Deep Pink","#FF409F":"Grape","#FF80BF":"Electric Pink","#FFBFDF":"Pink","#451528":"Purple Red","#823857":"Purple Dino","#A94A76":"Purple Gray","#7F003F":"Rose","#BC6F95":"Antique Mauve","#D8A5BB":"Cool Marble","#F7DDE9":"Pink Granite","#C00000":"Apple","#FF0000":"Fire Truck","#FF4040":"Pale Red","#FF8080":"Salmon","#FFC0C0":"Warm Pink","#441415":"Sepia","#82393C":"Rust","#AA4D4E":"Brick","#800000":"Brick Red","#BC6E6E":"Mauve","#D8A3A4":"Shrimp Pink","#F8DDDD":"Shell Pink","#BF5F00":"Dark Orange","#FF7F00":"Orange","#FF9F40":"Grapefruit","#FFBF80":"Canteloupe","#FFDFBF":"Wax","#482C1B":"Dark Brick","#855A40":"Dirt","#B27C51":"Tan","#7F3F00":"Nutmeg","#C49B71":"Mustard","#E1C4A8":"Pale Tan","#FDEEE0":"Marble"},_colorPicker:null,STR_COLLAPSE:"Collapse Toolbar",STR_SPIN_LABEL:"Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.",STR_SPIN_UP:"Click to increase the value of this input",STR_SPIN_DOWN:"Click to decrease the value of this input",_titlebar:null,browser:YAHOO.env.ua,_buttonList:null,_buttonGroupList:null,_sep:null,_sepCount:null,_dragHandle:null,_toolbarConfigs:{renderer:true},CLASS_CONTAINER:"yui-toolbar-container",CLASS_DRAGHANDLE:"yui-toolbar-draghandle",CLASS_SEPARATOR:"yui-toolbar-separator",CLASS_DISABLED:"yui-toolbar-disabled",CLASS_PREFIX:"yui-toolbar",init:function(F,E){YAHOO.widget.Toolbar.superclass.init.call(this,F,E);
+},initAttributes:function(E){YAHOO.widget.Toolbar.superclass.initAttributes.call(this,E);this.addClass(this.CLASS_CONTAINER);this.setAttributeConfig("buttonType",{value:E.buttonType||"basic",writeOnce:true,validator:function(F){switch(F){case"advanced":case"basic":return true;}return false;},method:function(F){if(F=="advanced"){if(YAHOO.widget.Button){this.buttonType=YAHOO.widget.ToolbarButtonAdvanced;}else{this.buttonType=YAHOO.widget.ToolbarButton;}}else{this.buttonType=YAHOO.widget.ToolbarButton;}}});this.setAttributeConfig("buttons",{value:[],writeOnce:true,method:function(G){for(var F in G){if(D.hasOwnProperty(G,F)){if(G[F].type=="separator"){this.addSeparator();}else{if(G[F].group!==undefined){this.addButtonGroup(G[F]);}else{this.addButton(G[F]);}}}}}});this.setAttributeConfig("disabled",{value:false,method:function(F){if(this.get("disabled")===F){return false;}if(F){this.addClass(this.CLASS_DISABLED);this.set("draggable",false);this.disableAllButtons();}else{this.removeClass(this.CLASS_DISABLED);if(this._configs.draggable._initialConfig.value){this.set("draggable",true);}this.resetAllButtons();}}});this.setAttributeConfig("cont",{value:E.cont,readOnly:true});this.setAttributeConfig("grouplabels",{value:((E.grouplabels===false)?false:true),method:function(F){if(F){B.removeClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"));}else{B.addClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"));}}});this.setAttributeConfig("titlebar",{value:false,method:function(G){if(G){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}this._titlebar=document.createElement("DIV");B.addClass(this._titlebar,this.CLASS_PREFIX+"-titlebar");if(D.isString(G)){var F=document.createElement("h2");F.tabIndex="-1";F.innerHTML=G;this._titlebar.appendChild(F);}if(this.get("firstChild")){this.insertBefore(this._titlebar,this.get("firstChild"));}else{this.appendChild(this._titlebar);}if(this.get("collapse")){this.set("collapse",true);}}else{if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}}});this.setAttributeConfig("collapse",{value:false,method:function(H){if(this._titlebar){var G=null;var F=B.getElementsByClassName("collapse","span",this._titlebar);if(H){if(F.length>0){return true;}G=document.createElement("SPAN");G.innerHTML="X";G.title=this.STR_COLLAPSE;B.addClass(G,"collapse");this._titlebar.appendChild(G);A.addListener(G,"click",function(){if(B.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}else{this.collapse();}},this,true);}else{G=B.getElementsByClassName("collapse","span",this._titlebar);if(G[0]){if(B.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}G[0].parentNode.removeChild(G[0]);}}}}});this.setAttributeConfig("draggable",{value:(E.draggable||false),method:function(F){if(F&&!this.get("titlebar")){if(!this._dragHandle){this._dragHandle=document.createElement("SPAN");this._dragHandle.innerHTML="|";this._dragHandle.setAttribute("title","Click to drag the toolbar");this._dragHandle.id=this.get("id")+"_draghandle";B.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get("cont").hasChildNodes()){this.get("cont").insertBefore(this._dragHandle,this.get("cont").firstChild);}else{this.get("cont").appendChild(this._dragHandle);}this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}if(this._titlebar){if(F){this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._titlebar);B.addClass(this._titlebar,"draggable");}else{B.removeClass(this._titlebar,"draggable");if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(G){var F=true;if(!YAHOO.util.DD){F=false;}return F;}});},addButtonGroup:function(I){if(!this.get("element")){this._queue[this._queue.length]=["addButtonGroup",arguments];return false;}if(!this.hasClass(this.CLASS_PREFIX+"-grouped")){this.addClass(this.CLASS_PREFIX+"-grouped");}var J=document.createElement("DIV");B.addClass(J,this.CLASS_PREFIX+"-group");B.addClass(J,this.CLASS_PREFIX+"-group-"+I.group);if(I.label){var F=document.createElement("h3");F.innerHTML=I.label;J.appendChild(F);}if(!this.get("grouplabels")){B.addClass(this.get("cont"),this.CLASS_PREFIX,"-nogrouplabels");}this.get("cont").appendChild(J);var H=document.createElement("ul");J.appendChild(H);if(!this._buttonGroupList){this._buttonGroupList={};}this._buttonGroupList[I.group]=H;for(var G=0;G<I.buttons.length;G++){var E=document.createElement("li");E.className=this.CLASS_PREFIX+"-groupitem";H.appendChild(E);if((I.buttons[G].type!==undefined)&&I.buttons[G].type=="separator"){this.addSeparator(E);}else{I.buttons[G].container=E;this.addButton(I.buttons[G]);}}},addButtonToGroup:function(G,H,I){var F=this._buttonGroupList[H];var E=document.createElement("li");E.className=this.CLASS_PREFIX+"-groupitem";G.container=E;this.addButton(G,I);F.appendChild(E);},addButton:function(J,I){if(!this.get("element")){this._queue[this._queue.length]=["addButton",arguments];return false;}if(!this._buttonList){this._buttonList=[];}if(!J.container){J.container=this.get("cont");}if((J.type=="menu")||(J.type=="split")||(J.type=="select")){if(D.isArray(J.menu)){for(var P in J.menu){if(D.hasOwnProperty(J.menu,P)){var V={fn:function(Y,W,X){if(!J.menucmd){J.menucmd=J.value;}J.value=((X.value)?X.value:X._oText.nodeValue);},scope:this};J.menu[P].onclick=V;}}}}var Q={},N=false;for(var L in J){if(D.hasOwnProperty(J,L)){if(!this._toolbarConfigs[L]){Q[L]=J[L];}}}if(J.type=="select"){Q.type="menu";}if(J.type=="spin"){Q.type="push";}if(Q.type=="color"){if(YAHOO.widget.Overlay){Q=this._makeColorButton(Q);}else{N=true;}}if(Q.menu){if((YAHOO.widget.Overlay)&&(J.menu instanceof YAHOO.widget.Overlay)){J.menu.showEvent.subscribe(function(){this._button=Q;});}else{for(var O=0;O<Q.menu.length;
+O++){if(!Q.menu[O].value){Q.menu[O].value=Q.menu[O].text;}}if(this.browser.webkit){Q.focusmenu=false;}}}if(N){J=false;}else{this._configs.buttons.value[this._configs.buttons.value.length]=J;var T=new this.buttonType(Q);if(!T.buttonType){T.buttonType="rich";T.checkValue=function(Y){var X=this.getMenu().getItems();if(X.length===0){this.getMenu()._onBeforeShow();X=this.getMenu().getItems();}for(var W=0;W<X.length;W++){X[W].cfg.setProperty("checked",false);if(X[W].value==Y){X[W].cfg.setProperty("checked",true);}}};}if(this.get("disabled")){T.set("disabled",true);}if(!J.id){J.id=T.get("id");}if(I){var F=T.get("element");var M=null;if(I.get){M=I.get("element").nextSibling;}else{if(I.nextSibling){M=I.nextSibling;}}if(M){M.parentNode.insertBefore(F,M);}}T.addClass(this.CLASS_PREFIX+"-"+T.get("value"));var S=document.createElement("span");S.className=this.CLASS_PREFIX+"-icon";T.get("element").insertBefore(S,T.get("firstChild"));if(T._button.tagName.toLowerCase()=="button"){T.get("element").setAttribute("unselectable","on");var U=document.createElement("a");U.innerHTML=T._button.innerHTML;U.href="#";A.on(U,"click",function(W){A.stopEvent(W);});T._button.parentNode.replaceChild(U,T._button);T._button=U;}if(J.type=="select"){if(T._button.tagName.toLowerCase()=="select"){S.parentNode.removeChild(S);var G=T._button;var R=T.get("element");R.parentNode.replaceChild(G,R);}else{T.addClass(this.CLASS_PREFIX+"-select");}}if(J.type=="spin"){if(!D.isArray(J.range)){J.range=[10,100];}this._makeSpinButton(T,J);}T.get("element").setAttribute("title",T.get("label"));if(J.type!="spin"){if((YAHOO.widget.Overlay)&&(Q.menu instanceof YAHOO.widget.Overlay)){var H=function(Y){var W=true;if(Y.keyCode&&(Y.keyCode==9)){W=false;}if(W){if(this._colorPicker){this._colorPicker._button=J.value;}var X=T.getMenu().element;if(B.getStyle(X,"visibility")=="hidden"){T.getMenu().show();}else{T.getMenu().hide();}}YAHOO.util.Event.stopEvent(Y);};T.on("mousedown",H,J,this);T.on("keydown",H,J,this);}else{if((J.type!="menu")&&(J.type!="select")){T.on("keypress",this._buttonClick,J,this);T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);this._buttonClick(W,J);},J,this);T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});}else{T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);});T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});T.on("change",function(W){if(!J.menucmd){J.menucmd=J.value;}J.value=W.value;this._buttonClick(W,J);},this,true);var K=this;if(T.getMenu().mouseDownEvent){T.getMenu().mouseDownEvent.subscribe(function(Y,X){var W=X[1];YAHOO.util.Event.stopEvent(X[0]);T._onMenuClick(X[0],T);if(!J.menucmd){J.menucmd=J.value;}J.value=((W.value)?W.value:W._oText.nodeValue);K._buttonClick.call(K,X[1],J);T._hideMenu();return false;});T.getMenu().clickEvent.subscribe(function(X,W){YAHOO.util.Event.stopEvent(W[0]);});T.getMenu().mouseUpEvent.subscribe(function(X,W){YAHOO.util.Event.stopEvent(W[0]);});}}}}else{T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);});T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});}if(this.browser.ie){T.DOM_EVENTS.focusin=true;T.DOM_EVENTS.focusout=true;T.on("focusin",function(W){YAHOO.util.Event.stopEvent(W);},J,this);T.on("focusout",function(W){YAHOO.util.Event.stopEvent(W);},J,this);T.on("click",function(W){YAHOO.util.Event.stopEvent(W);},J,this);}if(this.browser.webkit){T.hasFocus=function(){return true;};}this._buttonList[this._buttonList.length]=T;if((J.type=="menu")||(J.type=="split")||(J.type=="select")){if(D.isArray(J.menu)){var E=T.getMenu();if(E.renderEvent){E.renderEvent.subscribe(C,T);if(J.renderer){E.renderEvent.subscribe(J.renderer,T);}}}}}return J;},addSeparator:function(E,H){if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false;}var F=((E)?E:this.get("cont"));if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false;}if(this._sepCount===null){this._sepCount=0;}if(!this._sep){this._sep=document.createElement("SPAN");B.addClass(this._sep,this.CLASS_SEPARATOR);this._sep.innerHTML="|";}var G=this._sep.cloneNode(true);this._sepCount++;B.addClass(G,this.CLASS_SEPARATOR+"-"+this._sepCount);if(H){var I=null;if(H.get){I=H.get("element").nextSibling;}else{if(H.nextSibling){I=H.nextSibling;}else{I=H;}}if(I){if(I==H){I.parentNode.appendChild(G);}else{I.parentNode.insertBefore(G,I);}}}else{F.appendChild(G);}return G;},_createColorPicker:function(H){if(B.get(H+"_colors")){B.get(H+"_colors").parentNode.removeChild(B.get(H+"_colors"));}var E=document.createElement("div");E.className="yui-toolbar-colors";E.id=H+"_colors";E.style.display="none";A.on(window,"load",function(){document.body.appendChild(E);},this,true);this._colorPicker=E;var G="";for(var F in this._colorData){if(D.hasOwnProperty(this._colorData,F)){G+="<a style=\"background-color: "+F+"\" href=\"#\">"+F.replace("#","")+"</a>";}}G+="<span><em>X</em><strong></strong></span>";window.setTimeout(function(){E.innerHTML=G;},0);A.on(E,"mouseover",function(M){var K=this._colorPicker;var L=K.getElementsByTagName("em")[0];var J=K.getElementsByTagName("strong")[0];var I=A.getTarget(M);if(I.tagName.toLowerCase()=="a"){L.style.backgroundColor=I.style.backgroundColor;J.innerHTML=this._colorData["#"+I.innerHTML]+"<br>"+I.innerHTML;}},this,true);A.on(E,"focus",function(I){A.stopEvent(I);});A.on(E,"click",function(I){A.stopEvent(I);});A.on(E,"mousedown",function(J){A.stopEvent(J);var I=A.getTarget(J);if(I.tagName.toLowerCase()=="a"){var L=this.fireEvent("colorPickerClicked",{type:"colorPickerClicked",target:this,button:this._colorPicker._button,color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML]});if(L!==false){var K={color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML],value:this._colorPicker._button};this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:K});}this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var F=this._colorPicker.getElementsByTagName("em")[0];
+var E=this._colorPicker.getElementsByTagName("strong")[0];F.style.backgroundColor="transparent";E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));B.addClass(E.menu.element,"yui-button-menu");B.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((T<I[0])?I[0]:T);T=((T>I[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I<F.menu.length;I++){if(F.menu[I].value==F.value){J=F.menu[I].text;break;}}K.set("label","<span class=\"yui-toolbar-"+F.menucmd+"-"+(F.value).replace(/ /g,"-").toLowerCase()+"\">"+J+"</span>");var M=K.getMenu().getItems();for(var G=0;G<M.length;G++){if(M[G].value.toLowerCase()==F.value.toLowerCase()){M[G].cfg.setProperty("checked",true);}else{M[G].cfg.setProperty("checked",false);}}}}}if(L){A.stopEvent(L);}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F].get("id")==G){return this._buttonList[F];}}return false;},getButtonByValue:function(K){var H=this.get("buttons");var F=H.length;for(var I=0;I<F;I++){if(H[I].group!==undefined){for(var E=0;E<H[I].buttons.length;E++){if((H[I].buttons[E].value==K)||(H[I].buttons[E].menucmd==K)){return this.getButtonById(H[I].buttons[E].id);}if(H[I].buttons[E].menu){for(var J=0;J<H[I].buttons[E].menu.length;J++){if(H[I].buttons[E].menu[J].value==K){return this.getButtonById(H[I].buttons[E].id);}}}}}else{if((H[I].value==K)||(H[I].menucmd==K)){return this.getButtonById(H[I].id);}if(H[I].menu){for(var G=0;G<H[I].menu.length;G++){if(H[I].menu[G].value==K){return this.getButtonById(H[I].id);}}}}}return false;},getButtonByIndex:function(E){if(this._buttonList[E]){return this._buttonList[E];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(F){var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){E.set("disabled",true);}else{return false;}},enableButton:function(F){if(this.get("disabled")){return false;}var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){if(E.get("disabled")){E.set("disabled",false);}}else{return false;}},selectButton:function(I,G){var F=I;if(I){if(D.isString(I)){F=this.getButtonById(I);}if(D.isNumber(I)){F=this.getButtonByIndex(I);}if((!(F instanceof YAHOO.widget.ToolbarButton))&&(!(F instanceof YAHOO.widget.ToolbarButtonAdvanced))){F=this.getButtonByValue(I);}if((F instanceof YAHOO.widget.ToolbarButton)||(F instanceof YAHOO.widget.ToolbarButtonAdvanced)){F.addClass("yui-button-selected");F.addClass("yui-button-"+F.get("value")+"-selected");if(G){if(F.buttonType=="rich"){var H=F.getMenu().getItems();for(var E=0;E<H.length;E++){if(H[E].value==G){H[E].cfg.setProperty("checked",true);F.set("label","<span class=\"yui-toolbar-"+F.get("value")+"-"+(G).replace(/ /g,"-").toLowerCase()+"\">"+H[E]._oText.nodeValue+"</span>");
+}else{H[E].cfg.setProperty("checked",false);}}}}}else{return false;}}},deselectButton:function(F){var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F<E;F++){this.deselectButton(this._buttonList[F]);}},disableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.disableButton(this._buttonList[F]);}},enableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.enableButton(this._buttonList[F]);}},resetAllButtons:function(I){if(!D.isObject(I)){I={};}if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){var H=this._buttonList[F];var G=H._configs.disabled._initialConfig.value;if(I[H.get("id")]){this.enableButton(H);this.selectButton(H);}else{if(G){this.disableButton(H);}else{this.enableButton(H);}this.deselectButton(H);}}},destroyButton:function(I){var G=I;if(D.isString(I)){G=this.getButtonById(I);}if(D.isNumber(I)){G=this.getButtonByIndex(I);}if((!(G instanceof YAHOO.widget.ToolbarButton))&&(!(G instanceof YAHOO.widget.ToolbarButtonAdvanced))){G=this.getButtonByValue(I);}if((G instanceof YAHOO.widget.ToolbarButton)||(G instanceof YAHOO.widget.ToolbarButtonAdvanced)){var H=G.get("id");G.destroy();var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F].get("id")==H){this._buttonList[F]=null;}}}else{return false;}},destroy:function(){this.get("element").innerHTML="";this.get("element").className="";for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}return true;},collapse:function(F){var E=B.getElementsByClassName("collapse","span",this._titlebar);if(F===false){B.removeClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");if(E[0]){B.removeClass(E[0],"collapsed");}this.fireEvent("toolbarExpanded",{type:"toolbarExpanded",target:this});}else{if(E[0]){B.addClass(E[0],"collapsed");}B.addClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");this.fireEvent("toolbarCollapsed",{type:"toolbarCollapsed",target:this});}},toString:function(){return"Toolbar (#"+this.get("element").id+") with "+this._buttonList.length+" buttons.";}});})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.SimpleEditor=function(I,N){var H={};if(D.isObject(I)&&(!I.tagName)&&!N){D.augmentObject(H,I);I=document.createElement("textarea");this.DOMReady=true;if(H.container){var L=C.get(H.container);L.appendChild(I);}else{document.body.appendChild(I);}}else{D.augmentObject(H,N);}var J={element:null,attributes:H},G=null;if(D.isString(I)){G=I;}else{if(J.attributes.id){G=J.attributes.id;}else{G=C.generateId(I);}}J.element=I;var K=document.createElement("DIV");J.attributes.element_cont=new YAHOO.util.Element(K,{id:G+"_container"});var F=document.createElement("div");C.addClass(F,"first-child");J.attributes.element_cont.appendChild(F);if(!J.attributes.toolbar_cont){J.attributes.toolbar_cont=document.createElement("DIV");J.attributes.toolbar_cont.id=G+"_toolbar";F.appendChild(J.attributes.toolbar_cont);}var M=document.createElement("DIV");F.appendChild(M);J.attributes.editor_wrapper=M;YAHOO.widget.SimpleEditor.superclass.constructor.call(this,J.element,J.attributes);};function E(F){return F.replace(/ /g,"-").toLowerCase();}YAHOO.extend(YAHOO.widget.SimpleEditor,YAHOO.util.Element,{_docType:"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var F=document.location.href;if(F.indexOf("?")!==-1){F=F.substring(0,F.indexOf("?"));}F=F.substring(0,F.lastIndexOf("/"))+"/";return F;}(),_lastImage:null,_blankImageLoaded:null,_fixNodesTimer:null,_nodeChangeTimer:null,_lastNodeChangeEvent:null,_lastNodeChange:0,_rendered:null,DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:null,dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,iframe:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerCounter:0,_disabled:["createlink","fontname","fontsize","forecolor","backcolor"],_alwaysDisabled:{},_alwaysEnabled:{},_semantic:{"bold":true,"italic":true,"underline":true},_tag2cmd:{"b":"bold","strong":"bold","i":"italic","em":"italic","u":"underline","sup":"superscript","sub":"subscript","img":"insertimage","a":"createlink","ul":"insertunorderedlist","ol":"insertorderedlist"},_createIframe:function(){var J=document.createElement("iframe");J.id=this.get("id")+"_editor";var H={border:"0",frameBorder:"0",marginWidth:"0",marginHeight:"0",leftMargin:"0",topMargin:"0",allowTransparency:"true",width:"100%"};if(this.get("autoHeight")){H.scrolling="no";}for(var I in H){if(D.hasOwnProperty(H,I)){J.setAttribute(I,H[I]);}}var G="javascript:;";if(this.browser.ie){G="about:blank";}J.setAttribute("src",G);var F=new YAHOO.util.Element(J);return F;},_isElement:function(G,F){if(G&&G.tagName&&(G.tagName.toLowerCase()==F)){return true;
+}if(G&&G.getAttribute&&(G.getAttribute("tag")==F)){return true;}return false;},_hasParent:function(G,F){if(!G||!G.parentNode){return false;}while(G.parentNode){if(this._isElement(G,F)){return G;}if(G.parentNode){G=G.parentNode;}else{return false;}}return false;},_getDoc:function(){var F=false;if(this.get){if(this.get("iframe")){if(this.get("iframe").get){if(this.get("iframe").get("element")){try{if(this.get("iframe").get("element").contentWindow){if(this.get("iframe").get("element").contentWindow.document){F=this.get("iframe").get("element").contentWindow.document;return F;}}}catch(G){}}}}}return false;},_getWindow:function(){return this.get("iframe").get("element").contentWindow;},_focusWindow:function(F){if(this.browser.webkit){if(F){this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild,0,this._getDoc().body.firstChild,1);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(false);}}else{this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,1);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(false);}}this._getWindow().focus();}else{this._getWindow().focus();}},_hasSelection:function(){var H=this._getSelection();var F=this._getRange();var G=false;if(!H||!F){return G;}if(this.browser.ie||this.browser.opera){if(F.text){G=true;}if(F.html){G=true;}}else{if(this.browser.webkit){if(H+""!==""){G=true;}}else{if(H&&(H.toString()!=="")&&(H!==undefined)){G=true;}}}return G;},_getSelection:function(){var F=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){F=this._getDoc().selection;}else{F=this._getWindow().getSelection();}if(this.browser.webkit){if(F.baseNode){this._selection={};this._selection.baseNode=F.baseNode;this._selection.baseOffset=F.baseOffset;this._selection.extentNode=F.extentNode;this._selection.extentOffset=F.extentOffset;}else{if(this._selection!==null){F=this._getWindow().getSelection();F.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}}return F;},_selectNode:function(G){if(!G){return false;}var H=this._getSelection(),F=null;if(this.browser.ie){try{F=this._getDoc().body.createTextRange();F.moveToElementText(G);F.select();}catch(I){}}else{if(this.browser.webkit){H.setBaseAndExtent(G,0,G,G.innerText.length);}else{if(this.browser.opera){H=this._getWindow().getSelection();F=this._getDoc().createRange();F.selectNode(G);H.removeAllRanges();H.addRange(F);}else{F=this._getDoc().createRange();F.selectNodeContents(G);H.removeAllRanges();H.addRange(F);}}}},_getRange:function(){var F=this._getSelection();if(F===null){return null;}if(this.browser.webkit&&!F.getRangeAt){var H=this._getDoc().createRange();try{H.setStart(F.anchorNode,F.anchorOffset);H.setEnd(F.focusNode,F.focusOffset);}catch(G){H=this._getWindow().getSelection()+"";}return H;}if(this.browser.ie||this.browser.opera){try{return F.createRange();}catch(G){return null;}}if(F.rangeCount>0){return F.getRangeAt(0);}return null;},_setDesignMode:function(F){try{var H=true;if(this.browser.ie&&(F.toLowerCase()=="off")){H=false;}if(H){this._getDoc().designMode=F;}}catch(G){}},_toggleDesignMode:function(){var G=this._getDoc().designMode.toLowerCase(),F="on";if(G=="on"){F="off";}this._setDesignMode(F);return F;},_initEditor:function(){if(this.browser.ie){this._getDoc().body.style.margin="0";}if(!this.get("disabled")){if(this._getDoc().designMode.toLowerCase()!="on"){this._setDesignMode("on");this._contentTimerCounter=0;}}if(!this._getDoc().body){this._contentTimerCounter=0;this._checkLoaded();return false;}this.toolbar.on("buttonClick",this._handleToolbarClick,this,true);A.on(this._getDoc(),"mouseup",this._handleMouseUp,this,true);A.on(this._getDoc(),"mousedown",this._handleMouseDown,this,true);A.on(this._getDoc(),"click",this._handleClick,this,true);A.on(this._getDoc(),"dblclick",this._handleDoubleClick,this,true);A.on(this._getDoc(),"keypress",this._handleKeyPress,this,true);A.on(this._getDoc(),"keyup",this._handleKeyUp,this,true);A.on(this._getDoc(),"keydown",this._handleKeyDown,this,true);if(!this.get("disabled")){this.toolbar.set("disabled",false);}this.fireEvent("editorContentLoaded",{type:"editorLoaded",target:this});if(this.get("dompath")){var F=this;setTimeout(function(){F._writeDomPath.call(F);},150);}this.nodeChange(true);this._setBusy(true);},_checkLoaded:function(){this._contentTimerCounter++;if(this._contentTimer){clearTimeout(this._contentTimer);}if(this._contentTimerCounter>500){return false;}var H=false;try{if(this._getDoc()&&this._getDoc().body){if(this.browser.ie){if(this._getDoc().body.readyState=="complete"){H=true;}}else{if(this._getDoc().body._rteLoaded===true){H=true;}}}}catch(G){H=false;}if(H===true){this._initEditor();}else{var F=this;this._contentTimer=setTimeout(function(){F._checkLoaded.call(F);},20);}},_setInitialContent:function(){var G=D.substitute(this.get("html"),{TITLE:this.STR_TITLE,CONTENT:this._cleanIncomingHTML(this.get("element").value),CSS:this.get("css"),HIDDEN_CSS:((this.get("hiddencss"))?this.get("hiddencss"):"/* No Hidden CSS */"),EXTRA_CSS:((this.get("extracss"))?this.get("extracss"):"/* No Extra CSS */")}),F=true;if(document.compatMode!="BackCompat"){G=this._docType+"\n"+G;}else{}if(this.browser.ie||this.browser.webkit||this.browser.opera||(navigator.userAgent.indexOf("Firefox/1.5")!=-1)){try{this._getDoc().open();this._getDoc().write(G);this._getDoc().close();}catch(H){F=false;}}else{this.get("iframe").get("element").src="data:text/html;charset=utf-8,"+encodeURIComponent(G);}if(F){this._checkLoaded();}},_setMarkupType:function(F){switch(this.get("markup")){case"css":this._setEditorStyle(true);break;case"default":this._setEditorStyle(false);break;case"semantic":case"xhtml":if(this._semantic[F]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}break;}},_setEditorStyle:function(G){try{this._getDoc().execCommand("useCSS",false,!G);}catch(F){}},_getSelectedElement:function(){var I=this._getDoc(),F=null,G=null,J=null;
+if(this.browser.ie){this.currentEvent=this._getWindow().event;F=this._getRange();if(F){J=F.item?F.item(0):F.parentElement();if(J==I.body){J=null;}}if((this.currentEvent!==null)&&(this.currentEvent.keyCode===0)){J=A.getTarget(this.currentEvent);}}else{G=this._getSelection();F=this._getRange();if(!G||!F){return null;}if(!this._hasSelection()){if(G.anchorNode&&(G.anchorNode.nodeType==3)){if(G.anchorNode.parentNode){J=G.anchorNode.parentNode;}if(G.anchorNode.nextSibling!=G.focusNode.nextSibling){J=G.anchorNode.nextSibling;}}if(this._isElement(J,"br")){J=null;}if(!J){J=F.commonAncestorContainer;if(!F.collapsed){if(F.startContainer==F.endContainer){if(F.startOffset-F.endOffset<2){if(F.startContainer.hasChildNodes()){J=F.startContainer.childNodes[F.startOffset];}}}}}}}if(this.currentEvent!==null){try{switch(this.currentEvent.type){case"click":case"mousedown":case"mouseup":J=A.getTarget(this.currentEvent);break;default:break;}}catch(H){}}else{if((this.currentElement&&this.currentElement[0])&&(!this.browser.ie)){J=this.currentElement[0];}}if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!J){J=YAHOO.util.Event.getTarget(this.currentEvent);}}if(!J||!J.tagName){J=I.body;}if(this._isElement(J,"html")){J=I.body;}if(this._isElement(J,"body")){J=I.body;}if(J&&!J.parentNode){J=I.body;}if(J===undefined){J=null;}return J;},_getDomPath:function(F){if(!F){F=this._getSelectedElement();}var G=[];while(F!==null){if(F.ownerDocument!=this._getDoc()){F=null;break;}if(F.nodeName&&F.nodeType&&(F.nodeType==1)){G[G.length]=F;}if(this._isElement(F,"body")){break;}F=F.parentNode;}if(G.length===0){if(this._getDoc()&&this._getDoc().body){G[0]=this._getDoc().body;}}return G.reverse();},_writeDomPath:function(){var L=this._getDomPath(),J=[],H="",M="";for(var F=0;F<L.length;F++){var N=L[F].tagName.toLowerCase();if((N=="ol")&&(L[F].type)){N+=":"+L[F].type;}if(C.hasClass(L[F],"yui-tag")){N=L[F].getAttribute("tag");}if((this.get("markup")=="semantic")||(this.get("markup")=="xhtml")){switch(N){case"b":N="strong";break;case"i":N="em";break;}}if(!C.hasClass(L[F],"yui-non")){if(C.hasClass(L[F],"yui-tag")){M=N;}else{H=((L[F].className!=="")?"."+L[F].className.replace(/ /g,"."):"");if((H.indexOf("yui")!=-1)||(H.toLowerCase().indexOf("apple-style-span")!=-1)){H="";}M=N+((L[F].id)?"#"+L[F].id:"")+H;}switch(N){case"a":if(L[F].getAttribute("href",2)){M+=":"+L[F].getAttribute("href",2).replace("mailto:","").replace("http://","").replace("https://","");}break;case"img":var G=L[F].height;var K=L[F].width;if(L[F].style.height){G=parseInt(L[F].style.height,10);}if(L[F].style.width){K=parseInt(L[F].style.width,10);}M+="("+G+"x"+K+")";break;}if(M.length>10){M="<span title=\""+M+"\">"+M.substring(0,10)+"...</span>";}else{M="<span title=\""+M+"\">"+M+"</span>";}J[J.length]=M;}}var I=J.join(" "+this.SEP_DOMPATH+" ");if(this.dompath.innerHTML!=I){this.dompath.innerHTML=I;}},_fixNodes:function(){var K=this._getDoc(),I=[];for(var F in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,F)){if(F.toLowerCase()!="span"){var G=K.body.getElementsByTagName(F);if(G.length){for(var H=0;H<G.length;H++){I.push(G[H]);}}}}}for(var J=0;J<I.length;J++){if(I[J].parentNode){if(D.isObject(this.invalidHTML[I[J].tagName.toLowerCase()])&&this.invalidHTML[I[J].tagName.toLowerCase()].keepContents){this._swapEl(I[J],"span",function(M){M.className="yui-non";});}else{I[J].parentNode.removeChild(I[J]);}}}var L=this._getDoc().getElementsByTagName("img");C.addClass(L,"yui-img");},_isNonEditable:function(H){if(this.get("allowNoEdit")){var G=A.getTarget(H);if(this._isElement(G,"html")){G=null;}var J=this._getDomPath(G);for(var F=(J.length-1);F>-1;F--){if(C.hasClass(J[F],this.CLASS_NOEDIT)){try{this._getDoc().execCommand("enableObjectResizing",false,"false");}catch(I){}this.nodeChange();A.stopEvent(H);return true;}}try{this._getDoc().execCommand("enableObjectResizing",false,"true");}catch(I){}}return false;},_setCurrentEvent:function(F){this.currentEvent=F;},_handleClick:function(G){if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);if(this.currentWindow){this.closeWindow();}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}if(this.browser.webkit){var F=A.getTarget(G);if(this._isElement(F,"a")||this._isElement(F.parentNode,"a")){A.stopEvent(G);this.nodeChange();}}else{this.nodeChange();}},_handleMouseUp:function(G){if(this._isNonEditable(G)){return false;}var F=this;if(this.browser.opera){var H=A.getTarget(G);if(this._isElement(H,"img")){this.nodeChange();if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(G);}else{this.operaEvent=window.setTimeout(function(){F.operaEvent=false;},700);}}}if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){A.stopEvent(G);}}this.nodeChange();this.fireEvent("editorMouseUp",{type:"editorMouseUp",target:this,ev:G});},_handleMouseDown:function(F){if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this.browser.webkit&&this._hasSelection()){var H=this._getSelection();if(!this.browser.webkit3){H.collapse(true);}else{H.collapseToStart();}}if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}if(this._isElement(G,"img")||this._isElement(G,"a")){if(this.browser.webkit){A.stopEvent(F);if(this._isElement(G,"img")){C.addClass(G,"selected");this._lastImage=G;}}this.nodeChange();}this.fireEvent("editorMouseDown",{type:"editorMouseDown",target:this,ev:F});},_handleDoubleClick:function(F){if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this._isElement(G,"img")){this.currentElement[0]=G;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}else{if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");
+this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}}this.nodeChange();this.editorDirty=false;this.fireEvent("editorDoubleClick",{type:"editorDoubleClick",target:this,ev:F});},_handleKeyUp:function(G){if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);switch(G.keyCode){case 37:case 38:case 39:case 40:case 46:case 8:case 87:if((G.keyCode==87)&&this.currentWindow&&G.shiftKey&&G.ctrlKey){this.closeWindow();}else{if(!this.browser.ie){if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);}var F=this;this._nodeChangeTimer=setTimeout(function(){F._nodeChangeTimer=null;F.nodeChange.call(F);},100);}else{this.nodeChange();}this.editorDirty=true;}break;}this.fireEvent("editorKeyUp",{type:"editorKeyUp",target:this,ev:G});},_handleKeyPress:function(F){if(this.get("allowNoEdit")){if(F&&F.keyCode&&((F.keyCode==46)||F.keyCode==63272)){A.stopEvent(F);}}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);if(this.browser.webkit){if(!this.browser.webkit3){if(F.keyCode&&(F.keyCode==122)&&(F.metaKey)){if(this._hasParent(this._getSelectedElement(),"li")){A.stopEvent(F);}}}this._listFix(F);}this.fireEvent("editorKeyPress",{type:"editorKeyPress",target:this,ev:F});},_listFix:function(L){var O=null,J=null,F=false,H=null;if(this.browser.webkit){if(L.keyCode&&(L.keyCode==13)){if(this._hasParent(this._getSelectedElement(),"li")){var I=this._hasParent(this._getSelectedElement(),"li");var N=this._getDoc().createElement("li");N.innerHTML="<span class=\"yui-non\">&nbsp;</span>&nbsp;";if(I.nextSibling){I.parentNode.insertBefore(N,I.nextSibling);}else{I.parentNode.appendChild(N);}this.currentElement[0]=N;this._selectNode(N.firstChild);if(!this.browser.webkit3){I.parentNode.style.display="list-item";setTimeout(function(){I.parentNode.style.display="block";},1);}A.stopEvent(L);}}}if(L.keyCode&&((!this.browser.webkit3&&(L.keyCode==25))||((this.browser.webkit3||!this.browser.webkit)&&((L.keyCode==9)&&L.shiftKey)))){O=this._getSelectedElement();if(this._hasParent(O,"li")){O=this._hasParent(O,"li");if(this._hasParent(O,"ul")||this._hasParent(O,"ol")){J=this._hasParent(O,"ul");if(!J){J=this._hasParent(O,"ol");}if(this._isElement(J.previousSibling,"li")){J.removeChild(O);J.parentNode.insertBefore(O,J.nextSibling);if(this.browser.ie){H=this._getDoc().body.createTextRange();H.moveToElementText(O);H.collapse(false);H.select();}if(this.browser.webkit){if(!this.browser.webkit3){J.style.display="list-item";J.parentNode.style.display="list-item";setTimeout(function(){J.style.display="block";J.parentNode.style.display="block";},1);}}A.stopEvent(L);}}}}if(L.keyCode&&((L.keyCode==9)&&(!L.shiftKey))){var G=this._getSelectedElement();if(this._hasParent(G,"li")){F=this._hasParent(G,"li").innerHTML;}if(this.browser.webkit){this._getDoc().execCommand("inserttext",false,"\t");}O=this._getSelectedElement();if(this._hasParent(O,"li")){J=this._hasParent(O,"li");var K=this._getDoc().createElement(J.parentNode.tagName.toLowerCase());if(this.browser.webkit){var M=C.getElementsByClassName("Apple-tab-span","span",J);if(M[0]){J.removeChild(M[0]);J.innerHTML=D.trim(J.innerHTML);if(F){J.innerHTML="<span class=\"yui-non\">"+F+"</span>&nbsp;";}else{J.innerHTML="<span class=\"yui-non\">&nbsp;</span>&nbsp;";}}}else{if(F){J.innerHTML=F+"&nbsp;";}else{J.innerHTML="&nbsp;";}}J.parentNode.replaceChild(K,J);K.appendChild(J);if(this.browser.webkit){this._getSelection().setBaseAndExtent(J.firstChild,1,J.firstChild,J.firstChild.innerText.length);if(!this.browser.webkit3){J.parentNode.parentNode.style.display="list-item";setTimeout(function(){J.parentNode.parentNode.style.display="block";},1);}}else{if(this.browser.ie){H=this._getDoc().body.createTextRange();H.moveToElementText(J);H.collapse(false);H.select();}else{this._selectNode(J);}}A.stopEvent(L);}if(this.browser.webkit){A.stopEvent(L);}this.nodeChange();}},_handleKeyDown:function(J){if(this._isNonEditable(J)){return false;}this._setCurrentEvent(J);if(this.currentWindow){this.closeWindow();}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}var I=false,K=null,H=false;if(J.shiftKey&&J.ctrlKey){I=true;}switch(J.keyCode){case 84:if(J.shiftKey&&J.ctrlKey){this.toolbar._titlebar.firstChild.focus();A.stopEvent(J);I=false;}break;case 27:if(J.shiftKey){this.afterElement.focus();A.stopEvent(J);H=false;}break;case 76:if(this._hasSelection()){if(J.shiftKey&&J.ctrlKey){var G=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){G=false;}}if(G){this.execCommand("createlink","");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});I=false;}}}break;case 65:if(J.metaKey&&this.browser.webkit){A.stopEvent(J);this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,this._getDoc().body.innerHTML.length);}break;case 66:K="bold";break;case 73:K="italic";break;case 85:K="underline";break;case 13:if(this.browser.ie){var L=this._getRange();var F=this._getSelectedElement();if(!this._isElement(F,"li")){if(L){L.pasteHTML("<br>");L.collapse(false);L.select();}A.stopEvent(J);}}}if(this.browser.ie){this._listFix(J);}if(I&&K){this.execCommand(K,null);A.stopEvent(J);this.nodeChange();}this.fireEvent("editorKeyDown",{type:"editorKeyDown",target:this,ev:J});},nodeChange:function(G){var H=parseInt(this.get("nodeChangeThreshold"),10);var N=Math.round(new Date().getTime()/1000);if(G===true){this._lastNodeChange=0;}if((this._lastNodeChange+H)<N){var Q=this;if(this._fixNodesTimer===null){this._fixNodesTimer=window.setTimeout(function(){Q._fixNodes.call(Q);Q._fixNodesTimer=null;},0);}}this._lastNodeChange=N;if(this.currentEvent){this._lastNodeChangeEvent=this.currentEvent.type;}var Y=this.fireEvent("beforeNodeChange",{type:"beforeNodeChange",target:this});
+if(Y===false){return false;}if(this.get("dompath")){this._writeDomPath();}if(!this.get("disabled")){if(this.STOP_NODE_CHANGE){this.STOP_NODE_CHANGE=false;return false;}else{var S=this._getSelection(),P=this._getRange(),F=this._getSelectedElement(),L=this.toolbar.getButtonByValue("fontname"),K=this.toolbar.getButtonByValue("fontsize");if(G!==true){this.editorDirty=true;}var M={};if(this._lastButton){M[this._lastButton.id]=true;}if(!this._isElement(F,"body")){if(L){M[L.get("id")]=true;}if(K){M[K.get("id")]=true;}}this.toolbar.resetAllButtons(M);for(var Z=0;Z<this._disabled.length;Z++){var O=this.toolbar.getButtonByValue(this._disabled[Z]);if(O&&O.get){if(this._lastButton&&(O.get("id")===this._lastButton.id)){}else{if(!this._hasSelection()){switch(this._disabled[Z]){case"fontname":case"fontsize":break;default:this.toolbar.disableButton(O);}}else{if(!this._alwaysDisabled[this._disabled[Z]]){this.toolbar.enableButton(O);}}if(!this._alwaysEnabled[this._disabled[Z]]){this.toolbar.deselectButton(O);}}}}var R=this._getDomPath();var a=null,V=null;for(var W=0;W<R.length;W++){a=R[W].tagName.toLowerCase();if(R[W].getAttribute("tag")){a=R[W].getAttribute("tag").toLowerCase();}V=this._tag2cmd[a];if(V===undefined){V=[];}if(!D.isArray(V)){V=[V];}if(R[W].style.fontWeight.toLowerCase()=="bold"){V[V.length]="bold";}if(R[W].style.fontStyle.toLowerCase()=="italic"){V[V.length]="italic";}if(R[W].style.textDecoration.toLowerCase()=="underline"){V[V.length]="underline";}if(V.length>0){for(var U=0;U<V.length;U++){this.toolbar.selectButton(V[U]);this.toolbar.enableButton(V[U]);}}switch(R[W].style.textAlign.toLowerCase()){case"left":case"right":case"center":case"justify":var T=R[W].style.textAlign.toLowerCase();if(R[W].style.textAlign.toLowerCase()=="justify"){T="full";}this.toolbar.selectButton("justify"+T);this.toolbar.enableButton("justify"+T);break;}}if(L){var X=L._configs.label._initialConfig.value;L.set("label","<span class=\"yui-toolbar-fontname-"+E(X)+"\">"+X+"</span>");this._updateMenuChecked("fontname",X);}if(K){K.set("label",K._configs.label._initialConfig.value);}var J=this.toolbar.getButtonByValue("heading");if(J){J.set("label",J._configs.label._initialConfig.value);this._updateMenuChecked("heading","none");}var I=this.toolbar.getButtonByValue("insertimage");if(I&&this.currentWindow&&(this.currentWindow.name=="insertimage")){this.toolbar.disableButton(I);}}}this.fireEvent("afterNodeChange",{type:"afterNodeChange",target:this});},_updateMenuChecked:function(F,G,I){if(!I){I=this.toolbar;}var H=I.getButtonByValue(F);H.checkValue(G);},_handleToolbarClick:function(G){var I="";var J="";var H=G.button.value;if(G.button.menucmd){I=H;H=G.button.menucmd;}this._lastButton=G.button;if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(H,I);if(!this.browser.webkit){var F=this;setTimeout(function(){F._focusWindow.call(F);},5);}}A.stopEvent(G);},_setupAfterElement:function(){if(!this.beforeElement){this.beforeElement=document.createElement("h2");this.beforeElement.className="yui-editor-skipheader";this.beforeElement.tabIndex="-1";this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get("element_cont").get("firstChild").insertBefore(this.beforeElement,this.toolbar.get("nextSibling"));}if(!this.afterElement){this.afterElement=document.createElement("h2");this.afterElement.className="yui-editor-skipheader";this.afterElement.tabIndex="-1";this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get("element_cont").get("firstChild").appendChild(this.afterElement);}},_disableEditor:function(G){if(G){if(!this._mask){if(!!this.browser.ie){this._setDesignMode("off");}if(this.toolbar){this.toolbar.set("disabled",true);}this._mask=document.createElement("DIV");C.setStyle(this._mask,"height","100%");C.setStyle(this._mask,"width","100%");C.setStyle(this._mask,"position","absolute");C.setStyle(this._mask,"top","0");C.setStyle(this._mask,"left","0");C.setStyle(this._mask,"opacity",".5");C.addClass(this._mask,"yui-editor-masked");this.get("iframe").get("parentNode").appendChild(this._mask);}}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;if(this.toolbar){this.toolbar.set("disabled",false);}this._setDesignMode("on");this._focusWindow();var F=this;window.setTimeout(function(){F.nodeChange.call(F);},100);}}},EDITOR_PANEL_ID:"yui-editor-panel",SEP_DOMPATH:"<",STR_LEAVE_EDITOR:"You have left the Rich Text Editor.",STR_BEFORE_EDITOR:"This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>",STR_TITLE:"Rich Text Area.",STR_IMAGE_HERE:"Image Url Here",STR_LINK_URL:"Link URL",STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_NOEDIT:"yui-noedit",CLASS_CONTAINER:"yui-editor-container",CLASS_EDITABLE:"yui-editor-editable",CLASS_EDITABLE_CONT:"yui-editor-editable-container",CLASS_PREFIX:"yui-editor",browser:function(){var F=YAHOO.env.ua;if(F.webkit>420){F.webkit3=F.webkit;}else{F.webkit3=0;}return F;}(),init:function(G,F){if(!this._defaultToolbar){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"separator"},{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true}]},{type:"separator"},{group:"indentlist",label:"Lists",buttons:[{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};
+}YAHOO.widget.SimpleEditor.superclass.init.call(this,G,F);YAHOO.widget.EditorInfo._instances[this.get("id")]=this;this.currentElement=[];this.on("contentReady",function(){this.DOMReady=true;this.fireQueue();},this,true);},initAttributes:function(F){YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this,F);var G=this;this.setAttributeConfig("container",{writeOnce:true,value:F.container||false});this.setAttributeConfig("plainText",{writeOnce:true,value:F.plainText||false});this.setAttributeConfig("iframe",{value:null});this.setAttributeConfig("textarea",{value:null,writeOnce:true});this.setAttributeConfig("container",{readOnly:true,value:null});this.setAttributeConfig("nodeChangeThreshold",{value:F.nodeChangeThreshold||3,validator:YAHOO.lang.isNumber});this.setAttributeConfig("allowNoEdit",{value:F.allowNoEdit||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("limitCommands",{value:F.limitCommands||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("element_cont",{value:F.element_cont});this.setAttributeConfig("editor_wrapper",{value:F.editor_wrapper||null,writeOnce:true});this.setAttributeConfig("height",{value:F.height||C.getStyle(G.get("element"),"height"),method:function(H){if(this._rendered){if(this.get("animate")){var I=new YAHOO.util.Anim(this.get("iframe").get("parentNode"),{height:{to:parseInt(H,10)}},0.5);I.animate();}else{C.setStyle(this.get("iframe").get("parentNode"),"height",H);}}}});this.setAttributeConfig("autoHeight",{value:F.autoHeight||false,method:function(H){if(H){if(this.get("iframe")){this.get("iframe").get("element").setAttribute("scrolling","no");}this.on("afterNodeChange",this._handleAutoHeight,this,true);this.on("editorKeyDown",this._handleAutoHeight,this,true);this.on("editorKeyPress",this._handleAutoHeight,this,true);}else{if(this.get("iframe")){this.get("iframe").get("element").setAttribute("scrolling","auto");}this.unsubscribe("afterNodeChange",this._handleAutoHeight);this.unsubscribe("editorKeyDown",this._handleAutoHeight);this.unsubscribe("editorKeyPress",this._handleAutoHeight);}}});this.setAttributeConfig("width",{value:F.width||C.getStyle(this.get("element"),"width"),method:function(H){if(this._rendered){if(this.get("animate")){var I=new YAHOO.util.Anim(this.get("element_cont").get("element"),{width:{to:parseInt(H,10)}},0.5);I.animate();}else{this.get("element_cont").setStyle("width",H);}}}});this.setAttributeConfig("blankimage",{value:F.blankimage||this._getBlankImage()});this.setAttributeConfig("css",{value:F.css||this._defaultCSS,writeOnce:true});this.setAttributeConfig("html",{value:F.html||"<html><head><title>{TITLE}</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><base href=\""+this._baseHREF+"\"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload=\"document.body._rteLoaded = true;\">{CONTENT}</body></html>",writeOnce:true});this.setAttributeConfig("extracss",{value:F.css||"",writeOnce:true});this.setAttributeConfig("handleSubmit",{value:F.handleSubmit||false,method:function(H){if(this.get("element").form){if(!this._formButtons){this._formButtons=[];}if(H){A.on(this.get("element").form,"submit",this._handleFormSubmit,this,true);var I=this.get("element").form.getElementsByTagName("input");for(var K=0;K<I.length;K++){var J=I[K].getAttribute("type");if(J&&(J.toLowerCase()=="submit")){A.on(I[K],"click",this._handleFormButtonClick,this,true);this._formButtons[this._formButtons.length]=I[K];}}}else{A.unsubscribe(this.get("element").form,"submit",this._handleFormSubmit);if(this._formButtons){A.unsubscribe(this._formButtons,"click",this._handleFormButtonClick);}}}}});this.setAttributeConfig("disabled",{value:false,method:function(H){if(this._rendered){this._disableEditor(H);}}});this.setAttributeConfig("toolbar_cont",{value:null,writeOnce:true});this.setAttributeConfig("toolbar",{value:F.toolbar||this._defaultToolbar,writeOnce:true,method:function(H){if(!H.buttonType){H.buttonType=this._defaultToolbar.buttonType;}this._defaultToolbar=H;}});this.setAttributeConfig("animate",{value:((F.animate)?((YAHOO.util.Anim)?true:false):false),validator:function(I){var H=true;if(!YAHOO.util.Anim){H=false;}return H;}});this.setAttributeConfig("panel",{value:null,writeOnce:true,validator:function(I){var H=true;if(!YAHOO.widget.Overlay){H=false;}return H;}});this.setAttributeConfig("focusAtStart",{value:F.focusAtStart||false,writeOnce:true,method:function(){this.on("editorContentLoaded",function(){var H=this;setTimeout(function(){H._focusWindow.call(H,true);H.editorDirty=false;},400);},this,true);}});this.setAttributeConfig("dompath",{value:F.dompath||false,method:function(H){if(H&&!this.dompath){this.dompath=document.createElement("DIV");this.dompath.id=this.get("id")+"_dompath";C.addClass(this.dompath,"dompath");this.get("element_cont").get("firstChild").appendChild(this.dompath);if(this.get("iframe")){this._writeDomPath();}}else{if(!H&&this.dompath){this.dompath.parentNode.removeChild(this.dompath);this.dompath=null;}}}});this.setAttributeConfig("markup",{value:F.markup||"semantic",validator:function(H){switch(H.toLowerCase()){case"semantic":case"css":case"default":case"xhtml":return true;}return false;}});this.setAttributeConfig("removeLineBreaks",{value:F.removeLineBreaks||false,validator:YAHOO.lang.isBoolean});this.on("afterRender",function(){this._renderPanel();});},_getBlankImage:function(){if(!this.DOMReady){this._queue[this._queue.length]=["_getBlankImage",arguments];return"";}var F="";if(!this._blankImageLoaded){var G=document.createElement("div");G.style.position="absolute";G.style.top="-9999px";G.style.left="-9999px";G.className=this.CLASS_PREFIX+"-blankimage";document.body.appendChild(G);F=YAHOO.util.Dom.getStyle(G,"background-image");F=F.replace("url(","").replace(")","").replace(/"/g,"");this.set("blankimage",F);this._blankImageLoaded=true;}else{F=this.get("blankimage");}return F;},_handleAutoHeight:function(){var J=this._getDoc(),G=J.body,K=J.documentElement;
+var F=parseInt(C.getStyle(this.get("editor_wrapper"),"height"),10);var H=G.scrollHeight;if(this.browser.webkit){H=K.scrollHeight;}if(H<parseInt(this.get("height"),10)){H=parseInt(this.get("height"),10);}if((F!=H)&&(H>=parseInt(this.get("height"),10))){C.setStyle(this.get("editor_wrapper"),"height",H+"px");if(this.browser.ie){this.get("iframe").setStyle("height","99%");this.get("iframe").setStyle("zoom","1");var I=this;window.setTimeout(function(){I.get("iframe").setStyle("height","100%");},1);}}},_formButtons:null,_formButtonClicked:null,_handleFormButtonClick:function(G){var F=A.getTarget(G);this._formButtonClicked=F;},_handleFormSubmit:function(I){A.stopEvent(I);this.saveHTML();var H=this.get("element").form;var F=this._formButtonClicked||false;var G=this;window.setTimeout(function(){YAHOO.util.Event.removeListener(H,"submit",G._handleFormSubmit);if(YAHOO.env.ua.ie){H.fireEvent("onsubmit");if(F){F.click();}}else{if(F){F.click();}else{var J=document.createEvent("HTMLEvents");J.initEvent("submit",true,true);H.dispatchEvent(J);if(YAHOO.env.ua.webkit){if(YAHOO.lang.isFunction(H.submit)){H.submit();}}}}},200);},_handleFontSize:function(H){var F=this.toolbar.getButtonById(H.button.id);var G=F.get("label")+"px";this.execCommand("fontsize",G);this.STOP_EXEC_COMMAND=true;},_handleColorPicker:function(H){var G=H.button;var F="#"+H.color;if((G=="forecolor")||(G=="backcolor")){this.execCommand(G,F);}},_handleAlign:function(I){var H=null;for(var F=0;F<I.button.menu.length;F++){if(I.button.menu[F].value==I.button.value){H=I.button.menu[F].value;}}var G=this._getSelection();this.execCommand(H,G);this.STOP_EXEC_COMMAND=true;},_handleAfterNodeChange:function(){var R=this._getDomPath(),M=null,I=null,N=null,G=false;var K=this.toolbar.getButtonByValue("fontname");var L=this.toolbar.getButtonByValue("fontsize");var F=this.toolbar.getButtonByValue("heading");for(var H=0;H<R.length;H++){M=R[H];var Q=M.tagName.toLowerCase();if(M.getAttribute("tag")){Q=M.getAttribute("tag");}I=M.getAttribute("face");if(C.getStyle(M,"font-family")){I=C.getStyle(M,"font-family");}if(Q.substring(0,1)=="h"){if(F){for(var J=0;J<F._configs.menu.value.length;J++){if(F._configs.menu.value[J].value.toLowerCase()==Q){F.set("label",F._configs.menu.value[J].text);}}this._updateMenuChecked("heading",Q);}}}if(K){for(var P=0;P<K._configs.menu.value.length;P++){if(I&&K._configs.menu.value[P].text.toLowerCase()==I.toLowerCase()){G=true;I=K._configs.menu.value[P].text;}}if(!G){I=K._configs.label._initialConfig.value;}var O="<span class=\"yui-toolbar-fontname-"+E(I)+"\">"+I+"</span>";if(K.get("label")!=O){K.set("label",O);this._updateMenuChecked("fontname",I);}}if(L){N=parseInt(C.getStyle(M,"fontSize"),10);if((N===null)||isNaN(N)){N=L._configs.label._initialConfig.value;}L.set("label",""+N);}if(!this._isElement(M,"body")&&!this._isElement(M,"img")){this.toolbar.enableButton(K);this.toolbar.enableButton(L);this.toolbar.enableButton("forecolor");this.toolbar.enableButton("backcolor");}if(this._isElement(M,"img")){if(YAHOO.widget.Overlay){this.toolbar.enableButton("createlink");}}if(this._isElement(M,"blockquote")){this.toolbar.selectButton("indent");this.toolbar.disableButton("indent");this.toolbar.enableButton("outdent");}if(this._hasParent(M,"ol")||this._hasParent(M,"ul")){this.toolbar.disableButton("indent");}this._lastButton=null;},_setBusy:function(F){},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false;}}this.toolbar.set("disabled",true);this.on("afterExecCommand",function(){var F=this.currentElement[0],H="http://";if(!F){F=this._getSelectedElement();}if(F){if(F.getAttribute("src")){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){H=this.STR_IMAGE_HERE;}}}var G=prompt(this.STR_LINK_URL+": ",H);if((G!=="")&&(G!==null)){F.setAttribute("src",G);}else{if(G===null){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}}this.closeWindow();this.toolbar.set("disabled",false);},this,true);},_handleInsertImageWindowClose:function(){this.nodeChange();},_isLocalFile:function(F){if((F!=="")&&((F.indexOf("file:/")!=-1)||(F.indexOf(":\\")!=-1))){return true;}return false;},_handleCreateLinkClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.toolbar.set("disabled",true);this.on("afterExecCommand",function(){var H=this.currentElement[0],G="";if(H){if(H.getAttribute("href",2)!==null){G=H.getAttribute("href",2);}}var J=prompt(this.STR_LINK_URL+": ",G);if((J!=="")&&(J!==null)){var I=J;if((I.indexOf("://")==-1)&&(I.substring(0,1)!="/")&&(I.substring(0,6).toLowerCase()!="mailto")){if((I.indexOf("@")!=-1)&&(I.substring(0,6).toLowerCase()!="mailto")){I="mailto:"+I;}else{if(I.substring(0,1)!="#"){I="http://"+I;}}}H.setAttribute("href",I);}else{if(J!==null){var F=this._getDoc().createElement("span");F.innerHTML=H.innerHTML;C.addClass(F,"yui-non");H.parentNode.replaceChild(F,H);}}this.closeWindow();this.toolbar.set("disabled",false);});},_handleCreateLinkWindowClose:function(){this.nodeChange();this.currentElement=[];},render:function(){if(this._rendered){return false;}if(!this.DOMReady){this._queue[this._queue.length]=["render",arguments];return false;}this._rendered=true;var F=this;window.setTimeout(function(){F._render.call(F);},4);},_render:function(){this._setBusy();var F=this;this.set("textarea",this.get("element"));this.get("element_cont").setStyle("display","none");this.get("element_cont").addClass(this.CLASS_CONTAINER);this.set("iframe",this._createIframe());window.setTimeout(function(){F._setInitialContent.call(F);},10);this.get("editor_wrapper").appendChild(this.get("iframe").get("element"));if(this.get("disabled")){this._disableEditor(true);}var G=this.get("toolbar");if(G instanceof B){this.toolbar=G;this.toolbar.set("disabled",true);}else{G.disabled=true;this.toolbar=new B(this.get("toolbar_cont"),G);}this.fireEvent("toolbarLoaded",{type:"toolbarLoaded",target:this.toolbar});this.toolbar.on("toolbarCollapsed",function(){if(this.currentWindow){this.moveWindow();
+}},this,true);this.toolbar.on("toolbarExpanded",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("fontsizeClick",function(H){this._handleFontSize(H);},this,true);this.toolbar.on("colorPickerClicked",function(H){this._handleColorPicker(H);return false;},this,true);this.toolbar.on("alignClick",function(H){this._handleAlign(H);},this,true);this.on("afterNodeChange",function(){this._handleAfterNodeChange();},this,true);this.toolbar.on("insertimageClick",function(){this._handleInsertImageClick();},this,true);this.on("windowinsertimageClose",function(){this._handleInsertImageWindowClose();},this,true);this.toolbar.on("createlinkClick",function(){this._handleCreateLinkClick();},this,true);this.on("windowcreatelinkClose",function(){this._handleCreateLinkWindowClose();},this,true);this.get("parentNode").replaceChild(this.get("element_cont").get("element"),this.get("element"));this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");this.get("element_cont").appendChild(this.get("element"));this.get("element_cont").setStyle("display","block");C.addClass(this.get("iframe").get("parentNode"),this.CLASS_EDITABLE_CONT);this.get("iframe").addClass(this.CLASS_EDITABLE);this.get("element_cont").setStyle("width",this.get("width"));C.setStyle(this.get("iframe").get("parentNode"),"height",this.get("height"));this.get("iframe").setStyle("width","100%");this.get("iframe").setStyle("height","100%");window.setTimeout(function(){F._setupAfterElement.call(F);},0);this.fireEvent("afterRender",{type:"afterRender",target:this});},execCommand:function(H,G){var K=this.fireEvent("beforeExecCommand",{type:"beforeExecCommand",target:this,args:arguments});if((K===false)||(this.STOP_EXEC_COMMAND)){this.STOP_EXEC_COMMAND=false;return false;}this._setMarkupType(H);if(this.browser.ie){this._getWindow().focus();}var F=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue(H)){F=false;}}this.editorDirty=true;if((typeof this["cmd_"+H.toLowerCase()]=="function")&&F){var J=this["cmd_"+H.toLowerCase()](G);F=J[0];if(J[1]){H=J[1];}if(J[2]){G=J[2];}}if(F){try{this._getDoc().execCommand(H,false,G);}catch(I){}}else{}this.on("afterExecCommand",function(){this.unsubscribeAll("afterExecCommand");this.nodeChange();});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});},cmd_backcolor:function(I){var F=true,G=this._getSelectedElement(),H="backcolor";if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);H="hilitecolor";}if(!this._isElement(G,"body")){C.setStyle(G,"background-color",I);this._selectNode(G);F=false;}else{this._createCurrentElement("span",{backgroundColor:I});this._selectNode(this.currentElement[0]);F=false;}return[F,H];},cmd_forecolor:function(H){var F=true,G=this._getSelectedElement();if(!this._isElement(G,"body")){C.setStyle(G,"color",H);this._selectNode(G);F=false;}else{this._createCurrentElement("span",{color:H});this._selectNode(this.currentElement[0]);F=false;}return[F];},cmd_unlink:function(F){this._swapEl(this.currentElement[0],"span",function(G){G.className="yui-non";});return[false];},cmd_createlink:function(H){var G=this._getSelectedElement(),F=null;if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");}else{if(!this._isElement(G,"a")){this._createCurrentElement("a");F=this._swapEl(this.currentElement[0],"a");this.currentElement[0]=F;}else{this.currentElement[0]=G;}}return[false];},cmd_insertimage:function(K){var F=true,G=null,J="insertimage",I=this._getSelectedElement();if(K===""){K=this.get("blankimage");}if(this._isElement(I,"img")){this.currentElement[0]=I;F=false;}else{if(this._getDoc().queryCommandEnabled(J)){this._getDoc().execCommand("insertimage",false,K);var L=this._getDoc().getElementsByTagName("img");for(var H=0;H<L.length;H++){if(!YAHOO.util.Dom.hasClass(L[H],"yui-img")){YAHOO.util.Dom.addClass(L[H],"yui-img");this.currentElement[0]=L[H];}}F=false;}else{if(I==this._getDoc().body){G=this._getDoc().createElement("img");G.setAttribute("src",K);YAHOO.util.Dom.addClass(G,"yui-img");this._getDoc().body.appendChild(G);}else{this._createCurrentElement("img");G=this._getDoc().createElement("img");G.setAttribute("src",K);YAHOO.util.Dom.addClass(G,"yui-img");this.currentElement[0].parentNode.replaceChild(G,this.currentElement[0]);}this.currentElement[0]=G;F=false;}}return[F];},cmd_inserthtml:function(I){var F=true,H="inserthtml",G=null,J=null;if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(H)){this._createCurrentElement("img");G=this._getDoc().createElement("span");G.innerHTML=I;this.currentElement[0].parentNode.replaceChild(G,this.currentElement[0]);F=false;}else{if(this.browser.ie){J=this._getRange();if(J.item){J.item(0).outerHTML=I;}else{J.pasteHTML(I);}F=false;}}return[F];},cmd_list:function(W){var Q=true,T=null,M=0,G=null,P="",U=this._getSelectedElement(),R="insertorderedlist";if(W=="ul"){R="insertunorderedlist";}if((this.browser.webkit&&!this._getDoc().queryCommandEnabled(R))){if(this._isElement(U,"li")&&this._isElement(U.parentNode,W)){G=U.parentNode;T=this._getDoc().createElement("span");YAHOO.util.Dom.addClass(T,"yui-non");P="";var F=G.getElementsByTagName("li");for(M=0;M<F.length;M++){P+="<div>"+F[M].innerHTML+"</div>";}T.innerHTML=P;this.currentElement[0]=G;this.currentElement[0].parentNode.replaceChild(T,this.currentElement[0]);}else{this._createCurrentElement(W.toLowerCase());T=this._getDoc().createElement(W);for(M=0;M<this.currentElement.length;M++){var J=this._getDoc().createElement("li");J.innerHTML=this.currentElement[M].innerHTML+"<span class=\"yui-non\">&nbsp;</span>&nbsp;";T.appendChild(J);if(M>0){this.currentElement[M].parentNode.removeChild(this.currentElement[M]);}}this.currentElement[0].parentNode.replaceChild(T,this.currentElement[0]);this.currentElement[0]=T;var H=this.currentElement[0].firstChild;H=C.getElementsByClassName("yui-non","span",H)[0];this._getSelection().setBaseAndExtent(H,1,H,H.innerText.length);
+}Q=false;}else{G=this._getSelectedElement();if(this._isElement(G,"li")&&this._isElement(G.parentNode,W)||(this.browser.ie&&this._isElement(this._getRange().parentElement,"li"))||(this.browser.ie&&this._isElement(G,"ul"))||(this.browser.ie&&this._isElement(G,"ol"))){if(this.browser.ie){if((this.browser.ie&&this._isElement(G,"ul"))||(this.browser.ie&&this._isElement(G,"ol"))){G=G.getElementsByTagName("li")[0];}P="";var I=G.parentNode.getElementsByTagName("li");for(var S=0;S<I.length;S++){P+=I[S].innerHTML+"<br>";}var V=this._getDoc().createElement("span");V.innerHTML=P;G.parentNode.parentNode.replaceChild(V,G.parentNode);}else{this.nodeChange();this._getDoc().execCommand(R,"",G.parentNode);this.nodeChange();}Q=false;}if(this.browser.opera){var O=this;window.setTimeout(function(){var X=O._getDoc().getElementsByTagName("li");for(var Y=0;Y<X.length;Y++){if(X[Y].innerHTML.toLowerCase()=="<br>"){X[Y].parentNode.parentNode.removeChild(X[Y].parentNode);}}},30);}if(this.browser.ie&&Q){var K="";if(this._getRange().html){K="<li>"+this._getRange().html+"</li>";}else{var L=this._getRange().text.split("\n");if(L.length>1){K="";for(var N=0;N<L.length;N++){K+="<li>"+L[N]+"</li>";}}else{K="<li>"+this._getRange().text+"</li>";}}this._getRange().pasteHTML("<"+W+">"+K+"</"+W+">");Q=false;}}return Q;},cmd_insertorderedlist:function(F){return[this.cmd_list("ol")];},cmd_insertunorderedlist:function(F){return[this.cmd_list("ul")];},cmd_fontname:function(H){var F=true,G=this._getSelectedElement();this.currentFont=H;if(G&&G.tagName&&!this._hasSelection()){YAHOO.util.Dom.setStyle(G,"font-family",H);F=false;}return[F];},cmd_fontsize:function(G){if(this.currentElement&&(this.currentElement.length>0)&&(!this._hasSelection())){YAHOO.util.Dom.setStyle(this.currentElement,"fontSize",G);}else{if(!this._isElement(this._getSelectedElement(),"body")){var F=this._getSelectedElement();YAHOO.util.Dom.setStyle(F,"fontSize",G);this._selectNode(F);}else{this._createCurrentElement("span",{"fontSize":G});this._selectNode(this.currentElement[0]);}}return[false];},_swapEl:function(G,F,I){var H=this._getDoc().createElement(F);H.innerHTML=G.innerHTML;if(typeof I=="function"){I.call(this,H);}G.parentNode.replaceChild(H,G);return H;},_createCurrentElement:function(H,U){H=((H)?H:"a");var b=null,G=[],I=this._getDoc();if(this.currentFont){if(!U){U={};}U.fontFamily=this.currentFont;this.currentFont=null;}this.currentElement=[];var X=function(){var f=null;switch(H){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":f=I.createElement(H);break;default:f=I.createElement("span");YAHOO.util.Dom.addClass(f,"yui-tag-"+H);YAHOO.util.Dom.addClass(f,"yui-tag");f.setAttribute("tag",H);for(var e in U){if(YAHOO.util.Lang.hasOwnProperty(U,e)){f.style[e]=U[e];}}break;}return f;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled("insertimage")){this._getDoc().execCommand("insertimage",false,"yui-tmp-img");var W=this._getDoc().getElementsByTagName("img");for(var Z=0;Z<W.length;Z++){if(W[Z].getAttribute("src",2)=="yui-tmp-img"){G=X();W[Z].parentNode.replaceChild(G,W[Z]);this.currentElement[this.currentElement.length]=G;}}}else{if(this.currentEvent){b=YAHOO.util.Event.getTarget(this.currentEvent);}else{b=this._getDoc().body;}}if(b){G=X();if(this._isElement(b,"body")||this._isElement(b,"html")){if(this._isElement(b,"html")){b=this._getDoc().body;}b.appendChild(G);}else{if(b.nextSibling){b.parentNode.insertBefore(G,b.nextSibling);}else{b.parentNode.appendChild(G);}}this.currentElement[this.currentElement.length]=G;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(G,0,G,0);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(true);}}}}else{this._setEditorStyle(true);this._getDoc().execCommand("fontname",false,"yui-tmp");var F=[];var R=this._getDoc().getElementsByTagName("font");var P=this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);var M=this._getDoc().getElementsByTagName("span");var L=this._getDoc().getElementsByTagName("i");var K=this._getDoc().getElementsByTagName("b");var J=this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);for(var V=0;V<R.length;V++){F[F.length]=R[V];}for(var N=0;N<J.length;N++){F[F.length]=J[N];}for(var T=0;T<P.length;T++){F[F.length]=P[T];}for(var S=0;S<M.length;S++){F[F.length]=M[S];}for(var Q=0;Q<L.length;Q++){F[F.length]=L[Q];}for(var O=0;O<K.length;O++){F[F.length]=K[O];}for(var a=0;a<F.length;a++){if((YAHOO.util.Dom.getStyle(F[a],"font-family")=="yui-tmp")||(F[a].face&&(F[a].face=="yui-tmp"))){G=X();G.innerHTML=F[a].innerHTML;if(this._isElement(F[a],"ol")||(this._isElement(F[a],"ul"))){var Y=F[a].getElementsByTagName("li")[0];F[a].style.fontFamily="inherit";Y.style.fontFamily="inherit";G.innerHTML=Y.innerHTML;Y.innerHTML="";Y.appendChild(G);this.currentElement[this.currentElement.length]=G;}else{if(this._isElement(F[a],"li")){F[a].innerHTML="";F[a].appendChild(G);F[a].style.fontFamily="inherit";this.currentElement[this.currentElement.length]=G;}else{if(F[a].parentNode){F[a].parentNode.replaceChild(G,F[a]);this.currentElement[this.currentElement.length]=G;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(G,0,G,0);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(true);}}if(this.browser.ie&&U&&U.fontSize){this._getSelection().empty();}if(this.browser.gecko){this._getSelection().collapseToStart();}}}}}}var c=this.currentElement.length;for(var d=0;d<c;d++){if((d+1)!=c){if(this.currentElement[d]&&this.currentElement[d].nextSibling){if(this._isElement(this.currentElement[d],"br")){this.currentElement[this.currentElement.length]=this.currentElement[d].nextSibling;}}}}}},saveHTML:function(){var F=this.cleanHTML();this.get("element").value=F;return F;},setEditorHTML:function(F){F=this._cleanIncomingHTML(F);this._getDoc().body.innerHTML=F;this.nodeChange();},getEditorHTML:function(){var F=this._getDoc().body;if(F===null){return null;
+}return this._getDoc().body.innerHTML;},show:function(){if(this.browser.gecko){this._setDesignMode("on");this._focusWindow();}if(this.browser.webkit){var F=this;window.setTimeout(function(){F._setInitialContent.call(F);},10);}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}this.get("iframe").setStyle("position","static");this.get("iframe").setStyle("left","");},hide:function(){if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}if(this._fixNodesTimer){clearTimeout(this._fixNodesTimer);this._fixNodesTimer=null;}if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);this._nodeChangeTimer=null;}this._lastNodeChange=0;this.get("iframe").setStyle("position","absolute");this.get("iframe").setStyle("left","-9999px");},_cleanIncomingHTML:function(F){F=F.replace(/<strong([^>]*)>/gi,"<b$1>");F=F.replace(/<\/strong>/gi,"</b>");F=F.replace(/<embed([^>]*)>/gi,"<YUI_EMBED$1>");F=F.replace(/<\/embed>/gi,"</YUI_EMBED>");F=F.replace(/<em([^>]*)>/gi,"<i$1>");F=F.replace(/<\/em>/gi,"</i>");F=F.replace(/<YUI_EMBED([^>]*)>/gi,"<embed$1>");F=F.replace(/<\/YUI_EMBED>/gi,"</embed>");if(this.get("plainText")){F=F.replace(/\n/g,"<br>").replace(/\r/g,"<br>");F=F.replace(/  /gi,"&nbsp;&nbsp;");F=F.replace(/\t/gi,"&nbsp;&nbsp;&nbsp;&nbsp;");}F=F.replace(/<script([^>]*)>/gi,"<bad>");F=F.replace(/<\/script([^>]*)>/gi,"</bad>");F=F.replace(/&lt;script([^>]*)&gt;/gi,"<bad>");F=F.replace(/&lt;\/script([^>]*)&gt;/gi,"</bad>");F=F.replace(/\n/g,"<YUI_LF>").replace(/\r/g,"<YUI_LF>");F=F.replace(new RegExp("<bad([^>]*)>(.*?)</bad>","gi"),"");F=F.replace(/<YUI_LF>/g,"\n");return F;},cleanHTML:function(H){if(!H){H=this.getEditorHTML();}var G=this.get("markup");H=this.pre_filter_linebreaks(H,G);H=H.replace(/<img([^>]*)\/>/gi,"<YUI_IMG$1>");H=H.replace(/<img([^>]*)>/gi,"<YUI_IMG$1>");H=H.replace(/<input([^>]*)\/>/gi,"<YUI_INPUT$1>");H=H.replace(/<input([^>]*)>/gi,"<YUI_INPUT$1>");H=H.replace(/<ul([^>]*)>/gi,"<YUI_UL$1>");H=H.replace(/<\/ul>/gi,"</YUI_UL>");H=H.replace(/<blockquote([^>]*)>/gi,"<YUI_BQ$1>");H=H.replace(/<\/blockquote>/gi,"</YUI_BQ>");H=H.replace(/<embed([^>]*)>/gi,"<YUI_EMBED$1>");H=H.replace(/<\/embed>/gi,"</YUI_EMBED>");if((G=="semantic")||(G=="xhtml")){H=H.replace(/<i(\s+[^>]*)?>/gi,"<em$1>");H=H.replace(/<\/i>/gi,"</em>");H=H.replace(/<b([^>]*)>/gi,"<strong$1>");H=H.replace(/<\/b>/gi,"</strong>");}H=H.replace(/<font/gi,"<font");H=H.replace(/<\/font>/gi,"</font>");H=H.replace(/<span/gi,"<span");H=H.replace(/<\/span>/gi,"</span>");if((G=="semantic")||(G=="xhtml")||(G=="css")){H=H.replace(new RegExp("<font([^>]*)face=\"([^>]*)\">(.*?)</font>","gi"),"<span $1 style=\"font-family: $2;\">$3</span>");H=H.replace(/<u/gi,"<span style=\"text-decoration: underline;\"");H=H.replace(/\/u>/gi,"/span>");if(G=="css"){H=H.replace(/<em([^>]*)>/gi,"<i$1>");H=H.replace(/<\/em>/gi,"</i>");H=H.replace(/<strong([^>]*)>/gi,"<b$1>");H=H.replace(/<\/strong>/gi,"</b>");H=H.replace(/<b/gi,"<span style=\"font-weight: bold;\"");H=H.replace(/\/b>/gi,"/span>");H=H.replace(/<i/gi,"<span style=\"font-style: italic;\"");H=H.replace(/\/i>/gi,"/span>");}H=H.replace(/  /gi," ");}else{H=H.replace(/<u/gi,"<u");H=H.replace(/\/u>/gi,"/u>");}H=H.replace(/<ol([^>]*)>/gi,"<ol$1>");H=H.replace(/\/ol>/gi,"/ol>");H=H.replace(/<li/gi,"<li");H=H.replace(/\/li>/gi,"/li>");H=this.filter_safari(H);H=this.filter_internals(H);H=this.filter_all_rgb(H);H=this.post_filter_linebreaks(H,G);if(G=="xhtml"){H=H.replace(/<YUI_IMG([^>]*)>/g,"<img $1 />");H=H.replace(/<YUI_INPUT([^>]*)>/g,"<input $1 />");}else{H=H.replace(/<YUI_IMG([^>]*)>/g,"<img $1>");H=H.replace(/<YUI_INPUT([^>]*)>/g,"<input $1>");}H=H.replace(/<YUI_UL([^>]*)>/g,"<ul$1>");H=H.replace(/<\/YUI_UL>/g,"</ul>");H=this.filter_invalid_lists(H);H=H.replace(/<YUI_BQ([^>]*)>/g,"<blockquote$1>");H=H.replace(/<\/YUI_BQ>/g,"</blockquote>");H=H.replace(/<YUI_EMBED([^>]*)>/g,"<embed$1>");H=H.replace(/<\/YUI_EMBED>/g,"</embed>");H=YAHOO.lang.trim(H);if(this.get("removeLineBreaks")){H=H.replace(/\n/g,"").replace(/\r/g,"");H=H.replace(/  /gi," ");}if(H.substring(0,6).toLowerCase()=="<span>"){H=H.substring(6);if(H.substring(H.length-7,H.length).toLowerCase()=="</span>"){H=H.substring(0,H.length-7);}}for(var F in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,F)){if(D.isObject(F)&&F.keepContents){H=H.replace(new RegExp("<"+F+"([^>]*)>(.*?)</"+F+">","gi"),"$1");}else{H=H.replace(new RegExp("<"+F+"([^>]*)>(.*?)</"+F+">","gi"),"");}}}this.fireEvent("cleanHTML",{type:"cleanHTML",target:this,html:H});return H;},filter_invalid_lists:function(F){F=F.replace(/<\/li>\n/gi,"</li>");F=F.replace(/<\/li><ol>/gi,"</li><li><ol>");F=F.replace(/<\/ol>/gi,"</ol></li>");F=F.replace(/<\/ol><\/li>\n/gi,"</ol>\n");F=F.replace(/<\/li><ul>/gi,"</li><li><ul>");F=F.replace(/<\/ul>/gi,"</ul></li>");F=F.replace(/<\/ul><\/li>\n/gi,"</ul>\n");F=F.replace(/<\/li>/gi,"</li>\n");F=F.replace(/<\/ol>/gi,"</ol>\n");F=F.replace(/<ol>/gi,"<ol>\n");F=F.replace(/<ul>/gi,"<ul>\n");return F;},filter_safari:function(F){if(this.browser.webkit){F=F.replace(/Apple-style-span/gi,"");F=F.replace(/style="line-height: normal;"/gi,"");F=F.replace(/<li><\/li>/gi,"");F=F.replace(/<li> <\/li>/gi,"");F=F.replace(/<li>  <\/li>/gi,"");F=F.replace(/<div><\/div>/gi,"");F=F.replace(/<div> <\/div>/gi,"");}return F;},filter_internals:function(F){F=F.replace(/\r/g,"");F=F.replace(/<\/?(body|head|html)[^>]*>/gi,"");F=F.replace(/<YUI_BR><\/li>/gi,"</li>");F=F.replace(/yui-tag-span/gi,"");F=F.replace(/yui-tag/gi,"");F=F.replace(/yui-non/gi,"");F=F.replace(/yui-img/gi,"");F=F.replace(/ tag="span"/gi,"");F=F.replace(/ class=""/gi,"");F=F.replace(/ style=""/gi,"");F=F.replace(/ class=" "/gi,"");F=F.replace(/ class="  "/gi,"");F=F.replace(/ target=""/gi,"");F=F.replace(/ title=""/gi,"");if(this.browser.ie){F=F.replace(/ class= /gi,"");
+F=F.replace(/ class= >/gi,"");F=F.replace(/_height="([^>])"/gi,"");F=F.replace(/_width="([^>])"/gi,"");}return F;},filter_all_rgb:function(J){var I=new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)","gi");var F=J.match(I);if(D.isArray(F)){for(var H=0;H<F.length;H++){var G=this.filter_rgb(F[H]);J=J.replace(F[H].toString(),G);}}return J;},filter_rgb:function(H){if(H.toLowerCase().indexOf("rgb")!=-1){var K=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var G=H.replace(K,"$1,$2,$3,$4,$5").split(",");if(G.length==5){var J=parseInt(G[1],10).toString(16);var I=parseInt(G[2],10).toString(16);var F=parseInt(G[3],10).toString(16);J=J.length==1?"0"+J:J;I=I.length==1?"0"+I:I;F=F.length==1?"0"+F:F;H="#"+J+I+F;}}return H;},pre_filter_linebreaks:function(G,F){if(this.browser.webkit){G=G.replace(/<br class="khtml-block-placeholder">/gi,"<YUI_BR>");G=G.replace(/<br class="webkit-block-placeholder">/gi,"<YUI_BR>");}G=G.replace(/<br>/gi,"<YUI_BR>");G=G.replace(/<br (.*?)>/gi,"<YUI_BR>");G=G.replace(/<br\/>/gi,"<YUI_BR>");G=G.replace(/<br \/>/gi,"<YUI_BR>");G=G.replace(/<div><YUI_BR><\/div>/gi,"<YUI_BR>");G=G.replace(/<p>(&nbsp;|&#160;)<\/p>/g,"<YUI_BR>");G=G.replace(/<p><br>&nbsp;<\/p>/gi,"<YUI_BR>");G=G.replace(/<p>&nbsp;<\/p>/gi,"<YUI_BR>");G=G.replace(/<YUI_BR>$/,"");G=G.replace(/<YUI_BR><\/p>/g,"</p>");return G;},post_filter_linebreaks:function(G,F){if(F=="xhtml"){G=G.replace(/<YUI_BR>/g,"<br />");}else{G=G.replace(/<YUI_BR>/g,"<br>");}return G;},clearEditorDoc:function(){this._getDoc().body.innerHTML="&nbsp;";},_renderPanel:function(){},openWindow:function(F){},moveWindow:function(){},_closeWindow:function(){},closeWindow:function(){this.unsubscribeAll("afterExecCommand");this.toolbar.resetAllButtons();this._focusWindow();},destroy:function(){this.saveHTML();this.toolbar.destroy();this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");var G=this.get("element");this.get("element_cont").get("parentNode").replaceChild(G,this.get("element_cont").get("element"));this.get("element_cont").get("element").innerHTML="";this.set("handleSubmit",false);for(var F in this){if(D.hasOwnProperty(this,F)){this[F]=null;}}return true;},toString:function(){var F="SimpleEditor";if(this.get&&this.get("element_cont")){F="SimpleEditor (#"+this.get("element_cont").get("id")+")"+((this.get("disabled")?" Disabled":""));}return F;}});YAHOO.widget.EditorInfo={_instances:{},window:{},panel:null,getEditorById:function(F){if(!YAHOO.lang.isString(F)){F=F.id;}if(this._instances[F]){return this._instances[F];}return false;},toString:function(){var F=0;for(var G in this._instances){F++;}return"Editor Info ("+F+" registered intance"+((F>1)?"s":"")+")";}};})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.Editor=function(G,F){YAHOO.widget.Editor.superclass.constructor.call(this,G,F);};function E(F){return F.replace(/ /g,"-").toLowerCase();}YAHOO.extend(YAHOO.widget.Editor,YAHOO.widget.SimpleEditor,{STR_BEFORE_EDITOR:"This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>",STR_CLOSE_WINDOW:"Close Window",STR_CLOSE_WINDOW_NOTE:"To close this window use the Control + Shift + W key",STR_IMAGE_PROP_TITLE:"Image Options",STR_IMAGE_URL:"Image Url",STR_IMAGE_TITLE:"Description",STR_IMAGE_SIZE:"Size",STR_IMAGE_ORIG_SIZE:"Original Size",STR_IMAGE_COPY:"<span class=\"tip\"><span class=\"icon icon-info\"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you'd like.</span>",STR_IMAGE_PADDING:"Padding",STR_IMAGE_BORDER:"Border",STR_IMAGE_TEXTFLOW:"Text Flow",STR_LOCAL_FILE_WARNING:"<span class=\"tip\"><span class=\"icon icon-warn\"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>",STR_LINK_PROP_TITLE:"Link Options",STR_LINK_PROP_REMOVE:"Remove link from text",STR_LINK_NEW_WINDOW:"Open in a new window.",STR_LINK_TITLE:"Description",CLASS_LOCAL_FILE:"warning-localfile",CLASS_HIDDEN:"yui-hidden",init:function(G,F){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttonType:"advanced",buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"separator"},{type:"push",label:"Subscript",value:"subscript",disabled:true},{type:"push",label:"Superscript",value:"superscript",disabled:true},{type:"separator"},{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true},{type:"separator"},{type:"push",label:"Remove Formatting",value:"removeformat",disabled:true},{type:"push",label:"Show/Hide Hidden Elements",value:"hiddenelements"}]},{type:"separator"},{group:"alignment",label:"Alignment",buttons:[{type:"push",label:"Align Left CTRL + SHIFT + [",value:"justifyleft"},{type:"push",label:"Align Center CTRL + SHIFT + |",value:"justifycenter"},{type:"push",label:"Align Right CTRL + SHIFT + ]",value:"justifyright"},{type:"push",label:"Justify",value:"justifyfull"}]},{type:"separator"},{group:"parastyle",label:"Paragraph Style",buttons:[{type:"select",label:"Normal",value:"heading",disabled:true,menu:[{text:"Normal",value:"none",checked:true},{text:"Header 1",value:"h1"},{text:"Header 2",value:"h2"},{text:"Header 3",value:"h3"},{text:"Header 4",value:"h4"},{text:"Header 5",value:"h5"},{text:"Header 6",value:"h6"}]}]},{type:"separator"},{group:"indentlist",label:"Indenting and Lists",buttons:[{type:"push",label:"Indent",value:"indent",disabled:true},{type:"push",label:"Outdent",value:"outdent",disabled:true},{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};
+YAHOO.widget.Editor.superclass.init.call(this,G,F);},initAttributes:function(F){YAHOO.widget.Editor.superclass.initAttributes.call(this,F);this.setAttributeConfig("localFileWarning",{value:F.locaFileWarning||true});this.setAttributeConfig("hiddencss",{value:F.hiddencss||".yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }",writeOnce:true});},_fixNodes:function(){YAHOO.widget.Editor.superclass._fixNodes.call(this);var I="";var J=this._getDoc().getElementsByTagName("img");for(var G=0;G<J.length;G++){if(J[G].getAttribute("href",2)){I=J[G].getAttribute("src",2);if(this._isLocalFile(I)){C.addClass(J[G],this.CLASS_LOCAL_FILE);}else{C.removeClass(J[G],this.CLASS_LOCAL_FILE);}}}var H=this._getDoc().body.getElementsByTagName("a");for(var F=0;F<H.length;F++){if(H[F].getAttribute("href",2)){I=H[F].getAttribute("href",2);if(this._isLocalFile(I)){C.addClass(H[F],this.CLASS_LOCAL_FILE);}else{C.removeClass(H[F],this.CLASS_LOCAL_FILE);}}}},_disabled:["createlink","forecolor","backcolor","fontname","fontsize","superscript","subscript","removeformat","heading","indent"],_alwaysDisabled:{"outdent":true},_alwaysEnabled:{hiddenelements:true},_handleKeyDown:function(H){YAHOO.widget.Editor.superclass._handleKeyDown.call(this,H);var G=false,I=null,F=false;if(H.shiftKey&&H.ctrlKey){G=true;}switch(H.keyCode){case 219:I="justifyleft";break;case 220:I="justifycenter";break;case 221:I="justifyright";break;}if(G&&I){this.execCommand(I,null);A.stopEvent(H);this.nodeChange();}},_handleCreateLinkClick:function(){var F=this._getSelectedElement();if(this._isElement(F,"img")){this.STOP_EXEC_COMMAND=true;this.currentElement[0]=F;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});return false;}if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.on("afterExecCommand",function(){var M=new YAHOO.widget.EditorWindow("createlink",{width:"350px"});var J=this.currentElement[0],I="",P="",N="",K=false;if(J){if(J.getAttribute("href",2)!==null){I=J.getAttribute("href",2);if(this._isLocalFile(I)){M.setFooter(this.STR_LOCAL_FILE_WARNING);K=true;}else{M.setFooter(" ");}}if(J.getAttribute("title")!==null){P=J.getAttribute("title");}if(J.getAttribute("target")!==null){N=J.getAttribute("target");}}var O="<label for=\"createlink_url\"><strong>"+this.STR_LINK_URL+":</strong> <input type=\"text\" name=\"createlink_url\" id=\"createlink_url\" value=\""+I+"\""+((K)?" class=\"warning\"":"")+"></label>";O+="<label for=\"createlink_target\"><strong>&nbsp;</strong><input type=\"checkbox\" name=\"createlink_target_\" id=\"createlink_target\" value=\"_blank\""+((N)?" checked":"")+"> "+this.STR_LINK_NEW_WINDOW+"</label>";O+="<label for=\"createlink_title\"><strong>"+this.STR_LINK_TITLE+":</strong> <input type=\"text\" name=\"createlink_title\" id=\"createlink_title\" value=\""+P+"\"></label>";var L=document.createElement("div");L.innerHTML=O;var H=document.createElement("div");H.className="removeLink";var G=document.createElement("a");G.href="#";G.innerHTML=this.STR_LINK_PROP_REMOVE;G.title=this.STR_LINK_PROP_REMOVE;A.on(G,"click",function(Q){A.stopEvent(Q);this.execCommand("unlink");this.closeWindow();},this,true);H.appendChild(G);L.appendChild(H);M.setHeader(this.STR_LINK_PROP_TITLE);M.setBody(L);A.onAvailable("createlink_url",function(){window.setTimeout(function(){try{YAHOO.util.Dom.get("createlink_url").focus();}catch(Q){}},50);A.on("createlink_url","blur",function(){var Q=C.get("createlink_url");if(this._isLocalFile(Q.value)){C.addClass(Q,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{C.removeClass(Q,"warning");this.get("panel").setFooter(" ");}},this,true);},this,true);this.openWindow(M);});},_handleCreateLinkWindowClose:function(){var H=C.get("createlink_url"),J=C.get("createlink_target"),L=C.get("createlink_title"),I=this.currentElement[0],F=I;if(H&&H.value){var K=H.value;if((K.indexOf("://")==-1)&&(K.substring(0,1)!="/")&&(K.substring(0,6).toLowerCase()!="mailto")){if((K.indexOf("@")!=-1)&&(K.substring(0,6).toLowerCase()!="mailto")){K="mailto:"+K;}else{if(K.substring(0,1)!="#"){K="http://"+K;}}}I.setAttribute("href",K);if(J.checked){I.setAttribute("target",J.value);}else{I.setAttribute("target","");}I.setAttribute("title",((L.value)?L.value:""));}else{var G=this._getDoc().createElement("span");G.innerHTML=I.innerHTML;C.addClass(G,"yui-non");I.parentNode.replaceChild(G,I);}this.nodeChange();this.currentElement=[];},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false;}}this._setBusy();this.on("afterExecCommand",function(){var I=this.currentElement[0],S=null,P="",e="",f="",O="",b="",V=75,Y=75,U=0,Q=0,N=0,W=false,M=new YAHOO.widget.EditorWindow("insertimage",{width:"415px"});if(!I){I=this._getSelectedElement();}if(I){if(I.getAttribute("src")){O=I.getAttribute("src",2);if(O.indexOf(this.get("blankimage"))!=-1){O=this.STR_IMAGE_HERE;W=true;}}if(I.getAttribute("alt",2)){f=I.getAttribute("alt",2);}if(I.getAttribute("title",2)){f=I.getAttribute("title",2);}if(I.parentNode&&this._isElement(I.parentNode,"a")){P=I.parentNode.getAttribute("href",2);if(I.parentNode.getAttribute("target")!==null){e=I.parentNode.getAttribute("target");}}V=parseInt(I.height,10);Y=parseInt(I.width,10);if(I.style.height){V=parseInt(I.style.height,10);}if(I.style.width){Y=parseInt(I.style.width,10);}if(I.style.margin){U=parseInt(I.style.margin,10);}if(!I._height){I._height=V;}if(!I._width){I._width=Y;}Q=I._height;N=I._width;}var Z="<label for=\"insertimage_url\"><strong>"+this.STR_IMAGE_URL+":</strong> <input type=\"text\" id=\"insertimage_url\" value=\""+O+"\" size=\"40\"></label>";
+S=document.createElement("div");S.innerHTML=Z;var K=document.createElement("div");K.id="img_toolbar";S.appendChild(K);var F="<label for=\"insertimage_title\"><strong>"+this.STR_IMAGE_TITLE+":</strong> <input type=\"text\" id=\"insertimage_title\" value=\""+f+"\" size=\"40\"></label>";F+="<label for=\"insertimage_link\"><strong>"+this.STR_LINK_URL+":</strong> <input type=\"text\" name=\"insertimage_link\" id=\"insertimage_link\" value=\""+P+"\"></label>";F+="<label for=\"insertimage_target\"><strong>&nbsp;</strong><input type=\"checkbox\" name=\"insertimage_target_\" id=\"insertimage_target\" value=\"_blank\""+((e)?" checked":"")+"> "+this.STR_LINK_NEW_WINDOW+"</label>";var T=document.createElement("div");T.innerHTML=F;S.appendChild(T);M.cache=S;var H=new YAHOO.widget.Toolbar(K,{buttonType:this._defaultToolbar.buttonType,buttons:[{group:"textflow",label:this.STR_IMAGE_TEXTFLOW+":",buttons:[{type:"push",label:"Left",value:"left"},{type:"push",label:"Inline",value:"inline"},{type:"push",label:"Block",value:"block"},{type:"push",label:"Right",value:"right"}]},{type:"separator"},{group:"padding",label:this.STR_IMAGE_PADDING+":",buttons:[{type:"spin",label:""+U,value:"padding",range:[0,50]}]},{type:"separator"},{group:"border",label:this.STR_IMAGE_BORDER+":",buttons:[{type:"select",label:"Border Size",value:"bordersize",menu:[{text:"none",value:"0",checked:true},{text:"1px",value:"1"},{text:"2px",value:"2"},{text:"3px",value:"3"},{text:"4px",value:"4"},{text:"5px",value:"5"}]},{type:"select",label:"Border Type",value:"bordertype",disabled:true,menu:[{text:"Solid",value:"solid",checked:true},{text:"Dashed",value:"dashed"},{text:"Dotted",value:"dotted"}]},{type:"color",label:"Border Color",value:"bordercolor",disabled:true}]}]});var G="0";var X="solid";if(I.style.borderLeftWidth){G=parseInt(I.style.borderLeftWidth,10);}if(I.style.borderLeftStyle){X=I.style.borderLeftStyle;}var d=H.getButtonByValue("bordersize");var a=((parseInt(G,10)>0)?"":"none");d.set("label","<span class=\"yui-toolbar-bordersize-"+G+"\">"+a+"</span>");this._updateMenuChecked("bordersize",G,H);var R=H.getButtonByValue("bordertype");R.set("label","<span class=\"yui-toolbar-bordertype-"+X+"\"></span>");this._updateMenuChecked("bordertype",X,H);if(parseInt(G,10)>0){H.enableButton(R);H.enableButton(d);}var J=H.get("cont");var c=document.createElement("div");c.className="yui-toolbar-group yui-toolbar-group-height-width height-width";c.innerHTML="<h3>"+this.STR_IMAGE_SIZE+":</h3>";var L="";if((V!=Q)||(Y!=N)){L="<span class=\"info\">"+this.STR_IMAGE_ORIG_SIZE+"<br>"+N+" x "+Q+"</span>";}c.innerHTML+="<span><input type=\"text\" size=\"3\" value=\""+Y+"\" id=\"insertimage_width\"> x <input type=\"text\" size=\"3\" value=\""+V+"\" id=\"insertimage_height\"></span>"+L;J.insertBefore(c,J.firstChild);A.onAvailable("insertimage_width",function(){A.on("insertimage_width","blur",function(){var g=parseInt(C.get("insertimage_width").value,10);if(g>5){I.style.width=g+"px";this.moveWindow();}},this,true);},this,true);A.onAvailable("insertimage_height",function(){A.on("insertimage_height","blur",function(){var g=parseInt(C.get("insertimage_height").value,10);if(g>5){I.style.height=g+"px";this.moveWindow();}},this,true);},this,true);if((I.align=="right")||(I.align=="left")){H.selectButton(I.align);}else{if(I.style.display=="block"){H.selectButton("block");}else{H.selectButton("inline");}}if(parseInt(I.style.marginLeft,10)>0){H.getButtonByValue("padding").set("label",""+parseInt(I.style.marginLeft,10));}if(I.style.borderSize){H.selectButton("bordersize");H.selectButton(parseInt(I.style.borderSize,10));}H.on("colorPickerClicked",function(k){var h="1",j="solid",g="black";if(I.style.borderLeftWidth){h=parseInt(I.style.borderLeftWidth,10);}if(I.style.borderLeftStyle){j=I.style.borderLeftStyle;}if(I.style.borderLeftColor){g=I.style.borderLeftColor;}var i=h+"px "+j+" #"+k.color;I.style.border=i;},this.toolbar,true);H.on("buttonClick",function(m){var k=m.button.value,j="";if(m.button.menucmd){k=m.button.menucmd;}var h="1",i="solid",g="black";if(I.style.borderLeftWidth){h=parseInt(I.style.borderLeftWidth,10);}if(I.style.borderLeftStyle){i=I.style.borderLeftStyle;}if(I.style.borderLeftColor){g=I.style.borderLeftColor;}switch(k){case"bordersize":if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}j=parseInt(m.button.value,10)+"px "+i+" "+g;I.style.border=j;if(parseInt(m.button.value,10)>0){H.enableButton("bordertype");H.enableButton("bordercolor");}else{H.disableButton("bordertype");H.disableButton("bordercolor");}break;case"bordertype":if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}j=h+"px "+m.button.value+" "+g;I.style.border=j;break;case"right":case"left":H.deselectAllButtons();I.style.display="";I.align=m.button.value;break;case"inline":H.deselectAllButtons();I.style.display="";I.align="";break;case"block":H.deselectAllButtons();I.style.display="block";I.align="center";break;case"padding":var l=H.getButtonById(m.button.id);I.style.margin=l.get("label")+"px";break;}H.selectButton(m.button.value);this.moveWindow();},this,true);M.setHeader(this.STR_IMAGE_PROP_TITLE);M.setBody(S);if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){M.setFooter(this.STR_IMAGE_COPY);}this.openWindow(M);A.onAvailable("insertimage_url",function(){this.toolbar.selectButton("insertimage");window.setTimeout(function(){YAHOO.util.Dom.get("insertimage_url").focus();if(W){YAHOO.util.Dom.get("insertimage_url").select();}},50);if(this.get("localFileWarning")){A.on("insertimage_link","blur",function(){var g=C.get("insertimage_link");if(this._isLocalFile(g.value)){C.addClass(g,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{C.removeClass(g,"warning");this.get("panel").setFooter(" ");if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){this.get("panel").setFooter(this.STR_IMAGE_COPY);}}},this,true);A.on("insertimage_url","blur",function(){var i=C.get("insertimage_url");
+if(this._isLocalFile(i.value)){C.addClass(i,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{if(this.currentElement[0]){C.removeClass(i,"warning");this.get("panel").setFooter(" ");if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){this.get("panel").setFooter(this.STR_IMAGE_COPY);}if(i&&i.value&&(i.value!=this.STR_IMAGE_HERE)){this.currentElement[0].setAttribute("src",i.value);var h=this,g=new Image();g.onerror=function(){i.value=h.STR_IMAGE_HERE;g.setAttribute("src",h.get("blankimage"));h.currentElement[0].setAttribute("src",h.get("blankimage"));YAHOO.util.Dom.get("insertimage_height").value=g.height;YAHOO.util.Dom.get("insertimage_width").value=g.width;};window.setTimeout(function(){YAHOO.util.Dom.get("insertimage_height").value=g.height;YAHOO.util.Dom.get("insertimage_width").value=g.width;if(h.currentElement&&h.currentElement[0]){if(!h.currentElement[0]._height){h.currentElement[0]._height=g.height;}if(!h.currentElement[0]._width){h.currentElement[0]._width=g.width;}}h.moveWindow();},200);if(i.value!=this.STR_IMAGE_HERE){g.src=i.value;}}}}},this,true);}},this,true);});},_handleInsertImageWindowClose:function(){var F=C.get("insertimage_url");var M=C.get("insertimage_title");var J=C.get("insertimage_link");var K=C.get("insertimage_target");var I=this.currentElement[0];if(F&&F.value&&(F.value!=this.STR_IMAGE_HERE)){I.setAttribute("src",F.value);I.setAttribute("title",M.value);I.setAttribute("alt",M.value);var H=I.parentNode;if(J.value){var L=J.value;if((L.indexOf("://")==-1)&&(L.substring(0,1)!="/")&&(L.substring(0,6).toLowerCase()!="mailto")){if((L.indexOf("@")!=-1)&&(L.substring(0,6).toLowerCase()!="mailto")){L="mailto:"+L;}else{L="http://"+L;}}if(H&&this._isElement(H,"a")){H.setAttribute("href",L);if(K.checked){H.setAttribute("target",K.value);}else{H.setAttribute("target","");}}else{var G=this._getDoc().createElement("a");G.setAttribute("href",L);if(K.checked){G.setAttribute("target",K.value);}else{G.setAttribute("target","");}I.parentNode.replaceChild(G,I);G.appendChild(I);}}else{if(H&&this._isElement(H,"a")){H.parentNode.replaceChild(I,H);}}}else{I.parentNode.removeChild(I);}this.currentElement=[];this.nodeChange();},_renderPanel:function(){var F=null;if(!YAHOO.widget.EditorInfo.panel){F=new YAHOO.widget.Overlay(this.EDITOR_PANEL_ID,{width:"300px",iframe:true,visible:false,underlay:"none",draggable:false,close:false});YAHOO.widget.EditorInfo.panel=F;}else{F=YAHOO.widget.EditorInfo.panel;}this.set("panel",F);this.get("panel").setBody("---");this.get("panel").setHeader(" ");this.get("panel").setFooter(" ");if(this.DOMReady){this.get("panel").render(document.body);C.addClass(this.get("panel").element,"yui-editor-panel");}else{A.onDOMReady(function(){this.get("panel").render(document.body);C.addClass(this.get("panel").element,"yui-editor-panel");},this,true);}this.get("panel").showEvent.subscribe(function(){YAHOO.util.Dom.setStyle(this.element,"display","block");});return this.get("panel");},openWindow:function(K){this.toolbar.set("disabled",true);A.on(document,"keypress",this._closeWindow,this,true);if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}YAHOO.widget.EditorInfo.window.win=K;YAHOO.widget.EditorInfo.window.scope=this;var P=this,L=C.getXY(this.currentElement[0]),U=C.getXY(this.get("iframe").get("element")),N=this.get("panel"),T=[(L[0]+U[0]-20),(L[1]+U[1]+10)],O=(parseInt(K.attrs.width,10)/2),R="center",M=null;this.fireEvent("beforeOpenWindow",{type:"beforeOpenWindow",win:K,panel:N});M=document.createElement("div");M.className=this.CLASS_PREFIX+"-body-cont";for(var V in this.browser){if(this.browser[V]){C.addClass(M,V);break;}}C.addClass(M,((YAHOO.widget.Button&&(this._defaultToolbar.buttonType=="advanced"))?"good-button":"no-button"));var S=document.createElement("h3");S.className="yui-editor-skipheader";S.innerHTML=this.STR_CLOSE_WINDOW_NOTE;M.appendChild(S);form=document.createElement("form");form.setAttribute("method","GET");var W=K.name;A.on(form,"submit",function(Y){var X="window"+W+"Submit";P.fireEvent(X,{type:X,target:this});A.stopEvent(Y);},this,true);M.appendChild(form);if(D.isObject(K.body)){form.appendChild(K.body);}else{var F=document.createElement("div");F.innerHTML=K.body;form.appendChild(F);}var J=document.createElement("span");J.innerHTML="X";J.title=this.STR_CLOSE_WINDOW;J.className="close";A.on(J,"click",function(){this.closeWindow();},this,true);var H=document.createElement("span");H.innerHTML="^";H.className="knob";K._knob=H;var I=document.createElement("h3");I.innerHTML=K.header;N.cfg.setProperty("width",K.attrs.width);N.setHeader(" ");N.appendToHeader(I);I.appendChild(J);I.appendChild(H);N.setBody(" ");N.setFooter(" ");if(K.footer!==null){N.setFooter(K.footer);C.addClass(N.footer,"open");}else{C.removeClass(N.footer,"open");}N.appendToBody(M);var Q=function(){N.bringToTop();A.on(N.element,"click",function(X){A.stopPropagation(X);});this._setBusy(true);N.showEvent.unsubscribe(Q);};N.showEvent.subscribe(Q,this,true);var G=function(){this.currentWindow=null;var X="window"+W+"Close";this.fireEvent(X,{type:X,target:this});N.hideEvent.unsubscribe(G);};N.hideEvent.subscribe(G,this,true);this.currentWindow=K;this.moveWindow(true);N.show();this.fireEvent("afterOpenWindow",{type:"afterOpenWindow",win:K,panel:N});},moveWindow:function(G){if(!this.currentWindow){return false;}var J=this.currentWindow,K=C.getXY(this.currentElement[0]),b=C.getXY(this.get("iframe").get("element")),P=this.get("panel"),Z=[(K[0]+b[0]),(K[1]+b[1])],S=(parseInt(J.attrs.width,10)/2),V="center",R=P.cfg.getProperty("xy"),H=J._knob,Y=0,M=0,U=false;Z[0]=((Z[0]-S)+20);Z[0]=Z[0]-C.getDocumentScrollLeft(this._getDoc());Z[1]=Z[1]-C.getDocumentScrollTop(this._getDoc());if(this._isElement(this.currentElement[0],"img")){if(this.currentElement[0].src.indexOf(this.get("blankimage"))!=-1){Z[0]=(Z[0]+(75/2));Z[1]=(Z[1]+75);}else{var O=parseInt(this.currentElement[0].width,10);
+var X=parseInt(this.currentElement[0].height,10);Z[0]=(Z[0]+(O/2));Z[1]=(Z[1]+X);}Z[1]=Z[1]+15;}else{var L=C.getStyle(this.currentElement[0],"fontSize");if(L&&L.indexOf&&L.indexOf("px")!=-1){Z[1]=Z[1]+parseInt(C.getStyle(this.currentElement[0],"fontSize"),10)+5;}else{Z[1]=Z[1]+20;}}if(Z[0]<b[0]){Z[0]=b[0]+5;V="left";}if((Z[0]+(S*2))>(b[0]+parseInt(this.get("iframe").get("element").clientWidth,10))){Z[0]=((b[0]+parseInt(this.get("iframe").get("element").clientWidth,10))-(S*2)-5);V="right";}try{Y=(Z[0]-R[0]);M=(Z[1]-R[1]);}catch(c){}var Q=b[1]+parseInt(this.get("height"),10);var I=b[0]+parseInt(this.get("width"),10);if(Z[1]>Q){Z[1]=Q;}if(Z[0]>I){Z[0]=(I/2);}Y=((Y<0)?(Y*-1):Y);M=((M<0)?(M*-1):M);if(((Y>10)||(M>10))||G){var T=0,W=0;if(this.currentElement[0].width){W=(parseInt(this.currentElement[0].width,10)/2);}var N=K[0]+b[0]+W;T=N-Z[0];if(T>(parseInt(J.attrs.width,10)-1)){T=parseInt(J.attrs.width,10)-1;}else{if(T<40){T=1;}}if(isNaN(T)){T=1;}if(G){if(H){H.style.left=T+"px";}if(this.get("animate")){C.setStyle(P.element,"opacity","0");U=new YAHOO.util.Anim(P.element,{opacity:{from:0,to:1}},0.1,YAHOO.util.Easing.easeOut);P.cfg.setProperty("xy",Z);U.onComplete.subscribe(function(){if(this.browser.ie){P.element.style.filter="none";}},this,true);U.animate();}else{P.cfg.setProperty("xy",Z);}}else{if(this.get("animate")){U=new YAHOO.util.Anim(P.element,{},0.5,YAHOO.util.Easing.easeOut);U.attributes={top:{to:Z[1]},left:{to:Z[0]}};U.onComplete.subscribe(function(){P.cfg.setProperty("xy",Z);});var a=new YAHOO.util.Anim(P.iframe,U.attributes,0.5,YAHOO.util.Easing.easeOut);var F=new YAHOO.util.Anim(H,{left:{to:T}},0.6,YAHOO.util.Easing.easeOut);U.animate();a.animate();F.animate();}else{H.style.left=T+"px";P.cfg.setProperty("xy",Z);}}}},_closeWindow:function(F){if((F.charCode==87)&&F.shiftKey&&F.ctrlKey){if(this.currentWindow){this.closeWindow();}}},closeWindow:function(){YAHOO.widget.EditorInfo.window={};this.fireEvent("closeWindow",{type:"closeWindow",win:this.currentWindow});this.currentWindow=null;this.get("panel").hide();this.get("panel").cfg.setProperty("xy",[-900,-900]);this.get("panel").syncIframe();this.unsubscribeAll("afterExecCommand");this.toolbar.set("disabled",false);this.toolbar.resetAllButtons();this._focusWindow();A.removeListener(document,"keypress",this._closeWindow);},cmd_heading:function(J){var G=true,H=null,I="heading",K=this._getSelection(),F=this._getSelectedElement();if(F){K=F;}if(this.browser.ie){I="formatblock";}if(J=="none"){if((K&&K.tagName&&(K.tagName.toLowerCase().substring(0,1)=="h"))||(K&&K.parentNode&&K.parentNode.tagName&&(K.parentNode.tagName.toLowerCase().substring(0,1)=="h"))){if(K.parentNode.tagName.toLowerCase().substring(0,1)=="h"){K=K.parentNode;}if(this._isElement(K,"html")){return[false];}H=this._swapEl(F,"span",function(L){L.className="yui-non";});this._selectNode(H);this.currentElement[0]=H;}G=false;}else{if(this._isElement(F,"h1")||this._isElement(F,"h2")||this._isElement(F,"h3")||this._isElement(F,"h4")||this._isElement(F,"h5")||this._isElement(F,"h6")){H=this._swapEl(F,J);this._selectNode(H);this.currentElement[0]=H;}else{this._createCurrentElement(J);this._selectNode(this.currentElement[0]);}G=false;}return[G,I];},cmd_hiddenelements:function(F){if(this._showingHiddenElements){this._lastButton=null;this._showingHiddenElements=false;this.toolbar.deselectButton("hiddenelements");C.removeClass(this._getDoc().body,this.CLASS_HIDDEN);}else{this._showingHiddenElements=true;C.addClass(this._getDoc().body,this.CLASS_HIDDEN);this.toolbar.selectButton("hiddenelements");}return[false];},cmd_removeformat:function(I){var G=true;if(this.browser.webkit&&!this._getDoc().queryCommandEnabled("removeformat")){var F=this._getSelection()+"";this._createCurrentElement("span");this.currentElement[0].className="yui-non";this.currentElement[0].innerHTML=F;for(var H=1;H<this.currentElement.length;H++){this.currentElement[H].parentNode.removeChild(this.currentElement[H]);}G=false;}return[G];},cmd_script:function(L,K){var H=true,F=L.toLowerCase().substring(0,3),I=null,G=this._getSelectedElement();if(this.browser.webkit){if(this._isElement(G,F)){I=this._swapEl(this.currentElement[0],"span",function(M){M.className="yui-non";});this._selectNode(I);}else{this._createCurrentElement(F);var J=this._swapEl(this.currentElement[0],F);this._selectNode(J);this.currentElement[0]=J;}H=false;}return H;},cmd_superscript:function(F){return[this.cmd_script("superscript",F)];},cmd_subscript:function(F){return[this.cmd_script("subscript",F)];},cmd_indent:function(I){var F=true,H=this._getSelectedElement(),J=null;if(this.browser.webkit||this.browser.ie||this.browser.gecko){if(this._isElement(H,"blockquote")){J=this._getDoc().createElement("blockquote");J.innerHTML=H.innerHTML;H.innerHTML="";H.appendChild(J);this._selectNode(J);}else{this._createCurrentElement("blockquote");for(var G=0;G<this.currentElement.length;G++){J=this._getDoc().createElement("blockquote");J.innerHTML=this.currentElement[G].innerHTML;this.currentElement[G].parentNode.replaceChild(J,this.currentElement[G]);this.currentElement[G]=J;}this._selectNode(this.currentElement[0]);}F=false;}else{I="blockquote";}return[F,"indent",I];},cmd_outdent:function(J){var F=true,I=this._getSelectedElement(),K=null,G=null;if(this.browser.webkit||this.browser.ie||this.browser.gecko){I=this._getSelectedElement();if(this._isElement(I,"blockquote")){var H=I.parentNode;if(this._isElement(I.parentNode,"blockquote")){H.innerHTML=I.innerHTML;this._selectNode(H);}else{G=this._getDoc().createElement("span");G.innerHTML=I.innerHTML;YAHOO.util.Dom.addClass(G,"yui-non");H.replaceChild(G,I);this._selectNode(G);}}else{}F=false;}else{J="blockquote";}return[F,"indent",J];},toString:function(){var F="Editor";if(this.get&&this.get("element_cont")){F="Editor (#"+this.get("element_cont").get("id")+")"+((this.get("disabled")?" Disabled":""));}return F;}});YAHOO.widget.EditorWindow=function(G,F){this.name=G.replace(" ","_");this.attrs=F;};YAHOO.widget.EditorWindow.prototype={_cache:null,header:null,body:null,footer:null,setHeader:function(F){this.header=F;
+},setBody:function(F){this.body=F;},setFooter:function(F){this.footer=F;},toString:function(){return"Editor Window ("+this.name+")";}};})();YAHOO.register("editor",YAHOO.widget.Editor,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 658a32b4001af679c8021d765788fcd71709412f..ebee96754d86c6c16d300b0b1073ddf3f5ace99e 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
-*/
-/*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
 */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+    /**
+     * @description <p>Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButtonAdvanced
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event, container_core, menu, button
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    if (YAHOO.widget.Button) {
+        YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button;
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich';
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) {
+            var _menuItems = this.getMenu().getItems();
+            if (_menuItems.length === 0) {
+                this.getMenu()._onBeforeShow();
+                _menuItems = this.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }      
+        };
+    } else {
+        YAHOO.widget.ToolbarButtonAdvanced = function() {};
+    }
+
+
+    /**
+     * @description <p>Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButton
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event
+     * @Extends YAHOO.util.Element
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    YAHOO.widget.ToolbarButton = function(el, attrs) {
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+
+        if (!oConfig.attributes.type) {
+            oConfig.attributes.type = 'push';
+        }
+        
+        oConfig.element = document.createElement('span');
+        oConfig.element.setAttribute('unselectable', 'on');
+        oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button';
+        oConfig.element.innerHTML = '<span class="first-child"><a href="#">LABEL</a></span>';
+        oConfig.attributes.id = Dom.generateId();
+
+        YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, {
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        buttonType: 'normal',
+        /**
+        * @method _handleMouseOver
+        * @private
+        * @description Adds classes to the button elements on mouseover (hover)
+        */
+        _handleMouseOver: function() {
+            if (!this.get('disabled')) {
+                this.addClass('yui-button-hover');
+                this.addClass('yui-' + this.get('type') + '-button-hover');
+            }
+        },
+        /**
+        * @method _handleMouseOut
+        * @private
+        * @description Removes classes from the button elements on mouseout (hover)
+        */
+        _handleMouseOut: function() {
+            this.removeClass('yui-button-hover');
+            this.removeClass('yui-' + this.get('type') + '-button-hover');
+        },
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        checkValue: function(value) {
+            if (this.get('type') == 'menu') {
+                var opts = this._button.options;
+                for (var i = 0; i < opts.length; i++) {
+                    if (opts[i].value == value) {
+                        opts.selectedIndex = i;
+                    }
+                }
+            }
+        },
+        /** 
+        * @method init
+        * @description The ToolbarButton class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.on('mouseover', this._handleMouseOver, this, true);
+            this.on('mouseout', this._handleMouseOut, this, true);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */        
+        initAttributes: function(attr) {
+            YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute value
+            * @description The value of the button
+            * @type String
+            */            
+            this.setAttributeConfig('value', {
+                value: attr.value
+            });
+            /**
+            * @attribute menu
+            * @description The menu attribute, see YAHOO.widget.Button
+            * @type Object
+            */            
+            this.setAttributeConfig('menu', {
+                value: attr.menu || false
+            });
+            /**
+            * @attribute type
+            * @description The type of button to create: push, menu, color, select, spin
+            * @type String
+            */            
+            this.setAttributeConfig('type', {
+                value: attr.type,
+                writeOnce: true,
+                method: function(type) {
+                    var el, opt;
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    switch (type) {
+                        case 'select':
+                        case 'menu':
+                            el = document.createElement('select');
+                            var menu = this.get('menu');
+                            for (var i = 0; i < menu.length; i++) {
+                                opt = document.createElement('option');
+                                opt.innerHTML = menu[i].text;
+                                opt.value = menu[i].value;
+                                if (menu[i].checked) {
+                                    opt.selected = true;
+                                }
+                                el.appendChild(opt);
+                            }
+                            this._button.parentNode.replaceChild(el, this._button);
+                            Event.on(el, 'change', this._handleSelect, this, true);
+                            this._button = el;
+                            break;
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Set the button into a disabled state
+            * @type String
+            */            
+            this.setAttributeConfig('disabled', {
+                value: attr.disabled || false,
+                method: function(disabled) {
+                    if (disabled) {
+                        this.addClass('yui-button-disabled');
+                        this.addClass('yui-' + this.get('type') + '-button-disabled');
+                    } else {
+                        this.removeClass('yui-button-disabled');
+                        this.removeClass('yui-' + this.get('type') + '-button-disabled');
+                    }
+                    if (this.get('type') == 'menu') {
+                        this._button.disabled = disabled;
+                    }
+                }
+            });
+
+            /**
+            * @attribute label
+            * @description The text label for the button
+            * @type String
+            */            
+            this.setAttributeConfig('label', {
+                value: attr.label,
+                method: function(label) {
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    if (this.get('type') == 'push') {
+                        this._button.innerHTML = label;
+                    }
+                }
+            });
+
+            /**
+            * @attribute title
+            * @description The title of the button
+            * @type String
+            */            
+            this.setAttributeConfig('title', {
+                value: attr.title
+            });
+
+            /**
+            * @config container
+            * @description The container that the button is rendered to, handled by Toolbar
+            * @type String
+            */            
+            this.setAttributeConfig('container', {
+                value: null,
+                writeOnce: true,
+                method: function(cont) {
+                    this.appendTo(cont);
+                }
+            });
+
+        },
+        /** 
+        * @private
+        * @method _handleSelect
+        * @description The event fired when a change event gets fired on a select element
+        * @param {Event} ev The change event.
+        */        
+        _handleSelect: function(ev) {
+            var tar = Event.getTarget(ev);
+            var value = tar.options[tar.selectedIndex].value;
+            this.fireEvent('change', {type: 'change', value: value });
+        },
+        /** 
+        * @method getMenu
+        * @description A stub function to mimic YAHOO.widget.Button's getMenu method
+        */        
+        getMenu: function() {
+            return this.get('menu');
+        },
+        /** 
+        * @method fireEvent
+        * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled.
+        */        
+        fireEvent: function (p_sType , p_aArgs) {
+            //  Disabled buttons should not respond to DOM events
+            if (this.DOM_EVENTS[p_sType] && this.get('disabled')) {
+                return;
+            }
+        
+            YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs);
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */        
+        toString: function() {
+            return 'ToolbarButton (' + this.get('id') + ')';
+        }
+        
+    });
+})();
 /**
  * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
- * @class Toolbar
  * @namespace YAHOO.widget
- * @requires yahoo, dom, element, event
- * @optional container, menu, button, dragdrop
+ * @requires yahoo, dom, element, event, toolbarbutton
+ * @optional container_core, dragdrop
  * @beta
  */
 (function() {
@@ -28,20 +325,22 @@ var Dom = YAHOO.util.Dom,
     /**
      * Provides a rich toolbar widget based on the button and menu widgets
      * @constructor
+     * @class Toolbar
+     * @extends YAHOO.util.Element
      * @param {String/HTMLElement} el The element to turn into a toolbar.
      * @param {Object} attrs Object liternal containing configuration parameters.
     */
     YAHOO.widget.Toolbar = function(el, attrs) {
         
         if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
-            var attrs = el;
+            attrs = el;
         }
         var local_attrs = (attrs || {});
 
         var oConfig = {
             element: null,
             attributes: local_attrs
-        }
+        };
         
         
         if (Lang.isString(el) && Dom.get(el)) {
@@ -67,16 +366,15 @@ var Dom = YAHOO.util.Dom,
         
         var cont = document.createElement('DIV');
         oConfig.attributes.cont = cont;
-        Dom.addClass(cont, 'yui-toolbar-subcont')
+        Dom.addClass(cont, 'yui-toolbar-subcont');
         oConfig.element.appendChild(cont);
         
         oConfig.attributes.element = oConfig.element;
         oConfig.attributes.id = oConfig.element.id;
 
         YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
-        
-        
-    }
+         
+    };
 
     /**
     * @method _addMenuClasses
@@ -97,10 +395,15 @@ var Dom = YAHOO.util.Dom,
             Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
             Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
         }
-        this._setWidth();
-    };
+    }
 
     YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property buttonType
+        * @description The default button to use
+        * @type Object
+        */
+        buttonType: YAHOO.widget.ToolbarButton,
         /** 
         * @property dd
         * @description The DragDrop instance associated with the Toolbar
@@ -297,12 +600,6 @@ var Dom = YAHOO.util.Dom,
         */
         _titlebar: null,
         /** 
-        * @property _disabled
-        * @description Object to track button status when enabling/disabling the toolbar
-        * @type Object
-        */
-        _disabled: null,
-        /** 
         * @property browser
         * @description Standard browser detection
         * @type Object
@@ -401,12 +698,40 @@ var Dom = YAHOO.util.Dom,
         */
         initAttributes: function(attr) {
             YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
-            var el = this.get('element');
             this.addClass(this.CLASS_CONTAINER);
 
+            /**
+            * @attribute buttonType
+            * @description The buttonType to use (advanced or basic)
+            * @type String
+            */
+            this.setAttributeConfig('buttonType', {
+                value: attr.buttonType || 'basic',
+                writeOnce: true,
+                validator: function(type) {
+                    switch (type) {
+                        case 'advanced':
+                        case 'basic':
+                            return true;
+                    }
+                    return false;
+                },
+                method: function(type) {
+                    if (type == 'advanced') {
+                        if (YAHOO.widget.Button) {
+                            this.buttonType = YAHOO.widget.ToolbarButtonAdvanced;
+                        } else {
+                            this.buttonType = YAHOO.widget.ToolbarButton;
+                        }
+                    } else {
+                        this.buttonType = YAHOO.widget.ToolbarButton;
+                    }
+                }
+            });
+
 
             /**
-            * @config buttons
+            * @attribute buttons
             * @description Object specifying the buttons to include in the toolbar
             * Example:
             * <code><pre>
@@ -422,7 +747,7 @@ var Dom = YAHOO.util.Dom,
             *   }
             * }
             * </pre></code>
-            * @type Object
+            * @type Array
             */
             
             this.setAttributeConfig('buttons', {
@@ -433,7 +758,7 @@ var Dom = YAHOO.util.Dom,
                         if (Lang.hasOwnProperty(data, i)) {
                             if (data[i].type == 'separator') {
                                 this.addSeparator();
-                            } else if (data[i].group != undefined) {
+                            } else if (data[i].group !== undefined) {
                                 this.addButtonGroup(data[i]);
                             } else {
                                 this.addButton(data[i]);
@@ -444,7 +769,7 @@ var Dom = YAHOO.util.Dom,
             });
 
             /**
-            * @config disabled
+            * @attribute disabled
             * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
             * @default false
             * @type Boolean
@@ -452,78 +777,53 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('disabled', {
                 value: false,
                 method: function(disabled) {
-                    if (!Lang.isObject(this._disabled)) {
-                        this._disabled = {};
+                    if (this.get('disabled') === disabled) {
+                        return false;
                     }
                     if (disabled) {
                         this.addClass(this.CLASS_DISABLED);
                         this.set('draggable', false);
+                        this.disableAllButtons();
                     } else {
                         this.removeClass(this.CLASS_DISABLED);
                         if (this._configs.draggable._initialConfig.value) {
                             //Draggable by default, set it back
                             this.set('draggable', true);
                         }
-                    }
-                    var len = this._buttonList.length;
-                    for (var i = 0; i < len; i++) {
-                        if (disabled) {
-                            //If it's already disabled, flag it
-                            if (this._buttonList[i].get('disabled')) {
-                                this._disabled[i] = true;
-                            } else {
-                                this._disabled[i] = null;
-                            }
-                            this.disableButton(this._buttonList[i].get('id'));
-                        } else {
-                            //Check to see if it was disabled by default and skip it
-                            var _button = this._buttonList[i];
-                            var _check = _button._configs.disabled._initialConfig.value;
-                            if (this._disabled[i]) {
-                                _check = true;
-                            }
-                            if (!_check) {
-                                this.enableButton(_button.get('id'));
-                            }
-                        }
+                        this.resetAllButtons();
                     }
                 }
             });
 
-            /**
-            * @config grouplabels
-            * @description Boolean indicating if the toolbar should show the group label's text string.
-            * @default true
-            * @type Boolean
-            */
-            this.setAttributeConfig('grouplabels', {
-                value: true,
-                writeOnce: true
-            });
-
             /**
             * @config cont
-            * @description Boolean indicating if the toolbar should show the group label's text string.
-            * @default true
-            * @type Boolean
+            * @description The container for the toolbar.
+            * @type HTMLElement
             */
             this.setAttributeConfig('cont', {
                 value: attr.cont,
                 readOnly: true
             });
 
+
             /**
-            * @config collapse
-            * @description Boolean indicating if the the titlebar should have a collapse button.
-            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
-            * @default false
+            * @attribute grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
             * @type Boolean
             */
-            this.setAttributeConfig('collapse', {
-                value: false
+            this.setAttributeConfig('grouplabels', {
+                value: ((attr.grouplabels === false) ? false : true),
+                method: function(grouplabels) {
+                    if (grouplabels) {
+                        Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    } else {
+                        Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    }
+                }
             });
             /**
-            * @config titlebar
+            * @attribute titlebar
             * @description Boolean indicating if the toolbar should have a titlebar. If
             * passed a string, it will use that as the titlebar text
             * @default false
@@ -544,35 +844,14 @@ var Dom = YAHOO.util.Dom,
                             h2.innerHTML = titlebar;
                             this._titlebar.appendChild(h2);
                         }
-                        if (this.get('collapse')) {
-                            var collapse = document.createElement('SPAN');
-                            collapse.innerHTML = 'X';
-                            collapse.title = this.STR_COLLAPSE;
-
-                            Dom.addClass(collapse, 'collapse');
-                            this._titlebar.appendChild(collapse);
-                            Event.addListener(collapse, 'click', function() {
-                                if (Dom.getStyle(this.get('cont'), 'display') == 'none') {
-                                    Dom.setStyle(this.get('cont'), 'display', 'block');
-                                    Dom.removeClass(collapse, 'collapsed');
-                                    this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
-                                } else {
-                                    Dom.setStyle(this.get('cont'), 'display', 'none');
-                                    Dom.addClass(collapse, 'collapsed');
-                                    this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
-                                }
-                            }, this, true);
-                        }
-                        if (this.get('draggable')) {
-                            this.dd = new YAHOO.util.DD(this.get('id'));
-                            this.dd.setHandleElId(this._titlebar);
-                            Dom.addClass(this._titlebar, 'draggable');
-                        }
                         if (this.get('firstChild')) {
                             this.insertBefore(this._titlebar, this.get('firstChild'));
                         } else {
                             this.appendChild(this._titlebar);
                         }
+                        if (this.get('collapse')) {
+                            this.set('collapse', true);
+                        }
                     } else if (this._titlebar) {
                         if (this._titlebar && this._titlebar.parentNode) {
                             this._titlebar.parentNode.removeChild(this._titlebar);
@@ -583,7 +862,52 @@ var Dom = YAHOO.util.Dom,
 
 
             /**
-            * @config draggable
+            * @attribute collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false,
+                method: function(collapse) {
+                    if (this._titlebar) {
+                        var collapseEl = null;
+                        var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                        if (collapse) {
+                            if (el.length > 0) {
+                                //There is already a collapse button
+                                return true;
+                            }
+                            collapseEl = document.createElement('SPAN');
+                            collapseEl.innerHTML = 'X';
+                            collapseEl.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapseEl, 'collapse');
+                            this._titlebar.appendChild(collapseEl);
+                            Event.addListener(collapseEl, 'click', function() {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    this.collapse(false); //Expand Toolbar
+                                } else {
+                                    this.collapse(); //Collapse Toolbar
+                                }
+                            }, this, true);
+                        } else {
+                            collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                            if (collapseEl[0]) {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    //We are closed, reopen the titlebar..
+                                    this.collapse(false); //Expand Toolbar
+                                }
+                                collapseEl[0].parentNode.removeChild(collapseEl[0]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute draggable
             * @description Boolean indicating if the toolbar should be draggable.  
             * @default false
             * @type Boolean
@@ -592,8 +916,6 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('draggable', {
                 value: (attr.draggable || false),
                 method: function(draggable) {
-                    var el = this.get('element');
-
                     if (draggable && !this.get('titlebar')) {
                         if (!this._dragHandle) {
                             this._dragHandle = document.createElement('SPAN');
@@ -663,11 +985,15 @@ var Dom = YAHOO.util.Dom,
             var div = document.createElement('DIV');
             Dom.addClass(div, this.CLASS_PREFIX + '-group');
             Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
-            if (oGroup.label && this.get('grouplabels')) {
+            //if (oGroup.label && this.get('grouplabels')) {
+            if (oGroup.label) {
                 var label = document.createElement('h3');
                 label.innerHTML = oGroup.label;
                 div.appendChild(label);
             }
+            if (!this.get('grouplabels')) {
+                Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels');
+            }
 
             this.get('cont').appendChild(div);
 
@@ -683,8 +1009,9 @@ var Dom = YAHOO.util.Dom,
 
             for (var i = 0; i < oGroup.buttons.length; i++) {
                 var li = document.createElement('li');
+                li.className = this.CLASS_PREFIX + '-groupitem';
                 ul.appendChild(li);
-                if ((oGroup.buttons[i].type != undefined) && oGroup.buttons[i].type == 'separator') {
+                if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') {
                     this.addSeparator(li);
                 } else {
                     oGroup.buttons[i].container = li;
@@ -703,6 +1030,7 @@ var Dom = YAHOO.util.Dom,
         addButtonToGroup: function(oButton, group, after) {
             var groupCont = this._buttonGroupList[group];
             var li = document.createElement('li');
+            li.className = this.CLASS_PREFIX + '-groupitem';
             oButton.container = li;
             this.addButton(oButton, after);
             groupCont.appendChild(li);
@@ -722,8 +1050,6 @@ var Dom = YAHOO.util.Dom,
             if (!this._buttonList) {
                 this._buttonList = [];
             }
-            //Add to .get('buttons') manually
-            this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
             if (!oButton.container) {
                 oButton.container = this.get('cont');
             }
@@ -738,22 +1064,19 @@ var Dom = YAHOO.util.Dom,
                                         oButton.menucmd = oButton.value;
                                     }
                                     oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
-                                    //This line made Opera fire the click event and the mousedown,
-                                    //  so events for menus where firing twice.
-                                    //this._buttonClick('click', oButton);
                                 },
                                 scope: this
-                            }
+                            };
                             oButton.menu[i].onclick = funcObject;
                         }
                     }
                 }
             }
-            var _oButton = {};
-            for (var i in oButton) {
-                if (Lang.hasOwnProperty(oButton, i)) {
-                    if (!this._toolbarConfigs[i]) {
-                        _oButton[i] = oButton[i];
+            var _oButton = {}, skip = false;
+            for (var o in oButton) {
+                if (Lang.hasOwnProperty(oButton, o)) {
+                    if (!this._toolbarConfigs[o]) {
+                        _oButton[o] = oButton[o];
                     }
                 }
             }
@@ -764,17 +1087,21 @@ var Dom = YAHOO.util.Dom,
                 _oButton.type = 'push';
             }
             if (_oButton.type == 'color') {
-                _oButton = this._makeColorButton(_oButton);
+                if (YAHOO.widget.Overlay) {
+                    _oButton = this._makeColorButton(_oButton);
+                } else {
+                    skip = true;
+                }
             }
             if (_oButton.menu) {
-                if (oButton.menu instanceof YAHOO.widget.Overlay) {
+                if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) {
                     oButton.menu.showEvent.subscribe(function() {
                         this._button = _oButton;
                     });
                 } else {
-                    for (var i = 0; i < _oButton.menu.length; i++) {
-                        if (!_oButton.menu[i].value) {
-                            _oButton.menu[i].value = _oButton.menu[i].text;
+                    for (var m = 0; m < _oButton.menu.length; m++) {
+                        if (!_oButton.menu[m].value) {
+                            _oButton.menu[m].value = _oButton.menu[m].text;
                         }
                     }
                     if (this.browser.webkit) {
@@ -782,80 +1109,158 @@ var Dom = YAHOO.util.Dom,
                     }
                 }
             }
-            var tmp = new YAHOO.widget.Button(_oButton);
-            if (this.get('disabled')) {
-                //Toolbar is disabled, disable the new button too!
-                tmp.set('disabled', true);
-            }
-            if (!oButton.id) {
-                oButton.id = tmp.get('id');
-            }
-            
-            if (after) {
-                var el = tmp.get('element');
-                var nextSib = null;
-                if (after.get) {
-                    nextSib = after.get('element').nextSibling;
-                } else if (after.nextSibling) {
-                    nextSib = after.nextSibling;
+            if (skip) {
+                oButton = false;
+            } else {
+                //Add to .get('buttons') manually
+                this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+                
+                var tmp = new this.buttonType(_oButton);
+                if (!tmp.buttonType) {
+                    tmp.buttonType = 'rich';
+                    tmp.checkValue = function(value) {
+                        var _menuItems = this.getMenu().getItems();
+                        if (_menuItems.length === 0) {
+                            this.getMenu()._onBeforeShow();
+                            _menuItems = this.getMenu().getItems();
+                        }
+                        for (var i = 0; i < _menuItems.length; i++) {
+                            _menuItems[i].cfg.setProperty('checked', false);
+                            if (_menuItems[i].value == value) {
+                                _menuItems[i].cfg.setProperty('checked', true);
+                            }
+                        }      
+                    };
                 }
-                if (nextSib) {
-                    nextSib.parentNode.insertBefore(el, nextSib);
-                }
-            }
-            tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
-            var icon = document.createElement('span');
-            icon.className = this.CLASS_PREFIX + '-icon';
-            tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
-            //Replace the Button HTML Element with an a href
-            var a = document.createElement('a');
-            a.innerHTML = tmp._button.innerHTML;
-            a.href = '#';
-            Event.on(a, 'click', function(ev) {
-                Event.stopEvent(ev);
-            });
-            tmp._button.parentNode.replaceChild(a, tmp._button);
-            tmp._button = a;
-
-            if (oButton.type == 'select') {
-                tmp.addClass(this.CLASS_PREFIX + '-select');
-            }
-            if (oButton.type == 'spin') {
-                if (!Lang.isArray(oButton.range)) {
-                    oButton.range = [ 10, 100 ];
+                
+                if (this.get('disabled')) {
+                    //Toolbar is disabled, disable the new button too!
+                    tmp.set('disabled', true);
+                }
+                if (!oButton.id) {
+                    oButton.id = tmp.get('id');
+                }
+                
+                if (after) {
+                    var el = tmp.get('element');
+                    var nextSib = null;
+                    if (after.get) {
+                        nextSib = after.get('element').nextSibling;
+                    } else if (after.nextSibling) {
+                        nextSib = after.nextSibling;
+                    }
+                    if (nextSib) {
+                        nextSib.parentNode.insertBefore(el, nextSib);
+                    }
+                }
+                tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+
+                var icon = document.createElement('span');
+                icon.className = this.CLASS_PREFIX + '-icon';
+                tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+                if (tmp._button.tagName.toLowerCase() == 'button') {
+                    tmp.get('element').setAttribute('unselectable', 'on');
+                    //Replace the Button HTML Element with an a href if it exists
+                    var a = document.createElement('a');
+                    a.innerHTML = tmp._button.innerHTML;
+                    a.href = '#';
+                    Event.on(a, 'click', function(ev) {
+                        Event.stopEvent(ev);
+                    });
+                    tmp._button.parentNode.replaceChild(a, tmp._button);
+                    tmp._button = a;
                 }
-                this._makeSpinButton(tmp, oButton);
-            }
-
-            tmp.get('element').setAttribute('title', tmp.get('label'));
 
-            if (oButton.type != 'spin') {
-                if (_oButton.menu instanceof YAHOO.widget.Overlay) {
-                    var showPicker = function(ev) {
-                        var exec = true;
-                        if (ev.keyCode && (ev.keyCode == 9)) {
-                            exec = false;
-                        }
-                        if (exec) {
-                            this._colorPicker._button = oButton.value;
-                            var menuEL = tmp.getMenu().element;
-                            if (menuEL.style.visibility == 'hidden') {
-                                tmp.getMenu().show();
-                            } else {
-                                tmp.getMenu().hide();
+                if (oButton.type == 'select') {
+                    if (tmp._button.tagName.toLowerCase() == 'select') {
+                        icon.parentNode.removeChild(icon);
+                        var iel = tmp._button;
+                        var parEl = tmp.get('element');
+                        parEl.parentNode.replaceChild(iel, parEl);
+                    } else {
+                        //Don't put a class on it if it's a real select element
+                        tmp.addClass(this.CLASS_PREFIX + '-select');
+                    }
+                }
+                if (oButton.type == 'spin') {
+                    if (!Lang.isArray(oButton.range)) {
+                        oButton.range = [ 10, 100 ];
+                    }
+                    this._makeSpinButton(tmp, oButton);
+                }
+                tmp.get('element').setAttribute('title', tmp.get('label'));
+                if (oButton.type != 'spin') {
+                    if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) {
+                        var showPicker = function(ev) {
+                            var exec = true;
+                            if (ev.keyCode && (ev.keyCode == 9)) {
+                                exec = false;
+                            }
+                            if (exec) {
+                                if (this._colorPicker) {
+                                    this._colorPicker._button = oButton.value;
+                                }
+                                var menuEL = tmp.getMenu().element;
+                                if (Dom.getStyle(menuEL, 'visibility') == 'hidden') {
+                                    tmp.getMenu().show();
+                                } else {
+                                    tmp.getMenu().hide();
+                                }
                             }
+                            YAHOO.util.Event.stopEvent(ev);
+                        };
+                        tmp.on('mousedown', showPicker, oButton, this);
+                        tmp.on('keydown', showPicker, oButton, this);
+                        
+                    } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                        tmp.on('keypress', this._buttonClick, oButton, this);
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                            this._buttonClick(ev, oButton);
+                        }, oButton, this);
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                    } else {
+                        //Stop the mousedown event so we can trap the selection in the editor!
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('change', function(ev) {
+                            if (!oButton.menucmd) {
+                                oButton.menucmd = oButton.value;
+                            }
+                            oButton.value = ev.value;
+                            this._buttonClick(ev, oButton);
+                        }, this, true);
+
+                        var self = this;
+                        //Hijack the mousedown event in the menu and make it fire a button click..
+                        if (tmp.getMenu().mouseDownEvent) {
+                            tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                                var oMenu = args[1];
+                                YAHOO.util.Event.stopEvent(args[0]);
+                                tmp._onMenuClick(args[0], tmp);
+                                if (!oButton.menucmd) {
+                                    oButton.menucmd = oButton.value;
+                                }
+                                oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                self._buttonClick.call(self, args[1], oButton);
+                                tmp._hideMenu();
+                                return false;
+                            });
+                            tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                            tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) {
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
                         }
-                        YAHOO.util.Event.stopEvent(ev);
-                    };
-                    tmp.on('mousedown', showPicker, oButton, this);
-                    tmp.on('keydown', showPicker, oButton, this);
-                    
-                } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
-                    tmp.on('keypress', this._buttonClick, oButton, this);
-                    tmp.on('mousedown', function(ev) {
-                        this._buttonClick(ev, oButton);
-                        YAHOO.util.Event.stopEvent(ev);
-                    }, oButton, this);
+                        
+                    }
                 } else {
                     //Stop the mousedown event so we can trap the selection in the editor!
                     tmp.on('mousedown', function(ev) {
@@ -864,64 +1269,41 @@ var Dom = YAHOO.util.Dom,
                     tmp.on('click', function(ev) {
                         YAHOO.util.Event.stopEvent(ev);
                     });
-                    var self = this;
-                    //Hijack the mousedown event in the menu and make it fire a button click..
-                    tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
-                        var oMenu = args[1];
-                        YAHOO.util.Event.stopEvent(args[0]);
-                        tmp._onMenuClick(args[0], tmp);
-                        if (!oButton.menucmd) {
-                            oButton.menucmd = oButton.value;
-                        }
-                        oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
-                        self._buttonClick.call(self, args[1], oButton);
-                        tmp._hideMenu();
-                        return false;
-                    });
-                    tmp.getMenu().clickEvent.subscribe(function(ev, args) {
-                        YAHOO.util.Event.stopEvent(args[0]);
-                    });
                 }
-            } else {
-                //Stop the mousedown event so we can trap the selection in the editor!
-                tmp.on('mousedown', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                });
-                tmp.on('click', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                });
-            }
-            if (this.browser.ie) {
-                //Add a couple of new events for IE
-                tmp.DOM_EVENTS.focusin = true;
-                tmp.DOM_EVENTS.focusout = true;
-                
-                //Stop them so we don't loose focus in the Editor
-                tmp.on('focusin', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-                
-                tmp.on('focusout', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-                tmp.on('click', function(ev) {
-                    YAHOO.util.Event.stopEvent(ev);
-                }, oButton, this);
-            }
-            if (this.browser.webkit) {
-                //This will keep the document from gaining focus and the editor from loosing it..
-                //Forcefully remove the focus calls in button!
-                tmp.hasFocus = function() {
-                    return true;
+                if (this.browser.ie) {
+                    //Add a couple of new events for IE
+                    tmp.DOM_EVENTS.focusin = true;
+                    tmp.DOM_EVENTS.focusout = true;
+                    
+                    //Stop them so we don't loose focus in the Editor
+                    tmp.on('focusin', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    
+                    tmp.on('focusout', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
                 }
-            }
-            this._buttonList[this._buttonList.length] = tmp;
-            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
-                if (Lang.isArray(oButton.menu)) {
-                    var menu = tmp.getMenu();
-                    menu.renderEvent.subscribe(_addMenuClasses, tmp);
-                    if (oButton.renderer) {
-                        menu.renderEvent.subscribe(oButton.renderer, tmp);
+                if (this.browser.webkit) {
+                    //This will keep the document from gaining focus and the editor from loosing it..
+                    //Forcefully remove the focus calls in button!
+                    tmp.hasFocus = function() {
+                        return true;
+                    };
+                }
+                this._buttonList[this._buttonList.length] = tmp;
+                if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                    if (Lang.isArray(oButton.menu)) {
+                        var menu = tmp.getMenu();
+                        if (menu.renderEvent) {
+                            menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                            if (oButton.renderer) {
+                                menu.renderEvent.subscribe(oButton.renderer, tmp);
+                            }
+                        }
                     }
                 }
             }
@@ -943,7 +1325,7 @@ var Dom = YAHOO.util.Dom,
                 this._queue[this._queue.length] = ['addSeparator', arguments];
                 return false;
             }
-            if (this._sepCount == null) {
+            if (this._sepCount === null) {
                 this._sepCount = 0;
             }
             if (!this._sep) {
@@ -1002,11 +1384,14 @@ var Dom = YAHOO.util.Dom,
                 }
             }
             html += '<span><em>X</em><strong></strong></span>';
-            picker.innerHTML = html;
-            var em = picker.getElementsByTagName('em')[0];
-            var strong = picker.getElementsByTagName('strong')[0];
+            window.setTimeout(function() {
+                picker.innerHTML = html;
+            }, 0);
 
             Event.on(picker, 'mouseover', function(ev) {
+                var picker = this._colorPicker;
+                var em = picker.getElementsByTagName('em')[0];
+                var strong = picker.getElementsByTagName('strong')[0];
                 var tar = Event.getTarget(ev);
                 if (tar.tagName.toLowerCase() == 'a') {
                     em.style.backgroundColor = tar.style.backgroundColor;
@@ -1023,7 +1408,16 @@ var Dom = YAHOO.util.Dom,
                 Event.stopEvent(ev);
                 var tar = Event.getTarget(ev);
                 if (tar.tagName.toLowerCase() == 'a') {
-                    this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    if (retVal !== false) {
+                        var info = {
+                            color: tar.innerHTML,
+                            colorName: this._colorData['#' + tar.innerHTML],
+                            value: this._colorPicker._button 
+                        };
+                    
+                        this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                    }
                     this.getButtonByValue(this._colorPicker._button).getMenu().hide();
                 }
             }, this, true);
@@ -1043,16 +1437,18 @@ var Dom = YAHOO.util.Dom,
         * @method _makeColorButton
         * @private
         * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
-        * @param {Object} _oButton <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} _oButton <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
         */
         _makeColorButton: function(_oButton) {
             if (!this._colorPicker) {   
                 this._createColorPicker(this.get('id'));
             }
             _oButton.type = 'color';
-            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visbile: false, position: 'absolute' });
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true });
             _oButton.menu.setBody('');
             _oButton.menu.render(this.get('cont'));
+            Dom.addClass(_oButton.menu.element, 'yui-button-menu');
+            Dom.addClass(_oButton.menu.element, 'yui-color-button-menu');
             _oButton.menu.beforeShowEvent.subscribe(function() {
                 _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
                 _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
@@ -1060,9 +1456,7 @@ var Dom = YAHOO.util.Dom,
                 this._resetColorPicker();
                 var _p = this._colorPicker;
                 if (_p.parentNode) {
-                    //if (_p.parentNode != _oButton.menu.body) {
-                        _p.parentNode.removeChild(_p);
-                    //}
+                    _p.parentNode.removeChild(_p);
                 }
                 _oButton.menu.setBody('');
                 _oButton.menu.appendToBody(_p);
@@ -1074,7 +1468,7 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _makeSpinButton
         * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
-        * @param {Object} _button <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} _button <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
         * @param {Object} oButton Object literal containing the buttons initial config
         */
         _makeSpinButton: function(_button, oButton) {
@@ -1118,7 +1512,7 @@ var Dom = YAHOO.util.Dom,
             var _intUp = function(ev) {
                 YAHOO.util.Event.stopEvent(ev);
                 if (!_button.get('disabled') && (ev.keyCode != 9)) {
-                    var value = parseInt(_button.get('label'));
+                    var value = parseInt(_button.get('label'), 10);
                     value++;
                     value = cleanVal(value);
                     _button.set('label', ''+value);
@@ -1135,7 +1529,7 @@ var Dom = YAHOO.util.Dom,
             var _intDown = function(ev) {
                 YAHOO.util.Event.stopEvent(ev);
                 if (!_button.get('disabled') && (ev.keyCode != 9)) {
-                    var value = parseInt(_button.get('label'));
+                    var value = parseInt(_button.get('label'), 10);
                     value--;
                     value = cleanVal(value);
 
@@ -1189,39 +1583,50 @@ var Dom = YAHOO.util.Dom,
             if (ev && ev.type == 'keypress') {
                 if (ev.keyCode == 9) {
                     doEvent = false;
-                } else if ((ev.keyCode == 13) || (ev.keyCode == 0) || (ev.keyCode == 32)) {
+                } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) {
                 } else {
                     doEvent = false;
                 }
             }
 
             if (doEvent) {
+                var fireNextEvent = true,
+                    retValue = false;
                 if (info.value) {
-                    this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
                 }
                 
-                if (info.menucmd) {
-                    this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                if (info.menucmd && fireNextEvent) {
+                    retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                if (fireNextEvent) {
+                    this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
                 }
-                
-                this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
 
                 if (info.type == 'select') {
                     var button = this.getButtonById(info.id);
-                    var txt = info.value;
-                    for (var i = 0; i < info.menu.length; i++) {
-                        if (info.menu[i].value == info.value) {
-                            txt = info.menu[i].text;
-                            break;
+                    if (button.buttonType == 'rich') {
+                        var txt = info.value;
+                        for (var i = 0; i < info.menu.length; i++) {
+                            if (info.menu[i].value == info.value) {
+                                txt = info.menu[i].text;
+                                break;
+                            }
                         }
-                    }
-                    button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
-                    var _items = button.getMenu().getItems();
-                    for (var m = 0; m < _items.length; m++) {
-                        if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
-                            _items[m].cfg.setProperty('checked', true);
-                        } else {
-                            _items[m].cfg.setProperty('checked', false);
+                        button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                                _items[m].cfg.setProperty('checked', true);
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
                         }
                     }
                 }
@@ -1234,7 +1639,7 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonById
         * @description Gets a button instance from the toolbar by is Dom id.
         * @param {String} id The Dom id to query for.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
         */
         getButtonById: function(id) {
             var len = this._buttonList.length;
@@ -1249,13 +1654,13 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonByValue
         * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
         * @param {String} value The button value to query for.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
         */
         getButtonByValue: function(value) {
             var _buttons = this.get('buttons');
             var len = _buttons.length;
             for (var i = 0; i < len; i++) {
-                if (_buttons[i].group != undefined) {
+                if (_buttons[i].group !== undefined) {
                     for (var m = 0; m < _buttons[i].buttons.length; m++) {
                         if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
                             return this.getButtonById(_buttons[i].buttons[m].id);
@@ -1273,8 +1678,8 @@ var Dom = YAHOO.util.Dom,
                         return this.getButtonById(_buttons[i].id);
                     }
                     if (_buttons[i].menu) { //Menu Button, loop through the values
-                        for (var s = 0; s < _buttons[i].menu.length; s++) {
-                            if (_buttons[i].menu[s].value == value) {
+                        for (var j = 0; j < _buttons[i].menu.length; j++) {
+                            if (_buttons[i].menu[j].value == value) {
                                 return this.getButtonById(_buttons[i].id);
                             }
                         }
@@ -1287,7 +1692,7 @@ var Dom = YAHOO.util.Dom,
         * @method getButtonByIndex
         * @description Gets a button instance from the toolbar by is index in _buttonList.
         * @param {Number} index The index of the button in _buttonList.
-        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
         */
         getButtonByIndex: function(index) {
             if (this._buttonList[index]) {
@@ -1307,17 +1712,21 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method disableButton
         * @description Disables a button in the toolbar.
-        * @param {String/Number} button Disable a button by it's id or index.
+        * @param {String/Number} id Disable a button by it's id, index or value.
         * @return {Boolean}
         */
-        disableButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        disableButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                 button.set('disabled', true);
             } else {
                 return false;
@@ -1326,18 +1735,27 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method enableButton
         * @description Enables a button in the toolbar.
-        * @param {String/Number} button Enable a button by it's id or index.
+        * @param {String/Number} id Enable a button by it's id, index or value.
         * @return {Boolean}
         */
-        enableButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        enableButton: function(id) {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
-                button.set('disabled', false);
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                if (button.get('disabled')) {
+                    button.set('disabled', false);
+                }
             } else {
                 return false;
             }
@@ -1345,28 +1763,34 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method selectButton
         * @description Selects a button in the toolbar.
-        * @param {String/Number} button select a button by it's id or index.
+        * @param {String/Number} id Select a button by it's id, index or value.
         * @return {Boolean}
         */
-        selectButton: function(button, value) {
-            if (button) {
-                if (Lang.isString(button)) {
-                    var button = this.getButtonById(button);
+        selectButton: function(id, value) {
+            var button = id;
+            if (id) {
+                if (Lang.isString(id)) {
+                    button = this.getButtonById(id);
+                }
+                if (Lang.isNumber(id)) {
+                    button = this.getButtonByIndex(id);
                 }
-                if (Lang.isNumber(button)) {
-                    var button = this.getButtonByIndex(button);
+                if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                    button = this.getButtonByValue(id);
                 }
-                if (button instanceof YAHOO.widget.Button) {
+                if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                     button.addClass('yui-button-selected');
                     button.addClass('yui-button-' + button.get('value') + '-selected');
                     if (value) {
-                        var _items = button.getMenu().getItems();
-                        for (var m = 0; m < _items.length; m++) {
-                            if (_items[m].value == value) {
-                                _items[m].cfg.setProperty('checked', true);
-                                button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
-                            } else {
-                                _items[m].cfg.setProperty('checked', false);
+                        if (button.buttonType == 'rich') {
+                            var _items = button.getMenu().getItems();
+                            for (var m = 0; m < _items.length; m++) {
+                                if (_items[m].value == value) {
+                                    _items[m].cfg.setProperty('checked', true);
+                                    button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                                } else {
+                                    _items[m].cfg.setProperty('checked', false);
+                                }
                             }
                         }
                     }
@@ -1378,17 +1802,21 @@ var Dom = YAHOO.util.Dom,
         /**
         * @method deselectButton
         * @description Deselects a button in the toolbar.
-        * @param {String/Number} button Deselect a button by it's id or index.
+        * @param {String/Number} id Deselect a button by it's id, index or value.
         * @return {Boolean}
         */
-        deselectButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        deselectButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
                 button.removeClass('yui-button-selected');
                 button.removeClass('yui-button-' + button.get('value') + '-selected');
                 button.removeClass('yui-button-hover');
@@ -1408,25 +1836,87 @@ var Dom = YAHOO.util.Dom,
             }
         },
         /**
+        * @method disableAllButtons
+        * @description Disables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        disableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.disableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method enableAllButtons
+        * @description Enables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        enableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.enableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method resetAllButtons
+        * @description Resets all buttons to their initial state.
+        * @param {Object} _ex Except these buttons
+        * @return {Boolean}
+        */
+        resetAllButtons: function(_ex) {
+            if (!Lang.isObject(_ex)) {
+                _ex = {};
+            }
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                var _button = this._buttonList[i];
+                var disabled = _button._configs.disabled._initialConfig.value;
+                if (_ex[_button.get('id')]) {
+                    this.enableButton(_button);
+                    this.selectButton(_button);
+                } else {
+                    if (disabled) {
+                        this.disableButton(_button);
+                    } else {
+                        this.enableButton(_button);
+                    }
+                    this.deselectButton(_button);
+                }
+            }
+        },
+        /**
         * @method destroyButton
         * @description Destroy a button in the toolbar.
-        * @param {String/Number} button Destroy a button by it's id or index.
+        * @param {String/Number} id Destroy a button by it's id or index.
         * @return {Boolean}
         */
-        destroyButton: function(button) {
-            if (Lang.isString(button)) {
-                var button = this.getButtonById(button);
+        destroyButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
             }
-            if (Lang.isNumber(button)) {
-                var button = this.getButtonByIndex(button);
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
             }
-            if (button instanceof YAHOO.widget.Button) {
-                var id = button.get('id');
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                var thisID = button.get('id');
                 button.destroy();
 
                 var len = this._buttonList.length;
                 for (var i = 0; i < len; i++) {
-                    if (this._buttonList[i].get('id') == id) {
+                    if (this._buttonList[i].get('id') == thisID) {
                         this._buttonList[i] = null;
                     }
                 }
@@ -1452,6 +1942,27 @@ var Dom = YAHOO.util.Dom,
             return true;
         },
         /**
+        * @method collapse
+        * @description Programatically collapse the toolbar.
+        * @param {Boolean} collapse True to collapse, false to expand.
+        */
+        collapse: function(collapse) {
+            var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+            if (collapse === false) {
+                Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                if (el[0]) {
+                    Dom.removeClass(el[0], 'collapsed');
+                }
+                this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+            } else {
+                if (el[0]) {
+                    Dom.addClass(el[0], 'collapsed');
+                }
+                Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+            }
+        },
+        /**
         * @method toString
         * @description Returns a string representing the toolbar.
         * @return {String}
@@ -1492,17 +2003,11 @@ var Dom = YAHOO.util.Dom,
 * @type YAHOO.util.CustomEvent
 */
 })();
-/*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-*/
 /**
- * @module editor
  * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
  * @namespace YAHOO.widget
- * @requires yahoo, dom, element, event, toolbar, container, menu, button
- * @optional dragdrop, animation
+ * @requires yahoo, dom, element, event, toolbar
+ * @optional animation, container_core
  * @beta
  */
 
@@ -1510,105 +2015,178 @@ http://developer.yahoo.net/yui/license.txt
 var Dom = YAHOO.util.Dom,
     Event = YAHOO.util.Event,
     Lang = YAHOO.lang,
-    DD = YAHOO.util.DD,
     Toolbar = YAHOO.widget.Toolbar;
 
-
     /**
      * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
      * @constructor
-     * @class Editor
+     * @class SimpleEditor
      * @extends YAHOO.util.Element
      * @param {String/HTMLElement} el The textarea element to turn into an editor.
      * @param {Object} attrs Object liternal containing configuration parameters.
     */
     
-    YAHOO.widget.Editor = function(el, attrs) {
+    YAHOO.widget.SimpleEditor = function(el, attrs) {
+        
+        var o = {};
+        if (Lang.isObject(el) && (!el.tagName) && !attrs) {
+            Lang.augmentObject(o, el); //Break the config reference
+            el = document.createElement('textarea');
+            this.DOMReady = true;
+            if (o.container) {
+                var c = Dom.get(o.container);
+                c.appendChild(el);
+            } else {
+                document.body.appendChild(el);
+            }
+        } else {
+            Lang.augmentObject(o, attrs); //Break the config reference
+        }
 
         var oConfig = {
             element: null,
-            attributes: (attrs || {})
-        }
+            attributes: o
+        }, id = null;
 
         if (Lang.isString(el)) {
-            oConfig.attributes.textarea = Dom.get(el);
+            id = el;
+        } else {
+            if (oConfig.attributes.id) {
+                id = oConfig.attributes.id;
+            } else {
+                id = Dom.generateId(el);
+            }
         }
-        
+        oConfig.element = el;
+
         var element_cont = document.createElement('DIV');
         oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
-            id: oConfig.attributes.textarea.id + '_container'
+            id: id + '_container'
         });
-        oConfig.attributes.element_cont.setStyle('display', 'none');
-
-        oConfig.element = oConfig.attributes.textarea;
-
         var div = document.createElement('div');
+        Dom.addClass(div, 'first-child');
         oConfig.attributes.element_cont.appendChild(div);
         
         if (!oConfig.attributes.toolbar_cont) {
             oConfig.attributes.toolbar_cont = document.createElement('DIV');
-            oConfig.attributes.toolbar_cont.id = oConfig.attributes.textarea.id + '_toolbar';
+            oConfig.attributes.toolbar_cont.id = id + '_toolbar';
             div.appendChild(oConfig.attributes.toolbar_cont);
         }
-        
-        if (!oConfig.attributes.iframe) {
-            oConfig.attributes.iframe = _createIframe(oConfig.attributes.textarea.id);
-            var editorWrapper = document.createElement('DIV');
-            editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));
-            div.appendChild(editorWrapper);
-        }
+        var editorWrapper = document.createElement('DIV');
+        div.appendChild(editorWrapper);
+        oConfig.attributes.editor_wrapper = editorWrapper;
 
-        Event.onDOMReady(function() {
-            this.DOMReady = true;
-            this.fireQueue();
-        }, this, true);
-
-        YAHOO.widget.Editor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
-    }
+        YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
 
     /**
-    * @private _cleanClassName
+    * @private
+    * @method _cleanClassName
     * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
     * @param {String} str The classname to clean up
-    * @returns {String}
+    * @return {String}
     */
     function _cleanClassName(str) {
         return str.replace(/ /g, '-').toLowerCase();
     }
 
-    /**
-    * @private _createIframe
-    * @description Creates the DOM and YUI Element for the iFrame editor area.
-    * @param {String} id The string ID to prefix the iframe with
-    * @returns {Object} iFrame object
-    */
-    function _createIframe(id) {
-        var ifrmID = id + '_editor';
-        var ifrmDom = document.createElement('iframe');
-        ifrmDom.id = ifrmID;
-        var config = {
-            border: '0',
-            frameBorder: '0',
-            marginWidth: '0',
-            marginHeight: '0',
-            leftMargin: '0',
-            topMargin: '0',
-            allowTransparency: 'true',
-            width: '100%',
-            src: 'javascript:false'
-        }
-        for (var i in config) {
-            if (Lang.hasOwnProperty(config, i)) {
-                ifrmDom.setAttribute(i, config[i]);
-            }
-        }
-
-        var ifrm = new YAHOO.util.Element(ifrmDom);
-        ifrm.setStyle('zIndex', '-1');
-        return ifrm;
-    }
 
-    YAHOO.extend(YAHOO.widget.Editor, YAHOO.util.Element, {
+    YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, {
+        /**
+        * @property _docType
+        * @description The DOCTYPE to use in the editable container.
+        * @type String
+        */
+        _docType: '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',
+        /**
+        * @property editorDirty
+        * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed.
+        * @type Boolean
+        */
+        editorDirty: null,
+        /**
+        * @property _defaultCSS
+        * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' }
+        * @type String
+        */
+        _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }',
+        /**
+        * @property _defaultToolbar
+        * @private
+        * @description Default toolbar config.
+        * @type Object
+        */
+        _defaultToolbar: null,
+        /**
+        * @property _lastButton
+        * @private
+        * @description The last button pressed, so we don't disable it.
+        * @type Object
+        */
+        _lastButton: null,
+        /**
+        * @property _baseHREF
+        * @private
+        * @description The base location of the editable page (this page) so that relative paths for image work.
+        * @type String
+        */
+        _baseHREF: function() {
+            var href = document.location.href;
+            if (href.indexOf('?') !== -1) { //Remove the query string
+                href = href.substring(0, href.indexOf('?'));
+            }
+            href = href.substring(0, href.lastIndexOf('/')) + '/';
+            return href;
+        }(),
+        /**
+        * @property _lastImage
+        * @private
+        * @description Safari reference for the last image selected (for styling as selected).
+        * @type HTMLElement
+        */
+        _lastImage: null,
+        /**
+        * @property _blankImageLoaded
+        * @private
+        * @description Don't load the blank image more than once..
+        * @type Boolean
+        */
+        _blankImageLoaded: null,
+        /**
+        * @property _fixNodesTimer
+        * @private
+        * @description Holder for the fixNodes timer
+        * @type Date
+        */
+        _fixNodesTimer: null,
+        /**
+        * @property _nodeChangeTimer
+        * @private
+        * @description Holds a reference to the nodeChange setTimeout call
+        * @type Number
+        */
+        _nodeChangeTimer: null,
+        /**
+        * @property _lastNodeChangeEvent
+        * @private
+        * @description Flag to determine the last event that fired a node change
+        * @type Event
+        */
+        _lastNodeChangeEvent: null,
+        /**
+        * @property _lastNodeChange
+        * @private
+        * @description Flag to determine when the last node change was fired
+        * @type Date
+        */
+        _lastNodeChange: 0,
+        /**
+        * @property _rendered
+        * @private
+        * @description Flag to determine if editor has been rendered or not
+        * @type Boolean
+        */
+        _rendered: null,
         /**
         * @property DOMReady
         * @private
@@ -1667,7 +2245,7 @@ var Dom = YAHOO.util.Dom,
         * @description A reference to the current working element in the editor
         * @type Array
         */
-        currentElement: [],
+        currentElement: null,
         /**
         * @property dompath
         * @description A reference to the dompath container for writing the current working dom path to.
@@ -1688,7 +2266,7 @@ var Dom = YAHOO.util.Dom,
         afterElement: null,
         /**
         * @property invalidHTML
-        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine.
         * @type Object
         */
         invalidHTML: {
@@ -1699,6 +2277,7 @@ var Dom = YAHOO.util.Dom,
             link: true,
             html: true,
             body: true,
+            iframe: true,
             script: true,
             style: true,
             textarea: true
@@ -1728,7 +2307,7 @@ var Dom = YAHOO.util.Dom,
         * @description The Toolbar items that should be disabled if there is no selection present in the editor.
         * @type Array
         */
-        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent', 'outdent' ],
+        _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ],
         /**
         * @private
         * @property _alwaysDisabled
@@ -1742,7 +2321,7 @@ var Dom = YAHOO.util.Dom,
         * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
         * @type Object
         */
-        _alwaysEnabled: { hiddenelements: true },
+        _alwaysEnabled: { },
         /**
         * @private
         * @property _semantic
@@ -1762,24 +2341,97 @@ var Dom = YAHOO.util.Dom,
             'i': 'italic',
             'em': 'italic',
             'u': 'underline',
-            'blockquote': 'formatblock',
             'sup': 'superscript',
             'sub': 'subscript',
             'img': 'insertimage',
             'a' : 'createlink',
             'ul' : 'insertunorderedlist',
-            'ol' : 'insertorderedlist',
-            'indent' : 'indent',
-            'outdent' : 'outdent'
+            'ol' : 'insertorderedlist'
         },
+
         /**
-        * @private
-        * @method _getDoc
-        * @description Get the Document of the IFRAME
-        * @return {Object}
-        */
-        _getDoc: function() {
-            //if (this.get && this.get('iframe') && this.get('iframe').get && this.get('iframe').get('element') && this.get('iframe').get('element').contentWindow && this.get('iframe').get('element').contentWindow.document) {
+        * @private _createIframe
+        * @description Creates the DOM and YUI Element for the iFrame editor area.
+        * @param {String} id The string ID to prefix the iframe with
+        * @return {Object} iFrame object
+        */
+        _createIframe: function() {
+            var ifrmDom = document.createElement('iframe');
+            ifrmDom.id = this.get('id') + '_editor';
+            var config = {
+                border: '0',
+                frameBorder: '0',
+                marginWidth: '0',
+                marginHeight: '0',
+                leftMargin: '0',
+                topMargin: '0',
+                allowTransparency: 'true',
+                width: '100%'
+            };
+            if (this.get('autoHeight')) {
+                config.scrolling = 'no';
+            }
+            for (var i in config) {
+                if (Lang.hasOwnProperty(config, i)) {
+                    ifrmDom.setAttribute(i, config[i]);
+                }
+            }
+            var isrc = 'javascript:;';
+            if (this.browser.ie) {
+                isrc = 'about:blank';
+            }
+            ifrmDom.setAttribute('src', isrc);
+            var ifrm = new YAHOO.util.Element(ifrmDom);
+            //ifrm.setStyle('zIndex', '-1');
+            return ifrm;
+        },
+        /**
+        * @private _isElement
+        * @description Checks to see if an Element reference is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return {Boolean}
+        */
+        _isElement: function(el, tag) {
+            if (el && el.tagName && (el.tagName.toLowerCase() == tag)) {
+                return true;
+            }
+            if (el && el.getAttribute && (el.getAttribute('tag') == tag)) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private _hasParent
+        * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return HTMLElement
+        */
+        _hasParent: function(el, tag) {
+            if (!el || !el.parentNode) {
+                return false;
+            }
+            
+            while (el.parentNode) {
+                if (this._isElement(el, tag)) {
+                    return el;
+                }
+                if (el.parentNode) {
+                    el = el.parentNode;
+                } else {
+                    return false;
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
+        */
+        _getDoc: function() {
             var value = false;
             if (this.get) {
                 if (this.get('iframe')) {
@@ -1789,6 +2441,7 @@ var Dom = YAHOO.util.Dom,
                                 if (this.get('iframe').get('element').contentWindow) {
                                     if (this.get('iframe').get('element').contentWindow.document) {
                                         value = this.get('iframe').get('element').contentWindow.document;
+                                        return value;
                                     }
                                 }
                             } catch (e) {}
@@ -1796,7 +2449,7 @@ var Dom = YAHOO.util.Dom,
                     }
                 }
             }
-            return value;
+            return false;
         },
         /**
         * @private
@@ -1822,17 +2475,21 @@ var Dom = YAHOO.util.Dom,
                     * @description Can't get Safari to place the cursor at the beginning of the text..
                     * This workaround at least set's the toolbar into the proper state.
                     */
-                    this._getSelection().setBaseAndExtent(this._getDoc().body, 0, this._getDoc().body, 1);
-                    this._getSelection().collapse(false);   
+                    this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild, 0, this._getDoc().body.firstChild, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
                 } else {
                     this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
-                    this._getSelection().collapse(false);   
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
                 }
                 this._getWindow().focus();
-                //Check for.webkit3
-                if (this._getDoc().queryCommandEnabled('insertimage')) {
-                    this.browser.webkit3 = true;
-                }
             } else {
                 this._getWindow().focus();
             }
@@ -1841,13 +2498,17 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _hasSelection
         * @description Determines if there is a selection in the editor document.
-        * @returns {Boolean}
+        * @return {Boolean}
         */
         _hasSelection: function() {
             var sel = this._getSelection();
             var range = this._getRange();
             var hasSel = false;
 
+            if (!sel || !range) {
+                return hasSel;
+            }
+
             //Internet Explorer
             if (this.browser.ie || this.browser.opera) {
                 if (range.text) {
@@ -1857,8 +2518,14 @@ var Dom = YAHOO.util.Dom,
                     hasSel = true;
                 }
             } else {
-                if ((sel != '') && (sel != undefined)) {
-                    hasSel = true;
+                if (this.browser.webkit) {
+                    if (sel+'' !== '') {
+                        hasSel = true;
+                    }
+                } else {
+                    if (sel && (sel.toString() !== '') && (sel !== undefined)) {
+                        hasSel = true;
+                    }
                 }
             }
             return hasSel;
@@ -1867,7 +2534,7 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getSelection
         * @description Handles the different selection objects across the A-Grade list.
-        * @returns {Object} Selection Object
+        * @return {Object} Selection Object
         */
         _getSelection: function() {
             var _sel = null;
@@ -1880,19 +2547,18 @@ var Dom = YAHOO.util.Dom,
                 //Handle Safari's lack of Selection Object
                 if (this.browser.webkit) {
                     if (_sel.baseNode) {
-                            this._selection = new Object();
+                            this._selection = {};
                             this._selection.baseNode = _sel.baseNode;
                             this._selection.baseOffset = _sel.baseOffset;
                             this._selection.extentNode = _sel.extentNode;
                             this._selection.extentOffset = _sel.extentOffset;
-                    } else if (this._selection != null) {
+                    } else if (this._selection !== null) {
                         _sel = this._getWindow().getSelection();
                         _sel.setBaseAndExtent(
                             this._selection.baseNode,
                             this._selection.baseOffset,
                             this._selection.extentNode,
-                            this._selection.extentOffset
-                        );
+                            this._selection.extentOffset);
                         this._selection = null;
                     }
                 }
@@ -1901,14 +2567,49 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @private
+        * @method _selectNode
+        * @description Places the highlight around a given node
+        * @param {HTMLElement} node The node to select
+        */
+        _selectNode: function(node) {
+            if (!node) {
+                return false;
+            }
+            var sel = this._getSelection(),
+                range = null;
+
+            if (this.browser.ie) {
+                try { //IE freaks out here sometimes..
+                    range = this._getDoc().body.createTextRange();
+                    range.moveToElementText(node);
+                    range.select();
+                } catch (e) {
+                }
+            } else if (this.browser.webkit) {
+                               sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+            } else if (this.browser.opera) {
+                sel = this._getWindow().getSelection();
+                range = this._getDoc().createRange();
+                range.selectNode(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            } else {
+                range = this._getDoc().createRange();
+                range.selectNodeContents(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            }
+        },
+        /**
+        * @private
         * @method _getRange
         * @description Handles the different range objects across the A-Grade list.
-        * @returns {Object} Range Object
+        * @return {Object} Range Object
         */
-        _getRange: function(sel) {
+        _getRange: function() {
             var sel = this._getSelection();
 
-            if (sel == null) {
+            if (sel === null) {
                 return null;
             }
 
@@ -1924,7 +2625,11 @@ var Dom = YAHOO.util.Dom,
             }
 
             if (this.browser.ie || this.browser.opera) {
-                return sel.createRange();
+                try {
+                    return sel.createRange();
+                } catch (e) {
+                    return null;
+                }
             }
 
             if (sel.rangeCount > 0) {
@@ -1940,17 +2645,24 @@ var Dom = YAHOO.util.Dom,
         */
         _setDesignMode: function(state) {
             try {
-                this._getDoc().designMode = state;
+                var set = true;
+                //SourceForge Bug #1807057
+                if (this.browser.ie && (state.toLowerCase() == 'off')) {
+                    set = false;
+                }
+                if (set) {
+                    this._getDoc().designMode = state;
+                }
             } catch(e) { }
         },
         /**
         * @private
         * @method _toggleDesignMode
         * @description Toggles the designMode of the iFrame document on and off.
-        * @returns {String} The state that it was set to.
+        * @return {String} The state that it was set to.
         */
         _toggleDesignMode: function() {
-            var _dMode = this._getDoc().designMode,
+            var _dMode = this._getDoc().designMode.toLowerCase(),
                 _state = 'on';
             if (_dMode == 'on') {
                 _state = 'off';
@@ -1967,25 +2679,39 @@ var Dom = YAHOO.util.Dom,
             if (this.browser.ie) {
                 this._getDoc().body.style.margin = '0';
             }
-            this._setDesignMode('on');
+            if (!this.get('disabled')) {
+                if (this._getDoc().designMode.toLowerCase() != 'on') {
+                    this._setDesignMode('on');
+                    this._contentTimerCounter = 0;
+                }
+            }
+            if (!this._getDoc().body) {
+                this._contentTimerCounter = 0;
+                this._checkLoaded();
+                return false;
+            }
             
             this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
             //Setup Listeners on iFrame
-            Event.addListener(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
-            Event.addListener(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
-            Event.addListener(this._getDoc(), 'click', this._handleClick, this, true);
-            Event.addListener(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
-            Event.addListener(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
-            Event.addListener(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
-            Event.addListener(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
-            this.toolbar.set('disabled', false);
+            Event.on(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.on(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.on(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.on(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.on(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.on(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.on(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            if (!this.get('disabled')) {
+                this.toolbar.set('disabled', false);
+            }
             this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
             if (this.get('dompath')) {
                 var self = this;
-                window.setTimeout(function() {
+                setTimeout(function() {
                     self._writeDomPath.call(self);
                 }, 150);
             }
+            this.nodeChange(true);
+            this._setBusy(true);
         },
         /**
         * @private
@@ -1995,25 +2721,34 @@ var Dom = YAHOO.util.Dom,
         _checkLoaded: function() {
             this._contentTimerCounter++;
             if (this._contentTimer) {
-                window.clearTimeout(this._contentTimer);
+                clearTimeout(this._contentTimer);
             }
-            if (this._contentTimerCounter > 250) {
-                alert('ERROR: Body Did Not load');
+            if (this._contentTimerCounter > 500) {
                 return false;
             }
-            if (this._getDoc() && this._getDoc().body && (this._getDoc().body._rteLoaded == true)) {
-                //The onload event has fired, clean up after ourselves and fire the _initEditor method
-                /*
-                if (!this.browser.ie) {
-                    //IE Doesn't like this..
-                    delete this._getDoc().body._rteLoaded;
-                    this._getDoc().body.removeAttribute('onload');
+            var init = false;
+            try {
+                if (this._getDoc() && this._getDoc().body) {
+                    if (this.browser.ie) {
+                        if (this._getDoc().body.readyState == 'complete') {
+                            init = true;
+                        }
+                    } else {
+                        if (this._getDoc().body._rteLoaded === true) {
+                            init = true;
+                        }
+                    }
                 }
-                */
+            } catch (e) {
+                init = false;
+            }
+
+            if (init === true) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
                 this._initEditor();
             } else {
                 var self = this;
-                this._contentTimer = window.setTimeout(function() {
+                this._contentTimer = setTimeout(function() {
                     self._checkLoaded.call(self);
                 }, 20);
             }
@@ -2024,18 +2759,36 @@ var Dom = YAHOO.util.Dom,
         * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
         */
         _setInitialContent: function() {
-            var title = this.STR_TITLE;
-            var html = this.get('html');
-            html = html.replace('{TITLE}', title);
-            html = html.replace('{CONTENT}', this.get('textarea').value);
-            html = html.replace('{CSS}', this.get('css'));
-            html = html.replace('{HIDDEN_CSS}', this.get('hiddencss'));
-
-            this._getDoc().open();
-            this._getDoc().write(html);
-            this._getDoc().close();
-            
-            this._checkLoaded();   
+            var html = Lang.substitute(this.get('html'), {
+                TITLE: this.STR_TITLE,
+                CONTENT: this._cleanIncomingHTML(this.get('element').value),
+                CSS: this.get('css'),
+                HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'),
+                EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */')
+            }),
+            check = true;
+            if (document.compatMode != 'BackCompat') {
+                html = this._docType + "\n" + html;
+            } else {
+            }
+
+            if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) {
+                //Firefox 1.5 doesn't like setting designMode on an document created with a data url
+                try {
+                    this._getDoc().open();
+                    this._getDoc().write(html);
+                    this._getDoc().close();
+                } catch (e) {
+                    //Safari will only be here if we are hidden
+                    check = false;
+                }
+            } else {
+                //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality
+                this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html);
+            }
+            if (check) {
+                this._checkLoaded();
+            }
         },
         /**
         * @private
@@ -2052,6 +2805,7 @@ var Dom = YAHOO.util.Dom,
                     this._setEditorStyle(false);
                     break;
                 case 'semantic':
+                case 'xhtml':
                     if (this._semantic[action]) {
                         this._setEditorStyle(false);
                     } else {
@@ -2074,26 +2828,34 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getSelectedElement
         * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
-        * @returns {HTMLElement} The currently selected element.
+        * @return {HTMLElement} The currently selected element.
         */
         _getSelectedElement: function() {
-            var doc = this._getDoc();
+            var doc = this._getDoc(),
+                range = null,
+                sel = null,
+                elm = null;
+
             if (this.browser.ie) {
-                var range = this._getRange(), elm = null;
+                this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event;
+                range = this._getRange();
                 if (range) {
                     elm = range.item ? range.item(0) : range.parentElement();
                     if (elm == doc.body) {
                         elm = null;
                     }
                 }
+                if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
             } else {
-                var sel = this._getSelection(),
-                    range = this._getRange(),
-                    elm = null;
+                sel = this._getSelection();
+                range = this._getRange();
+
                 if (!sel || !range) {
                     return null;
                 }
-                if (sel != '') {
+                if (!this._hasSelection()) {
                     if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
                         if (sel.anchorNode.parentNode) { //next check parentNode
                             elm = sel.anchorNode.parentNode;
@@ -2102,11 +2864,9 @@ var Dom = YAHOO.util.Dom,
                             elm = sel.anchorNode.nextSibling;
                         }
                     }
-                    
-                    if (elm && elm.tagName && (elm.tagName.toLowerCase() == 'br')) {
+                    if (this._isElement(elm, 'br')) {
                         elm = null;
                     }
-                
                     if (!elm) {
                         elm = range.commonAncestorContainer;
                         if (!range.collapsed) {
@@ -2119,67 +2879,78 @@ var Dom = YAHOO.util.Dom,
                             }
                         }
                     }
-                    //Safari Fix
-                    if (!elm) {
-                        if (this.currentEvent) {
-                            //elm = Event.getTarget(this.currentEvent);
-                        }
-                    }
                 }
             }
-            if (!elm && (this.currentElement[0] || this.currentEvent)) {
-                if (this.currentEvent && (this.currentEvent.keyCode == undefined) && Event.getTarget(this.currentEvent)) {
-                    elm = Event.getTarget(this.currentEvent);
-                } else if (this.currentEvent && (this.currentEvent.keyCode != undefined) && Event.getTarget(this.currentEvent)) {
-                } else {
-                    elm = this.currentElement[0];
+            if (this.currentEvent !== null) {
+                try {
+                    switch (this.currentEvent.type) {
+                        case 'click':
+                        case 'mousedown':
+                        case 'mouseup':
+                            elm = Event.getTarget(this.currentEvent);
+                            break;
+                        default:
+                            //Do nothing
+                            break;
+                    }
+                } catch (e) {
                 }
-            } else if ((elm == this._getDoc().body) && this.currentElement[0] && !this._hasSelection()) {
+            } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) {
                 elm = this.currentElement[0];
             }
-
             if (this.browser.opera || this.browser.webkit) {
                 if (this.currentEvent && !elm) {
-                    elm = Event.getTarget(this.currentEvent);
+                    elm = YAHOO.util.Event.getTarget(this.currentEvent);
                 }
             }
-
             if (!elm || !elm.tagName) {
                 elm = doc.body;
             }
-            if (elm && elm.tagName && elm.tagName.toLowerCase() == 'html') {
+            if (this._isElement(elm, 'html')) {
                 //Safari sometimes gives us the HTML node back..
                 elm = doc.body;
             }
-            
+            if (this._isElement(elm, 'body')) {
+                //make sure that body means this body not the parent..
+                elm = doc.body;
+            }
+            if (elm && !elm.parentNode) { //Not in document
+                elm = doc.body;
+            }
+            if (elm === undefined) {
+                elm = null;
+            }
             return elm;
         },
         /**
         * @private
         * @method _getDomPath
         * @description This method will attempt to build the DOM path from the currently selected element.
-        * @returns {Array} An array of node references that will create the DOM Path.
+        * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used
+        * @return {Array} An array of node references that will create the DOM Path.
         */
-        _getDomPath: function() {
-                       var el = this._getSelectedElement();
+        _getDomPath: function(el) {
+            if (!el) {
+                           el = this._getSelectedElement();
+            }
                        var domPath = [];
-                       
-                       while (el!= null) {
+            while (el !== null) {
                 if (el.ownerDocument != this._getDoc()) {
-                    return false;
+                    el = null;
+                    break;
                 }
                 //Check to see if we get el.nodeName and nodeType
-                if (el.nodeName && (el.nodeType == 1)) {
+                if (el.nodeName && el.nodeType && (el.nodeType == 1)) {
                     domPath[domPath.length] = el;
                 }
 
-                if (el.nodeName.toUpperCase() == "BODY") {
-                                   break;
+                if (this._isElement(el, 'body')) {
+                    break;
                 }
 
-                               el = el.parentNode;
-                       }
-            if (domPath.length == 0) {
+                el = el.parentNode;
+            }
+            if (domPath.length === 0) {
                 if (this._getDoc() && this._getDoc().body) {
                     domPath[0] = this._getDoc().body;
                 }
@@ -2193,7 +2964,9 @@ var Dom = YAHOO.util.Dom,
         */
         _writeDomPath: function() { 
             var path = this._getDomPath(),
-                pathArr = [];
+                pathArr = [],
+                classPath = '',
+                pathStr = '';
             for (var i = 0; i < path.length; i++) {
                 var tag = path[i].tagName.toLowerCase();
                 if ((tag == 'ol') && (path[i].type)) {
@@ -2202,7 +2975,7 @@ var Dom = YAHOO.util.Dom,
                 if (Dom.hasClass(path[i], 'yui-tag')) {
                     tag = path[i].getAttribute('tag');
                 }
-                if ((this.get('markup') == 'semantic')) {
+                if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) {
                     switch (tag) {
                         case 'b': tag = 'strong'; break;
                         case 'i': tag = 'em'; break;
@@ -2210,21 +2983,37 @@ var Dom = YAHOO.util.Dom,
                 }
                 if (!Dom.hasClass(path[i], 'yui-non')) {
                     if (Dom.hasClass(path[i], 'yui-tag')) {
-                        var pathStr = tag;
-                        if (tag == 'a') {
-                            if (path[i].getAttribute('href')) {
-                                pathStr += ':' + path[i].getAttribute('href').replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
-                            }
-                        }
+                        pathStr = tag;
                     } else {
-                        var classPath = ((path[i].className != '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : '');
                         if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
                             classPath = '';
                         }
-                        var pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                        pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                    }
+                    switch (tag) {
+                        case 'a':
+                            if (path[i].getAttribute('href', 2)) {
+                                pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                            break;
+                        case 'img':
+                            var h = path[i].height;
+                            var w = path[i].width;
+                            if (path[i].style.height) {
+                                h = parseInt(path[i].style.height, 10);
+                            }
+                            if (path[i].style.width) {
+                                w = parseInt(path[i].style.width, 10);
+                            }
+                            pathStr += '(' + h + 'x' + w + ')';
+                        break;
                     }
+
                     if (pathStr.length > 10) {
-                        pathStr = pathStr.substring(0, 10) + '...';
+                        pathStr = '<span title="' + pathStr + '">' + pathStr.substring(0, 10) + '...' + '</span>';
+                    } else {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr + '</span>';
                     }
                     pathArr[pathArr.length] = pathStr;
                 }
@@ -2241,73 +3030,73 @@ var Dom = YAHOO.util.Dom,
         * @description Fix href and imgs as well as remove invalid HTML.
         */
         _fixNodes: function() {
-            for (var i in this.invalidHTML) {
-                if (Lang.hasOwnProperty(this.invalidHTML, i)) {
-                    var tags = this._getDoc().body.getElementsByTagName(i);
-                    for (var h = 0; h < tags.length; h++) {
-                        if (tags[h].parentNode) {
-                            tags[h].parentNode.removeChild(tags[h]);
+            var doc = this._getDoc(),
+                els = [];
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (v.toLowerCase() != 'span') {
+                        var tags = doc.body.getElementsByTagName(v);
+                        if (tags.length) {
+                            for (var i = 0; i < tags.length; i++) {
+                                els.push(tags[i]);
+                            }
                         }
                     }
                 }
             }
-            var as = this._getDoc().body.getElementsByTagName('a');
-            if (as.length) {
-                for (var i = 0; i < as.length; i++) {
-                    var el = this._getDoc().createElement('span');
-                    Dom.addClass(el, 'yui-tag-a');
-                    Dom.addClass(el, 'yui-tag');
-                    el.innerHTML = as[i].innerHTML;
-                    el.setAttribute('tag', 'a');
-                    el.setAttribute('href', as[i].getAttribute('href'));
-                    if (as[i].getAttribute('target') != null) {
-                        el.setAttribute('target', as[i].getAttribute('target'));
-                    }
-                    as[i].parentNode.replaceChild(el, as[i]);
-                    as[i] = null;
-                }
-            }
-            var imgs = this._getDoc().getElementsByTagName('img');
-            Dom.addClass(imgs, 'yui-img');
-
-            for (var i = 0; i < imgs.length; i++) {
-                if (imgs[i].getAttribute('href', 2)) {
-                    var url = imgs[i].getAttribute('src', 2);
-                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                        Dom.addClass(imgs[i], this.CLASS_LOCAL_FILE);
-                    } else {
-                        Dom.removeClass(imgs[i], this.CLASS_LOCAL_FILE);
-                    }
-                }
-            }
-
-            var fakeAs = this._getDoc().body.getElementsByTagName('span');
-            for (var i = 0; i < fakeAs.length; i++) {
-                if (fakeAs[i].getAttribute('href', 2)) {
-                    var url = fakeAs[i].getAttribute('href', 2);
-                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                        Dom.addClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+            for (var h = 0; h < els.length; h++) {
+                if (els[h].parentNode) {
+                    if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) {
+                        this._swapEl(els[h], 'span', function(el) {
+                            el.className = 'yui-non';
+                        });
                     } else {
-                        Dom.removeClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                        els[h].parentNode.removeChild(els[h]);
                     }
                 }
             }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');   
         },
         /**
         * @private
-        * @method _showHidden
-        * @description Toggle on/off the hidden.css file.
-        */
-        _showHidden: function() {
-            if (this._showingHiddenElements) {
-                this._showingHiddenElements = false;
-                this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));
-                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
-            } else {
-                this._showingHiddenElements = true;
-                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
-                this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));
+        * @method _isNonEditable
+        * @param Event ev The Dom event being checked
+        * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied.
+        * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also
+        * disable and enable the Editor's toolbar based on the noedit state.
+        * @return Boolean
+        */
+        _isNonEditable: function(ev) {
+            if (this.get('allowNoEdit')) {
+                var el = Event.getTarget(ev);
+                if (this._isElement(el, 'html')) {
+                    el = null;
+                }
+                var path = this._getDomPath(el);
+                for (var i = (path.length - 1); i > -1; i--) {
+                    if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) {
+                        //if (this.toolbar.get('disabled') === false) {
+                        //    this.toolbar.set('disabled', true);
+                        //}
+                        try {
+                             this._getDoc().execCommand('enableObjectResizing', false, 'false');
+                        } catch (e) {}
+                        this.nodeChange();
+                        Event.stopEvent(ev);
+                        return true;
+                    }
+                }
+                //if (this.toolbar.get('disabled') === true) {
+                    //Should only happen once..
+                    //this.toolbar.set('disabled', false);
+                    try {
+                         this._getDoc().execCommand('enableObjectResizing', false, 'true');
+                    } catch (e) {}
+                //}
             }
+            return false;
         },
         /**
         * @private
@@ -2316,8 +3105,6 @@ var Dom = YAHOO.util.Dom,
         * @description Sets the current event property
         */
         _setCurrentEvent: function(ev) {
-            if (ev && ev.type) {
-            }
             this.currentEvent = ev;
         },
         /**
@@ -2327,11 +3114,23 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all click events inside the iFrame document.
         */
         _handleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             if (this.currentWindow) {
                 this.closeWindow();
             }
-            if (!this.browser.webkit) {
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this.browser.webkit) {
+                var tar =Event.getTarget(ev);
+                if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) {
+                    Event.stopEvent(ev);
+                    this.nodeChange();
+                }
+            } else {
                 this.nodeChange();
             }
         },
@@ -2342,7 +3141,13 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all mouseup events inside the iFrame document.
         */
         _handleMouseUp: function(ev) {
-            this._setCurrentEvent(ev);
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            //Don't set current event for mouseup.
+            //It get's fired after a menu is closed and gives up a bogus event to work with
+            //this._setCurrentEvent(ev);
+            var self = this;
             if (this.browser.opera) {
                 /**
                 * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
@@ -2350,9 +3155,8 @@ var Dom = YAHOO.util.Dom,
                 * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
                 */
                 var sel = Event.getTarget(ev);
-                if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                if (this._isElement(sel, 'img')) {
                     this.nodeChange();
-                    var self = this;
                     if (this.operaEvent) {
                         clearTimeout(this.operaEvent);
                         this.operaEvent = null;
@@ -2360,7 +3164,7 @@ var Dom = YAHOO.util.Dom,
                     } else {
                         this.operaEvent = window.setTimeout(function() {
                             self.operaEvent = false;
-                        }, 200);
+                        }, 700);
                     }
                 }
             }
@@ -2369,7 +3173,7 @@ var Dom = YAHOO.util.Dom,
                 if (this.browser.webkit) {
                     Event.stopEvent(ev);
                 }
-            }            
+            }
             this.nodeChange();
             this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
         },
@@ -2380,15 +3184,33 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all mousedown events inside the iFrame document.
         */
         _handleMouseDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             var sel = Event.getTarget(ev);
-            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+            if (this.browser.webkit && this._hasSelection()) {
+                var _sel = this._getSelection();
+                if (!this.browser.webkit3) {
+                    _sel.collapse(true);
+                } else {
+                    _sel.collapseToStart();
+                }
+            }
+            if (this.browser.webkit && this._lastImage) {
+                Dom.removeClass(this._lastImage, 'selected');
+                this._lastImage = null;
+            }
+            if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) {
                 if (this.browser.webkit) {
-                    this.nodeChange();
                     Event.stopEvent(ev);
+                    if (this._isElement(sel, 'img')) {
+                        Dom.addClass(sel, 'selected');
+                        this._lastImage = sel;
+                    }
                 }
+                this.nodeChange();
             }
-            //this.nodeChange();
             this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
         },
         /**
@@ -2398,18 +3220,22 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all doubleclick events inside the iFrame document.
         */
         _handleDoubleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             var sel = Event.getTarget(ev);
-            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+            if (this._isElement(sel, 'img')) {
                 this.currentElement[0] = sel;
                 this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
                 this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-            } else if (sel && sel.getAttribute && sel.getAttribute('tag') && (sel.getAttribute('tag').toLowerCase() == 'a')) {
-                this.currentElement[0] = sel;
+            } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a
+                this.currentElement[0] = this._hasParent(sel, 'a');
                 this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
                 this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
             }
             this.nodeChange();
+            this.editorDirty = false;
             this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
         },
         /**
@@ -2419,6 +3245,9 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all keyup events inside the iFrame document.
         */
         _handleKeyUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
             switch (ev.keyCode) {
                 case 37: //Left Arrow
@@ -2427,12 +3256,24 @@ var Dom = YAHOO.util.Dom,
                 case 40: //Down Arrow
                 case 46: //Forward Delete
                 case 8: //Delete
-                case 65: //The letter a (for ctrl + a and cmd + a)
-                case 27: //Escape key if window is open
-                    if ((ev.keyCode == 27) && this.currentWindow) {
+                case 87: //W key if window is open
+                    if ((ev.keyCode == 87) && this.currentWindow && ev.shiftKey && ev.ctrlKey) {
                         this.closeWindow();
+                    } else {
+                        if (!this.browser.ie) {
+                            if (this._nodeChangeTimer) {
+                                clearTimeout(this._nodeChangeTimer);
+                            }
+                            var self = this;
+                            this._nodeChangeTimer = setTimeout(function() {
+                                self._nodeChangeTimer = null;
+                                self.nodeChange.call(self);
+                            }, 100);
+                        } else {
+                            this.nodeChange();
+                        }
+                        this.editorDirty = true;
                     }
-                    this.nodeChange();
                     break;
             }
             this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
@@ -2444,56 +3285,226 @@ var Dom = YAHOO.util.Dom,
         * @description Handles all keypress events inside the iFrame document.
         */
         _handleKeyPress: function(ev) {
+            if (this.get('allowNoEdit')) {
+                if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) {
+                    //Forward delete key
+                    Event.stopEvent(ev);
+                }
+            }
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
             this._setCurrentEvent(ev);
+            if (this.browser.webkit) {
+                if (!this.browser.webkit3) {
+                    if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) {
+                        //This is CMD + z (for undo)
+                        if (this._hasParent(this._getSelectedElement(), 'li')) {
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+                /* This was removed because it crashes Safari 2.x in some cases
+                if (ev.keyCode && (ev.keyCode == 8)) {
+                    //Delete Key
+                    if (this._isElement(this._getSelectedElement(), 'br')) {
+                        var el = this._getSelectedElement();
+                        el.parentNode.removeChild(el);
+                    }
+                }
+                */
+                this._listFix(ev);
+            }
             this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
         },
         /**
         * @private
-        * @method _handleKeyDown
+        * @method _listFix
         * @param {Event} ev The event we are working on.
-        * @description Handles all keydown events inside the iFrame document.
+        * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items.
         */
-        _handleKeyDown: function(ev) {
-            this._setCurrentEvent(ev);
-            if (this.currentWindow) {
-                this.closeWindow();
-            }
-            var doExec = false;
-            var action = null;
-            //if (ev.ctrlKey) {
-            if (ev.shiftKey && ev.ctrlKey) {
-                doExec = true;
-            }
-            switch (ev.keyCode) {
-                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
-                    if (ev.shiftKey && ev.ctrlKey) {
-                        this.toolbar._titlebar.firstChild.focus();
+        _listFix: function(ev) {
+            var testLi = null, par = null, preContent = false, range = null;
+            //Enter Key
+            if (this.browser.webkit) {
+                if (ev.keyCode && (ev.keyCode == 13)) {
+                    if (this._hasParent(this._getSelectedElement(), 'li')) {
+                        var tar = this._hasParent(this._getSelectedElement(), 'li');
+                        var li = this._getDoc().createElement('li');
+                        li.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        if (tar.nextSibling) {
+                            tar.parentNode.insertBefore(li, tar.nextSibling);
+                        } else {
+                            tar.parentNode.appendChild(li);
+                        }
+                        this.currentElement[0] = li;
+                        this._selectNode(li.firstChild);
+                        if (!this.browser.webkit3) {
+                            tar.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                tar.parentNode.style.display = 'block';
+                            }, 1);
+                        }
                         Event.stopEvent(ev);
-                        doExec = false;
                     }
-                    break;
-                case 27: //Focus After Element - Ctrl + Shift + Esc
-                    if (ev.shiftKey) {
-                        this.afterElement.focus();
-                        Event.stopEvent(ev);
-                        exec = false;
+                }
+            }
+            //Shift + Tab Key
+            if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) {
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    testLi = this._hasParent(testLi, 'li');
+                    if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) {
+                        par = this._hasParent(testLi, 'ul');
+                        if (!par) {
+                            par = this._hasParent(testLi, 'ol');
+                        }
+                        if (this._isElement(par.previousSibling, 'li')) {
+                            par.removeChild(testLi);
+                            par.parentNode.insertBefore(testLi, par.nextSibling);
+                            if (this.browser.ie) {
+                                range = this._getDoc().body.createTextRange();
+                                range.moveToElementText(testLi);
+                                range.collapse(false);
+                                range.select();
+                            }
+                            if (this.browser.webkit) {
+                                if (!this.browser.webkit3) {
+                                    par.style.display = 'list-item';
+                                    par.parentNode.style.display = 'list-item';
+                                    setTimeout(function() {
+                                        par.style.display = 'block';
+                                        par.parentNode.style.display = 'block';
+                                    }, 1);
+                                }
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+            }
+            //Tab Key
+            if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) {
+                var preLi = this._getSelectedElement();
+                if (this._hasParent(preLi, 'li')) {
+                    preContent = this._hasParent(preLi, 'li').innerHTML;
+                }
+                if (this.browser.webkit) {
+                    this._getDoc().execCommand('inserttext', false, '\t');
+                }
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    par = this._hasParent(testLi, 'li');
+                    var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase());
+                    if (this.browser.webkit) {
+                        var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par);
+                        //Remove the span element that Safari puts in
+                        if (span[0]) {
+                            par.removeChild(span[0]);
+                            par.innerHTML = Lang.trim(par.innerHTML);
+                            //Put the HTML from the LI into this new LI
+                            if (preContent) {
+                                par.innerHTML = '<span class="yui-non">' + preContent + '</span>&nbsp;';
+                            } else {
+                                par.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                            }
+                        }
+                    } else {
+                        if (preContent) {
+                            par.innerHTML = preContent + '&nbsp;';
+                        } else {
+                            par.innerHTML = '&nbsp;';
+                        }
+                    }
+
+                    par.parentNode.replaceChild(newUl, par);
+                    newUl.appendChild(par);
+                    if (this.browser.webkit) {
+                        this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length);
+                        if (!this.browser.webkit3) {
+                            par.parentNode.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                par.parentNode.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                    } else if (this.browser.ie) {
+                        range = this._getDoc().body.createTextRange();
+                        range.moveToElementText(par);
+                        range.collapse(false);
+                        range.select();
+                    } else {
+                        this._selectNode(par);
+                    }
+                    Event.stopEvent(ev);
+                }
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
                     }
                     break;
-                case 219: //Left
-                    action = 'justifyleft';
-                    break;
-                case 220: //Center
-                    action = 'justifycenter';
-                    break;
-                case 221: //Right
-                    action = 'justifyright';
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
                     break;
                 case 76: //L
                     if (this._hasSelection()) {
-                        this.execCommand('createlink', '');
-                        this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
-                        this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-                        doExec = false;
+                        if (ev.shiftKey && ev.ctrlKey) {
+                            var makeLink = true;
+                            if (this.get('limitCommands')) {
+                                if (!this.toolbar.getButtonByValue('createlink')) {
+                                    makeLink = false;
+                                }
+                            }
+                            if (makeLink) {
+                                this.execCommand('createlink', '');
+                                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                                doExec = false;
+                            }
+                        }
+                    }
+                    break;
+                case 65:
+                    if (ev.metaKey && this.browser.webkit) {
+                        Event.stopEvent(ev);
+                        //Override Safari's select all and select the contents of the editor not the iframe as Safari would by default.
+                        this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, this._getDoc().body.innerHTML.length);
                     }
                     break;
                 case 66: //B
@@ -2505,18 +3516,12 @@ var Dom = YAHOO.util.Dom,
                 case 85: //U
                     action = 'underline';
                     break;
-                case 9: //Tab Key
-                    if (this.browser.safari) {
-                        this._getDoc().execCommand('inserttext', false, '\t');
-                        Event.stopEvent(ev);
-                    }
-                    break;
                 case 13:
                     if (this.browser.ie) {
                         //Insert a <br> instead of a <p></p> in Internet Explorer
                         var _range = this._getRange();
                         var tar = this._getSelectedElement();
-                        if (tar && tar.tagName && (tar.tagName.toLowerCase() != 'li')) {
+                        if (!this._isElement(tar, 'li')) {
                             if (_range) {
                                 _range.pasteHTML('<br>');
                                 _range.collapse(false);
@@ -2526,6 +3531,10 @@ var Dom = YAHOO.util.Dom,
                         }
                     }
             }
+            //if (!this.browser.gecko && !this.browser.webkit) {
+            if (this.browser.ie) {
+                this._listFix(ev);
+            }
             if (doExec && action) {
                 this.execCommand(action, null);
                 Event.stopEvent(ev);
@@ -2535,12 +3544,34 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @method nodeChange
+        * @param {Boolean} force Optional paramenter to skip the threshold counter
         * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
         */
-        nodeChange: function() {
-            this._fixNodes();
+        nodeChange: function(force) {
+            var threshold = parseInt(this.get('nodeChangeThreshold'), 10);
+            var thisNodeChange = Math.round(new Date().getTime() / 1000);
+            if (force === true) {
+                this._lastNodeChange = 0;
+            }
+            
+            if ((this._lastNodeChange + threshold) < thisNodeChange) {
+                var self = this;
+                if (this._fixNodesTimer === null) {
+                    this._fixNodesTimer = window.setTimeout(function() {
+                        self._fixNodes.call(self);
+                        self._fixNodesTimer = null;
+                    }, 0);
+                }
+            }
+            this._lastNodeChange = thisNodeChange;
+            if (this.currentEvent) {
+                this._lastNodeChangeEvent = this.currentEvent.type;
+            }
 
-            this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (beforeNodeChange === false) {
+                return false;
+            }
             if (this.get('dompath')) {
                 this._writeDomPath();
             }
@@ -2551,66 +3582,87 @@ var Dom = YAHOO.util.Dom,
                     this.STOP_NODE_CHANGE = false;
                     return false;
                 } else {
-                    var sel = this._getSelection();
-                    var range = this._getRange();
+                    var sel = this._getSelection(),
+                        range = this._getRange(),
+                        el = this._getSelectedElement(),
+                        fn_button = this.toolbar.getButtonByValue('fontname'),
+                        fs_button = this.toolbar.getButtonByValue('fontsize');
+
+                    if (force !== true) {
+                        this.editorDirty = true;
+                    }
+
+                    //Handle updating the toolbar with active buttons
+                    var _ex = {};
+                    if (this._lastButton) {
+                        _ex[this._lastButton.id] = true;
+                    }
+                    if (!this._isElement(el, 'body')) {
+                        if (fn_button) {
+                            _ex[fn_button.get('id')] = true;
+                        }
+                        if (fs_button) {
+                            _ex[fs_button.get('id')] = true;
+                        }
+                    }
+                    this.toolbar.resetAllButtons(_ex);
 
                     //Handle disabled buttons
-                    for (var i = 0; i < this._disabled.length; i++) {
-                        var _button = this.toolbar.getButtonByValue(this._disabled[i]);
+                    for (var d = 0; d < this._disabled.length; d++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[d]);
                         if (_button && _button.get) {
-                            if (!this._hasSelection()) {
-                                //No Selection - disable
-                                this.toolbar.disableButton(_button.get('id'));
+                            if (this._lastButton && (_button.get('id') === this._lastButton.id)) {
+                                //Skip
                             } else {
-                                if (!this._alwaysDisabled[this._disabled[i]]) {
-                                    this.toolbar.enableButton(_button.get('id'));
+                                if (!this._hasSelection()) {
+                                    switch (this._disabled[d]) {
+                                        case 'fontname':
+                                        case 'fontsize':
+                                            break;
+                                        default:
+                                            //No Selection - disable
+                                            this.toolbar.disableButton(_button);
+                                    }
+                                } else {
+                                    if (!this._alwaysDisabled[this._disabled[d]]) {
+                                        this.toolbar.enableButton(_button);
+                                    }
+                                }
+                                if (!this._alwaysEnabled[this._disabled[d]]) {
+                                    this.toolbar.deselectButton(_button);
                                 }
                             }
-                            if (!this._alwaysEnabled[this._disabled[i]]) {
-                                this.toolbar.deselectButton(_button);
-                            }
-                        }
-                    }
-                    //Handle updating the toolbar with active buttons
-                    for (var i = 0; i < this.toolbar._buttonList.length; i++) {
-                        if (!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]) {
-                            this.toolbar.deselectButton(this.toolbar._buttonList[i]);
                         }
                     }
                     var path = this._getDomPath();
-                    var olType = null;
+                    var tag = null, cmd = null;
                     for (var i = 0; i < path.length; i++) {
-                        var tag = path[i].tagName.toLowerCase();
+                        tag = path[i].tagName.toLowerCase();
                         if (path[i].getAttribute('tag')) {
-                            var tag = path[i].getAttribute('tag').toLowerCase();
+                            tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        cmd = this._tag2cmd[tag];
+                        if (cmd === undefined) {
+                            cmd = [];
+                        }
+                        if (!Lang.isArray(cmd)) {
+                            cmd = [cmd];
                         }
-                        var cmd = this._tag2cmd[tag];
 
                         //Bold and Italic styles
                         if (path[i].style.fontWeight.toLowerCase() == 'bold') {
-                            cmd = 'bold';
+                            cmd[cmd.length] = 'bold';
                         }
                         if (path[i].style.fontStyle.toLowerCase() == 'italic') {
-                            cmd = 'italic';
+                            cmd[cmd.length] = 'italic';
                         }
                         if (path[i].style.textDecoration.toLowerCase() == 'underline') {
-                            cmd = 'underline';
+                            cmd[cmd.length] = 'underline';
                         }
-                        if (tag == 'ol') {
-                            if (path[i].type) {
-                                olType = path[i].type;
-                            } else {
-                                olType = 'A';
-                            }
-                        }
-                        if (cmd) {
-                            if (!Lang.isArray(cmd)) {
-                                cmd = [cmd];
-                            }
+                        if (cmd.length > 0) {
                             for (var j = 0; j < cmd.length; j++) {
-                                var button = this.toolbar.getButtonByValue(cmd[j]);
-                                this.toolbar.selectButton(button);
-                                this.toolbar.enableButton(button);
+                                this.toolbar.selectButton(cmd[j]);
+                                this.toolbar.enableButton(cmd[j]);
                             }
                         }
                         //Handle Alignment
@@ -2623,25 +3675,20 @@ var Dom = YAHOO.util.Dom,
                                 if (path[i].style.textAlign.toLowerCase() == 'justify') {
                                     alignType = 'full';
                                 }
-                                var button = this.toolbar.getButtonByValue('justify' + alignType);
-                                this.toolbar.selectButton(button);
-                                this.toolbar.enableButton(button);
+                                this.toolbar.selectButton('justify' + alignType);
+                                this.toolbar.enableButton('justify' + alignType);
                                 break;
                         }
-                        //Handle Ordered List Drop Down - it will reset if olType is null
-                        //this._updateMenuChecked('insertorderedlist', olType);
                     }
                     //After for loop
 
                     //Reset Font Family and Size to the inital configs
-                    var fn_button = this.toolbar.getButtonByValue('fontname');
                     if (fn_button) {
                         var family = fn_button._configs.label._initialConfig.value;
                         fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
                         this._updateMenuChecked('fontname', family);
                     }
 
-                    var fs_button = this.toolbar.getButtonByValue('fontsize');
                     if (fs_button) {
                         fs_button.set('label', fs_button._configs.label._initialConfig.value);
                     }
@@ -2651,6 +3698,10 @@ var Dom = YAHOO.util.Dom,
                         hd_button.set('label', hd_button._configs.label._initialConfig.value);
                         this._updateMenuChecked('heading', 'none');
                     }
+                    var img_button = this.toolbar.getButtonByValue('insertimage');
+                    if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) {
+                        this.toolbar.disableButton(img_button);
+                    }
                 }
             }
 
@@ -2669,17 +3720,7 @@ var Dom = YAHOO.util.Dom,
                 tbar = this.toolbar;
             }
             var _button = tbar.getButtonByValue(button);
-            var _menuItems = _button.getMenu().getItems();
-            if (_menuItems.length == 0) {
-                _button.getMenu()._onBeforeShow();
-                _menuItems = _button.getMenu().getItems();
-            }
-            for (var i = 0; i < _menuItems.length; i++) {
-                _menuItems[i].cfg.setProperty('checked', false);
-                if (_menuItems[i].value == value) {
-                    _menuItems[i].cfg.setProperty('checked', true);
-                }
-            }
+            _button.checkValue(value);
         },
         /**
         * @private
@@ -2695,11 +3736,18 @@ var Dom = YAHOO.util.Dom,
                 value = cmd;
                 cmd = ev.button.menucmd;
             }
+            this._lastButton = ev.button;
             if (this.STOP_EXEC_COMMAND) {
                 this.STOP_EXEC_COMMAND = false;
                 return false;
             } else {
                 this.execCommand(cmd, value);
+                if (!this.browser.webkit) {
+                     var self = this;
+                     setTimeout(function() {
+                         self._focusWindow.call(self);
+                     }, 5);
+                 }
             }
             Event.stopEvent(ev);
         },
@@ -2709,6 +3757,13 @@ var Dom = YAHOO.util.Dom,
         * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
         */
         _setupAfterElement: function() {
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
             if (!this.afterElement) {
                 this.afterElement = document.createElement('h2');
                 this.afterElement.className = 'yui-editor-skipheader';
@@ -2718,6 +3773,47 @@ var Dom = YAHOO.util.Dom,
             }
         },
         /**
+        * @private
+        * @method _disableEditor
+        * @param {Boolean} disabled Pass true to disable, false to enable
+        * @description Creates a mask to place over the Editor.
+        */
+        _disableEditor: function(disabled) {
+            if (disabled) {
+                if (!this._mask) {
+                    if (!!this.browser.ie) {
+                        this._setDesignMode('off');
+                    }
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', true);
+                    }
+                    this._mask = document.createElement('DIV');
+                    Dom.setStyle(this._mask, 'height', '100%');
+                    Dom.setStyle(this._mask, 'width', '100%');
+                    Dom.setStyle(this._mask, 'position', 'absolute');
+                    Dom.setStyle(this._mask, 'top', '0');
+                    Dom.setStyle(this._mask, 'left', '0');
+                    Dom.setStyle(this._mask, 'opacity', '.5');
+                    Dom.addClass(this._mask, 'yui-editor-masked');
+                    this.get('iframe').get('parentNode').appendChild(this._mask);
+                }
+            } else {
+                if (this._mask) {
+                    this._mask.parentNode.removeChild(this._mask);
+                    this._mask = null;
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', false);
+                    }
+                    this._setDesignMode('on');
+                    this._focusWindow();
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.nodeChange.call(self);
+                    }, 100);
+                }
+            }
+        },
+        /**
         * @property EDITOR_PANEL_ID
         * @description HTML id to give the properties window in the DOM.
         * @type String
@@ -2740,19 +3836,7 @@ var Dom = YAHOO.util.Dom,
         * @description The accessibility string for the element before the iFrame
         * @type String
         */
-        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',
-        /**
-        * @property STR_CLOSE_WINDOW
-        * @description The Title of the close button in the Editor Window
-        * @type String
-        */
-        STR_CLOSE_WINDOW: 'Close Window',
-        /**
-        * @property STR_CLOSE_WINDOW_NOTE
-        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
-        * @type String
-        */
-        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Escape key',
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',
         /**
         * @property STR_TITLE
         * @description The Title of the HTML document that is created in the iFrame
@@ -2766,96 +3850,12 @@ var Dom = YAHOO.util.Dom,
         */
         STR_IMAGE_HERE: 'Image Url Here',
         /**
-        * @property STR_IMAGE_PROP_TITLE
-        * @description The title for the Image Property Editor Window
-        * @type String
-        */
-        STR_IMAGE_PROP_TITLE: 'Image Options',
-        /**
-        * @property STR_IMAGE_URL
-        * @description The label string for Image URL
-        * @type String
-        */
-        STR_IMAGE_URL: 'Image Url',
-        /**
-        * @property STR_IMAGE_TITLE
-        * @description The label string for Image Description
-        * @type String
-        */
-        STR_IMAGE_TITLE: 'Description',
-        /**
-        * @property STR_IMAGE_SIZE
-        * @description The label string for Image Size
-        * @type String
-        */
-        STR_IMAGE_SIZE: 'Size',
-        /**
-        * @property STR_IMAGE_ORIG_SIZE
-        * @description The label string for Original Image Size
-        * @type String
-        */
-        STR_IMAGE_ORIG_SIZE: 'Original Size',
-        /**
-        * @property STR_IMAGE_COPY
-        * @description The label string for the image copy and paste message for Opera and Safari
-        * @type String
-        */
-        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
-        /**
-        * @property STR_IMAGE_PADDING
-        * @description The label string for the image padding.
-        * @type String
-        */
-        STR_IMAGE_PADDING: 'Padding',
-        /**
-        * @property STR_IMAGE_BORDER
-        * @description The label string for the image border.
-        * @type String
-        */
-        STR_IMAGE_BORDER: 'Border',
-        /**
-        * @property STR_IMAGE_TEXTFLOW
-        * @description The label string for the image text flow.
-        * @type String
-        */
-        STR_IMAGE_TEXTFLOW: 'Text Flow',
-        /**
-        * @property STR_LOCAL_FILE_WARNING
-        * @description The label string for the local file warning.
-        * @type String
-        */
-        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
-        /**
-        * @property STR_LINK_PROP_TITLE
-        * @description The label string for the Link Property Editor Window.
-        * @type String
-        */
-        STR_LINK_PROP_TITLE: 'Link Options',
-        /**
-        * @property STR_LINK_PROP_REMOVE
-        * @description The label string for the Remove link from text link inside the property editor.
-        * @type String
-        */
-        STR_LINK_PROP_REMOVE: 'Remove link from text',
-        /**
         * @property STR_LINK_URL
         * @description The label string for the Link URL.
         * @type String
         */
         STR_LINK_URL: 'Link URL',
         /**
-        * @property STR_LINK_NEW_WINDOW
-        * @description The string for the open in a new window label.
-        * @type String
-        */
-        STR_LINK_NEW_WINDOW: 'Open in a new window.',
-        /**
-        * @property STR_LINK_TITLE
-        * @description The string for the link description.
-        * @type String
-        */
-        STR_LINK_TITLE: 'Description',
-        /**
         * @protected
         * @property STOP_EXEC_COMMAND
         * @description Set to true when you want the default execCommand function to not process anything
@@ -2871,18 +3871,11 @@ var Dom = YAHOO.util.Dom,
         STOP_NODE_CHANGE: false,
         /**
         * @protected
-        * @property CLASS_HIDDEN
-        * @description CSS class applied to the body when the hiddenelements button is pressed.
-        * @type String
-        */
-        CLASS_HIDDEN: 'hidden',
-        /**
-        * @protected
-        * @property CLASS_LOCAL_FILE
-        * @description CSS class applied to an element when it's found to have a local url.
+        * @property CLASS_NOEDIT
+        * @description CSS class applied to elements that are not editable.
         * @type String
         */
-        CLASS_LOCAL_FILE: 'warning-localfile',
+        CLASS_NOEDIT: 'yui-noedit',
         /**
         * @protected
         * @property CLASS_CONTAINER
@@ -2916,121 +3909,330 @@ var Dom = YAHOO.util.Dom,
         * @description Standard browser detection
         * @type Object
         */
-        browser: YAHOO.env.ua,
+        browser: function() {
+            var br = YAHOO.env.ua;
+            //Check for webkit3
+            if (br.webkit > 420) {
+                br.webkit3 = br.webkit;
+            } else {
+                br.webkit3 = 0;
+            }
+            return br;
+        }(),
         /** 
         * @method init
         * @description The Editor class' initialization method
         */
         init: function(p_oElement, p_oAttributes) {
-            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
-            this.get('element_cont').addClass(this.CLASS_CONTAINER);
-            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
-            this.get('iframe').addClass(this.CLASS_EDITABLE);
-        },
-        /**
-        * @method initAttributes
-        * @description Initializes all of the configuration attributes used to create 
-        * the editor.
-        * @param {Object} attr Object literal specifying a set of 
-        * configuration attributes used to create the editor.
-        */
-        initAttributes: function(attr) {
-            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
+
+            if (!this._defaultToolbar) {
+                this._defaultToolbar = {
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }
+                                
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Lists',
+                            buttons: [
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                };
+            }
+
+            YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes);
+            YAHOO.widget.EditorInfo._instances[this.get('id')] = this;
+
+
+            this.currentElement = [];
+            this.on('contentReady', function() {
+                this.DOMReady = true;
+                this.fireQueue();
+            }, this, true);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr);
             var self = this;
 
+            /**
+            * @config container
+            * @description Used when dynamically creating the Editor from Javascript with no default textarea.
+            * We will create one and place it in this container. If no container is passed we will append to document.body.
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                writeOnce: true,
+                value: attr.container || false
+            });
+            /**
+            * @config plainText
+            * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('plainText', {
+                writeOnce: true,
+                value: attr.plainText || false
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('iframe', {
+                value: null
+            });
             /**
             * @private
+            * @depreciated
             * @config textarea
-            * @description A reference to the textarea element that we are replacing
+            * @description Internal config for holding the textarea element (replaced with element).
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('textarea', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @private
+            * @config container
+            * @description Internal config for holding a reference to the container to append a dynamic editor to.
             * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                readOnly: true,
+                value: null
+            });
+            /**
+            * @config nodeChangeThreshold
+            * @description The number of seconds that need to be in between nodeChange processing
+            * @default 3
+            * @type Number
+            */            
+            this.setAttributeConfig('nodeChangeThreshold', {
+                value: attr.nodeChangeThreshold || 3,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @config allowNoEdit
+            * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes.
+            * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key.
+            * @default false
             * @type Boolean
             */            
-            this.setAttributeConfig('textarea', {
-                value: attr.textarea,
+            this.setAttributeConfig('allowNoEdit', {
+                value: attr.allowNoEdit || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config limitCommands
+            * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('limitCommands', {
+                value: attr.limitCommands || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('element_cont', {
+                value: attr.element_cont
+            });
+            /**
+            * @private
+            * @config editor_wrapper
+            * @description The outter wrapper for the entire editor.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('editor_wrapper', {
+                value: attr.editor_wrapper || null,
                 writeOnce: true
             });
             /**
-            * @config height
+            * @attribute height
             * @description The height of the editor iframe container, not including the toolbar..
             * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
             * @type String
             */
             this.setAttributeConfig('height', {
-                value: attr.height || Dom.getStyle(self.get('textarea'), 'height'),
-                writeOnce: true
+                value: attr.height || Dom.getStyle(self.get('element'), 'height'),
+                method: function(height) {
+                    if (this._rendered) {
+                        //We have been rendered, change the height
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), {
+                                height: {
+                                    to: parseInt(height, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height);
+                        }
+                    }
+                }
+            });
+            /**
+            * @config autoHeight
+            * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height.
+            * @default false
+            * @type Boolean || Number
+            */
+            this.setAttributeConfig('autoHeight', {
+                value: attr.autoHeight || false,
+                method: function(a) {
+                    if (a) {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'no');
+                        }
+                        this.on('afterNodeChange', this._handleAutoHeight, this, true);
+                        this.on('editorKeyDown', this._handleAutoHeight, this, true);
+                        this.on('editorKeyPress', this._handleAutoHeight, this, true);
+                    } else {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'auto');
+                        }
+                        this.unsubscribe('afterNodeChange', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyDown', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyPress', this._handleAutoHeight);
+                    }
+                }
             });
             /**
-            * @config width
+            * @attribute width
             * @description The width of the editor container.
             * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
             * @type String
             */            
             this.setAttributeConfig('width', {
-                value: attr.width || Dom.getStyle(this.get('textarea'), 'width'),
-                writeOnce: true
+                value: attr.width || Dom.getStyle(this.get('element'), 'width'),
+                method: function(width) {
+                    if (this._rendered) {
+                        //We have been rendered, change the width
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), {
+                                width: {
+                                    to: parseInt(width, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            this.get('element_cont').setStyle('width', width);
+                        }
+                    }
+                }
             });
                         
             /**
-            * @config blankimage
-            * @description The CSS used to show/hide hidden elements on the page
-            * @default 'assets/blankimage.png'
+            * @attribute blankimage
+            * @description The URL for the image placeholder to put in when inserting an image.
+            * @default The yahooapis.com address for the current release + 'assets/blankimage.png'
             * @type String
             */            
             this.setAttributeConfig('blankimage', {
                 value: attr.blankimage || this._getBlankImage()
             });
             /**
-            * @config hiddencss
-            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
-            * @default <code><pre>
-            .hidden div, .hidden p, .hidden span, .hidden img {
-                border: 1px dotted #ccc;
-            }
-            .hidden .yui-non {
-                border: none;
-            }
-            .hidden img {
-                padding: 2px;
-            }</pre></code>
-            * @type String
-            */            
-            this.setAttributeConfig('hiddencss', {
-                value: attr.hiddencss || '.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',
-                writeOnce: true
-            });
-            /**
-            * @config css
+            * @attribute css
             * @description The Base CSS used to format the content of the editor
-            * @default <code><pre>body {
-                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            * @default <code><pre>html {
+                height: 95%;
             }
-            span.yui-tag-a {
-                color: blue; text-decoration: underline;
-            }
-            span.yui-tag-blockquote {
-                margin: 1em; display: block;
+            body {
+                height: 100%;
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
             }
-            span.yui-tag-indent {
-                margin-left: 1em; display: block;
+            a {
+                color: blue;
+                text-decoration: underline;
+                cursor: pointer;
             }
             .warning-localfile {
                 border-bottom: 1px dashed red !important;
-            }</pre></code>
+            }
+            .yui-busy {
+                cursor: wait !important;
+            }
+            img.selected { //Safari image selection
+                border: 2px dotted #808080;
+            }
+            img {
+                cursor: pointer !important;
+                border: none;
+            }
+            </pre></code>
             * @type String
             */            
             this.setAttributeConfig('css', {
-                value: attr.css || 'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',
+                value: attr.css || this._defaultCSS,
                 writeOnce: true
             });
             /**
-            * @config html
-            * @description The default HTML to be written to the iframe document before the contents are loaded
+            * @attribute html
+            * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item)
             * @default This HTML requires a few things if you are to override:
-                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
                 <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
                 <code>
                 <pre>
-                &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
                 &lt;html&gt;
                     &lt;head&gt;
                         &lt;title&gt;{TITLE}&lt;/title&gt;
@@ -3041,6 +4243,9 @@ var Dom = YAHOO.util.Dom,
                         &lt;style&gt;
                         {HIDDEN_CSS}
                         &lt;/style&gt;
+                        &lt;style&gt;
+                        {EXTRA_CSS}
+                        &lt;/style&gt;
                     &lt;/head&gt;
                 &lt;body onload="document.body._rteLoaded = true;"&gt;
                 {CONTENT}
@@ -3051,12 +4256,23 @@ var Dom = YAHOO.util.Dom,
             * @type String
             */            
             this.setAttributeConfig('html', {
-                value: attr.html || '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                value: attr.html || '<html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><base href="' + this._baseHREF + '"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute extracss
+            * @description Extra user defined css to load after the default SimpleEditor CSS
+            * @default ''
+            * @type String
+            */            
+            this.setAttributeConfig('extracss', {
+                value: attr.css || '',
                 writeOnce: true
             });
 
             /**
-            * @config handleSubmit
+            * @attribute handleSubmit
             * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
             If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
             Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
@@ -3064,32 +4280,33 @@ var Dom = YAHOO.util.Dom,
             * @type Boolean
             */            
             this.setAttributeConfig('handleSubmit', {
-                value: false,
-                writeOnce: true,
+                value: attr.handleSubmit || false,
                 method: function(exec) {
-                    if (exec) {
-                        var ta = this.get('textarea');
-                        if (ta.form) {
-                            Event.addListener(ta.form, 'submit', function() {
-                                this.saveHTML();
-                            }, this, true);
+                    if (this.get('element').form) {
+                        if (!this._formButtons) {
+                            this._formButtons = [];
+                        }
+                        if (exec) {
+                            Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true);
+                            var i = this.get('element').form.getElementsByTagName('input');
+                            for (var s = 0; s < i.length; s++) {
+                                var type = i[s].getAttribute('type');
+                                if (type && (type.toLowerCase() == 'submit')) {
+                                    Event.on(i[s], 'click', this._handleFormButtonClick, this, true);
+                                    this._formButtons[this._formButtons.length] = i[s];
+                                }
+                            }
+                        } else {
+                            Event.unsubscribe(this.get('element').form, 'submit', this._handleFormSubmit);
+                            if (this._formButtons) {
+                                Event.unsubscribe(this._formButtons, 'click', this._handleFormButtonClick);
+                            }
                         }
                     }
                 }
             });
             /**
-            * @private
-            * @config iframe
-            * @description Internal config for holding the iframe element.
-            * @default null
-            * @type Boolean
-            */
-            this.setAttributeConfig('iframe', {
-                value: null,
-                writeOnce: true
-            });
-            /**
-            * @config disabled
+            * @attribute disabled
             * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
             All Toolbar buttons are also disabled so they cannot be used.
             * @default false
@@ -3099,42 +4316,12 @@ var Dom = YAHOO.util.Dom,
             this.setAttributeConfig('disabled', {
                 value: false,
                 method: function(disabled) {
-                    if (disabled) {
-                        if (!this._mask) {
-                            this._setDesignMode('off');
-                            this.toolbar.set('disabled', true);
-                            this._mask = document.createElement('DIV');
-                            Dom.setStyle(this._mask, 'height', '100%');
-                            Dom.setStyle(this._mask, 'width', '100%');
-                            Dom.setStyle(this._mask, 'position', 'absolute');
-                            Dom.setStyle(this._mask, 'top', '0');
-                            Dom.setStyle(this._mask, 'left', '0');
-                            Dom.setStyle(this._mask, 'opacity', '.5');
-                            Dom.addClass(this._mask, 'yui-editor-masked');
-                            this.get('iframe').get('parentNode').appendChild(this._mask);
-                        }
-                    } else {
-                        if (this._mask) {
-                            this._mask.parentNode.removeChild(this._mask);
-                            this._mask = null;
-                            this.toolbar.set('disabled', false);
-                            this._setDesignMode('on');
-                            this._focusWindow();
-                        }
+                    if (this._rendered) {
+                        this._disableEditor(disabled);
                     }
                 }
             });
             /**
-            * @config element_cont
-            * @description Internal config for the editors container
-            * @default false
-            * @type Boolean
-            */
-            this.setAttributeConfig('element_cont', {
-                value: null,
-                writeOnce: true
-            });
-            /**
             * @config toolbar_cont
             * @description Internal config for the toolbars container
             * @default false
@@ -3145,127 +4332,35 @@ var Dom = YAHOO.util.Dom,
                 writeOnce: true
             });
             /**
-            * @config toolbar
+            * @attribute toolbar
             * @description The default toolbar config.
-            * @default This config is too large to display here, view the code to see it: <a href="editor.js.html"></a>
             * @type Object
             */            
             this.setAttributeConfig('toolbar', {
-                value: attr.toolbar || {
-                    /* {{{ Defaut Toolbar Config */
-                    collapse: true,
-                    titlebar: 'Text Editing Tools',
-                    draggable: false,
-                    buttons: [
-                        { group: 'fontstyle', label: 'Font Name and Size',
-                            buttons: [
-                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
-                                    menu: [
-                                        { text: 'Arial', checked: true },
-                                        { text: 'Arial Black' },
-                                        { text: 'Comic Sans MS' },
-                                        { text: 'Courier New' },
-                                        { text: 'Lucida Console' },
-                                        { text: 'Tahoma' },
-                                        { text: 'Times New Roman' },
-                                        { text: 'Trebuchet MS' },
-                                        { text: 'Verdana' }
-                                    ]
-                                },
-                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'textstyle', label: 'Font Style',
-                            buttons: [
-                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
-                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
-                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
-                                { type: 'separator' },
-                                { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
-                                { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
-                                { type: 'separator' },
-                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
-                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
-                                { type: 'separator' },
-                                { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
-                                { type: 'push', label: 'Hidden Elements', value: 'hiddenelements' }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'alignment', label: 'Alignment',
-                            buttons: [
-                                { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
-                                { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
-                                { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
-                                { type: 'push', label: 'Justify', value: 'justifyfull' }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'parastyle', label: 'Paragraph Style',
-                            buttons: [
-                            { type: 'select', label: 'Normal', value: 'heading', disabled: true,
-                                menu: [
-                                    { text: 'Normal', value: 'none', checked: true },
-                                    { text: 'Header 1', value: 'h1' },
-                                    { text: 'Header 2', value: 'h2' },
-                                    { text: 'Header 3', value: 'h3' },
-                                    { text: 'Header 4', value: 'h4' },
-                                    { text: 'Header 5', value: 'h5' },
-                                    { text: 'Header 6', value: 'h6' }
-                                ]
-                            }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'indentlist', label: 'Indenting and Lists',
-                            buttons: [
-                                { type: 'push', label: 'Indent', value: 'indent', disabled: true },
-                                { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
-                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
-                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
-                                /*
-                                { type: 'menu', label: 'Create an Ordered List', value: 'insertorderedlist',
-                                    menu: [
-                                        { text: '1,2,3,4', value: '1', checked: true },
-                                        { text: 'A,B,C,D', value: 'A' },
-                                        { text: 'a,b,c,d', value: 'a' },
-                                        { text: 'I,II,III,IV', value: 'I' },
-                                        { text: 'i,ii,iii,iv', value: 'i' }
-                                    ]
-                                }
-                                */
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'insertitem', label: 'Insert Item',
-                            buttons: [
-                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
-                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
-                            ]
-                        }
-                    ]
-                    /* }}} */
-                },
+                value: attr.toolbar || this._defaultToolbar,
                 writeOnce: true,
                 method: function(toolbar) {
+                    if (!toolbar.buttonType) {
+                        toolbar.buttonType = this._defaultToolbar.buttonType;
+                    }
+                    this._defaultToolbar = toolbar;
                 }
             });
             /**
-            * @config animate
+            * @attribute animate
             * @description Should the editor animate window movements
             * @default false unless Animation is found, then true
             * @type Boolean
             */            
             this.setAttributeConfig('animate', {
-                value: false,
+                value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false),
                 validator: function(value) {
                     var ret = true;
                     if (!YAHOO.util.Anim) {
                         ret = false;
                     }
                     return ret;
-                }               
+                }
             });
             /**
             * @config panel
@@ -3278,29 +4373,39 @@ var Dom = YAHOO.util.Dom,
                 writeOnce: true,
                 validator: function(value) {
                     var ret = true;
-                    if (!YAHOO.widget.Panel) {
+                    if (!YAHOO.widget.Overlay) {
                         ret = false;
                     }
                     return ret;
                 }               
             });
             /**
-            * @config localFileWarning
-            * @description Should we throw the warning if we detect a file that is local to their machine?
-            * @default true
+            * @attribute focusAtStart
+            * @description Should we focus the window when the content is ready?
+            * @default false
             * @type Boolean
             */            
-            this.setAttributeConfig('localFileWarning', {
-                value: true
+            this.setAttributeConfig('focusAtStart', {
+                value: attr.focusAtStart || false,
+                writeOnce: true,
+                method: function() {
+                    this.on('editorContentLoaded', function() {
+                        var self = this;
+                        setTimeout(function() {
+                            self._focusWindow.call(self, true);
+                            self.editorDirty = false;
+                        }, 400);
+                    }, this, true);
+                }
             });
             /**
-            * @config dompath
+            * @attribute dompath
             * @description Toggle the display of the current Dom path below the editor
             * @default false
             * @type Boolean
             */            
             this.setAttributeConfig('dompath', {
-                value: false,
+                value: attr.dompath || false,
                 method: function(dompath) {
                     if (dompath && !this.dompath) {
                         this.dompath = document.createElement('DIV');
@@ -3314,28 +4419,38 @@ var Dom = YAHOO.util.Dom,
                         this.dompath.parentNode.removeChild(this.dompath);
                         this.dompath = null;
                     }
-                    this._setupAfterElement();
                 }
             });
             /**
-            * @config markup
-            * @description Should we try to adjust the markup for the following types: semantic, css or default
+            * @attribute markup
+            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml
             * @default "semantic"
-            * @type Boolean
+            * @type String
             */            
             this.setAttributeConfig('markup', {
-                value: 'semantic',
+                value: attr.markup || 'semantic',
                 validator: function(markup) {
                     switch (markup.toLowerCase()) {
                         case 'semantic':
                         case 'css':
                         case 'default':
+                        case 'xhtml':
                         return true;
-                        break;
                     }
                     return false;
                 }
             });
+            /**
+            * @attribute removeLineBreaks
+            * @description Should we remove linebreaks and extra spaces on cleanup
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('removeLineBreaks', {
+                value: attr.removeLineBreaks || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            
 
             this.on('afterRender', function() {
                 this._renderPanel();
@@ -3345,26 +4460,119 @@ var Dom = YAHOO.util.Dom,
         * @private
         * @method _getBlankImage
         * @description Retrieves the full url of the image to use as the blank image.
-        * @returns {String} The URL to the blank image
+        * @return {String} The URL to the blank image
         */
         _getBlankImage: function() {
             if (!this.DOMReady) {
                 this._queue[this._queue.length] = ['_getBlankImage', arguments];
                 return '';
-            }      
-            var div = document.createElement('div');
-            div.style.position = 'absolute';
-            div.style.top = '-9999px';
-            div.style.left = '-9999px';
-            div.className = this.CLASS_PREFIX + '-blankimage';
-            document.body.appendChild(div);
-            var img = YAHOO.util.Dom.getStyle(div, 'background-image');
-            img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
-            this.set('blankimage', img);            
+            }
+            var img = '';
+            if (!this._blankImageLoaded) {
+                var div = document.createElement('div');
+                div.style.position = 'absolute';
+                div.style.top = '-9999px';
+                div.style.left = '-9999px';
+                div.className = this.CLASS_PREFIX + '-blankimage';
+                document.body.appendChild(div);
+                img = YAHOO.util.Dom.getStyle(div, 'background-image');
+                img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+                this.set('blankimage', img);
+                this._blankImageLoaded = true;
+            } else {
+                img = this.get('blankimage');
+            }
             return img;
         },
         /**
         * @private
+        * @method _handleAutoHeight
+        * @description Handles resizing the editor's height based on the content
+        */
+        _handleAutoHeight: function() {
+            var doc = this._getDoc(),
+                body = doc.body,
+                docEl = doc.documentElement;
+
+            var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10);
+            var newHeight = body.scrollHeight;
+            if (this.browser.webkit) {
+                newHeight = docEl.scrollHeight;
+            }
+            if (newHeight < parseInt(this.get('height'), 10)) {
+                newHeight = parseInt(this.get('height'), 10);
+            }
+            if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) {   
+                Dom.setStyle(this.get('editor_wrapper'), 'height', newHeight + 'px');
+                if (this.browser.ie) {
+                    //Internet Explorer needs this
+                    this.get('iframe').setStyle('height', '99%');
+                    this.get('iframe').setStyle('zoom', '1');
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.get('iframe').setStyle('height', '100%');
+                    }, 1);
+                }
+            }
+        },
+        _formButtons: null,
+        _formButtonClicked: null,
+        _handleFormButtonClick: function(ev) {
+            var tar = Event.getTarget(ev);
+            this._formButtonClicked = tar;
+        },
+        /**
+        * @private
+        * @method _handleFormSubmit
+        * @description Handles the form submission.
+        * @param {Object} ev The Form Submit Event
+        */
+        _handleFormSubmit: function(ev) {
+            Event.stopEvent(ev);
+            
+            this.saveHTML();
+            var form = this.get('element').form;
+            var tar = this._formButtonClicked || false;
+            var self = this;
+
+            window.setTimeout(function() {
+                YAHOO.util.Event.removeListener(form, 'submit', self._handleFormSubmit);
+                if (YAHOO.env.ua.ie) {
+                    form.fireEvent("onsubmit");
+                    if (tar) {
+                        tar.click();
+                    }
+                } else {  // Gecko, Opera, and Safari
+                    if (tar) {
+                        tar.click();
+                    } else {
+                        var oEvent = document.createEvent("HTMLEvents");
+                        oEvent.initEvent("submit", true, true);
+                        form.dispatchEvent(oEvent);
+                        if (YAHOO.env.ua.webkit) {
+                            if (YAHOO.lang.isFunction(form.submit)) {
+                                form.submit();
+                            }
+                        }
+                    }
+                }
+                /*
+                if (YAHOO.env.ua.ie || YAHOO.env.ua.webkit) {
+                    if (YAHOO.lang.isFunction(form.submit)) {
+                        form.submit();
+                    } else {
+                        if (YAHOO.lang.isObject(form.submit)) {
+                            form.submit.click();
+                        } else {
+                        }
+                    }
+                }
+                */
+            }, 200);
+            
+        },
+        /**
+        * @private
         * @method _handleFontSize
         * @description Handles the font size button in the toolbar.
         * @param {Object} o Object returned from Toolbar's buttonClick Event
@@ -3377,7 +4585,6 @@ var Dom = YAHOO.util.Dom,
         },
         /**
         * @private
-        * @method _handleColorPicker
         * @description Handles the colorpicker buttons in the toolbar.
         * @param {Object} o Object returned from Toolbar's buttonClick Event
         */
@@ -3395,7 +4602,6 @@ var Dom = YAHOO.util.Dom,
         * @param {Object} o Object returned from Toolbar's buttonClick Event
         */
         _handleAlign: function(o) {
-            var button = this.toolbar.getButtonById(o.button.id);
             var cmd = null;
             for (var i = 0; i < o.button.menu.length; i++) {
                 if (o.button.menu[i].value == o.button.value) {
@@ -3413,13 +4619,20 @@ var Dom = YAHOO.util.Dom,
         * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
         */
         _handleAfterNodeChange: function() {
-            var path = this._getDomPath();
+            var path = this._getDomPath(),
+                elm = null,
+                family = null,
+                fontsize = null,
+                validFont = false;
+            var fn_button = this.toolbar.getButtonByValue('fontname');
+            var fs_button = this.toolbar.getButtonByValue('fontsize');
+            var hd_button = this.toolbar.getButtonByValue('heading');
+
             for (var i = 0; i < path.length; i++) {
-                var elm = path[i],
-                    tag = elm.tagName.toLowerCase(),
-                    family = null,
-                    fontsize = null,
-                    validFont = false;
+                elm = path[i];
+
+                var tag = elm.tagName.toLowerCase();
+
 
                 if (elm.getAttribute('tag')) {
                     tag = elm.getAttribute('tag');
@@ -3429,69 +4642,93 @@ var Dom = YAHOO.util.Dom,
                 if (Dom.getStyle(elm, 'font-family')) {
                     family = Dom.getStyle(elm, 'font-family');
                 }
-                var fn_button = this.toolbar.getButtonByValue('fontname');
-                if (fn_button) {
-                    for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
-                        if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
-                            validFont = true;
-                            family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
-                        }
-                    }
-                    if (!validFont) {
-                        family = fn_button._configs.label._initialConfig.value;
-                    }
-                    fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
-                    this._updateMenuChecked('fontname', family);
-                }
-
-                var fs_button = this.toolbar.getButtonByValue('fontsize');
-                if (fs_button) {
-                    fontsize = parseInt(Dom.getStyle(elm, 'fontSize'));
-                    if ((fontsize == null) || isNaN(fontsize)) {
-                        fontsize = fs_button._configs.label._initialConfig.value;
-                    }
-                    fs_button.set('label', ''+fontsize);
-                }
 
                 if (tag.substring(0, 1) == 'h') {
-                    var hd_button = this.toolbar.getButtonByValue('heading');
                     if (hd_button) {
-                        for (var b = 0; b < hd_button._configs.menu.value.length; b++) {
-                            if (hd_button._configs.menu.value[b].value.toLowerCase() == tag) {
-                                hd_button.set('label', hd_button._configs.menu.value[b].text);
+                        for (var h = 0; h < hd_button._configs.menu.value.length; h++) {
+                            if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[h].text);
                             }
                         }
                         this._updateMenuChecked('heading', tag);
                     }
                 }
             }
+
+            if (fn_button) {
+                for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                    if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                        validFont = true;
+                        family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                    }
+                }
+                if (!validFont) {
+                    family = fn_button._configs.label._initialConfig.value;
+                }
+                var familyLabel = '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>';
+                if (fn_button.get('label') != familyLabel) {
+                    fn_button.set('label', familyLabel);
+                    this._updateMenuChecked('fontname', family);
+                }
+            }
+
+            if (fs_button) {
+                fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10);
+                if ((fontsize === null) || isNaN(fontsize)) {
+                    fontsize = fs_button._configs.label._initialConfig.value;
+                }
+                fs_button.set('label', ''+fontsize);
+            }
             
-            if (elm && elm.tagName && (elm.tagName.toLowerCase() != 'body')) {
+            if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) {
                 this.toolbar.enableButton(fn_button);
                 this.toolbar.enableButton(fs_button);
+                this.toolbar.enableButton('forecolor');
+                this.toolbar.enableButton('backcolor');
+            }
+            if (this._isElement(elm, 'img')) {
+                if (YAHOO.widget.Overlay) {
+                    this.toolbar.enableButton('createlink');
+                }
             }
+            if (this._isElement(elm, 'blockquote')) {
+                this.toolbar.selectButton('indent');
+                this.toolbar.disableButton('indent');
+                this.toolbar.enableButton('outdent');
+            }
+            if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) {
+                this.toolbar.disableButton('indent');
+            }
+            this._lastButton = null;
             
         },
+        _setBusy: function(off) {
+            /*
+            if (off) {
+                Dom.removeClass(document.body, 'yui-busy');
+                Dom.removeClass(this._getDoc().body, 'yui-busy');
+            } else {
+                Dom.addClass(document.body, 'yui-busy');
+                Dom.addClass(this._getDoc().body, 'yui-busy');
+            }
+            */
+        },
         /**
         * @private
         * @method _handleInsertImageClick
         * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
         */
         _handleInsertImageClick: function() {
-            //this.toolbar.disableButton(this.toolbar.getButtonByValue('insertimage'));
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
             this.on('afterExecCommand', function() {
                 var el = this.currentElement[0],
-                    title = '',
-                    src = '',
-                    align = '',
-                    height = 75,
-                    width = 75,
-                    padding = 0,
-                    blankimage = false,
-                    win = new YAHOO.widget.EditorWindow('insertimage', {
-                        width: '415px'
-                    });
-
+                    src = 'http://';
                 if (!el) {
                     el = this._getSelectedElement();
                 }
@@ -3500,399 +4737,86 @@ var Dom = YAHOO.util.Dom,
                         src = el.getAttribute('src', 2);
                         if (src.indexOf(this.get('blankimage')) != -1) {
                             src = this.STR_IMAGE_HERE;
-                            blankimage = true;
                         }
                     }
-                    if (el.getAttribute('alt', 2)) {
-                        title = el.getAttribute('alt', 2);
-                    }
-                    if (el.getAttribute('title', 2)) {
-                        title = el.getAttribute('title', 2);
-                    }
-                    height = parseInt(el.height);
-                    width = parseInt(el.width);
-                    if (el.style.height) {
-                        height = parseInt(el.style.height);
-                    }
-                    if (el.style.width) {
-                        width = parseInt(el.style.width);
-                    }
-                    if (el.style.margin) {
-                        padding = parseInt(el.style.margin);
-                    }
-                    if (!el._height) {
-                        el._height = height;
-                    }
-                    if (!el._width) {
-                        el._width = width;
-                    }
-                    var oheight = el._height;
-                    var owidth = el._width;
-                }
-                if (!win.cache) {
-                    var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
-                    var body = document.createElement('div');
-                    body.innerHTML = str;
-
-                    var tbarCont = document.createElement('div');
-                    tbarCont.id = 'img_toolbar';
-                    body.appendChild(tbarCont);
-
-                    var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
-                    var div = document.createElement('div');
-                    div.innerHTML = str2;
-                    body.appendChild(div);
-                    win.cache = body;
-                } else {
-                    body = win.cache;
-                }
-
-                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
-                    /* {{{ */ 
-                    buttons: [
-                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
-                            buttons: [
-                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
-                            buttons: [
-                                { type: 'select', label: 'Border Size', value: 'bordersize',
-                                    menu: [
-                                        { text: 'none', value: '0', checked: true },
-                                        { text: '----', value: '1' },
-                                        { text: '----', value: '2' },
-                                        { text: '----', value: '3' },
-                                        { text: '----', value: '4' },
-                                        { text: '----', value: '5' }
-                                    ]
-                                },
-                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
-                                    menu: [
-                                        { text: '----', value: 'solid', checked: true },
-                                        { text: '----', value: 'dashed' },
-                                        { text: '----', value: 'dotted' }
-                                    ]
-                                },
-                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
-                            ]
-                        },
-                        { type: 'separator' },
-                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
-                            buttons: [
-                                { type: 'push', label: 'Left', value: 'left' },
-                                { type: 'push', label: 'Inline', value: 'inline' },
-                                { type: 'push', label: 'Block', value: 'block' },
-                                { type: 'push', label: 'Right', value: 'right' }
-                            ]
-                        }
-                    ]
-                    /* }}} */
-                });
-                
-                var bsize = '0';
-                var btype = 'solid';
-                if (el.style.borderLeftWidth) {
-                    bsize = parseInt(el.style.borderLeftWidth);
                 }
-                if (el.style.borderLeftStyle) {
-                    btype = el.style.borderLeftStyle;
+                var str = prompt(this.STR_LINK_URL + ': ', src);
+                if ((str !== '') && (str !== null)) {
+                    el.setAttribute('src', str);
+                } else if (str === null) {
+                    el.parentNode.removeChild(el);
+                    this.currentElement = [];
+                    this.nodeChange();
                 }
-                var bs_button = tbar.getButtonByValue('bordersize');
-                var bSizeStr = ((parseInt(bsize) > 0) ? '----' : 'none');
-                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
-                this._updateMenuChecked('bordersize', bsize, tbar);
-
-                var bs_button = tbar.getButtonByValue('bordertype');
-                bs_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '">----</span>');
-                this._updateMenuChecked('bordertype', btype, tbar);
-                if (parseInt(bsize) > 0) {
-                    tbar.enableButton(tbar.getButtonByValue('bordertype'));
-                    tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            }, this, true);
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            this.nodeChange();
+        },
+        /**
+        * @private
+        * @method _isLocalFile
+        * @param {String} url THe url/string to check
+        * @description Checks to see if a string (href or img src) is possibly a local file reference..
+        */
+        _isLocalFile: function(url) {
+            if ((url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    return false;
                 }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    url = '';
 
-                var cont = tbar.get('cont');
-                var hw = document.createElement('div');
-                hw.className = 'yui-toolbar-group yui-toolbar-group-padding height-width';
-                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
-                var orgSize = '';
-                if ((height != oheight) || (width != owidth)) {
-                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                    }
                 }
-                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
-                cont.insertBefore(hw, cont.firstChild);
-
-                Event.onAvailable('insertimage_width', function() {
-                    Event.on('insertimage_width', 'blur', function() {
-                        var value = parseInt(Dom.get('insertimage_width').value);
-                        if (value > 5) {
-                            el.style.width = value + 'px';
-                            this.moveWindow();
-                        }
-                    }, this, true);
-                }, this, true);
-                Event.onAvailable('insertimage_height', function() {
-                    Event.on('insertimage_height', 'blur', function() {
-                        var value = parseInt(Dom.get('insertimage_height').value);
-                        if (value > 5) {
-                            el.style.height = value + 'px';
-                            this.moveWindow();
+                var str = prompt(this.STR_LINK_URL + ': ', url);
+                if ((str !== '') && (str !== null)) {
+                    var urlValue = str;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            if (urlValue.substring(0, 1) != '#') {
+                                urlValue = 'http:/'+'/' + urlValue;
+                            }
                         }
-                    }, this, true);
-                }, this, true);
-
-                if (el.align == 'right') {
-                    tbar.selectButton(tbar.getButtonByValue('right'));
-                } else if (el.align == 'left') {
-                    tbar.selectButton(tbar.getButtonByValue('left'));
-                } else if (el.style.display == 'block') {
-                    tbar.selectButton(tbar.getButtonByValue('block'));
-                } else {
-                    tbar.selectButton(tbar.getButtonByValue('inline'));
-                }
-                if (parseInt(el.style.marginLeft) > 0) {
-                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft));
-                }
-                if (el.style.borderSize) {
-                    tbar.selectButton(tbar.getButtonByValue('bordersize'));
-                    tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));
+                    }
+                    el.setAttribute('href', urlValue);
+                } else if (str !== null) {
+                    var _span = this._getDoc().createElement('span');
+                    _span.innerHTML = el.innerHTML;
+                    Dom.addClass(_span, 'yui-non');
+                    el.parentNode.replaceChild(_span, el);
                 }
-
-                tbar.on('colorPickerClicked', function(o) {
-                    var size = '1', type = 'solid', color = 'black';
-
-                    if (el.style.borderLeftWidth) {
-                        size = parseInt(el.style.borderLeftWidth);
-                    }
-                    if (el.style.borderLeftStyle) {
-                        type = el.style.borderLeftStyle;
-                    }
-                    if (el.style.borderLeftColor) {
-                        color = el.style.borderLeftColor;
-                    }
-                    var borderString = size + 'px ' + type + ' #' + o.color;
-                    el.style.border = borderString;
-                }, this.toolbar, true);
-
-                tbar.on('buttonClick', function(o) {
-                    var value = o.button.value;
-                    if (o.button.menucmd) {
-                        value = o.button.menucmd
-                    }
-                    var size = '1', type = 'solid', color = 'black';
-
-                    /* All border calcs are done on the left border
-                        since our default interface only supports
-                        one border size/type and color */
-                    if (el.style.borderLeftWidth) {
-                        size = parseInt(el.style.borderLeftWidth);
-                    }
-                    if (el.style.borderLeftStyle) {
-                        type = el.style.borderLeftStyle;
-                    }
-                    if (el.style.borderLeftColor) {
-                        color = el.style.borderLeftColor;
-                    }
-                    switch(value) {
-                        case 'bordersize':
-                            var borderString = parseInt(o.button.value) + 'px ' + type + ' ' + color;
-                            el.style.border = borderString;
-                            if (parseInt(o.button.value) > 0) {
-                                tbar.enableButton(tbar.getButtonByValue('bordertype'));
-                                tbar.enableButton(tbar.getButtonByValue('bordercolor'));
-                            } else {
-                                tbar.disableButton(tbar.getButtonByValue('bordertype'));
-                                tbar.disableButton(tbar.getButtonByValue('bordercolor'));
-                            }
-                            break;
-                        case 'bordertype':
-                            var borderString = size + 'px ' + o.button.value + ' ' + color;
-                            el.style.border = borderString;
-                            break;
-                        case 'right':
-                        case 'left':
-                            tbar.deselectAllButtons();
-                            el.style.display = '';
-                            el.align = o.button.value;
-                            break;
-                        case 'inline':
-                            tbar.deselectAllButtons();
-                            el.style.display = '';
-                            el.align = '';
-                            break;
-                        case 'block':
-                            tbar.deselectAllButtons();
-                            el.style.display = 'block';
-                            el.align = 'center';
-                            break;
-                        case 'padding':
-                            var _button = tbar.getButtonById(o.button.id);
-                            el.style.margin = _button.get('label') + 'px';
-                            break;
-                    }
-                    tbar.selectButton(tbar.getButtonByValue(o.button.value));
-                    this.moveWindow();
-                }, this, true);
-
-                win.setHeader(this.STR_IMAGE_PROP_TITLE);
-                win.setBody(body);
-                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
-                    var str = this.STR_IMAGE_COPY;
-                    win.setFooter(str);
-                }
-                this.openWindow(win);
-
-
-                //Set event after openWindow..
-                Event.onAvailable('insertimage_url', function() {
-                    window.setTimeout(function() {
-                        YAHOO.util.Dom.get('insertimage_url').focus();
-                        if (blankimage) {
-                            YAHOO.util.Dom.get('insertimage_url').select();
-                        }
-                    }, 50);
-                    
-                    if (this.get('localFileWarning')) {
-                        Event.on('insertimage_url', 'blur', function() {
-                            var url = Dom.get('insertimage_url');
-                            if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
-                                //Local File throw Warning
-                                Dom.addClass(url, 'warning');
-                                var str = this.STR_LOCAL_FILE_WARNING;
-                                this.get('panel').setFooter(str);
-                            } else {
-                                Dom.removeClass(url, 'warning');
-                                this.get('panel').setFooter(' ');
-                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
-                                    var str = this.STR_IMAGE_COPY;
-                                    this.get('panel').setFooter(str);
-                                }
-                                
-                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
-                                    this.currentElement[0].setAttribute('src', url.value);
-                                    var img = new Image();
-                                    var self = this;
-                                    window.setTimeout(function() {
-                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
-                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
-                                        if (!self.currentElement[0]._height) {
-                                            self.currentElement[0]._height = img.height;
-                                        }
-                                        if (!self.currentElement[0]._width) {
-                                            self.currentElement[0]._width = img.width;
-                                        }
-                                        self.moveWindow();
-                                    }, 200);
-
-                                    img.src = url.value;
-                                }
-                            }
-                        }, this, true);
-                    }
-                }, this, true);
-            });
-        },
-        /**
-        * @private
-        * @method _handleInsertImageWindowClose
-        * @description Handles the closing of the Image Properties Window.
-        */
-        _handleInsertImageWindowClose: function() {
-            var url = Dom.get('insertimage_url');
-            var title = Dom.get('insertimage_title');
-            var el = this.currentElement[0];
-            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
-                el.setAttribute('src', url.value);
-                el.setAttribute('title', title.value);
-                el.setAttribute('alt', title.value);
-                //this.toolbar.enableButton(this.toolbar.getButtonByValue('insertimage'));
-            } else {
-                //No url/src given, remove the node from the document
-                el.parentNode.removeChild(el);
-            }
-        },
-        /**
-        * @private
-        * @method _handleCreateLinkClick
-        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
-        */
-        _handleCreateLinkClick: function() {
-            this.on('afterExecCommand', function() {
-
-                var win = new YAHOO.widget.EditorWindow('createlink', {
-                    width: '300px'
-                });
-                
-                var el = this.currentElement[0],
-                    url = '',
-                    title = '',
-                    target = '',
-                    localFile = false;
-                if (el) {
-                    if (el.getAttribute('href') != null) {
-                        url = el.getAttribute('href');
-                        if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
-                            //Local File throw Warning
-                            var str = this.STR_LOCAL_FILE_WARNING;
-                            win.setFooter(str);
-                            localFile = true;
-                        } else {
-                            win.setFooter(' ');
-                        }
-                    }
-                    if (el.getAttribute('title') != null) {
-                        title = el.getAttribute('title');
-                    }
-                    if (el.getAttribute('target') != null) {
-                        target = el.getAttribute('target');
-                    }
-                }
-                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
-                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
-                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
-                
-                var body = document.createElement('div');
-                body.innerHTML = str;
-
-                var unlinkCont = document.createElement('div');
-                unlinkCont.className = 'removeLink';
-                var unlink = document.createElement('a');
-                unlink.href = '#';
-                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
-                unlink.title = this.STR_LINK_PROP_REMOVE;
-                Event.on(unlink, 'click', function(ev) {
-                    Event.stopEvent(ev);
-                    this.execCommand('unlink');
-                    this.closeWindow();
-                }, this, true);
-                unlinkCont.appendChild(unlink);
-                body.appendChild(unlinkCont);
-
-                win.setHeader(this.STR_LINK_PROP_TITLE);
-                win.setBody(body);
-
-                Event.onAvailable('createlink_url', function() {
-                    window.setTimeout(function() {
-                        try {
-                            YAHOO.util.Dom.get('createlink_url').focus();
-                        } catch (e) {}
-                    }, 50);
-                    Event.on('createlink_url', 'blur', function() {
-                        var url = Dom.get('createlink_url');
-                        if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
-                            //Local File throw Warning
-                            Dom.addClass(url, 'warning');
-                            var str = this.STR_LOCAL_FILE_WARNING;
-                            this.get('panel').setFooter(str);
-                        } else {
-                            Dom.removeClass(url, 'warning');
-                            this.get('panel').setFooter(' ');
-                        }
-                    }, this, true);
-                }, this, true);
-
-                this.openWindow(win);
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
             });
         },
         /**
@@ -3901,52 +4825,63 @@ var Dom = YAHOO.util.Dom,
         * @description Handles the closing of the Link Properties Window.
         */
         _handleCreateLinkWindowClose: function() {
-            var url = Dom.get('createlink_url');
-            var target = Dom.get('createlink_target');
-            var title = Dom.get('createlink_title');
-            var el = this.currentElement[0];
-            if (url && url.value) {
-                var urlValue = url.value;
-                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
-                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
-                        //Found an @ sign, prefix with mailto:
-                        urlValue = 'mailto:' + urlValue;
-                    } else {
-                        /* :// not found adding */
-                        urlValue = 'http:/'+'/' + urlValue;
-                    }
-                }
-                el.setAttribute('href', urlValue);
-                if (target.checked) {
-                    el.setAttribute('target', target.value);
-                } else {
-                    el.setAttribute('target', '');
-                }
-                el.setAttribute('title', ((title.value) ? title.value : ''));
-
-            } else {
-                el.removeAttribute('tag');
-                Dom.removeClass(el, 'yui-tag-a');
-                Dom.removeClass(el, 'yui-tag');
-                Dom.addClass(el, 'yui-non');
-            }
             this.nodeChange();
+            this.currentElement = [];
         },
         /**
         * @method render
-        * @description Causes the toolbar and the editor to render and replace the textarea.
+        * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load.
         */
         render: function() {
+            if (this._rendered) {
+                return false;
+            }
             if (!this.DOMReady) {
                 this._queue[this._queue.length] = ['render', arguments];
                 return false;
             }
+            this._rendered = true;
+            var self = this;
+            window.setTimeout(function() {
+                self._render.call(self);
+            }, 4);
+        },
+        /**
+        * @private
+        * @method _render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        _render: function() {
+            this._setBusy();
             var self = this;
+            this.set('textarea', this.get('element'));
+
+            this.get('element_cont').setStyle('display', 'none');
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+
+            this.set('iframe', this._createIframe());
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+
+            this.get('editor_wrapper').appendChild(this.get('iframe').get('element'));
+
+            if (this.get('disabled')) {
+                this._disableEditor(true);
+            }
+
             var tbarConf = this.get('toolbar');
-            //Set the toolbar to disabled until content is loaded
-            tbarConf.disabled = true;
             //Create Toolbar instance
-            this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            if (tbarConf instanceof Toolbar) {
+                this.toolbar = tbarConf;
+                //Set the toolbar to disabled until content is loaded
+                this.toolbar.set('disabled', true);
+            } else {
+                //Set the toolbar to disabled until content is loaded
+                tbarConf.disabled = true;
+                this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            }
+
             this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
 
             
@@ -3966,6 +4901,7 @@ var Dom = YAHOO.util.Dom,
             
             this.toolbar.on('colorPickerClicked', function(o) {
                 this._handleColorPicker(o);
+                return false; //Stop the buttonClick event
             }, this, true);
 
             this.toolbar.on('alignClick', function(o) {
@@ -3986,40 +4922,33 @@ var Dom = YAHOO.util.Dom,
             this.on('windowcreatelinkClose', function() {
                 this._handleCreateLinkWindowClose();
             }, this, true);
-
+            
 
             //Replace Textarea with editable area
-            
             this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
 
-
-            if (!this.beforeElement) {
-                this.beforeElement = document.createElement('h2');
-                this.beforeElement.className = 'yui-editor-skipheader';
-                this.beforeElement.tabIndex = '-1';
-                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
-                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
-            }
             
-            Dom.setStyle(this.get('textarea'), 'display', 'none');
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
             this.get('element_cont').appendChild(this.get('element'));
             this.get('element_cont').setStyle('display', 'block');
 
 
-            //Set height and width of editor container
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
+
+            //Set height and width of editor container
             this.get('element_cont').setStyle('width', this.get('width'));
             Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
 
             this.get('iframe').setStyle('width', '100%'); //WIDTH
-            //this.get('iframe').setStyle('_width', '99%'); //WIDTH
             this.get('iframe').setStyle('height', '100%');
 
-
-            var self = this;
             window.setTimeout(function() {
-                self._setInitialContent.call(self);
-            }, 10);
-            
+                self._setupAfterElement.call(self);
+            }, 0);
             this.fireEvent('afterRender', { type: 'afterRender', target: this });
         },
         /**
@@ -4029,8 +4958,8 @@ var Dom = YAHOO.util.Dom,
         * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
         */
         execCommand: function(action, value) {
-            this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
-            if (this.STOP_EXEC_COMMAND) {
+            var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) {
                 this.STOP_EXEC_COMMAND = false;
                 return false;
             }
@@ -4039,592 +4968,2140 @@ var Dom = YAHOO.util.Dom,
                 this._getWindow().focus();
             }
             var exec = true;
-            var _sel = this._getSelection();
-            var _range = this._getRange();
-            var _selEl = this._getSelectedElement();
-            if (_selEl) {
-                _sel = _selEl;
+            
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue(action)) {
+                    exec = false;
+                }
             }
-            switch (action.toLowerCase()) {
-                case 'heading':
-                    if (this.browser.ie) {
-                        action = 'formatblock';
-                    }
-                    if (value == 'none') {
-                        if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
-                            if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
-                                _sel = _sel.parentNode;
-                            }
-                            var _span = this._getDoc().createElement('span');
-                            _span.className = 'yui-non';
-                            _span.innerHTML = _sel.innerHTML;
-                            _sel.parentNode.replaceChild(_span, _sel);
+
+            this.editorDirty = true;
+            
+            if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) {
+                var retValue = this['cmd_' + action.toLowerCase()](value);
+                exec = retValue[0];
+                if (retValue[1]) {
+                    action = retValue[1];
+                }
+                if (retValue[2]) {
+                    value = retValue[2];
+                }
+            }
+            if (exec) {
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                }
+            } else {
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+    /* {{{  Command Overrides */
+
+        /**
+        * @method cmd_backcolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used.
+        */
+        cmd_backcolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement(),
+                action = 'backcolor';
+
+            if (this.browser.gecko || this.browser.opera) {
+                this._setEditorStyle(true);
+                action = 'hilitecolor';
+            }
+            /**
+            * @browser opera
+            * @knownissue - Opera fails to assign a background color on an element that already has one.
+            *
+            if (this.browser.opera) {
+                if (!this._isElement(el, 'body') && Dom.getStyle(el, 'background-color')) {
+                    Dom.setStyle(el, 'background-color', value);
+                } else {
+                    this._createCurrentElement('span', { backgroundColor: value });
+                }
+                exec = false;
+            //} else if (!this._hasSelection()) {
+            } else if (el !== this._getDoc().body) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }*/
+
+            if (!this._isElement(el, 'body')) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }
+
+            return [exec, action];
+        },
+        /**
+        * @method cmd_forecolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used.
+        */
+        cmd_forecolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement();
+
+                if (!this._isElement(el, 'body')) {
+                    Dom.setStyle(el, 'color', value);
+                    this._selectNode(el);
+                    exec = false;
+                } else {
+                    this._createCurrentElement('span', { color: value });
+                    this._selectNode(this.currentElement[0]);
+                    exec = false;
+                }
+                return [exec];
+        },
+        /**
+        * @method cmd_unlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used.
+        */
+        cmd_unlink: function(value) {
+            this._swapEl(this.currentElement[0], 'span', function(el) {
+                el.className = 'yui-non';
+            });
+            return [false];
+        },
+        /**
+        * @method cmd_createlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used.
+        */
+        cmd_createlink: function(value) {
+            var el = this._getSelectedElement(), _a = null;
+            if (this._hasParent(el, 'a')) {
+                this.currentElement[0] = this._hasParent(el, 'a');
+            } else if (!this._isElement(el, 'a')) {
+                this._createCurrentElement('a');
+                _a = this._swapEl(this.currentElement[0], 'a');
+                this.currentElement[0] = _a;
+            } else {
+                this.currentElement[0] = el;
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_insertimage
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used.
+        */
+        cmd_insertimage: function(value) {
+            var exec = true, _img = null, action = 'insertimage',
+                el = this._getSelectedElement();
+
+            if (value === '') {
+                value = this.get('blankimage');
+            }
+
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            
+            if (this._isElement(el, 'img')) {
+                this.currentElement[0] = el;
+                exec = false;
+            } else {
+                if (this._getDoc().queryCommandEnabled(action)) {
+                    this._getDoc().execCommand('insertimage', false, value);
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                            YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                            this.currentElement[0] = imgs[i];
                         }
-                        exec = false;
+                    }
+                    exec = false;
+                } else {
+                    if (el == this._getDoc().body) {
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this._getDoc().body.appendChild(_img);
                     } else {
-                        if (this.browser.ie || this.browser.webkit || this.browser.opera) {
-                            this._createCurrentElement(value);
-                            exec = false;
+                        this._createCurrentElement('img');
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                    }
+                    this.currentElement[0] = _img;
+                    exec = false;
+                }
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_inserthtml
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used.
+        */
+        cmd_inserthtml: function(value) {
+            var exec = true, action = 'inserthtml', _span = null, _range = null;
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                this._createCurrentElement('img');
+                _span = this._getDoc().createElement('span');
+                _span.innerHTML = value;
+                this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                exec = false;
+            } else if (this.browser.ie) {
+                _range = this._getRange();
+                if (_range.item) {
+                    _range.item(0).outerHTML = value;
+                } else {
+                    _range.pasteHTML(value);
+                }
+                exec = false;                    
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_list
+        * @param tag The tag of the list you want to create (eg, ul or ol)
+        * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods.
+        */
+        cmd_list: function(tag) {
+            var exec = true, list = null, li = 0, el = null, str = '',
+                selEl = this._getSelectedElement(), action = 'insertorderedlist';
+                if (tag == 'ul') {
+                    action = 'insertunorderedlist';
+                }
+            /**
+            * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+            * @browser Safari 2.x
+            * The issue with this workaround is that when applied to a set of text
+            * that has BR's in it, Safari may or may not pick up the individual items as
+            * list items. This is fixed in WebKit (Safari 3)
+            */
+            if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) {
+                    el = selEl.parentNode;
+                    list = this._getDoc().createElement('span');
+                    YAHOO.util.Dom.addClass(list, 'yui-non');
+                    str = '';
+                    var lis = el.getElementsByTagName('li');
+                    for (li = 0; li < lis.length; li++) {
+                        str += '<div>' + lis[li].innerHTML + '</div>';
+                    }
+                    list.innerHTML = str;
+                    this.currentElement[0] = el;
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                } else {
+                    this._createCurrentElement(tag.toLowerCase());
+                    list = this._getDoc().createElement(tag);
+                    for (li = 0; li < this.currentElement.length; li++) {
+                        var newli = this._getDoc().createElement('li');
+                        newli.innerHTML = this.currentElement[li].innerHTML + '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        list.appendChild(newli);
+                        if (li > 0) {
+                            this.currentElement[li].parentNode.removeChild(this.currentElement[li]);
                         }
                     }
-                    break;
-                case 'backcolor':
-                    if (this.browser.gecko || this.browser.opera) {
-                        this._setEditorStyle(true);
-                        action = 'hilitecolor';
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                    this.currentElement[0] = list;
+                    var _h = this.currentElement[0].firstChild;
+                    _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0];
+                    this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length);
+                }
+                exec = false;
+            } else {
+                el = this._getSelectedElement();
+                if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list..
+                    if (this.browser.ie) {
+                        if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) {
+                            el = el.getElementsByTagName('li')[0];
+                        }
+                        str = '';
+                        var lis2 = el.parentNode.getElementsByTagName('li');
+                        for (var j = 0; j < lis2.length; j++) {
+                            str += lis2[j].innerHTML + '<br>';
+                        }
+                        var newEl = this._getDoc().createElement('span');
+                        newEl.innerHTML = str;
+                        el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    } else {
+                        this.nodeChange();
+                        this._getDoc().execCommand(action, '', el.parentNode);
+                        this.nodeChange();
                     }
-                    break;
-                case 'hiddenelements':
-                    this._showHidden();
-                    exec = false;
-                    break;
-                case 'unlink':
-                    //var el = this._getSelectedElement();
-                    var el = this.currentElement[0];
-                    el.removeAttribute('title');
-                    el.removeAttribute('tag');
-                    el.removeAttribute('target');
-                    el.removeAttribute('href');
-                    YAHOO.util.Dom.addClass(el, 'yui-non');
-                    YAHOO.util.Dom.removeClass(el, 'yui-tag-a');
-                    YAHOO.util.Dom.removeClass(el, 'yui-tag');
                     exec = false;
-                    break;
-                case 'createlink':
-                    var el = this._getSelectedElement();
-                    if (!el || (el.getAttribute('tag') != 'a')) {
-                        this._createCurrentElement('a');
+                }
+                if (this.browser.opera) {
+                    var self = this;
+                    window.setTimeout(function() {
+                        var liso = self._getDoc().getElementsByTagName('li');
+                        for (var i = 0; i < liso.length; i++) {
+                            if (liso[i].innerHTML.toLowerCase() == '<br>') {
+                                liso[i].parentNode.parentNode.removeChild(liso[i].parentNode);
+                            }
+                        }
+                    },30);
+                }
+                if (this.browser.ie && exec) {
+                    var html = '';
+                    if (this._getRange().html) {
+                        html = '<li>' + this._getRange().html+ '</li>';
                     } else {
-                        this.currentElement[0] = el;
+                        var t = this._getRange().text.split('\n');
+                        if (t.length > 1) {
+                            html = '';
+                            for (var ie = 0; ie < t.length; ie++) {
+                                html += '<li>' + t[ie] + '</li>';
+                            }
+                        } else {
+                            html = '<li>' + this._getRange().text + '</li>';
+                        }
                     }
+
+                    this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
                     exec = false;
-                    break;
-                case 'insertimage':
-                    if (value == '') {
-                        value = this.get('blankimage');
-                    }
-                    /**
-                    * @knownissue
-                    * @browser Safari 2.x
-                    * @description The issue here is that we have no way of knowing where the cursor position is
-                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
-                    */
-                    
-                    var el = this._getSelectedElement();
+                }
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_insertorderedlist
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used.
+        */
+        cmd_insertorderedlist: function(value) {
+            return [this.cmd_list('ol')];
+        },
+        /**
+        * @method cmd_insertunorderedlist 
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used.
+        */
+        cmd_insertunorderedlist: function(value) {
+            return [this.cmd_list('ul')];
+        },
+        /**
+        * @method cmd_fontname
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used.
+        */
+        cmd_fontname: function(value) {
+            var exec = true,
+                selEl = this._getSelectedElement();
 
-                    if (el && el.tagName && (el.tagName.toLowerCase() == 'img')) {
-                        this.currentElement[0] = el;
-                        exec = false;
-                    } else {
-                        if (this._getDoc().queryCommandEnabled(action)) {
-                            this._getDoc().execCommand('insertimage', false, value);
-                            var imgs = this._getDoc().getElementsByTagName('img');
-                            for (var i = 0; i < imgs.length; i++) {
-                                if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
-                                    YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
-                                    this.currentElement[0] = imgs[i];
-                                }
+            this.currentFont = value;
+            if (selEl && selEl.tagName && !this._hasSelection()) {
+                YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_fontsize
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used.
+        */
+        cmd_fontsize: function(value) {
+            if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection())) {
+                YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+            } else if (!this._isElement(this._getSelectedElement(), 'body')) {
+                var el = this._getSelectedElement();
+                YAHOO.util.Dom.setStyle(el, 'fontSize', value);
+                this._selectNode(el);
+            } else {
+                this._createCurrentElement('span', {'fontSize': value });
+                this._selectNode(this.currentElement[0]);
+            }
+            return [false];
+        },
+    /* }}} */
+        /**
+        * @private
+        * @method _swapEl
+        * @param {HTMLElement} el The element to swap with
+        * @param {String} tagName The tagname of the element that you wish to create
+        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.
+        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place.
+        */
+        _swapEl: function(el, tagName, callback) {
+            var _el = this._getDoc().createElement(tagName);
+            _el.innerHTML = el.innerHTML;
+            if (typeof callback == 'function') {
+                callback.call(this, _el);
+            }
+            el.parentNode.replaceChild(_el, el);
+            return _el;
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for an element with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to the 
+        * <code>this.currentElement</code> array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            tagName = ((tagName) ? tagName : 'a');
+            var tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                var el = null;
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+
+                        for (var k in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, k)) {
+                                el.style[k] = tagStyle[k];
                             }
-                            exec = false;
-                        } else {
-                            this._createCurrentElement('img');
-                            var _img = this._getDoc().createElement('img');
-                            _img.setAttribute('src', value);
-                            YAHOO.util.Dom.addClass(_img, 'yui-img');
-                            this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
-                            this.currentElement[0] = _img;
-                            exec = false;
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var j = 0; j < imgs.length; j++) {
+                        if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[j].parentNode.replaceChild(el, imgs[j]);
+                            this.currentElement[this.currentElement.length] = el;
                         }
                     }
-                    
-                    break;
-                case 'inserthtml':
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
                     /**
                     * @knownissue
                     * @browser Safari 2.x
                     * @description The issue here is that we have no way of knowing where the cursor position is
                     * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
                     */
-                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
-                        this._createCurrentElement('img');
-                        var _span = this._getDoc().createElement('span');
-                        _span.innerHTML = value;
-                        this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
-                        exec = false;
-                    } else if (this.browser.ie) {
-                        var _range = this._getRange();
-                        if (_range.item) {
-                            _range.item(0).outerHTML = value;
-                        } else {
-                            _range.pasteHTML(value);
+                    el = _elCreate();
+                    if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) {
+                        if (this._isElement(tar, 'html')) {
+                            tar = this._getDoc().body;
                         }
-                        exec = false;                    
-                    }
-                    break;
-                case 'removeformat':
-                    /**
-                    * @knownissue Remove Format issue
-                    * @browser Safari 2.x
-                    * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
-                    * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
-                    * So here we are making the best possible guess and acting on it.
-                    */
-                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
-                        this._createCurrentElement('span');
-                        YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
-                        var re= /<\S[^><]*>/g;
-                        var str = this.currentElement[0].innerHTML.replace(re, '');
-                        var _txt = this._getDoc().createTextNode(str);
-                        this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
-                        
-                        exec = false;
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
                     }
-                    break;
-                case 'superscript':
-                case 'subscript':
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
                     if (this.browser.webkit) {
-                        var tag = action.toLowerCase().substring(0, 3);
-                        this._createCurrentElement(tag);
-                        if (this.currentElement[0].parentNode.tagName.toLowerCase() == tag) {
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = this.currentElement[0].innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        if (this.browser.webkit3) {
+                            this._getSelection().collapseToStart();
                         } else {
-                            var _sub = this._getDoc().createElement(tag);
-                            _sub.innerHTML = this.currentElement[0].innerHTML;
-                            this.currentElement[0].parentNode.replaceChild(_sub, this.currentElement[0]);
-                        }
-                        exec = false;
-                    }
-                    break;
-                case 'formatblock':
-                    value = 'blockquote';
-                    if (this.browser.webkit) {
-                        this._createCurrentElement('blockquote');
-                        if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-blockquote')) {
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = this.currentElement[0].innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-                        }
-                        exec = false;
-                    } else {
-                        var tar = Event.getTarget(this.currentEvent);
-                        if (tar && tar.tagName && (tar.tagName.toLowerCase() == 'blockquote')) {
-                            var span = this._getDoc().createElement('span');
-                            span.innerHTML = tar.innerHTML;
-                            YAHOO.util.Dom.addClass(span, 'yui-non');
-                            tar.parentNode.replaceChild(span, tar);
-                            exec = false;
-                        }
-                    }
-                    break;
-                case 'indent':
-                case 'outdent':
-                    this._createCurrentElement(action.toLowerCase());
-                    if (this.currentElement[0].parentNode) {
-                        if (action.toLowerCase() == 'outdent') {
-                            if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-indent')) {
-                                var span = this._getDoc().createElement('span');
-                                span.innerHTML = this.currentElement[0].innerHTML;
-                                YAHOO.util.Dom.addClass(span, 'yui-non');
-                                this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
-                            }
+                            this._getSelection().collapse(true);
                         }
                     }
-                    exec = false;
-                    break;
-                case 'insertorderedlist':
-                case 'insertunorderedlist':
-                    /**
-                    * @knownissue Safari 2.+ doesn't support ordered and unordered lists
-                    * @browser Safari 2.x
-                    * The issue with this workaround is that when applied to a set of text
-                    * that has BR's in it, Safari may or may not pick up the individual items as
-                    * list items. This is fixed in WebKit (Safari 3)
-                    */
-                    var tag = ((action.toLowerCase() == 'insertorderedlist') ? 'ol' : 'ul');
-                    //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) || this.browser.opera) {
-                    if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
-                        var selEl = this._getSelectedElement();
-                        if ((selEl.tagName.toLowerCase() == 'li') && (selEl.parentNode.tagName.toLowerCase() == tag)) {
-                            var el = selEl.parentNode;
-                            var list = this._getDoc().createElement('span');
-                            YAHOO.util.Dom.addClass(list, 'yui-non');
-                            var str = '';
-                            var lis = el.getElementsByTagName('li');
-                            for (var i = 0; i < lis.length; i++) {
-                                str += lis[i].innerHTML + '<br>';
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                var _tmp6 = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);
+                for (var e1 = 0; e1 < _tmp1.length; e1++) {
+                    _tmp[_tmp.length] = _tmp1[e1];
+                }
+                for (var e6 = 0; e6 < _tmp6.length; e6++) {
+                    _tmp[_tmp.length] = _tmp6[e6];
+                }
+                for (var e2 = 0; e2 < _tmp2.length; e2++) {
+                    _tmp[_tmp.length] = _tmp2[e2];
+                }
+                for (var e3 = 0; e3 < _tmp3.length; e3++) {
+                    _tmp[_tmp.length] = _tmp3[e3];
+                }
+                for (var e4 = 0; e4 < _tmp4.length; e4++) {
+                    _tmp[_tmp.length] = _tmp4[e4];
+                }
+                for (var e5 = 0; e5 < _tmp5.length; e5++) {
+                    _tmp[_tmp.length] = _tmp5[e5];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) {
+                            var fc = _tmp[i].getElementsByTagName('li')[0];
+                            _tmp[i].style.fontFamily = 'inherit';
+                            fc.style.fontFamily = 'inherit';
+                            el.innerHTML = fc.innerHTML;
+                            fc.innerHTML = '';
+                            fc.appendChild(el);
+                            this.currentElement[this.currentElement.length] = el;
+                        } else if (this._isElement(_tmp[i], 'li')) {
+                            _tmp[i].innerHTML = '';
+                            _tmp[i].appendChild(el);
+                            _tmp[i].style.fontFamily = 'inherit';
+                            this.currentElement[this.currentElement.length] = el;
+                        } else {
+                            if (_tmp[i].parentNode) {
+                                _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                                this.currentElement[this.currentElement.length] = el;
+                                this.currentEvent = null;
+                                if (this.browser.webkit) {
+                                    //Force Safari to focus the new element
+                                    this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                    if (this.browser.webkit3) {
+                                        this._getSelection().collapseToStart();
+                                    } else {
+                                        this._getSelection().collapse(true);
+                                    }
+                                }
+                                if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                    this._getSelection().empty();
+                                }
+                                if (this.browser.gecko) {
+                                    this._getSelection().collapseToStart();
+                                }
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var e = 0; e < len; e++) {
+                    if ((e + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[e] && this.currentElement[e].nextSibling) {
+                            if (this._isElement(this.currentElement[e], 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[e].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        * @return String
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('element').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            html = this._cleanIncomingHTML(html);
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            var b = this._getDoc().body;
+            if (b === null) {
+                return null;
+            }
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method show
+        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.
+        */
+        show: function() {
+            if (this.browser.gecko) {
+                this._setDesignMode('on');
+                this._focusWindow();
+            }
+            if (this.browser.webkit) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._setInitialContent.call(self);
+                }, 10);
+            }
+            //Adding this will close all other Editor window's when showing this one.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            //Put the iframe back in place
+            this.get('iframe').setStyle('position', 'static');
+            this.get('iframe').setStyle('left', '');
+        },
+        /**
+        * @method hide
+        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.
+        */
+        hide: function() {
+            //Adding this will close all other Editor window's.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this._fixNodesTimer) {
+                clearTimeout(this._fixNodesTimer);
+                this._fixNodesTimer = null;
+            }
+            if (this._nodeChangeTimer) {
+                clearTimeout(this._nodeChangeTimer);
+                this._nodeChangeTimer = null;
+            }
+            this._lastNodeChange = 0;
+            //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.
+            this.get('iframe').setStyle('position', 'absolute');
+            this.get('iframe').setStyle('left', '-9999px');
+        },
+        /**
+        * @method _cleanIncomingHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the input
+        * @return {String} The filtered HTML
+        */
+        _cleanIncomingHTML: function(html) {
+            html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+            html = html.replace(/<\/strong>/gi, '</b>');   
+
+            //replace embed before em check
+            html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+            html = html.replace(/<\/embed>/gi, '</YUI_EMBED>');
+
+            html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+            html = html.replace(/<\/em>/gi, '</i>');
+            
+            //Put embed tags back in..
+            html = html.replace(/<YUI_EMBED([^>]*)>/gi, '<embed$1>');
+            html = html.replace(/<\/YUI_EMBED>/gi, '</embed>');
+            if (this.get('plainText')) {
+                html = html.replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+                html = html.replace(/  /gi, '&nbsp;&nbsp;'); //Replace all double spaces
+                html = html.replace(/\t/gi, '&nbsp;&nbsp;&nbsp;&nbsp;'); //Replace all tabs
+            }
+            //Removing Script Tags from the Editor
+            html = html.replace(/<script([^>]*)>/gi, '<bad>');
+            html = html.replace(/<\/script([^>]*)>/gi, '</bad>');
+            html = html.replace(/&lt;script([^>]*)&gt;/gi, '<bad>');
+            html = html.replace(/&lt;\/script([^>]*)&gt;/gi, '</bad>');
+            //Replace the line feeds
+            html = html.replace(/\n/g, '<YUI_LF>').replace(/\r/g, '<YUI_LF>');
+            //Remove Bad HTML elements (used to be script nodes)
+            html = html.replace(new RegExp('<bad([^>]*)>(.*?)<\/bad>', 'gi'), '');
+            //Replace the lines feeds
+            html = html.replace(/<YUI_LF>/g, '\n');
+            return html;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @return {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                html = this.getEditorHTML();
+            }
+            var markup = this.get('markup');
+            //Make some backups...
+            html = this.pre_filter_linebreaks(html, markup);
+
+                   html = html.replace(/<img([^>]*)\/>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+
+                   html = html.replace(/<input([^>]*)\/>/gi, '<YUI_INPUT$1>');
+                   html = html.replace(/<input([^>]*)>/gi, '<YUI_INPUT$1>');
+
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+                   html = html.replace(/<blockquote([^>]*)>/gi, '<YUI_BQ$1>');
+                   html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>');
+
+                   html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+                   html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>');
+
+            //Convert b and i tags to strong and em tags
+            if ((markup == 'semantic') || (markup == 'xhtml')) {
+                html = html.replace(/<i(\s+[^>]*)?>/gi, '<em$1>');
+                html = html.replace(/<\/i>/gi, '</em>');
+                html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                html = html.replace(/<\/b>/gi, '</strong>');
+            }
+            
+            //Case Changing
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+            if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) {
+                html = html.replace(new RegExp('<font([^>]*)face="([^>]*)">(.*?)<\/font>', 'gi'), '<span $1 style="font-family: $2;">$3</span>');
+                html = html.replace(/<u/gi, '<span style="text-decoration: underline;"');
+                html = html.replace(/\/u>/gi, '/span>');
+                if (markup == 'css') {
+                    html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+                    html = html.replace(/<\/em>/gi, '</i>');
+                    html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+                    html = html.replace(/<\/strong>/gi, '</b>');
+                    html = html.replace(/<b/gi, '<span style="font-weight: bold;"');
+                    html = html.replace(/\/b>/gi, '/span>');
+                    html = html.replace(/<i/gi, '<span style="font-style: italic;"');
+                    html = html.replace(/\/i>/gi, '/span>');
+                }
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            } else {
+                       html = html.replace(/<u/gi, '<u');
+                       html = html.replace(/\/u>/gi, '/u>');
+            }
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+            html = this.filter_safari(html);
+
+            html = this.filter_internals(html);
+
+            html = this.filter_all_rgb(html);
+
+            //Replace our backups with the real thing
+            html = this.post_filter_linebreaks(html, markup);
+
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1 />');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1 />');
+            } else {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1>');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1>');
+            }
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            html = this.filter_invalid_lists(html);
+
+                   html = html.replace(/<YUI_BQ([^>]*)>/g, '<blockquote$1>');
+                   html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>');
+
+                   html = html.replace(/<YUI_EMBED([^>]*)>/g, '<embed$1>');
+                   html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>');
+
+            //Trim the output, removing whitespace from the beginning and end
+            html = YAHOO.lang.trim(html);
+
+            if (this.get('removeLineBreaks')) {
+                html = html.replace(/\n/g, '').replace(/\r/g, '');
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            }
+            
+            //First empty span
+            if (html.substring(0, 6).toLowerCase() == '<span>')  {
+                html = html.substring(6);
+                //Last empty span
+                if (html.substring(html.length - 7, html.length).toLowerCase() == '</span>')  {
+                    html = html.substring(0, html.length - 7);
+                }
+            }
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (Lang.isObject(v) && v.keepContents) {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1');
+                    } else {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '');
+                    }
+                }
+            }
+
+            this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html });
+
+            return html;
+        },
+        /**
+        * @method filter_invalid_lists
+        * @param String html The HTML string to filter
+        * @description Filters invalid ol and ul list markup, converts this: <li></li><ol>..</ol> to this: <li></li><li><ol>..</ol></li>
+        */
+        filter_invalid_lists: function(html) {
+            html = html.replace(/<\/li>\n/gi, '</li>');
+
+            html = html.replace(/<\/li><ol>/gi, '</li><li><ol>');
+            html = html.replace(/<\/ol>/gi, '</ol></li>');
+            html = html.replace(/<\/ol><\/li>\n/gi, "</ol>\n");
+
+            html = html.replace(/<\/li><ul>/gi, '</li><li><ul>');
+            html = html.replace(/<\/ul>/gi, '</ul></li>');
+            html = html.replace(/<\/ul><\/li>\n/gi, "</ul>\n");
+
+            html = html.replace(/<\/li>/gi, "</li>\n");
+            html = html.replace(/<\/ol>/gi, "</ol>\n");
+            html = html.replace(/<ol>/gi, "<ol>\n");
+            html = html.replace(/<ul>/gi, "<ul>\n");
+            return html;
+        },
+        /**
+        * @method filter_safari
+        * @param String html The HTML string to filter
+        * @description Filters strings specific to Safari
+        * @return String
+        */
+        filter_safari: function(html) {
+            if (this.browser.webkit) {
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+                //Remove bogus LI's
+                html = html.replace(/<li><\/li>/gi, '');
+                html = html.replace(/<li> <\/li>/gi, '');
+                html = html.replace(/<li>  <\/li>/gi, '');
+                //Remove bogus DIV's
+                html = html.replace(/<div><\/div>/gi, '');
+                html = html.replace(/<div> <\/div>/gi, '');
+            }
+            return html;
+        },
+        /**
+        * @method filter_internals
+        * @param String html The HTML string to filter
+        * @description Filters internal RTE strings and bogus attrs we don't want
+        * @return String
+        */
+        filter_internals: function(html) {
+                   html = html.replace(/\r/g, '');
+            //Fix stuff we don't want
+               html = html.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+            //Fix last BR in LI
+                   html = html.replace(/<YUI_BR><\/li>/gi, '</li>');
+
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ style=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            if (this.browser.ie) {
+                       html = html.replace(/ class= /gi, '');
+                       html = html.replace(/ class= >/gi, '');
+                       html = html.replace(/_height="([^>])"/gi, '');
+                       html = html.replace(/_width="([^>])"/gi, '');
+            }
+            
+            return html;
+        },
+        /**
+        * @method filter_all_rgb
+        * @param String str The HTML string to filter
+        * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00"
+        * @return String
+        */
+        filter_all_rgb: function(str) {
+            var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi");
+            var arr = str.match(exp);
+            if (Lang.isArray(arr)) {
+                for (var i = 0; i < arr.length; i++) {
+                    var color = this.filter_rgb(arr[i]);
+                    str = str.replace(arr[i].toString(), color);
+                }
+            }
+            
+            return str;
+        },
+        /**
+        * @method filter_rgb
+        * @param String css The CSS string containing rgb(#,#,#);
+        * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00
+        * @return String
+        */
+        filter_rgb: function(css) {
+            if (css.toLowerCase().indexOf('rgb') != -1) {
+                var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+                var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(',');
+            
+                if (rgb.length == 5) {
+                    var r = parseInt(rgb[1], 10).toString(16);
+                    var g = parseInt(rgb[2], 10).toString(16);
+                    var b = parseInt(rgb[3], 10).toString(16);
+
+                    r = r.length == 1 ? '0' + r : r;
+                    g = g.length == 1 ? '0' + g : g;
+                    b = b.length == 1 ? '0' + b : b;
+
+                    css = "#" + r + g + b;
+                }
+            }
+            return css;
+        },
+        /**
+        * @method pre_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        pre_filter_linebreaks: function(html, markup) {
+            if (this.browser.webkit) {
+                       html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                       html = html.replace(/<br class="webkit-block-placeholder">/gi, '<YUI_BR>');
+            }
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br (.*?)>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<br \/>/gi, '<YUI_BR>');
+                   html = html.replace(/<div><YUI_BR><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+            //Fix last BR
+               html = html.replace(/<YUI_BR>$/, '');
+            //Fix last BR in P
+               html = html.replace(/<YUI_BR><\/p>/g, '</p>');
+            return html;
+        },
+        /**
+        * @method post_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        post_filter_linebreaks: function(html, markup) {
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_BR>/g, '<br />');
+            } else {
+                       html = html.replace(/<YUI_BR>/g, '<br>');
+            }
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Override Method for Advanced Editor
+        */
+        _renderPanel: function() {
+        },
+        /**
+        * @method openWindow
+        * @description Override Method for Advanced Editor
+        */
+        openWindow: function(win) {
+        },
+        /**
+        * @method moveWindow
+        * @description Override Method for Advanced Editor
+        */
+        moveWindow: function() {
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        _closeWindow: function() {
+        },
+        /**
+        * @method closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        closeWindow: function() {
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.resetAllButtons();
+            this._focusWindow();        
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            var textArea = this.get('element');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            this.set('handleSubmit', false); //Remove the submit handler
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'SimpleEditor';
+            if (this.get && this.get('element_cont')) {
+                str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event cleanHTML
+* @description Event is fired after the cleanHTML method is called.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property _instances
+        * @description A reference to all editors on the page.
+        * @type Object
+        */
+        _instances: {},
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>
+        */
+        panel: null,
+        /**
+        * @method getEditorById
+        * @description Returns a reference to the Editor object associated with the given textarea
+        * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of
+        * @return Object <a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a>
+        */
+        getEditorById: function(id) {
+            if (!YAHOO.lang.isString(id)) {
+                //Not a string, assume a node Reference
+                id = id.id;
+            }
+            if (this._instances[id]) {
+                return this._instances[id];
+            }
+            return false;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorInfo.
+        * @return {String}
+        */
+        toString: function() {
+            var len = 0;
+            for (var i in this._instances) {
+                len++;
+            }
+            return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')';
+        }
+    };
+
+
+
+    
+})();
+/**
+ * @module editor
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, container_core, simpleeditor
+ * @optional dragdrop, animation, menu, button
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    Toolbar = YAHOO.widget.Toolbar;
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class Editor
+     * @extends YAHOO.widget.SimpleEditor
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.Editor = function(el, attrs) {
+        YAHOO.widget.Editor.superclass.constructor.call(this, el, attrs);
+    };
+
+    /**
+    * @private
+    * @method _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @return {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+
+    YAHOO.extend(YAHOO.widget.Editor, YAHOO.widget.SimpleEditor, {
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',    
+        /**
+        * @property STR_CLOSE_WINDOW
+        * @description The Title of the close button in the Editor Window
+        * @type String
+        */
+        STR_CLOSE_WINDOW: 'Close Window',
+        /**
+        * @property STR_CLOSE_WINDOW_NOTE
+        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
+        * @type String
+        */
+        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Control + Shift + W key',
+        /**
+        * @property STR_IMAGE_PROP_TITLE
+        * @description The title for the Image Property Editor Window
+        * @type String
+        */
+        STR_IMAGE_PROP_TITLE: 'Image Options',
+        /**
+        * @property STR_IMAGE_URL
+        * @description The label string for Image URL
+        * @type String
+        */
+        STR_IMAGE_URL: 'Image Url',
+        /**
+        * @property STR_IMAGE_TITLE
+        * @description The label string for Image Description
+        * @type String
+        */
+        STR_IMAGE_TITLE: 'Description',
+        /**
+        * @property STR_IMAGE_SIZE
+        * @description The label string for Image Size
+        * @type String
+        */
+        STR_IMAGE_SIZE: 'Size',
+        /**
+        * @property STR_IMAGE_ORIG_SIZE
+        * @description The label string for Original Image Size
+        * @type String
+        */
+        STR_IMAGE_ORIG_SIZE: 'Original Size',
+        /**
+        * @property STR_IMAGE_COPY
+        * @description The label string for the image copy and paste message for Opera and Safari
+        * @type String
+        */
+        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
+        /**
+        * @property STR_IMAGE_PADDING
+        * @description The label string for the image padding.
+        * @type String
+        */
+        STR_IMAGE_PADDING: 'Padding',
+        /**
+        * @property STR_IMAGE_BORDER
+        * @description The label string for the image border.
+        * @type String
+        */
+        STR_IMAGE_BORDER: 'Border',
+        /**
+        * @property STR_IMAGE_TEXTFLOW
+        * @description The label string for the image text flow.
+        * @type String
+        */
+        STR_IMAGE_TEXTFLOW: 'Text Flow',
+        /**
+        * @property STR_LOCAL_FILE_WARNING
+        * @description The label string for the local file warning.
+        * @type String
+        */
+        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
+        /**
+        * @property STR_LINK_PROP_TITLE
+        * @description The label string for the Link Property Editor Window.
+        * @type String
+        */
+        STR_LINK_PROP_TITLE: 'Link Options',
+        /**
+        * @property STR_LINK_PROP_REMOVE
+        * @description The label string for the Remove link from text link inside the property editor.
+        * @type String
+        */
+        STR_LINK_PROP_REMOVE: 'Remove link from text',
+        /**
+        * @property STR_LINK_NEW_WINDOW
+        * @description The string for the open in a new window label.
+        * @type String
+        */
+        STR_LINK_NEW_WINDOW: 'Open in a new window.',
+        /**
+        * @property STR_LINK_TITLE
+        * @description The string for the link description.
+        * @type String
+        */
+        STR_LINK_TITLE: 'Description',
+        /**
+        * @protected
+        * @property CLASS_LOCAL_FILE
+        * @description CSS class applied to an element when it's found to have a local url.
+        * @type String
+        */
+        CLASS_LOCAL_FILE: 'warning-localfile',
+        /**
+        * @protected
+        * @property CLASS_HIDDEN
+        * @description CSS class applied to the body when the hiddenelements button is pressed.
+        * @type String
+        */
+        CLASS_HIDDEN: 'yui-hidden',
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+
+            this._defaultToolbar = {
+                collapse: true,
+                titlebar: 'Text Editing Tools',
+                draggable: false,
+                buttonType: 'advanced',
+                buttons: [
+                    { group: 'fontstyle', label: 'Font Name and Size',
+                        buttons: [
+                            { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                menu: [
+                                    { text: 'Arial', checked: true },
+                                    { text: 'Arial Black' },
+                                    { text: 'Comic Sans MS' },
+                                    { text: 'Courier New' },
+                                    { text: 'Lucida Console' },
+                                    { text: 'Tahoma' },
+                                    { text: 'Times New Roman' },
+                                    { text: 'Trebuchet MS' },
+                                    { text: 'Verdana' }
+                                ]
+                            },
+                            { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'textstyle', label: 'Font Style',
+                        buttons: [
+                            { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                            { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                            { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                            { type: 'separator' },
+                            { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
+                            { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
+                            { type: 'separator' },
+                            { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                            { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
+                            { type: 'separator' },
+                            { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
+                            { type: 'push', label: 'Show/Hide Hidden Elements', value: 'hiddenelements' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'alignment', label: 'Alignment',
+                        buttons: [
+                            { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
+                            { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
+                            { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
+                            { type: 'push', label: 'Justify', value: 'justifyfull' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'parastyle', label: 'Paragraph Style',
+                        buttons: [
+                        { type: 'select', label: 'Normal', value: 'heading', disabled: true,
+                            menu: [
+                                { text: 'Normal', value: 'none', checked: true },
+                                { text: 'Header 1', value: 'h1' },
+                                { text: 'Header 2', value: 'h2' },
+                                { text: 'Header 3', value: 'h3' },
+                                { text: 'Header 4', value: 'h4' },
+                                { text: 'Header 5', value: 'h5' },
+                                { text: 'Header 6', value: 'h6' }
+                            ]
+                        }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'indentlist', label: 'Indenting and Lists',
+                        buttons: [
+                            { type: 'push', label: 'Indent', value: 'indent', disabled: true },
+                            { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
+                            { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                            { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                        ]
+                    },
+                    { type: 'separator' },
+                    { group: 'insertitem', label: 'Insert Item',
+                        buttons: [
+                            { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                            { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                        ]
+                    }
+                ]
+            };
+
+            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute localFileWarning
+            * @description Should we throw the warning if we detect a file that is local to their machine?
+            * @default true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('localFileWarning', {
+                value: attr.locaFileWarning || true
+            });
+
+            /**
+            * @attribute hiddencss
+            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
+            * @default <code><pre>
+            .yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div, .yui-hidden p, .yui-hidden span, .yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table {
+                border: 1px dotted #ccc;
+            }
+            .yui-hidden .yui-non {
+                border: none;
+            }
+            .yui-hidden img {
+                padding: 2px;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('hiddencss', {
+                value: attr.hiddencss || '.yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }',
+                writeOnce: true
+            });
+           
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            YAHOO.widget.Editor.superclass._fixNodes.call(this);
+            var url = '';
+
+            var imgs = this._getDoc().getElementsByTagName('img');
+            for (var im = 0; im < imgs.length; im++) {
+                if (imgs[im].getAttribute('href', 2)) {
+                    url = imgs[im].getAttribute('src', 2);
+                    if (this._isLocalFile(url)) {
+                        Dom.addClass(imgs[im], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(imgs[im], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+            var fakeAs = this._getDoc().body.getElementsByTagName('a');
+            for (var a = 0; a < fakeAs.length; a++) {
+                if (fakeAs[a].getAttribute('href', 2)) {
+                    url = fakeAs[a].getAttribute('href', 2);
+                    if (this._isLocalFile(url)) {
+                        Dom.addClass(fakeAs[a], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(fakeAs[a], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { 'outdent': true },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { hiddenelements: true },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Override method that handles some new keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            YAHOO.widget.Editor.superclass._handleKeyDown.call(this, ev);
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 219: //Left
+                    action = 'justifyleft';
+                    break;
+                case 220: //Center
+                    action = 'justifycenter';
+                    break;
+                case 221: //Right
+                    action = 'justifyright';
+                    break;
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+        },        
+        _handleCreateLinkClick: function() {
+            var el = this._getSelectedElement();
+            if (this._isElement(el, 'img')) {
+                this.STOP_EXEC_COMMAND = true;
+                this.currentElement[0] = el;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                return false;
+            }
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    return false;
+                }
+            }
+            
+            this.on('afterExecCommand', function() {
+
+                var win = new YAHOO.widget.EditorWindow('createlink', {
+                    width: '350px'
+                });
+                
+                var el = this.currentElement[0],
+                    url = '',
+                    title = '',
+                    target = '',
+                    localFile = false;
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                        if (this._isLocalFile(url)) {
+                            //Local File throw Warning
+                            win.setFooter(this.STR_LOCAL_FILE_WARNING);
+                            localFile = true;
+                        } else {
+                            win.setFooter(' ');
+                        }
+                    }
+                    if (el.getAttribute('title') !== null) {
+                        title = el.getAttribute('title');
+                    }
+                    if (el.getAttribute('target') !== null) {
+                        target = el.getAttribute('target');
+                    }
+                }
+                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
+                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
+                
+                var body = document.createElement('div');
+                body.innerHTML = str;
+
+                var unlinkCont = document.createElement('div');
+                unlinkCont.className = 'removeLink';
+                var unlink = document.createElement('a');
+                unlink.href = '#';
+                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
+                unlink.title = this.STR_LINK_PROP_REMOVE;
+                Event.on(unlink, 'click', function(ev) {
+                    Event.stopEvent(ev);
+                    this.execCommand('unlink');
+                    this.closeWindow();
+                }, this, true);
+                unlinkCont.appendChild(unlink);
+                body.appendChild(unlinkCont);
+
+                win.setHeader(this.STR_LINK_PROP_TITLE);
+                win.setBody(body);
+
+                Event.onAvailable('createlink_url', function() {
+                    window.setTimeout(function() {
+                        try {
+                            YAHOO.util.Dom.get('createlink_url').focus();
+                        } catch (e) {}
+                    }, 50);
+                    Event.on('createlink_url', 'blur', function() {
+                        var url = Dom.get('createlink_url');
+                        if (this._isLocalFile(url.value)) {
+                            //Local File throw Warning
+                            Dom.addClass(url, 'warning');
+                            this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
+                        } else {
+                            Dom.removeClass(url, 'warning');
+                            this.get('panel').setFooter(' ');
+                        }
+                    }, this, true);
+                }, this, true);
+
+                this.openWindow(win);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            var url = Dom.get('createlink_url'),
+                target = Dom.get('createlink_target'),
+                title = Dom.get('createlink_title'),
+                el = this.currentElement[0],
+                a = el;
+            if (url && url.value) {
+                var urlValue = url.value;
+                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        //Found an @ sign, prefix with mailto:
+                        urlValue = 'mailto:' + urlValue;
+                    } else {
+                        /* :// not found adding */
+                        if (urlValue.substring(0, 1) != '#') {
+                            urlValue = 'http:/'+'/' + urlValue;
+                        }
+                        
+                    }
+                }
+                el.setAttribute('href', urlValue);
+                if (target.checked) {
+                    el.setAttribute('target', target.value);
+                } else {
+                    el.setAttribute('target', '');
+                }
+                el.setAttribute('title', ((title.value) ? title.value : ''));
+
+            } else {
+                var _span = this._getDoc().createElement('span');
+                _span.innerHTML = el.innerHTML;
+                Dom.addClass(_span, 'yui-non');
+                el.parentNode.replaceChild(_span, el);
+            }
+            this.nodeChange();
+            this.currentElement = [];
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    return false;
+                }
+            }
+            this._setBusy();
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    body = null,
+                    link = '',
+                    target = '',
+                    title = '',
+                    src = '',
+                    align = '',
+                    height = 75,
+                    width = 75,
+                    padding = 0,
+                    oheight = 0,
+                    owidth = 0,
+                    blankimage = false,
+                    win = new YAHOO.widget.EditorWindow('insertimage', {
+                        width: '415px'
+                    });
+
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                            blankimage = true;
+                        }
+                    }
+                    if (el.getAttribute('alt', 2)) {
+                        title = el.getAttribute('alt', 2);
+                    }
+                    if (el.getAttribute('title', 2)) {
+                        title = el.getAttribute('title', 2);
+                    }
+
+                    if (el.parentNode && this._isElement(el.parentNode, 'a')) {
+                        link = el.parentNode.getAttribute('href', 2);
+                        if (el.parentNode.getAttribute('target') !== null) {
+                            target = el.parentNode.getAttribute('target');
+                        }
+                    }
+                    height = parseInt(el.height, 10);
+                    width = parseInt(el.width, 10);
+                    if (el.style.height) {
+                        height = parseInt(el.style.height, 10);
+                    }
+                    if (el.style.width) {
+                        width = parseInt(el.style.width, 10);
+                    }
+                    if (el.style.margin) {
+                        padding = parseInt(el.style.margin, 10);
+                    }
+                    if (!el._height) {
+                        el._height = height;
+                    }
+                    if (!el._width) {
+                        el._width = width;
+                    }
+                    oheight = el._height;
+                    owidth = el._width;
+                }
+                var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
+                body = document.createElement('div');
+                body.innerHTML = str;
+
+                var tbarCont = document.createElement('div');
+                tbarCont.id = 'img_toolbar';
+                body.appendChild(tbarCont);
+
+                var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
+                str2 += '<label for="insertimage_link"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="insertimage_link" id="insertimage_link" value="' + link + '"></label>';
+                str2 += '<label for="insertimage_target"><strong>&nbsp;</strong><input type="checkbox" name="insertimage_target_" id="insertimage_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                var div = document.createElement('div');
+                div.innerHTML = str2;
+                body.appendChild(div);
+                win.cache = body;
+
+                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
+                    /* {{{ */ 
+                    buttonType: this._defaultToolbar.buttonType,
+                    buttons: [
+                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
+                            buttons: [
+                                { type: 'push', label: 'Left', value: 'left' },
+                                { type: 'push', label: 'Inline', value: 'inline' },
+                                { type: 'push', label: 'Block', value: 'block' },
+                                { type: 'push', label: 'Right', value: 'right' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
+                            buttons: [
+                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
+                            buttons: [
+                                { type: 'select', label: 'Border Size', value: 'bordersize',
+                                    menu: [
+                                        { text: 'none', value: '0', checked: true },
+                                        { text: '1px', value: '1' },
+                                        { text: '2px', value: '2' },
+                                        { text: '3px', value: '3' },
+                                        { text: '4px', value: '4' },
+                                        { text: '5px', value: '5' }
+                                    ]
+                                },
+                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
+                                    menu: [
+                                        { text: 'Solid', value: 'solid', checked: true },
+                                        { text: 'Dashed', value: 'dashed' },
+                                        { text: 'Dotted', value: 'dotted' }
+                                    ]
+                                },
+                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                });
+                
+                var bsize = '0';
+                var btype = 'solid';
+                if (el.style.borderLeftWidth) {
+                    bsize = parseInt(el.style.borderLeftWidth, 10);
+                }
+                if (el.style.borderLeftStyle) {
+                    btype = el.style.borderLeftStyle;
+                }
+                var bs_button = tbar.getButtonByValue('bordersize');
+                var bSizeStr = ((parseInt(bsize, 10) > 0) ? '' : 'none');
+                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
+                this._updateMenuChecked('bordersize', bsize, tbar);
+
+                var bt_button = tbar.getButtonByValue('bordertype');
+                bt_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '"></span>');
+                this._updateMenuChecked('bordertype', btype, tbar);
+                if (parseInt(bsize, 10) > 0) {
+                    tbar.enableButton(bt_button);
+                    tbar.enableButton(bs_button);
+                }
+
+                var cont = tbar.get('cont');
+                var hw = document.createElement('div');
+                hw.className = 'yui-toolbar-group yui-toolbar-group-height-width height-width';
+                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
+                var orgSize = '';
+                if ((height != oheight) || (width != owidth)) {
+                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                }
+                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
+                cont.insertBefore(hw, cont.firstChild);
+
+                Event.onAvailable('insertimage_width', function() {
+                    Event.on('insertimage_width', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_width').value, 10);
+                        if (value > 5) {
+                            el.style.width = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+                Event.onAvailable('insertimage_height', function() {
+                    Event.on('insertimage_height', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_height').value, 10);
+                        if (value > 5) {
+                            el.style.height = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+
+                if ((el.align == 'right') || (el.align == 'left')) {
+                    tbar.selectButton(el.align);
+                } else if (el.style.display == 'block') {
+                    tbar.selectButton('block');
+                } else {
+                    tbar.selectButton('inline');
+                }
+                if (parseInt(el.style.marginLeft, 10) > 0) {
+                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft, 10));
+                }
+                if (el.style.borderSize) {
+                    tbar.selectButton('bordersize');
+                    tbar.selectButton(parseInt(el.style.borderSize, 10));
+                }
+
+                tbar.on('colorPickerClicked', function(o) {
+                    var size = '1', type = 'solid', color = 'black';
+
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth, 10);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    var borderString = size + 'px ' + type + ' #' + o.color;
+                    el.style.border = borderString;
+                }, this.toolbar, true);
+
+                tbar.on('buttonClick', function(o) {
+                    var value = o.button.value,
+                        borderString = '';
+                    if (o.button.menucmd) {
+                        value = o.button.menucmd;
+                    }
+                    var size = '1', type = 'solid', color = 'black';
+
+                    /* All border calcs are done on the left border
+                        since our default interface only supports
+                        one border size/type and color */
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth, 10);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    switch(value) {
+                        case 'bordersize':
+                            if (this.browser.webkit && this._lastImage) {
+                                Dom.removeClass(this._lastImage, 'selected');
+                                this._lastImage = null;
                             }
-                            list.innerHTML = str;
 
-                        } else {
-                            this._createCurrentElement(tag.toLowerCase());
-                            var el = this.currentElement[0];
-                            var list = this._getDoc().createElement(tag);
-                            if (tag == 'ol') {
-                                list.type = value;
+                            borderString = parseInt(o.button.value, 10) + 'px ' + type + ' ' + color;
+                            el.style.border = borderString;
+                            if (parseInt(o.button.value, 10) > 0) {
+                                tbar.enableButton('bordertype');
+                                tbar.enableButton('bordercolor');
+                            } else {
+                                tbar.disableButton('bordertype');
+                                tbar.disableButton('bordercolor');
+                            }
+                            break;
+                        case 'bordertype':
+                            if (this.browser.webkit && this._lastImage) {
+                                Dom.removeClass(this._lastImage, 'selected');
+                                this._lastImage = null;
                             }
-                            var li = this._getDoc().createElement('li');
-                            li.innerHTML = el.innerHTML + '&nbsp;';
-                            list.appendChild(li);
+                            borderString = size + 'px ' + o.button.value + ' ' + color;
+                            el.style.border = borderString;
+                            break;
+                        case 'right':
+                        case 'left':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = o.button.value;
+                            break;
+                        case 'inline':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = '';
+                            break;
+                        case 'block':
+                            tbar.deselectAllButtons();
+                            el.style.display = 'block';
+                            el.align = 'center';
+                            break;
+                        case 'padding':
+                            var _button = tbar.getButtonById(o.button.id);
+                            el.style.margin = _button.get('label') + 'px';
+                            break;
+                    }
+                    tbar.selectButton(o.button.value);
+                    this.moveWindow();
+                }, this, true);
+
+                win.setHeader(this.STR_IMAGE_PROP_TITLE);
+                win.setBody(body);
+                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                    win.setFooter(this.STR_IMAGE_COPY);
+                }
+                this.openWindow(win);
+
+                //Set event after openWindow..
+                Event.onAvailable('insertimage_url', function() {
+
+                    this.toolbar.selectButton('insertimage');
+
+                    window.setTimeout(function() {
+                        YAHOO.util.Dom.get('insertimage_url').focus();
+                        if (blankimage) {
+                            YAHOO.util.Dom.get('insertimage_url').select();
                         }
-                        el.parentNode.replaceChild(list, el);
-                        exec = false;
-                    } else {
-                        var el = this._getSelectedElement();
-                        if ((el.tagName.toLowerCase() == 'li') && (el.parentNode.tagName.toLowerCase() == tag) || (this.browser.ie && this._getRange().parentElement && this._getRange().parentElement.tagName && (this._getRange().parentElement.tagName.toLowerCase() == 'li'))) { //we are in a list..
-                            if (this.browser.ie) {
-                                exec = false;
-                                var str = '';
-                                var lis = el.parentNode.getElementsByTagName('li');
-                                for (var i = 0; i < lis.length; i++) {
-                                    str += lis[i].innerHTML + '<br>';
-                                }
-                                var newEl = this._getDoc().createElement('span');
-                                newEl.innerHTML = str;
-                                el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    }, 50);
+                    
+                    if (this.get('localFileWarning')) {
+                        Event.on('insertimage_link', 'blur', function() {
+                            var url = Dom.get('insertimage_link');
+                            if (this._isLocalFile(url.value)) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
                             } else {
-                                this.nodeChange();
-                                this._getDoc().execCommand(action, '', el.parentNode);
-                                this.nodeChange();
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    this.get('panel').setFooter(this.STR_IMAGE_COPY);
+                                }
                             }
-                        }
-                        if (this.browser.opera) {
-                            var self = this;
-                            window.setTimeout(function() {
-                                var lis = self._getDoc().getElementsByTagName('li');
-                                for (var i = 0; i < lis.length; i++) {
-                                    if (lis[i].innerHTML.toLowerCase() == '<br>') {
-                                        lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);
+                        }, this, true);
+
+                        Event.on('insertimage_url', 'blur', function() {
+                            var url = Dom.get('insertimage_url');
+                            if (this._isLocalFile(url.value)) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING);
+                            } else if (this.currentElement[0]) {
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    this.get('panel').setFooter(this.STR_IMAGE_COPY);
+                                }
+                                
+                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                                    this.currentElement[0].setAttribute('src', url.value);
+                                    var self = this,
+                                        img = new Image();
+
+                                    img.onerror = function() {
+                                        url.value = self.STR_IMAGE_HERE;
+                                        img.setAttribute('src', self.get('blankimage'));
+                                        self.currentElement[0].setAttribute('src', self.get('blankimage'));
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                    };
+                                    window.setTimeout(function() {
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                        if (self.currentElement && self.currentElement[0]) {
+                                            if (!self.currentElement[0]._height) {
+                                                self.currentElement[0]._height = img.height;
+                                            }
+                                            if (!self.currentElement[0]._width) {
+                                                self.currentElement[0]._width = img.width;
+                                            }
+                                        }
+                                        self.moveWindow();
+                                    }, 200);
+
+                                    if (url.value != this.STR_IMAGE_HERE) {
+                                        img.src = url.value;
                                     }
                                 }
-                            },30);
-                        }
-                        if (this.browser.ie && exec) {
-                            var html = '';
-                            if (this._getRange().html) {
-                                html = '<li>' + this._getRange().html+ '</li>';
-                            } else {
-                                html = '<li>' + this._getRange().text + '</li>';
                             }
-
-                            this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
-                            exec = false;
-                        }
-                    }
-                    break;
-                case 'fontname':
-                    var selEl = this._getSelectedElement();
-                    this.currentFont = value;
-                    if (selEl && selEl.tagName && !this._hasSelection()) {
-                        YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
-                        exec = false;
-                    }
-                    break;
-                case 'fontsize':
-                    if ((this.currentElement.length > 0) && (!this._hasSelection())) {
-                        YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
-                    } else {
-                        this._createCurrentElement('span', {'fontSize': value });
+                        }, this, true);
                     }
-                    exec = false;
-                    break;
-            }
-            if (exec) {
-                try {
-                    this._getDoc().execCommand(action, false, value);
-                } catch(e) {
-                }
-            } else {
-            }
-            this.on('afterExecCommand', function() {
-                this.unsubscribeAll('afterExecCommand');
-                this.nodeChange();
+                }, this, true);
             });
-            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
-            
         },
         /**
         * @private
-        * @method _createCurrentElement
-        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
-        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
-        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
-        * It will then search the document for a span with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to
-        * <code>this.currentElement</code>, so we now have an element reference to the element that was just modified. At this point we can use standard DOM manipulation to change it as we see fit.
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
         */
-        _createCurrentElement: function(tagName, tagStyle) {
-            var tagName = ((tagName) ? tagName : 'a'),
-                sel = this._getSelection(),
-                tar = null,
-                el = [],
-                _doc = this._getDoc();
-            
-            if (this.currentFont) {
-                if (!tagStyle) {
-                    tagStyle = {};
-                }
-                tagStyle.fontFamily = this.currentFont;
-                this.currentFont = null;
-            }
-            this.currentElement = [];
-
-            var _elCreate = function() {
-                switch (tagName) {
-                    case 'h1':
-                    case 'h2':
-                    case 'h3':
-                    case 'h4':
-                    case 'h5':
-                    case 'h6':
-                        var el = _doc.createElement(tagName);
-                        break;
-                    default:
-                        var el = _doc.createElement('span');
-                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
-                        YAHOO.util.Dom.addClass(el, 'yui-tag');
-                        el.setAttribute('tag', tagName);
-                        el.tabIndex = 1;
-
-                        for (var i in tagStyle) {
-                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, i)) {
-                                el.style[i] = tagStyle[i];
-                            }
-                        }
-                        break;
-                }
-                return el;
-            };
-
-            if (!this._hasSelection()) {
-                if (this._getDoc().queryCommandEnabled('insertimage')) {
-                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
-                    var imgs = this._getDoc().getElementsByTagName('img');
-                    for (var i = 0; i < imgs.length; i++) {
-                        if (imgs[i].getAttribute('src', 2) == 'yui-tmp-img') {
-                            el = _elCreate();
-                            imgs[i].parentNode.replaceChild(el, imgs[i]);
-                            this.currentElement[this.currentElement.length] = el;
-                            //this.currentElement = el;
+        _handleInsertImageWindowClose: function() {
+            var url = Dom.get('insertimage_url');
+            var title = Dom.get('insertimage_title');
+            var link = Dom.get('insertimage_link');
+            var target = Dom.get('insertimage_target');
+            var el = this.currentElement[0];
+            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                el.setAttribute('src', url.value);
+                el.setAttribute('title', title.value);
+                el.setAttribute('alt', title.value);
+                var par = el.parentNode;
+                if (link.value) {
+                    var urlValue = link.value;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            urlValue = 'http:/'+'/' + urlValue;
                         }
                     }
-                } else {
-                    if (this.currentEvent) {
-                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
-                    } else {
-                        //For Safari..
-                        tar = this._getDoc().body;                        
-                    }
-                }
-                if (tar) {
-                    /**
-                    * @knownissue
-                    * @browser Safari 2.x
-                    * @description The issue here is that we have no way of knowing where the cursor position is
-                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
-                    */
-                    el = _elCreate();
-                    if (tar.tagName.toLowerCase() == 'body') {
-                        tar.appendChild(el);
-                    } else if (tar.nextSibling) {
-                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    if (par && this._isElement(par, 'a')) {
+                        par.setAttribute('href', urlValue);
+                        if (target.checked) {
+                            par.setAttribute('target', target.value);
+                        } else {
+                            par.setAttribute('target', '');
+                        }
                     } else {
-                        tar.parentNode.appendChild(el);
-                    }
-                    //this.currentElement = el;
-                    this.currentElement[this.currentElement.length] = el;
-                    this.currentEvent = null;
-                    if (this.browser.webkit) {
-                        //Force Safari to focus the new element
-                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
-                        this._getSelection().collapse(true);   
-                    }
-                }
-            } else {
-                //Force CSS Styling for this action...
-                this._setEditorStyle(true);
-                this._getDoc().execCommand('fontname', false, 'yui-tmp');
-                var _tmp = [];
-                /* TODO: This needs to be cleaned up.. */
-                var _tmp1 = this._getDoc().getElementsByTagName('font');
-                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
-                var _tmp3 = this._getDoc().getElementsByTagName('span');
-                var _tmp4 = this._getDoc().getElementsByTagName('i');
-                var _tmp5 = this._getDoc().getElementsByTagName('b');
-                for (var e = 0; e < _tmp1.length; e++) {
-                    _tmp[_tmp.length] = _tmp1[e];
-                }
-                for (var e = 0; e < _tmp2.length; e++) {
-                    _tmp[_tmp.length] = _tmp2[e];
-                }
-                for (var e = 0; e < _tmp3.length; e++) {
-                    _tmp[_tmp.length] = _tmp3[e];
-                }
-                for (var e = 0; e < _tmp4.length; e++) {
-                    _tmp[_tmp.length] = _tmp4[e];
-                }
-                for (var e = 0; e < _tmp5.length; e++) {
-                    _tmp[_tmp.length] = _tmp5[e];
-                }
-                for (var i = 0; i < _tmp.length; i++) {
-                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
-                        var el = _elCreate();
-                        el.innerHTML = _tmp[i].innerHTML;
-                        if (_tmp[i].parentNode) {
-                            _tmp[i].parentNode.replaceChild(el, _tmp[i]);
-                            //this.currentElement = el;
-                            this.currentElement[this.currentElement.length] = el;
-                            this.currentEvent = null;
-                            if (this.browser.webkit) {
-                                //Force Safari to focus the new element
-                                this._getSelection().setBaseAndExtent(el, 0, el, 0);
-                                this._getSelection().collapse(true);   
-                            }
-                            if (this.browser.ie && tagStyle && tagStyle.fontSize) {
-                                this._getSelection().empty();
-                            }
-                            if (this.browser.gecko) {
-                                this._getSelection().collapseToStart();
-                            }
+                        var _a = this._getDoc().createElement('a');
+                        _a.setAttribute('href', urlValue);
+                        if (target.checked) {
+                            _a.setAttribute('target', target.value);
+                        } else {
+                            _a.setAttribute('target', '');
                         }
+                        el.parentNode.replaceChild(_a, el);
+                        _a.appendChild(el);
                     }
-                }
-                var len = this.currentElement.length;
-                for (var i = 0; i < len; i++) {
-                    if ((i + 1) != len) { //Skip the last one in the list
-                        if (this.currentElement[i] && this.currentElement[i].nextSibling) {
-                            if (this.currentElement[i].tagName && (this.currentElement[i].tagName.toLowerCase() != 'br')) {
-                                this.currentElement[this.currentElement.length] = this.currentElement[i].nextSibling;
-                            }
-                        }
+                } else {
+                    if (par && this._isElement(par, 'a')) {
+                        par.parentNode.replaceChild(el, par);
                     }
                 }
+            } else {
+                //No url/src given, remove the node from the document
+                el.parentNode.removeChild(el);
             }
-        },
-        /**
-        * @method saveHTML
-        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
-        */
-        saveHTML: function() {
-            var html = this.cleanHTML();
-            this.get('textarea').value = html;
-            return html;
-        },
-        /**
-        * @method setEditorHTML
-        * @param {String} html The html content to load into the editor
-        * @description Loads HTML into the editors body
-        */
-        setEditorHTML: function(html) {
-            this._getDoc().body.innerHTML = html;
+            this.currentElement = [];
             this.nodeChange();
         },
         /**
-        * @method getEditorHTML
-        * @description Gets the unprocessed/unfiltered HTML from the editor
-        */
-        getEditorHTML: function() {
-            return this._getDoc().body.innerHTML;
-        },
-        /**
-        * @method cleanHTML
-        * @param {String} html The unfiltered HTML
-        * @description Process the HTML with a few regexes to clean it up and stabilize the output
-        * @returns {String} The filtered HTML
-        */
-        cleanHTML: function(html) {
-            //Start Filtering Output
-            //Begin RegExs..
-            if (!html) { 
-                var html = this.getEditorHTML();
-            }
-            //Make some backups...
-                   html = html.replace(/<div><br><\/div>/gi, '<YUI_BR>');
-                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
-                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
-                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
-                   html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
-                   html = html.replace(/<br>/gi, '<YUI_BR>');
-                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
-                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
-                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
-                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
-
-            //Convert b and i tags to strong and em tags
-                   html = html.replace(/<i([^>]*)>/gi, '<em$1>');
-                   html = html.replace(/<\/i>/gi, '</em>');
-                   html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
-                   html = html.replace(/<\/b>/gi, '</strong>');
-
-                   html = html.replace(/<font/gi, '<font');
-                   html = html.replace(/<\/font>/gi, '</font>');
-                   html = html.replace(/<span/gi, '<span');
-                   html = html.replace(/<\/span>/gi, '</span>');
-                   html = html.replace(/<u/gi, '<u');
-                   html = html.replace(/\/u>/gi, '/u>');
-
-                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
-                   html = html.replace(/\/ol>/gi, '/ol>');
-                   html = html.replace(/<li/gi, '<li');
-                   html = html.replace(/\/li>/gi, '/li>');
-
-            //Handle the sudo A tags
-            html = html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>', 'gi'), '<a $1 $2>$3</a>');
-
-            //Safari only regexes
-            if (this.browser.webkit) {
-                //<DIV><SPAN class="Apple-style-span" style="line-height: normal;">Test THis</SPAN></DIV>
-                html = html.replace(/Apple-style-span/gi, '');
-                html = html.replace(/style="line-height: normal;"/gi, '');
-            }
-
-            //yui-tag-a yui-tag yui-non yui-img
-                   html = html.replace(/yui-tag-a/gi, '');
-                   html = html.replace(/yui-tag-span/gi, '');
-                   html = html.replace(/yui-tag/gi, '');
-                   html = html.replace(/yui-non/gi, '');
-                   html = html.replace(/yui-img/gi, '');
-                   html = html.replace(/ tag="span"/gi, '');
-                   html = html.replace(/ class=""/gi, '');
-                   html = html.replace(/ class=" "/gi, '');
-                   html = html.replace(/ class="  "/gi, '');
-                   html = html.replace(/ target=""/gi, '');
-                   html = html.replace(/ title=""/gi, '');
-
-            //Other string cleanup
-                   html = html.replace(/<br><li/gi, '<li');
-            //<P><br>&nbsp;</P>
-                   //html = html.replace(/<span >([^>]*)<\/span>/gi, '$1');
-                   //html = html.replace(/<div>([^>]*)<\/div>/gi, '$1');
-            
-            
-            //Replace our backups with the real thing
-                   html = html.replace(/<YUI_BR>/g, '<br>');
-                   html = html.replace(/<YUI_IMG([^>]*)>/g, '<img$1>');
-                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
-                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
-
-            return html;
-        },
-        /**
-        * @method clearEditorDoc
-        * @description Clear the doc of the Editor
-        */
-        clearEditorDoc: function() {
-            this._getDoc().body.innerHTML = '&nbsp;';
-        },
-        /**
         * @private
         * @method _renderPanel
         * @description Renders the panel used for Editor Windows to the document so we can start using it..
-        * @returns {<a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>}
+        * @return {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>}
         */
         _renderPanel: function() {
+            var panel = null;
             if (!YAHOO.widget.EditorInfo.panel) {
-                var panel = new YAHOO.widget.Panel(this.EDITOR_PANEL_ID, {
+                panel = new YAHOO.widget.Overlay(this.EDITOR_PANEL_ID, {
                     width: '300px',
                     iframe: true,
                     visible: false,
@@ -4634,7 +7111,7 @@ var Dom = YAHOO.util.Dom,
                 });
                 YAHOO.widget.EditorInfo.panel = panel;
             } else {
-                var panel = YAHOO.widget.EditorInfo.panel;
+                panel = YAHOO.widget.EditorInfo.panel;
             }
             this.set('panel', panel);
 
@@ -4662,7 +7139,7 @@ var Dom = YAHOO.util.Dom,
         */
         openWindow: function(win) {
             this.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open..
-            Event.addListener(document, 'keypress', this._closeWindow, this, true);
+            Event.on(document, 'keypress', this._closeWindow, this, true);
             if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
                 YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
             }
@@ -4674,13 +7151,21 @@ var Dom = YAHOO.util.Dom,
                 elXY = Dom.getXY(this.get('iframe').get('element')),
                 panel = this.get('panel'),
                 newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
-                wWidth = (parseInt(win.attrs.width) / 2),
-                align = 'center';
+                wWidth = (parseInt(win.attrs.width, 10) / 2),
+                align = 'center',
+                body = null;
 
             this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel });
 
             body = document.createElement('div');
             body.className = this.CLASS_PREFIX + '-body-cont';
+            for (var b in this.browser) {
+                if (this.browser[b]) {
+                    Dom.addClass(body, b);
+                    break;
+                }
+            }
+            Dom.addClass(body, ((YAHOO.widget.Button && (this._defaultToolbar.buttonType == 'advanced')) ? 'good-button' : 'no-button'));
 
             var _note = document.createElement('h3');
             _note.className = 'yui-editor-skipheader';
@@ -4689,14 +7174,13 @@ var Dom = YAHOO.util.Dom,
             form = document.createElement('form');
             form.setAttribute('method', 'GET');
             var windowName = win.name;
-            Event.addListener(form, 'submit', function(ev) {
+            Event.on(form, 'submit', function(ev) {
                 var evName = 'window' + windowName + 'Submit';
                 self.fireEvent(evName, { type: evName, target: this });
                 Event.stopEvent(ev);
             }, this, true);
             body.appendChild(form);
 
-            Dom.setStyle(panel.element.firstChild, 'width', win.attrs.width);
             if (Lang.isObject(win.body)) { //Assume it's a reference
                 form.appendChild(win.body);
             } else { //Assume it's a string
@@ -4708,7 +7192,7 @@ var Dom = YAHOO.util.Dom,
             _close.innerHTML = 'X';
             _close.title = this.STR_CLOSE_WINDOW;
             _close.className = 'close';
-            Event.addListener(_close, 'click', function() {
+            Event.on(_close, 'click', function() {
                 this.closeWindow();
             }, this, true);
             var _knob = document.createElement('span');
@@ -4726,21 +7210,29 @@ var Dom = YAHOO.util.Dom,
             _header.appendChild(_knob);
             panel.setBody(' '); //Clear the current body
             panel.setFooter(' '); //Clear the current footer
-            if (win.footer != null) {
+            if (win.footer !== null) {
                 panel.setFooter(win.footer);
+                Dom.addClass(panel.footer, 'open');
+            } else {
+                Dom.removeClass(panel.footer, 'open');
             }
             panel.appendToBody(body); //Append the new DOM node to it
-            panel.showEvent.subscribe(function() {
-                Event.addListener(panel.element, 'click', function(ev) {
+            var fireShowEvent = function() {
+                panel.bringToTop();
+                Event.on(panel.element, 'click', function(ev) {
                     Event.stopPropagation(ev);
                 });
-            }, this, true);
-            panel.hideEvent.subscribe(function() {
+                this._setBusy(true);
+                panel.showEvent.unsubscribe(fireShowEvent);
+            };
+            panel.showEvent.subscribe(fireShowEvent, this, true);
+            var fireCloseEvent = function() {
                 this.currentWindow = null;
                 var evName = 'window' + windowName + 'Close';
-                this.fireEvent(evName, { type: evName, target: this });
-
-            }, this, true);
+                this.fireEvent(evName, { type: evName, target: this });
+                panel.hideEvent.unsubscribe(fireCloseEvent);
+            };
+            panel.hideEvent.subscribe(fireCloseEvent, this, true);
             this.currentWindow = win;
             this.moveWindow(true);
             panel.show();
@@ -4761,32 +7253,35 @@ var Dom = YAHOO.util.Dom,
                 panel = this.get('panel'),
                 //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
                 newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])],
-                wWidth = (parseInt(win.attrs.width) / 2),
+                wWidth = (parseInt(win.attrs.width, 10) / 2),
                 align = 'center',
                 orgXY = panel.cfg.getProperty('xy'),
-                _knob = win._knob;
+                _knob = win._knob,
+                xDiff = 0,
+                yDiff = 0,
+                anim = false;
+
 
             newXY[0] = ((newXY[0] - wWidth) + 20);
             //Account for the Scroll bars in a scrolled editor window.
             newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc());
             newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc());
             
-
-
-            if (this.currentElement[0].tagName && (this.currentElement[0].tagName.toLowerCase() == 'img')) {
+            if (this._isElement(this.currentElement[0], 'img')) {
                 if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) {
                     newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size
                     newXY[1] = (newXY[1] + 75); //Placeholder sizea
                 } else {
-                    var w = parseInt(this.currentElement[0].width);
-                    var h = parseInt(this.currentElement[0].height);
+                    var w = parseInt(this.currentElement[0].width, 10);
+                    var h = parseInt(this.currentElement[0].height, 10);
                     newXY[0] = (newXY[0] + (w / 2));
                     newXY[1] = (newXY[1] + h);
                 }
                 newXY[1] = newXY[1] + 15;
             } else {
-                if (Dom.getStyle(this.currentElement[0], 'fontSize').indexOf('px') != -1) {
-                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize')) + 5;
+                var fs = Dom.getStyle(this.currentElement[0], 'fontSize');
+                if (fs && fs.indexOf && fs.indexOf('px') != -1) {
+                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize'), 10) + 5;
                 } else {
                     newXY[1] = newXY[1] + 20;
                 }
@@ -4796,17 +7291,24 @@ var Dom = YAHOO.util.Dom,
                 align = 'left';
             }
 
-            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth))) {
-                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth)) - (wWidth * 2) - 5);
+            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10))) {
+                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10)) - (wWidth * 2) - 5);
                 align = 'right';
             }
             
             try {
-                var xDiff = (newXY[0] - orgXY[0]);
-                var yDiff = (newXY[1] - orgXY[1]);
-            } catch (e) {
-                var xDiff = 0;
-                var yDiff = 0;
+                xDiff = (newXY[0] - orgXY[0]);
+                yDiff = (newXY[1] - orgXY[1]);
+            } catch (e) {}
+
+
+            var iTop = elXY[1] + parseInt(this.get('height'), 10);
+            var iLeft = elXY[0] + parseInt(this.get('width'), 10);
+            if (newXY[1] > iTop) {
+                newXY[1] = iTop;
+            }
+            if (newXY[0] > iLeft) {
+                newXY[0] = (iLeft / 2);
             }
             
             //Convert negative numbers to positive so we can get the difference in distance
@@ -4818,19 +7320,19 @@ var Dom = YAHOO.util.Dom,
                     elW = 0;
 
                 if (this.currentElement[0].width) {
-                    elW = (parseInt(this.currentElement[0].width) / 2);
+                    elW = (parseInt(this.currentElement[0].width, 10) / 2);
                 }
 
                 var leftOffset = xy[0] + elXY[0] + elW;
                 _knobLeft = leftOffset - newXY[0];
                 //Check to see if the knob will go off either side & reposition it
-                if (_knobLeft > (parseInt(win.attrs.width) - 40)) {
-                    _knobLeft = parseInt(win.attrs.width) - 40;
+                if (_knobLeft > (parseInt(win.attrs.width, 10) - 1)) {
+                    _knobLeft = parseInt(win.attrs.width, 10) - 1;
                 } else if (_knobLeft < 40) {
-                    _knobLeft = 40;
+                    _knobLeft = 1;
                 }
                 if (isNaN(_knobLeft)) {
-                    _knobLeft = 40;
+                    _knobLeft = 1;
                 }
                 if (force) {
                     if (_knob) {
@@ -4838,12 +7340,12 @@ var Dom = YAHOO.util.Dom,
                     }
                     if (this.get('animate')) {
                         Dom.setStyle(panel.element, 'opacity', '0');
-                        var anim = new YAHOO.util.Anim(panel.element, {
+                        anim = new YAHOO.util.Anim(panel.element, {
                             opacity: {
                                 from: 0,
                                 to: 1
                             }
-                        }, .1, YAHOO.util.Easing.easeOut);
+                        }, 0.1, YAHOO.util.Easing.easeOut);
                         panel.cfg.setProperty('xy', newXY);
                         anim.onComplete.subscribe(function() {
                             if (this.browser.ie) {
@@ -4856,7 +7358,7 @@ var Dom = YAHOO.util.Dom,
                     }
                 } else {
                     if (this.get('animate')) {
-                        var anim = new YAHOO.util.Anim(panel.element, {}, .5, YAHOO.util.Easing.easeOut);
+                        anim = new YAHOO.util.Anim(panel.element, {}, 0.5, YAHOO.util.Easing.easeOut);
                         anim.attributes = {
                             top: {
                                 to: newXY[1]
@@ -4864,18 +7366,18 @@ var Dom = YAHOO.util.Dom,
                             left: {
                                 to: newXY[0]
                             }
-                        }
+                        };
                         anim.onComplete.subscribe(function() {
                             panel.cfg.setProperty('xy', newXY);
                         });
                         //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed ..
-                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, .5, YAHOO.util.Easing.easeOut)
+                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, 0.5, YAHOO.util.Easing.easeOut);
 
                         var _knobAnim = new YAHOO.util.Anim(_knob, {
                             left: {
                                 to: _knobLeft
                             }
-                        }, .75, YAHOO.util.Easing.easeOut);
+                        }, 0.6, YAHOO.util.Easing.easeOut);
                         anim.animate();
                         iframeAnim.animate();
                         _knobAnim.animate();
@@ -4893,7 +7395,7 @@ var Dom = YAHOO.util.Dom,
         * @param {Event} ev The keypress Event that we are trapping
         */
         _closeWindow: function(ev) {
-            if (ev.keyCode == 27) {
+            if ((ev.charCode == 87) && ev.shiftKey && ev.ctrlKey) {
                 if (this.currentWindow) {
                     this.closeWindow();
                 }
@@ -4912,29 +7414,215 @@ var Dom = YAHOO.util.Dom,
             this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel
             this.unsubscribeAll('afterExecCommand');
             this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed
+            this.toolbar.resetAllButtons();
             this._focusWindow();
             Event.removeListener(document, 'keypress', this._closeWindow);
         },
+        /* {{{  Command Overrides - These commands are only over written when we are using the advanced version */
         /**
-        * @method destroy
-        * @description Destroys the editor, all of it's elements and objects.
-        * @return {Boolean}
+        * @method cmd_heading
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('heading') is used.
         */
-        destroy: function() {
-            this.saveHTML();
-            this.toolbar.destroy();
-            Dom.setStyle(this.get('textarea'), 'display', 'block');
-            var textArea = this.get('textarea');
-            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
-            this.get('element_cont').get('element').innerHTML = '';
-            //Brutal Object Destroy
-            for (var i in this) {
-                if (Lang.hasOwnProperty(this, i)) {
-                    this[i] = null;
+        cmd_heading: function(value) {
+            var exec = true,
+                el = null,
+                action = 'heading',
+                _sel = this._getSelection(),
+                _selEl = this._getSelectedElement();
+
+            if (_selEl) {
+                _sel = _selEl;
+            }
+            
+            if (this.browser.ie) {
+                action = 'formatblock';
+            }
+            if (value == 'none') {
+                if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
+                    if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
+                        _sel = _sel.parentNode;
+                    }
+                    if (this._isElement(_sel, 'html')) {
+                        return [false];
+                    }
+                    el = this._swapEl(_selEl, 'span', function(el) {
+                        el.className = 'yui-non';
+                    });
+                    this._selectNode(el);
+                    this.currentElement[0] = el;
                 }
+                exec = false;
+            } else {
+                if (this._isElement(_selEl, 'h1') || this._isElement(_selEl, 'h2') || this._isElement(_selEl, 'h3') || this._isElement(_selEl, 'h4') || this._isElement(_selEl, 'h5') || this._isElement(_selEl, 'h6')) {
+                    el = this._swapEl(_selEl, value);
+                    this._selectNode(el);
+                    this.currentElement[0] = el;
+                } else {
+                    this._createCurrentElement(value);
+                    this._selectNode(this.currentElement[0]);
+                }
+                exec = false;
             }
-            return true;
-        },        
+            return [exec, action];
+        },
+        /**
+        * @method cmd_hiddenelements
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('hiddenelements') is used.
+        */
+        cmd_hiddenelements: function(value) {
+            if (this._showingHiddenElements) {
+                //Don't auto highlight the hidden button
+                this._lastButton = null;
+                this._showingHiddenElements = false;
+                this.toolbar.deselectButton('hiddenelements');
+                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
+            } else {
+                this._showingHiddenElements = true;
+                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
+                this.toolbar.selectButton('hiddenelements');
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_removeformat
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('removeformat') is used.
+        */
+        cmd_removeformat: function(value) {
+            var exec = true;
+            /**
+            * @knownissue Remove Format issue
+            * @browser Safari 2.x
+            * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
+            * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
+            * So here we are making the best possible guess and acting on it.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled('removeformat')) {
+                var _txt = this._getSelection()+'';
+                this._createCurrentElement('span');
+                this.currentElement[0].className = 'yui-non';
+                this.currentElement[0].innerHTML = _txt;
+                for (var i = 1; i < this.currentElement.length; i++) {
+                    this.currentElement[i].parentNode.removeChild(this.currentElement[i]);
+                }
+                /*
+                this._createCurrentElement('span');
+                YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
+                var re= /<\S[^><]*>/g;
+                var str = this.currentElement[0].innerHTML.replace(re, '');
+                var _txt = this._getDoc().createTextNode(str);
+                this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
+                */
+                
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_script
+        * @param action action passed from the execCommand method
+        * @param value Value passed from the execCommand method
+        * @description This is a combined execCommand override method. It is called from the cmd_superscript and cmd_subscript methods.
+        */
+        cmd_script: function(action, value) {
+            var exec = true, tag = action.toLowerCase().substring(0, 3),
+                _span = null, _selEl = this._getSelectedElement();
+
+            if (this.browser.webkit) {
+                if (this._isElement(_selEl, tag)) {
+                    _span = this._swapEl(this.currentElement[0], 'span', function(el) {
+                        el.className = 'yui-non';
+                    });
+                    this._selectNode(_span);
+                } else {
+                    this._createCurrentElement(tag);
+                    var _sub = this._swapEl(this.currentElement[0], tag);
+                    this._selectNode(_sub);
+                    this.currentElement[0] = _sub;
+                }
+                exec = false;
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_superscript
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('superscript') is used.
+        */
+        cmd_superscript: function(value) {
+            return [this.cmd_script('superscript', value)];
+        },
+        /**
+        * @method cmd_subscript
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('subscript') is used.
+        */
+        cmd_subscript: function(value) {
+            return [this.cmd_script('subscript', value)];
+        },
+        /**
+        * @method cmd_indent
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('indent') is used.
+        */
+        cmd_indent: function(value) {
+            var exec = true, selEl = this._getSelectedElement(), _bq = null;
+
+            if (this.browser.webkit || this.browser.ie || this.browser.gecko) {
+                if (this._isElement(selEl, 'blockquote')) {
+                    _bq = this._getDoc().createElement('blockquote');
+                    _bq.innerHTML = selEl.innerHTML;
+                    selEl.innerHTML = '';
+                    selEl.appendChild(_bq);
+                    this._selectNode(_bq);
+                } else {
+                    this._createCurrentElement('blockquote');
+                    for (var i = 0; i < this.currentElement.length; i++) {
+                        _bq = this._getDoc().createElement('blockquote');
+                        _bq.innerHTML = this.currentElement[i].innerHTML;
+                        this.currentElement[i].parentNode.replaceChild(_bq, this.currentElement[i]);
+                        this.currentElement[i] = _bq;
+                    }
+                    this._selectNode(this.currentElement[0]);
+                }
+                exec = false;
+            } else {
+                value = 'blockquote';
+            }
+            return [exec, 'indent', value];
+        },
+        /**
+        * @method cmd_outdent
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('outdent') is used.
+        */
+        cmd_outdent: function(value) {
+            var exec = true, selEl = this._getSelectedElement(), _bq = null, _span = null;
+            if (this.browser.webkit || this.browser.ie || this.browser.gecko) {
+                selEl = this._getSelectedElement();
+                if (this._isElement(selEl, 'blockquote')) {
+                    var par = selEl.parentNode;
+                    if (this._isElement(selEl.parentNode, 'blockquote')) {
+                        par.innerHTML = selEl.innerHTML;
+                        this._selectNode(par);
+                    } else {
+                        _span = this._getDoc().createElement('span');
+                        _span.innerHTML = selEl.innerHTML;
+                        YAHOO.util.Dom.addClass(_span, 'yui-non');
+                        par.replaceChild(_span, selEl);
+                        this._selectNode(_span);
+                    }
+                } else {
+                }
+                exec = false;
+            } else {
+                value = 'blockquote';
+            }
+            return [exec, 'indent', value];
+        },
+        /* }}}*/        
         /**
         * @method toString
         * @description Returns a string representing the editor.
@@ -4948,135 +7636,6 @@ var Dom = YAHOO.util.Dom,
             return str;
         }
     });
-
-/**
-* @event toolbarLoaded
-* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterRender
-* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorContentLoaded
-* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorMouseUp
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorMouseDown
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorDoubleClick
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyUp
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyPress
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event editorKeyDown
-* @param {Event} ev The DOM Event that occured
-* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeNodeChange
-* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterNodeChange
-* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeExecCommand
-* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterExecCommand
-* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event beforeOpenWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event afterOpenWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event closeWindow
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event windowCMDOpen
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-/**
-* @event windowCMDClose
-* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
-* @param {Overlay} panel The Overlay object that is used to create the window.
-* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
-* @type YAHOO.util.CustomEvent
-*/
-
-/**
-     * @description Singleton object used to track the open window objects and panels across the various open editors
-     * @class EditorInfo
-     * @static
-    */
-    YAHOO.widget.EditorInfo = {
-        /**
-        * @private
-        * @property window
-        * @description A reference to the currently open window object in any editor on the page.
-        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
-        */
-        window: {},
-        /**
-        * @private
-        * @property panel
-        * @description A reference to the currently open panel in any editor on the page.
-        * @type Object <a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>
-        */
-        panel: null
-    }
-
     /**
      * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown.
      * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor.
@@ -5097,7 +7656,7 @@ var Dom = YAHOO.util.Dom,
         * @description The window attributes
         */
         this.attrs = attrs;
-    }
+    };
 
     YAHOO.widget.EditorWindow.prototype = {
         /**
@@ -5157,8 +7716,40 @@ var Dom = YAHOO.util.Dom,
             return 'Editor Window (' + this.name + ')';
         }
     };
+/**
+* @event beforeOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event closeWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDOpen
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDClose
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
 
-
-    
 })();
-YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.3.0", build: "442"});
+YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/editor/simpleeditor-beta-debug.js b/lib/yui/editor/simpleeditor-beta-debug.js
new file mode 100644 (file)
index 0000000..0b0d013
--- /dev/null
@@ -0,0 +1,6227 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+    /**
+     * @description <p>Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButtonAdvanced
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event, container_core, menu, button
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    if (YAHOO.widget.Button) {
+        YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button;
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich';
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) {
+            var _menuItems = this.getMenu().getItems();
+            if (_menuItems.length === 0) {
+                this.getMenu()._onBeforeShow();
+                _menuItems = this.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }      
+        };
+    } else {
+        YAHOO.widget.ToolbarButtonAdvanced = function() {};
+    }
+
+
+    /**
+     * @description <p>Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButton
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event
+     * @Extends YAHOO.util.Element
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    YAHOO.widget.ToolbarButton = function(el, attrs) {
+        YAHOO.log('ToolbarButton Initalizing', 'info', 'ToolbarButton');
+        YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar');
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+
+        if (!oConfig.attributes.type) {
+            oConfig.attributes.type = 'push';
+        }
+        
+        oConfig.element = document.createElement('span');
+        oConfig.element.setAttribute('unselectable', 'on');
+        oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button';
+        oConfig.element.innerHTML = '<span class="first-child"><a href="#">LABEL</a></span>';
+        oConfig.attributes.id = Dom.generateId();
+
+        YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, {
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        buttonType: 'normal',
+        /**
+        * @method _handleMouseOver
+        * @private
+        * @description Adds classes to the button elements on mouseover (hover)
+        */
+        _handleMouseOver: function() {
+            if (!this.get('disabled')) {
+                this.addClass('yui-button-hover');
+                this.addClass('yui-' + this.get('type') + '-button-hover');
+            }
+        },
+        /**
+        * @method _handleMouseOut
+        * @private
+        * @description Removes classes from the button elements on mouseout (hover)
+        */
+        _handleMouseOut: function() {
+            this.removeClass('yui-button-hover');
+            this.removeClass('yui-' + this.get('type') + '-button-hover');
+        },
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        checkValue: function(value) {
+            if (this.get('type') == 'menu') {
+                var opts = this._button.options;
+                for (var i = 0; i < opts.length; i++) {
+                    if (opts[i].value == value) {
+                        opts.selectedIndex = i;
+                    }
+                }
+            }
+        },
+        /** 
+        * @method init
+        * @description The ToolbarButton class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.on('mouseover', this._handleMouseOver, this, true);
+            this.on('mouseout', this._handleMouseOut, this, true);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */        
+        initAttributes: function(attr) {
+            YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute value
+            * @description The value of the button
+            * @type String
+            */            
+            this.setAttributeConfig('value', {
+                value: attr.value
+            });
+            /**
+            * @attribute menu
+            * @description The menu attribute, see YAHOO.widget.Button
+            * @type Object
+            */            
+            this.setAttributeConfig('menu', {
+                value: attr.menu || false
+            });
+            /**
+            * @attribute type
+            * @description The type of button to create: push, menu, color, select, spin
+            * @type String
+            */            
+            this.setAttributeConfig('type', {
+                value: attr.type,
+                writeOnce: true,
+                method: function(type) {
+                    var el, opt;
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    switch (type) {
+                        case 'select':
+                        case 'menu':
+                            el = document.createElement('select');
+                            var menu = this.get('menu');
+                            for (var i = 0; i < menu.length; i++) {
+                                opt = document.createElement('option');
+                                opt.innerHTML = menu[i].text;
+                                opt.value = menu[i].value;
+                                if (menu[i].checked) {
+                                    opt.selected = true;
+                                }
+                                el.appendChild(opt);
+                            }
+                            this._button.parentNode.replaceChild(el, this._button);
+                            Event.on(el, 'change', this._handleSelect, this, true);
+                            this._button = el;
+                            break;
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Set the button into a disabled state
+            * @type String
+            */            
+            this.setAttributeConfig('disabled', {
+                value: attr.disabled || false,
+                method: function(disabled) {
+                    if (disabled) {
+                        this.addClass('yui-button-disabled');
+                        this.addClass('yui-' + this.get('type') + '-button-disabled');
+                    } else {
+                        this.removeClass('yui-button-disabled');
+                        this.removeClass('yui-' + this.get('type') + '-button-disabled');
+                    }
+                    if (this.get('type') == 'menu') {
+                        this._button.disabled = disabled;
+                    }
+                }
+            });
+
+            /**
+            * @attribute label
+            * @description The text label for the button
+            * @type String
+            */            
+            this.setAttributeConfig('label', {
+                value: attr.label,
+                method: function(label) {
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    if (this.get('type') == 'push') {
+                        this._button.innerHTML = label;
+                    }
+                }
+            });
+
+            /**
+            * @attribute title
+            * @description The title of the button
+            * @type String
+            */            
+            this.setAttributeConfig('title', {
+                value: attr.title
+            });
+
+            /**
+            * @config container
+            * @description The container that the button is rendered to, handled by Toolbar
+            * @type String
+            */            
+            this.setAttributeConfig('container', {
+                value: null,
+                writeOnce: true,
+                method: function(cont) {
+                    this.appendTo(cont);
+                }
+            });
+
+        },
+        /** 
+        * @private
+        * @method _handleSelect
+        * @description The event fired when a change event gets fired on a select element
+        * @param {Event} ev The change event.
+        */        
+        _handleSelect: function(ev) {
+            var tar = Event.getTarget(ev);
+            var value = tar.options[tar.selectedIndex].value;
+            this.fireEvent('change', {type: 'change', value: value });
+        },
+        /** 
+        * @method getMenu
+        * @description A stub function to mimic YAHOO.widget.Button's getMenu method
+        */        
+        getMenu: function() {
+            return this.get('menu');
+        },
+        /** 
+        * @method fireEvent
+        * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled.
+        */        
+        fireEvent: function (p_sType , p_aArgs) {
+            //  Disabled buttons should not respond to DOM events
+            if (this.DOM_EVENTS[p_sType] && this.get('disabled')) {
+                return;
+            }
+        
+            YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs);
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */        
+        toString: function() {
+            return 'ToolbarButton (' + this.get('id') + ')';
+        }
+        
+    });
+})();
+/**
+ * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbarbutton
+ * @optional container_core, dragdrop
+ * @beta
+ */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * Provides a rich toolbar widget based on the button and menu widgets
+     * @constructor
+     * @class Toolbar
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The element to turn into a toolbar.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    YAHOO.widget.Toolbar = function(el, attrs) {
+        YAHOO.log('Toolbar Initalizing', 'info', 'Toolbar');
+        YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar');
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+        
+        
+        if (Lang.isString(el) && Dom.get(el)) {
+            oConfig.element = Dom.get(el);
+        } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) {  
+            oConfig.element = Dom.get(el);
+        }
+        
+
+        if (!oConfig.element) {
+            YAHOO.log('No element defined, creating toolbar container', 'warn', 'Toolbar');
+            oConfig.element = document.createElement('DIV');
+            oConfig.element.id = Dom.generateId();
+            
+            if (local_attrs.container && Dom.get(local_attrs.container)) {
+                YAHOO.log('Container found in config appending to it (' + Dom.get(local_attrs.container).id + ')', 'info', 'Toolbar');
+                Dom.get(local_attrs.container).appendChild(oConfig.element);
+            }
+        }
+        
+
+        if (!oConfig.element.id) {
+            oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId());
+            YAHOO.log('No element ID defined for toolbar container, creating..', 'warn', 'Toolbar');
+        }
+        YAHOO.log('Initing toolbar with id: ' + oConfig.element.id, 'info', 'Toolbar');
+        
+        var cont = document.createElement('DIV');
+        oConfig.attributes.cont = cont;
+        Dom.addClass(cont, 'yui-toolbar-subcont');
+        oConfig.element.appendChild(cont);
+        
+        oConfig.attributes.element = oConfig.element;
+        oConfig.attributes.id = oConfig.element.id;
+
+        YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+         
+    };
+
+    /**
+    * @method _addMenuClasses
+    * @private
+    * @description This method is called from Menu's renderEvent to add a few more classes to the menu items
+    * @param {String} ev The event that fired.
+    * @param {Array} na Array of event information.
+    * @param {Object} o Button config object. 
+    */
+
+    function _addMenuClasses(ev, na, o) {
+        Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu');
+        if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) {
+            Dom.addClass(this.element, 'yui-toolbar-select-menu');
+        }
+        var items = this.getItems();
+        for (var i = 0; i < items.length; i++) {
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
+        }
+    }
+
+    YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property buttonType
+        * @description The default button to use
+        * @type Object
+        */
+        buttonType: YAHOO.widget.ToolbarButton,
+        /** 
+        * @property dd
+        * @description The DragDrop instance associated with the Toolbar
+        * @type Object
+        */
+        dd: null,
+        /** 
+        * @property _colorData
+        * @description Object reference containing colors hex and text values.
+        * @type Object
+        */
+        _colorData: {
+/* {{{ _colorData */
+    '#111111': 'Obsidian',
+    '#2D2D2D': 'Dark Gray',
+    '#434343': 'Shale',
+    '#5B5B5B': 'Flint',
+    '#737373': 'Gray',
+    '#8B8B8B': 'Concrete',
+    '#A2A2A2': 'Gray',
+    '#B9B9B9': 'Titanium',
+    '#000000': 'Black',
+    '#D0D0D0': 'Light Gray',
+    '#E6E6E6': 'Silver',
+    '#FFFFFF': 'White',
+    '#BFBF00': 'Pumpkin',
+    '#FFFF00': 'Yellow',
+    '#FFFF40': 'Banana',
+    '#FFFF80': 'Pale Yellow',
+    '#FFFFBF': 'Butter',
+    '#525330': 'Raw Siena',
+    '#898A49': 'Mildew',
+    '#AEA945': 'Olive',
+    '#7F7F00': 'Paprika',
+    '#C3BE71': 'Earth',
+    '#E0DCAA': 'Khaki',
+    '#FCFAE1': 'Cream',
+    '#60BF00': 'Cactus',
+    '#80FF00': 'Chartreuse',
+    '#A0FF40': 'Green',
+    '#C0FF80': 'Pale Lime',
+    '#DFFFBF': 'Light Mint',
+    '#3B5738': 'Green',
+    '#668F5A': 'Lime Gray',
+    '#7F9757': 'Yellow',
+    '#407F00': 'Clover',
+    '#8A9B55': 'Pistachio',
+    '#B7C296': 'Light Jade',
+    '#E6EBD5': 'Breakwater',
+    '#00BF00': 'Spring Frost',
+    '#00FF80': 'Pastel Green',
+    '#40FFA0': 'Light Emerald',
+    '#80FFC0': 'Sea Foam',
+    '#BFFFDF': 'Sea Mist',
+    '#033D21': 'Dark Forrest',
+    '#438059': 'Moss',
+    '#7FA37C': 'Medium Green',
+    '#007F40': 'Pine',
+    '#8DAE94': 'Yellow Gray Green',
+    '#ACC6B5': 'Aqua Lung',
+    '#DDEBE2': 'Sea Vapor',
+    '#00BFBF': 'Fog',
+    '#00FFFF': 'Cyan',
+    '#40FFFF': 'Turquoise Blue',
+    '#80FFFF': 'Light Aqua',
+    '#BFFFFF': 'Pale Cyan',
+    '#033D3D': 'Dark Teal',
+    '#347D7E': 'Gray Turquoise',
+    '#609A9F': 'Green Blue',
+    '#007F7F': 'Seaweed',
+    '#96BDC4': 'Green Gray',
+    '#B5D1D7': 'Soapstone',
+    '#E2F1F4': 'Light Turquoise',
+    '#0060BF': 'Summer Sky',
+    '#0080FF': 'Sky Blue',
+    '#40A0FF': 'Electric Blue',
+    '#80C0FF': 'Light Azure',
+    '#BFDFFF': 'Ice Blue',
+    '#1B2C48': 'Navy',
+    '#385376': 'Biscay',
+    '#57708F': 'Dusty Blue',
+    '#00407F': 'Sea Blue',
+    '#7792AC': 'Sky Blue Gray',
+    '#A8BED1': 'Morning Sky',
+    '#DEEBF6': 'Vapor',
+    '#0000BF': 'Deep Blue',
+    '#0000FF': 'Blue',
+    '#4040FF': 'Cerulean Blue',
+    '#8080FF': 'Evening Blue',
+    '#BFBFFF': 'Light Blue',
+    '#212143': 'Deep Indigo',
+    '#373E68': 'Sea Blue',
+    '#444F75': 'Night Blue',
+    '#00007F': 'Indigo Blue',
+    '#585E82': 'Dockside',
+    '#8687A4': 'Blue Gray',
+    '#D2D1E1': 'Light Blue Gray',
+    '#6000BF': 'Neon Violet',
+    '#8000FF': 'Blue Violet',
+    '#A040FF': 'Violet Purple',
+    '#C080FF': 'Violet Dusk',
+    '#DFBFFF': 'Pale Lavender',
+    '#302449': 'Cool Shale',
+    '#54466F': 'Dark Indigo',
+    '#655A7F': 'Dark Violet',
+    '#40007F': 'Violet',
+    '#726284': 'Smoky Violet',
+    '#9E8FA9': 'Slate Gray',
+    '#DCD1DF': 'Violet White',
+    '#BF00BF': 'Royal Violet',
+    '#FF00FF': 'Fuchsia',
+    '#FF40FF': 'Magenta',
+    '#FF80FF': 'Orchid',
+    '#FFBFFF': 'Pale Magenta',
+    '#4A234A': 'Dark Purple',
+    '#794A72': 'Medium Purple',
+    '#936386': 'Cool Granite',
+    '#7F007F': 'Purple',
+    '#9D7292': 'Purple Moon',
+    '#C0A0B6': 'Pale Purple',
+    '#ECDAE5': 'Pink Cloud',
+    '#BF005F': 'Hot Pink',
+    '#FF007F': 'Deep Pink',
+    '#FF409F': 'Grape',
+    '#FF80BF': 'Electric Pink',
+    '#FFBFDF': 'Pink',
+    '#451528': 'Purple Red',
+    '#823857': 'Purple Dino',
+    '#A94A76': 'Purple Gray',
+    '#7F003F': 'Rose',
+    '#BC6F95': 'Antique Mauve',
+    '#D8A5BB': 'Cool Marble',
+    '#F7DDE9': 'Pink Granite',
+    '#C00000': 'Apple',
+    '#FF0000': 'Fire Truck',
+    '#FF4040': 'Pale Red',
+    '#FF8080': 'Salmon',
+    '#FFC0C0': 'Warm Pink',
+    '#441415': 'Sepia',
+    '#82393C': 'Rust',
+    '#AA4D4E': 'Brick',
+    '#800000': 'Brick Red',
+    '#BC6E6E': 'Mauve',
+    '#D8A3A4': 'Shrimp Pink',
+    '#F8DDDD': 'Shell Pink',
+    '#BF5F00': 'Dark Orange',
+    '#FF7F00': 'Orange',
+    '#FF9F40': 'Grapefruit',
+    '#FFBF80': 'Canteloupe',
+    '#FFDFBF': 'Wax',
+    '#482C1B': 'Dark Brick',
+    '#855A40': 'Dirt',
+    '#B27C51': 'Tan',
+    '#7F3F00': 'Nutmeg',
+    '#C49B71': 'Mustard',
+    '#E1C4A8': 'Pale Tan',
+    '#FDEEE0': 'Marble'
+/* }}} */
+        },
+        /** 
+        * @property _colorPicker
+        * @description The HTML Element containing the colorPicker
+        * @type HTMLElement
+        */
+        _colorPicker: null,
+        /** 
+        * @property STR_COLLAPSE
+        * @description String for Toolbar Collapse Button
+        * @type String
+        */
+        STR_COLLAPSE: 'Collapse Toolbar',
+        /** 
+        * @property STR_SPIN_LABEL
+        * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute
+        * @type String
+        */
+        STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',
+        /** 
+        * @property STR_SPIN_UP
+        * @description String for spinbutton up
+        * @type String
+        */
+        STR_SPIN_UP: 'Click to increase the value of this input',
+        /** 
+        * @property STR_SPIN_DOWN
+        * @description String for spinbutton down
+        * @type String
+        */
+        STR_SPIN_DOWN: 'Click to decrease the value of this input',
+        /** 
+        * @property _titlebar
+        * @description Object reference to the titlebar
+        * @type HTMLElement
+        */
+        _titlebar: null,
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /**
+        * @protected
+        * @property _buttonList
+        * @description Internal property list of current buttons in the toolbar
+        * @type Array
+        */
+        _buttonList: null,
+        /**
+        * @protected
+        * @property _buttonGroupList
+        * @description Internal property list of current button groups in the toolbar
+        * @type Array
+        */
+        _buttonGroupList: null,
+        /**
+        * @protected
+        * @property _sep
+        * @description Internal reference to the separator HTML Element for cloning
+        * @type HTMLElement
+        */
+        _sep: null,
+        /**
+        * @protected
+        * @property _sepCount
+        * @description Internal refernce for counting separators, so we can give them a useful class name for styling
+        * @type Number
+        */
+        _sepCount: null,
+        /**
+        * @protected
+        * @property draghandle
+        * @type HTMLElement
+        */
+        _dragHandle: null,
+        /**
+        * @protected
+        * @property _toolbarConfigs
+        * @type Object
+        */
+        _toolbarConfigs: {
+            renderer: true
+        },
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the toolbar container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-toolbar-container',
+        /**
+        * @protected
+        * @property CLASS_DRAGHANDLE
+        * @description Default CSS class to apply to the toolbar's drag handle element
+        * @type String
+        */
+        CLASS_DRAGHANDLE: 'yui-toolbar-draghandle',
+        /**
+        * @protected
+        * @property CLASS_SEPARATOR
+        * @description Default CSS class to apply to all separators in the toolbar
+        * @type String
+        */
+        CLASS_SEPARATOR: 'yui-toolbar-separator',
+        /**
+        * @protected
+        * @property CLASS_DISABLED
+        * @description Default CSS class to apply when the toolbar is disabled
+        * @type String
+        */
+        CLASS_DISABLED: 'yui-toolbar-disabled',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-toolbar',
+        /** 
+        * @method init
+        * @description The Toolbar class's initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
+            this.addClass(this.CLASS_CONTAINER);
+
+            /**
+            * @attribute buttonType
+            * @description The buttonType to use (advanced or basic)
+            * @type String
+            */
+            this.setAttributeConfig('buttonType', {
+                value: attr.buttonType || 'basic',
+                writeOnce: true,
+                validator: function(type) {
+                    switch (type) {
+                        case 'advanced':
+                        case 'basic':
+                            return true;
+                    }
+                    return false;
+                },
+                method: function(type) {
+                    if (type == 'advanced') {
+                        if (YAHOO.widget.Button) {
+                            this.buttonType = YAHOO.widget.ToolbarButtonAdvanced;
+                        } else {
+                            YAHOO.log('Can not find YAHOO.widget.Button', 'error', 'Toolbar');
+                            this.buttonType = YAHOO.widget.ToolbarButton;
+                        }
+                    } else {
+                        this.buttonType = YAHOO.widget.ToolbarButton;
+                    }
+                }
+            });
+
+
+            /**
+            * @attribute buttons
+            * @description Object specifying the buttons to include in the toolbar
+            * Example:
+            * <code><pre>
+            * {
+            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
+            *   { type: 'separator' },
+            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
+            *       menu: [
+            *           { text: "Left", value: 'alignleft' },
+            *           { text: "Center", value: 'aligncenter' },
+            *           { text: "Right", value: 'alignright' }
+            *       ]
+            *   }
+            * }
+            * </pre></code>
+            * @type Array
+            */
+            
+            this.setAttributeConfig('buttons', {
+                value: [],
+                writeOnce: true,
+                method: function(data) {
+                    for (var i in data) {
+                        if (Lang.hasOwnProperty(data, i)) {
+                            if (data[i].type == 'separator') {
+                                this.addSeparator();
+                            } else if (data[i].group !== undefined) {
+                                this.addButtonGroup(data[i]);
+                            } else {
+                                this.addButton(data[i]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (this.get('disabled') === disabled) {
+                        return false;
+                    }
+                    if (disabled) {
+                        this.addClass(this.CLASS_DISABLED);
+                        this.set('draggable', false);
+                        this.disableAllButtons();
+                    } else {
+                        this.removeClass(this.CLASS_DISABLED);
+                        if (this._configs.draggable._initialConfig.value) {
+                            //Draggable by default, set it back
+                            this.set('draggable', true);
+                        }
+                        this.resetAllButtons();
+                    }
+                }
+            });
+
+            /**
+            * @config cont
+            * @description The container for the toolbar.
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('cont', {
+                value: attr.cont,
+                readOnly: true
+            });
+
+
+            /**
+            * @attribute grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('grouplabels', {
+                value: ((attr.grouplabels === false) ? false : true),
+                method: function(grouplabels) {
+                    if (grouplabels) {
+                        Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    } else {
+                        Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    }
+                }
+            });
+            /**
+            * @attribute titlebar
+            * @description Boolean indicating if the toolbar should have a titlebar. If
+            * passed a string, it will use that as the titlebar text
+            * @default false
+            * @type Boolean or String
+            */
+            this.setAttributeConfig('titlebar', {
+                value: false,
+                method: function(titlebar) {
+                    if (titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                        this._titlebar = document.createElement('DIV');
+                        Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar');
+                        if (Lang.isString(titlebar)) {
+                            var h2 = document.createElement('h2');
+                            h2.tabIndex = '-1';
+                            h2.innerHTML = titlebar;
+                            this._titlebar.appendChild(h2);
+                        }
+                        if (this.get('firstChild')) {
+                            this.insertBefore(this._titlebar, this.get('firstChild'));
+                        } else {
+                            this.appendChild(this._titlebar);
+                        }
+                        if (this.get('collapse')) {
+                            this.set('collapse', true);
+                        }
+                    } else if (this._titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                    }
+                }
+            });
+
+
+            /**
+            * @attribute collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false,
+                method: function(collapse) {
+                    if (this._titlebar) {
+                        var collapseEl = null;
+                        var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                        if (collapse) {
+                            if (el.length > 0) {
+                                //There is already a collapse button
+                                return true;
+                            }
+                            collapseEl = document.createElement('SPAN');
+                            collapseEl.innerHTML = 'X';
+                            collapseEl.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapseEl, 'collapse');
+                            this._titlebar.appendChild(collapseEl);
+                            Event.addListener(collapseEl, 'click', function() {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    this.collapse(false); //Expand Toolbar
+                                } else {
+                                    this.collapse(); //Collapse Toolbar
+                                }
+                            }, this, true);
+                        } else {
+                            collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                            if (collapseEl[0]) {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    //We are closed, reopen the titlebar..
+                                    this.collapse(false); //Expand Toolbar
+                                }
+                                collapseEl[0].parentNode.removeChild(collapseEl[0]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute draggable
+            * @description Boolean indicating if the toolbar should be draggable.  
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('draggable', {
+                value: (attr.draggable || false),
+                method: function(draggable) {
+                    if (draggable && !this.get('titlebar')) {
+                        YAHOO.log('Dragging enabled', 'info', 'Toolbar');
+                        if (!this._dragHandle) {
+                            this._dragHandle = document.createElement('SPAN');
+                            this._dragHandle.innerHTML = '|';
+                            this._dragHandle.setAttribute('title', 'Click to drag the toolbar');
+                            this._dragHandle.id = this.get('id') + '_draghandle';
+                            Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE);
+                            if (this.get('cont').hasChildNodes()) {
+                                this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild);
+                            } else {
+                                this.get('cont').appendChild(this._dragHandle);
+                            }
+                            /**
+                            * @property dd
+                            * @description The DragDrop instance associated with the Toolbar
+                            * @type Object
+                            */
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._dragHandle.id);
+                            
+                        }
+                    } else {
+                        YAHOO.log('Dragging disabled', 'info', 'Toolbar');
+                        if (this._dragHandle) {
+                            this._dragHandle.parentNode.removeChild(this._dragHandle);
+                            this._dragHandle = null;
+                            this.dd = null;
+                        }
+                    }
+                    if (this._titlebar) {
+                        if (draggable) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        } else {
+                            Dom.removeClass(this._titlebar, 'draggable');
+                            if (this.dd) {
+                                this.dd.unreg();
+                                this.dd = null;
+                            }
+                        }
+                    }
+                },
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.DD) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+
+        },
+        /**
+        * @method addButtonGroup
+        * @description Add a new button group to the toolbar. (uses addButton)
+        * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs)
+        */
+        addButtonGroup: function(oGroup) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButtonGroup', arguments];
+                return false;
+            }
+            
+            if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) {
+                this.addClass(this.CLASS_PREFIX + '-grouped');
+            }
+            var div = document.createElement('DIV');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
+            //if (oGroup.label && this.get('grouplabels')) {
+            if (oGroup.label) {
+                var label = document.createElement('h3');
+                label.innerHTML = oGroup.label;
+                div.appendChild(label);
+            }
+            if (!this.get('grouplabels')) {
+                Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels');
+            }
+
+            this.get('cont').appendChild(div);
+
+            //For accessibility, let's put all of the group buttons in an Unordered List
+            var ul = document.createElement('ul');
+            div.appendChild(ul);
+
+            if (!this._buttonGroupList) {
+                this._buttonGroupList = {};
+            }
+            
+            this._buttonGroupList[oGroup.group] = ul;
+
+            for (var i = 0; i < oGroup.buttons.length; i++) {
+                var li = document.createElement('li');
+                li.className = this.CLASS_PREFIX + '-groupitem';
+                ul.appendChild(li);
+                if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') {
+                    this.addSeparator(li);
+                } else {
+                    oGroup.buttons[i].container = li;
+                    this.addButton(oGroup.buttons[i]);
+                }
+            }
+        },
+        /**
+        * @method addButtonToGroup
+        * @description Add a new button to a toolbar group. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {String} group The Group identifier passed into the initial config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButtonToGroup: function(oButton, group, after) {
+            var groupCont = this._buttonGroupList[group];
+            var li = document.createElement('li');
+            li.className = this.CLASS_PREFIX + '-groupitem';
+            oButton.container = li;
+            this.addButton(oButton, after);
+            groupCont.appendChild(li);
+        },
+        /**
+        * @method addButton
+        * @description Add a new button to the toolbar. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButton: function(oButton, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButton', arguments];
+                return false;
+            }
+            if (!this._buttonList) {
+                this._buttonList = [];
+            }
+            YAHOO.log('Adding button of type: ' + oButton.type, 'info', 'Toolbar');
+            if (!oButton.container) {
+                oButton.container = this.get('cont');
+            }
+
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    for (var i in oButton.menu) {
+                        if (Lang.hasOwnProperty(oButton.menu, i)) {
+                            var funcObject = {
+                                fn: function(ev, x, oMenu) {
+                                    if (!oButton.menucmd) {
+                                        oButton.menucmd = oButton.value;
+                                    }
+                                    oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                },
+                                scope: this
+                            };
+                            oButton.menu[i].onclick = funcObject;
+                        }
+                    }
+                }
+            }
+            var _oButton = {}, skip = false;
+            for (var o in oButton) {
+                if (Lang.hasOwnProperty(oButton, o)) {
+                    if (!this._toolbarConfigs[o]) {
+                        _oButton[o] = oButton[o];
+                    }
+                }
+            }
+            if (oButton.type == 'select') {
+                _oButton.type = 'menu';
+            }
+            if (oButton.type == 'spin') {
+                _oButton.type = 'push';
+            }
+            if (_oButton.type == 'color') {
+                if (YAHOO.widget.Overlay) {
+                    _oButton = this._makeColorButton(_oButton);
+                } else {
+                    skip = true;
+                }
+            }
+            if (_oButton.menu) {
+                if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) {
+                    oButton.menu.showEvent.subscribe(function() {
+                        this._button = _oButton;
+                    });
+                } else {
+                    for (var m = 0; m < _oButton.menu.length; m++) {
+                        if (!_oButton.menu[m].value) {
+                            _oButton.menu[m].value = _oButton.menu[m].text;
+                        }
+                    }
+                    if (this.browser.webkit) {
+                        _oButton.focusmenu = false;
+                    }
+                }
+            }
+            if (skip) {
+                oButton = false;
+            } else {
+                //Add to .get('buttons') manually
+                this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+                
+                var tmp = new this.buttonType(_oButton);
+                if (!tmp.buttonType) {
+                    tmp.buttonType = 'rich';
+                    tmp.checkValue = function(value) {
+                        var _menuItems = this.getMenu().getItems();
+                        if (_menuItems.length === 0) {
+                            this.getMenu()._onBeforeShow();
+                            _menuItems = this.getMenu().getItems();
+                        }
+                        for (var i = 0; i < _menuItems.length; i++) {
+                            _menuItems[i].cfg.setProperty('checked', false);
+                            if (_menuItems[i].value == value) {
+                                _menuItems[i].cfg.setProperty('checked', true);
+                            }
+                        }      
+                    };
+                }
+                
+                if (this.get('disabled')) {
+                    //Toolbar is disabled, disable the new button too!
+                    tmp.set('disabled', true);
+                }
+                if (!oButton.id) {
+                    oButton.id = tmp.get('id');
+                }
+                YAHOO.log('Button created (' + oButton.type + ')', 'info', 'Toolbar');
+                
+                if (after) {
+                    var el = tmp.get('element');
+                    var nextSib = null;
+                    if (after.get) {
+                        nextSib = after.get('element').nextSibling;
+                    } else if (after.nextSibling) {
+                        nextSib = after.nextSibling;
+                    }
+                    if (nextSib) {
+                        nextSib.parentNode.insertBefore(el, nextSib);
+                    }
+                }
+                tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+
+                var icon = document.createElement('span');
+                icon.className = this.CLASS_PREFIX + '-icon';
+                tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+                if (tmp._button.tagName.toLowerCase() == 'button') {
+                    tmp.get('element').setAttribute('unselectable', 'on');
+                    //Replace the Button HTML Element with an a href if it exists
+                    var a = document.createElement('a');
+                    a.innerHTML = tmp._button.innerHTML;
+                    a.href = '#';
+                    Event.on(a, 'click', function(ev) {
+                        Event.stopEvent(ev);
+                    });
+                    tmp._button.parentNode.replaceChild(a, tmp._button);
+                    tmp._button = a;
+                }
+
+                if (oButton.type == 'select') {
+                    if (tmp._button.tagName.toLowerCase() == 'select') {
+                        icon.parentNode.removeChild(icon);
+                        var iel = tmp._button;
+                        var parEl = tmp.get('element');
+                        parEl.parentNode.replaceChild(iel, parEl);
+                    } else {
+                        //Don't put a class on it if it's a real select element
+                        tmp.addClass(this.CLASS_PREFIX + '-select');
+                    }
+                }
+                if (oButton.type == 'spin') {
+                    if (!Lang.isArray(oButton.range)) {
+                        oButton.range = [ 10, 100 ];
+                    }
+                    this._makeSpinButton(tmp, oButton);
+                }
+                tmp.get('element').setAttribute('title', tmp.get('label'));
+                if (oButton.type != 'spin') {
+                    if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) {
+                        var showPicker = function(ev) {
+                            var exec = true;
+                            if (ev.keyCode && (ev.keyCode == 9)) {
+                                exec = false;
+                            }
+                            if (exec) {
+                                if (this._colorPicker) {
+                                    this._colorPicker._button = oButton.value;
+                                }
+                                var menuEL = tmp.getMenu().element;
+                                if (Dom.getStyle(menuEL, 'visibility') == 'hidden') {
+                                    tmp.getMenu().show();
+                                } else {
+                                    tmp.getMenu().hide();
+                                }
+                            }
+                            YAHOO.util.Event.stopEvent(ev);
+                        };
+                        tmp.on('mousedown', showPicker, oButton, this);
+                        tmp.on('keydown', showPicker, oButton, this);
+                        
+                    } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                        tmp.on('keypress', this._buttonClick, oButton, this);
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                            this._buttonClick(ev, oButton);
+                        }, oButton, this);
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                    } else {
+                        //Stop the mousedown event so we can trap the selection in the editor!
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('change', function(ev) {
+                            if (!oButton.menucmd) {
+                                oButton.menucmd = oButton.value;
+                            }
+                            oButton.value = ev.value;
+                            this._buttonClick(ev, oButton);
+                        }, this, true);
+
+                        var self = this;
+                        //Hijack the mousedown event in the menu and make it fire a button click..
+                        if (tmp.getMenu().mouseDownEvent) {
+                            tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                                YAHOO.log('mouseDownEvent', 'warn', 'Toolbar');
+                                var oMenu = args[1];
+                                YAHOO.util.Event.stopEvent(args[0]);
+                                tmp._onMenuClick(args[0], tmp);
+                                if (!oButton.menucmd) {
+                                    oButton.menucmd = oButton.value;
+                                }
+                                oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                self._buttonClick.call(self, args[1], oButton);
+                                tmp._hideMenu();
+                                return false;
+                            });
+                            tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                                YAHOO.log('clickEvent', 'warn', 'Toolbar');
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                            tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) {
+                                YAHOO.log('mouseUpEvent', 'warn', 'Toolbar');
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                        }
+                        
+                    }
+                } else {
+                    //Stop the mousedown event so we can trap the selection in the editor!
+                    tmp.on('mousedown', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                }
+                if (this.browser.ie) {
+                    //Add a couple of new events for IE
+                    tmp.DOM_EVENTS.focusin = true;
+                    tmp.DOM_EVENTS.focusout = true;
+                    
+                    //Stop them so we don't loose focus in the Editor
+                    tmp.on('focusin', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    
+                    tmp.on('focusout', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                }
+                if (this.browser.webkit) {
+                    //This will keep the document from gaining focus and the editor from loosing it..
+                    //Forcefully remove the focus calls in button!
+                    tmp.hasFocus = function() {
+                        return true;
+                    };
+                }
+                this._buttonList[this._buttonList.length] = tmp;
+                if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                    if (Lang.isArray(oButton.menu)) {
+                        YAHOO.log('Button type is (' + oButton.type + '), doing extra renderer work.', 'info', 'Toolbar');
+                        var menu = tmp.getMenu();
+                        if (menu.renderEvent) {
+                            menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                            if (oButton.renderer) {
+                                menu.renderEvent.subscribe(oButton.renderer, tmp);
+                            }
+                        }
+                    }
+                }
+            }
+            return oButton;
+        },
+        /**
+        * @method addSeparator
+        * @description Add a new button separator to the toolbar.
+        * @param {HTMLElement} cont Optional HTML element to insert this button into.
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addSeparator: function(cont, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            var sepCont = ((cont) ? cont : this.get('cont'));
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            if (this._sepCount === null) {
+                this._sepCount = 0;
+            }
+            if (!this._sep) {
+                YAHOO.log('Separator does not yet exist, creating', 'info', 'Toolbar');
+                this._sep = document.createElement('SPAN');
+                Dom.addClass(this._sep, this.CLASS_SEPARATOR);
+                this._sep.innerHTML = '|';
+            }
+            YAHOO.log('Separator does exist, cloning', 'info', 'Toolbar');
+            var _sep = this._sep.cloneNode(true);
+            this._sepCount++;
+            Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount);
+            if (after) {
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                } else {
+                    nextSib = after;
+                }
+                if (nextSib) {
+                    if (nextSib == after) {
+                        nextSib.parentNode.appendChild(_sep);
+                    } else {
+                        nextSib.parentNode.insertBefore(_sep, nextSib);
+                    }
+                }
+            } else {
+                sepCont.appendChild(_sep);
+            }
+            return _sep;
+        },
+        /**
+        * @method _createColorPicker
+        * @private
+        * @description Creates the core DOM reference to the color picker menu item.
+        * @param {String} id the id of the toolbar to prefix this DOM container with.
+        */
+        _createColorPicker: function(id) {
+            if (Dom.get(id + '_colors')) {
+               Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors'));
+            }
+            var picker = document.createElement('div');
+            picker.className = 'yui-toolbar-colors';
+            picker.id = id + '_colors';
+            picker.style.display = 'none';
+            Event.on(window, 'load', function() {
+                document.body.appendChild(picker);
+            }, this, true);
+
+            this._colorPicker = picker;
+
+            var html = '';
+            for (var i in this._colorData) {
+                if (Lang.hasOwnProperty(this._colorData, i)) {
+                    html += '<a style="background-color: ' + i + '" href="#">' + i.replace('#', '') + '</a>';
+                }
+            }
+            html += '<span><em>X</em><strong></strong></span>';
+            window.setTimeout(function() {
+                picker.innerHTML = html;
+            }, 0);
+
+            Event.on(picker, 'mouseover', function(ev) {
+                var picker = this._colorPicker;
+                var em = picker.getElementsByTagName('em')[0];
+                var strong = picker.getElementsByTagName('strong')[0];
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    em.style.backgroundColor = tar.style.backgroundColor;
+                    strong.innerHTML = this._colorData['#' + tar.innerHTML] + '<br>' + tar.innerHTML;
+                }
+            }, this, true);
+            Event.on(picker, 'focus', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    if (retVal !== false) {
+                        var info = {
+                            color: tar.innerHTML,
+                            colorName: this._colorData['#' + tar.innerHTML],
+                            value: this._colorPicker._button 
+                        };
+                    
+                        this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                    }
+                    this.getButtonByValue(this._colorPicker._button).getMenu().hide();
+                }
+            }, this, true);
+        },
+        /**
+        * @method _resetColorPicker
+        * @private
+        * @description Clears the currently selected color or mouseover color in the color picker.
+        */
+        _resetColorPicker: function() {
+            var em = this._colorPicker.getElementsByTagName('em')[0];
+            var strong = this._colorPicker.getElementsByTagName('strong')[0];
+            em.style.backgroundColor = 'transparent';
+            strong.innerHTML = '';
+        },
+        /**
+        * @method _makeColorButton
+        * @private
+        * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
+        * @param {Object} _oButton <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
+        */
+        _makeColorButton: function(_oButton) {
+            if (!this._colorPicker) {   
+                this._createColorPicker(this.get('id'));
+            }
+            _oButton.type = 'color';
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true });
+            _oButton.menu.setBody('');
+            _oButton.menu.render(this.get('cont'));
+            Dom.addClass(_oButton.menu.element, 'yui-button-menu');
+            Dom.addClass(_oButton.menu.element, 'yui-color-button-menu');
+            _oButton.menu.beforeShowEvent.subscribe(function() {
+                _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
+                _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
+                //Move the DOM reference of the color picker to the Overlay that we are about to show.
+                this._resetColorPicker();
+                var _p = this._colorPicker;
+                if (_p.parentNode) {
+                    _p.parentNode.removeChild(_p);
+                }
+                _oButton.menu.setBody('');
+                _oButton.menu.appendToBody(_p);
+                this._colorPicker.style.display = 'block';
+            }, this, true);
+            return _oButton;
+        },
+        /**
+        * @private
+        * @method _makeSpinButton
+        * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
+        * @param {Object} _button <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
+        * @param {Object} oButton Object literal containing the buttons initial config
+        */
+        _makeSpinButton: function(_button, oButton) {
+            _button.addClass(this.CLASS_PREFIX + '-spinbutton');
+            var self = this,
+                _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child
+                range = oButton.range,
+                _b1 = document.createElement('a'),
+                _b2 = document.createElement('a');
+                _b1.href = '#';
+                _b2.href = '#';
+            
+            //Setup the up and down arrows
+            _b1.className = 'up';
+            _b1.title = this.STR_SPIN_UP;
+            _b1.innerHTML = this.STR_SPIN_UP;
+            _b2.className = 'down';
+            _b2.title = this.STR_SPIN_DOWN;
+            _b2.innerHTML = this.STR_SPIN_DOWN;
+
+            //Append them to the container
+            _par.appendChild(_b1);
+            _par.appendChild(_b2);
+            
+            var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') });
+            _button.set('title', label);
+
+            var cleanVal = function(value) {
+                value = ((value < range[0]) ? range[0] : value);
+                value = ((value > range[1]) ? range[1] : value);
+                return value;
+            };
+
+            var br = this.browser;
+            var tbar = false;
+            var strLabel = this.STR_SPIN_LABEL;
+            if (this._titlebar && this._titlebar.firstChild) {
+                tbar = this._titlebar.firstChild;
+            }
+            
+            var _intUp = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'), 10);
+                    value++;
+                    value = cleanVal(value);
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intDown = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'), 10);
+                    value--;
+                    value = cleanVal(value);
+
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intKeyUp = function(ev) {
+                if (ev.keyCode == 38) {
+                    _intUp(ev);
+                } else if (ev.keyCode == 40) {
+                    _intDown(ev);
+                } else if (ev.keyCode == 107 && ev.shiftKey) {  //Plus Key
+                    _intUp(ev);
+                } else if (ev.keyCode == 109 && ev.shiftKey) {  //Minus Key
+                    _intDown(ev);
+                }
+            };
+
+            //Handle arrow keys..
+            _button.on('keydown', _intKeyUp, this, true);
+
+            //Listen for the click on the up button and act on it
+            //Listen for the click on the down button and act on it
+            Event.on(_b1, 'mousedown',function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b2, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b1, 'click', _intUp, this, true);
+            Event.on(_b2, 'click', _intDown, this, true);
+        },
+        /**
+        * @protected
+        * @method _buttonClick
+        * @description Click handler for all buttons in the toolbar.
+        * @param {String} ev The event that was passed in.
+        * @param {Object} info Object literal of information about the button that was clicked.
+        */
+        _buttonClick: function(ev, info) {
+            var doEvent = true;
+            
+            if (ev && ev.type == 'keypress') {
+                if (ev.keyCode == 9) {
+                    doEvent = false;
+                } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) {
+                } else {
+                    doEvent = false;
+                }
+            }
+
+            if (doEvent) {
+                var fireNextEvent = true,
+                    retValue = false;
+                if (info.value) {
+                    YAHOO.log('fireEvent::' + info.value + 'Click', 'info', 'Toolbar');
+                    retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                
+                if (info.menucmd && fireNextEvent) {
+                    YAHOO.log('fireEvent::' + info.menucmd + 'Click', 'info', 'Toolbar');
+                    retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                if (fireNextEvent) {
+                    YAHOO.log('fireEvent::buttonClick', 'info', 'Toolbar');
+                    this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                }
+
+                if (info.type == 'select') {
+                    var button = this.getButtonById(info.id);
+                    if (button.buttonType == 'rich') {
+                        var txt = info.value;
+                        for (var i = 0; i < info.menu.length; i++) {
+                            if (info.menu[i].value == info.value) {
+                                txt = info.menu[i].text;
+                                break;
+                            }
+                        }
+                        button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                                _items[m].cfg.setProperty('checked', true);
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
+                        }
+                    }
+                }
+            }
+            if (ev) {
+                Event.stopEvent(ev);
+            }
+        },
+        /**
+        * @method getButtonById
+        * @description Gets a button instance from the toolbar by is Dom id.
+        * @param {String} id The Dom id to query for.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
+        */
+        getButtonById: function(id) {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                if (this._buttonList[i].get('id') == id) {
+                    return this._buttonList[i];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByValue
+        * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
+        * @param {String} value The button value to query for.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        */
+        getButtonByValue: function(value) {
+            var _buttons = this.get('buttons');
+            var len = _buttons.length;
+            for (var i = 0; i < len; i++) {
+                if (_buttons[i].group !== undefined) {
+                    for (var m = 0; m < _buttons[i].buttons.length; m++) {
+                        if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
+                            return this.getButtonById(_buttons[i].buttons[m].id);
+                        }
+                        if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values
+                            for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) {
+                                if (_buttons[i].buttons[m].menu[s].value == value) {
+                                    return this.getButtonById(_buttons[i].buttons[m].id);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) {
+                        return this.getButtonById(_buttons[i].id);
+                    }
+                    if (_buttons[i].menu) { //Menu Button, loop through the values
+                        for (var j = 0; j < _buttons[i].menu.length; j++) {
+                            if (_buttons[i].menu[j].value == value) {
+                                return this.getButtonById(_buttons[i].id);
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByIndex
+        * @description Gets a button instance from the toolbar by is index in _buttonList.
+        * @param {Number} index The index of the button in _buttonList.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
+        */
+        getButtonByIndex: function(index) {
+            if (this._buttonList[index]) {
+                return this._buttonList[index];
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method getButtons
+        * @description Returns an array of buttons in the current toolbar
+        * @return {Array}
+        */
+        getButtons: function() {
+            return this._buttonList;
+        },
+        /**
+        * @method disableButton
+        * @description Disables a button in the toolbar.
+        * @param {String/Number} id Disable a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        disableButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                button.set('disabled', true);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method enableButton
+        * @description Enables a button in the toolbar.
+        * @param {String/Number} id Enable a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        enableButton: function(id) {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                if (button.get('disabled')) {
+                    button.set('disabled', false);
+                }
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method selectButton
+        * @description Selects a button in the toolbar.
+        * @param {String/Number} id Select a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        selectButton: function(id, value) {
+            var button = id;
+            if (id) {
+                if (Lang.isString(id)) {
+                    button = this.getButtonById(id);
+                }
+                if (Lang.isNumber(id)) {
+                    button = this.getButtonByIndex(id);
+                }
+                if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                    button = this.getButtonByValue(id);
+                }
+                if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                    button.addClass('yui-button-selected');
+                    button.addClass('yui-button-' + button.get('value') + '-selected');
+                    if (value) {
+                        if (button.buttonType == 'rich') {
+                            var _items = button.getMenu().getItems();
+                            for (var m = 0; m < _items.length; m++) {
+                                if (_items[m].value == value) {
+                                    _items[m].cfg.setProperty('checked', true);
+                                    button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                                } else {
+                                    _items[m].cfg.setProperty('checked', false);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        /**
+        * @method deselectButton
+        * @description Deselects a button in the toolbar.
+        * @param {String/Number} id Deselect a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        deselectButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                button.removeClass('yui-button-selected');
+                button.removeClass('yui-button-' + button.get('value') + '-selected');
+                button.removeClass('yui-button-hover');
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method deselectAllButtons
+        * @description Deselects all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        deselectAllButtons: function() {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.deselectButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method disableAllButtons
+        * @description Disables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        disableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.disableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method enableAllButtons
+        * @description Enables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        enableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.enableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method resetAllButtons
+        * @description Resets all buttons to their initial state.
+        * @param {Object} _ex Except these buttons
+        * @return {Boolean}
+        */
+        resetAllButtons: function(_ex) {
+            if (!Lang.isObject(_ex)) {
+                _ex = {};
+            }
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                var _button = this._buttonList[i];
+                var disabled = _button._configs.disabled._initialConfig.value;
+                if (_ex[_button.get('id')]) {
+                    this.enableButton(_button);
+                    this.selectButton(_button);
+                } else {
+                    if (disabled) {
+                        this.disableButton(_button);
+                    } else {
+                        this.enableButton(_button);
+                    }
+                    this.deselectButton(_button);
+                }
+            }
+        },
+        /**
+        * @method destroyButton
+        * @description Destroy a button in the toolbar.
+        * @param {String/Number} id Destroy a button by it's id or index.
+        * @return {Boolean}
+        */
+        destroyButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                var thisID = button.get('id');
+                button.destroy();
+
+                var len = this._buttonList.length;
+                for (var i = 0; i < len; i++) {
+                    if (this._buttonList[i].get('id') == thisID) {
+                        this._buttonList[i] = null;
+                    }
+                }
+            } else {
+                return false;
+            }
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the toolbar, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.get('element').innerHTML = '';
+            this.get('element').className = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },
+        /**
+        * @method collapse
+        * @description Programatically collapse the toolbar.
+        * @param {Boolean} collapse True to collapse, false to expand.
+        */
+        collapse: function(collapse) {
+            var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+            if (collapse === false) {
+                Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                if (el[0]) {
+                    Dom.removeClass(el[0], 'collapsed');
+                }
+                this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+            } else {
+                if (el[0]) {
+                    Dom.addClass(el[0], 'collapsed');
+                }
+                Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+            }
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.';
+        }
+    });
+/**
+* @event buttonClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event valueClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description This is a special dynamic event that is created and dispatched based on the value property
+* of the button config. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* Example:
+* <code><pre>
+* buttons : [
+*   { type: 'button', value: 'test', value: 'testButton' }
+* ]</pre>
+* </code>
+* With the valueClick event you could subscribe to this buttons click event with this:
+* tbar.in('testButtonClick', function() { alert('test button clicked'); })
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarExpanded
+* @description Fires when the toolbar is expanded via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarCollapsed
+* @description Fires when the toolbar is collapsed via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+})();
+/**
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbar
+ * @optional animation, container_core
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    Toolbar = YAHOO.widget.Toolbar;
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class SimpleEditor
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.SimpleEditor = function(el, attrs) {
+        YAHOO.log('SimpleEditor Initalizing', 'info', 'SimpleEditor');
+        
+        var o = {};
+        if (Lang.isObject(el) && (!el.tagName) && !attrs) {
+            Lang.augmentObject(o, el); //Break the config reference
+            el = document.createElement('textarea');
+            this.DOMReady = true;
+            if (o.container) {
+                var c = Dom.get(o.container);
+                c.appendChild(el);
+            } else {
+                document.body.appendChild(el);
+            }
+        } else {
+            Lang.augmentObject(o, attrs); //Break the config reference
+        }
+
+        var oConfig = {
+            element: null,
+            attributes: o
+        }, id = null;
+
+        if (Lang.isString(el)) {
+            id = el;
+        } else {
+            if (oConfig.attributes.id) {
+                id = oConfig.attributes.id;
+            } else {
+                id = Dom.generateId(el);
+            }
+        }
+        oConfig.element = el;
+
+        var element_cont = document.createElement('DIV');
+        oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
+            id: id + '_container'
+        });
+        var div = document.createElement('div');
+        Dom.addClass(div, 'first-child');
+        oConfig.attributes.element_cont.appendChild(div);
+        
+        if (!oConfig.attributes.toolbar_cont) {
+            oConfig.attributes.toolbar_cont = document.createElement('DIV');
+            oConfig.attributes.toolbar_cont.id = id + '_toolbar';
+            div.appendChild(oConfig.attributes.toolbar_cont);
+        }
+        var editorWrapper = document.createElement('DIV');
+        div.appendChild(editorWrapper);
+        oConfig.attributes.editor_wrapper = editorWrapper;
+
+        YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    /**
+    * @private
+    * @method _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @return {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+
+    YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, {
+        /**
+        * @property _docType
+        * @description The DOCTYPE to use in the editable container.
+        * @type String
+        */
+        _docType: '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',
+        /**
+        * @property editorDirty
+        * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed.
+        * @type Boolean
+        */
+        editorDirty: null,
+        /**
+        * @property _defaultCSS
+        * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' }
+        * @type String
+        */
+        _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }',
+        /**
+        * @property _defaultToolbar
+        * @private
+        * @description Default toolbar config.
+        * @type Object
+        */
+        _defaultToolbar: null,
+        /**
+        * @property _lastButton
+        * @private
+        * @description The last button pressed, so we don't disable it.
+        * @type Object
+        */
+        _lastButton: null,
+        /**
+        * @property _baseHREF
+        * @private
+        * @description The base location of the editable page (this page) so that relative paths for image work.
+        * @type String
+        */
+        _baseHREF: function() {
+            var href = document.location.href;
+            if (href.indexOf('?') !== -1) { //Remove the query string
+                href = href.substring(0, href.indexOf('?'));
+            }
+            href = href.substring(0, href.lastIndexOf('/')) + '/';
+            return href;
+        }(),
+        /**
+        * @property _lastImage
+        * @private
+        * @description Safari reference for the last image selected (for styling as selected).
+        * @type HTMLElement
+        */
+        _lastImage: null,
+        /**
+        * @property _blankImageLoaded
+        * @private
+        * @description Don't load the blank image more than once..
+        * @type Boolean
+        */
+        _blankImageLoaded: null,
+        /**
+        * @property _fixNodesTimer
+        * @private
+        * @description Holder for the fixNodes timer
+        * @type Date
+        */
+        _fixNodesTimer: null,
+        /**
+        * @property _nodeChangeTimer
+        * @private
+        * @description Holds a reference to the nodeChange setTimeout call
+        * @type Number
+        */
+        _nodeChangeTimer: null,
+        /**
+        * @property _lastNodeChangeEvent
+        * @private
+        * @description Flag to determine the last event that fired a node change
+        * @type Event
+        */
+        _lastNodeChangeEvent: null,
+        /**
+        * @property _lastNodeChange
+        * @private
+        * @description Flag to determine when the last node change was fired
+        * @type Date
+        */
+        _lastNodeChange: 0,
+        /**
+        * @property _rendered
+        * @private
+        * @description Flag to determine if editor has been rendered or not
+        * @type Boolean
+        */
+        _rendered: null,
+        /**
+        * @property DOMReady
+        * @private
+        * @description Flag to determine if DOM is ready or not
+        * @type Boolean
+        */
+        DOMReady: null,
+        /**
+        * @property _selection
+        * @private
+        * @description Holder for caching iframe selections
+        * @type Object
+        */
+        _selection: null,
+        /**
+        * @property _mask
+        * @private
+        * @description DOM Element holder for the editor Mask when disabled
+        * @type Object
+        */
+        _mask: null,
+        /**
+        * @property _showingHiddenElements
+        * @private
+        * @description Status of the hidden elements button
+        * @type Boolean
+        */
+        _showingHiddenElements: null,
+        /**
+        * @property currentWindow
+        * @description A reference to the currently open EditorWindow
+        * @type Object
+        */
+        currentWindow: null,
+        /**
+        * @property currentEvent
+        * @description A reference to the current editor event
+        * @type Event
+        */
+        currentEvent: null,
+        /**
+        * @property operaEvent
+        * @private
+        * @description setTimeout holder for Opera and Image DoubleClick event..
+        * @type Object
+        */
+        operaEvent: null,
+        /**
+        * @property currentFont
+        * @description A reference to the last font selected from the Toolbar
+        * @type HTMLElement
+        */
+        currentFont: null,
+        /**
+        * @property currentElement
+        * @description A reference to the current working element in the editor
+        * @type Array
+        */
+        currentElement: null,
+        /**
+        * @property dompath
+        * @description A reference to the dompath container for writing the current working dom path to.
+        * @type HTMLElement
+        */
+        dompath: null,
+        /**
+        * @property beforeElement
+        * @description A reference to the H2 placed before the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        beforeElement: null,
+        /**
+        * @property afterElement
+        * @description A reference to the H2 placed after the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        afterElement: null,
+        /**
+        * @property invalidHTML
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine.
+        * @type Object
+        */
+        invalidHTML: {
+            form: true,
+            input: true,
+            button: true,
+            select: true,
+            link: true,
+            html: true,
+            body: true,
+            iframe: true,
+            script: true,
+            style: true,
+            textarea: true
+        },
+        /**
+        * @property toolbar
+        * @description Local property containing the <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a> instance
+        * @type <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>
+        */
+        toolbar: null,
+        /**
+        * @private
+        * @property _contentTimer
+        * @description setTimeout holder for documentReady check
+        */
+        _contentTimer: null,
+        /**
+        * @private
+        * @property _contentTimerCounter
+        * @description Counter to check the number of times the body is polled for before giving up
+        * @type Number
+        */
+        _contentTimerCounter: 0,
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { },
+        /**
+        * @private
+        * @property _semantic
+        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.
+        * @type Object
+        */
+        _semantic: { 'bold': true, 'italic' : true, 'underline' : true },
+        /**
+        * @private
+        * @property _tag2cmd
+        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.
+        * @type Object
+        */
+        _tag2cmd: {
+            'b': 'bold',
+            'strong': 'bold',
+            'i': 'italic',
+            'em': 'italic',
+            'u': 'underline',
+            'sup': 'superscript',
+            'sub': 'subscript',
+            'img': 'insertimage',
+            'a' : 'createlink',
+            'ul' : 'insertunorderedlist',
+            'ol' : 'insertorderedlist'
+        },
+
+        /**
+        * @private _createIframe
+        * @description Creates the DOM and YUI Element for the iFrame editor area.
+        * @param {String} id The string ID to prefix the iframe with
+        * @return {Object} iFrame object
+        */
+        _createIframe: function() {
+            var ifrmDom = document.createElement('iframe');
+            ifrmDom.id = this.get('id') + '_editor';
+            var config = {
+                border: '0',
+                frameBorder: '0',
+                marginWidth: '0',
+                marginHeight: '0',
+                leftMargin: '0',
+                topMargin: '0',
+                allowTransparency: 'true',
+                width: '100%'
+            };
+            if (this.get('autoHeight')) {
+                config.scrolling = 'no';
+            }
+            for (var i in config) {
+                if (Lang.hasOwnProperty(config, i)) {
+                    ifrmDom.setAttribute(i, config[i]);
+                }
+            }
+            var isrc = 'javascript:;';
+            if (this.browser.ie) {
+                isrc = 'about:blank';
+            }
+            ifrmDom.setAttribute('src', isrc);
+            var ifrm = new YAHOO.util.Element(ifrmDom);
+            //ifrm.setStyle('zIndex', '-1');
+            return ifrm;
+        },
+        /**
+        * @private _isElement
+        * @description Checks to see if an Element reference is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return {Boolean}
+        */
+        _isElement: function(el, tag) {
+            if (el && el.tagName && (el.tagName.toLowerCase() == tag)) {
+                return true;
+            }
+            if (el && el.getAttribute && (el.getAttribute('tag') == tag)) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private _hasParent
+        * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return HTMLElement
+        */
+        _hasParent: function(el, tag) {
+            if (!el || !el.parentNode) {
+                return false;
+            }
+            
+            while (el.parentNode) {
+                if (this._isElement(el, tag)) {
+                    return el;
+                }
+                if (el.parentNode) {
+                    el = el.parentNode;
+                } else {
+                    return false;
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
+        */
+        _getDoc: function() {
+            var value = false;
+            if (this.get) {
+                if (this.get('iframe')) {
+                    if (this.get('iframe').get) {
+                        if (this.get('iframe').get('element')) {
+                            try {
+                                if (this.get('iframe').get('element').contentWindow) {
+                                    if (this.get('iframe').get('element').contentWindow.document) {
+                                        value = this.get('iframe').get('element').contentWindow.document;
+                                        return value;
+                                    }
+                                }
+                            } catch (e) {}
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getWindow
+        * @description Get the Window of the IFRAME
+        * @return {Object}
+        */
+        _getWindow: function() {
+            return this.get('iframe').get('element').contentWindow;
+        },
+        /**
+        * @private
+        * @method _focusWindow
+        * @description Attempt to set the focus of the iframes window.
+        * @param {Boolean} onLoad Safari needs some special care to set the cursor in the iframe
+        */
+        _focusWindow: function(onLoad) {
+            if (this.browser.webkit) {
+                if (onLoad) {
+                    /**
+                    * @knownissue Safari Cursor Position
+                    * @browser Safari 2.x
+                    * @description Can't get Safari to place the cursor at the beginning of the text..
+                    * This workaround at least set's the toolbar into the proper state.
+                    */
+                    this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild, 0, this._getDoc().body.firstChild, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
+                } else {
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
+                }
+                this._getWindow().focus();
+            } else {
+                this._getWindow().focus();
+            }
+        },
+        /**
+        * @private
+        * @method _hasSelection
+        * @description Determines if there is a selection in the editor document.
+        * @return {Boolean}
+        */
+        _hasSelection: function() {
+            var sel = this._getSelection();
+            var range = this._getRange();
+            var hasSel = false;
+
+            if (!sel || !range) {
+                return hasSel;
+            }
+
+            //Internet Explorer
+            if (this.browser.ie || this.browser.opera) {
+                if (range.text) {
+                    hasSel = true;
+                }
+                if (range.html) {
+                    hasSel = true;
+                }
+            } else {
+                if (this.browser.webkit) {
+                    if (sel+'' !== '') {
+                        hasSel = true;
+                    }
+                } else {
+                    if (sel && (sel.toString() !== '') && (sel !== undefined)) {
+                        hasSel = true;
+                    }
+                }
+            }
+            return hasSel;
+        },
+        /**
+        * @private
+        * @method _getSelection
+        * @description Handles the different selection objects across the A-Grade list.
+        * @return {Object} Selection Object
+        */
+        _getSelection: function() {
+            var _sel = null;
+            if (this._getDoc() && this._getWindow()) {
+                if (this._getDoc().selection) {
+                    _sel = this._getDoc().selection;
+                } else {
+                    _sel = this._getWindow().getSelection();
+                }
+                //Handle Safari's lack of Selection Object
+                if (this.browser.webkit) {
+                    if (_sel.baseNode) {
+                            this._selection = {};
+                            this._selection.baseNode = _sel.baseNode;
+                            this._selection.baseOffset = _sel.baseOffset;
+                            this._selection.extentNode = _sel.extentNode;
+                            this._selection.extentOffset = _sel.extentOffset;
+                    } else if (this._selection !== null) {
+                        _sel = this._getWindow().getSelection();
+                        _sel.setBaseAndExtent(
+                            this._selection.baseNode,
+                            this._selection.baseOffset,
+                            this._selection.extentNode,
+                            this._selection.extentOffset);
+                        this._selection = null;
+                    }
+                }
+            }
+            return _sel;
+        },
+        /**
+        * @private
+        * @method _selectNode
+        * @description Places the highlight around a given node
+        * @param {HTMLElement} node The node to select
+        */
+        _selectNode: function(node) {
+            if (!node) {
+                return false;
+            }
+            var sel = this._getSelection(),
+                range = null;
+
+            if (this.browser.ie) {
+                try { //IE freaks out here sometimes..
+                    range = this._getDoc().body.createTextRange();
+                    range.moveToElementText(node);
+                    range.select();
+                } catch (e) {
+                    YAHOO.log('IE failed to select element: ' + node.tagName, 'warn', 'SimpleEditor');
+                }
+            } else if (this.browser.webkit) {
+                               sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+            } else if (this.browser.opera) {
+                sel = this._getWindow().getSelection();
+                range = this._getDoc().createRange();
+                range.selectNode(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            } else {
+                range = this._getDoc().createRange();
+                range.selectNodeContents(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            }
+        },
+        /**
+        * @private
+        * @method _getRange
+        * @description Handles the different range objects across the A-Grade list.
+        * @return {Object} Range Object
+        */
+        _getRange: function() {
+            var sel = this._getSelection();
+
+            if (sel === null) {
+                return null;
+            }
+
+            if (this.browser.webkit && !sel.getRangeAt) {
+                var _range = this._getDoc().createRange();
+                try {
+                    _range.setStart(sel.anchorNode, sel.anchorOffset);
+                    _range.setEnd(sel.focusNode, sel.focusOffset);
+                } catch (e) {
+                    _range = this._getWindow().getSelection()+'';
+                }
+                return _range;
+            }
+
+            if (this.browser.ie || this.browser.opera) {
+                try {
+                    return sel.createRange();
+                } catch (e) {
+                    return null;
+                }
+            }
+
+            if (sel.rangeCount > 0) {
+                return sel.getRangeAt(0);
+            }
+            return null;
+        },
+        /**
+        * @private
+        * @method _setDesignMode
+        * @description Sets the designMode of the iFrame document.
+        * @param {String} state This should be either on or off
+        */
+        _setDesignMode: function(state) {
+            try {
+                var set = true;
+                //SourceForge Bug #1807057
+                if (this.browser.ie && (state.toLowerCase() == 'off')) {
+                    set = false;
+                }
+                if (set) {
+                    this._getDoc().designMode = state;
+                }
+            } catch(e) { }
+        },
+        /**
+        * @private
+        * @method _toggleDesignMode
+        * @description Toggles the designMode of the iFrame document on and off.
+        * @return {String} The state that it was set to.
+        */
+        _toggleDesignMode: function() {
+            var _dMode = this._getDoc().designMode.toLowerCase(),
+                _state = 'on';
+            if (_dMode == 'on') {
+                _state = 'off';
+            }
+            this._setDesignMode(_state);
+            return _state;
+        },
+        /**
+        * @private
+        * @method _initEditor
+        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
+        */
+        _initEditor: function() {
+            if (this.browser.ie) {
+                this._getDoc().body.style.margin = '0';
+            }
+            if (!this.get('disabled')) {
+                if (this._getDoc().designMode.toLowerCase() != 'on') {
+                    this._setDesignMode('on');
+                    this._contentTimerCounter = 0;
+                }
+            }
+            if (!this._getDoc().body) {
+                YAHOO.log('Body is null, check again', 'error', 'SimpleEditor');
+                this._contentTimerCounter = 0;
+                this._checkLoaded();
+                return false;
+            }
+            
+            YAHOO.log('editorLoaded', 'info', 'SimpleEditor');
+            this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
+            //Setup Listeners on iFrame
+            Event.on(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.on(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.on(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.on(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.on(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.on(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.on(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            if (!this.get('disabled')) {
+                this.toolbar.set('disabled', false);
+            }
+            this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
+            if (this.get('dompath')) {
+                YAHOO.log('Delayed DomPath write', 'info', 'SimpleEditor');
+                var self = this;
+                setTimeout(function() {
+                    self._writeDomPath.call(self);
+                }, 150);
+            }
+            this.nodeChange(true);
+            this._setBusy(true);
+        },
+        /**
+        * @private
+        * @method _checkLoaded
+        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.
+        */
+        _checkLoaded: function() {
+            this._contentTimerCounter++;
+            if (this._contentTimer) {
+                clearTimeout(this._contentTimer);
+            }
+            if (this._contentTimerCounter > 500) {
+                YAHOO.log('ERROR: Body Did Not load', 'error', 'SimpleEditor');
+                return false;
+            }
+            var init = false;
+            try {
+                if (this._getDoc() && this._getDoc().body) {
+                    if (this.browser.ie) {
+                        if (this._getDoc().body.readyState == 'complete') {
+                            init = true;
+                        }
+                    } else {
+                        if (this._getDoc().body._rteLoaded === true) {
+                            init = true;
+                        }
+                    }
+                }
+            } catch (e) {
+                init = false;
+                YAHOO.log('checking body (e)' + e, 'error', 'SimpleEditor');
+            }
+
+            if (init === true) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
+                this._initEditor();
+            } else {
+                var self = this;
+                this._contentTimer = setTimeout(function() {
+                    self._checkLoaded.call(self);
+                }, 20);
+            }
+        },
+        /**
+        * @private
+        * @method _setInitialContent
+        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
+        */
+        _setInitialContent: function() {
+            YAHOO.log('Populating editor body with contents of the text area', 'info', 'SimpleEditor');
+            var html = Lang.substitute(this.get('html'), {
+                TITLE: this.STR_TITLE,
+                CONTENT: this._cleanIncomingHTML(this.get('element').value),
+                CSS: this.get('css'),
+                HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'),
+                EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */')
+            }),
+            check = true;
+            if (document.compatMode != 'BackCompat') {
+                YAHOO.log('Adding Doctype to editable area', 'info', 'SimpleEditor');
+                html = this._docType + "\n" + html;
+            } else {
+                YAHOO.log('DocType skipped because we are in BackCompat Mode.', 'warn', 'SimpleEditor');
+            }
+
+            if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) {
+                //Firefox 1.5 doesn't like setting designMode on an document created with a data url
+                try {
+                    this._getDoc().open();
+                    this._getDoc().write(html);
+                    this._getDoc().close();
+                } catch (e) {
+                    YAHOO.log('Setting doc failed.. (_setInitialContent)', 'error', 'SimpleEditor');
+                    //Safari will only be here if we are hidden
+                    check = false;
+                }
+            } else {
+                //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality
+                this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html);
+            }
+            if (check) {
+                this._checkLoaded();
+            }
+        },
+        /**
+        * @private
+        * @method _setMarkupType
+        * @param {String} action The action to take. Possible values are: css, default or semantic
+        * @description This method will turn on/off the useCSS execCommand.
+        */
+        _setMarkupType: function(action) {
+            switch (this.get('markup')) {
+                case 'css':
+                    this._setEditorStyle(true);
+                    break;
+                case 'default':
+                    this._setEditorStyle(false);
+                    break;
+                case 'semantic':
+                case 'xhtml':
+                    if (this._semantic[action]) {
+                        this._setEditorStyle(false);
+                    } else {
+                        this._setEditorStyle(true);
+                    }
+                    break;
+            }
+        },
+        /**
+        * Set the editor to use CSS instead of HTML
+        * @param {Booleen} stat True/False
+        */
+        _setEditorStyle: function(stat) {
+            try {
+                this._getDoc().execCommand('useCSS', false, !stat);
+            } catch (ex) {
+            }
+        },
+        /**
+        * @private
+        * @method _getSelectedElement
+        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
+        * @return {HTMLElement} The currently selected element.
+        */
+        _getSelectedElement: function() {
+            var doc = this._getDoc(),
+                range = null,
+                sel = null,
+                elm = null;
+
+            if (this.browser.ie) {
+                this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event;
+                range = this._getRange();
+                if (range) {
+                    elm = range.item ? range.item(0) : range.parentElement();
+                    if (elm == doc.body) {
+                        elm = null;
+                    }
+                }
+                if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
+            } else {
+                sel = this._getSelection();
+                range = this._getRange();
+
+                if (!sel || !range) {
+                    return null;
+                }
+                if (!this._hasSelection()) {
+                    if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
+                        if (sel.anchorNode.parentNode) { //next check parentNode
+                            elm = sel.anchorNode.parentNode;
+                        }
+                        if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) {
+                            elm = sel.anchorNode.nextSibling;
+                        }
+                    }
+                    if (this._isElement(elm, 'br')) {
+                        elm = null;
+                    }
+                    if (!elm) {
+                        elm = range.commonAncestorContainer;
+                        if (!range.collapsed) {
+                            if (range.startContainer == range.endContainer) {
+                                if (range.startOffset - range.endOffset < 2) {
+                                    if (range.startContainer.hasChildNodes()) {
+                                        elm = range.startContainer.childNodes[range.startOffset];
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (this.currentEvent !== null) {
+                try {
+                    switch (this.currentEvent.type) {
+                        case 'click':
+                        case 'mousedown':
+                        case 'mouseup':
+                            elm = Event.getTarget(this.currentEvent);
+                            break;
+                        default:
+                            //Do nothing
+                            break;
+                    }
+                } catch (e) {
+                    YAHOO.log('Firefox 1.5 errors here: ' + e, 'error', 'SimpleEditor');
+                }
+            } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) {
+                elm = this.currentElement[0];
+            }
+            if (this.browser.opera || this.browser.webkit) {
+                if (this.currentEvent && !elm) {
+                    elm = YAHOO.util.Event.getTarget(this.currentEvent);
+                }
+            }
+            if (!elm || !elm.tagName) {
+                elm = doc.body;
+            }
+            if (this._isElement(elm, 'html')) {
+                //Safari sometimes gives us the HTML node back..
+                elm = doc.body;
+            }
+            if (this._isElement(elm, 'body')) {
+                //make sure that body means this body not the parent..
+                elm = doc.body;
+            }
+            if (elm && !elm.parentNode) { //Not in document
+                elm = doc.body;
+            }
+            if (elm === undefined) {
+                elm = null;
+            }
+            return elm;
+        },
+        /**
+        * @private
+        * @method _getDomPath
+        * @description This method will attempt to build the DOM path from the currently selected element.
+        * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used
+        * @return {Array} An array of node references that will create the DOM Path.
+        */
+        _getDomPath: function(el) {
+            if (!el) {
+                           el = this._getSelectedElement();
+            }
+                       var domPath = [];
+            while (el !== null) {
+                if (el.ownerDocument != this._getDoc()) {
+                    el = null;
+                    break;
+                }
+                //Check to see if we get el.nodeName and nodeType
+                if (el.nodeName && el.nodeType && (el.nodeType == 1)) {
+                    domPath[domPath.length] = el;
+                }
+
+                if (this._isElement(el, 'body')) {
+                    break;
+                }
+
+                el = el.parentNode;
+            }
+            if (domPath.length === 0) {
+                if (this._getDoc() && this._getDoc().body) {
+                    domPath[0] = this._getDoc().body;
+                }
+            }
+            return domPath.reverse();
+        },
+        /**
+        * @private
+        * @method _writeDomPath
+        * @description Write the current DOM path out to the dompath container below the editor.
+        */
+        _writeDomPath: function() { 
+            var path = this._getDomPath(),
+                pathArr = [],
+                classPath = '',
+                pathStr = '';
+            for (var i = 0; i < path.length; i++) {
+                var tag = path[i].tagName.toLowerCase();
+                if ((tag == 'ol') && (path[i].type)) {
+                    tag += ':' + path[i].type;
+                }
+                if (Dom.hasClass(path[i], 'yui-tag')) {
+                    tag = path[i].getAttribute('tag');
+                }
+                if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) {
+                    switch (tag) {
+                        case 'b': tag = 'strong'; break;
+                        case 'i': tag = 'em'; break;
+                    }
+                }
+                if (!Dom.hasClass(path[i], 'yui-non')) {
+                    if (Dom.hasClass(path[i], 'yui-tag')) {
+                        pathStr = tag;
+                    } else {
+                        classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
+                            classPath = '';
+                        }
+                        pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                    }
+                    switch (tag) {
+                        case 'a':
+                            if (path[i].getAttribute('href', 2)) {
+                                pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                            break;
+                        case 'img':
+                            var h = path[i].height;
+                            var w = path[i].width;
+                            if (path[i].style.height) {
+                                h = parseInt(path[i].style.height, 10);
+                            }
+                            if (path[i].style.width) {
+                                w = parseInt(path[i].style.width, 10);
+                            }
+                            pathStr += '(' + h + 'x' + w + ')';
+                        break;
+                    }
+
+                    if (pathStr.length > 10) {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr.substring(0, 10) + '...' + '</span>';
+                    } else {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr + '</span>';
+                    }
+                    pathArr[pathArr.length] = pathStr;
+                }
+            }
+            var str = pathArr.join(' ' + this.SEP_DOMPATH + ' ');
+            //Prevent flickering
+            if (this.dompath.innerHTML != str) {
+                this.dompath.innerHTML = str;
+            }
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            var doc = this._getDoc(),
+                els = [];
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (v.toLowerCase() != 'span') {
+                        var tags = doc.body.getElementsByTagName(v);
+                        if (tags.length) {
+                            for (var i = 0; i < tags.length; i++) {
+                                els.push(tags[i]);
+                            }
+                        }
+                    }
+                }
+            }
+            for (var h = 0; h < els.length; h++) {
+                if (els[h].parentNode) {
+                    if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) {
+                        this._swapEl(els[h], 'span', function(el) {
+                            el.className = 'yui-non';
+                        });
+                    } else {
+                        els[h].parentNode.removeChild(els[h]);
+                    }
+                }
+            }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');   
+        },
+        /**
+        * @private
+        * @method _isNonEditable
+        * @param Event ev The Dom event being checked
+        * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied.
+        * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also
+        * disable and enable the Editor's toolbar based on the noedit state.
+        * @return Boolean
+        */
+        _isNonEditable: function(ev) {
+            if (this.get('allowNoEdit')) {
+                var el = Event.getTarget(ev);
+                if (this._isElement(el, 'html')) {
+                    el = null;
+                }
+                var path = this._getDomPath(el);
+                for (var i = (path.length - 1); i > -1; i--) {
+                    if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) {
+                        //if (this.toolbar.get('disabled') === false) {
+                        //    this.toolbar.set('disabled', true);
+                        //}
+                        try {
+                             this._getDoc().execCommand('enableObjectResizing', false, 'false');
+                        } catch (e) {}
+                        this.nodeChange();
+                        Event.stopEvent(ev);
+                        YAHOO.log('CLASS_NOEDIT found in DOM Path, stopping event', 'info', 'SimpleEditor');
+                        return true;
+                    }
+                }
+                //if (this.toolbar.get('disabled') === true) {
+                    //Should only happen once..
+                    //this.toolbar.set('disabled', false);
+                    try {
+                         this._getDoc().execCommand('enableObjectResizing', false, 'true');
+                    } catch (e) {}
+                //}
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _setCurrentEvent
+        * @param {Event} ev The event to cache
+        * @description Sets the current event property
+        */
+        _setCurrentEvent: function(ev) {
+            this.currentEvent = ev;
+        },
+        /**
+        * @private
+        * @method _handleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all click events inside the iFrame document.
+        */
+        _handleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this.browser.webkit) {
+                var tar =Event.getTarget(ev);
+                if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) {
+                    Event.stopEvent(ev);
+                    this.nodeChange();
+                }
+            } else {
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mouseup events inside the iFrame document.
+        */
+        _handleMouseUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            //Don't set current event for mouseup.
+            //It get's fired after a menu is closed and gives up a bogus event to work with
+            //this._setCurrentEvent(ev);
+            var self = this;
+            if (this.browser.opera) {
+                /**
+                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
+                * @browser Opera
+                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
+                */
+                var sel = Event.getTarget(ev);
+                if (this._isElement(sel, 'img')) {
+                    this.nodeChange();
+                    if (this.operaEvent) {
+                        clearTimeout(this.operaEvent);
+                        this.operaEvent = null;
+                        this._handleDoubleClick(ev);
+                    } else {
+                        this.operaEvent = window.setTimeout(function() {
+                            self.operaEvent = false;
+                        }, 700);
+                    }
+                }
+            }
+            //This will stop Safari from selecting the entire document if you select all the text in the editor
+            if (this.browser.webkit || this.browser.opera) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+            }
+            this.nodeChange();
+            this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mousedown events inside the iFrame document.
+        */
+        _handleMouseDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (this.browser.webkit && this._hasSelection()) {
+                var _sel = this._getSelection();
+                if (!this.browser.webkit3) {
+                    _sel.collapse(true);
+                } else {
+                    _sel.collapseToStart();
+                }
+            }
+            if (this.browser.webkit && this._lastImage) {
+                Dom.removeClass(this._lastImage, 'selected');
+                this._lastImage = null;
+            }
+            if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                    if (this._isElement(sel, 'img')) {
+                        Dom.addClass(sel, 'selected');
+                        this._lastImage = sel;
+                    }
+                }
+                this.nodeChange();
+            }
+            this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleDoubleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all doubleclick events inside the iFrame document.
+        */
+        _handleDoubleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (this._isElement(sel, 'img')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a
+                this.currentElement[0] = this._hasParent(sel, 'a');
+                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            }
+            this.nodeChange();
+            this.editorDirty = false;
+            this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keyup events inside the iFrame document.
+        */
+        _handleKeyUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            switch (ev.keyCode) {
+                case 37: //Left Arrow
+                case 38: //Up Arrow
+                case 39: //Right Arrow
+                case 40: //Down Arrow
+                case 46: //Forward Delete
+                case 8: //Delete
+                case 87: //W key if window is open
+                    if ((ev.keyCode == 87) && this.currentWindow && ev.shiftKey && ev.ctrlKey) {
+                        this.closeWindow();
+                    } else {
+                        if (!this.browser.ie) {
+                            if (this._nodeChangeTimer) {
+                                clearTimeout(this._nodeChangeTimer);
+                            }
+                            var self = this;
+                            this._nodeChangeTimer = setTimeout(function() {
+                                self._nodeChangeTimer = null;
+                                self.nodeChange.call(self);
+                            }, 100);
+                        } else {
+                            this.nodeChange();
+                        }
+                        this.editorDirty = true;
+                    }
+                    break;
+            }
+            this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keypress events inside the iFrame document.
+        */
+        _handleKeyPress: function(ev) {
+            if (this.get('allowNoEdit')) {
+                if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) {
+                    //Forward delete key
+                    YAHOO.log('allowNoEdit is set, forward delete key has been disabled', 'warn', 'SimpleEditor');
+                    Event.stopEvent(ev);
+                }
+            }
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.browser.webkit) {
+                if (!this.browser.webkit3) {
+                    if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) {
+                        //This is CMD + z (for undo)
+                        if (this._hasParent(this._getSelectedElement(), 'li')) {
+                            YAHOO.log('We are in an LI and we found CMD + z, stopping the event', 'warn', 'SimpleEditor');
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+                /* This was removed because it crashes Safari 2.x in some cases
+                if (ev.keyCode && (ev.keyCode == 8)) {
+                    //Delete Key
+                    if (this._isElement(this._getSelectedElement(), 'br')) {
+                        var el = this._getSelectedElement();
+                        el.parentNode.removeChild(el);
+                    }
+                }
+                */
+                this._listFix(ev);
+            }
+            this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _listFix
+        * @param {Event} ev The event we are working on.
+        * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items.
+        */
+        _listFix: function(ev) {
+            //YAHOO.log('Lists Fix (' + ev.keyCode + ')', 'info', 'SimpleEditor');
+            var testLi = null, par = null, preContent = false, range = null;
+            //Enter Key
+            if (this.browser.webkit) {
+                if (ev.keyCode && (ev.keyCode == 13)) {
+                    if (this._hasParent(this._getSelectedElement(), 'li')) {
+                        var tar = this._hasParent(this._getSelectedElement(), 'li');
+                        var li = this._getDoc().createElement('li');
+                        li.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        if (tar.nextSibling) {
+                            tar.parentNode.insertBefore(li, tar.nextSibling);
+                        } else {
+                            tar.parentNode.appendChild(li);
+                        }
+                        this.currentElement[0] = li;
+                        this._selectNode(li.firstChild);
+                        if (!this.browser.webkit3) {
+                            tar.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                tar.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                        Event.stopEvent(ev);
+                    }
+                }
+            }
+            //Shift + Tab Key
+            if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) {
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    testLi = this._hasParent(testLi, 'li');
+                    YAHOO.log('We have a SHIFT tab in an LI, reverse it..', 'info', 'SimpleEditor');
+                    if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) {
+                        YAHOO.log('We have a double parent, move up a level', 'info', 'SimpleEditor');
+                        par = this._hasParent(testLi, 'ul');
+                        if (!par) {
+                            par = this._hasParent(testLi, 'ol');
+                        }
+                        //YAHOO.log(par.previousSibling + ' :: ' + par.previousSibling.innerHTML);
+                        if (this._isElement(par.previousSibling, 'li')) {
+                            par.removeChild(testLi);
+                            par.parentNode.insertBefore(testLi, par.nextSibling);
+                            if (this.browser.ie) {
+                                range = this._getDoc().body.createTextRange();
+                                range.moveToElementText(testLi);
+                                range.collapse(false);
+                                range.select();
+                            }
+                            if (this.browser.webkit) {
+                                if (!this.browser.webkit3) {
+                                    par.style.display = 'list-item';
+                                    par.parentNode.style.display = 'list-item';
+                                    setTimeout(function() {
+                                        par.style.display = 'block';
+                                        par.parentNode.style.display = 'block';
+                                    }, 1);
+                                }
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+            }
+            //Tab Key
+            if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) {
+                YAHOO.log('List Fix - Tab', 'info', 'SimpleEditor');
+                var preLi = this._getSelectedElement();
+                if (this._hasParent(preLi, 'li')) {
+                    preContent = this._hasParent(preLi, 'li').innerHTML;
+                }
+                //YAHOO.log('preLI: ' + preLi.tagName + ' :: ' + preLi.innerHTML);
+                if (this.browser.webkit) {
+                    this._getDoc().execCommand('inserttext', false, '\t');
+                }
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    YAHOO.log('We have a tab in an LI', 'info', 'SimpleEditor');
+                    par = this._hasParent(testLi, 'li');
+                    YAHOO.log('parLI: ' + par.tagName + ' :: ' + par.innerHTML);
+                    var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase());
+                    if (this.browser.webkit) {
+                        var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par);
+                        //Remove the span element that Safari puts in
+                        if (span[0]) {
+                            par.removeChild(span[0]);
+                            par.innerHTML = Lang.trim(par.innerHTML);
+                            //Put the HTML from the LI into this new LI
+                            if (preContent) {
+                                par.innerHTML = '<span class="yui-non">' + preContent + '</span>&nbsp;';
+                            } else {
+                                par.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                            }
+                        }
+                    } else {
+                        if (preContent) {
+                            par.innerHTML = preContent + '&nbsp;';
+                        } else {
+                            par.innerHTML = '&nbsp;';
+                        }
+                    }
+
+                    par.parentNode.replaceChild(newUl, par);
+                    newUl.appendChild(par);
+                    if (this.browser.webkit) {
+                        this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length);
+                        if (!this.browser.webkit3) {
+                            par.parentNode.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                par.parentNode.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                    } else if (this.browser.ie) {
+                        range = this._getDoc().body.createTextRange();
+                        range.moveToElementText(par);
+                        range.collapse(false);
+                        range.select();
+                    } else {
+                        this._selectNode(par);
+                    }
+                    Event.stopEvent(ev);
+                }
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
+                    }
+                    break;
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
+                    break;
+                case 76: //L
+                    if (this._hasSelection()) {
+                        if (ev.shiftKey && ev.ctrlKey) {
+                            var makeLink = true;
+                            if (this.get('limitCommands')) {
+                                if (!this.toolbar.getButtonByValue('createlink')) {
+                                    YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor');
+                                    makeLink = false;
+                                }
+                            }
+                            if (makeLink) {
+                                this.execCommand('createlink', '');
+                                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                                doExec = false;
+                            }
+                        }
+                    }
+                    break;
+                case 65:
+                    if (ev.metaKey && this.browser.webkit) {
+                        Event.stopEvent(ev);
+                        //Override Safari's select all and select the contents of the editor not the iframe as Safari would by default.
+                        this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, this._getDoc().body.innerHTML.length);
+                    }
+                    break;
+                case 66: //B
+                    action = 'bold';
+                    break;
+                case 73: //I
+                    action = 'italic';
+                    break;
+                case 85: //U
+                    action = 'underline';
+                    break;
+                case 13:
+                    if (this.browser.ie) {
+                        //Insert a <br> instead of a <p></p> in Internet Explorer
+                        var _range = this._getRange();
+                        var tar = this._getSelectedElement();
+                        if (!this._isElement(tar, 'li')) {
+                            if (_range) {
+                                _range.pasteHTML('<br>');
+                                _range.collapse(false);
+                                _range.select();
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+            }
+            //if (!this.browser.gecko && !this.browser.webkit) {
+            if (this.browser.ie) {
+                this._listFix(ev);
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+            this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev });
+        },
+        /**
+        * @method nodeChange
+        * @param {Boolean} force Optional paramenter to skip the threshold counter
+        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
+        */
+        nodeChange: function(force) {
+            var threshold = parseInt(this.get('nodeChangeThreshold'), 10);
+            var thisNodeChange = Math.round(new Date().getTime() / 1000);
+            if (force === true) {
+                this._lastNodeChange = 0;
+            }
+            
+            if ((this._lastNodeChange + threshold) < thisNodeChange) {
+                var self = this;
+                if (this._fixNodesTimer === null) {
+                    this._fixNodesTimer = window.setTimeout(function() {
+                        self._fixNodes.call(self);
+                        self._fixNodesTimer = null;
+                    }, 0);
+                }
+            }
+            this._lastNodeChange = thisNodeChange;
+            if (this.currentEvent) {
+                this._lastNodeChangeEvent = this.currentEvent.type;
+            }
+
+            var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (beforeNodeChange === false) {
+                return false;
+            }
+            if (this.get('dompath')) {
+                this._writeDomPath();
+            }
+            //Check to see if we are disabled before continuing
+            if (!this.get('disabled')) {
+                if (this.STOP_NODE_CHANGE) {
+                    //Reset this var for next action
+                    this.STOP_NODE_CHANGE = false;
+                    return false;
+                } else {
+                    var sel = this._getSelection(),
+                        range = this._getRange(),
+                        el = this._getSelectedElement(),
+                        fn_button = this.toolbar.getButtonByValue('fontname'),
+                        fs_button = this.toolbar.getButtonByValue('fontsize');
+
+                    if (force !== true) {
+                        this.editorDirty = true;
+                    }
+
+                    //Handle updating the toolbar with active buttons
+                    var _ex = {};
+                    if (this._lastButton) {
+                        _ex[this._lastButton.id] = true;
+                    }
+                    if (!this._isElement(el, 'body')) {
+                        if (fn_button) {
+                            _ex[fn_button.get('id')] = true;
+                        }
+                        if (fs_button) {
+                            _ex[fs_button.get('id')] = true;
+                        }
+                    }
+                    this.toolbar.resetAllButtons(_ex);
+
+                    //Handle disabled buttons
+                    for (var d = 0; d < this._disabled.length; d++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[d]);
+                        if (_button && _button.get) {
+                            if (this._lastButton && (_button.get('id') === this._lastButton.id)) {
+                                //Skip
+                            } else {
+                                if (!this._hasSelection()) {
+                                    switch (this._disabled[d]) {
+                                        case 'fontname':
+                                        case 'fontsize':
+                                            break;
+                                        default:
+                                            //No Selection - disable
+                                            this.toolbar.disableButton(_button);
+                                    }
+                                } else {
+                                    if (!this._alwaysDisabled[this._disabled[d]]) {
+                                        this.toolbar.enableButton(_button);
+                                    }
+                                }
+                                if (!this._alwaysEnabled[this._disabled[d]]) {
+                                    this.toolbar.deselectButton(_button);
+                                }
+                            }
+                        }
+                    }
+                    var path = this._getDomPath();
+                    var tag = null, cmd = null;
+                    for (var i = 0; i < path.length; i++) {
+                        tag = path[i].tagName.toLowerCase();
+                        if (path[i].getAttribute('tag')) {
+                            tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        cmd = this._tag2cmd[tag];
+                        if (cmd === undefined) {
+                            cmd = [];
+                        }
+                        if (!Lang.isArray(cmd)) {
+                            cmd = [cmd];
+                        }
+
+                        //Bold and Italic styles
+                        if (path[i].style.fontWeight.toLowerCase() == 'bold') {
+                            cmd[cmd.length] = 'bold';
+                        }
+                        if (path[i].style.fontStyle.toLowerCase() == 'italic') {
+                            cmd[cmd.length] = 'italic';
+                        }
+                        if (path[i].style.textDecoration.toLowerCase() == 'underline') {
+                            cmd[cmd.length] = 'underline';
+                        }
+                        if (cmd.length > 0) {
+                            for (var j = 0; j < cmd.length; j++) {
+                                this.toolbar.selectButton(cmd[j]);
+                                this.toolbar.enableButton(cmd[j]);
+                            }
+                        }
+                        //Handle Alignment
+                        switch (path[i].style.textAlign.toLowerCase()) {
+                            case 'left':
+                            case 'right':
+                            case 'center':
+                            case 'justify':
+                                var alignType = path[i].style.textAlign.toLowerCase();
+                                if (path[i].style.textAlign.toLowerCase() == 'justify') {
+                                    alignType = 'full';
+                                }
+                                this.toolbar.selectButton('justify' + alignType);
+                                this.toolbar.enableButton('justify' + alignType);
+                                break;
+                        }
+                    }
+                    //After for loop
+
+                    //Reset Font Family and Size to the inital configs
+                    if (fn_button) {
+                        var family = fn_button._configs.label._initialConfig.value;
+                        fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                        this._updateMenuChecked('fontname', family);
+                    }
+
+                    if (fs_button) {
+                        fs_button.set('label', fs_button._configs.label._initialConfig.value);
+                    }
+
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        hd_button.set('label', hd_button._configs.label._initialConfig.value);
+                        this._updateMenuChecked('heading', 'none');
+                    }
+                    var img_button = this.toolbar.getButtonByValue('insertimage');
+                    if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) {
+                        this.toolbar.disableButton(img_button);
+                    }
+                }
+            }
+
+            this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this });
+        },
+        /**
+        * @private
+        * @method _updateMenuChecked
+        * @param {Object} button The command identifier of the button you want to check
+        * @param {String} value The value of the menu item you want to check
+        * @param {<a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>} The Toolbar instance the button belongs to (defaults to this.toolbar) 
+        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.
+        */
+        _updateMenuChecked: function(button, value, tbar) {
+            if (!tbar) {
+                tbar = this.toolbar;
+            }
+            var _button = tbar.getButtonByValue(button);
+            _button.checkValue(value);
+        },
+        /**
+        * @private
+        * @method _handleToolbarClick
+        * @param {Event} ev The event that triggered the button click
+        * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.
+        */
+        _handleToolbarClick: function(ev) {
+            var value = '';
+            var str = '';
+            var cmd = ev.button.value;
+            if (ev.button.menucmd) {
+                value = cmd;
+                cmd = ev.button.menucmd;
+            }
+            this._lastButton = ev.button;
+            if (this.STOP_EXEC_COMMAND) {
+                YAHOO.log('execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true', 'warn', 'SimpleEditor');
+                YAHOO.log('NOEXEC::execCommand::(' + cmd + '), (' + value + ')', 'warn', 'SimpleEditor');
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            } else {
+                this.execCommand(cmd, value);
+                if (!this.browser.webkit) {
+                     var self = this;
+                     setTimeout(function() {
+                         self._focusWindow.call(self);
+                     }, 5);
+                 }
+            }
+            Event.stopEvent(ev);
+        },
+        /**
+        * @private
+        * @method _setupAfterElement
+        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
+        */
+        _setupAfterElement: function() {
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
+            if (!this.afterElement) {
+                this.afterElement = document.createElement('h2');
+                this.afterElement.className = 'yui-editor-skipheader';
+                this.afterElement.tabIndex = '-1';
+                this.afterElement.innerHTML = this.STR_LEAVE_EDITOR;
+                this.get('element_cont').get('firstChild').appendChild(this.afterElement);
+            }
+        },
+        /**
+        * @private
+        * @method _disableEditor
+        * @param {Boolean} disabled Pass true to disable, false to enable
+        * @description Creates a mask to place over the Editor.
+        */
+        _disableEditor: function(disabled) {
+            if (disabled) {
+                if (!this._mask) {
+                    if (!!this.browser.ie) {
+                        this._setDesignMode('off');
+                    }
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', true);
+                    }
+                    this._mask = document.createElement('DIV');
+                    Dom.setStyle(this._mask, 'height', '100%');
+                    Dom.setStyle(this._mask, 'width', '100%');
+                    Dom.setStyle(this._mask, 'position', 'absolute');
+                    Dom.setStyle(this._mask, 'top', '0');
+                    Dom.setStyle(this._mask, 'left', '0');
+                    Dom.setStyle(this._mask, 'opacity', '.5');
+                    Dom.addClass(this._mask, 'yui-editor-masked');
+                    this.get('iframe').get('parentNode').appendChild(this._mask);
+                }
+            } else {
+                if (this._mask) {
+                    this._mask.parentNode.removeChild(this._mask);
+                    this._mask = null;
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', false);
+                    }
+                    this._setDesignMode('on');
+                    this._focusWindow();
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.nodeChange.call(self);
+                    }, 100);
+                }
+            }
+        },
+        /**
+        * @property EDITOR_PANEL_ID
+        * @description HTML id to give the properties window in the DOM.
+        * @type String
+        */
+        EDITOR_PANEL_ID: 'yui-editor-panel',
+        /**
+        * @property SEP_DOMPATH
+        * @description The value to place in between the Dom path items
+        * @type String
+        */
+        SEP_DOMPATH: '<',
+        /**
+        * @property STR_LEAVE_EDITOR
+        * @description The accessibility string for the element after the iFrame
+        * @type String
+        */
+        STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.',
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',
+        /**
+        * @property STR_TITLE
+        * @description The Title of the HTML document that is created in the iFrame
+        * @type String
+        */
+        STR_TITLE: 'Rich Text Area.',
+        /**
+        * @property STR_IMAGE_HERE
+        * @description The text to place in the URL textbox when using the blankimage.
+        * @type String
+        */
+        STR_IMAGE_HERE: 'Image Url Here',
+        /**
+        * @property STR_LINK_URL
+        * @description The label string for the Link URL.
+        * @type String
+        */
+        STR_LINK_URL: 'Link URL',
+        /**
+        * @protected
+        * @property STOP_EXEC_COMMAND
+        * @description Set to true when you want the default execCommand function to not process anything
+        * @type Boolean
+        */
+        STOP_EXEC_COMMAND: false,
+        /**
+        * @protected
+        * @property STOP_NODE_CHANGE
+        * @description Set to true when you want the default nodeChange function to not process anything
+        * @type Boolean
+        */
+        STOP_NODE_CHANGE: false,
+        /**
+        * @protected
+        * @property CLASS_NOEDIT
+        * @description CSS class applied to elements that are not editable.
+        * @type String
+        */
+        CLASS_NOEDIT: 'yui-noedit',
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the editors container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-editor-container',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE
+        * @description Default CSS class to apply to the editors iframe element
+        * @type String
+        */
+        CLASS_EDITABLE: 'yui-editor-editable',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE_CONT
+        * @description Default CSS class to apply to the editors iframe's parent element
+        * @type String
+        */
+        CLASS_EDITABLE_CONT: 'yui-editor-editable-container',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-editor',
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: function() {
+            var br = YAHOO.env.ua;
+            //Check for webkit3
+            if (br.webkit > 420) {
+                br.webkit3 = br.webkit;
+            } else {
+                br.webkit3 = 0;
+            }
+            return br;
+        }(),
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'SimpleEditor');
+
+            if (!this._defaultToolbar) {
+                this._defaultToolbar = {
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }
+                                
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Lists',
+                            buttons: [
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                };
+            }
+
+            YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes);
+            YAHOO.widget.EditorInfo._instances[this.get('id')] = this;
+
+
+            this.currentElement = [];
+            this.on('contentReady', function() {
+                this.DOMReady = true;
+                this.fireQueue();
+            }, this, true);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr);
+            var self = this;
+
+            /**
+            * @config container
+            * @description Used when dynamically creating the Editor from Javascript with no default textarea.
+            * We will create one and place it in this container. If no container is passed we will append to document.body.
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                writeOnce: true,
+                value: attr.container || false
+            });
+            /**
+            * @config plainText
+            * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('plainText', {
+                writeOnce: true,
+                value: attr.plainText || false
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('iframe', {
+                value: null
+            });
+            /**
+            * @private
+            * @depreciated
+            * @config textarea
+            * @description Internal config for holding the textarea element (replaced with element).
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('textarea', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @private
+            * @config container
+            * @description Internal config for holding a reference to the container to append a dynamic editor to.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                readOnly: true,
+                value: null
+            });
+            /**
+            * @config nodeChangeThreshold
+            * @description The number of seconds that need to be in between nodeChange processing
+            * @default 3
+            * @type Number
+            */            
+            this.setAttributeConfig('nodeChangeThreshold', {
+                value: attr.nodeChangeThreshold || 3,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @config allowNoEdit
+            * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes.
+            * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('allowNoEdit', {
+                value: attr.allowNoEdit || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config limitCommands
+            * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('limitCommands', {
+                value: attr.limitCommands || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('element_cont', {
+                value: attr.element_cont
+            });
+            /**
+            * @private
+            * @config editor_wrapper
+            * @description The outter wrapper for the entire editor.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('editor_wrapper', {
+                value: attr.editor_wrapper || null,
+                writeOnce: true
+            });
+            /**
+            * @attribute height
+            * @description The height of the editor iframe container, not including the toolbar..
+            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
+            * @type String
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || Dom.getStyle(self.get('element'), 'height'),
+                method: function(height) {
+                    if (this._rendered) {
+                        //We have been rendered, change the height
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), {
+                                height: {
+                                    to: parseInt(height, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height);
+                        }
+                    }
+                }
+            });
+            /**
+            * @config autoHeight
+            * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height.
+            * @default false
+            * @type Boolean || Number
+            */
+            this.setAttributeConfig('autoHeight', {
+                value: attr.autoHeight || false,
+                method: function(a) {
+                    if (a) {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'no');
+                        }
+                        this.on('afterNodeChange', this._handleAutoHeight, this, true);
+                        this.on('editorKeyDown', this._handleAutoHeight, this, true);
+                        this.on('editorKeyPress', this._handleAutoHeight, this, true);
+                    } else {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'auto');
+                        }
+                        this.unsubscribe('afterNodeChange', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyDown', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyPress', this._handleAutoHeight);
+                    }
+                }
+            });
+            /**
+            * @attribute width
+            * @description The width of the editor container.
+            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
+            * @type String
+            */            
+            this.setAttributeConfig('width', {
+                value: attr.width || Dom.getStyle(this.get('element'), 'width'),
+                method: function(width) {
+                    if (this._rendered) {
+                        //We have been rendered, change the width
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), {
+                                width: {
+                                    to: parseInt(width, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            this.get('element_cont').setStyle('width', width);
+                        }
+                    }
+                }
+            });
+                        
+            /**
+            * @attribute blankimage
+            * @description The URL for the image placeholder to put in when inserting an image.
+            * @default The yahooapis.com address for the current release + 'assets/blankimage.png'
+            * @type String
+            */            
+            this.setAttributeConfig('blankimage', {
+                value: attr.blankimage || this._getBlankImage()
+            });
+            /**
+            * @attribute css
+            * @description The Base CSS used to format the content of the editor
+            * @default <code><pre>html {
+                height: 95%;
+            }
+            body {
+                height: 100%;
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            }
+            a {
+                color: blue;
+                text-decoration: underline;
+                cursor: pointer;
+            }
+            .warning-localfile {
+                border-bottom: 1px dashed red !important;
+            }
+            .yui-busy {
+                cursor: wait !important;
+            }
+            img.selected { //Safari image selection
+                border: 2px dotted #808080;
+            }
+            img {
+                cursor: pointer !important;
+                border: none;
+            }
+            </pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('css', {
+                value: attr.css || this._defaultCSS,
+                writeOnce: true
+            });
+            /**
+            * @attribute html
+            * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item)
+            * @default This HTML requires a few things if you are to override:
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
+                <code>
+                <pre>
+                &lt;html&gt;
+                    &lt;head&gt;
+                        &lt;title&gt;{TITLE}&lt;/title&gt;
+                        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
+                        &lt;style&gt;
+                        {CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {HIDDEN_CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {EXTRA_CSS}
+                        &lt;/style&gt;
+                    &lt;/head&gt;
+                &lt;body onload="document.body._rteLoaded = true;"&gt;
+                {CONTENT}
+                &lt;/body&gt;
+                &lt;/html&gt;
+                </pre>
+                </code>
+            * @type String
+            */            
+            this.setAttributeConfig('html', {
+                value: attr.html || '<html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><base href="' + this._baseHREF + '"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute extracss
+            * @description Extra user defined css to load after the default SimpleEditor CSS
+            * @default ''
+            * @type String
+            */            
+            this.setAttributeConfig('extracss', {
+                value: attr.css || '',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute handleSubmit
+            * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
+            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
+            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('handleSubmit', {
+                value: attr.handleSubmit || false,
+                method: function(exec) {
+                    if (this.get('element').form) {
+                        if (!this._formButtons) {
+                            this._formButtons = [];
+                        }
+                        if (exec) {
+                            Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true);
+                            var i = this.get('element').form.getElementsByTagName('input');
+                            for (var s = 0; s < i.length; s++) {
+                                var type = i[s].getAttribute('type');
+                                if (type && (type.toLowerCase() == 'submit')) {
+                                    Event.on(i[s], 'click', this._handleFormButtonClick, this, true);
+                                    this._formButtons[this._formButtons.length] = i[s];
+                                }
+                            }
+                        } else {
+                            Event.unsubscribe(this.get('element').form, 'submit', this._handleFormSubmit);
+                            if (this._formButtons) {
+                                Event.unsubscribe(this._formButtons, 'click', this._handleFormButtonClick);
+                            }
+                        }
+                    }
+                }
+            });
+            /**
+            * @attribute disabled
+            * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
+            All Toolbar buttons are also disabled so they cannot be used.
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (this._rendered) {
+                        this._disableEditor(disabled);
+                    }
+                }
+            });
+            /**
+            * @config toolbar_cont
+            * @description Internal config for the toolbars container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('toolbar_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @attribute toolbar
+            * @description The default toolbar config.
+            * @type Object
+            */            
+            this.setAttributeConfig('toolbar', {
+                value: attr.toolbar || this._defaultToolbar,
+                writeOnce: true,
+                method: function(toolbar) {
+                    if (!toolbar.buttonType) {
+                        toolbar.buttonType = this._defaultToolbar.buttonType;
+                    }
+                    this._defaultToolbar = toolbar;
+                }
+            });
+            /**
+            * @attribute animate
+            * @description Should the editor animate window movements
+            * @default false unless Animation is found, then true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('animate', {
+                value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false),
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+            /**
+            * @config panel
+            * @description A reference to the panel we are using for windows.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('panel', {
+                value: null,
+                writeOnce: true,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.widget.Overlay) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @attribute focusAtStart
+            * @description Should we focus the window when the content is ready?
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('focusAtStart', {
+                value: attr.focusAtStart || false,
+                writeOnce: true,
+                method: function() {
+                    this.on('editorContentLoaded', function() {
+                        var self = this;
+                        setTimeout(function() {
+                            self._focusWindow.call(self, true);
+                            self.editorDirty = false;
+                        }, 400);
+                    }, this, true);
+                }
+            });
+            /**
+            * @attribute dompath
+            * @description Toggle the display of the current Dom path below the editor
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('dompath', {
+                value: attr.dompath || false,
+                method: function(dompath) {
+                    if (dompath && !this.dompath) {
+                        this.dompath = document.createElement('DIV');
+                        this.dompath.id = this.get('id') + '_dompath';
+                        Dom.addClass(this.dompath, 'dompath');
+                        this.get('element_cont').get('firstChild').appendChild(this.dompath);
+                        if (this.get('iframe')) {
+                            this._writeDomPath();
+                        }
+                    } else if (!dompath && this.dompath) {
+                        this.dompath.parentNode.removeChild(this.dompath);
+                        this.dompath = null;
+                    }
+                }
+            });
+            /**
+            * @attribute markup
+            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml
+            * @default "semantic"
+            * @type String
+            */            
+            this.setAttributeConfig('markup', {
+                value: attr.markup || 'semantic',
+                validator: function(markup) {
+                    switch (markup.toLowerCase()) {
+                        case 'semantic':
+                        case 'css':
+                        case 'default':
+                        case 'xhtml':
+                        return true;
+                    }
+                    return false;
+                }
+            });
+            /**
+            * @attribute removeLineBreaks
+            * @description Should we remove linebreaks and extra spaces on cleanup
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('removeLineBreaks', {
+                value: attr.removeLineBreaks || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            
+
+            this.on('afterRender', function() {
+                this._renderPanel();
+            });
+        },
+        /**
+        * @private
+        * @method _getBlankImage
+        * @description Retrieves the full url of the image to use as the blank image.
+        * @return {String} The URL to the blank image
+        */
+        _getBlankImage: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['_getBlankImage', arguments];
+                return '';
+            }
+            var img = '';
+            if (!this._blankImageLoaded) {
+                var div = document.createElement('div');
+                div.style.position = 'absolute';
+                div.style.top = '-9999px';
+                div.style.left = '-9999px';
+                div.className = this.CLASS_PREFIX + '-blankimage';
+                document.body.appendChild(div);
+                img = YAHOO.util.Dom.getStyle(div, 'background-image');
+                img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+                this.set('blankimage', img);
+                this._blankImageLoaded = true;
+            } else {
+                img = this.get('blankimage');
+            }
+            return img;
+        },
+        /**
+        * @private
+        * @method _handleAutoHeight
+        * @description Handles resizing the editor's height based on the content
+        */
+        _handleAutoHeight: function() {
+            var doc = this._getDoc(),
+                body = doc.body,
+                docEl = doc.documentElement;
+
+            var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10);
+            var newHeight = body.scrollHeight;
+            if (this.browser.webkit) {
+                newHeight = docEl.scrollHeight;
+            }
+            if (newHeight < parseInt(this.get('height'), 10)) {
+                newHeight = parseInt(this.get('height'), 10);
+            }
+            if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) {   
+                Dom.setStyle(this.get('editor_wrapper'), 'height', newHeight + 'px');
+                if (this.browser.ie) {
+                    //Internet Explorer needs this
+                    this.get('iframe').setStyle('height', '99%');
+                    this.get('iframe').setStyle('zoom', '1');
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.get('iframe').setStyle('height', '100%');
+                    }, 1);
+                }
+            }
+        },
+        _formButtons: null,
+        _formButtonClicked: null,
+        _handleFormButtonClick: function(ev) {
+            var tar = Event.getTarget(ev);
+            this._formButtonClicked = tar;
+        },
+        /**
+        * @private
+        * @method _handleFormSubmit
+        * @description Handles the form submission.
+        * @param {Object} ev The Form Submit Event
+        */
+        _handleFormSubmit: function(ev) {
+            Event.stopEvent(ev);
+            YAHOO.log('Button: ' + this._formButtonClicked.id, 'info', 'SimpleEditor');
+            
+            this.saveHTML();
+            var form = this.get('element').form;
+            var tar = this._formButtonClicked || false;
+            var self = this;
+
+            window.setTimeout(function() {
+                YAHOO.util.Event.removeListener(form, 'submit', self._handleFormSubmit);
+                if (YAHOO.env.ua.ie) {
+                    form.fireEvent("onsubmit");
+                    if (tar) {
+                        tar.click();
+                    }
+                } else {  // Gecko, Opera, and Safari
+                    if (tar) {
+                        tar.click();
+                    } else {
+                        var oEvent = document.createEvent("HTMLEvents");
+                        oEvent.initEvent("submit", true, true);
+                        form.dispatchEvent(oEvent);
+                        if (YAHOO.env.ua.webkit) {
+                            if (YAHOO.lang.isFunction(form.submit)) {
+                                form.submit();
+                            }
+                        }
+                    }
+                }
+                /*
+                if (YAHOO.env.ua.ie || YAHOO.env.ua.webkit) {
+                    if (YAHOO.lang.isFunction(form.submit)) {
+                        form.submit();
+                    } else {
+                        if (YAHOO.lang.isObject(form.submit)) {
+                            form.submit.click();
+                        } else {
+                            YAHOO.log('Form submit failed because form.submit was not a function. Please change the submit buttons name and id.', 'error', 'SimpleEditor');
+                        }
+                    }
+                }
+                */
+            }, 200);
+            
+        },
+        /**
+        * @private
+        * @method _handleFontSize
+        * @description Handles the font size button in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleFontSize: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var value = button.get('label') + 'px';
+            this.execCommand('fontsize', value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @description Handles the colorpicker buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleColorPicker: function(o) {
+            var cmd = o.button;
+            var value = '#' + o.color;
+            if ((cmd == 'forecolor') || (cmd == 'backcolor')) {
+                this.execCommand(cmd, value);
+            }
+        },
+        /**
+        * @private
+        * @method _handleAlign
+        * @description Handles the alignment buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleAlign: function(o) {
+            var cmd = null;
+            for (var i = 0; i < o.button.menu.length; i++) {
+                if (o.button.menu[i].value == o.button.value) {
+                    cmd = o.button.menu[i].value;
+                }
+            }
+            var value = this._getSelection();
+
+            this.execCommand(cmd, value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleAfterNodeChange
+        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
+        */
+        _handleAfterNodeChange: function() {
+            var path = this._getDomPath(),
+                elm = null,
+                family = null,
+                fontsize = null,
+                validFont = false;
+            var fn_button = this.toolbar.getButtonByValue('fontname');
+            var fs_button = this.toolbar.getButtonByValue('fontsize');
+            var hd_button = this.toolbar.getButtonByValue('heading');
+
+            for (var i = 0; i < path.length; i++) {
+                elm = path[i];
+
+                var tag = elm.tagName.toLowerCase();
+
+
+                if (elm.getAttribute('tag')) {
+                    tag = elm.getAttribute('tag');
+                }
+
+                family = elm.getAttribute('face');
+                if (Dom.getStyle(elm, 'font-family')) {
+                    family = Dom.getStyle(elm, 'font-family');
+                }
+
+                if (tag.substring(0, 1) == 'h') {
+                    if (hd_button) {
+                        for (var h = 0; h < hd_button._configs.menu.value.length; h++) {
+                            if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[h].text);
+                            }
+                        }
+                        this._updateMenuChecked('heading', tag);
+                    }
+                }
+            }
+
+            if (fn_button) {
+                for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                    if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                        validFont = true;
+                        family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                    }
+                }
+                if (!validFont) {
+                    family = fn_button._configs.label._initialConfig.value;
+                }
+                var familyLabel = '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>';
+                if (fn_button.get('label') != familyLabel) {
+                    fn_button.set('label', familyLabel);
+                    this._updateMenuChecked('fontname', family);
+                }
+            }
+
+            if (fs_button) {
+                fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10);
+                if ((fontsize === null) || isNaN(fontsize)) {
+                    fontsize = fs_button._configs.label._initialConfig.value;
+                }
+                fs_button.set('label', ''+fontsize);
+            }
+            
+            if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) {
+                this.toolbar.enableButton(fn_button);
+                this.toolbar.enableButton(fs_button);
+                this.toolbar.enableButton('forecolor');
+                this.toolbar.enableButton('backcolor');
+            }
+            if (this._isElement(elm, 'img')) {
+                if (YAHOO.widget.Overlay) {
+                    this.toolbar.enableButton('createlink');
+                }
+            }
+            if (this._isElement(elm, 'blockquote')) {
+                this.toolbar.selectButton('indent');
+                this.toolbar.disableButton('indent');
+                this.toolbar.enableButton('outdent');
+            }
+            if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) {
+                this.toolbar.disableButton('indent');
+            }
+            this._lastButton = null;
+            
+        },
+        _setBusy: function(off) {
+            /*
+            if (off) {
+                Dom.removeClass(document.body, 'yui-busy');
+                Dom.removeClass(this._getDoc().body, 'yui-busy');
+            } else {
+                Dom.addClass(document.body, 'yui-busy');
+                Dom.addClass(this._getDoc().body, 'yui-busy');
+            }
+            */
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    YAHOO.log('Toolbar Button for (insertimage) was not found, skipping exec.', 'info', 'SimpleEditor');
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    src = 'http://';
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                        }
+                    }
+                }
+                var str = prompt(this.STR_LINK_URL + ': ', src);
+                if ((str !== '') && (str !== null)) {
+                    el.setAttribute('src', str);
+                } else if (str === null) {
+                    el.parentNode.removeChild(el);
+                    this.currentElement = [];
+                    this.nodeChange();
+                }
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            }, this, true);
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            this.nodeChange();
+        },
+        /**
+        * @private
+        * @method _isLocalFile
+        * @param {String} url THe url/string to check
+        * @description Checks to see if a string (href or img src) is possibly a local file reference..
+        */
+        _isLocalFile: function(url) {
+            if ((url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor');
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    url = '';
+
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                    }
+                }
+                var str = prompt(this.STR_LINK_URL + ': ', url);
+                if ((str !== '') && (str !== null)) {
+                    var urlValue = str;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            if (urlValue.substring(0, 1) != '#') {
+                                urlValue = 'http:/'+'/' + urlValue;
+                            }
+                        }
+                    }
+                    el.setAttribute('href', urlValue);
+                } else if (str !== null) {
+                    var _span = this._getDoc().createElement('span');
+                    _span.innerHTML = el.innerHTML;
+                    Dom.addClass(_span, 'yui-non');
+                    el.parentNode.replaceChild(_span, el);
+                }
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            this.nodeChange();
+            this.currentElement = [];
+        },
+        /**
+        * @method render
+        * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load.
+        */
+        render: function() {
+            if (this._rendered) {
+                return false;
+            }
+            YAHOO.log('Render', 'info', 'SimpleEditor');
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['render', arguments];
+                return false;
+            }
+            this._rendered = true;
+            var self = this;
+            window.setTimeout(function() {
+                self._render.call(self);
+            }, 4);
+        },
+        /**
+        * @private
+        * @method _render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        _render: function() {
+            this._setBusy();
+            var self = this;
+            this.set('textarea', this.get('element'));
+
+            this.get('element_cont').setStyle('display', 'none');
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+
+            this.set('iframe', this._createIframe());
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+
+            this.get('editor_wrapper').appendChild(this.get('iframe').get('element'));
+
+            if (this.get('disabled')) {
+                this._disableEditor(true);
+            }
+
+            var tbarConf = this.get('toolbar');
+            //Create Toolbar instance
+            if (tbarConf instanceof Toolbar) {
+                this.toolbar = tbarConf;
+                //Set the toolbar to disabled until content is loaded
+                this.toolbar.set('disabled', true);
+            } else {
+                //Set the toolbar to disabled until content is loaded
+                tbarConf.disabled = true;
+                this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            }
+
+            YAHOO.log('fireEvent::toolbarLoaded', 'info', 'SimpleEditor');
+            this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
+
+            
+            this.toolbar.on('toolbarCollapsed', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('toolbarExpanded', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('fontsizeClick', function(o) {
+                this._handleFontSize(o);
+            }, this, true);
+            
+            this.toolbar.on('colorPickerClicked', function(o) {
+                this._handleColorPicker(o);
+                return false; //Stop the buttonClick event
+            }, this, true);
+
+            this.toolbar.on('alignClick', function(o) {
+                this._handleAlign(o);
+            }, this, true);
+            this.on('afterNodeChange', function() {
+                this._handleAfterNodeChange();
+            }, this, true);
+            this.toolbar.on('insertimageClick', function() {
+                this._handleInsertImageClick();
+            }, this, true);
+            this.on('windowinsertimageClose', function() {
+                this._handleInsertImageWindowClose();
+            }, this, true);
+            this.toolbar.on('createlinkClick', function() {
+                this._handleCreateLinkClick();
+            }, this, true);
+            this.on('windowcreatelinkClose', function() {
+                this._handleCreateLinkWindowClose();
+            }, this, true);
+            
+
+            //Replace Textarea with editable area
+            this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
+
+            
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            this.get('element_cont').appendChild(this.get('element'));
+            this.get('element_cont').setStyle('display', 'block');
+
+
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
+
+            //Set height and width of editor container
+            this.get('element_cont').setStyle('width', this.get('width'));
+            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
+
+            this.get('iframe').setStyle('width', '100%'); //WIDTH
+            this.get('iframe').setStyle('height', '100%');
+
+            window.setTimeout(function() {
+                self._setupAfterElement.call(self);
+            }, 0);
+            this.fireEvent('afterRender', { type: 'afterRender', target: this });
+        },
+        /**
+        * @method execCommand
+        * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml)
+        * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana'
+        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
+        */
+        execCommand: function(action, value) {
+            var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            }
+            this._setMarkupType(action);
+            if (this.browser.ie) {
+                this._getWindow().focus();
+            }
+            var exec = true;
+            
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue(action)) {
+                    YAHOO.log('Toolbar Button for (' + action + ') was not found, skipping exec.', 'info', 'SimpleEditor');
+                    exec = false;
+                }
+            }
+
+            this.editorDirty = true;
+            
+            if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) {
+                YAHOO.log('Found execCommand override method: (cmd_' + action.toLowerCase() + ')', 'info', 'SimpleEditor');
+                var retValue = this['cmd_' + action.toLowerCase()](value);
+                exec = retValue[0];
+                if (retValue[1]) {
+                    action = retValue[1];
+                }
+                if (retValue[2]) {
+                    value = retValue[2];
+                }
+            }
+            if (exec) {
+                YAHOO.log('execCommand::(' + action + '), (' + value + ')', 'info', 'SimpleEditor');
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                    YAHOO.log('execCommand Failed', 'error', 'SimpleEditor');
+                }
+            } else {
+                YAHOO.log('OVERRIDE::execCommand::(' + action + '),(' + value + ') skipped', 'warn', 'SimpleEditor');
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+    /* {{{  Command Overrides */
+
+        /**
+        * @method cmd_backcolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used.
+        */
+        cmd_backcolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement(),
+                action = 'backcolor';
+
+            if (this.browser.gecko || this.browser.opera) {
+                this._setEditorStyle(true);
+                action = 'hilitecolor';
+            }
+            /**
+            * @browser opera
+            * @knownissue - Opera fails to assign a background color on an element that already has one.
+            *
+            if (this.browser.opera) {
+                if (!this._isElement(el, 'body') && Dom.getStyle(el, 'background-color')) {
+                    Dom.setStyle(el, 'background-color', value);
+                } else {
+                    this._createCurrentElement('span', { backgroundColor: value });
+                }
+                exec = false;
+            //} else if (!this._hasSelection()) {
+            } else if (el !== this._getDoc().body) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }*/
+
+            if (!this._isElement(el, 'body')) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }
+
+            return [exec, action];
+        },
+        /**
+        * @method cmd_forecolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used.
+        */
+        cmd_forecolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement();
+
+                if (!this._isElement(el, 'body')) {
+                    Dom.setStyle(el, 'color', value);
+                    this._selectNode(el);
+                    exec = false;
+                } else {
+                    this._createCurrentElement('span', { color: value });
+                    this._selectNode(this.currentElement[0]);
+                    exec = false;
+                }
+                return [exec];
+        },
+        /**
+        * @method cmd_unlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used.
+        */
+        cmd_unlink: function(value) {
+            this._swapEl(this.currentElement[0], 'span', function(el) {
+                el.className = 'yui-non';
+            });
+            return [false];
+        },
+        /**
+        * @method cmd_createlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used.
+        */
+        cmd_createlink: function(value) {
+            var el = this._getSelectedElement(), _a = null;
+            if (this._hasParent(el, 'a')) {
+                this.currentElement[0] = this._hasParent(el, 'a');
+            } else if (!this._isElement(el, 'a')) {
+                this._createCurrentElement('a');
+                _a = this._swapEl(this.currentElement[0], 'a');
+                this.currentElement[0] = _a;
+            } else {
+                this.currentElement[0] = el;
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_insertimage
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used.
+        */
+        cmd_insertimage: function(value) {
+            var exec = true, _img = null, action = 'insertimage',
+                el = this._getSelectedElement();
+
+            if (value === '') {
+                value = this.get('blankimage');
+            }
+
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            
+            YAHOO.log('InsertImage: ' + el.tagName, 'info', 'SimpleEditor');
+            if (this._isElement(el, 'img')) {
+                this.currentElement[0] = el;
+                exec = false;
+            } else {
+                if (this._getDoc().queryCommandEnabled(action)) {
+                    this._getDoc().execCommand('insertimage', false, value);
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                            YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                            this.currentElement[0] = imgs[i];
+                        }
+                    }
+                    exec = false;
+                } else {
+                    if (el == this._getDoc().body) {
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this._getDoc().body.appendChild(_img);
+                    } else {
+                        this._createCurrentElement('img');
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                    }
+                    this.currentElement[0] = _img;
+                    exec = false;
+                }
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_inserthtml
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used.
+        */
+        cmd_inserthtml: function(value) {
+            var exec = true, action = 'inserthtml', _span = null, _range = null;
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                YAHOO.log('More Safari DOM tricks (inserthtml)', 'info', 'EditorSafari');
+                this._createCurrentElement('img');
+                _span = this._getDoc().createElement('span');
+                _span.innerHTML = value;
+                this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                exec = false;
+            } else if (this.browser.ie) {
+                _range = this._getRange();
+                if (_range.item) {
+                    _range.item(0).outerHTML = value;
+                } else {
+                    _range.pasteHTML(value);
+                }
+                exec = false;                    
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_list
+        * @param tag The tag of the list you want to create (eg, ul or ol)
+        * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods.
+        */
+        cmd_list: function(tag) {
+            var exec = true, list = null, li = 0, el = null, str = '',
+                selEl = this._getSelectedElement(), action = 'insertorderedlist';
+                if (tag == 'ul') {
+                    action = 'insertunorderedlist';
+                }
+            /**
+            * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+            * @browser Safari 2.x
+            * The issue with this workaround is that when applied to a set of text
+            * that has BR's in it, Safari may or may not pick up the individual items as
+            * list items. This is fixed in WebKit (Safari 3)
+            */
+            if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) {
+                    YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor');
+                    el = selEl.parentNode;
+                    list = this._getDoc().createElement('span');
+                    YAHOO.util.Dom.addClass(list, 'yui-non');
+                    str = '';
+                    var lis = el.getElementsByTagName('li');
+                    for (li = 0; li < lis.length; li++) {
+                        str += '<div>' + lis[li].innerHTML + '</div>';
+                    }
+                    list.innerHTML = str;
+                    this.currentElement[0] = el;
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                } else {
+                    YAHOO.log('Create list item', 'info', 'SimpleEditor');
+                    this._createCurrentElement(tag.toLowerCase());
+                    list = this._getDoc().createElement(tag);
+                    for (li = 0; li < this.currentElement.length; li++) {
+                        var newli = this._getDoc().createElement('li');
+                        newli.innerHTML = this.currentElement[li].innerHTML + '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        list.appendChild(newli);
+                        if (li > 0) {
+                            this.currentElement[li].parentNode.removeChild(this.currentElement[li]);
+                        }
+                    }
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                    this.currentElement[0] = list;
+                    var _h = this.currentElement[0].firstChild;
+                    _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0];
+                    this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length);
+                }
+                exec = false;
+            } else {
+                el = this._getSelectedElement();
+                YAHOO.log(el.tagName);
+                if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list..
+                    YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor');
+                    if (this.browser.ie) {
+                        if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) {
+                            el = el.getElementsByTagName('li')[0];
+                        }
+                        YAHOO.log('Undo IE', 'info', 'SimpleEditor');
+                        str = '';
+                        var lis2 = el.parentNode.getElementsByTagName('li');
+                        for (var j = 0; j < lis2.length; j++) {
+                            str += lis2[j].innerHTML + '<br>';
+                        }
+                        var newEl = this._getDoc().createElement('span');
+                        newEl.innerHTML = str;
+                        el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    } else {
+                        this.nodeChange();
+                        this._getDoc().execCommand(action, '', el.parentNode);
+                        this.nodeChange();
+                    }
+                    exec = false;
+                }
+                if (this.browser.opera) {
+                    var self = this;
+                    window.setTimeout(function() {
+                        var liso = self._getDoc().getElementsByTagName('li');
+                        for (var i = 0; i < liso.length; i++) {
+                            if (liso[i].innerHTML.toLowerCase() == '<br>') {
+                                liso[i].parentNode.parentNode.removeChild(liso[i].parentNode);
+                            }
+                        }
+                    },30);
+                }
+                if (this.browser.ie && exec) {
+                    var html = '';
+                    if (this._getRange().html) {
+                        html = '<li>' + this._getRange().html+ '</li>';
+                    } else {
+                        var t = this._getRange().text.split('\n');
+                        if (t.length > 1) {
+                            html = '';
+                            for (var ie = 0; ie < t.length; ie++) {
+                                html += '<li>' + t[ie] + '</li>';
+                            }
+                        } else {
+                            html = '<li>' + this._getRange().text + '</li>';
+                        }
+                    }
+
+                    this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
+                    exec = false;
+                }
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_insertorderedlist
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used.
+        */
+        cmd_insertorderedlist: function(value) {
+            return [this.cmd_list('ol')];
+        },
+        /**
+        * @method cmd_insertunorderedlist 
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used.
+        */
+        cmd_insertunorderedlist: function(value) {
+            return [this.cmd_list('ul')];
+        },
+        /**
+        * @method cmd_fontname
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used.
+        */
+        cmd_fontname: function(value) {
+            var exec = true,
+                selEl = this._getSelectedElement();
+
+            this.currentFont = value;
+            if (selEl && selEl.tagName && !this._hasSelection()) {
+                YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_fontsize
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used.
+        */
+        cmd_fontsize: function(value) {
+            if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection())) {
+                YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+            } else if (!this._isElement(this._getSelectedElement(), 'body')) {
+                var el = this._getSelectedElement();
+                YAHOO.util.Dom.setStyle(el, 'fontSize', value);
+                this._selectNode(el);
+            } else {
+                this._createCurrentElement('span', {'fontSize': value });
+                this._selectNode(this.currentElement[0]);
+            }
+            return [false];
+        },
+    /* }}} */
+        /**
+        * @private
+        * @method _swapEl
+        * @param {HTMLElement} el The element to swap with
+        * @param {String} tagName The tagname of the element that you wish to create
+        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.
+        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place.
+        */
+        _swapEl: function(el, tagName, callback) {
+            var _el = this._getDoc().createElement(tagName);
+            _el.innerHTML = el.innerHTML;
+            if (typeof callback == 'function') {
+                callback.call(this, _el);
+            }
+            el.parentNode.replaceChild(_el, el);
+            return _el;
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for an element with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to the 
+        * <code>this.currentElement</code> array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            tagName = ((tagName) ? tagName : 'a');
+            var tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                var el = null;
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+
+                        for (var k in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, k)) {
+                                el.style[k] = tagStyle[k];
+                            }
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var j = 0; j < imgs.length; j++) {
+                        if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[j].parentNode.replaceChild(el, imgs[j]);
+                            this.currentElement[this.currentElement.length] = el;
+                        }
+                    }
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    el = _elCreate();
+                    if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) {
+                        if (this._isElement(tar, 'html')) {
+                            tar = this._getDoc().body;
+                        }
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
+                    }
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
+                    if (this.browser.webkit) {
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        if (this.browser.webkit3) {
+                            this._getSelection().collapseToStart();
+                        } else {
+                            this._getSelection().collapse(true);
+                        }
+                    }
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                var _tmp6 = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);
+                for (var e1 = 0; e1 < _tmp1.length; e1++) {
+                    _tmp[_tmp.length] = _tmp1[e1];
+                }
+                for (var e6 = 0; e6 < _tmp6.length; e6++) {
+                    _tmp[_tmp.length] = _tmp6[e6];
+                }
+                for (var e2 = 0; e2 < _tmp2.length; e2++) {
+                    _tmp[_tmp.length] = _tmp2[e2];
+                }
+                for (var e3 = 0; e3 < _tmp3.length; e3++) {
+                    _tmp[_tmp.length] = _tmp3[e3];
+                }
+                for (var e4 = 0; e4 < _tmp4.length; e4++) {
+                    _tmp[_tmp.length] = _tmp4[e4];
+                }
+                for (var e5 = 0; e5 < _tmp5.length; e5++) {
+                    _tmp[_tmp.length] = _tmp5[e5];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) {
+                            var fc = _tmp[i].getElementsByTagName('li')[0];
+                            _tmp[i].style.fontFamily = 'inherit';
+                            fc.style.fontFamily = 'inherit';
+                            el.innerHTML = fc.innerHTML;
+                            fc.innerHTML = '';
+                            fc.appendChild(el);
+                            this.currentElement[this.currentElement.length] = el;
+                        } else if (this._isElement(_tmp[i], 'li')) {
+                            _tmp[i].innerHTML = '';
+                            _tmp[i].appendChild(el);
+                            _tmp[i].style.fontFamily = 'inherit';
+                            this.currentElement[this.currentElement.length] = el;
+                        } else {
+                            if (_tmp[i].parentNode) {
+                                _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                                this.currentElement[this.currentElement.length] = el;
+                                this.currentEvent = null;
+                                if (this.browser.webkit) {
+                                    //Force Safari to focus the new element
+                                    this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                    if (this.browser.webkit3) {
+                                        this._getSelection().collapseToStart();
+                                    } else {
+                                        this._getSelection().collapse(true);
+                                    }
+                                }
+                                if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                    this._getSelection().empty();
+                                }
+                                if (this.browser.gecko) {
+                                    this._getSelection().collapseToStart();
+                                }
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var e = 0; e < len; e++) {
+                    if ((e + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[e] && this.currentElement[e].nextSibling) {
+                            if (this._isElement(this.currentElement[e], 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[e].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        * @return String
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('element').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            html = this._cleanIncomingHTML(html);
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            var b = this._getDoc().body;
+            if (b === null) {
+                YAHOO.log('Body is null, returning null.', 'error', 'SimpleEditor');
+                return null;
+            }
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method show
+        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.
+        */
+        show: function() {
+            if (this.browser.gecko) {
+                this._setDesignMode('on');
+                this._focusWindow();
+            }
+            if (this.browser.webkit) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._setInitialContent.call(self);
+                }, 10);
+            }
+            //Adding this will close all other Editor window's when showing this one.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            //Put the iframe back in place
+            this.get('iframe').setStyle('position', 'static');
+            this.get('iframe').setStyle('left', '');
+        },
+        /**
+        * @method hide
+        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.
+        */
+        hide: function() {
+            //Adding this will close all other Editor window's.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this._fixNodesTimer) {
+                clearTimeout(this._fixNodesTimer);
+                this._fixNodesTimer = null;
+            }
+            if (this._nodeChangeTimer) {
+                clearTimeout(this._nodeChangeTimer);
+                this._nodeChangeTimer = null;
+            }
+            this._lastNodeChange = 0;
+            //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.
+            this.get('iframe').setStyle('position', 'absolute');
+            this.get('iframe').setStyle('left', '-9999px');
+        },
+        /**
+        * @method _cleanIncomingHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the input
+        * @return {String} The filtered HTML
+        */
+        _cleanIncomingHTML: function(html) {
+            html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+            html = html.replace(/<\/strong>/gi, '</b>');   
+
+            //replace embed before em check
+            html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+            html = html.replace(/<\/embed>/gi, '</YUI_EMBED>');
+
+            html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+            html = html.replace(/<\/em>/gi, '</i>');
+            
+            //Put embed tags back in..
+            html = html.replace(/<YUI_EMBED([^>]*)>/gi, '<embed$1>');
+            html = html.replace(/<\/YUI_EMBED>/gi, '</embed>');
+            if (this.get('plainText')) {
+                YAHOO.log('Filtering as plain text', 'info', 'SimpleEditor');
+                html = html.replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+                html = html.replace(/  /gi, '&nbsp;&nbsp;'); //Replace all double spaces
+                html = html.replace(/\t/gi, '&nbsp;&nbsp;&nbsp;&nbsp;'); //Replace all tabs
+            }
+            //Removing Script Tags from the Editor
+            html = html.replace(/<script([^>]*)>/gi, '<bad>');
+            html = html.replace(/<\/script([^>]*)>/gi, '</bad>');
+            html = html.replace(/&lt;script([^>]*)&gt;/gi, '<bad>');
+            html = html.replace(/&lt;\/script([^>]*)&gt;/gi, '</bad>');
+            //Replace the line feeds
+            html = html.replace(/\n/g, '<YUI_LF>').replace(/\r/g, '<YUI_LF>');
+            //Remove Bad HTML elements (used to be script nodes)
+            html = html.replace(new RegExp('<bad([^>]*)>(.*?)<\/bad>', 'gi'), '');
+            //Replace the lines feeds
+            html = html.replace(/<YUI_LF>/g, '\n');
+            return html;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @return {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                html = this.getEditorHTML();
+            }
+            var markup = this.get('markup');
+            //Make some backups...
+            html = this.pre_filter_linebreaks(html, markup);
+
+                   html = html.replace(/<img([^>]*)\/>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+
+                   html = html.replace(/<input([^>]*)\/>/gi, '<YUI_INPUT$1>');
+                   html = html.replace(/<input([^>]*)>/gi, '<YUI_INPUT$1>');
+
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+                   html = html.replace(/<blockquote([^>]*)>/gi, '<YUI_BQ$1>');
+                   html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>');
+
+                   html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+                   html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>');
+
+            //Convert b and i tags to strong and em tags
+            if ((markup == 'semantic') || (markup == 'xhtml')) {
+                html = html.replace(/<i(\s+[^>]*)?>/gi, '<em$1>');
+                html = html.replace(/<\/i>/gi, '</em>');
+                html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                html = html.replace(/<\/b>/gi, '</strong>');
+            }
+            
+            //Case Changing
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+            if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) {
+                html = html.replace(new RegExp('<font([^>]*)face="([^>]*)">(.*?)<\/font>', 'gi'), '<span $1 style="font-family: $2;">$3</span>');
+                html = html.replace(/<u/gi, '<span style="text-decoration: underline;"');
+                html = html.replace(/\/u>/gi, '/span>');
+                if (markup == 'css') {
+                    html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+                    html = html.replace(/<\/em>/gi, '</i>');
+                    html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+                    html = html.replace(/<\/strong>/gi, '</b>');
+                    html = html.replace(/<b/gi, '<span style="font-weight: bold;"');
+                    html = html.replace(/\/b>/gi, '/span>');
+                    html = html.replace(/<i/gi, '<span style="font-style: italic;"');
+                    html = html.replace(/\/i>/gi, '/span>');
+                }
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            } else {
+                       html = html.replace(/<u/gi, '<u');
+                       html = html.replace(/\/u>/gi, '/u>');
+            }
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+            html = this.filter_safari(html);
+
+            html = this.filter_internals(html);
+
+            html = this.filter_all_rgb(html);
+
+            //Replace our backups with the real thing
+            html = this.post_filter_linebreaks(html, markup);
+
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1 />');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1 />');
+            } else {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1>');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1>');
+            }
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            html = this.filter_invalid_lists(html);
+
+                   html = html.replace(/<YUI_BQ([^>]*)>/g, '<blockquote$1>');
+                   html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>');
+
+                   html = html.replace(/<YUI_EMBED([^>]*)>/g, '<embed$1>');
+                   html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>');
+
+            //Trim the output, removing whitespace from the beginning and end
+            html = YAHOO.lang.trim(html);
+
+            if (this.get('removeLineBreaks')) {
+                html = html.replace(/\n/g, '').replace(/\r/g, '');
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            }
+            
+            //First empty span
+            if (html.substring(0, 6).toLowerCase() == '<span>')  {
+                html = html.substring(6);
+                //Last empty span
+                if (html.substring(html.length - 7, html.length).toLowerCase() == '</span>')  {
+                    html = html.substring(0, html.length - 7);
+                }
+            }
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (Lang.isObject(v) && v.keepContents) {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1');
+                    } else {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '');
+                    }
+                }
+            }
+
+            this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html });
+
+            return html;
+        },
+        /**
+        * @method filter_invalid_lists
+        * @param String html The HTML string to filter
+        * @description Filters invalid ol and ul list markup, converts this: <li></li><ol>..</ol> to this: <li></li><li><ol>..</ol></li>
+        */
+        filter_invalid_lists: function(html) {
+            html = html.replace(/<\/li>\n/gi, '</li>');
+
+            html = html.replace(/<\/li><ol>/gi, '</li><li><ol>');
+            html = html.replace(/<\/ol>/gi, '</ol></li>');
+            html = html.replace(/<\/ol><\/li>\n/gi, "</ol>\n");
+
+            html = html.replace(/<\/li><ul>/gi, '</li><li><ul>');
+            html = html.replace(/<\/ul>/gi, '</ul></li>');
+            html = html.replace(/<\/ul><\/li>\n/gi, "</ul>\n");
+
+            html = html.replace(/<\/li>/gi, "</li>\n");
+            html = html.replace(/<\/ol>/gi, "</ol>\n");
+            html = html.replace(/<ol>/gi, "<ol>\n");
+            html = html.replace(/<ul>/gi, "<ul>\n");
+            return html;
+        },
+        /**
+        * @method filter_safari
+        * @param String html The HTML string to filter
+        * @description Filters strings specific to Safari
+        * @return String
+        */
+        filter_safari: function(html) {
+            if (this.browser.webkit) {
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+                //Remove bogus LI's
+                html = html.replace(/<li><\/li>/gi, '');
+                html = html.replace(/<li> <\/li>/gi, '');
+                html = html.replace(/<li>  <\/li>/gi, '');
+                //Remove bogus DIV's
+                html = html.replace(/<div><\/div>/gi, '');
+                html = html.replace(/<div> <\/div>/gi, '');
+            }
+            return html;
+        },
+        /**
+        * @method filter_internals
+        * @param String html The HTML string to filter
+        * @description Filters internal RTE strings and bogus attrs we don't want
+        * @return String
+        */
+        filter_internals: function(html) {
+                   html = html.replace(/\r/g, '');
+            //Fix stuff we don't want
+               html = html.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+            //Fix last BR in LI
+                   html = html.replace(/<YUI_BR><\/li>/gi, '</li>');
+
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ style=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            if (this.browser.ie) {
+                       html = html.replace(/ class= /gi, '');
+                       html = html.replace(/ class= >/gi, '');
+                       html = html.replace(/_height="([^>])"/gi, '');
+                       html = html.replace(/_width="([^>])"/gi, '');
+            }
+            
+            return html;
+        },
+        /**
+        * @method filter_all_rgb
+        * @param String str The HTML string to filter
+        * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00"
+        * @return String
+        */
+        filter_all_rgb: function(str) {
+            var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi");
+            var arr = str.match(exp);
+            if (Lang.isArray(arr)) {
+                for (var i = 0; i < arr.length; i++) {
+                    var color = this.filter_rgb(arr[i]);
+                    str = str.replace(arr[i].toString(), color);
+                }
+            }
+            
+            return str;
+        },
+        /**
+        * @method filter_rgb
+        * @param String css The CSS string containing rgb(#,#,#);
+        * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00
+        * @return String
+        */
+        filter_rgb: function(css) {
+            if (css.toLowerCase().indexOf('rgb') != -1) {
+                var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+                var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(',');
+            
+                if (rgb.length == 5) {
+                    var r = parseInt(rgb[1], 10).toString(16);
+                    var g = parseInt(rgb[2], 10).toString(16);
+                    var b = parseInt(rgb[3], 10).toString(16);
+
+                    r = r.length == 1 ? '0' + r : r;
+                    g = g.length == 1 ? '0' + g : g;
+                    b = b.length == 1 ? '0' + b : b;
+
+                    css = "#" + r + g + b;
+                }
+            }
+            return css;
+        },
+        /**
+        * @method pre_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        pre_filter_linebreaks: function(html, markup) {
+            if (this.browser.webkit) {
+                       html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                       html = html.replace(/<br class="webkit-block-placeholder">/gi, '<YUI_BR>');
+            }
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br (.*?)>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<br \/>/gi, '<YUI_BR>');
+                   html = html.replace(/<div><YUI_BR><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+            //Fix last BR
+               html = html.replace(/<YUI_BR>$/, '');
+            //Fix last BR in P
+               html = html.replace(/<YUI_BR><\/p>/g, '</p>');
+            return html;
+        },
+        /**
+        * @method post_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        post_filter_linebreaks: function(html, markup) {
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_BR>/g, '<br />');
+            } else {
+                       html = html.replace(/<YUI_BR>/g, '<br>');
+            }
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Override Method for Advanced Editor
+        */
+        _renderPanel: function() {
+        },
+        /**
+        * @method openWindow
+        * @description Override Method for Advanced Editor
+        */
+        openWindow: function(win) {
+        },
+        /**
+        * @method moveWindow
+        * @description Override Method for Advanced Editor
+        */
+        moveWindow: function() {
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        _closeWindow: function() {
+        },
+        /**
+        * @method closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        closeWindow: function() {
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.resetAllButtons();
+            this._focusWindow();        
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            var textArea = this.get('element');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            this.set('handleSubmit', false); //Remove the submit handler
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'SimpleEditor';
+            if (this.get && this.get('element_cont')) {
+                str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event cleanHTML
+* @description Event is fired after the cleanHTML method is called.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property _instances
+        * @description A reference to all editors on the page.
+        * @type Object
+        */
+        _instances: {},
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>
+        */
+        panel: null,
+        /**
+        * @method getEditorById
+        * @description Returns a reference to the Editor object associated with the given textarea
+        * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of
+        * @return Object <a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a>
+        */
+        getEditorById: function(id) {
+            if (!YAHOO.lang.isString(id)) {
+                //Not a string, assume a node Reference
+                id = id.id;
+            }
+            if (this._instances[id]) {
+                return this._instances[id];
+            }
+            return false;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorInfo.
+        * @return {String}
+        */
+        toString: function() {
+            var len = 0;
+            for (var i in this._instances) {
+                len++;
+            }
+            return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')';
+        }
+    };
+
+
+
+    
+})();
+YAHOO.register("simpleeditor", YAHOO.widget.SimpleEditor, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/editor/simpleeditor-beta-min.js b/lib/yui/editor/simpleeditor-beta-min.js
new file mode 100644 (file)
index 0000000..c6be32d
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;if(YAHOO.widget.Button){YAHOO.widget.ToolbarButtonAdvanced=YAHOO.widget.Button;YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType="rich";YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue=function(F){var E=this.getMenu().getItems();if(E.length===0){this.getMenu()._onBeforeShow();E=this.getMenu().getItems();}for(var D=0;D<E.length;D++){E[D].cfg.setProperty("checked",false);if(E[D].value==F){E[D].cfg.setProperty("checked",true);}}};}else{YAHOO.widget.ToolbarButtonAdvanced=function(){};}YAHOO.widget.ToolbarButton=function(E,D){if(C.isObject(arguments[0])&&!B.get(E).nodeType){D=E;}var G=(D||{});var F={element:null,attributes:G};if(!F.attributes.type){F.attributes.type="push";}F.element=document.createElement("span");F.element.setAttribute("unselectable","on");F.element.className="yui-button yui-"+F.attributes.type+"-button";F.element.innerHTML="<span class=\"first-child\"><a href=\"#\">LABEL</a></span>";F.attributes.id=B.generateId();YAHOO.widget.ToolbarButton.superclass.constructor.call(this,F.element,F.attributes);};YAHOO.extend(YAHOO.widget.ToolbarButton,YAHOO.util.Element,{buttonType:"normal",_handleMouseOver:function(){if(!this.get("disabled")){this.addClass("yui-button-hover");this.addClass("yui-"+this.get("type")+"-button-hover");}},_handleMouseOut:function(){this.removeClass("yui-button-hover");this.removeClass("yui-"+this.get("type")+"-button-hover");},checkValue:function(F){if(this.get("type")=="menu"){var E=this._button.options;for(var D=0;D<E.length;D++){if(E[D].value==F){E.selectedIndex=D;}}}},init:function(E,D){YAHOO.widget.ToolbarButton.superclass.init.call(this,E,D);this.on("mouseover",this._handleMouseOver,this,true);this.on("mouseout",this._handleMouseOut,this,true);},initAttributes:function(D){YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this,D);this.setAttributeConfig("value",{value:D.value});this.setAttributeConfig("menu",{value:D.menu||false});this.setAttributeConfig("type",{value:D.type,writeOnce:true,method:function(H){var G,F;if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0];}switch(H){case"select":case"menu":G=document.createElement("select");var I=this.get("menu");for(var E=0;E<I.length;E++){F=document.createElement("option");F.innerHTML=I[E].text;F.value=I[E].value;if(I[E].checked){F.selected=true;}G.appendChild(F);}this._button.parentNode.replaceChild(G,this._button);A.on(G,"change",this._handleSelect,this,true);this._button=G;break;}}});this.setAttributeConfig("disabled",{value:D.disabled||false,method:function(E){if(E){this.addClass("yui-button-disabled");this.addClass("yui-"+this.get("type")+"-button-disabled");}else{this.removeClass("yui-button-disabled");this.removeClass("yui-"+this.get("type")+"-button-disabled");}if(this.get("type")=="menu"){this._button.disabled=E;}}});this.setAttributeConfig("label",{value:D.label,method:function(E){if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0];}if(this.get("type")=="push"){this._button.innerHTML=E;}}});this.setAttributeConfig("title",{value:D.title});this.setAttributeConfig("container",{value:null,writeOnce:true,method:function(E){this.appendTo(E);}});},_handleSelect:function(E){var D=A.getTarget(E);var F=D.options[D.selectedIndex].value;this.fireEvent("change",{type:"change",value:F});},getMenu:function(){return this.get("menu");},fireEvent:function(E,D){if(this.DOM_EVENTS[E]&&this.get("disabled")){return ;}YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this,E,D);},toString:function(){return"ToolbarButton ("+this.get("id")+")";}});})();(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;YAHOO.widget.Toolbar=function(G,F){if(D.isObject(arguments[0])&&!B.get(G).nodeType){F=G;}var I=(F||{});var H={element:null,attributes:I};if(D.isString(G)&&B.get(G)){H.element=B.get(G);}else{if(D.isObject(G)&&B.get(G)&&B.get(G).nodeType){H.element=B.get(G);}}if(!H.element){H.element=document.createElement("DIV");H.element.id=B.generateId();if(I.container&&B.get(I.container)){B.get(I.container).appendChild(H.element);}}if(!H.element.id){H.element.id=((D.isString(G))?G:B.generateId());}var E=document.createElement("DIV");H.attributes.cont=E;B.addClass(E,"yui-toolbar-subcont");H.element.appendChild(E);H.attributes.element=H.element;H.attributes.id=H.element.id;YAHOO.widget.Toolbar.superclass.constructor.call(this,H.element,H.attributes);};function C(H,E,I){B.addClass(this.element,"yui-toolbar-"+I.get("value")+"-menu");if(B.hasClass(I._button.parentNode.parentNode,"yui-toolbar-select")){B.addClass(this.element,"yui-toolbar-select-menu");}var F=this.getItems();for(var G=0;G<F.length;G++){B.addClass(F[G].element,"yui-toolbar-"+I.get("value")+"-"+((F[G].value)?F[G].value.replace(/ /g,"-").toLowerCase():F[G]._oText.nodeValue.replace(/ /g,"-").toLowerCase()));B.addClass(F[G].element,"yui-toolbar-"+I.get("value")+"-"+((F[G].value)?F[G].value.replace(/ /g,"-"):F[G]._oText.nodeValue.replace(/ /g,"-")));}}YAHOO.extend(YAHOO.widget.Toolbar,YAHOO.util.Element,{buttonType:YAHOO.widget.ToolbarButton,dd:null,_colorData:{"#111111":"Obsidian","#2D2D2D":"Dark Gray","#434343":"Shale","#5B5B5B":"Flint","#737373":"Gray","#8B8B8B":"Concrete","#A2A2A2":"Gray","#B9B9B9":"Titanium","#000000":"Black","#D0D0D0":"Light Gray","#E6E6E6":"Silver","#FFFFFF":"White","#BFBF00":"Pumpkin","#FFFF00":"Yellow","#FFFF40":"Banana","#FFFF80":"Pale Yellow","#FFFFBF":"Butter","#525330":"Raw Siena","#898A49":"Mildew","#AEA945":"Olive","#7F7F00":"Paprika","#C3BE71":"Earth","#E0DCAA":"Khaki","#FCFAE1":"Cream","#60BF00":"Cactus","#80FF00":"Chartreuse","#A0FF40":"Green","#C0FF80":"Pale Lime","#DFFFBF":"Light Mint","#3B5738":"Green","#668F5A":"Lime Gray","#7F9757":"Yellow","#407F00":"Clover","#8A9B55":"Pistachio","#B7C296":"Light Jade","#E6EBD5":"Breakwater","#00BF00":"Spring Frost","#00FF80":"Pastel Green","#40FFA0":"Light Emerald","#80FFC0":"Sea Foam","#BFFFDF":"Sea Mist","#033D21":"Dark Forrest","#438059":"Moss","#7FA37C":"Medium Green","#007F40":"Pine","#8DAE94":"Yellow Gray Green","#ACC6B5":"Aqua Lung","#DDEBE2":"Sea Vapor","#00BFBF":"Fog","#00FFFF":"Cyan","#40FFFF":"Turquoise Blue","#80FFFF":"Light Aqua","#BFFFFF":"Pale Cyan","#033D3D":"Dark Teal","#347D7E":"Gray Turquoise","#609A9F":"Green Blue","#007F7F":"Seaweed","#96BDC4":"Green Gray","#B5D1D7":"Soapstone","#E2F1F4":"Light Turquoise","#0060BF":"Summer Sky","#0080FF":"Sky Blue","#40A0FF":"Electric Blue","#80C0FF":"Light Azure","#BFDFFF":"Ice Blue","#1B2C48":"Navy","#385376":"Biscay","#57708F":"Dusty Blue","#00407F":"Sea Blue","#7792AC":"Sky Blue Gray","#A8BED1":"Morning Sky","#DEEBF6":"Vapor","#0000BF":"Deep Blue","#0000FF":"Blue","#4040FF":"Cerulean Blue","#8080FF":"Evening Blue","#BFBFFF":"Light Blue","#212143":"Deep Indigo","#373E68":"Sea Blue","#444F75":"Night Blue","#00007F":"Indigo Blue","#585E82":"Dockside","#8687A4":"Blue Gray","#D2D1E1":"Light Blue Gray","#6000BF":"Neon Violet","#8000FF":"Blue Violet","#A040FF":"Violet Purple","#C080FF":"Violet Dusk","#DFBFFF":"Pale Lavender","#302449":"Cool Shale","#54466F":"Dark Indigo","#655A7F":"Dark Violet","#40007F":"Violet","#726284":"Smoky Violet","#9E8FA9":"Slate Gray","#DCD1DF":"Violet White","#BF00BF":"Royal Violet","#FF00FF":"Fuchsia","#FF40FF":"Magenta","#FF80FF":"Orchid","#FFBFFF":"Pale Magenta","#4A234A":"Dark Purple","#794A72":"Medium Purple","#936386":"Cool Granite","#7F007F":"Purple","#9D7292":"Purple Moon","#C0A0B6":"Pale Purple","#ECDAE5":"Pink Cloud","#BF005F":"Hot Pink","#FF007F":"Deep Pink","#FF409F":"Grape","#FF80BF":"Electric Pink","#FFBFDF":"Pink","#451528":"Purple Red","#823857":"Purple Dino","#A94A76":"Purple Gray","#7F003F":"Rose","#BC6F95":"Antique Mauve","#D8A5BB":"Cool Marble","#F7DDE9":"Pink Granite","#C00000":"Apple","#FF0000":"Fire Truck","#FF4040":"Pale Red","#FF8080":"Salmon","#FFC0C0":"Warm Pink","#441415":"Sepia","#82393C":"Rust","#AA4D4E":"Brick","#800000":"Brick Red","#BC6E6E":"Mauve","#D8A3A4":"Shrimp Pink","#F8DDDD":"Shell Pink","#BF5F00":"Dark Orange","#FF7F00":"Orange","#FF9F40":"Grapefruit","#FFBF80":"Canteloupe","#FFDFBF":"Wax","#482C1B":"Dark Brick","#855A40":"Dirt","#B27C51":"Tan","#7F3F00":"Nutmeg","#C49B71":"Mustard","#E1C4A8":"Pale Tan","#FDEEE0":"Marble"},_colorPicker:null,STR_COLLAPSE:"Collapse Toolbar",STR_SPIN_LABEL:"Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.",STR_SPIN_UP:"Click to increase the value of this input",STR_SPIN_DOWN:"Click to decrease the value of this input",_titlebar:null,browser:YAHOO.env.ua,_buttonList:null,_buttonGroupList:null,_sep:null,_sepCount:null,_dragHandle:null,_toolbarConfigs:{renderer:true},CLASS_CONTAINER:"yui-toolbar-container",CLASS_DRAGHANDLE:"yui-toolbar-draghandle",CLASS_SEPARATOR:"yui-toolbar-separator",CLASS_DISABLED:"yui-toolbar-disabled",CLASS_PREFIX:"yui-toolbar",init:function(F,E){YAHOO.widget.Toolbar.superclass.init.call(this,F,E);
+},initAttributes:function(E){YAHOO.widget.Toolbar.superclass.initAttributes.call(this,E);this.addClass(this.CLASS_CONTAINER);this.setAttributeConfig("buttonType",{value:E.buttonType||"basic",writeOnce:true,validator:function(F){switch(F){case"advanced":case"basic":return true;}return false;},method:function(F){if(F=="advanced"){if(YAHOO.widget.Button){this.buttonType=YAHOO.widget.ToolbarButtonAdvanced;}else{this.buttonType=YAHOO.widget.ToolbarButton;}}else{this.buttonType=YAHOO.widget.ToolbarButton;}}});this.setAttributeConfig("buttons",{value:[],writeOnce:true,method:function(G){for(var F in G){if(D.hasOwnProperty(G,F)){if(G[F].type=="separator"){this.addSeparator();}else{if(G[F].group!==undefined){this.addButtonGroup(G[F]);}else{this.addButton(G[F]);}}}}}});this.setAttributeConfig("disabled",{value:false,method:function(F){if(this.get("disabled")===F){return false;}if(F){this.addClass(this.CLASS_DISABLED);this.set("draggable",false);this.disableAllButtons();}else{this.removeClass(this.CLASS_DISABLED);if(this._configs.draggable._initialConfig.value){this.set("draggable",true);}this.resetAllButtons();}}});this.setAttributeConfig("cont",{value:E.cont,readOnly:true});this.setAttributeConfig("grouplabels",{value:((E.grouplabels===false)?false:true),method:function(F){if(F){B.removeClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"));}else{B.addClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"));}}});this.setAttributeConfig("titlebar",{value:false,method:function(G){if(G){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}this._titlebar=document.createElement("DIV");B.addClass(this._titlebar,this.CLASS_PREFIX+"-titlebar");if(D.isString(G)){var F=document.createElement("h2");F.tabIndex="-1";F.innerHTML=G;this._titlebar.appendChild(F);}if(this.get("firstChild")){this.insertBefore(this._titlebar,this.get("firstChild"));}else{this.appendChild(this._titlebar);}if(this.get("collapse")){this.set("collapse",true);}}else{if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}}});this.setAttributeConfig("collapse",{value:false,method:function(H){if(this._titlebar){var G=null;var F=B.getElementsByClassName("collapse","span",this._titlebar);if(H){if(F.length>0){return true;}G=document.createElement("SPAN");G.innerHTML="X";G.title=this.STR_COLLAPSE;B.addClass(G,"collapse");this._titlebar.appendChild(G);A.addListener(G,"click",function(){if(B.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}else{this.collapse();}},this,true);}else{G=B.getElementsByClassName("collapse","span",this._titlebar);if(G[0]){if(B.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}G[0].parentNode.removeChild(G[0]);}}}}});this.setAttributeConfig("draggable",{value:(E.draggable||false),method:function(F){if(F&&!this.get("titlebar")){if(!this._dragHandle){this._dragHandle=document.createElement("SPAN");this._dragHandle.innerHTML="|";this._dragHandle.setAttribute("title","Click to drag the toolbar");this._dragHandle.id=this.get("id")+"_draghandle";B.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get("cont").hasChildNodes()){this.get("cont").insertBefore(this._dragHandle,this.get("cont").firstChild);}else{this.get("cont").appendChild(this._dragHandle);}this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}if(this._titlebar){if(F){this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._titlebar);B.addClass(this._titlebar,"draggable");}else{B.removeClass(this._titlebar,"draggable");if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(G){var F=true;if(!YAHOO.util.DD){F=false;}return F;}});},addButtonGroup:function(I){if(!this.get("element")){this._queue[this._queue.length]=["addButtonGroup",arguments];return false;}if(!this.hasClass(this.CLASS_PREFIX+"-grouped")){this.addClass(this.CLASS_PREFIX+"-grouped");}var J=document.createElement("DIV");B.addClass(J,this.CLASS_PREFIX+"-group");B.addClass(J,this.CLASS_PREFIX+"-group-"+I.group);if(I.label){var F=document.createElement("h3");F.innerHTML=I.label;J.appendChild(F);}if(!this.get("grouplabels")){B.addClass(this.get("cont"),this.CLASS_PREFIX,"-nogrouplabels");}this.get("cont").appendChild(J);var H=document.createElement("ul");J.appendChild(H);if(!this._buttonGroupList){this._buttonGroupList={};}this._buttonGroupList[I.group]=H;for(var G=0;G<I.buttons.length;G++){var E=document.createElement("li");E.className=this.CLASS_PREFIX+"-groupitem";H.appendChild(E);if((I.buttons[G].type!==undefined)&&I.buttons[G].type=="separator"){this.addSeparator(E);}else{I.buttons[G].container=E;this.addButton(I.buttons[G]);}}},addButtonToGroup:function(G,H,I){var F=this._buttonGroupList[H];var E=document.createElement("li");E.className=this.CLASS_PREFIX+"-groupitem";G.container=E;this.addButton(G,I);F.appendChild(E);},addButton:function(J,I){if(!this.get("element")){this._queue[this._queue.length]=["addButton",arguments];return false;}if(!this._buttonList){this._buttonList=[];}if(!J.container){J.container=this.get("cont");}if((J.type=="menu")||(J.type=="split")||(J.type=="select")){if(D.isArray(J.menu)){for(var P in J.menu){if(D.hasOwnProperty(J.menu,P)){var V={fn:function(Y,W,X){if(!J.menucmd){J.menucmd=J.value;}J.value=((X.value)?X.value:X._oText.nodeValue);},scope:this};J.menu[P].onclick=V;}}}}var Q={},N=false;for(var L in J){if(D.hasOwnProperty(J,L)){if(!this._toolbarConfigs[L]){Q[L]=J[L];}}}if(J.type=="select"){Q.type="menu";}if(J.type=="spin"){Q.type="push";}if(Q.type=="color"){if(YAHOO.widget.Overlay){Q=this._makeColorButton(Q);}else{N=true;}}if(Q.menu){if((YAHOO.widget.Overlay)&&(J.menu instanceof YAHOO.widget.Overlay)){J.menu.showEvent.subscribe(function(){this._button=Q;});}else{for(var O=0;O<Q.menu.length;
+O++){if(!Q.menu[O].value){Q.menu[O].value=Q.menu[O].text;}}if(this.browser.webkit){Q.focusmenu=false;}}}if(N){J=false;}else{this._configs.buttons.value[this._configs.buttons.value.length]=J;var T=new this.buttonType(Q);if(!T.buttonType){T.buttonType="rich";T.checkValue=function(Y){var X=this.getMenu().getItems();if(X.length===0){this.getMenu()._onBeforeShow();X=this.getMenu().getItems();}for(var W=0;W<X.length;W++){X[W].cfg.setProperty("checked",false);if(X[W].value==Y){X[W].cfg.setProperty("checked",true);}}};}if(this.get("disabled")){T.set("disabled",true);}if(!J.id){J.id=T.get("id");}if(I){var F=T.get("element");var M=null;if(I.get){M=I.get("element").nextSibling;}else{if(I.nextSibling){M=I.nextSibling;}}if(M){M.parentNode.insertBefore(F,M);}}T.addClass(this.CLASS_PREFIX+"-"+T.get("value"));var S=document.createElement("span");S.className=this.CLASS_PREFIX+"-icon";T.get("element").insertBefore(S,T.get("firstChild"));if(T._button.tagName.toLowerCase()=="button"){T.get("element").setAttribute("unselectable","on");var U=document.createElement("a");U.innerHTML=T._button.innerHTML;U.href="#";A.on(U,"click",function(W){A.stopEvent(W);});T._button.parentNode.replaceChild(U,T._button);T._button=U;}if(J.type=="select"){if(T._button.tagName.toLowerCase()=="select"){S.parentNode.removeChild(S);var G=T._button;var R=T.get("element");R.parentNode.replaceChild(G,R);}else{T.addClass(this.CLASS_PREFIX+"-select");}}if(J.type=="spin"){if(!D.isArray(J.range)){J.range=[10,100];}this._makeSpinButton(T,J);}T.get("element").setAttribute("title",T.get("label"));if(J.type!="spin"){if((YAHOO.widget.Overlay)&&(Q.menu instanceof YAHOO.widget.Overlay)){var H=function(Y){var W=true;if(Y.keyCode&&(Y.keyCode==9)){W=false;}if(W){if(this._colorPicker){this._colorPicker._button=J.value;}var X=T.getMenu().element;if(B.getStyle(X,"visibility")=="hidden"){T.getMenu().show();}else{T.getMenu().hide();}}YAHOO.util.Event.stopEvent(Y);};T.on("mousedown",H,J,this);T.on("keydown",H,J,this);}else{if((J.type!="menu")&&(J.type!="select")){T.on("keypress",this._buttonClick,J,this);T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);this._buttonClick(W,J);},J,this);T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});}else{T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);});T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});T.on("change",function(W){if(!J.menucmd){J.menucmd=J.value;}J.value=W.value;this._buttonClick(W,J);},this,true);var K=this;if(T.getMenu().mouseDownEvent){T.getMenu().mouseDownEvent.subscribe(function(Y,X){var W=X[1];YAHOO.util.Event.stopEvent(X[0]);T._onMenuClick(X[0],T);if(!J.menucmd){J.menucmd=J.value;}J.value=((W.value)?W.value:W._oText.nodeValue);K._buttonClick.call(K,X[1],J);T._hideMenu();return false;});T.getMenu().clickEvent.subscribe(function(X,W){YAHOO.util.Event.stopEvent(W[0]);});T.getMenu().mouseUpEvent.subscribe(function(X,W){YAHOO.util.Event.stopEvent(W[0]);});}}}}else{T.on("mousedown",function(W){YAHOO.util.Event.stopEvent(W);});T.on("click",function(W){YAHOO.util.Event.stopEvent(W);});}if(this.browser.ie){T.DOM_EVENTS.focusin=true;T.DOM_EVENTS.focusout=true;T.on("focusin",function(W){YAHOO.util.Event.stopEvent(W);},J,this);T.on("focusout",function(W){YAHOO.util.Event.stopEvent(W);},J,this);T.on("click",function(W){YAHOO.util.Event.stopEvent(W);},J,this);}if(this.browser.webkit){T.hasFocus=function(){return true;};}this._buttonList[this._buttonList.length]=T;if((J.type=="menu")||(J.type=="split")||(J.type=="select")){if(D.isArray(J.menu)){var E=T.getMenu();if(E.renderEvent){E.renderEvent.subscribe(C,T);if(J.renderer){E.renderEvent.subscribe(J.renderer,T);}}}}}return J;},addSeparator:function(E,H){if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false;}var F=((E)?E:this.get("cont"));if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false;}if(this._sepCount===null){this._sepCount=0;}if(!this._sep){this._sep=document.createElement("SPAN");B.addClass(this._sep,this.CLASS_SEPARATOR);this._sep.innerHTML="|";}var G=this._sep.cloneNode(true);this._sepCount++;B.addClass(G,this.CLASS_SEPARATOR+"-"+this._sepCount);if(H){var I=null;if(H.get){I=H.get("element").nextSibling;}else{if(H.nextSibling){I=H.nextSibling;}else{I=H;}}if(I){if(I==H){I.parentNode.appendChild(G);}else{I.parentNode.insertBefore(G,I);}}}else{F.appendChild(G);}return G;},_createColorPicker:function(H){if(B.get(H+"_colors")){B.get(H+"_colors").parentNode.removeChild(B.get(H+"_colors"));}var E=document.createElement("div");E.className="yui-toolbar-colors";E.id=H+"_colors";E.style.display="none";A.on(window,"load",function(){document.body.appendChild(E);},this,true);this._colorPicker=E;var G="";for(var F in this._colorData){if(D.hasOwnProperty(this._colorData,F)){G+="<a style=\"background-color: "+F+"\" href=\"#\">"+F.replace("#","")+"</a>";}}G+="<span><em>X</em><strong></strong></span>";window.setTimeout(function(){E.innerHTML=G;},0);A.on(E,"mouseover",function(M){var K=this._colorPicker;var L=K.getElementsByTagName("em")[0];var J=K.getElementsByTagName("strong")[0];var I=A.getTarget(M);if(I.tagName.toLowerCase()=="a"){L.style.backgroundColor=I.style.backgroundColor;J.innerHTML=this._colorData["#"+I.innerHTML]+"<br>"+I.innerHTML;}},this,true);A.on(E,"focus",function(I){A.stopEvent(I);});A.on(E,"click",function(I){A.stopEvent(I);});A.on(E,"mousedown",function(J){A.stopEvent(J);var I=A.getTarget(J);if(I.tagName.toLowerCase()=="a"){var L=this.fireEvent("colorPickerClicked",{type:"colorPickerClicked",target:this,button:this._colorPicker._button,color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML]});if(L!==false){var K={color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML],value:this._colorPicker._button};this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:K});}this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var F=this._colorPicker.getElementsByTagName("em")[0];
+var E=this._colorPicker.getElementsByTagName("strong")[0];F.style.backgroundColor="transparent";E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));B.addClass(E.menu.element,"yui-button-menu");B.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((T<I[0])?I[0]:T);T=((T>I[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I<F.menu.length;I++){if(F.menu[I].value==F.value){J=F.menu[I].text;break;}}K.set("label","<span class=\"yui-toolbar-"+F.menucmd+"-"+(F.value).replace(/ /g,"-").toLowerCase()+"\">"+J+"</span>");var M=K.getMenu().getItems();for(var G=0;G<M.length;G++){if(M[G].value.toLowerCase()==F.value.toLowerCase()){M[G].cfg.setProperty("checked",true);}else{M[G].cfg.setProperty("checked",false);}}}}}if(L){A.stopEvent(L);}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F].get("id")==G){return this._buttonList[F];}}return false;},getButtonByValue:function(K){var H=this.get("buttons");var F=H.length;for(var I=0;I<F;I++){if(H[I].group!==undefined){for(var E=0;E<H[I].buttons.length;E++){if((H[I].buttons[E].value==K)||(H[I].buttons[E].menucmd==K)){return this.getButtonById(H[I].buttons[E].id);}if(H[I].buttons[E].menu){for(var J=0;J<H[I].buttons[E].menu.length;J++){if(H[I].buttons[E].menu[J].value==K){return this.getButtonById(H[I].buttons[E].id);}}}}}else{if((H[I].value==K)||(H[I].menucmd==K)){return this.getButtonById(H[I].id);}if(H[I].menu){for(var G=0;G<H[I].menu.length;G++){if(H[I].menu[G].value==K){return this.getButtonById(H[I].id);}}}}}return false;},getButtonByIndex:function(E){if(this._buttonList[E]){return this._buttonList[E];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(F){var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){E.set("disabled",true);}else{return false;}},enableButton:function(F){if(this.get("disabled")){return false;}var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){if(E.get("disabled")){E.set("disabled",false);}}else{return false;}},selectButton:function(I,G){var F=I;if(I){if(D.isString(I)){F=this.getButtonById(I);}if(D.isNumber(I)){F=this.getButtonByIndex(I);}if((!(F instanceof YAHOO.widget.ToolbarButton))&&(!(F instanceof YAHOO.widget.ToolbarButtonAdvanced))){F=this.getButtonByValue(I);}if((F instanceof YAHOO.widget.ToolbarButton)||(F instanceof YAHOO.widget.ToolbarButtonAdvanced)){F.addClass("yui-button-selected");F.addClass("yui-button-"+F.get("value")+"-selected");if(G){if(F.buttonType=="rich"){var H=F.getMenu().getItems();for(var E=0;E<H.length;E++){if(H[E].value==G){H[E].cfg.setProperty("checked",true);F.set("label","<span class=\"yui-toolbar-"+F.get("value")+"-"+(G).replace(/ /g,"-").toLowerCase()+"\">"+H[E]._oText.nodeValue+"</span>");
+}else{H[E].cfg.setProperty("checked",false);}}}}}else{return false;}}},deselectButton:function(F){var E=F;if(D.isString(F)){E=this.getButtonById(F);}if(D.isNumber(F)){E=this.getButtonByIndex(F);}if((!(E instanceof YAHOO.widget.ToolbarButton))&&(!(E instanceof YAHOO.widget.ToolbarButtonAdvanced))){E=this.getButtonByValue(F);}if((E instanceof YAHOO.widget.ToolbarButton)||(E instanceof YAHOO.widget.ToolbarButtonAdvanced)){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F<E;F++){this.deselectButton(this._buttonList[F]);}},disableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.disableButton(this._buttonList[F]);}},enableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.enableButton(this._buttonList[F]);}},resetAllButtons:function(I){if(!D.isObject(I)){I={};}if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){var H=this._buttonList[F];var G=H._configs.disabled._initialConfig.value;if(I[H.get("id")]){this.enableButton(H);this.selectButton(H);}else{if(G){this.disableButton(H);}else{this.enableButton(H);}this.deselectButton(H);}}},destroyButton:function(I){var G=I;if(D.isString(I)){G=this.getButtonById(I);}if(D.isNumber(I)){G=this.getButtonByIndex(I);}if((!(G instanceof YAHOO.widget.ToolbarButton))&&(!(G instanceof YAHOO.widget.ToolbarButtonAdvanced))){G=this.getButtonByValue(I);}if((G instanceof YAHOO.widget.ToolbarButton)||(G instanceof YAHOO.widget.ToolbarButtonAdvanced)){var H=G.get("id");G.destroy();var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F].get("id")==H){this._buttonList[F]=null;}}}else{return false;}},destroy:function(){this.get("element").innerHTML="";this.get("element").className="";for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}return true;},collapse:function(F){var E=B.getElementsByClassName("collapse","span",this._titlebar);if(F===false){B.removeClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");if(E[0]){B.removeClass(E[0],"collapsed");}this.fireEvent("toolbarExpanded",{type:"toolbarExpanded",target:this});}else{if(E[0]){B.addClass(E[0],"collapsed");}B.addClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");this.fireEvent("toolbarCollapsed",{type:"toolbarCollapsed",target:this});}},toString:function(){return"Toolbar (#"+this.get("element").id+") with "+this._buttonList.length+" buttons.";}});})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.SimpleEditor=function(I,N){var H={};if(D.isObject(I)&&(!I.tagName)&&!N){D.augmentObject(H,I);I=document.createElement("textarea");this.DOMReady=true;if(H.container){var L=C.get(H.container);L.appendChild(I);}else{document.body.appendChild(I);}}else{D.augmentObject(H,N);}var J={element:null,attributes:H},G=null;if(D.isString(I)){G=I;}else{if(J.attributes.id){G=J.attributes.id;}else{G=C.generateId(I);}}J.element=I;var K=document.createElement("DIV");J.attributes.element_cont=new YAHOO.util.Element(K,{id:G+"_container"});var F=document.createElement("div");C.addClass(F,"first-child");J.attributes.element_cont.appendChild(F);if(!J.attributes.toolbar_cont){J.attributes.toolbar_cont=document.createElement("DIV");J.attributes.toolbar_cont.id=G+"_toolbar";F.appendChild(J.attributes.toolbar_cont);}var M=document.createElement("DIV");F.appendChild(M);J.attributes.editor_wrapper=M;YAHOO.widget.SimpleEditor.superclass.constructor.call(this,J.element,J.attributes);};function E(F){return F.replace(/ /g,"-").toLowerCase();}YAHOO.extend(YAHOO.widget.SimpleEditor,YAHOO.util.Element,{_docType:"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var F=document.location.href;if(F.indexOf("?")!==-1){F=F.substring(0,F.indexOf("?"));}F=F.substring(0,F.lastIndexOf("/"))+"/";return F;}(),_lastImage:null,_blankImageLoaded:null,_fixNodesTimer:null,_nodeChangeTimer:null,_lastNodeChangeEvent:null,_lastNodeChange:0,_rendered:null,DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:null,dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,iframe:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerCounter:0,_disabled:["createlink","fontname","fontsize","forecolor","backcolor"],_alwaysDisabled:{},_alwaysEnabled:{},_semantic:{"bold":true,"italic":true,"underline":true},_tag2cmd:{"b":"bold","strong":"bold","i":"italic","em":"italic","u":"underline","sup":"superscript","sub":"subscript","img":"insertimage","a":"createlink","ul":"insertunorderedlist","ol":"insertorderedlist"},_createIframe:function(){var J=document.createElement("iframe");J.id=this.get("id")+"_editor";var H={border:"0",frameBorder:"0",marginWidth:"0",marginHeight:"0",leftMargin:"0",topMargin:"0",allowTransparency:"true",width:"100%"};if(this.get("autoHeight")){H.scrolling="no";}for(var I in H){if(D.hasOwnProperty(H,I)){J.setAttribute(I,H[I]);}}var G="javascript:;";if(this.browser.ie){G="about:blank";}J.setAttribute("src",G);var F=new YAHOO.util.Element(J);return F;},_isElement:function(G,F){if(G&&G.tagName&&(G.tagName.toLowerCase()==F)){return true;
+}if(G&&G.getAttribute&&(G.getAttribute("tag")==F)){return true;}return false;},_hasParent:function(G,F){if(!G||!G.parentNode){return false;}while(G.parentNode){if(this._isElement(G,F)){return G;}if(G.parentNode){G=G.parentNode;}else{return false;}}return false;},_getDoc:function(){var F=false;if(this.get){if(this.get("iframe")){if(this.get("iframe").get){if(this.get("iframe").get("element")){try{if(this.get("iframe").get("element").contentWindow){if(this.get("iframe").get("element").contentWindow.document){F=this.get("iframe").get("element").contentWindow.document;return F;}}}catch(G){}}}}}return false;},_getWindow:function(){return this.get("iframe").get("element").contentWindow;},_focusWindow:function(F){if(this.browser.webkit){if(F){this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild,0,this._getDoc().body.firstChild,1);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(false);}}else{this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,1);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(false);}}this._getWindow().focus();}else{this._getWindow().focus();}},_hasSelection:function(){var H=this._getSelection();var F=this._getRange();var G=false;if(!H||!F){return G;}if(this.browser.ie||this.browser.opera){if(F.text){G=true;}if(F.html){G=true;}}else{if(this.browser.webkit){if(H+""!==""){G=true;}}else{if(H&&(H.toString()!=="")&&(H!==undefined)){G=true;}}}return G;},_getSelection:function(){var F=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){F=this._getDoc().selection;}else{F=this._getWindow().getSelection();}if(this.browser.webkit){if(F.baseNode){this._selection={};this._selection.baseNode=F.baseNode;this._selection.baseOffset=F.baseOffset;this._selection.extentNode=F.extentNode;this._selection.extentOffset=F.extentOffset;}else{if(this._selection!==null){F=this._getWindow().getSelection();F.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}}return F;},_selectNode:function(G){if(!G){return false;}var H=this._getSelection(),F=null;if(this.browser.ie){try{F=this._getDoc().body.createTextRange();F.moveToElementText(G);F.select();}catch(I){}}else{if(this.browser.webkit){H.setBaseAndExtent(G,0,G,G.innerText.length);}else{if(this.browser.opera){H=this._getWindow().getSelection();F=this._getDoc().createRange();F.selectNode(G);H.removeAllRanges();H.addRange(F);}else{F=this._getDoc().createRange();F.selectNodeContents(G);H.removeAllRanges();H.addRange(F);}}}},_getRange:function(){var F=this._getSelection();if(F===null){return null;}if(this.browser.webkit&&!F.getRangeAt){var H=this._getDoc().createRange();try{H.setStart(F.anchorNode,F.anchorOffset);H.setEnd(F.focusNode,F.focusOffset);}catch(G){H=this._getWindow().getSelection()+"";}return H;}if(this.browser.ie||this.browser.opera){try{return F.createRange();}catch(G){return null;}}if(F.rangeCount>0){return F.getRangeAt(0);}return null;},_setDesignMode:function(F){try{var H=true;if(this.browser.ie&&(F.toLowerCase()=="off")){H=false;}if(H){this._getDoc().designMode=F;}}catch(G){}},_toggleDesignMode:function(){var G=this._getDoc().designMode.toLowerCase(),F="on";if(G=="on"){F="off";}this._setDesignMode(F);return F;},_initEditor:function(){if(this.browser.ie){this._getDoc().body.style.margin="0";}if(!this.get("disabled")){if(this._getDoc().designMode.toLowerCase()!="on"){this._setDesignMode("on");this._contentTimerCounter=0;}}if(!this._getDoc().body){this._contentTimerCounter=0;this._checkLoaded();return false;}this.toolbar.on("buttonClick",this._handleToolbarClick,this,true);A.on(this._getDoc(),"mouseup",this._handleMouseUp,this,true);A.on(this._getDoc(),"mousedown",this._handleMouseDown,this,true);A.on(this._getDoc(),"click",this._handleClick,this,true);A.on(this._getDoc(),"dblclick",this._handleDoubleClick,this,true);A.on(this._getDoc(),"keypress",this._handleKeyPress,this,true);A.on(this._getDoc(),"keyup",this._handleKeyUp,this,true);A.on(this._getDoc(),"keydown",this._handleKeyDown,this,true);if(!this.get("disabled")){this.toolbar.set("disabled",false);}this.fireEvent("editorContentLoaded",{type:"editorLoaded",target:this});if(this.get("dompath")){var F=this;setTimeout(function(){F._writeDomPath.call(F);},150);}this.nodeChange(true);this._setBusy(true);},_checkLoaded:function(){this._contentTimerCounter++;if(this._contentTimer){clearTimeout(this._contentTimer);}if(this._contentTimerCounter>500){return false;}var H=false;try{if(this._getDoc()&&this._getDoc().body){if(this.browser.ie){if(this._getDoc().body.readyState=="complete"){H=true;}}else{if(this._getDoc().body._rteLoaded===true){H=true;}}}}catch(G){H=false;}if(H===true){this._initEditor();}else{var F=this;this._contentTimer=setTimeout(function(){F._checkLoaded.call(F);},20);}},_setInitialContent:function(){var G=D.substitute(this.get("html"),{TITLE:this.STR_TITLE,CONTENT:this._cleanIncomingHTML(this.get("element").value),CSS:this.get("css"),HIDDEN_CSS:((this.get("hiddencss"))?this.get("hiddencss"):"/* No Hidden CSS */"),EXTRA_CSS:((this.get("extracss"))?this.get("extracss"):"/* No Extra CSS */")}),F=true;if(document.compatMode!="BackCompat"){G=this._docType+"\n"+G;}else{}if(this.browser.ie||this.browser.webkit||this.browser.opera||(navigator.userAgent.indexOf("Firefox/1.5")!=-1)){try{this._getDoc().open();this._getDoc().write(G);this._getDoc().close();}catch(H){F=false;}}else{this.get("iframe").get("element").src="data:text/html;charset=utf-8,"+encodeURIComponent(G);}if(F){this._checkLoaded();}},_setMarkupType:function(F){switch(this.get("markup")){case"css":this._setEditorStyle(true);break;case"default":this._setEditorStyle(false);break;case"semantic":case"xhtml":if(this._semantic[F]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}break;}},_setEditorStyle:function(G){try{this._getDoc().execCommand("useCSS",false,!G);}catch(F){}},_getSelectedElement:function(){var I=this._getDoc(),F=null,G=null,J=null;
+if(this.browser.ie){this.currentEvent=this._getWindow().event;F=this._getRange();if(F){J=F.item?F.item(0):F.parentElement();if(J==I.body){J=null;}}if((this.currentEvent!==null)&&(this.currentEvent.keyCode===0)){J=A.getTarget(this.currentEvent);}}else{G=this._getSelection();F=this._getRange();if(!G||!F){return null;}if(!this._hasSelection()){if(G.anchorNode&&(G.anchorNode.nodeType==3)){if(G.anchorNode.parentNode){J=G.anchorNode.parentNode;}if(G.anchorNode.nextSibling!=G.focusNode.nextSibling){J=G.anchorNode.nextSibling;}}if(this._isElement(J,"br")){J=null;}if(!J){J=F.commonAncestorContainer;if(!F.collapsed){if(F.startContainer==F.endContainer){if(F.startOffset-F.endOffset<2){if(F.startContainer.hasChildNodes()){J=F.startContainer.childNodes[F.startOffset];}}}}}}}if(this.currentEvent!==null){try{switch(this.currentEvent.type){case"click":case"mousedown":case"mouseup":J=A.getTarget(this.currentEvent);break;default:break;}}catch(H){}}else{if((this.currentElement&&this.currentElement[0])&&(!this.browser.ie)){J=this.currentElement[0];}}if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!J){J=YAHOO.util.Event.getTarget(this.currentEvent);}}if(!J||!J.tagName){J=I.body;}if(this._isElement(J,"html")){J=I.body;}if(this._isElement(J,"body")){J=I.body;}if(J&&!J.parentNode){J=I.body;}if(J===undefined){J=null;}return J;},_getDomPath:function(F){if(!F){F=this._getSelectedElement();}var G=[];while(F!==null){if(F.ownerDocument!=this._getDoc()){F=null;break;}if(F.nodeName&&F.nodeType&&(F.nodeType==1)){G[G.length]=F;}if(this._isElement(F,"body")){break;}F=F.parentNode;}if(G.length===0){if(this._getDoc()&&this._getDoc().body){G[0]=this._getDoc().body;}}return G.reverse();},_writeDomPath:function(){var L=this._getDomPath(),J=[],H="",M="";for(var F=0;F<L.length;F++){var N=L[F].tagName.toLowerCase();if((N=="ol")&&(L[F].type)){N+=":"+L[F].type;}if(C.hasClass(L[F],"yui-tag")){N=L[F].getAttribute("tag");}if((this.get("markup")=="semantic")||(this.get("markup")=="xhtml")){switch(N){case"b":N="strong";break;case"i":N="em";break;}}if(!C.hasClass(L[F],"yui-non")){if(C.hasClass(L[F],"yui-tag")){M=N;}else{H=((L[F].className!=="")?"."+L[F].className.replace(/ /g,"."):"");if((H.indexOf("yui")!=-1)||(H.toLowerCase().indexOf("apple-style-span")!=-1)){H="";}M=N+((L[F].id)?"#"+L[F].id:"")+H;}switch(N){case"a":if(L[F].getAttribute("href",2)){M+=":"+L[F].getAttribute("href",2).replace("mailto:","").replace("http://","").replace("https://","");}break;case"img":var G=L[F].height;var K=L[F].width;if(L[F].style.height){G=parseInt(L[F].style.height,10);}if(L[F].style.width){K=parseInt(L[F].style.width,10);}M+="("+G+"x"+K+")";break;}if(M.length>10){M="<span title=\""+M+"\">"+M.substring(0,10)+"...</span>";}else{M="<span title=\""+M+"\">"+M+"</span>";}J[J.length]=M;}}var I=J.join(" "+this.SEP_DOMPATH+" ");if(this.dompath.innerHTML!=I){this.dompath.innerHTML=I;}},_fixNodes:function(){var K=this._getDoc(),I=[];for(var F in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,F)){if(F.toLowerCase()!="span"){var G=K.body.getElementsByTagName(F);if(G.length){for(var H=0;H<G.length;H++){I.push(G[H]);}}}}}for(var J=0;J<I.length;J++){if(I[J].parentNode){if(D.isObject(this.invalidHTML[I[J].tagName.toLowerCase()])&&this.invalidHTML[I[J].tagName.toLowerCase()].keepContents){this._swapEl(I[J],"span",function(M){M.className="yui-non";});}else{I[J].parentNode.removeChild(I[J]);}}}var L=this._getDoc().getElementsByTagName("img");C.addClass(L,"yui-img");},_isNonEditable:function(H){if(this.get("allowNoEdit")){var G=A.getTarget(H);if(this._isElement(G,"html")){G=null;}var J=this._getDomPath(G);for(var F=(J.length-1);F>-1;F--){if(C.hasClass(J[F],this.CLASS_NOEDIT)){try{this._getDoc().execCommand("enableObjectResizing",false,"false");}catch(I){}this.nodeChange();A.stopEvent(H);return true;}}try{this._getDoc().execCommand("enableObjectResizing",false,"true");}catch(I){}}return false;},_setCurrentEvent:function(F){this.currentEvent=F;},_handleClick:function(G){if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);if(this.currentWindow){this.closeWindow();}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}if(this.browser.webkit){var F=A.getTarget(G);if(this._isElement(F,"a")||this._isElement(F.parentNode,"a")){A.stopEvent(G);this.nodeChange();}}else{this.nodeChange();}},_handleMouseUp:function(G){if(this._isNonEditable(G)){return false;}var F=this;if(this.browser.opera){var H=A.getTarget(G);if(this._isElement(H,"img")){this.nodeChange();if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(G);}else{this.operaEvent=window.setTimeout(function(){F.operaEvent=false;},700);}}}if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){A.stopEvent(G);}}this.nodeChange();this.fireEvent("editorMouseUp",{type:"editorMouseUp",target:this,ev:G});},_handleMouseDown:function(F){if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this.browser.webkit&&this._hasSelection()){var H=this._getSelection();if(!this.browser.webkit3){H.collapse(true);}else{H.collapseToStart();}}if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}if(this._isElement(G,"img")||this._isElement(G,"a")){if(this.browser.webkit){A.stopEvent(F);if(this._isElement(G,"img")){C.addClass(G,"selected");this._lastImage=G;}}this.nodeChange();}this.fireEvent("editorMouseDown",{type:"editorMouseDown",target:this,ev:F});},_handleDoubleClick:function(F){if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this._isElement(G,"img")){this.currentElement[0]=G;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}else{if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");
+this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}}this.nodeChange();this.editorDirty=false;this.fireEvent("editorDoubleClick",{type:"editorDoubleClick",target:this,ev:F});},_handleKeyUp:function(G){if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);switch(G.keyCode){case 37:case 38:case 39:case 40:case 46:case 8:case 87:if((G.keyCode==87)&&this.currentWindow&&G.shiftKey&&G.ctrlKey){this.closeWindow();}else{if(!this.browser.ie){if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);}var F=this;this._nodeChangeTimer=setTimeout(function(){F._nodeChangeTimer=null;F.nodeChange.call(F);},100);}else{this.nodeChange();}this.editorDirty=true;}break;}this.fireEvent("editorKeyUp",{type:"editorKeyUp",target:this,ev:G});},_handleKeyPress:function(F){if(this.get("allowNoEdit")){if(F&&F.keyCode&&((F.keyCode==46)||F.keyCode==63272)){A.stopEvent(F);}}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);if(this.browser.webkit){if(!this.browser.webkit3){if(F.keyCode&&(F.keyCode==122)&&(F.metaKey)){if(this._hasParent(this._getSelectedElement(),"li")){A.stopEvent(F);}}}this._listFix(F);}this.fireEvent("editorKeyPress",{type:"editorKeyPress",target:this,ev:F});},_listFix:function(L){var O=null,J=null,F=false,H=null;if(this.browser.webkit){if(L.keyCode&&(L.keyCode==13)){if(this._hasParent(this._getSelectedElement(),"li")){var I=this._hasParent(this._getSelectedElement(),"li");var N=this._getDoc().createElement("li");N.innerHTML="<span class=\"yui-non\">&nbsp;</span>&nbsp;";if(I.nextSibling){I.parentNode.insertBefore(N,I.nextSibling);}else{I.parentNode.appendChild(N);}this.currentElement[0]=N;this._selectNode(N.firstChild);if(!this.browser.webkit3){I.parentNode.style.display="list-item";setTimeout(function(){I.parentNode.style.display="block";},1);}A.stopEvent(L);}}}if(L.keyCode&&((!this.browser.webkit3&&(L.keyCode==25))||((this.browser.webkit3||!this.browser.webkit)&&((L.keyCode==9)&&L.shiftKey)))){O=this._getSelectedElement();if(this._hasParent(O,"li")){O=this._hasParent(O,"li");if(this._hasParent(O,"ul")||this._hasParent(O,"ol")){J=this._hasParent(O,"ul");if(!J){J=this._hasParent(O,"ol");}if(this._isElement(J.previousSibling,"li")){J.removeChild(O);J.parentNode.insertBefore(O,J.nextSibling);if(this.browser.ie){H=this._getDoc().body.createTextRange();H.moveToElementText(O);H.collapse(false);H.select();}if(this.browser.webkit){if(!this.browser.webkit3){J.style.display="list-item";J.parentNode.style.display="list-item";setTimeout(function(){J.style.display="block";J.parentNode.style.display="block";},1);}}A.stopEvent(L);}}}}if(L.keyCode&&((L.keyCode==9)&&(!L.shiftKey))){var G=this._getSelectedElement();if(this._hasParent(G,"li")){F=this._hasParent(G,"li").innerHTML;}if(this.browser.webkit){this._getDoc().execCommand("inserttext",false,"\t");}O=this._getSelectedElement();if(this._hasParent(O,"li")){J=this._hasParent(O,"li");var K=this._getDoc().createElement(J.parentNode.tagName.toLowerCase());if(this.browser.webkit){var M=C.getElementsByClassName("Apple-tab-span","span",J);if(M[0]){J.removeChild(M[0]);J.innerHTML=D.trim(J.innerHTML);if(F){J.innerHTML="<span class=\"yui-non\">"+F+"</span>&nbsp;";}else{J.innerHTML="<span class=\"yui-non\">&nbsp;</span>&nbsp;";}}}else{if(F){J.innerHTML=F+"&nbsp;";}else{J.innerHTML="&nbsp;";}}J.parentNode.replaceChild(K,J);K.appendChild(J);if(this.browser.webkit){this._getSelection().setBaseAndExtent(J.firstChild,1,J.firstChild,J.firstChild.innerText.length);if(!this.browser.webkit3){J.parentNode.parentNode.style.display="list-item";setTimeout(function(){J.parentNode.parentNode.style.display="block";},1);}}else{if(this.browser.ie){H=this._getDoc().body.createTextRange();H.moveToElementText(J);H.collapse(false);H.select();}else{this._selectNode(J);}}A.stopEvent(L);}if(this.browser.webkit){A.stopEvent(L);}this.nodeChange();}},_handleKeyDown:function(J){if(this._isNonEditable(J)){return false;}this._setCurrentEvent(J);if(this.currentWindow){this.closeWindow();}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}var I=false,K=null,H=false;if(J.shiftKey&&J.ctrlKey){I=true;}switch(J.keyCode){case 84:if(J.shiftKey&&J.ctrlKey){this.toolbar._titlebar.firstChild.focus();A.stopEvent(J);I=false;}break;case 27:if(J.shiftKey){this.afterElement.focus();A.stopEvent(J);H=false;}break;case 76:if(this._hasSelection()){if(J.shiftKey&&J.ctrlKey){var G=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){G=false;}}if(G){this.execCommand("createlink","");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});I=false;}}}break;case 65:if(J.metaKey&&this.browser.webkit){A.stopEvent(J);this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,this._getDoc().body.innerHTML.length);}break;case 66:K="bold";break;case 73:K="italic";break;case 85:K="underline";break;case 13:if(this.browser.ie){var L=this._getRange();var F=this._getSelectedElement();if(!this._isElement(F,"li")){if(L){L.pasteHTML("<br>");L.collapse(false);L.select();}A.stopEvent(J);}}}if(this.browser.ie){this._listFix(J);}if(I&&K){this.execCommand(K,null);A.stopEvent(J);this.nodeChange();}this.fireEvent("editorKeyDown",{type:"editorKeyDown",target:this,ev:J});},nodeChange:function(G){var H=parseInt(this.get("nodeChangeThreshold"),10);var N=Math.round(new Date().getTime()/1000);if(G===true){this._lastNodeChange=0;}if((this._lastNodeChange+H)<N){var Q=this;if(this._fixNodesTimer===null){this._fixNodesTimer=window.setTimeout(function(){Q._fixNodes.call(Q);Q._fixNodesTimer=null;},0);}}this._lastNodeChange=N;if(this.currentEvent){this._lastNodeChangeEvent=this.currentEvent.type;}var Y=this.fireEvent("beforeNodeChange",{type:"beforeNodeChange",target:this});
+if(Y===false){return false;}if(this.get("dompath")){this._writeDomPath();}if(!this.get("disabled")){if(this.STOP_NODE_CHANGE){this.STOP_NODE_CHANGE=false;return false;}else{var S=this._getSelection(),P=this._getRange(),F=this._getSelectedElement(),L=this.toolbar.getButtonByValue("fontname"),K=this.toolbar.getButtonByValue("fontsize");if(G!==true){this.editorDirty=true;}var M={};if(this._lastButton){M[this._lastButton.id]=true;}if(!this._isElement(F,"body")){if(L){M[L.get("id")]=true;}if(K){M[K.get("id")]=true;}}this.toolbar.resetAllButtons(M);for(var Z=0;Z<this._disabled.length;Z++){var O=this.toolbar.getButtonByValue(this._disabled[Z]);if(O&&O.get){if(this._lastButton&&(O.get("id")===this._lastButton.id)){}else{if(!this._hasSelection()){switch(this._disabled[Z]){case"fontname":case"fontsize":break;default:this.toolbar.disableButton(O);}}else{if(!this._alwaysDisabled[this._disabled[Z]]){this.toolbar.enableButton(O);}}if(!this._alwaysEnabled[this._disabled[Z]]){this.toolbar.deselectButton(O);}}}}var R=this._getDomPath();var a=null,V=null;for(var W=0;W<R.length;W++){a=R[W].tagName.toLowerCase();if(R[W].getAttribute("tag")){a=R[W].getAttribute("tag").toLowerCase();}V=this._tag2cmd[a];if(V===undefined){V=[];}if(!D.isArray(V)){V=[V];}if(R[W].style.fontWeight.toLowerCase()=="bold"){V[V.length]="bold";}if(R[W].style.fontStyle.toLowerCase()=="italic"){V[V.length]="italic";}if(R[W].style.textDecoration.toLowerCase()=="underline"){V[V.length]="underline";}if(V.length>0){for(var U=0;U<V.length;U++){this.toolbar.selectButton(V[U]);this.toolbar.enableButton(V[U]);}}switch(R[W].style.textAlign.toLowerCase()){case"left":case"right":case"center":case"justify":var T=R[W].style.textAlign.toLowerCase();if(R[W].style.textAlign.toLowerCase()=="justify"){T="full";}this.toolbar.selectButton("justify"+T);this.toolbar.enableButton("justify"+T);break;}}if(L){var X=L._configs.label._initialConfig.value;L.set("label","<span class=\"yui-toolbar-fontname-"+E(X)+"\">"+X+"</span>");this._updateMenuChecked("fontname",X);}if(K){K.set("label",K._configs.label._initialConfig.value);}var J=this.toolbar.getButtonByValue("heading");if(J){J.set("label",J._configs.label._initialConfig.value);this._updateMenuChecked("heading","none");}var I=this.toolbar.getButtonByValue("insertimage");if(I&&this.currentWindow&&(this.currentWindow.name=="insertimage")){this.toolbar.disableButton(I);}}}this.fireEvent("afterNodeChange",{type:"afterNodeChange",target:this});},_updateMenuChecked:function(F,G,I){if(!I){I=this.toolbar;}var H=I.getButtonByValue(F);H.checkValue(G);},_handleToolbarClick:function(G){var I="";var J="";var H=G.button.value;if(G.button.menucmd){I=H;H=G.button.menucmd;}this._lastButton=G.button;if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(H,I);if(!this.browser.webkit){var F=this;setTimeout(function(){F._focusWindow.call(F);},5);}}A.stopEvent(G);},_setupAfterElement:function(){if(!this.beforeElement){this.beforeElement=document.createElement("h2");this.beforeElement.className="yui-editor-skipheader";this.beforeElement.tabIndex="-1";this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get("element_cont").get("firstChild").insertBefore(this.beforeElement,this.toolbar.get("nextSibling"));}if(!this.afterElement){this.afterElement=document.createElement("h2");this.afterElement.className="yui-editor-skipheader";this.afterElement.tabIndex="-1";this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get("element_cont").get("firstChild").appendChild(this.afterElement);}},_disableEditor:function(G){if(G){if(!this._mask){if(!!this.browser.ie){this._setDesignMode("off");}if(this.toolbar){this.toolbar.set("disabled",true);}this._mask=document.createElement("DIV");C.setStyle(this._mask,"height","100%");C.setStyle(this._mask,"width","100%");C.setStyle(this._mask,"position","absolute");C.setStyle(this._mask,"top","0");C.setStyle(this._mask,"left","0");C.setStyle(this._mask,"opacity",".5");C.addClass(this._mask,"yui-editor-masked");this.get("iframe").get("parentNode").appendChild(this._mask);}}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;if(this.toolbar){this.toolbar.set("disabled",false);}this._setDesignMode("on");this._focusWindow();var F=this;window.setTimeout(function(){F.nodeChange.call(F);},100);}}},EDITOR_PANEL_ID:"yui-editor-panel",SEP_DOMPATH:"<",STR_LEAVE_EDITOR:"You have left the Rich Text Editor.",STR_BEFORE_EDITOR:"This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>",STR_TITLE:"Rich Text Area.",STR_IMAGE_HERE:"Image Url Here",STR_LINK_URL:"Link URL",STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_NOEDIT:"yui-noedit",CLASS_CONTAINER:"yui-editor-container",CLASS_EDITABLE:"yui-editor-editable",CLASS_EDITABLE_CONT:"yui-editor-editable-container",CLASS_PREFIX:"yui-editor",browser:function(){var F=YAHOO.env.ua;if(F.webkit>420){F.webkit3=F.webkit;}else{F.webkit3=0;}return F;}(),init:function(G,F){if(!this._defaultToolbar){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"separator"},{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true}]},{type:"separator"},{group:"indentlist",label:"Lists",buttons:[{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};
+}YAHOO.widget.SimpleEditor.superclass.init.call(this,G,F);YAHOO.widget.EditorInfo._instances[this.get("id")]=this;this.currentElement=[];this.on("contentReady",function(){this.DOMReady=true;this.fireQueue();},this,true);},initAttributes:function(F){YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this,F);var G=this;this.setAttributeConfig("container",{writeOnce:true,value:F.container||false});this.setAttributeConfig("plainText",{writeOnce:true,value:F.plainText||false});this.setAttributeConfig("iframe",{value:null});this.setAttributeConfig("textarea",{value:null,writeOnce:true});this.setAttributeConfig("container",{readOnly:true,value:null});this.setAttributeConfig("nodeChangeThreshold",{value:F.nodeChangeThreshold||3,validator:YAHOO.lang.isNumber});this.setAttributeConfig("allowNoEdit",{value:F.allowNoEdit||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("limitCommands",{value:F.limitCommands||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("element_cont",{value:F.element_cont});this.setAttributeConfig("editor_wrapper",{value:F.editor_wrapper||null,writeOnce:true});this.setAttributeConfig("height",{value:F.height||C.getStyle(G.get("element"),"height"),method:function(H){if(this._rendered){if(this.get("animate")){var I=new YAHOO.util.Anim(this.get("iframe").get("parentNode"),{height:{to:parseInt(H,10)}},0.5);I.animate();}else{C.setStyle(this.get("iframe").get("parentNode"),"height",H);}}}});this.setAttributeConfig("autoHeight",{value:F.autoHeight||false,method:function(H){if(H){if(this.get("iframe")){this.get("iframe").get("element").setAttribute("scrolling","no");}this.on("afterNodeChange",this._handleAutoHeight,this,true);this.on("editorKeyDown",this._handleAutoHeight,this,true);this.on("editorKeyPress",this._handleAutoHeight,this,true);}else{if(this.get("iframe")){this.get("iframe").get("element").setAttribute("scrolling","auto");}this.unsubscribe("afterNodeChange",this._handleAutoHeight);this.unsubscribe("editorKeyDown",this._handleAutoHeight);this.unsubscribe("editorKeyPress",this._handleAutoHeight);}}});this.setAttributeConfig("width",{value:F.width||C.getStyle(this.get("element"),"width"),method:function(H){if(this._rendered){if(this.get("animate")){var I=new YAHOO.util.Anim(this.get("element_cont").get("element"),{width:{to:parseInt(H,10)}},0.5);I.animate();}else{this.get("element_cont").setStyle("width",H);}}}});this.setAttributeConfig("blankimage",{value:F.blankimage||this._getBlankImage()});this.setAttributeConfig("css",{value:F.css||this._defaultCSS,writeOnce:true});this.setAttributeConfig("html",{value:F.html||"<html><head><title>{TITLE}</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><base href=\""+this._baseHREF+"\"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload=\"document.body._rteLoaded = true;\">{CONTENT}</body></html>",writeOnce:true});this.setAttributeConfig("extracss",{value:F.css||"",writeOnce:true});this.setAttributeConfig("handleSubmit",{value:F.handleSubmit||false,method:function(H){if(this.get("element").form){if(!this._formButtons){this._formButtons=[];}if(H){A.on(this.get("element").form,"submit",this._handleFormSubmit,this,true);var I=this.get("element").form.getElementsByTagName("input");for(var K=0;K<I.length;K++){var J=I[K].getAttribute("type");if(J&&(J.toLowerCase()=="submit")){A.on(I[K],"click",this._handleFormButtonClick,this,true);this._formButtons[this._formButtons.length]=I[K];}}}else{A.unsubscribe(this.get("element").form,"submit",this._handleFormSubmit);if(this._formButtons){A.unsubscribe(this._formButtons,"click",this._handleFormButtonClick);}}}}});this.setAttributeConfig("disabled",{value:false,method:function(H){if(this._rendered){this._disableEditor(H);}}});this.setAttributeConfig("toolbar_cont",{value:null,writeOnce:true});this.setAttributeConfig("toolbar",{value:F.toolbar||this._defaultToolbar,writeOnce:true,method:function(H){if(!H.buttonType){H.buttonType=this._defaultToolbar.buttonType;}this._defaultToolbar=H;}});this.setAttributeConfig("animate",{value:((F.animate)?((YAHOO.util.Anim)?true:false):false),validator:function(I){var H=true;if(!YAHOO.util.Anim){H=false;}return H;}});this.setAttributeConfig("panel",{value:null,writeOnce:true,validator:function(I){var H=true;if(!YAHOO.widget.Overlay){H=false;}return H;}});this.setAttributeConfig("focusAtStart",{value:F.focusAtStart||false,writeOnce:true,method:function(){this.on("editorContentLoaded",function(){var H=this;setTimeout(function(){H._focusWindow.call(H,true);H.editorDirty=false;},400);},this,true);}});this.setAttributeConfig("dompath",{value:F.dompath||false,method:function(H){if(H&&!this.dompath){this.dompath=document.createElement("DIV");this.dompath.id=this.get("id")+"_dompath";C.addClass(this.dompath,"dompath");this.get("element_cont").get("firstChild").appendChild(this.dompath);if(this.get("iframe")){this._writeDomPath();}}else{if(!H&&this.dompath){this.dompath.parentNode.removeChild(this.dompath);this.dompath=null;}}}});this.setAttributeConfig("markup",{value:F.markup||"semantic",validator:function(H){switch(H.toLowerCase()){case"semantic":case"css":case"default":case"xhtml":return true;}return false;}});this.setAttributeConfig("removeLineBreaks",{value:F.removeLineBreaks||false,validator:YAHOO.lang.isBoolean});this.on("afterRender",function(){this._renderPanel();});},_getBlankImage:function(){if(!this.DOMReady){this._queue[this._queue.length]=["_getBlankImage",arguments];return"";}var F="";if(!this._blankImageLoaded){var G=document.createElement("div");G.style.position="absolute";G.style.top="-9999px";G.style.left="-9999px";G.className=this.CLASS_PREFIX+"-blankimage";document.body.appendChild(G);F=YAHOO.util.Dom.getStyle(G,"background-image");F=F.replace("url(","").replace(")","").replace(/"/g,"");this.set("blankimage",F);this._blankImageLoaded=true;}else{F=this.get("blankimage");}return F;},_handleAutoHeight:function(){var J=this._getDoc(),G=J.body,K=J.documentElement;
+var F=parseInt(C.getStyle(this.get("editor_wrapper"),"height"),10);var H=G.scrollHeight;if(this.browser.webkit){H=K.scrollHeight;}if(H<parseInt(this.get("height"),10)){H=parseInt(this.get("height"),10);}if((F!=H)&&(H>=parseInt(this.get("height"),10))){C.setStyle(this.get("editor_wrapper"),"height",H+"px");if(this.browser.ie){this.get("iframe").setStyle("height","99%");this.get("iframe").setStyle("zoom","1");var I=this;window.setTimeout(function(){I.get("iframe").setStyle("height","100%");},1);}}},_formButtons:null,_formButtonClicked:null,_handleFormButtonClick:function(G){var F=A.getTarget(G);this._formButtonClicked=F;},_handleFormSubmit:function(I){A.stopEvent(I);this.saveHTML();var H=this.get("element").form;var F=this._formButtonClicked||false;var G=this;window.setTimeout(function(){YAHOO.util.Event.removeListener(H,"submit",G._handleFormSubmit);if(YAHOO.env.ua.ie){H.fireEvent("onsubmit");if(F){F.click();}}else{if(F){F.click();}else{var J=document.createEvent("HTMLEvents");J.initEvent("submit",true,true);H.dispatchEvent(J);if(YAHOO.env.ua.webkit){if(YAHOO.lang.isFunction(H.submit)){H.submit();}}}}},200);},_handleFontSize:function(H){var F=this.toolbar.getButtonById(H.button.id);var G=F.get("label")+"px";this.execCommand("fontsize",G);this.STOP_EXEC_COMMAND=true;},_handleColorPicker:function(H){var G=H.button;var F="#"+H.color;if((G=="forecolor")||(G=="backcolor")){this.execCommand(G,F);}},_handleAlign:function(I){var H=null;for(var F=0;F<I.button.menu.length;F++){if(I.button.menu[F].value==I.button.value){H=I.button.menu[F].value;}}var G=this._getSelection();this.execCommand(H,G);this.STOP_EXEC_COMMAND=true;},_handleAfterNodeChange:function(){var R=this._getDomPath(),M=null,I=null,N=null,G=false;var K=this.toolbar.getButtonByValue("fontname");var L=this.toolbar.getButtonByValue("fontsize");var F=this.toolbar.getButtonByValue("heading");for(var H=0;H<R.length;H++){M=R[H];var Q=M.tagName.toLowerCase();if(M.getAttribute("tag")){Q=M.getAttribute("tag");}I=M.getAttribute("face");if(C.getStyle(M,"font-family")){I=C.getStyle(M,"font-family");}if(Q.substring(0,1)=="h"){if(F){for(var J=0;J<F._configs.menu.value.length;J++){if(F._configs.menu.value[J].value.toLowerCase()==Q){F.set("label",F._configs.menu.value[J].text);}}this._updateMenuChecked("heading",Q);}}}if(K){for(var P=0;P<K._configs.menu.value.length;P++){if(I&&K._configs.menu.value[P].text.toLowerCase()==I.toLowerCase()){G=true;I=K._configs.menu.value[P].text;}}if(!G){I=K._configs.label._initialConfig.value;}var O="<span class=\"yui-toolbar-fontname-"+E(I)+"\">"+I+"</span>";if(K.get("label")!=O){K.set("label",O);this._updateMenuChecked("fontname",I);}}if(L){N=parseInt(C.getStyle(M,"fontSize"),10);if((N===null)||isNaN(N)){N=L._configs.label._initialConfig.value;}L.set("label",""+N);}if(!this._isElement(M,"body")&&!this._isElement(M,"img")){this.toolbar.enableButton(K);this.toolbar.enableButton(L);this.toolbar.enableButton("forecolor");this.toolbar.enableButton("backcolor");}if(this._isElement(M,"img")){if(YAHOO.widget.Overlay){this.toolbar.enableButton("createlink");}}if(this._isElement(M,"blockquote")){this.toolbar.selectButton("indent");this.toolbar.disableButton("indent");this.toolbar.enableButton("outdent");}if(this._hasParent(M,"ol")||this._hasParent(M,"ul")){this.toolbar.disableButton("indent");}this._lastButton=null;},_setBusy:function(F){},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false;}}this.toolbar.set("disabled",true);this.on("afterExecCommand",function(){var F=this.currentElement[0],H="http://";if(!F){F=this._getSelectedElement();}if(F){if(F.getAttribute("src")){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){H=this.STR_IMAGE_HERE;}}}var G=prompt(this.STR_LINK_URL+": ",H);if((G!=="")&&(G!==null)){F.setAttribute("src",G);}else{if(G===null){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}}this.closeWindow();this.toolbar.set("disabled",false);},this,true);},_handleInsertImageWindowClose:function(){this.nodeChange();},_isLocalFile:function(F){if((F!=="")&&((F.indexOf("file:/")!=-1)||(F.indexOf(":\\")!=-1))){return true;}return false;},_handleCreateLinkClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.toolbar.set("disabled",true);this.on("afterExecCommand",function(){var H=this.currentElement[0],G="";if(H){if(H.getAttribute("href",2)!==null){G=H.getAttribute("href",2);}}var J=prompt(this.STR_LINK_URL+": ",G);if((J!=="")&&(J!==null)){var I=J;if((I.indexOf("://")==-1)&&(I.substring(0,1)!="/")&&(I.substring(0,6).toLowerCase()!="mailto")){if((I.indexOf("@")!=-1)&&(I.substring(0,6).toLowerCase()!="mailto")){I="mailto:"+I;}else{if(I.substring(0,1)!="#"){I="http://"+I;}}}H.setAttribute("href",I);}else{if(J!==null){var F=this._getDoc().createElement("span");F.innerHTML=H.innerHTML;C.addClass(F,"yui-non");H.parentNode.replaceChild(F,H);}}this.closeWindow();this.toolbar.set("disabled",false);});},_handleCreateLinkWindowClose:function(){this.nodeChange();this.currentElement=[];},render:function(){if(this._rendered){return false;}if(!this.DOMReady){this._queue[this._queue.length]=["render",arguments];return false;}this._rendered=true;var F=this;window.setTimeout(function(){F._render.call(F);},4);},_render:function(){this._setBusy();var F=this;this.set("textarea",this.get("element"));this.get("element_cont").setStyle("display","none");this.get("element_cont").addClass(this.CLASS_CONTAINER);this.set("iframe",this._createIframe());window.setTimeout(function(){F._setInitialContent.call(F);},10);this.get("editor_wrapper").appendChild(this.get("iframe").get("element"));if(this.get("disabled")){this._disableEditor(true);}var G=this.get("toolbar");if(G instanceof B){this.toolbar=G;this.toolbar.set("disabled",true);}else{G.disabled=true;this.toolbar=new B(this.get("toolbar_cont"),G);}this.fireEvent("toolbarLoaded",{type:"toolbarLoaded",target:this.toolbar});this.toolbar.on("toolbarCollapsed",function(){if(this.currentWindow){this.moveWindow();
+}},this,true);this.toolbar.on("toolbarExpanded",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("fontsizeClick",function(H){this._handleFontSize(H);},this,true);this.toolbar.on("colorPickerClicked",function(H){this._handleColorPicker(H);return false;},this,true);this.toolbar.on("alignClick",function(H){this._handleAlign(H);},this,true);this.on("afterNodeChange",function(){this._handleAfterNodeChange();},this,true);this.toolbar.on("insertimageClick",function(){this._handleInsertImageClick();},this,true);this.on("windowinsertimageClose",function(){this._handleInsertImageWindowClose();},this,true);this.toolbar.on("createlinkClick",function(){this._handleCreateLinkClick();},this,true);this.on("windowcreatelinkClose",function(){this._handleCreateLinkWindowClose();},this,true);this.get("parentNode").replaceChild(this.get("element_cont").get("element"),this.get("element"));this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");this.get("element_cont").appendChild(this.get("element"));this.get("element_cont").setStyle("display","block");C.addClass(this.get("iframe").get("parentNode"),this.CLASS_EDITABLE_CONT);this.get("iframe").addClass(this.CLASS_EDITABLE);this.get("element_cont").setStyle("width",this.get("width"));C.setStyle(this.get("iframe").get("parentNode"),"height",this.get("height"));this.get("iframe").setStyle("width","100%");this.get("iframe").setStyle("height","100%");window.setTimeout(function(){F._setupAfterElement.call(F);},0);this.fireEvent("afterRender",{type:"afterRender",target:this});},execCommand:function(H,G){var K=this.fireEvent("beforeExecCommand",{type:"beforeExecCommand",target:this,args:arguments});if((K===false)||(this.STOP_EXEC_COMMAND)){this.STOP_EXEC_COMMAND=false;return false;}this._setMarkupType(H);if(this.browser.ie){this._getWindow().focus();}var F=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue(H)){F=false;}}this.editorDirty=true;if((typeof this["cmd_"+H.toLowerCase()]=="function")&&F){var J=this["cmd_"+H.toLowerCase()](G);F=J[0];if(J[1]){H=J[1];}if(J[2]){G=J[2];}}if(F){try{this._getDoc().execCommand(H,false,G);}catch(I){}}else{}this.on("afterExecCommand",function(){this.unsubscribeAll("afterExecCommand");this.nodeChange();});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});},cmd_backcolor:function(I){var F=true,G=this._getSelectedElement(),H="backcolor";if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);H="hilitecolor";}if(!this._isElement(G,"body")){C.setStyle(G,"background-color",I);this._selectNode(G);F=false;}else{this._createCurrentElement("span",{backgroundColor:I});this._selectNode(this.currentElement[0]);F=false;}return[F,H];},cmd_forecolor:function(H){var F=true,G=this._getSelectedElement();if(!this._isElement(G,"body")){C.setStyle(G,"color",H);this._selectNode(G);F=false;}else{this._createCurrentElement("span",{color:H});this._selectNode(this.currentElement[0]);F=false;}return[F];},cmd_unlink:function(F){this._swapEl(this.currentElement[0],"span",function(G){G.className="yui-non";});return[false];},cmd_createlink:function(H){var G=this._getSelectedElement(),F=null;if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");}else{if(!this._isElement(G,"a")){this._createCurrentElement("a");F=this._swapEl(this.currentElement[0],"a");this.currentElement[0]=F;}else{this.currentElement[0]=G;}}return[false];},cmd_insertimage:function(K){var F=true,G=null,J="insertimage",I=this._getSelectedElement();if(K===""){K=this.get("blankimage");}if(this._isElement(I,"img")){this.currentElement[0]=I;F=false;}else{if(this._getDoc().queryCommandEnabled(J)){this._getDoc().execCommand("insertimage",false,K);var L=this._getDoc().getElementsByTagName("img");for(var H=0;H<L.length;H++){if(!YAHOO.util.Dom.hasClass(L[H],"yui-img")){YAHOO.util.Dom.addClass(L[H],"yui-img");this.currentElement[0]=L[H];}}F=false;}else{if(I==this._getDoc().body){G=this._getDoc().createElement("img");G.setAttribute("src",K);YAHOO.util.Dom.addClass(G,"yui-img");this._getDoc().body.appendChild(G);}else{this._createCurrentElement("img");G=this._getDoc().createElement("img");G.setAttribute("src",K);YAHOO.util.Dom.addClass(G,"yui-img");this.currentElement[0].parentNode.replaceChild(G,this.currentElement[0]);}this.currentElement[0]=G;F=false;}}return[F];},cmd_inserthtml:function(I){var F=true,H="inserthtml",G=null,J=null;if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(H)){this._createCurrentElement("img");G=this._getDoc().createElement("span");G.innerHTML=I;this.currentElement[0].parentNode.replaceChild(G,this.currentElement[0]);F=false;}else{if(this.browser.ie){J=this._getRange();if(J.item){J.item(0).outerHTML=I;}else{J.pasteHTML(I);}F=false;}}return[F];},cmd_list:function(W){var Q=true,T=null,M=0,G=null,P="",U=this._getSelectedElement(),R="insertorderedlist";if(W=="ul"){R="insertunorderedlist";}if((this.browser.webkit&&!this._getDoc().queryCommandEnabled(R))){if(this._isElement(U,"li")&&this._isElement(U.parentNode,W)){G=U.parentNode;T=this._getDoc().createElement("span");YAHOO.util.Dom.addClass(T,"yui-non");P="";var F=G.getElementsByTagName("li");for(M=0;M<F.length;M++){P+="<div>"+F[M].innerHTML+"</div>";}T.innerHTML=P;this.currentElement[0]=G;this.currentElement[0].parentNode.replaceChild(T,this.currentElement[0]);}else{this._createCurrentElement(W.toLowerCase());T=this._getDoc().createElement(W);for(M=0;M<this.currentElement.length;M++){var J=this._getDoc().createElement("li");J.innerHTML=this.currentElement[M].innerHTML+"<span class=\"yui-non\">&nbsp;</span>&nbsp;";T.appendChild(J);if(M>0){this.currentElement[M].parentNode.removeChild(this.currentElement[M]);}}this.currentElement[0].parentNode.replaceChild(T,this.currentElement[0]);this.currentElement[0]=T;var H=this.currentElement[0].firstChild;H=C.getElementsByClassName("yui-non","span",H)[0];this._getSelection().setBaseAndExtent(H,1,H,H.innerText.length);
+}Q=false;}else{G=this._getSelectedElement();if(this._isElement(G,"li")&&this._isElement(G.parentNode,W)||(this.browser.ie&&this._isElement(this._getRange().parentElement,"li"))||(this.browser.ie&&this._isElement(G,"ul"))||(this.browser.ie&&this._isElement(G,"ol"))){if(this.browser.ie){if((this.browser.ie&&this._isElement(G,"ul"))||(this.browser.ie&&this._isElement(G,"ol"))){G=G.getElementsByTagName("li")[0];}P="";var I=G.parentNode.getElementsByTagName("li");for(var S=0;S<I.length;S++){P+=I[S].innerHTML+"<br>";}var V=this._getDoc().createElement("span");V.innerHTML=P;G.parentNode.parentNode.replaceChild(V,G.parentNode);}else{this.nodeChange();this._getDoc().execCommand(R,"",G.parentNode);this.nodeChange();}Q=false;}if(this.browser.opera){var O=this;window.setTimeout(function(){var X=O._getDoc().getElementsByTagName("li");for(var Y=0;Y<X.length;Y++){if(X[Y].innerHTML.toLowerCase()=="<br>"){X[Y].parentNode.parentNode.removeChild(X[Y].parentNode);}}},30);}if(this.browser.ie&&Q){var K="";if(this._getRange().html){K="<li>"+this._getRange().html+"</li>";}else{var L=this._getRange().text.split("\n");if(L.length>1){K="";for(var N=0;N<L.length;N++){K+="<li>"+L[N]+"</li>";}}else{K="<li>"+this._getRange().text+"</li>";}}this._getRange().pasteHTML("<"+W+">"+K+"</"+W+">");Q=false;}}return Q;},cmd_insertorderedlist:function(F){return[this.cmd_list("ol")];},cmd_insertunorderedlist:function(F){return[this.cmd_list("ul")];},cmd_fontname:function(H){var F=true,G=this._getSelectedElement();this.currentFont=H;if(G&&G.tagName&&!this._hasSelection()){YAHOO.util.Dom.setStyle(G,"font-family",H);F=false;}return[F];},cmd_fontsize:function(G){if(this.currentElement&&(this.currentElement.length>0)&&(!this._hasSelection())){YAHOO.util.Dom.setStyle(this.currentElement,"fontSize",G);}else{if(!this._isElement(this._getSelectedElement(),"body")){var F=this._getSelectedElement();YAHOO.util.Dom.setStyle(F,"fontSize",G);this._selectNode(F);}else{this._createCurrentElement("span",{"fontSize":G});this._selectNode(this.currentElement[0]);}}return[false];},_swapEl:function(G,F,I){var H=this._getDoc().createElement(F);H.innerHTML=G.innerHTML;if(typeof I=="function"){I.call(this,H);}G.parentNode.replaceChild(H,G);return H;},_createCurrentElement:function(H,U){H=((H)?H:"a");var b=null,G=[],I=this._getDoc();if(this.currentFont){if(!U){U={};}U.fontFamily=this.currentFont;this.currentFont=null;}this.currentElement=[];var X=function(){var f=null;switch(H){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":f=I.createElement(H);break;default:f=I.createElement("span");YAHOO.util.Dom.addClass(f,"yui-tag-"+H);YAHOO.util.Dom.addClass(f,"yui-tag");f.setAttribute("tag",H);for(var e in U){if(YAHOO.util.Lang.hasOwnProperty(U,e)){f.style[e]=U[e];}}break;}return f;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled("insertimage")){this._getDoc().execCommand("insertimage",false,"yui-tmp-img");var W=this._getDoc().getElementsByTagName("img");for(var Z=0;Z<W.length;Z++){if(W[Z].getAttribute("src",2)=="yui-tmp-img"){G=X();W[Z].parentNode.replaceChild(G,W[Z]);this.currentElement[this.currentElement.length]=G;}}}else{if(this.currentEvent){b=YAHOO.util.Event.getTarget(this.currentEvent);}else{b=this._getDoc().body;}}if(b){G=X();if(this._isElement(b,"body")||this._isElement(b,"html")){if(this._isElement(b,"html")){b=this._getDoc().body;}b.appendChild(G);}else{if(b.nextSibling){b.parentNode.insertBefore(G,b.nextSibling);}else{b.parentNode.appendChild(G);}}this.currentElement[this.currentElement.length]=G;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(G,0,G,0);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(true);}}}}else{this._setEditorStyle(true);this._getDoc().execCommand("fontname",false,"yui-tmp");var F=[];var R=this._getDoc().getElementsByTagName("font");var P=this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);var M=this._getDoc().getElementsByTagName("span");var L=this._getDoc().getElementsByTagName("i");var K=this._getDoc().getElementsByTagName("b");var J=this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);for(var V=0;V<R.length;V++){F[F.length]=R[V];}for(var N=0;N<J.length;N++){F[F.length]=J[N];}for(var T=0;T<P.length;T++){F[F.length]=P[T];}for(var S=0;S<M.length;S++){F[F.length]=M[S];}for(var Q=0;Q<L.length;Q++){F[F.length]=L[Q];}for(var O=0;O<K.length;O++){F[F.length]=K[O];}for(var a=0;a<F.length;a++){if((YAHOO.util.Dom.getStyle(F[a],"font-family")=="yui-tmp")||(F[a].face&&(F[a].face=="yui-tmp"))){G=X();G.innerHTML=F[a].innerHTML;if(this._isElement(F[a],"ol")||(this._isElement(F[a],"ul"))){var Y=F[a].getElementsByTagName("li")[0];F[a].style.fontFamily="inherit";Y.style.fontFamily="inherit";G.innerHTML=Y.innerHTML;Y.innerHTML="";Y.appendChild(G);this.currentElement[this.currentElement.length]=G;}else{if(this._isElement(F[a],"li")){F[a].innerHTML="";F[a].appendChild(G);F[a].style.fontFamily="inherit";this.currentElement[this.currentElement.length]=G;}else{if(F[a].parentNode){F[a].parentNode.replaceChild(G,F[a]);this.currentElement[this.currentElement.length]=G;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(G,0,G,0);if(this.browser.webkit3){this._getSelection().collapseToStart();}else{this._getSelection().collapse(true);}}if(this.browser.ie&&U&&U.fontSize){this._getSelection().empty();}if(this.browser.gecko){this._getSelection().collapseToStart();}}}}}}var c=this.currentElement.length;for(var d=0;d<c;d++){if((d+1)!=c){if(this.currentElement[d]&&this.currentElement[d].nextSibling){if(this._isElement(this.currentElement[d],"br")){this.currentElement[this.currentElement.length]=this.currentElement[d].nextSibling;}}}}}},saveHTML:function(){var F=this.cleanHTML();this.get("element").value=F;return F;},setEditorHTML:function(F){F=this._cleanIncomingHTML(F);this._getDoc().body.innerHTML=F;this.nodeChange();},getEditorHTML:function(){var F=this._getDoc().body;if(F===null){return null;
+}return this._getDoc().body.innerHTML;},show:function(){if(this.browser.gecko){this._setDesignMode("on");this._focusWindow();}if(this.browser.webkit){var F=this;window.setTimeout(function(){F._setInitialContent.call(F);},10);}if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}this.get("iframe").setStyle("position","static");this.get("iframe").setStyle("left","");},hide:function(){if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}if(this._fixNodesTimer){clearTimeout(this._fixNodesTimer);this._fixNodesTimer=null;}if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);this._nodeChangeTimer=null;}this._lastNodeChange=0;this.get("iframe").setStyle("position","absolute");this.get("iframe").setStyle("left","-9999px");},_cleanIncomingHTML:function(F){F=F.replace(/<strong([^>]*)>/gi,"<b$1>");F=F.replace(/<\/strong>/gi,"</b>");F=F.replace(/<embed([^>]*)>/gi,"<YUI_EMBED$1>");F=F.replace(/<\/embed>/gi,"</YUI_EMBED>");F=F.replace(/<em([^>]*)>/gi,"<i$1>");F=F.replace(/<\/em>/gi,"</i>");F=F.replace(/<YUI_EMBED([^>]*)>/gi,"<embed$1>");F=F.replace(/<\/YUI_EMBED>/gi,"</embed>");if(this.get("plainText")){F=F.replace(/\n/g,"<br>").replace(/\r/g,"<br>");F=F.replace(/  /gi,"&nbsp;&nbsp;");F=F.replace(/\t/gi,"&nbsp;&nbsp;&nbsp;&nbsp;");}F=F.replace(/<script([^>]*)>/gi,"<bad>");F=F.replace(/<\/script([^>]*)>/gi,"</bad>");F=F.replace(/&lt;script([^>]*)&gt;/gi,"<bad>");F=F.replace(/&lt;\/script([^>]*)&gt;/gi,"</bad>");F=F.replace(/\n/g,"<YUI_LF>").replace(/\r/g,"<YUI_LF>");F=F.replace(new RegExp("<bad([^>]*)>(.*?)</bad>","gi"),"");F=F.replace(/<YUI_LF>/g,"\n");return F;},cleanHTML:function(H){if(!H){H=this.getEditorHTML();}var G=this.get("markup");H=this.pre_filter_linebreaks(H,G);H=H.replace(/<img([^>]*)\/>/gi,"<YUI_IMG$1>");H=H.replace(/<img([^>]*)>/gi,"<YUI_IMG$1>");H=H.replace(/<input([^>]*)\/>/gi,"<YUI_INPUT$1>");H=H.replace(/<input([^>]*)>/gi,"<YUI_INPUT$1>");H=H.replace(/<ul([^>]*)>/gi,"<YUI_UL$1>");H=H.replace(/<\/ul>/gi,"</YUI_UL>");H=H.replace(/<blockquote([^>]*)>/gi,"<YUI_BQ$1>");H=H.replace(/<\/blockquote>/gi,"</YUI_BQ>");H=H.replace(/<embed([^>]*)>/gi,"<YUI_EMBED$1>");H=H.replace(/<\/embed>/gi,"</YUI_EMBED>");if((G=="semantic")||(G=="xhtml")){H=H.replace(/<i(\s+[^>]*)?>/gi,"<em$1>");H=H.replace(/<\/i>/gi,"</em>");H=H.replace(/<b([^>]*)>/gi,"<strong$1>");H=H.replace(/<\/b>/gi,"</strong>");}H=H.replace(/<font/gi,"<font");H=H.replace(/<\/font>/gi,"</font>");H=H.replace(/<span/gi,"<span");H=H.replace(/<\/span>/gi,"</span>");if((G=="semantic")||(G=="xhtml")||(G=="css")){H=H.replace(new RegExp("<font([^>]*)face=\"([^>]*)\">(.*?)</font>","gi"),"<span $1 style=\"font-family: $2;\">$3</span>");H=H.replace(/<u/gi,"<span style=\"text-decoration: underline;\"");H=H.replace(/\/u>/gi,"/span>");if(G=="css"){H=H.replace(/<em([^>]*)>/gi,"<i$1>");H=H.replace(/<\/em>/gi,"</i>");H=H.replace(/<strong([^>]*)>/gi,"<b$1>");H=H.replace(/<\/strong>/gi,"</b>");H=H.replace(/<b/gi,"<span style=\"font-weight: bold;\"");H=H.replace(/\/b>/gi,"/span>");H=H.replace(/<i/gi,"<span style=\"font-style: italic;\"");H=H.replace(/\/i>/gi,"/span>");}H=H.replace(/  /gi," ");}else{H=H.replace(/<u/gi,"<u");H=H.replace(/\/u>/gi,"/u>");}H=H.replace(/<ol([^>]*)>/gi,"<ol$1>");H=H.replace(/\/ol>/gi,"/ol>");H=H.replace(/<li/gi,"<li");H=H.replace(/\/li>/gi,"/li>");H=this.filter_safari(H);H=this.filter_internals(H);H=this.filter_all_rgb(H);H=this.post_filter_linebreaks(H,G);if(G=="xhtml"){H=H.replace(/<YUI_IMG([^>]*)>/g,"<img $1 />");H=H.replace(/<YUI_INPUT([^>]*)>/g,"<input $1 />");}else{H=H.replace(/<YUI_IMG([^>]*)>/g,"<img $1>");H=H.replace(/<YUI_INPUT([^>]*)>/g,"<input $1>");}H=H.replace(/<YUI_UL([^>]*)>/g,"<ul$1>");H=H.replace(/<\/YUI_UL>/g,"</ul>");H=this.filter_invalid_lists(H);H=H.replace(/<YUI_BQ([^>]*)>/g,"<blockquote$1>");H=H.replace(/<\/YUI_BQ>/g,"</blockquote>");H=H.replace(/<YUI_EMBED([^>]*)>/g,"<embed$1>");H=H.replace(/<\/YUI_EMBED>/g,"</embed>");H=YAHOO.lang.trim(H);if(this.get("removeLineBreaks")){H=H.replace(/\n/g,"").replace(/\r/g,"");H=H.replace(/  /gi," ");}if(H.substring(0,6).toLowerCase()=="<span>"){H=H.substring(6);if(H.substring(H.length-7,H.length).toLowerCase()=="</span>"){H=H.substring(0,H.length-7);}}for(var F in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,F)){if(D.isObject(F)&&F.keepContents){H=H.replace(new RegExp("<"+F+"([^>]*)>(.*?)</"+F+">","gi"),"$1");}else{H=H.replace(new RegExp("<"+F+"([^>]*)>(.*?)</"+F+">","gi"),"");}}}this.fireEvent("cleanHTML",{type:"cleanHTML",target:this,html:H});return H;},filter_invalid_lists:function(F){F=F.replace(/<\/li>\n/gi,"</li>");F=F.replace(/<\/li><ol>/gi,"</li><li><ol>");F=F.replace(/<\/ol>/gi,"</ol></li>");F=F.replace(/<\/ol><\/li>\n/gi,"</ol>\n");F=F.replace(/<\/li><ul>/gi,"</li><li><ul>");F=F.replace(/<\/ul>/gi,"</ul></li>");F=F.replace(/<\/ul><\/li>\n/gi,"</ul>\n");F=F.replace(/<\/li>/gi,"</li>\n");F=F.replace(/<\/ol>/gi,"</ol>\n");F=F.replace(/<ol>/gi,"<ol>\n");F=F.replace(/<ul>/gi,"<ul>\n");return F;},filter_safari:function(F){if(this.browser.webkit){F=F.replace(/Apple-style-span/gi,"");F=F.replace(/style="line-height: normal;"/gi,"");F=F.replace(/<li><\/li>/gi,"");F=F.replace(/<li> <\/li>/gi,"");F=F.replace(/<li>  <\/li>/gi,"");F=F.replace(/<div><\/div>/gi,"");F=F.replace(/<div> <\/div>/gi,"");}return F;},filter_internals:function(F){F=F.replace(/\r/g,"");F=F.replace(/<\/?(body|head|html)[^>]*>/gi,"");F=F.replace(/<YUI_BR><\/li>/gi,"</li>");F=F.replace(/yui-tag-span/gi,"");F=F.replace(/yui-tag/gi,"");F=F.replace(/yui-non/gi,"");F=F.replace(/yui-img/gi,"");F=F.replace(/ tag="span"/gi,"");F=F.replace(/ class=""/gi,"");F=F.replace(/ style=""/gi,"");F=F.replace(/ class=" "/gi,"");F=F.replace(/ class="  "/gi,"");F=F.replace(/ target=""/gi,"");F=F.replace(/ title=""/gi,"");if(this.browser.ie){F=F.replace(/ class= /gi,"");
+F=F.replace(/ class= >/gi,"");F=F.replace(/_height="([^>])"/gi,"");F=F.replace(/_width="([^>])"/gi,"");}return F;},filter_all_rgb:function(J){var I=new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)","gi");var F=J.match(I);if(D.isArray(F)){for(var H=0;H<F.length;H++){var G=this.filter_rgb(F[H]);J=J.replace(F[H].toString(),G);}}return J;},filter_rgb:function(H){if(H.toLowerCase().indexOf("rgb")!=-1){var K=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var G=H.replace(K,"$1,$2,$3,$4,$5").split(",");if(G.length==5){var J=parseInt(G[1],10).toString(16);var I=parseInt(G[2],10).toString(16);var F=parseInt(G[3],10).toString(16);J=J.length==1?"0"+J:J;I=I.length==1?"0"+I:I;F=F.length==1?"0"+F:F;H="#"+J+I+F;}}return H;},pre_filter_linebreaks:function(G,F){if(this.browser.webkit){G=G.replace(/<br class="khtml-block-placeholder">/gi,"<YUI_BR>");G=G.replace(/<br class="webkit-block-placeholder">/gi,"<YUI_BR>");}G=G.replace(/<br>/gi,"<YUI_BR>");G=G.replace(/<br (.*?)>/gi,"<YUI_BR>");G=G.replace(/<br\/>/gi,"<YUI_BR>");G=G.replace(/<br \/>/gi,"<YUI_BR>");G=G.replace(/<div><YUI_BR><\/div>/gi,"<YUI_BR>");G=G.replace(/<p>(&nbsp;|&#160;)<\/p>/g,"<YUI_BR>");G=G.replace(/<p><br>&nbsp;<\/p>/gi,"<YUI_BR>");G=G.replace(/<p>&nbsp;<\/p>/gi,"<YUI_BR>");G=G.replace(/<YUI_BR>$/,"");G=G.replace(/<YUI_BR><\/p>/g,"</p>");return G;},post_filter_linebreaks:function(G,F){if(F=="xhtml"){G=G.replace(/<YUI_BR>/g,"<br />");}else{G=G.replace(/<YUI_BR>/g,"<br>");}return G;},clearEditorDoc:function(){this._getDoc().body.innerHTML="&nbsp;";},_renderPanel:function(){},openWindow:function(F){},moveWindow:function(){},_closeWindow:function(){},closeWindow:function(){this.unsubscribeAll("afterExecCommand");this.toolbar.resetAllButtons();this._focusWindow();},destroy:function(){this.saveHTML();this.toolbar.destroy();this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");var G=this.get("element");this.get("element_cont").get("parentNode").replaceChild(G,this.get("element_cont").get("element"));this.get("element_cont").get("element").innerHTML="";this.set("handleSubmit",false);for(var F in this){if(D.hasOwnProperty(this,F)){this[F]=null;}}return true;},toString:function(){var F="SimpleEditor";if(this.get&&this.get("element_cont")){F="SimpleEditor (#"+this.get("element_cont").get("id")+")"+((this.get("disabled")?" Disabled":""));}return F;}});YAHOO.widget.EditorInfo={_instances:{},window:{},panel:null,getEditorById:function(F){if(!YAHOO.lang.isString(F)){F=F.id;}if(this._instances[F]){return this._instances[F];}return false;},toString:function(){var F=0;for(var G in this._instances){F++;}return"Editor Info ("+F+" registered intance"+((F>1)?"s":"")+")";}};})();YAHOO.register("simpleeditor",YAHOO.widget.SimpleEditor,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/editor/simpleeditor-beta.js b/lib/yui/editor/simpleeditor-beta.js
new file mode 100644 (file)
index 0000000..d3f49a7
--- /dev/null
@@ -0,0 +1,6158 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+    /**
+     * @description <p>Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButtonAdvanced
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event, container_core, menu, button
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    if (YAHOO.widget.Button) {
+        YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button;
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich';
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) {
+            var _menuItems = this.getMenu().getItems();
+            if (_menuItems.length === 0) {
+                this.getMenu()._onBeforeShow();
+                _menuItems = this.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }      
+        };
+    } else {
+        YAHOO.widget.ToolbarButtonAdvanced = function() {};
+    }
+
+
+    /**
+     * @description <p>Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar</p>
+     * @class ToolbarButton
+     * @namespace YAHOO.widget
+     * @requires yahoo, dom, element, event
+     * @Extends YAHOO.util.Element
+     * @beta
+     * 
+     * Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a button.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    YAHOO.widget.ToolbarButton = function(el, attrs) {
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+
+        if (!oConfig.attributes.type) {
+            oConfig.attributes.type = 'push';
+        }
+        
+        oConfig.element = document.createElement('span');
+        oConfig.element.setAttribute('unselectable', 'on');
+        oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button';
+        oConfig.element.innerHTML = '<span class="first-child"><a href="#">LABEL</a></span>';
+        oConfig.attributes.id = Dom.generateId();
+
+        YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, {
+        /**
+        * @property buttonType
+        * @private
+        * @description Tells if the Button is a Rich Button or a Simple Button
+        */
+        buttonType: 'normal',
+        /**
+        * @method _handleMouseOver
+        * @private
+        * @description Adds classes to the button elements on mouseover (hover)
+        */
+        _handleMouseOver: function() {
+            if (!this.get('disabled')) {
+                this.addClass('yui-button-hover');
+                this.addClass('yui-' + this.get('type') + '-button-hover');
+            }
+        },
+        /**
+        * @method _handleMouseOut
+        * @private
+        * @description Removes classes from the button elements on mouseout (hover)
+        */
+        _handleMouseOut: function() {
+            this.removeClass('yui-button-hover');
+            this.removeClass('yui-' + this.get('type') + '-button-hover');
+        },
+        /**
+        * @method checkValue
+        * @param {String} value The value of the option that we want to mark as selected
+        * @description Select an option by value
+        */
+        checkValue: function(value) {
+            if (this.get('type') == 'menu') {
+                var opts = this._button.options;
+                for (var i = 0; i < opts.length; i++) {
+                    if (opts[i].value == value) {
+                        opts.selectedIndex = i;
+                    }
+                }
+            }
+        },
+        /** 
+        * @method init
+        * @description The ToolbarButton class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.on('mouseover', this._handleMouseOver, this, true);
+            this.on('mouseout', this._handleMouseOut, this, true);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */        
+        initAttributes: function(attr) {
+            YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute value
+            * @description The value of the button
+            * @type String
+            */            
+            this.setAttributeConfig('value', {
+                value: attr.value
+            });
+            /**
+            * @attribute menu
+            * @description The menu attribute, see YAHOO.widget.Button
+            * @type Object
+            */            
+            this.setAttributeConfig('menu', {
+                value: attr.menu || false
+            });
+            /**
+            * @attribute type
+            * @description The type of button to create: push, menu, color, select, spin
+            * @type String
+            */            
+            this.setAttributeConfig('type', {
+                value: attr.type,
+                writeOnce: true,
+                method: function(type) {
+                    var el, opt;
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    switch (type) {
+                        case 'select':
+                        case 'menu':
+                            el = document.createElement('select');
+                            var menu = this.get('menu');
+                            for (var i = 0; i < menu.length; i++) {
+                                opt = document.createElement('option');
+                                opt.innerHTML = menu[i].text;
+                                opt.value = menu[i].value;
+                                if (menu[i].checked) {
+                                    opt.selected = true;
+                                }
+                                el.appendChild(opt);
+                            }
+                            this._button.parentNode.replaceChild(el, this._button);
+                            Event.on(el, 'change', this._handleSelect, this, true);
+                            this._button = el;
+                            break;
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Set the button into a disabled state
+            * @type String
+            */            
+            this.setAttributeConfig('disabled', {
+                value: attr.disabled || false,
+                method: function(disabled) {
+                    if (disabled) {
+                        this.addClass('yui-button-disabled');
+                        this.addClass('yui-' + this.get('type') + '-button-disabled');
+                    } else {
+                        this.removeClass('yui-button-disabled');
+                        this.removeClass('yui-' + this.get('type') + '-button-disabled');
+                    }
+                    if (this.get('type') == 'menu') {
+                        this._button.disabled = disabled;
+                    }
+                }
+            });
+
+            /**
+            * @attribute label
+            * @description The text label for the button
+            * @type String
+            */            
+            this.setAttributeConfig('label', {
+                value: attr.label,
+                method: function(label) {
+                    if (!this._button) {
+                        this._button = this.get('element').getElementsByTagName('a')[0];
+                    }
+                    if (this.get('type') == 'push') {
+                        this._button.innerHTML = label;
+                    }
+                }
+            });
+
+            /**
+            * @attribute title
+            * @description The title of the button
+            * @type String
+            */            
+            this.setAttributeConfig('title', {
+                value: attr.title
+            });
+
+            /**
+            * @config container
+            * @description The container that the button is rendered to, handled by Toolbar
+            * @type String
+            */            
+            this.setAttributeConfig('container', {
+                value: null,
+                writeOnce: true,
+                method: function(cont) {
+                    this.appendTo(cont);
+                }
+            });
+
+        },
+        /** 
+        * @private
+        * @method _handleSelect
+        * @description The event fired when a change event gets fired on a select element
+        * @param {Event} ev The change event.
+        */        
+        _handleSelect: function(ev) {
+            var tar = Event.getTarget(ev);
+            var value = tar.options[tar.selectedIndex].value;
+            this.fireEvent('change', {type: 'change', value: value });
+        },
+        /** 
+        * @method getMenu
+        * @description A stub function to mimic YAHOO.widget.Button's getMenu method
+        */        
+        getMenu: function() {
+            return this.get('menu');
+        },
+        /** 
+        * @method fireEvent
+        * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled.
+        */        
+        fireEvent: function (p_sType , p_aArgs) {
+            //  Disabled buttons should not respond to DOM events
+            if (this.DOM_EVENTS[p_sType] && this.get('disabled')) {
+                return;
+            }
+        
+            YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs);
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */        
+        toString: function() {
+            return 'ToolbarButton (' + this.get('id') + ')';
+        }
+        
+    });
+})();
+/**
+ * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbarbutton
+ * @optional container_core, dragdrop
+ * @beta
+ */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * Provides a rich toolbar widget based on the button and menu widgets
+     * @constructor
+     * @class Toolbar
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The element to turn into a toolbar.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    YAHOO.widget.Toolbar = function(el, attrs) {
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        };
+        
+        
+        if (Lang.isString(el) && Dom.get(el)) {
+            oConfig.element = Dom.get(el);
+        } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) {  
+            oConfig.element = Dom.get(el);
+        }
+        
+
+        if (!oConfig.element) {
+            oConfig.element = document.createElement('DIV');
+            oConfig.element.id = Dom.generateId();
+            
+            if (local_attrs.container && Dom.get(local_attrs.container)) {
+                Dom.get(local_attrs.container).appendChild(oConfig.element);
+            }
+        }
+        
+
+        if (!oConfig.element.id) {
+            oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId());
+        }
+        
+        var cont = document.createElement('DIV');
+        oConfig.attributes.cont = cont;
+        Dom.addClass(cont, 'yui-toolbar-subcont');
+        oConfig.element.appendChild(cont);
+        
+        oConfig.attributes.element = oConfig.element;
+        oConfig.attributes.id = oConfig.element.id;
+
+        YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+         
+    };
+
+    /**
+    * @method _addMenuClasses
+    * @private
+    * @description This method is called from Menu's renderEvent to add a few more classes to the menu items
+    * @param {String} ev The event that fired.
+    * @param {Array} na Array of event information.
+    * @param {Object} o Button config object. 
+    */
+
+    function _addMenuClasses(ev, na, o) {
+        Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu');
+        if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) {
+            Dom.addClass(this.element, 'yui-toolbar-select-menu');
+        }
+        var items = this.getItems();
+        for (var i = 0; i < items.length; i++) {
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
+        }
+    }
+
+    YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property buttonType
+        * @description The default button to use
+        * @type Object
+        */
+        buttonType: YAHOO.widget.ToolbarButton,
+        /** 
+        * @property dd
+        * @description The DragDrop instance associated with the Toolbar
+        * @type Object
+        */
+        dd: null,
+        /** 
+        * @property _colorData
+        * @description Object reference containing colors hex and text values.
+        * @type Object
+        */
+        _colorData: {
+/* {{{ _colorData */
+    '#111111': 'Obsidian',
+    '#2D2D2D': 'Dark Gray',
+    '#434343': 'Shale',
+    '#5B5B5B': 'Flint',
+    '#737373': 'Gray',
+    '#8B8B8B': 'Concrete',
+    '#A2A2A2': 'Gray',
+    '#B9B9B9': 'Titanium',
+    '#000000': 'Black',
+    '#D0D0D0': 'Light Gray',
+    '#E6E6E6': 'Silver',
+    '#FFFFFF': 'White',
+    '#BFBF00': 'Pumpkin',
+    '#FFFF00': 'Yellow',
+    '#FFFF40': 'Banana',
+    '#FFFF80': 'Pale Yellow',
+    '#FFFFBF': 'Butter',
+    '#525330': 'Raw Siena',
+    '#898A49': 'Mildew',
+    '#AEA945': 'Olive',
+    '#7F7F00': 'Paprika',
+    '#C3BE71': 'Earth',
+    '#E0DCAA': 'Khaki',
+    '#FCFAE1': 'Cream',
+    '#60BF00': 'Cactus',
+    '#80FF00': 'Chartreuse',
+    '#A0FF40': 'Green',
+    '#C0FF80': 'Pale Lime',
+    '#DFFFBF': 'Light Mint',
+    '#3B5738': 'Green',
+    '#668F5A': 'Lime Gray',
+    '#7F9757': 'Yellow',
+    '#407F00': 'Clover',
+    '#8A9B55': 'Pistachio',
+    '#B7C296': 'Light Jade',
+    '#E6EBD5': 'Breakwater',
+    '#00BF00': 'Spring Frost',
+    '#00FF80': 'Pastel Green',
+    '#40FFA0': 'Light Emerald',
+    '#80FFC0': 'Sea Foam',
+    '#BFFFDF': 'Sea Mist',
+    '#033D21': 'Dark Forrest',
+    '#438059': 'Moss',
+    '#7FA37C': 'Medium Green',
+    '#007F40': 'Pine',
+    '#8DAE94': 'Yellow Gray Green',
+    '#ACC6B5': 'Aqua Lung',
+    '#DDEBE2': 'Sea Vapor',
+    '#00BFBF': 'Fog',
+    '#00FFFF': 'Cyan',
+    '#40FFFF': 'Turquoise Blue',
+    '#80FFFF': 'Light Aqua',
+    '#BFFFFF': 'Pale Cyan',
+    '#033D3D': 'Dark Teal',
+    '#347D7E': 'Gray Turquoise',
+    '#609A9F': 'Green Blue',
+    '#007F7F': 'Seaweed',
+    '#96BDC4': 'Green Gray',
+    '#B5D1D7': 'Soapstone',
+    '#E2F1F4': 'Light Turquoise',
+    '#0060BF': 'Summer Sky',
+    '#0080FF': 'Sky Blue',
+    '#40A0FF': 'Electric Blue',
+    '#80C0FF': 'Light Azure',
+    '#BFDFFF': 'Ice Blue',
+    '#1B2C48': 'Navy',
+    '#385376': 'Biscay',
+    '#57708F': 'Dusty Blue',
+    '#00407F': 'Sea Blue',
+    '#7792AC': 'Sky Blue Gray',
+    '#A8BED1': 'Morning Sky',
+    '#DEEBF6': 'Vapor',
+    '#0000BF': 'Deep Blue',
+    '#0000FF': 'Blue',
+    '#4040FF': 'Cerulean Blue',
+    '#8080FF': 'Evening Blue',
+    '#BFBFFF': 'Light Blue',
+    '#212143': 'Deep Indigo',
+    '#373E68': 'Sea Blue',
+    '#444F75': 'Night Blue',
+    '#00007F': 'Indigo Blue',
+    '#585E82': 'Dockside',
+    '#8687A4': 'Blue Gray',
+    '#D2D1E1': 'Light Blue Gray',
+    '#6000BF': 'Neon Violet',
+    '#8000FF': 'Blue Violet',
+    '#A040FF': 'Violet Purple',
+    '#C080FF': 'Violet Dusk',
+    '#DFBFFF': 'Pale Lavender',
+    '#302449': 'Cool Shale',
+    '#54466F': 'Dark Indigo',
+    '#655A7F': 'Dark Violet',
+    '#40007F': 'Violet',
+    '#726284': 'Smoky Violet',
+    '#9E8FA9': 'Slate Gray',
+    '#DCD1DF': 'Violet White',
+    '#BF00BF': 'Royal Violet',
+    '#FF00FF': 'Fuchsia',
+    '#FF40FF': 'Magenta',
+    '#FF80FF': 'Orchid',
+    '#FFBFFF': 'Pale Magenta',
+    '#4A234A': 'Dark Purple',
+    '#794A72': 'Medium Purple',
+    '#936386': 'Cool Granite',
+    '#7F007F': 'Purple',
+    '#9D7292': 'Purple Moon',
+    '#C0A0B6': 'Pale Purple',
+    '#ECDAE5': 'Pink Cloud',
+    '#BF005F': 'Hot Pink',
+    '#FF007F': 'Deep Pink',
+    '#FF409F': 'Grape',
+    '#FF80BF': 'Electric Pink',
+    '#FFBFDF': 'Pink',
+    '#451528': 'Purple Red',
+    '#823857': 'Purple Dino',
+    '#A94A76': 'Purple Gray',
+    '#7F003F': 'Rose',
+    '#BC6F95': 'Antique Mauve',
+    '#D8A5BB': 'Cool Marble',
+    '#F7DDE9': 'Pink Granite',
+    '#C00000': 'Apple',
+    '#FF0000': 'Fire Truck',
+    '#FF4040': 'Pale Red',
+    '#FF8080': 'Salmon',
+    '#FFC0C0': 'Warm Pink',
+    '#441415': 'Sepia',
+    '#82393C': 'Rust',
+    '#AA4D4E': 'Brick',
+    '#800000': 'Brick Red',
+    '#BC6E6E': 'Mauve',
+    '#D8A3A4': 'Shrimp Pink',
+    '#F8DDDD': 'Shell Pink',
+    '#BF5F00': 'Dark Orange',
+    '#FF7F00': 'Orange',
+    '#FF9F40': 'Grapefruit',
+    '#FFBF80': 'Canteloupe',
+    '#FFDFBF': 'Wax',
+    '#482C1B': 'Dark Brick',
+    '#855A40': 'Dirt',
+    '#B27C51': 'Tan',
+    '#7F3F00': 'Nutmeg',
+    '#C49B71': 'Mustard',
+    '#E1C4A8': 'Pale Tan',
+    '#FDEEE0': 'Marble'
+/* }}} */
+        },
+        /** 
+        * @property _colorPicker
+        * @description The HTML Element containing the colorPicker
+        * @type HTMLElement
+        */
+        _colorPicker: null,
+        /** 
+        * @property STR_COLLAPSE
+        * @description String for Toolbar Collapse Button
+        * @type String
+        */
+        STR_COLLAPSE: 'Collapse Toolbar',
+        /** 
+        * @property STR_SPIN_LABEL
+        * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute
+        * @type String
+        */
+        STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',
+        /** 
+        * @property STR_SPIN_UP
+        * @description String for spinbutton up
+        * @type String
+        */
+        STR_SPIN_UP: 'Click to increase the value of this input',
+        /** 
+        * @property STR_SPIN_DOWN
+        * @description String for spinbutton down
+        * @type String
+        */
+        STR_SPIN_DOWN: 'Click to decrease the value of this input',
+        /** 
+        * @property _titlebar
+        * @description Object reference to the titlebar
+        * @type HTMLElement
+        */
+        _titlebar: null,
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /**
+        * @protected
+        * @property _buttonList
+        * @description Internal property list of current buttons in the toolbar
+        * @type Array
+        */
+        _buttonList: null,
+        /**
+        * @protected
+        * @property _buttonGroupList
+        * @description Internal property list of current button groups in the toolbar
+        * @type Array
+        */
+        _buttonGroupList: null,
+        /**
+        * @protected
+        * @property _sep
+        * @description Internal reference to the separator HTML Element for cloning
+        * @type HTMLElement
+        */
+        _sep: null,
+        /**
+        * @protected
+        * @property _sepCount
+        * @description Internal refernce for counting separators, so we can give them a useful class name for styling
+        * @type Number
+        */
+        _sepCount: null,
+        /**
+        * @protected
+        * @property draghandle
+        * @type HTMLElement
+        */
+        _dragHandle: null,
+        /**
+        * @protected
+        * @property _toolbarConfigs
+        * @type Object
+        */
+        _toolbarConfigs: {
+            renderer: true
+        },
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the toolbar container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-toolbar-container',
+        /**
+        * @protected
+        * @property CLASS_DRAGHANDLE
+        * @description Default CSS class to apply to the toolbar's drag handle element
+        * @type String
+        */
+        CLASS_DRAGHANDLE: 'yui-toolbar-draghandle',
+        /**
+        * @protected
+        * @property CLASS_SEPARATOR
+        * @description Default CSS class to apply to all separators in the toolbar
+        * @type String
+        */
+        CLASS_SEPARATOR: 'yui-toolbar-separator',
+        /**
+        * @protected
+        * @property CLASS_DISABLED
+        * @description Default CSS class to apply when the toolbar is disabled
+        * @type String
+        */
+        CLASS_DISABLED: 'yui-toolbar-disabled',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-toolbar',
+        /** 
+        * @method init
+        * @description The Toolbar class's initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
+            this.addClass(this.CLASS_CONTAINER);
+
+            /**
+            * @attribute buttonType
+            * @description The buttonType to use (advanced or basic)
+            * @type String
+            */
+            this.setAttributeConfig('buttonType', {
+                value: attr.buttonType || 'basic',
+                writeOnce: true,
+                validator: function(type) {
+                    switch (type) {
+                        case 'advanced':
+                        case 'basic':
+                            return true;
+                    }
+                    return false;
+                },
+                method: function(type) {
+                    if (type == 'advanced') {
+                        if (YAHOO.widget.Button) {
+                            this.buttonType = YAHOO.widget.ToolbarButtonAdvanced;
+                        } else {
+                            this.buttonType = YAHOO.widget.ToolbarButton;
+                        }
+                    } else {
+                        this.buttonType = YAHOO.widget.ToolbarButton;
+                    }
+                }
+            });
+
+
+            /**
+            * @attribute buttons
+            * @description Object specifying the buttons to include in the toolbar
+            * Example:
+            * <code><pre>
+            * {
+            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
+            *   { type: 'separator' },
+            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
+            *       menu: [
+            *           { text: "Left", value: 'alignleft' },
+            *           { text: "Center", value: 'aligncenter' },
+            *           { text: "Right", value: 'alignright' }
+            *       ]
+            *   }
+            * }
+            * </pre></code>
+            * @type Array
+            */
+            
+            this.setAttributeConfig('buttons', {
+                value: [],
+                writeOnce: true,
+                method: function(data) {
+                    for (var i in data) {
+                        if (Lang.hasOwnProperty(data, i)) {
+                            if (data[i].type == 'separator') {
+                                this.addSeparator();
+                            } else if (data[i].group !== undefined) {
+                                this.addButtonGroup(data[i]);
+                            } else {
+                                this.addButton(data[i]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute disabled
+            * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (this.get('disabled') === disabled) {
+                        return false;
+                    }
+                    if (disabled) {
+                        this.addClass(this.CLASS_DISABLED);
+                        this.set('draggable', false);
+                        this.disableAllButtons();
+                    } else {
+                        this.removeClass(this.CLASS_DISABLED);
+                        if (this._configs.draggable._initialConfig.value) {
+                            //Draggable by default, set it back
+                            this.set('draggable', true);
+                        }
+                        this.resetAllButtons();
+                    }
+                }
+            });
+
+            /**
+            * @config cont
+            * @description The container for the toolbar.
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('cont', {
+                value: attr.cont,
+                readOnly: true
+            });
+
+
+            /**
+            * @attribute grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('grouplabels', {
+                value: ((attr.grouplabels === false) ? false : true),
+                method: function(grouplabels) {
+                    if (grouplabels) {
+                        Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    } else {
+                        Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels'));
+                    }
+                }
+            });
+            /**
+            * @attribute titlebar
+            * @description Boolean indicating if the toolbar should have a titlebar. If
+            * passed a string, it will use that as the titlebar text
+            * @default false
+            * @type Boolean or String
+            */
+            this.setAttributeConfig('titlebar', {
+                value: false,
+                method: function(titlebar) {
+                    if (titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                        this._titlebar = document.createElement('DIV');
+                        Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar');
+                        if (Lang.isString(titlebar)) {
+                            var h2 = document.createElement('h2');
+                            h2.tabIndex = '-1';
+                            h2.innerHTML = titlebar;
+                            this._titlebar.appendChild(h2);
+                        }
+                        if (this.get('firstChild')) {
+                            this.insertBefore(this._titlebar, this.get('firstChild'));
+                        } else {
+                            this.appendChild(this._titlebar);
+                        }
+                        if (this.get('collapse')) {
+                            this.set('collapse', true);
+                        }
+                    } else if (this._titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                    }
+                }
+            });
+
+
+            /**
+            * @attribute collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false,
+                method: function(collapse) {
+                    if (this._titlebar) {
+                        var collapseEl = null;
+                        var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                        if (collapse) {
+                            if (el.length > 0) {
+                                //There is already a collapse button
+                                return true;
+                            }
+                            collapseEl = document.createElement('SPAN');
+                            collapseEl.innerHTML = 'X';
+                            collapseEl.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapseEl, 'collapse');
+                            this._titlebar.appendChild(collapseEl);
+                            Event.addListener(collapseEl, 'click', function() {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    this.collapse(false); //Expand Toolbar
+                                } else {
+                                    this.collapse(); //Collapse Toolbar
+                                }
+                            }, this, true);
+                        } else {
+                            collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+                            if (collapseEl[0]) {
+                                if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) {
+                                    //We are closed, reopen the titlebar..
+                                    this.collapse(false); //Expand Toolbar
+                                }
+                                collapseEl[0].parentNode.removeChild(collapseEl[0]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute draggable
+            * @description Boolean indicating if the toolbar should be draggable.  
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('draggable', {
+                value: (attr.draggable || false),
+                method: function(draggable) {
+                    if (draggable && !this.get('titlebar')) {
+                        if (!this._dragHandle) {
+                            this._dragHandle = document.createElement('SPAN');
+                            this._dragHandle.innerHTML = '|';
+                            this._dragHandle.setAttribute('title', 'Click to drag the toolbar');
+                            this._dragHandle.id = this.get('id') + '_draghandle';
+                            Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE);
+                            if (this.get('cont').hasChildNodes()) {
+                                this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild);
+                            } else {
+                                this.get('cont').appendChild(this._dragHandle);
+                            }
+                            /**
+                            * @property dd
+                            * @description The DragDrop instance associated with the Toolbar
+                            * @type Object
+                            */
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._dragHandle.id);
+                            
+                        }
+                    } else {
+                        if (this._dragHandle) {
+                            this._dragHandle.parentNode.removeChild(this._dragHandle);
+                            this._dragHandle = null;
+                            this.dd = null;
+                        }
+                    }
+                    if (this._titlebar) {
+                        if (draggable) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        } else {
+                            Dom.removeClass(this._titlebar, 'draggable');
+                            if (this.dd) {
+                                this.dd.unreg();
+                                this.dd = null;
+                            }
+                        }
+                    }
+                },
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.DD) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+
+        },
+        /**
+        * @method addButtonGroup
+        * @description Add a new button group to the toolbar. (uses addButton)
+        * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs)
+        */
+        addButtonGroup: function(oGroup) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButtonGroup', arguments];
+                return false;
+            }
+            
+            if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) {
+                this.addClass(this.CLASS_PREFIX + '-grouped');
+            }
+            var div = document.createElement('DIV');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
+            //if (oGroup.label && this.get('grouplabels')) {
+            if (oGroup.label) {
+                var label = document.createElement('h3');
+                label.innerHTML = oGroup.label;
+                div.appendChild(label);
+            }
+            if (!this.get('grouplabels')) {
+                Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels');
+            }
+
+            this.get('cont').appendChild(div);
+
+            //For accessibility, let's put all of the group buttons in an Unordered List
+            var ul = document.createElement('ul');
+            div.appendChild(ul);
+
+            if (!this._buttonGroupList) {
+                this._buttonGroupList = {};
+            }
+            
+            this._buttonGroupList[oGroup.group] = ul;
+
+            for (var i = 0; i < oGroup.buttons.length; i++) {
+                var li = document.createElement('li');
+                li.className = this.CLASS_PREFIX + '-groupitem';
+                ul.appendChild(li);
+                if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') {
+                    this.addSeparator(li);
+                } else {
+                    oGroup.buttons[i].container = li;
+                    this.addButton(oGroup.buttons[i]);
+                }
+            }
+        },
+        /**
+        * @method addButtonToGroup
+        * @description Add a new button to a toolbar group. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {String} group The Group identifier passed into the initial config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButtonToGroup: function(oButton, group, after) {
+            var groupCont = this._buttonGroupList[group];
+            var li = document.createElement('li');
+            li.className = this.CLASS_PREFIX + '-groupitem';
+            oButton.container = li;
+            this.addButton(oButton, after);
+            groupCont.appendChild(li);
+        },
+        /**
+        * @method addButton
+        * @description Add a new button to the toolbar. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButton: function(oButton, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButton', arguments];
+                return false;
+            }
+            if (!this._buttonList) {
+                this._buttonList = [];
+            }
+            if (!oButton.container) {
+                oButton.container = this.get('cont');
+            }
+
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    for (var i in oButton.menu) {
+                        if (Lang.hasOwnProperty(oButton.menu, i)) {
+                            var funcObject = {
+                                fn: function(ev, x, oMenu) {
+                                    if (!oButton.menucmd) {
+                                        oButton.menucmd = oButton.value;
+                                    }
+                                    oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                },
+                                scope: this
+                            };
+                            oButton.menu[i].onclick = funcObject;
+                        }
+                    }
+                }
+            }
+            var _oButton = {}, skip = false;
+            for (var o in oButton) {
+                if (Lang.hasOwnProperty(oButton, o)) {
+                    if (!this._toolbarConfigs[o]) {
+                        _oButton[o] = oButton[o];
+                    }
+                }
+            }
+            if (oButton.type == 'select') {
+                _oButton.type = 'menu';
+            }
+            if (oButton.type == 'spin') {
+                _oButton.type = 'push';
+            }
+            if (_oButton.type == 'color') {
+                if (YAHOO.widget.Overlay) {
+                    _oButton = this._makeColorButton(_oButton);
+                } else {
+                    skip = true;
+                }
+            }
+            if (_oButton.menu) {
+                if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) {
+                    oButton.menu.showEvent.subscribe(function() {
+                        this._button = _oButton;
+                    });
+                } else {
+                    for (var m = 0; m < _oButton.menu.length; m++) {
+                        if (!_oButton.menu[m].value) {
+                            _oButton.menu[m].value = _oButton.menu[m].text;
+                        }
+                    }
+                    if (this.browser.webkit) {
+                        _oButton.focusmenu = false;
+                    }
+                }
+            }
+            if (skip) {
+                oButton = false;
+            } else {
+                //Add to .get('buttons') manually
+                this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+                
+                var tmp = new this.buttonType(_oButton);
+                if (!tmp.buttonType) {
+                    tmp.buttonType = 'rich';
+                    tmp.checkValue = function(value) {
+                        var _menuItems = this.getMenu().getItems();
+                        if (_menuItems.length === 0) {
+                            this.getMenu()._onBeforeShow();
+                            _menuItems = this.getMenu().getItems();
+                        }
+                        for (var i = 0; i < _menuItems.length; i++) {
+                            _menuItems[i].cfg.setProperty('checked', false);
+                            if (_menuItems[i].value == value) {
+                                _menuItems[i].cfg.setProperty('checked', true);
+                            }
+                        }      
+                    };
+                }
+                
+                if (this.get('disabled')) {
+                    //Toolbar is disabled, disable the new button too!
+                    tmp.set('disabled', true);
+                }
+                if (!oButton.id) {
+                    oButton.id = tmp.get('id');
+                }
+                
+                if (after) {
+                    var el = tmp.get('element');
+                    var nextSib = null;
+                    if (after.get) {
+                        nextSib = after.get('element').nextSibling;
+                    } else if (after.nextSibling) {
+                        nextSib = after.nextSibling;
+                    }
+                    if (nextSib) {
+                        nextSib.parentNode.insertBefore(el, nextSib);
+                    }
+                }
+                tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+
+                var icon = document.createElement('span');
+                icon.className = this.CLASS_PREFIX + '-icon';
+                tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+                if (tmp._button.tagName.toLowerCase() == 'button') {
+                    tmp.get('element').setAttribute('unselectable', 'on');
+                    //Replace the Button HTML Element with an a href if it exists
+                    var a = document.createElement('a');
+                    a.innerHTML = tmp._button.innerHTML;
+                    a.href = '#';
+                    Event.on(a, 'click', function(ev) {
+                        Event.stopEvent(ev);
+                    });
+                    tmp._button.parentNode.replaceChild(a, tmp._button);
+                    tmp._button = a;
+                }
+
+                if (oButton.type == 'select') {
+                    if (tmp._button.tagName.toLowerCase() == 'select') {
+                        icon.parentNode.removeChild(icon);
+                        var iel = tmp._button;
+                        var parEl = tmp.get('element');
+                        parEl.parentNode.replaceChild(iel, parEl);
+                    } else {
+                        //Don't put a class on it if it's a real select element
+                        tmp.addClass(this.CLASS_PREFIX + '-select');
+                    }
+                }
+                if (oButton.type == 'spin') {
+                    if (!Lang.isArray(oButton.range)) {
+                        oButton.range = [ 10, 100 ];
+                    }
+                    this._makeSpinButton(tmp, oButton);
+                }
+                tmp.get('element').setAttribute('title', tmp.get('label'));
+                if (oButton.type != 'spin') {
+                    if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) {
+                        var showPicker = function(ev) {
+                            var exec = true;
+                            if (ev.keyCode && (ev.keyCode == 9)) {
+                                exec = false;
+                            }
+                            if (exec) {
+                                if (this._colorPicker) {
+                                    this._colorPicker._button = oButton.value;
+                                }
+                                var menuEL = tmp.getMenu().element;
+                                if (Dom.getStyle(menuEL, 'visibility') == 'hidden') {
+                                    tmp.getMenu().show();
+                                } else {
+                                    tmp.getMenu().hide();
+                                }
+                            }
+                            YAHOO.util.Event.stopEvent(ev);
+                        };
+                        tmp.on('mousedown', showPicker, oButton, this);
+                        tmp.on('keydown', showPicker, oButton, this);
+                        
+                    } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                        tmp.on('keypress', this._buttonClick, oButton, this);
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                            this._buttonClick(ev, oButton);
+                        }, oButton, this);
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                    } else {
+                        //Stop the mousedown event so we can trap the selection in the editor!
+                        tmp.on('mousedown', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('click', function(ev) {
+                            YAHOO.util.Event.stopEvent(ev);
+                        });
+                        tmp.on('change', function(ev) {
+                            if (!oButton.menucmd) {
+                                oButton.menucmd = oButton.value;
+                            }
+                            oButton.value = ev.value;
+                            this._buttonClick(ev, oButton);
+                        }, this, true);
+
+                        var self = this;
+                        //Hijack the mousedown event in the menu and make it fire a button click..
+                        if (tmp.getMenu().mouseDownEvent) {
+                            tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                                var oMenu = args[1];
+                                YAHOO.util.Event.stopEvent(args[0]);
+                                tmp._onMenuClick(args[0], tmp);
+                                if (!oButton.menucmd) {
+                                    oButton.menucmd = oButton.value;
+                                }
+                                oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                self._buttonClick.call(self, args[1], oButton);
+                                tmp._hideMenu();
+                                return false;
+                            });
+                            tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                            tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) {
+                                YAHOO.util.Event.stopEvent(args[0]);
+                            });
+                        }
+                        
+                    }
+                } else {
+                    //Stop the mousedown event so we can trap the selection in the editor!
+                    tmp.on('mousedown', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                }
+                if (this.browser.ie) {
+                    //Add a couple of new events for IE
+                    tmp.DOM_EVENTS.focusin = true;
+                    tmp.DOM_EVENTS.focusout = true;
+                    
+                    //Stop them so we don't loose focus in the Editor
+                    tmp.on('focusin', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    
+                    tmp.on('focusout', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                }
+                if (this.browser.webkit) {
+                    //This will keep the document from gaining focus and the editor from loosing it..
+                    //Forcefully remove the focus calls in button!
+                    tmp.hasFocus = function() {
+                        return true;
+                    };
+                }
+                this._buttonList[this._buttonList.length] = tmp;
+                if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                    if (Lang.isArray(oButton.menu)) {
+                        var menu = tmp.getMenu();
+                        if (menu.renderEvent) {
+                            menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                            if (oButton.renderer) {
+                                menu.renderEvent.subscribe(oButton.renderer, tmp);
+                            }
+                        }
+                    }
+                }
+            }
+            return oButton;
+        },
+        /**
+        * @method addSeparator
+        * @description Add a new button separator to the toolbar.
+        * @param {HTMLElement} cont Optional HTML element to insert this button into.
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addSeparator: function(cont, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            var sepCont = ((cont) ? cont : this.get('cont'));
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            if (this._sepCount === null) {
+                this._sepCount = 0;
+            }
+            if (!this._sep) {
+                this._sep = document.createElement('SPAN');
+                Dom.addClass(this._sep, this.CLASS_SEPARATOR);
+                this._sep.innerHTML = '|';
+            }
+            var _sep = this._sep.cloneNode(true);
+            this._sepCount++;
+            Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount);
+            if (after) {
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                } else {
+                    nextSib = after;
+                }
+                if (nextSib) {
+                    if (nextSib == after) {
+                        nextSib.parentNode.appendChild(_sep);
+                    } else {
+                        nextSib.parentNode.insertBefore(_sep, nextSib);
+                    }
+                }
+            } else {
+                sepCont.appendChild(_sep);
+            }
+            return _sep;
+        },
+        /**
+        * @method _createColorPicker
+        * @private
+        * @description Creates the core DOM reference to the color picker menu item.
+        * @param {String} id the id of the toolbar to prefix this DOM container with.
+        */
+        _createColorPicker: function(id) {
+            if (Dom.get(id + '_colors')) {
+               Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors'));
+            }
+            var picker = document.createElement('div');
+            picker.className = 'yui-toolbar-colors';
+            picker.id = id + '_colors';
+            picker.style.display = 'none';
+            Event.on(window, 'load', function() {
+                document.body.appendChild(picker);
+            }, this, true);
+
+            this._colorPicker = picker;
+
+            var html = '';
+            for (var i in this._colorData) {
+                if (Lang.hasOwnProperty(this._colorData, i)) {
+                    html += '<a style="background-color: ' + i + '" href="#">' + i.replace('#', '') + '</a>';
+                }
+            }
+            html += '<span><em>X</em><strong></strong></span>';
+            window.setTimeout(function() {
+                picker.innerHTML = html;
+            }, 0);
+
+            Event.on(picker, 'mouseover', function(ev) {
+                var picker = this._colorPicker;
+                var em = picker.getElementsByTagName('em')[0];
+                var strong = picker.getElementsByTagName('strong')[0];
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    em.style.backgroundColor = tar.style.backgroundColor;
+                    strong.innerHTML = this._colorData['#' + tar.innerHTML] + '<br>' + tar.innerHTML;
+                }
+            }, this, true);
+            Event.on(picker, 'focus', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    if (retVal !== false) {
+                        var info = {
+                            color: tar.innerHTML,
+                            colorName: this._colorData['#' + tar.innerHTML],
+                            value: this._colorPicker._button 
+                        };
+                    
+                        this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                    }
+                    this.getButtonByValue(this._colorPicker._button).getMenu().hide();
+                }
+            }, this, true);
+        },
+        /**
+        * @method _resetColorPicker
+        * @private
+        * @description Clears the currently selected color or mouseover color in the color picker.
+        */
+        _resetColorPicker: function() {
+            var em = this._colorPicker.getElementsByTagName('em')[0];
+            var strong = this._colorPicker.getElementsByTagName('strong')[0];
+            em.style.backgroundColor = 'transparent';
+            strong.innerHTML = '';
+        },
+        /**
+        * @method _makeColorButton
+        * @private
+        * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
+        * @param {Object} _oButton <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
+        */
+        _makeColorButton: function(_oButton) {
+            if (!this._colorPicker) {   
+                this._createColorPicker(this.get('id'));
+            }
+            _oButton.type = 'color';
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true });
+            _oButton.menu.setBody('');
+            _oButton.menu.render(this.get('cont'));
+            Dom.addClass(_oButton.menu.element, 'yui-button-menu');
+            Dom.addClass(_oButton.menu.element, 'yui-color-button-menu');
+            _oButton.menu.beforeShowEvent.subscribe(function() {
+                _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
+                _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
+                //Move the DOM reference of the color picker to the Overlay that we are about to show.
+                this._resetColorPicker();
+                var _p = this._colorPicker;
+                if (_p.parentNode) {
+                    _p.parentNode.removeChild(_p);
+                }
+                _oButton.menu.setBody('');
+                _oButton.menu.appendToBody(_p);
+                this._colorPicker.style.display = 'block';
+            }, this, true);
+            return _oButton;
+        },
+        /**
+        * @private
+        * @method _makeSpinButton
+        * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
+        * @param {Object} _button <a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> reference
+        * @param {Object} oButton Object literal containing the buttons initial config
+        */
+        _makeSpinButton: function(_button, oButton) {
+            _button.addClass(this.CLASS_PREFIX + '-spinbutton');
+            var self = this,
+                _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child
+                range = oButton.range,
+                _b1 = document.createElement('a'),
+                _b2 = document.createElement('a');
+                _b1.href = '#';
+                _b2.href = '#';
+            
+            //Setup the up and down arrows
+            _b1.className = 'up';
+            _b1.title = this.STR_SPIN_UP;
+            _b1.innerHTML = this.STR_SPIN_UP;
+            _b2.className = 'down';
+            _b2.title = this.STR_SPIN_DOWN;
+            _b2.innerHTML = this.STR_SPIN_DOWN;
+
+            //Append them to the container
+            _par.appendChild(_b1);
+            _par.appendChild(_b2);
+            
+            var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') });
+            _button.set('title', label);
+
+            var cleanVal = function(value) {
+                value = ((value < range[0]) ? range[0] : value);
+                value = ((value > range[1]) ? range[1] : value);
+                return value;
+            };
+
+            var br = this.browser;
+            var tbar = false;
+            var strLabel = this.STR_SPIN_LABEL;
+            if (this._titlebar && this._titlebar.firstChild) {
+                tbar = this._titlebar.firstChild;
+            }
+            
+            var _intUp = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'), 10);
+                    value++;
+                    value = cleanVal(value);
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intDown = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'), 10);
+                    value--;
+                    value = cleanVal(value);
+
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intKeyUp = function(ev) {
+                if (ev.keyCode == 38) {
+                    _intUp(ev);
+                } else if (ev.keyCode == 40) {
+                    _intDown(ev);
+                } else if (ev.keyCode == 107 && ev.shiftKey) {  //Plus Key
+                    _intUp(ev);
+                } else if (ev.keyCode == 109 && ev.shiftKey) {  //Minus Key
+                    _intDown(ev);
+                }
+            };
+
+            //Handle arrow keys..
+            _button.on('keydown', _intKeyUp, this, true);
+
+            //Listen for the click on the up button and act on it
+            //Listen for the click on the down button and act on it
+            Event.on(_b1, 'mousedown',function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b2, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b1, 'click', _intUp, this, true);
+            Event.on(_b2, 'click', _intDown, this, true);
+        },
+        /**
+        * @protected
+        * @method _buttonClick
+        * @description Click handler for all buttons in the toolbar.
+        * @param {String} ev The event that was passed in.
+        * @param {Object} info Object literal of information about the button that was clicked.
+        */
+        _buttonClick: function(ev, info) {
+            var doEvent = true;
+            
+            if (ev && ev.type == 'keypress') {
+                if (ev.keyCode == 9) {
+                    doEvent = false;
+                } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) {
+                } else {
+                    doEvent = false;
+                }
+            }
+
+            if (doEvent) {
+                var fireNextEvent = true,
+                    retValue = false;
+                if (info.value) {
+                    retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                
+                if (info.menucmd && fireNextEvent) {
+                    retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                    if (retValue === false) {
+                        fireNextEvent = false;
+                    }
+                }
+                if (fireNextEvent) {
+                    this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+                }
+
+                if (info.type == 'select') {
+                    var button = this.getButtonById(info.id);
+                    if (button.buttonType == 'rich') {
+                        var txt = info.value;
+                        for (var i = 0; i < info.menu.length; i++) {
+                            if (info.menu[i].value == info.value) {
+                                txt = info.menu[i].text;
+                                break;
+                            }
+                        }
+                        button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                                _items[m].cfg.setProperty('checked', true);
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
+                        }
+                    }
+                }
+            }
+            if (ev) {
+                Event.stopEvent(ev);
+            }
+        },
+        /**
+        * @method getButtonById
+        * @description Gets a button instance from the toolbar by is Dom id.
+        * @param {String} id The Dom id to query for.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
+        */
+        getButtonById: function(id) {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                if (this._buttonList[i].get('id') == id) {
+                    return this._buttonList[i];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByValue
+        * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
+        * @param {String} value The button value to query for.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        */
+        getButtonByValue: function(value) {
+            var _buttons = this.get('buttons');
+            var len = _buttons.length;
+            for (var i = 0; i < len; i++) {
+                if (_buttons[i].group !== undefined) {
+                    for (var m = 0; m < _buttons[i].buttons.length; m++) {
+                        if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
+                            return this.getButtonById(_buttons[i].buttons[m].id);
+                        }
+                        if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values
+                            for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) {
+                                if (_buttons[i].buttons[m].menu[s].value == value) {
+                                    return this.getButtonById(_buttons[i].buttons[m].id);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) {
+                        return this.getButtonById(_buttons[i].id);
+                    }
+                    if (_buttons[i].menu) { //Menu Button, loop through the values
+                        for (var j = 0; j < _buttons[i].menu.length; j++) {
+                            if (_buttons[i].menu[j].value == value) {
+                                return this.getButtonById(_buttons[i].id);
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByIndex
+        * @description Gets a button instance from the toolbar by is index in _buttonList.
+        * @param {Number} index The index of the button in _buttonList.
+        * @return {<a href="YAHOO.widget.ToolbarButton.html">YAHOO.widget.ToolbarButton</a>}
+        */
+        getButtonByIndex: function(index) {
+            if (this._buttonList[index]) {
+                return this._buttonList[index];
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method getButtons
+        * @description Returns an array of buttons in the current toolbar
+        * @return {Array}
+        */
+        getButtons: function() {
+            return this._buttonList;
+        },
+        /**
+        * @method disableButton
+        * @description Disables a button in the toolbar.
+        * @param {String/Number} id Disable a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        disableButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                button.set('disabled', true);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method enableButton
+        * @description Enables a button in the toolbar.
+        * @param {String/Number} id Enable a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        enableButton: function(id) {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                if (button.get('disabled')) {
+                    button.set('disabled', false);
+                }
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method selectButton
+        * @description Selects a button in the toolbar.
+        * @param {String/Number} id Select a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        selectButton: function(id, value) {
+            var button = id;
+            if (id) {
+                if (Lang.isString(id)) {
+                    button = this.getButtonById(id);
+                }
+                if (Lang.isNumber(id)) {
+                    button = this.getButtonByIndex(id);
+                }
+                if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                    button = this.getButtonByValue(id);
+                }
+                if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                    button.addClass('yui-button-selected');
+                    button.addClass('yui-button-' + button.get('value') + '-selected');
+                    if (value) {
+                        if (button.buttonType == 'rich') {
+                            var _items = button.getMenu().getItems();
+                            for (var m = 0; m < _items.length; m++) {
+                                if (_items[m].value == value) {
+                                    _items[m].cfg.setProperty('checked', true);
+                                    button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                                } else {
+                                    _items[m].cfg.setProperty('checked', false);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        /**
+        * @method deselectButton
+        * @description Deselects a button in the toolbar.
+        * @param {String/Number} id Deselect a button by it's id, index or value.
+        * @return {Boolean}
+        */
+        deselectButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                button.removeClass('yui-button-selected');
+                button.removeClass('yui-button-' + button.get('value') + '-selected');
+                button.removeClass('yui-button-hover');
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method deselectAllButtons
+        * @description Deselects all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        deselectAllButtons: function() {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.deselectButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method disableAllButtons
+        * @description Disables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        disableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.disableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method enableAllButtons
+        * @description Enables all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        enableAllButtons: function() {
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.enableButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method resetAllButtons
+        * @description Resets all buttons to their initial state.
+        * @param {Object} _ex Except these buttons
+        * @return {Boolean}
+        */
+        resetAllButtons: function(_ex) {
+            if (!Lang.isObject(_ex)) {
+                _ex = {};
+            }
+            if (this.get('disabled')) {
+                return false;
+            }
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                var _button = this._buttonList[i];
+                var disabled = _button._configs.disabled._initialConfig.value;
+                if (_ex[_button.get('id')]) {
+                    this.enableButton(_button);
+                    this.selectButton(_button);
+                } else {
+                    if (disabled) {
+                        this.disableButton(_button);
+                    } else {
+                        this.enableButton(_button);
+                    }
+                    this.deselectButton(_button);
+                }
+            }
+        },
+        /**
+        * @method destroyButton
+        * @description Destroy a button in the toolbar.
+        * @param {String/Number} id Destroy a button by it's id or index.
+        * @return {Boolean}
+        */
+        destroyButton: function(id) {
+            var button = id;
+            if (Lang.isString(id)) {
+                button = this.getButtonById(id);
+            }
+            if (Lang.isNumber(id)) {
+                button = this.getButtonByIndex(id);
+            }
+            if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) {
+                button = this.getButtonByValue(id);
+            }
+            if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) {
+                var thisID = button.get('id');
+                button.destroy();
+
+                var len = this._buttonList.length;
+                for (var i = 0; i < len; i++) {
+                    if (this._buttonList[i].get('id') == thisID) {
+                        this._buttonList[i] = null;
+                    }
+                }
+            } else {
+                return false;
+            }
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the toolbar, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.get('element').innerHTML = '';
+            this.get('element').className = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },
+        /**
+        * @method collapse
+        * @description Programatically collapse the toolbar.
+        * @param {Boolean} collapse True to collapse, false to expand.
+        */
+        collapse: function(collapse) {
+            var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar);
+            if (collapse === false) {
+                Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                if (el[0]) {
+                    Dom.removeClass(el[0], 'collapsed');
+                }
+                this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+            } else {
+                if (el[0]) {
+                    Dom.addClass(el[0], 'collapsed');
+                }
+                Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed');
+                this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+            }
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.';
+        }
+    });
+/**
+* @event buttonClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event valueClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description This is a special dynamic event that is created and dispatched based on the value property
+* of the button config. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* Example:
+* <code><pre>
+* buttons : [
+*   { type: 'button', value: 'test', value: 'testButton' }
+* ]</pre>
+* </code>
+* With the valueClick event you could subscribe to this buttons click event with this:
+* tbar.in('testButtonClick', function() { alert('test button clicked'); })
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarExpanded
+* @description Fires when the toolbar is expanded via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarCollapsed
+* @description Fires when the toolbar is collapsed via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+})();
+/**
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbar
+ * @optional animation, container_core
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    Toolbar = YAHOO.widget.Toolbar;
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class SimpleEditor
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.SimpleEditor = function(el, attrs) {
+        
+        var o = {};
+        if (Lang.isObject(el) && (!el.tagName) && !attrs) {
+            Lang.augmentObject(o, el); //Break the config reference
+            el = document.createElement('textarea');
+            this.DOMReady = true;
+            if (o.container) {
+                var c = Dom.get(o.container);
+                c.appendChild(el);
+            } else {
+                document.body.appendChild(el);
+            }
+        } else {
+            Lang.augmentObject(o, attrs); //Break the config reference
+        }
+
+        var oConfig = {
+            element: null,
+            attributes: o
+        }, id = null;
+
+        if (Lang.isString(el)) {
+            id = el;
+        } else {
+            if (oConfig.attributes.id) {
+                id = oConfig.attributes.id;
+            } else {
+                id = Dom.generateId(el);
+            }
+        }
+        oConfig.element = el;
+
+        var element_cont = document.createElement('DIV');
+        oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
+            id: id + '_container'
+        });
+        var div = document.createElement('div');
+        Dom.addClass(div, 'first-child');
+        oConfig.attributes.element_cont.appendChild(div);
+        
+        if (!oConfig.attributes.toolbar_cont) {
+            oConfig.attributes.toolbar_cont = document.createElement('DIV');
+            oConfig.attributes.toolbar_cont.id = id + '_toolbar';
+            div.appendChild(oConfig.attributes.toolbar_cont);
+        }
+        var editorWrapper = document.createElement('DIV');
+        div.appendChild(editorWrapper);
+        oConfig.attributes.editor_wrapper = editorWrapper;
+
+        YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    };
+
+    /**
+    * @private
+    * @method _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @return {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+
+    YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, {
+        /**
+        * @property _docType
+        * @description The DOCTYPE to use in the editable container.
+        * @type String
+        */
+        _docType: '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',
+        /**
+        * @property editorDirty
+        * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed.
+        * @type Boolean
+        */
+        editorDirty: null,
+        /**
+        * @property _defaultCSS
+        * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' }
+        * @type String
+        */
+        _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }',
+        /**
+        * @property _defaultToolbar
+        * @private
+        * @description Default toolbar config.
+        * @type Object
+        */
+        _defaultToolbar: null,
+        /**
+        * @property _lastButton
+        * @private
+        * @description The last button pressed, so we don't disable it.
+        * @type Object
+        */
+        _lastButton: null,
+        /**
+        * @property _baseHREF
+        * @private
+        * @description The base location of the editable page (this page) so that relative paths for image work.
+        * @type String
+        */
+        _baseHREF: function() {
+            var href = document.location.href;
+            if (href.indexOf('?') !== -1) { //Remove the query string
+                href = href.substring(0, href.indexOf('?'));
+            }
+            href = href.substring(0, href.lastIndexOf('/')) + '/';
+            return href;
+        }(),
+        /**
+        * @property _lastImage
+        * @private
+        * @description Safari reference for the last image selected (for styling as selected).
+        * @type HTMLElement
+        */
+        _lastImage: null,
+        /**
+        * @property _blankImageLoaded
+        * @private
+        * @description Don't load the blank image more than once..
+        * @type Boolean
+        */
+        _blankImageLoaded: null,
+        /**
+        * @property _fixNodesTimer
+        * @private
+        * @description Holder for the fixNodes timer
+        * @type Date
+        */
+        _fixNodesTimer: null,
+        /**
+        * @property _nodeChangeTimer
+        * @private
+        * @description Holds a reference to the nodeChange setTimeout call
+        * @type Number
+        */
+        _nodeChangeTimer: null,
+        /**
+        * @property _lastNodeChangeEvent
+        * @private
+        * @description Flag to determine the last event that fired a node change
+        * @type Event
+        */
+        _lastNodeChangeEvent: null,
+        /**
+        * @property _lastNodeChange
+        * @private
+        * @description Flag to determine when the last node change was fired
+        * @type Date
+        */
+        _lastNodeChange: 0,
+        /**
+        * @property _rendered
+        * @private
+        * @description Flag to determine if editor has been rendered or not
+        * @type Boolean
+        */
+        _rendered: null,
+        /**
+        * @property DOMReady
+        * @private
+        * @description Flag to determine if DOM is ready or not
+        * @type Boolean
+        */
+        DOMReady: null,
+        /**
+        * @property _selection
+        * @private
+        * @description Holder for caching iframe selections
+        * @type Object
+        */
+        _selection: null,
+        /**
+        * @property _mask
+        * @private
+        * @description DOM Element holder for the editor Mask when disabled
+        * @type Object
+        */
+        _mask: null,
+        /**
+        * @property _showingHiddenElements
+        * @private
+        * @description Status of the hidden elements button
+        * @type Boolean
+        */
+        _showingHiddenElements: null,
+        /**
+        * @property currentWindow
+        * @description A reference to the currently open EditorWindow
+        * @type Object
+        */
+        currentWindow: null,
+        /**
+        * @property currentEvent
+        * @description A reference to the current editor event
+        * @type Event
+        */
+        currentEvent: null,
+        /**
+        * @property operaEvent
+        * @private
+        * @description setTimeout holder for Opera and Image DoubleClick event..
+        * @type Object
+        */
+        operaEvent: null,
+        /**
+        * @property currentFont
+        * @description A reference to the last font selected from the Toolbar
+        * @type HTMLElement
+        */
+        currentFont: null,
+        /**
+        * @property currentElement
+        * @description A reference to the current working element in the editor
+        * @type Array
+        */
+        currentElement: null,
+        /**
+        * @property dompath
+        * @description A reference to the dompath container for writing the current working dom path to.
+        * @type HTMLElement
+        */
+        dompath: null,
+        /**
+        * @property beforeElement
+        * @description A reference to the H2 placed before the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        beforeElement: null,
+        /**
+        * @property afterElement
+        * @description A reference to the H2 placed after the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        afterElement: null,
+        /**
+        * @property invalidHTML
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine.
+        * @type Object
+        */
+        invalidHTML: {
+            form: true,
+            input: true,
+            button: true,
+            select: true,
+            link: true,
+            html: true,
+            body: true,
+            iframe: true,
+            script: true,
+            style: true,
+            textarea: true
+        },
+        /**
+        * @property toolbar
+        * @description Local property containing the <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a> instance
+        * @type <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>
+        */
+        toolbar: null,
+        /**
+        * @private
+        * @property _contentTimer
+        * @description setTimeout holder for documentReady check
+        */
+        _contentTimer: null,
+        /**
+        * @private
+        * @property _contentTimerCounter
+        * @description Counter to check the number of times the body is polled for before giving up
+        * @type Number
+        */
+        _contentTimerCounter: 0,
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { },
+        /**
+        * @private
+        * @property _semantic
+        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.
+        * @type Object
+        */
+        _semantic: { 'bold': true, 'italic' : true, 'underline' : true },
+        /**
+        * @private
+        * @property _tag2cmd
+        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.
+        * @type Object
+        */
+        _tag2cmd: {
+            'b': 'bold',
+            'strong': 'bold',
+            'i': 'italic',
+            'em': 'italic',
+            'u': 'underline',
+            'sup': 'superscript',
+            'sub': 'subscript',
+            'img': 'insertimage',
+            'a' : 'createlink',
+            'ul' : 'insertunorderedlist',
+            'ol' : 'insertorderedlist'
+        },
+
+        /**
+        * @private _createIframe
+        * @description Creates the DOM and YUI Element for the iFrame editor area.
+        * @param {String} id The string ID to prefix the iframe with
+        * @return {Object} iFrame object
+        */
+        _createIframe: function() {
+            var ifrmDom = document.createElement('iframe');
+            ifrmDom.id = this.get('id') + '_editor';
+            var config = {
+                border: '0',
+                frameBorder: '0',
+                marginWidth: '0',
+                marginHeight: '0',
+                leftMargin: '0',
+                topMargin: '0',
+                allowTransparency: 'true',
+                width: '100%'
+            };
+            if (this.get('autoHeight')) {
+                config.scrolling = 'no';
+            }
+            for (var i in config) {
+                if (Lang.hasOwnProperty(config, i)) {
+                    ifrmDom.setAttribute(i, config[i]);
+                }
+            }
+            var isrc = 'javascript:;';
+            if (this.browser.ie) {
+                isrc = 'about:blank';
+            }
+            ifrmDom.setAttribute('src', isrc);
+            var ifrm = new YAHOO.util.Element(ifrmDom);
+            //ifrm.setStyle('zIndex', '-1');
+            return ifrm;
+        },
+        /**
+        * @private _isElement
+        * @description Checks to see if an Element reference is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return {Boolean}
+        */
+        _isElement: function(el, tag) {
+            if (el && el.tagName && (el.tagName.toLowerCase() == tag)) {
+                return true;
+            }
+            if (el && el.getAttribute && (el.getAttribute('tag') == tag)) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private _hasParent
+        * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type
+        * @param {HTMLElement} el The element to check
+        * @param {String} tag The tag that the element needs to be
+        * @return HTMLElement
+        */
+        _hasParent: function(el, tag) {
+            if (!el || !el.parentNode) {
+                return false;
+            }
+            
+            while (el.parentNode) {
+                if (this._isElement(el, tag)) {
+                    return el;
+                }
+                if (el.parentNode) {
+                    el = el.parentNode;
+                } else {
+                    return false;
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
+        */
+        _getDoc: function() {
+            var value = false;
+            if (this.get) {
+                if (this.get('iframe')) {
+                    if (this.get('iframe').get) {
+                        if (this.get('iframe').get('element')) {
+                            try {
+                                if (this.get('iframe').get('element').contentWindow) {
+                                    if (this.get('iframe').get('element').contentWindow.document) {
+                                        value = this.get('iframe').get('element').contentWindow.document;
+                                        return value;
+                                    }
+                                }
+                            } catch (e) {}
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _getWindow
+        * @description Get the Window of the IFRAME
+        * @return {Object}
+        */
+        _getWindow: function() {
+            return this.get('iframe').get('element').contentWindow;
+        },
+        /**
+        * @private
+        * @method _focusWindow
+        * @description Attempt to set the focus of the iframes window.
+        * @param {Boolean} onLoad Safari needs some special care to set the cursor in the iframe
+        */
+        _focusWindow: function(onLoad) {
+            if (this.browser.webkit) {
+                if (onLoad) {
+                    /**
+                    * @knownissue Safari Cursor Position
+                    * @browser Safari 2.x
+                    * @description Can't get Safari to place the cursor at the beginning of the text..
+                    * This workaround at least set's the toolbar into the proper state.
+                    */
+                    this._getSelection().setBaseAndExtent(this._getDoc().body.firstChild, 0, this._getDoc().body.firstChild, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
+                } else {
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
+                    if (this.browser.webkit3) {
+                        this._getSelection().collapseToStart();
+                    } else {
+                        this._getSelection().collapse(false);
+                    }
+                }
+                this._getWindow().focus();
+            } else {
+                this._getWindow().focus();
+            }
+        },
+        /**
+        * @private
+        * @method _hasSelection
+        * @description Determines if there is a selection in the editor document.
+        * @return {Boolean}
+        */
+        _hasSelection: function() {
+            var sel = this._getSelection();
+            var range = this._getRange();
+            var hasSel = false;
+
+            if (!sel || !range) {
+                return hasSel;
+            }
+
+            //Internet Explorer
+            if (this.browser.ie || this.browser.opera) {
+                if (range.text) {
+                    hasSel = true;
+                }
+                if (range.html) {
+                    hasSel = true;
+                }
+            } else {
+                if (this.browser.webkit) {
+                    if (sel+'' !== '') {
+                        hasSel = true;
+                    }
+                } else {
+                    if (sel && (sel.toString() !== '') && (sel !== undefined)) {
+                        hasSel = true;
+                    }
+                }
+            }
+            return hasSel;
+        },
+        /**
+        * @private
+        * @method _getSelection
+        * @description Handles the different selection objects across the A-Grade list.
+        * @return {Object} Selection Object
+        */
+        _getSelection: function() {
+            var _sel = null;
+            if (this._getDoc() && this._getWindow()) {
+                if (this._getDoc().selection) {
+                    _sel = this._getDoc().selection;
+                } else {
+                    _sel = this._getWindow().getSelection();
+                }
+                //Handle Safari's lack of Selection Object
+                if (this.browser.webkit) {
+                    if (_sel.baseNode) {
+                            this._selection = {};
+                            this._selection.baseNode = _sel.baseNode;
+                            this._selection.baseOffset = _sel.baseOffset;
+                            this._selection.extentNode = _sel.extentNode;
+                            this._selection.extentOffset = _sel.extentOffset;
+                    } else if (this._selection !== null) {
+                        _sel = this._getWindow().getSelection();
+                        _sel.setBaseAndExtent(
+                            this._selection.baseNode,
+                            this._selection.baseOffset,
+                            this._selection.extentNode,
+                            this._selection.extentOffset);
+                        this._selection = null;
+                    }
+                }
+            }
+            return _sel;
+        },
+        /**
+        * @private
+        * @method _selectNode
+        * @description Places the highlight around a given node
+        * @param {HTMLElement} node The node to select
+        */
+        _selectNode: function(node) {
+            if (!node) {
+                return false;
+            }
+            var sel = this._getSelection(),
+                range = null;
+
+            if (this.browser.ie) {
+                try { //IE freaks out here sometimes..
+                    range = this._getDoc().body.createTextRange();
+                    range.moveToElementText(node);
+                    range.select();
+                } catch (e) {
+                }
+            } else if (this.browser.webkit) {
+                               sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+            } else if (this.browser.opera) {
+                sel = this._getWindow().getSelection();
+                range = this._getDoc().createRange();
+                range.selectNode(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            } else {
+                range = this._getDoc().createRange();
+                range.selectNodeContents(node);
+                sel.removeAllRanges();
+                sel.addRange(range);
+            }
+        },
+        /**
+        * @private
+        * @method _getRange
+        * @description Handles the different range objects across the A-Grade list.
+        * @return {Object} Range Object
+        */
+        _getRange: function() {
+            var sel = this._getSelection();
+
+            if (sel === null) {
+                return null;
+            }
+
+            if (this.browser.webkit && !sel.getRangeAt) {
+                var _range = this._getDoc().createRange();
+                try {
+                    _range.setStart(sel.anchorNode, sel.anchorOffset);
+                    _range.setEnd(sel.focusNode, sel.focusOffset);
+                } catch (e) {
+                    _range = this._getWindow().getSelection()+'';
+                }
+                return _range;
+            }
+
+            if (this.browser.ie || this.browser.opera) {
+                try {
+                    return sel.createRange();
+                } catch (e) {
+                    return null;
+                }
+            }
+
+            if (sel.rangeCount > 0) {
+                return sel.getRangeAt(0);
+            }
+            return null;
+        },
+        /**
+        * @private
+        * @method _setDesignMode
+        * @description Sets the designMode of the iFrame document.
+        * @param {String} state This should be either on or off
+        */
+        _setDesignMode: function(state) {
+            try {
+                var set = true;
+                //SourceForge Bug #1807057
+                if (this.browser.ie && (state.toLowerCase() == 'off')) {
+                    set = false;
+                }
+                if (set) {
+                    this._getDoc().designMode = state;
+                }
+            } catch(e) { }
+        },
+        /**
+        * @private
+        * @method _toggleDesignMode
+        * @description Toggles the designMode of the iFrame document on and off.
+        * @return {String} The state that it was set to.
+        */
+        _toggleDesignMode: function() {
+            var _dMode = this._getDoc().designMode.toLowerCase(),
+                _state = 'on';
+            if (_dMode == 'on') {
+                _state = 'off';
+            }
+            this._setDesignMode(_state);
+            return _state;
+        },
+        /**
+        * @private
+        * @method _initEditor
+        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
+        */
+        _initEditor: function() {
+            if (this.browser.ie) {
+                this._getDoc().body.style.margin = '0';
+            }
+            if (!this.get('disabled')) {
+                if (this._getDoc().designMode.toLowerCase() != 'on') {
+                    this._setDesignMode('on');
+                    this._contentTimerCounter = 0;
+                }
+            }
+            if (!this._getDoc().body) {
+                this._contentTimerCounter = 0;
+                this._checkLoaded();
+                return false;
+            }
+            
+            this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
+            //Setup Listeners on iFrame
+            Event.on(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.on(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.on(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.on(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.on(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.on(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.on(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            if (!this.get('disabled')) {
+                this.toolbar.set('disabled', false);
+            }
+            this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
+            if (this.get('dompath')) {
+                var self = this;
+                setTimeout(function() {
+                    self._writeDomPath.call(self);
+                }, 150);
+            }
+            this.nodeChange(true);
+            this._setBusy(true);
+        },
+        /**
+        * @private
+        * @method _checkLoaded
+        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.
+        */
+        _checkLoaded: function() {
+            this._contentTimerCounter++;
+            if (this._contentTimer) {
+                clearTimeout(this._contentTimer);
+            }
+            if (this._contentTimerCounter > 500) {
+                return false;
+            }
+            var init = false;
+            try {
+                if (this._getDoc() && this._getDoc().body) {
+                    if (this.browser.ie) {
+                        if (this._getDoc().body.readyState == 'complete') {
+                            init = true;
+                        }
+                    } else {
+                        if (this._getDoc().body._rteLoaded === true) {
+                            init = true;
+                        }
+                    }
+                }
+            } catch (e) {
+                init = false;
+            }
+
+            if (init === true) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
+                this._initEditor();
+            } else {
+                var self = this;
+                this._contentTimer = setTimeout(function() {
+                    self._checkLoaded.call(self);
+                }, 20);
+            }
+        },
+        /**
+        * @private
+        * @method _setInitialContent
+        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
+        */
+        _setInitialContent: function() {
+            var html = Lang.substitute(this.get('html'), {
+                TITLE: this.STR_TITLE,
+                CONTENT: this._cleanIncomingHTML(this.get('element').value),
+                CSS: this.get('css'),
+                HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'),
+                EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */')
+            }),
+            check = true;
+            if (document.compatMode != 'BackCompat') {
+                html = this._docType + "\n" + html;
+            } else {
+            }
+
+            if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) {
+                //Firefox 1.5 doesn't like setting designMode on an document created with a data url
+                try {
+                    this._getDoc().open();
+                    this._getDoc().write(html);
+                    this._getDoc().close();
+                } catch (e) {
+                    //Safari will only be here if we are hidden
+                    check = false;
+                }
+            } else {
+                //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality
+                this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html);
+            }
+            if (check) {
+                this._checkLoaded();
+            }
+        },
+        /**
+        * @private
+        * @method _setMarkupType
+        * @param {String} action The action to take. Possible values are: css, default or semantic
+        * @description This method will turn on/off the useCSS execCommand.
+        */
+        _setMarkupType: function(action) {
+            switch (this.get('markup')) {
+                case 'css':
+                    this._setEditorStyle(true);
+                    break;
+                case 'default':
+                    this._setEditorStyle(false);
+                    break;
+                case 'semantic':
+                case 'xhtml':
+                    if (this._semantic[action]) {
+                        this._setEditorStyle(false);
+                    } else {
+                        this._setEditorStyle(true);
+                    }
+                    break;
+            }
+        },
+        /**
+        * Set the editor to use CSS instead of HTML
+        * @param {Booleen} stat True/False
+        */
+        _setEditorStyle: function(stat) {
+            try {
+                this._getDoc().execCommand('useCSS', false, !stat);
+            } catch (ex) {
+            }
+        },
+        /**
+        * @private
+        * @method _getSelectedElement
+        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
+        * @return {HTMLElement} The currently selected element.
+        */
+        _getSelectedElement: function() {
+            var doc = this._getDoc(),
+                range = null,
+                sel = null,
+                elm = null;
+
+            if (this.browser.ie) {
+                this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event;
+                range = this._getRange();
+                if (range) {
+                    elm = range.item ? range.item(0) : range.parentElement();
+                    if (elm == doc.body) {
+                        elm = null;
+                    }
+                }
+                if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
+            } else {
+                sel = this._getSelection();
+                range = this._getRange();
+
+                if (!sel || !range) {
+                    return null;
+                }
+                if (!this._hasSelection()) {
+                    if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
+                        if (sel.anchorNode.parentNode) { //next check parentNode
+                            elm = sel.anchorNode.parentNode;
+                        }
+                        if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) {
+                            elm = sel.anchorNode.nextSibling;
+                        }
+                    }
+                    if (this._isElement(elm, 'br')) {
+                        elm = null;
+                    }
+                    if (!elm) {
+                        elm = range.commonAncestorContainer;
+                        if (!range.collapsed) {
+                            if (range.startContainer == range.endContainer) {
+                                if (range.startOffset - range.endOffset < 2) {
+                                    if (range.startContainer.hasChildNodes()) {
+                                        elm = range.startContainer.childNodes[range.startOffset];
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (this.currentEvent !== null) {
+                try {
+                    switch (this.currentEvent.type) {
+                        case 'click':
+                        case 'mousedown':
+                        case 'mouseup':
+                            elm = Event.getTarget(this.currentEvent);
+                            break;
+                        default:
+                            //Do nothing
+                            break;
+                    }
+                } catch (e) {
+                }
+            } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) {
+                elm = this.currentElement[0];
+            }
+            if (this.browser.opera || this.browser.webkit) {
+                if (this.currentEvent && !elm) {
+                    elm = YAHOO.util.Event.getTarget(this.currentEvent);
+                }
+            }
+            if (!elm || !elm.tagName) {
+                elm = doc.body;
+            }
+            if (this._isElement(elm, 'html')) {
+                //Safari sometimes gives us the HTML node back..
+                elm = doc.body;
+            }
+            if (this._isElement(elm, 'body')) {
+                //make sure that body means this body not the parent..
+                elm = doc.body;
+            }
+            if (elm && !elm.parentNode) { //Not in document
+                elm = doc.body;
+            }
+            if (elm === undefined) {
+                elm = null;
+            }
+            return elm;
+        },
+        /**
+        * @private
+        * @method _getDomPath
+        * @description This method will attempt to build the DOM path from the currently selected element.
+        * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used
+        * @return {Array} An array of node references that will create the DOM Path.
+        */
+        _getDomPath: function(el) {
+            if (!el) {
+                           el = this._getSelectedElement();
+            }
+                       var domPath = [];
+            while (el !== null) {
+                if (el.ownerDocument != this._getDoc()) {
+                    el = null;
+                    break;
+                }
+                //Check to see if we get el.nodeName and nodeType
+                if (el.nodeName && el.nodeType && (el.nodeType == 1)) {
+                    domPath[domPath.length] = el;
+                }
+
+                if (this._isElement(el, 'body')) {
+                    break;
+                }
+
+                el = el.parentNode;
+            }
+            if (domPath.length === 0) {
+                if (this._getDoc() && this._getDoc().body) {
+                    domPath[0] = this._getDoc().body;
+                }
+            }
+            return domPath.reverse();
+        },
+        /**
+        * @private
+        * @method _writeDomPath
+        * @description Write the current DOM path out to the dompath container below the editor.
+        */
+        _writeDomPath: function() { 
+            var path = this._getDomPath(),
+                pathArr = [],
+                classPath = '',
+                pathStr = '';
+            for (var i = 0; i < path.length; i++) {
+                var tag = path[i].tagName.toLowerCase();
+                if ((tag == 'ol') && (path[i].type)) {
+                    tag += ':' + path[i].type;
+                }
+                if (Dom.hasClass(path[i], 'yui-tag')) {
+                    tag = path[i].getAttribute('tag');
+                }
+                if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) {
+                    switch (tag) {
+                        case 'b': tag = 'strong'; break;
+                        case 'i': tag = 'em'; break;
+                    }
+                }
+                if (!Dom.hasClass(path[i], 'yui-non')) {
+                    if (Dom.hasClass(path[i], 'yui-tag')) {
+                        pathStr = tag;
+                    } else {
+                        classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
+                            classPath = '';
+                        }
+                        pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                    }
+                    switch (tag) {
+                        case 'a':
+                            if (path[i].getAttribute('href', 2)) {
+                                pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                            break;
+                        case 'img':
+                            var h = path[i].height;
+                            var w = path[i].width;
+                            if (path[i].style.height) {
+                                h = parseInt(path[i].style.height, 10);
+                            }
+                            if (path[i].style.width) {
+                                w = parseInt(path[i].style.width, 10);
+                            }
+                            pathStr += '(' + h + 'x' + w + ')';
+                        break;
+                    }
+
+                    if (pathStr.length > 10) {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr.substring(0, 10) + '...' + '</span>';
+                    } else {
+                        pathStr = '<span title="' + pathStr + '">' + pathStr + '</span>';
+                    }
+                    pathArr[pathArr.length] = pathStr;
+                }
+            }
+            var str = pathArr.join(' ' + this.SEP_DOMPATH + ' ');
+            //Prevent flickering
+            if (this.dompath.innerHTML != str) {
+                this.dompath.innerHTML = str;
+            }
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            var doc = this._getDoc(),
+                els = [];
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (v.toLowerCase() != 'span') {
+                        var tags = doc.body.getElementsByTagName(v);
+                        if (tags.length) {
+                            for (var i = 0; i < tags.length; i++) {
+                                els.push(tags[i]);
+                            }
+                        }
+                    }
+                }
+            }
+            for (var h = 0; h < els.length; h++) {
+                if (els[h].parentNode) {
+                    if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) {
+                        this._swapEl(els[h], 'span', function(el) {
+                            el.className = 'yui-non';
+                        });
+                    } else {
+                        els[h].parentNode.removeChild(els[h]);
+                    }
+                }
+            }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');   
+        },
+        /**
+        * @private
+        * @method _isNonEditable
+        * @param Event ev The Dom event being checked
+        * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied.
+        * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also
+        * disable and enable the Editor's toolbar based on the noedit state.
+        * @return Boolean
+        */
+        _isNonEditable: function(ev) {
+            if (this.get('allowNoEdit')) {
+                var el = Event.getTarget(ev);
+                if (this._isElement(el, 'html')) {
+                    el = null;
+                }
+                var path = this._getDomPath(el);
+                for (var i = (path.length - 1); i > -1; i--) {
+                    if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) {
+                        //if (this.toolbar.get('disabled') === false) {
+                        //    this.toolbar.set('disabled', true);
+                        //}
+                        try {
+                             this._getDoc().execCommand('enableObjectResizing', false, 'false');
+                        } catch (e) {}
+                        this.nodeChange();
+                        Event.stopEvent(ev);
+                        return true;
+                    }
+                }
+                //if (this.toolbar.get('disabled') === true) {
+                    //Should only happen once..
+                    //this.toolbar.set('disabled', false);
+                    try {
+                         this._getDoc().execCommand('enableObjectResizing', false, 'true');
+                    } catch (e) {}
+                //}
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _setCurrentEvent
+        * @param {Event} ev The event to cache
+        * @description Sets the current event property
+        */
+        _setCurrentEvent: function(ev) {
+            this.currentEvent = ev;
+        },
+        /**
+        * @private
+        * @method _handleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all click events inside the iFrame document.
+        */
+        _handleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this.browser.webkit) {
+                var tar =Event.getTarget(ev);
+                if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) {
+                    Event.stopEvent(ev);
+                    this.nodeChange();
+                }
+            } else {
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mouseup events inside the iFrame document.
+        */
+        _handleMouseUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            //Don't set current event for mouseup.
+            //It get's fired after a menu is closed and gives up a bogus event to work with
+            //this._setCurrentEvent(ev);
+            var self = this;
+            if (this.browser.opera) {
+                /**
+                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
+                * @browser Opera
+                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
+                */
+                var sel = Event.getTarget(ev);
+                if (this._isElement(sel, 'img')) {
+                    this.nodeChange();
+                    if (this.operaEvent) {
+                        clearTimeout(this.operaEvent);
+                        this.operaEvent = null;
+                        this._handleDoubleClick(ev);
+                    } else {
+                        this.operaEvent = window.setTimeout(function() {
+                            self.operaEvent = false;
+                        }, 700);
+                    }
+                }
+            }
+            //This will stop Safari from selecting the entire document if you select all the text in the editor
+            if (this.browser.webkit || this.browser.opera) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+            }
+            this.nodeChange();
+            this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mousedown events inside the iFrame document.
+        */
+        _handleMouseDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (this.browser.webkit && this._hasSelection()) {
+                var _sel = this._getSelection();
+                if (!this.browser.webkit3) {
+                    _sel.collapse(true);
+                } else {
+                    _sel.collapseToStart();
+                }
+            }
+            if (this.browser.webkit && this._lastImage) {
+                Dom.removeClass(this._lastImage, 'selected');
+                this._lastImage = null;
+            }
+            if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                    if (this._isElement(sel, 'img')) {
+                        Dom.addClass(sel, 'selected');
+                        this._lastImage = sel;
+                    }
+                }
+                this.nodeChange();
+            }
+            this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleDoubleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all doubleclick events inside the iFrame document.
+        */
+        _handleDoubleClick: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (this._isElement(sel, 'img')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a
+                this.currentElement[0] = this._hasParent(sel, 'a');
+                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            }
+            this.nodeChange();
+            this.editorDirty = false;
+            this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keyup events inside the iFrame document.
+        */
+        _handleKeyUp: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            switch (ev.keyCode) {
+                case 37: //Left Arrow
+                case 38: //Up Arrow
+                case 39: //Right Arrow
+                case 40: //Down Arrow
+                case 46: //Forward Delete
+                case 8: //Delete
+                case 87: //W key if window is open
+                    if ((ev.keyCode == 87) && this.currentWindow && ev.shiftKey && ev.ctrlKey) {
+                        this.closeWindow();
+                    } else {
+                        if (!this.browser.ie) {
+                            if (this._nodeChangeTimer) {
+                                clearTimeout(this._nodeChangeTimer);
+                            }
+                            var self = this;
+                            this._nodeChangeTimer = setTimeout(function() {
+                                self._nodeChangeTimer = null;
+                                self.nodeChange.call(self);
+                            }, 100);
+                        } else {
+                            this.nodeChange();
+                        }
+                        this.editorDirty = true;
+                    }
+                    break;
+            }
+            this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keypress events inside the iFrame document.
+        */
+        _handleKeyPress: function(ev) {
+            if (this.get('allowNoEdit')) {
+                if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) {
+                    //Forward delete key
+                    Event.stopEvent(ev);
+                }
+            }
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.browser.webkit) {
+                if (!this.browser.webkit3) {
+                    if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) {
+                        //This is CMD + z (for undo)
+                        if (this._hasParent(this._getSelectedElement(), 'li')) {
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+                /* This was removed because it crashes Safari 2.x in some cases
+                if (ev.keyCode && (ev.keyCode == 8)) {
+                    //Delete Key
+                    if (this._isElement(this._getSelectedElement(), 'br')) {
+                        var el = this._getSelectedElement();
+                        el.parentNode.removeChild(el);
+                    }
+                }
+                */
+                this._listFix(ev);
+            }
+            this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _listFix
+        * @param {Event} ev The event we are working on.
+        * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items.
+        */
+        _listFix: function(ev) {
+            var testLi = null, par = null, preContent = false, range = null;
+            //Enter Key
+            if (this.browser.webkit) {
+                if (ev.keyCode && (ev.keyCode == 13)) {
+                    if (this._hasParent(this._getSelectedElement(), 'li')) {
+                        var tar = this._hasParent(this._getSelectedElement(), 'li');
+                        var li = this._getDoc().createElement('li');
+                        li.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        if (tar.nextSibling) {
+                            tar.parentNode.insertBefore(li, tar.nextSibling);
+                        } else {
+                            tar.parentNode.appendChild(li);
+                        }
+                        this.currentElement[0] = li;
+                        this._selectNode(li.firstChild);
+                        if (!this.browser.webkit3) {
+                            tar.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                tar.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                        Event.stopEvent(ev);
+                    }
+                }
+            }
+            //Shift + Tab Key
+            if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) {
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    testLi = this._hasParent(testLi, 'li');
+                    if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) {
+                        par = this._hasParent(testLi, 'ul');
+                        if (!par) {
+                            par = this._hasParent(testLi, 'ol');
+                        }
+                        if (this._isElement(par.previousSibling, 'li')) {
+                            par.removeChild(testLi);
+                            par.parentNode.insertBefore(testLi, par.nextSibling);
+                            if (this.browser.ie) {
+                                range = this._getDoc().body.createTextRange();
+                                range.moveToElementText(testLi);
+                                range.collapse(false);
+                                range.select();
+                            }
+                            if (this.browser.webkit) {
+                                if (!this.browser.webkit3) {
+                                    par.style.display = 'list-item';
+                                    par.parentNode.style.display = 'list-item';
+                                    setTimeout(function() {
+                                        par.style.display = 'block';
+                                        par.parentNode.style.display = 'block';
+                                    }, 1);
+                                }
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+                }
+            }
+            //Tab Key
+            if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) {
+                var preLi = this._getSelectedElement();
+                if (this._hasParent(preLi, 'li')) {
+                    preContent = this._hasParent(preLi, 'li').innerHTML;
+                }
+                if (this.browser.webkit) {
+                    this._getDoc().execCommand('inserttext', false, '\t');
+                }
+                testLi = this._getSelectedElement();
+                if (this._hasParent(testLi, 'li')) {
+                    par = this._hasParent(testLi, 'li');
+                    var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase());
+                    if (this.browser.webkit) {
+                        var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par);
+                        //Remove the span element that Safari puts in
+                        if (span[0]) {
+                            par.removeChild(span[0]);
+                            par.innerHTML = Lang.trim(par.innerHTML);
+                            //Put the HTML from the LI into this new LI
+                            if (preContent) {
+                                par.innerHTML = '<span class="yui-non">' + preContent + '</span>&nbsp;';
+                            } else {
+                                par.innerHTML = '<span class="yui-non">&nbsp;</span>&nbsp;';
+                            }
+                        }
+                    } else {
+                        if (preContent) {
+                            par.innerHTML = preContent + '&nbsp;';
+                        } else {
+                            par.innerHTML = '&nbsp;';
+                        }
+                    }
+
+                    par.parentNode.replaceChild(newUl, par);
+                    newUl.appendChild(par);
+                    if (this.browser.webkit) {
+                        this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length);
+                        if (!this.browser.webkit3) {
+                            par.parentNode.parentNode.style.display = 'list-item';
+                            setTimeout(function() {
+                                par.parentNode.parentNode.style.display = 'block';
+                            }, 1);
+                        }
+                    } else if (this.browser.ie) {
+                        range = this._getDoc().body.createTextRange();
+                        range.moveToElementText(par);
+                        range.collapse(false);
+                        range.select();
+                    } else {
+                        this._selectNode(par);
+                    }
+                    Event.stopEvent(ev);
+                }
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            if (this._isNonEditable(ev)) {
+                return false;
+            }
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            var doExec = false,
+                action = null,
+                exec = false;
+
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
+                    }
+                    break;
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
+                    break;
+                case 76: //L
+                    if (this._hasSelection()) {
+                        if (ev.shiftKey && ev.ctrlKey) {
+                            var makeLink = true;
+                            if (this.get('limitCommands')) {
+                                if (!this.toolbar.getButtonByValue('createlink')) {
+                                    makeLink = false;
+                                }
+                            }
+                            if (makeLink) {
+                                this.execCommand('createlink', '');
+                                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                                doExec = false;
+                            }
+                        }
+                    }
+                    break;
+                case 65:
+                    if (ev.metaKey && this.browser.webkit) {
+                        Event.stopEvent(ev);
+                        //Override Safari's select all and select the contents of the editor not the iframe as Safari would by default.
+                        this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, this._getDoc().body.innerHTML.length);
+                    }
+                    break;
+                case 66: //B
+                    action = 'bold';
+                    break;
+                case 73: //I
+                    action = 'italic';
+                    break;
+                case 85: //U
+                    action = 'underline';
+                    break;
+                case 13:
+                    if (this.browser.ie) {
+                        //Insert a <br> instead of a <p></p> in Internet Explorer
+                        var _range = this._getRange();
+                        var tar = this._getSelectedElement();
+                        if (!this._isElement(tar, 'li')) {
+                            if (_range) {
+                                _range.pasteHTML('<br>');
+                                _range.collapse(false);
+                                _range.select();
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+            }
+            //if (!this.browser.gecko && !this.browser.webkit) {
+            if (this.browser.ie) {
+                this._listFix(ev);
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+            this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev });
+        },
+        /**
+        * @method nodeChange
+        * @param {Boolean} force Optional paramenter to skip the threshold counter
+        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
+        */
+        nodeChange: function(force) {
+            var threshold = parseInt(this.get('nodeChangeThreshold'), 10);
+            var thisNodeChange = Math.round(new Date().getTime() / 1000);
+            if (force === true) {
+                this._lastNodeChange = 0;
+            }
+            
+            if ((this._lastNodeChange + threshold) < thisNodeChange) {
+                var self = this;
+                if (this._fixNodesTimer === null) {
+                    this._fixNodesTimer = window.setTimeout(function() {
+                        self._fixNodes.call(self);
+                        self._fixNodesTimer = null;
+                    }, 0);
+                }
+            }
+            this._lastNodeChange = thisNodeChange;
+            if (this.currentEvent) {
+                this._lastNodeChangeEvent = this.currentEvent.type;
+            }
+
+            var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (beforeNodeChange === false) {
+                return false;
+            }
+            if (this.get('dompath')) {
+                this._writeDomPath();
+            }
+            //Check to see if we are disabled before continuing
+            if (!this.get('disabled')) {
+                if (this.STOP_NODE_CHANGE) {
+                    //Reset this var for next action
+                    this.STOP_NODE_CHANGE = false;
+                    return false;
+                } else {
+                    var sel = this._getSelection(),
+                        range = this._getRange(),
+                        el = this._getSelectedElement(),
+                        fn_button = this.toolbar.getButtonByValue('fontname'),
+                        fs_button = this.toolbar.getButtonByValue('fontsize');
+
+                    if (force !== true) {
+                        this.editorDirty = true;
+                    }
+
+                    //Handle updating the toolbar with active buttons
+                    var _ex = {};
+                    if (this._lastButton) {
+                        _ex[this._lastButton.id] = true;
+                    }
+                    if (!this._isElement(el, 'body')) {
+                        if (fn_button) {
+                            _ex[fn_button.get('id')] = true;
+                        }
+                        if (fs_button) {
+                            _ex[fs_button.get('id')] = true;
+                        }
+                    }
+                    this.toolbar.resetAllButtons(_ex);
+
+                    //Handle disabled buttons
+                    for (var d = 0; d < this._disabled.length; d++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[d]);
+                        if (_button && _button.get) {
+                            if (this._lastButton && (_button.get('id') === this._lastButton.id)) {
+                                //Skip
+                            } else {
+                                if (!this._hasSelection()) {
+                                    switch (this._disabled[d]) {
+                                        case 'fontname':
+                                        case 'fontsize':
+                                            break;
+                                        default:
+                                            //No Selection - disable
+                                            this.toolbar.disableButton(_button);
+                                    }
+                                } else {
+                                    if (!this._alwaysDisabled[this._disabled[d]]) {
+                                        this.toolbar.enableButton(_button);
+                                    }
+                                }
+                                if (!this._alwaysEnabled[this._disabled[d]]) {
+                                    this.toolbar.deselectButton(_button);
+                                }
+                            }
+                        }
+                    }
+                    var path = this._getDomPath();
+                    var tag = null, cmd = null;
+                    for (var i = 0; i < path.length; i++) {
+                        tag = path[i].tagName.toLowerCase();
+                        if (path[i].getAttribute('tag')) {
+                            tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        cmd = this._tag2cmd[tag];
+                        if (cmd === undefined) {
+                            cmd = [];
+                        }
+                        if (!Lang.isArray(cmd)) {
+                            cmd = [cmd];
+                        }
+
+                        //Bold and Italic styles
+                        if (path[i].style.fontWeight.toLowerCase() == 'bold') {
+                            cmd[cmd.length] = 'bold';
+                        }
+                        if (path[i].style.fontStyle.toLowerCase() == 'italic') {
+                            cmd[cmd.length] = 'italic';
+                        }
+                        if (path[i].style.textDecoration.toLowerCase() == 'underline') {
+                            cmd[cmd.length] = 'underline';
+                        }
+                        if (cmd.length > 0) {
+                            for (var j = 0; j < cmd.length; j++) {
+                                this.toolbar.selectButton(cmd[j]);
+                                this.toolbar.enableButton(cmd[j]);
+                            }
+                        }
+                        //Handle Alignment
+                        switch (path[i].style.textAlign.toLowerCase()) {
+                            case 'left':
+                            case 'right':
+                            case 'center':
+                            case 'justify':
+                                var alignType = path[i].style.textAlign.toLowerCase();
+                                if (path[i].style.textAlign.toLowerCase() == 'justify') {
+                                    alignType = 'full';
+                                }
+                                this.toolbar.selectButton('justify' + alignType);
+                                this.toolbar.enableButton('justify' + alignType);
+                                break;
+                        }
+                    }
+                    //After for loop
+
+                    //Reset Font Family and Size to the inital configs
+                    if (fn_button) {
+                        var family = fn_button._configs.label._initialConfig.value;
+                        fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                        this._updateMenuChecked('fontname', family);
+                    }
+
+                    if (fs_button) {
+                        fs_button.set('label', fs_button._configs.label._initialConfig.value);
+                    }
+
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        hd_button.set('label', hd_button._configs.label._initialConfig.value);
+                        this._updateMenuChecked('heading', 'none');
+                    }
+                    var img_button = this.toolbar.getButtonByValue('insertimage');
+                    if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) {
+                        this.toolbar.disableButton(img_button);
+                    }
+                }
+            }
+
+            this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this });
+        },
+        /**
+        * @private
+        * @method _updateMenuChecked
+        * @param {Object} button The command identifier of the button you want to check
+        * @param {String} value The value of the menu item you want to check
+        * @param {<a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>} The Toolbar instance the button belongs to (defaults to this.toolbar) 
+        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.
+        */
+        _updateMenuChecked: function(button, value, tbar) {
+            if (!tbar) {
+                tbar = this.toolbar;
+            }
+            var _button = tbar.getButtonByValue(button);
+            _button.checkValue(value);
+        },
+        /**
+        * @private
+        * @method _handleToolbarClick
+        * @param {Event} ev The event that triggered the button click
+        * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.
+        */
+        _handleToolbarClick: function(ev) {
+            var value = '';
+            var str = '';
+            var cmd = ev.button.value;
+            if (ev.button.menucmd) {
+                value = cmd;
+                cmd = ev.button.menucmd;
+            }
+            this._lastButton = ev.button;
+            if (this.STOP_EXEC_COMMAND) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            } else {
+                this.execCommand(cmd, value);
+                if (!this.browser.webkit) {
+                     var self = this;
+                     setTimeout(function() {
+                         self._focusWindow.call(self);
+                     }, 5);
+                 }
+            }
+            Event.stopEvent(ev);
+        },
+        /**
+        * @private
+        * @method _setupAfterElement
+        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
+        */
+        _setupAfterElement: function() {
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
+            if (!this.afterElement) {
+                this.afterElement = document.createElement('h2');
+                this.afterElement.className = 'yui-editor-skipheader';
+                this.afterElement.tabIndex = '-1';
+                this.afterElement.innerHTML = this.STR_LEAVE_EDITOR;
+                this.get('element_cont').get('firstChild').appendChild(this.afterElement);
+            }
+        },
+        /**
+        * @private
+        * @method _disableEditor
+        * @param {Boolean} disabled Pass true to disable, false to enable
+        * @description Creates a mask to place over the Editor.
+        */
+        _disableEditor: function(disabled) {
+            if (disabled) {
+                if (!this._mask) {
+                    if (!!this.browser.ie) {
+                        this._setDesignMode('off');
+                    }
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', true);
+                    }
+                    this._mask = document.createElement('DIV');
+                    Dom.setStyle(this._mask, 'height', '100%');
+                    Dom.setStyle(this._mask, 'width', '100%');
+                    Dom.setStyle(this._mask, 'position', 'absolute');
+                    Dom.setStyle(this._mask, 'top', '0');
+                    Dom.setStyle(this._mask, 'left', '0');
+                    Dom.setStyle(this._mask, 'opacity', '.5');
+                    Dom.addClass(this._mask, 'yui-editor-masked');
+                    this.get('iframe').get('parentNode').appendChild(this._mask);
+                }
+            } else {
+                if (this._mask) {
+                    this._mask.parentNode.removeChild(this._mask);
+                    this._mask = null;
+                    if (this.toolbar) {
+                        this.toolbar.set('disabled', false);
+                    }
+                    this._setDesignMode('on');
+                    this._focusWindow();
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.nodeChange.call(self);
+                    }, 100);
+                }
+            }
+        },
+        /**
+        * @property EDITOR_PANEL_ID
+        * @description HTML id to give the properties window in the DOM.
+        * @type String
+        */
+        EDITOR_PANEL_ID: 'yui-editor-panel',
+        /**
+        * @property SEP_DOMPATH
+        * @description The value to place in between the Dom path items
+        * @type String
+        */
+        SEP_DOMPATH: '<',
+        /**
+        * @property STR_LEAVE_EDITOR
+        * @description The accessibility string for the element after the iFrame
+        * @type String
+        */
+        STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.',
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control + Shift + ESC.</li></ul>',
+        /**
+        * @property STR_TITLE
+        * @description The Title of the HTML document that is created in the iFrame
+        * @type String
+        */
+        STR_TITLE: 'Rich Text Area.',
+        /**
+        * @property STR_IMAGE_HERE
+        * @description The text to place in the URL textbox when using the blankimage.
+        * @type String
+        */
+        STR_IMAGE_HERE: 'Image Url Here',
+        /**
+        * @property STR_LINK_URL
+        * @description The label string for the Link URL.
+        * @type String
+        */
+        STR_LINK_URL: 'Link URL',
+        /**
+        * @protected
+        * @property STOP_EXEC_COMMAND
+        * @description Set to true when you want the default execCommand function to not process anything
+        * @type Boolean
+        */
+        STOP_EXEC_COMMAND: false,
+        /**
+        * @protected
+        * @property STOP_NODE_CHANGE
+        * @description Set to true when you want the default nodeChange function to not process anything
+        * @type Boolean
+        */
+        STOP_NODE_CHANGE: false,
+        /**
+        * @protected
+        * @property CLASS_NOEDIT
+        * @description CSS class applied to elements that are not editable.
+        * @type String
+        */
+        CLASS_NOEDIT: 'yui-noedit',
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the editors container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-editor-container',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE
+        * @description Default CSS class to apply to the editors iframe element
+        * @type String
+        */
+        CLASS_EDITABLE: 'yui-editor-editable',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE_CONT
+        * @description Default CSS class to apply to the editors iframe's parent element
+        * @type String
+        */
+        CLASS_EDITABLE_CONT: 'yui-editor-editable-container',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-editor',
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: function() {
+            var br = YAHOO.env.ua;
+            //Check for webkit3
+            if (br.webkit > 420) {
+                br.webkit3 = br.webkit;
+            } else {
+                br.webkit3 = 0;
+            }
+            return br;
+        }(),
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+
+            if (!this._defaultToolbar) {
+                this._defaultToolbar = {
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }
+                                
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Lists',
+                            buttons: [
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                };
+            }
+
+            YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes);
+            YAHOO.widget.EditorInfo._instances[this.get('id')] = this;
+
+
+            this.currentElement = [];
+            this.on('contentReady', function() {
+                this.DOMReady = true;
+                this.fireQueue();
+            }, this, true);
+
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr);
+            var self = this;
+
+            /**
+            * @config container
+            * @description Used when dynamically creating the Editor from Javascript with no default textarea.
+            * We will create one and place it in this container. If no container is passed we will append to document.body.
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                writeOnce: true,
+                value: attr.container || false
+            });
+            /**
+            * @config plainText
+            * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('plainText', {
+                writeOnce: true,
+                value: attr.plainText || false
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('iframe', {
+                value: null
+            });
+            /**
+            * @private
+            * @depreciated
+            * @config textarea
+            * @description Internal config for holding the textarea element (replaced with element).
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('textarea', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @private
+            * @config container
+            * @description Internal config for holding a reference to the container to append a dynamic editor to.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('container', {
+                readOnly: true,
+                value: null
+            });
+            /**
+            * @config nodeChangeThreshold
+            * @description The number of seconds that need to be in between nodeChange processing
+            * @default 3
+            * @type Number
+            */            
+            this.setAttributeConfig('nodeChangeThreshold', {
+                value: attr.nodeChangeThreshold || 3,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @config allowNoEdit
+            * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes.
+            * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('allowNoEdit', {
+                value: attr.allowNoEdit || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config limitCommands
+            * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('limitCommands', {
+                value: attr.limitCommands || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('element_cont', {
+                value: attr.element_cont
+            });
+            /**
+            * @private
+            * @config editor_wrapper
+            * @description The outter wrapper for the entire editor.
+            * @default null
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('editor_wrapper', {
+                value: attr.editor_wrapper || null,
+                writeOnce: true
+            });
+            /**
+            * @attribute height
+            * @description The height of the editor iframe container, not including the toolbar..
+            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
+            * @type String
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || Dom.getStyle(self.get('element'), 'height'),
+                method: function(height) {
+                    if (this._rendered) {
+                        //We have been rendered, change the height
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), {
+                                height: {
+                                    to: parseInt(height, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height);
+                        }
+                    }
+                }
+            });
+            /**
+            * @config autoHeight
+            * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height.
+            * @default false
+            * @type Boolean || Number
+            */
+            this.setAttributeConfig('autoHeight', {
+                value: attr.autoHeight || false,
+                method: function(a) {
+                    if (a) {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'no');
+                        }
+                        this.on('afterNodeChange', this._handleAutoHeight, this, true);
+                        this.on('editorKeyDown', this._handleAutoHeight, this, true);
+                        this.on('editorKeyPress', this._handleAutoHeight, this, true);
+                    } else {
+                        if (this.get('iframe')) {
+                            this.get('iframe').get('element').setAttribute('scrolling', 'auto');
+                        }
+                        this.unsubscribe('afterNodeChange', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyDown', this._handleAutoHeight);
+                        this.unsubscribe('editorKeyPress', this._handleAutoHeight);
+                    }
+                }
+            });
+            /**
+            * @attribute width
+            * @description The width of the editor container.
+            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
+            * @type String
+            */            
+            this.setAttributeConfig('width', {
+                value: attr.width || Dom.getStyle(this.get('element'), 'width'),
+                method: function(width) {
+                    if (this._rendered) {
+                        //We have been rendered, change the width
+                        if (this.get('animate')) {
+                            var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), {
+                                width: {
+                                    to: parseInt(width, 10)
+                                }
+                            }, 0.5);
+                            anim.animate();
+                        } else {
+                            this.get('element_cont').setStyle('width', width);
+                        }
+                    }
+                }
+            });
+                        
+            /**
+            * @attribute blankimage
+            * @description The URL for the image placeholder to put in when inserting an image.
+            * @default The yahooapis.com address for the current release + 'assets/blankimage.png'
+            * @type String
+            */            
+            this.setAttributeConfig('blankimage', {
+                value: attr.blankimage || this._getBlankImage()
+            });
+            /**
+            * @attribute css
+            * @description The Base CSS used to format the content of the editor
+            * @default <code><pre>html {
+                height: 95%;
+            }
+            body {
+                height: 100%;
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            }
+            a {
+                color: blue;
+                text-decoration: underline;
+                cursor: pointer;
+            }
+            .warning-localfile {
+                border-bottom: 1px dashed red !important;
+            }
+            .yui-busy {
+                cursor: wait !important;
+            }
+            img.selected { //Safari image selection
+                border: 2px dotted #808080;
+            }
+            img {
+                cursor: pointer !important;
+                border: none;
+            }
+            </pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('css', {
+                value: attr.css || this._defaultCSS,
+                writeOnce: true
+            });
+            /**
+            * @attribute html
+            * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item)
+            * @default This HTML requires a few things if you are to override:
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
+                <code>
+                <pre>
+                &lt;html&gt;
+                    &lt;head&gt;
+                        &lt;title&gt;{TITLE}&lt;/title&gt;
+                        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
+                        &lt;style&gt;
+                        {CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {HIDDEN_CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {EXTRA_CSS}
+                        &lt;/style&gt;
+                    &lt;/head&gt;
+                &lt;body onload="document.body._rteLoaded = true;"&gt;
+                {CONTENT}
+                &lt;/body&gt;
+                &lt;/html&gt;
+                </pre>
+                </code>
+            * @type String
+            */            
+            this.setAttributeConfig('html', {
+                value: attr.html || '<html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><base href="' + this._baseHREF + '"><style>{CSS}</style><style>{HIDDEN_CSS}</style><style>{EXTRA_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute extracss
+            * @description Extra user defined css to load after the default SimpleEditor CSS
+            * @default ''
+            * @type String
+            */            
+            this.setAttributeConfig('extracss', {
+                value: attr.css || '',
+                writeOnce: true
+            });
+
+            /**
+            * @attribute handleSubmit
+            * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
+            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
+            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('handleSubmit', {
+                value: attr.handleSubmit || false,
+                method: function(exec) {
+                    if (this.get('element').form) {
+                        if (!this._formButtons) {
+                            this._formButtons = [];
+                        }
+                        if (exec) {
+                            Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true);
+                            var i = this.get('element').form.getElementsByTagName('input');
+                            for (var s = 0; s < i.length; s++) {
+                                var type = i[s].getAttribute('type');
+                                if (type && (type.toLowerCase() == 'submit')) {
+                                    Event.on(i[s], 'click', this._handleFormButtonClick, this, true);
+                                    this._formButtons[this._formButtons.length] = i[s];
+                                }
+                            }
+                        } else {
+                            Event.unsubscribe(this.get('element').form, 'submit', this._handleFormSubmit);
+                            if (this._formButtons) {
+                                Event.unsubscribe(this._formButtons, 'click', this._handleFormButtonClick);
+                            }
+                        }
+                    }
+                }
+            });
+            /**
+            * @attribute disabled
+            * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
+            All Toolbar buttons are also disabled so they cannot be used.
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (this._rendered) {
+                        this._disableEditor(disabled);
+                    }
+                }
+            });
+            /**
+            * @config toolbar_cont
+            * @description Internal config for the toolbars container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('toolbar_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @attribute toolbar
+            * @description The default toolbar config.
+            * @type Object
+            */            
+            this.setAttributeConfig('toolbar', {
+                value: attr.toolbar || this._defaultToolbar,
+                writeOnce: true,
+                method: function(toolbar) {
+                    if (!toolbar.buttonType) {
+                        toolbar.buttonType = this._defaultToolbar.buttonType;
+                    }
+                    this._defaultToolbar = toolbar;
+                }
+            });
+            /**
+            * @attribute animate
+            * @description Should the editor animate window movements
+            * @default false unless Animation is found, then true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('animate', {
+                value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false),
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+            /**
+            * @config panel
+            * @description A reference to the panel we are using for windows.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('panel', {
+                value: null,
+                writeOnce: true,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.widget.Overlay) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @attribute focusAtStart
+            * @description Should we focus the window when the content is ready?
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('focusAtStart', {
+                value: attr.focusAtStart || false,
+                writeOnce: true,
+                method: function() {
+                    this.on('editorContentLoaded', function() {
+                        var self = this;
+                        setTimeout(function() {
+                            self._focusWindow.call(self, true);
+                            self.editorDirty = false;
+                        }, 400);
+                    }, this, true);
+                }
+            });
+            /**
+            * @attribute dompath
+            * @description Toggle the display of the current Dom path below the editor
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('dompath', {
+                value: attr.dompath || false,
+                method: function(dompath) {
+                    if (dompath && !this.dompath) {
+                        this.dompath = document.createElement('DIV');
+                        this.dompath.id = this.get('id') + '_dompath';
+                        Dom.addClass(this.dompath, 'dompath');
+                        this.get('element_cont').get('firstChild').appendChild(this.dompath);
+                        if (this.get('iframe')) {
+                            this._writeDomPath();
+                        }
+                    } else if (!dompath && this.dompath) {
+                        this.dompath.parentNode.removeChild(this.dompath);
+                        this.dompath = null;
+                    }
+                }
+            });
+            /**
+            * @attribute markup
+            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml
+            * @default "semantic"
+            * @type String
+            */            
+            this.setAttributeConfig('markup', {
+                value: attr.markup || 'semantic',
+                validator: function(markup) {
+                    switch (markup.toLowerCase()) {
+                        case 'semantic':
+                        case 'css':
+                        case 'default':
+                        case 'xhtml':
+                        return true;
+                    }
+                    return false;
+                }
+            });
+            /**
+            * @attribute removeLineBreaks
+            * @description Should we remove linebreaks and extra spaces on cleanup
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('removeLineBreaks', {
+                value: attr.removeLineBreaks || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            
+
+            this.on('afterRender', function() {
+                this._renderPanel();
+            });
+        },
+        /**
+        * @private
+        * @method _getBlankImage
+        * @description Retrieves the full url of the image to use as the blank image.
+        * @return {String} The URL to the blank image
+        */
+        _getBlankImage: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['_getBlankImage', arguments];
+                return '';
+            }
+            var img = '';
+            if (!this._blankImageLoaded) {
+                var div = document.createElement('div');
+                div.style.position = 'absolute';
+                div.style.top = '-9999px';
+                div.style.left = '-9999px';
+                div.className = this.CLASS_PREFIX + '-blankimage';
+                document.body.appendChild(div);
+                img = YAHOO.util.Dom.getStyle(div, 'background-image');
+                img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+                this.set('blankimage', img);
+                this._blankImageLoaded = true;
+            } else {
+                img = this.get('blankimage');
+            }
+            return img;
+        },
+        /**
+        * @private
+        * @method _handleAutoHeight
+        * @description Handles resizing the editor's height based on the content
+        */
+        _handleAutoHeight: function() {
+            var doc = this._getDoc(),
+                body = doc.body,
+                docEl = doc.documentElement;
+
+            var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10);
+            var newHeight = body.scrollHeight;
+            if (this.browser.webkit) {
+                newHeight = docEl.scrollHeight;
+            }
+            if (newHeight < parseInt(this.get('height'), 10)) {
+                newHeight = parseInt(this.get('height'), 10);
+            }
+            if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) {   
+                Dom.setStyle(this.get('editor_wrapper'), 'height', newHeight + 'px');
+                if (this.browser.ie) {
+                    //Internet Explorer needs this
+                    this.get('iframe').setStyle('height', '99%');
+                    this.get('iframe').setStyle('zoom', '1');
+                    var self = this;
+                    window.setTimeout(function() {
+                        self.get('iframe').setStyle('height', '100%');
+                    }, 1);
+                }
+            }
+        },
+        _formButtons: null,
+        _formButtonClicked: null,
+        _handleFormButtonClick: function(ev) {
+            var tar = Event.getTarget(ev);
+            this._formButtonClicked = tar;
+        },
+        /**
+        * @private
+        * @method _handleFormSubmit
+        * @description Handles the form submission.
+        * @param {Object} ev The Form Submit Event
+        */
+        _handleFormSubmit: function(ev) {
+            Event.stopEvent(ev);
+            
+            this.saveHTML();
+            var form = this.get('element').form;
+            var tar = this._formButtonClicked || false;
+            var self = this;
+
+            window.setTimeout(function() {
+                YAHOO.util.Event.removeListener(form, 'submit', self._handleFormSubmit);
+                if (YAHOO.env.ua.ie) {
+                    form.fireEvent("onsubmit");
+                    if (tar) {
+                        tar.click();
+                    }
+                } else {  // Gecko, Opera, and Safari
+                    if (tar) {
+                        tar.click();
+                    } else {
+                        var oEvent = document.createEvent("HTMLEvents");
+                        oEvent.initEvent("submit", true, true);
+                        form.dispatchEvent(oEvent);
+                        if (YAHOO.env.ua.webkit) {
+                            if (YAHOO.lang.isFunction(form.submit)) {
+                                form.submit();
+                            }
+                        }
+                    }
+                }
+                /*
+                if (YAHOO.env.ua.ie || YAHOO.env.ua.webkit) {
+                    if (YAHOO.lang.isFunction(form.submit)) {
+                        form.submit();
+                    } else {
+                        if (YAHOO.lang.isObject(form.submit)) {
+                            form.submit.click();
+                        } else {
+                        }
+                    }
+                }
+                */
+            }, 200);
+            
+        },
+        /**
+        * @private
+        * @method _handleFontSize
+        * @description Handles the font size button in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleFontSize: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var value = button.get('label') + 'px';
+            this.execCommand('fontsize', value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @description Handles the colorpicker buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleColorPicker: function(o) {
+            var cmd = o.button;
+            var value = '#' + o.color;
+            if ((cmd == 'forecolor') || (cmd == 'backcolor')) {
+                this.execCommand(cmd, value);
+            }
+        },
+        /**
+        * @private
+        * @method _handleAlign
+        * @description Handles the alignment buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleAlign: function(o) {
+            var cmd = null;
+            for (var i = 0; i < o.button.menu.length; i++) {
+                if (o.button.menu[i].value == o.button.value) {
+                    cmd = o.button.menu[i].value;
+                }
+            }
+            var value = this._getSelection();
+
+            this.execCommand(cmd, value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleAfterNodeChange
+        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
+        */
+        _handleAfterNodeChange: function() {
+            var path = this._getDomPath(),
+                elm = null,
+                family = null,
+                fontsize = null,
+                validFont = false;
+            var fn_button = this.toolbar.getButtonByValue('fontname');
+            var fs_button = this.toolbar.getButtonByValue('fontsize');
+            var hd_button = this.toolbar.getButtonByValue('heading');
+
+            for (var i = 0; i < path.length; i++) {
+                elm = path[i];
+
+                var tag = elm.tagName.toLowerCase();
+
+
+                if (elm.getAttribute('tag')) {
+                    tag = elm.getAttribute('tag');
+                }
+
+                family = elm.getAttribute('face');
+                if (Dom.getStyle(elm, 'font-family')) {
+                    family = Dom.getStyle(elm, 'font-family');
+                }
+
+                if (tag.substring(0, 1) == 'h') {
+                    if (hd_button) {
+                        for (var h = 0; h < hd_button._configs.menu.value.length; h++) {
+                            if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[h].text);
+                            }
+                        }
+                        this._updateMenuChecked('heading', tag);
+                    }
+                }
+            }
+
+            if (fn_button) {
+                for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                    if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                        validFont = true;
+                        family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                    }
+                }
+                if (!validFont) {
+                    family = fn_button._configs.label._initialConfig.value;
+                }
+                var familyLabel = '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>';
+                if (fn_button.get('label') != familyLabel) {
+                    fn_button.set('label', familyLabel);
+                    this._updateMenuChecked('fontname', family);
+                }
+            }
+
+            if (fs_button) {
+                fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10);
+                if ((fontsize === null) || isNaN(fontsize)) {
+                    fontsize = fs_button._configs.label._initialConfig.value;
+                }
+                fs_button.set('label', ''+fontsize);
+            }
+            
+            if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) {
+                this.toolbar.enableButton(fn_button);
+                this.toolbar.enableButton(fs_button);
+                this.toolbar.enableButton('forecolor');
+                this.toolbar.enableButton('backcolor');
+            }
+            if (this._isElement(elm, 'img')) {
+                if (YAHOO.widget.Overlay) {
+                    this.toolbar.enableButton('createlink');
+                }
+            }
+            if (this._isElement(elm, 'blockquote')) {
+                this.toolbar.selectButton('indent');
+                this.toolbar.disableButton('indent');
+                this.toolbar.enableButton('outdent');
+            }
+            if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) {
+                this.toolbar.disableButton('indent');
+            }
+            this._lastButton = null;
+            
+        },
+        _setBusy: function(off) {
+            /*
+            if (off) {
+                Dom.removeClass(document.body, 'yui-busy');
+                Dom.removeClass(this._getDoc().body, 'yui-busy');
+            } else {
+                Dom.addClass(document.body, 'yui-busy');
+                Dom.addClass(this._getDoc().body, 'yui-busy');
+            }
+            */
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('insertimage')) {
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    src = 'http://';
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                        }
+                    }
+                }
+                var str = prompt(this.STR_LINK_URL + ': ', src);
+                if ((str !== '') && (str !== null)) {
+                    el.setAttribute('src', str);
+                } else if (str === null) {
+                    el.parentNode.removeChild(el);
+                    this.currentElement = [];
+                    this.nodeChange();
+                }
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            }, this, true);
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            this.nodeChange();
+        },
+        /**
+        * @private
+        * @method _isLocalFile
+        * @param {String} url THe url/string to check
+        * @description Checks to see if a string (href or img src) is possibly a local file reference..
+        */
+        _isLocalFile: function(url) {
+            if ((url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                return true;
+            }
+            return false;
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue('createlink')) {
+                    return false;
+                }
+            }
+        
+            this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    url = '';
+
+                if (el) {
+                    if (el.getAttribute('href', 2) !== null) {
+                        url = el.getAttribute('href', 2);
+                    }
+                }
+                var str = prompt(this.STR_LINK_URL + ': ', url);
+                if ((str !== '') && (str !== null)) {
+                    var urlValue = str;
+                    if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                            //Found an @ sign, prefix with mailto:
+                            urlValue = 'mailto:' + urlValue;
+                        } else {
+                            /* :// not found adding */
+                            if (urlValue.substring(0, 1) != '#') {
+                                urlValue = 'http:/'+'/' + urlValue;
+                            }
+                        }
+                    }
+                    el.setAttribute('href', urlValue);
+                } else if (str !== null) {
+                    var _span = this._getDoc().createElement('span');
+                    _span.innerHTML = el.innerHTML;
+                    Dom.addClass(_span, 'yui-non');
+                    el.parentNode.replaceChild(_span, el);
+                }
+                this.closeWindow();
+                this.toolbar.set('disabled', false);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            this.nodeChange();
+            this.currentElement = [];
+        },
+        /**
+        * @method render
+        * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load.
+        */
+        render: function() {
+            if (this._rendered) {
+                return false;
+            }
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['render', arguments];
+                return false;
+            }
+            this._rendered = true;
+            var self = this;
+            window.setTimeout(function() {
+                self._render.call(self);
+            }, 4);
+        },
+        /**
+        * @private
+        * @method _render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        _render: function() {
+            this._setBusy();
+            var self = this;
+            this.set('textarea', this.get('element'));
+
+            this.get('element_cont').setStyle('display', 'none');
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+
+            this.set('iframe', this._createIframe());
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+
+            this.get('editor_wrapper').appendChild(this.get('iframe').get('element'));
+
+            if (this.get('disabled')) {
+                this._disableEditor(true);
+            }
+
+            var tbarConf = this.get('toolbar');
+            //Create Toolbar instance
+            if (tbarConf instanceof Toolbar) {
+                this.toolbar = tbarConf;
+                //Set the toolbar to disabled until content is loaded
+                this.toolbar.set('disabled', true);
+            } else {
+                //Set the toolbar to disabled until content is loaded
+                tbarConf.disabled = true;
+                this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            }
+
+            this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
+
+            
+            this.toolbar.on('toolbarCollapsed', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('toolbarExpanded', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('fontsizeClick', function(o) {
+                this._handleFontSize(o);
+            }, this, true);
+            
+            this.toolbar.on('colorPickerClicked', function(o) {
+                this._handleColorPicker(o);
+                return false; //Stop the buttonClick event
+            }, this, true);
+
+            this.toolbar.on('alignClick', function(o) {
+                this._handleAlign(o);
+            }, this, true);
+            this.on('afterNodeChange', function() {
+                this._handleAfterNodeChange();
+            }, this, true);
+            this.toolbar.on('insertimageClick', function() {
+                this._handleInsertImageClick();
+            }, this, true);
+            this.on('windowinsertimageClose', function() {
+                this._handleInsertImageWindowClose();
+            }, this, true);
+            this.toolbar.on('createlinkClick', function() {
+                this._handleCreateLinkClick();
+            }, this, true);
+            this.on('windowcreatelinkClose', function() {
+                this._handleCreateLinkWindowClose();
+            }, this, true);
+            
+
+            //Replace Textarea with editable area
+            this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
+
+            
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            this.get('element_cont').appendChild(this.get('element'));
+            this.get('element_cont').setStyle('display', 'block');
+
+
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
+
+            //Set height and width of editor container
+            this.get('element_cont').setStyle('width', this.get('width'));
+            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
+
+            this.get('iframe').setStyle('width', '100%'); //WIDTH
+            this.get('iframe').setStyle('height', '100%');
+
+            window.setTimeout(function() {
+                self._setupAfterElement.call(self);
+            }, 0);
+            this.fireEvent('afterRender', { type: 'afterRender', target: this });
+        },
+        /**
+        * @method execCommand
+        * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml)
+        * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana'
+        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
+        */
+        execCommand: function(action, value) {
+            var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            }
+            this._setMarkupType(action);
+            if (this.browser.ie) {
+                this._getWindow().focus();
+            }
+            var exec = true;
+            
+            if (this.get('limitCommands')) {
+                if (!this.toolbar.getButtonByValue(action)) {
+                    exec = false;
+                }
+            }
+
+            this.editorDirty = true;
+            
+            if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) {
+                var retValue = this['cmd_' + action.toLowerCase()](value);
+                exec = retValue[0];
+                if (retValue[1]) {
+                    action = retValue[1];
+                }
+                if (retValue[2]) {
+                    value = retValue[2];
+                }
+            }
+            if (exec) {
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                }
+            } else {
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+    /* {{{  Command Overrides */
+
+        /**
+        * @method cmd_backcolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used.
+        */
+        cmd_backcolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement(),
+                action = 'backcolor';
+
+            if (this.browser.gecko || this.browser.opera) {
+                this._setEditorStyle(true);
+                action = 'hilitecolor';
+            }
+            /**
+            * @browser opera
+            * @knownissue - Opera fails to assign a background color on an element that already has one.
+            *
+            if (this.browser.opera) {
+                if (!this._isElement(el, 'body') && Dom.getStyle(el, 'background-color')) {
+                    Dom.setStyle(el, 'background-color', value);
+                } else {
+                    this._createCurrentElement('span', { backgroundColor: value });
+                }
+                exec = false;
+            //} else if (!this._hasSelection()) {
+            } else if (el !== this._getDoc().body) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }*/
+
+            if (!this._isElement(el, 'body')) {
+                Dom.setStyle(el, 'background-color', value);
+                this._selectNode(el);
+                exec = false;
+            } else {
+                this._createCurrentElement('span', { backgroundColor: value });
+                this._selectNode(this.currentElement[0]);
+                exec = false;
+            }
+
+            return [exec, action];
+        },
+        /**
+        * @method cmd_forecolor
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used.
+        */
+        cmd_forecolor: function(value) {
+            var exec = true,
+                el = this._getSelectedElement();
+
+                if (!this._isElement(el, 'body')) {
+                    Dom.setStyle(el, 'color', value);
+                    this._selectNode(el);
+                    exec = false;
+                } else {
+                    this._createCurrentElement('span', { color: value });
+                    this._selectNode(this.currentElement[0]);
+                    exec = false;
+                }
+                return [exec];
+        },
+        /**
+        * @method cmd_unlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used.
+        */
+        cmd_unlink: function(value) {
+            this._swapEl(this.currentElement[0], 'span', function(el) {
+                el.className = 'yui-non';
+            });
+            return [false];
+        },
+        /**
+        * @method cmd_createlink
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used.
+        */
+        cmd_createlink: function(value) {
+            var el = this._getSelectedElement(), _a = null;
+            if (this._hasParent(el, 'a')) {
+                this.currentElement[0] = this._hasParent(el, 'a');
+            } else if (!this._isElement(el, 'a')) {
+                this._createCurrentElement('a');
+                _a = this._swapEl(this.currentElement[0], 'a');
+                this.currentElement[0] = _a;
+            } else {
+                this.currentElement[0] = el;
+            }
+            return [false];
+        },
+        /**
+        * @method cmd_insertimage
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used.
+        */
+        cmd_insertimage: function(value) {
+            var exec = true, _img = null, action = 'insertimage',
+                el = this._getSelectedElement();
+
+            if (value === '') {
+                value = this.get('blankimage');
+            }
+
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            
+            if (this._isElement(el, 'img')) {
+                this.currentElement[0] = el;
+                exec = false;
+            } else {
+                if (this._getDoc().queryCommandEnabled(action)) {
+                    this._getDoc().execCommand('insertimage', false, value);
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                            YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                            this.currentElement[0] = imgs[i];
+                        }
+                    }
+                    exec = false;
+                } else {
+                    if (el == this._getDoc().body) {
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this._getDoc().body.appendChild(_img);
+                    } else {
+                        this._createCurrentElement('img');
+                        _img = this._getDoc().createElement('img');
+                        _img.setAttribute('src', value);
+                        YAHOO.util.Dom.addClass(_img, 'yui-img');
+                        this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                    }
+                    this.currentElement[0] = _img;
+                    exec = false;
+                }
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_inserthtml
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used.
+        */
+        cmd_inserthtml: function(value) {
+            var exec = true, action = 'inserthtml', _span = null, _range = null;
+            /**
+            * @knownissue
+            * @browser Safari 2.x
+            * @description The issue here is that we have no way of knowing where the cursor position is
+            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+            */
+            if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                this._createCurrentElement('img');
+                _span = this._getDoc().createElement('span');
+                _span.innerHTML = value;
+                this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                exec = false;
+            } else if (this.browser.ie) {
+                _range = this._getRange();
+                if (_range.item) {
+                    _range.item(0).outerHTML = value;
+                } else {
+                    _range.pasteHTML(value);
+                }
+                exec = false;                    
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_list
+        * @param tag The tag of the list you want to create (eg, ul or ol)
+        * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods.
+        */
+        cmd_list: function(tag) {
+            var exec = true, list = null, li = 0, el = null, str = '',
+                selEl = this._getSelectedElement(), action = 'insertorderedlist';
+                if (tag == 'ul') {
+                    action = 'insertunorderedlist';
+                }
+            /**
+            * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+            * @browser Safari 2.x
+            * The issue with this workaround is that when applied to a set of text
+            * that has BR's in it, Safari may or may not pick up the individual items as
+            * list items. This is fixed in WebKit (Safari 3)
+            */
+            if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) {
+                    el = selEl.parentNode;
+                    list = this._getDoc().createElement('span');
+                    YAHOO.util.Dom.addClass(list, 'yui-non');
+                    str = '';
+                    var lis = el.getElementsByTagName('li');
+                    for (li = 0; li < lis.length; li++) {
+                        str += '<div>' + lis[li].innerHTML + '</div>';
+                    }
+                    list.innerHTML = str;
+                    this.currentElement[0] = el;
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                } else {
+                    this._createCurrentElement(tag.toLowerCase());
+                    list = this._getDoc().createElement(tag);
+                    for (li = 0; li < this.currentElement.length; li++) {
+                        var newli = this._getDoc().createElement('li');
+                        newli.innerHTML = this.currentElement[li].innerHTML + '<span class="yui-non">&nbsp;</span>&nbsp;';
+                        list.appendChild(newli);
+                        if (li > 0) {
+                            this.currentElement[li].parentNode.removeChild(this.currentElement[li]);
+                        }
+                    }
+                    this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]);
+                    this.currentElement[0] = list;
+                    var _h = this.currentElement[0].firstChild;
+                    _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0];
+                    this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length);
+                }
+                exec = false;
+            } else {
+                el = this._getSelectedElement();
+                if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list..
+                    if (this.browser.ie) {
+                        if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) {
+                            el = el.getElementsByTagName('li')[0];
+                        }
+                        str = '';
+                        var lis2 = el.parentNode.getElementsByTagName('li');
+                        for (var j = 0; j < lis2.length; j++) {
+                            str += lis2[j].innerHTML + '<br>';
+                        }
+                        var newEl = this._getDoc().createElement('span');
+                        newEl.innerHTML = str;
+                        el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                    } else {
+                        this.nodeChange();
+                        this._getDoc().execCommand(action, '', el.parentNode);
+                        this.nodeChange();
+                    }
+                    exec = false;
+                }
+                if (this.browser.opera) {
+                    var self = this;
+                    window.setTimeout(function() {
+                        var liso = self._getDoc().getElementsByTagName('li');
+                        for (var i = 0; i < liso.length; i++) {
+                            if (liso[i].innerHTML.toLowerCase() == '<br>') {
+                                liso[i].parentNode.parentNode.removeChild(liso[i].parentNode);
+                            }
+                        }
+                    },30);
+                }
+                if (this.browser.ie && exec) {
+                    var html = '';
+                    if (this._getRange().html) {
+                        html = '<li>' + this._getRange().html+ '</li>';
+                    } else {
+                        var t = this._getRange().text.split('\n');
+                        if (t.length > 1) {
+                            html = '';
+                            for (var ie = 0; ie < t.length; ie++) {
+                                html += '<li>' + t[ie] + '</li>';
+                            }
+                        } else {
+                            html = '<li>' + this._getRange().text + '</li>';
+                        }
+                    }
+
+                    this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
+                    exec = false;
+                }
+            }
+            return exec;
+        },
+        /**
+        * @method cmd_insertorderedlist
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used.
+        */
+        cmd_insertorderedlist: function(value) {
+            return [this.cmd_list('ol')];
+        },
+        /**
+        * @method cmd_insertunorderedlist 
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used.
+        */
+        cmd_insertunorderedlist: function(value) {
+            return [this.cmd_list('ul')];
+        },
+        /**
+        * @method cmd_fontname
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used.
+        */
+        cmd_fontname: function(value) {
+            var exec = true,
+                selEl = this._getSelectedElement();
+
+            this.currentFont = value;
+            if (selEl && selEl.tagName && !this._hasSelection()) {
+                YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                exec = false;
+            }
+            return [exec];
+        },
+        /**
+        * @method cmd_fontsize
+        * @param value Value passed from the execCommand method
+        * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used.
+        */
+        cmd_fontsize: function(value) {
+            if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection())) {
+                YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+            } else if (!this._isElement(this._getSelectedElement(), 'body')) {
+                var el = this._getSelectedElement();
+                YAHOO.util.Dom.setStyle(el, 'fontSize', value);
+                this._selectNode(el);
+            } else {
+                this._createCurrentElement('span', {'fontSize': value });
+                this._selectNode(this.currentElement[0]);
+            }
+            return [false];
+        },
+    /* }}} */
+        /**
+        * @private
+        * @method _swapEl
+        * @param {HTMLElement} el The element to swap with
+        * @param {String} tagName The tagname of the element that you wish to create
+        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.
+        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place.
+        */
+        _swapEl: function(el, tagName, callback) {
+            var _el = this._getDoc().createElement(tagName);
+            _el.innerHTML = el.innerHTML;
+            if (typeof callback == 'function') {
+                callback.call(this, _el);
+            }
+            el.parentNode.replaceChild(_el, el);
+            return _el;
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for an element with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to the 
+        * <code>this.currentElement</code> array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            tagName = ((tagName) ? tagName : 'a');
+            var tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                var el = null;
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+
+                        for (var k in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, k)) {
+                                el.style[k] = tagStyle[k];
+                            }
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var j = 0; j < imgs.length; j++) {
+                        if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[j].parentNode.replaceChild(el, imgs[j]);
+                            this.currentElement[this.currentElement.length] = el;
+                        }
+                    }
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    el = _elCreate();
+                    if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) {
+                        if (this._isElement(tar, 'html')) {
+                            tar = this._getDoc().body;
+                        }
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
+                    }
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
+                    if (this.browser.webkit) {
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        if (this.browser.webkit3) {
+                            this._getSelection().collapseToStart();
+                        } else {
+                            this._getSelection().collapse(true);
+                        }
+                    }
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                var _tmp6 = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName);
+                for (var e1 = 0; e1 < _tmp1.length; e1++) {
+                    _tmp[_tmp.length] = _tmp1[e1];
+                }
+                for (var e6 = 0; e6 < _tmp6.length; e6++) {
+                    _tmp[_tmp.length] = _tmp6[e6];
+                }
+                for (var e2 = 0; e2 < _tmp2.length; e2++) {
+                    _tmp[_tmp.length] = _tmp2[e2];
+                }
+                for (var e3 = 0; e3 < _tmp3.length; e3++) {
+                    _tmp[_tmp.length] = _tmp3[e3];
+                }
+                for (var e4 = 0; e4 < _tmp4.length; e4++) {
+                    _tmp[_tmp.length] = _tmp4[e4];
+                }
+                for (var e5 = 0; e5 < _tmp5.length; e5++) {
+                    _tmp[_tmp.length] = _tmp5[e5];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) {
+                            var fc = _tmp[i].getElementsByTagName('li')[0];
+                            _tmp[i].style.fontFamily = 'inherit';
+                            fc.style.fontFamily = 'inherit';
+                            el.innerHTML = fc.innerHTML;
+                            fc.innerHTML = '';
+                            fc.appendChild(el);
+                            this.currentElement[this.currentElement.length] = el;
+                        } else if (this._isElement(_tmp[i], 'li')) {
+                            _tmp[i].innerHTML = '';
+                            _tmp[i].appendChild(el);
+                            _tmp[i].style.fontFamily = 'inherit';
+                            this.currentElement[this.currentElement.length] = el;
+                        } else {
+                            if (_tmp[i].parentNode) {
+                                _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                                this.currentElement[this.currentElement.length] = el;
+                                this.currentEvent = null;
+                                if (this.browser.webkit) {
+                                    //Force Safari to focus the new element
+                                    this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                    if (this.browser.webkit3) {
+                                        this._getSelection().collapseToStart();
+                                    } else {
+                                        this._getSelection().collapse(true);
+                                    }
+                                }
+                                if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                    this._getSelection().empty();
+                                }
+                                if (this.browser.gecko) {
+                                    this._getSelection().collapseToStart();
+                                }
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var e = 0; e < len; e++) {
+                    if ((e + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[e] && this.currentElement[e].nextSibling) {
+                            if (this._isElement(this.currentElement[e], 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[e].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        * @return String
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('element').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            html = this._cleanIncomingHTML(html);
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            var b = this._getDoc().body;
+            if (b === null) {
+                return null;
+            }
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method show
+        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.
+        */
+        show: function() {
+            if (this.browser.gecko) {
+                this._setDesignMode('on');
+                this._focusWindow();
+            }
+            if (this.browser.webkit) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._setInitialContent.call(self);
+                }, 10);
+            }
+            //Adding this will close all other Editor window's when showing this one.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            //Put the iframe back in place
+            this.get('iframe').setStyle('position', 'static');
+            this.get('iframe').setStyle('left', '');
+        },
+        /**
+        * @method hide
+        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.
+        */
+        hide: function() {
+            //Adding this will close all other Editor window's.
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            if (this._fixNodesTimer) {
+                clearTimeout(this._fixNodesTimer);
+                this._fixNodesTimer = null;
+            }
+            if (this._nodeChangeTimer) {
+                clearTimeout(this._nodeChangeTimer);
+                this._nodeChangeTimer = null;
+            }
+            this._lastNodeChange = 0;
+            //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.
+            this.get('iframe').setStyle('position', 'absolute');
+            this.get('iframe').setStyle('left', '-9999px');
+        },
+        /**
+        * @method _cleanIncomingHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the input
+        * @return {String} The filtered HTML
+        */
+        _cleanIncomingHTML: function(html) {
+            html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+            html = html.replace(/<\/strong>/gi, '</b>');   
+
+            //replace embed before em check
+            html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+            html = html.replace(/<\/embed>/gi, '</YUI_EMBED>');
+
+            html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+            html = html.replace(/<\/em>/gi, '</i>');
+            
+            //Put embed tags back in..
+            html = html.replace(/<YUI_EMBED([^>]*)>/gi, '<embed$1>');
+            html = html.replace(/<\/YUI_EMBED>/gi, '</embed>');
+            if (this.get('plainText')) {
+                html = html.replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+                html = html.replace(/  /gi, '&nbsp;&nbsp;'); //Replace all double spaces
+                html = html.replace(/\t/gi, '&nbsp;&nbsp;&nbsp;&nbsp;'); //Replace all tabs
+            }
+            //Removing Script Tags from the Editor
+            html = html.replace(/<script([^>]*)>/gi, '<bad>');
+            html = html.replace(/<\/script([^>]*)>/gi, '</bad>');
+            html = html.replace(/&lt;script([^>]*)&gt;/gi, '<bad>');
+            html = html.replace(/&lt;\/script([^>]*)&gt;/gi, '</bad>');
+            //Replace the line feeds
+            html = html.replace(/\n/g, '<YUI_LF>').replace(/\r/g, '<YUI_LF>');
+            //Remove Bad HTML elements (used to be script nodes)
+            html = html.replace(new RegExp('<bad([^>]*)>(.*?)<\/bad>', 'gi'), '');
+            //Replace the lines feeds
+            html = html.replace(/<YUI_LF>/g, '\n');
+            return html;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @return {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                html = this.getEditorHTML();
+            }
+            var markup = this.get('markup');
+            //Make some backups...
+            html = this.pre_filter_linebreaks(html, markup);
+
+                   html = html.replace(/<img([^>]*)\/>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+
+                   html = html.replace(/<input([^>]*)\/>/gi, '<YUI_INPUT$1>');
+                   html = html.replace(/<input([^>]*)>/gi, '<YUI_INPUT$1>');
+
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+                   html = html.replace(/<blockquote([^>]*)>/gi, '<YUI_BQ$1>');
+                   html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>');
+
+                   html = html.replace(/<embed([^>]*)>/gi, '<YUI_EMBED$1>');
+                   html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>');
+
+            //Convert b and i tags to strong and em tags
+            if ((markup == 'semantic') || (markup == 'xhtml')) {
+                html = html.replace(/<i(\s+[^>]*)?>/gi, '<em$1>');
+                html = html.replace(/<\/i>/gi, '</em>');
+                html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                html = html.replace(/<\/b>/gi, '</strong>');
+            }
+            
+            //Case Changing
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+            if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) {
+                html = html.replace(new RegExp('<font([^>]*)face="([^>]*)">(.*?)<\/font>', 'gi'), '<span $1 style="font-family: $2;">$3</span>');
+                html = html.replace(/<u/gi, '<span style="text-decoration: underline;"');
+                html = html.replace(/\/u>/gi, '/span>');
+                if (markup == 'css') {
+                    html = html.replace(/<em([^>]*)>/gi, '<i$1>');
+                    html = html.replace(/<\/em>/gi, '</i>');
+                    html = html.replace(/<strong([^>]*)>/gi, '<b$1>');
+                    html = html.replace(/<\/strong>/gi, '</b>');
+                    html = html.replace(/<b/gi, '<span style="font-weight: bold;"');
+                    html = html.replace(/\/b>/gi, '/span>');
+                    html = html.replace(/<i/gi, '<span style="font-style: italic;"');
+                    html = html.replace(/\/i>/gi, '/span>');
+                }
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            } else {
+                       html = html.replace(/<u/gi, '<u');
+                       html = html.replace(/\/u>/gi, '/u>');
+            }
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+            html = this.filter_safari(html);
+
+            html = this.filter_internals(html);
+
+            html = this.filter_all_rgb(html);
+
+            //Replace our backups with the real thing
+            html = this.post_filter_linebreaks(html, markup);
+
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1 />');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1 />');
+            } else {
+                       html = html.replace(/<YUI_IMG([^>]*)>/g, '<img $1>');
+                       html = html.replace(/<YUI_INPUT([^>]*)>/g, '<input $1>');
+            }
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            html = this.filter_invalid_lists(html);
+
+                   html = html.replace(/<YUI_BQ([^>]*)>/g, '<blockquote$1>');
+                   html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>');
+
+                   html = html.replace(/<YUI_EMBED([^>]*)>/g, '<embed$1>');
+                   html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>');
+
+            //Trim the output, removing whitespace from the beginning and end
+            html = YAHOO.lang.trim(html);
+
+            if (this.get('removeLineBreaks')) {
+                html = html.replace(/\n/g, '').replace(/\r/g, '');
+                html = html.replace(/  /gi, ' '); //Replace all double spaces and replace with a single
+            }
+            
+            //First empty span
+            if (html.substring(0, 6).toLowerCase() == '<span>')  {
+                html = html.substring(6);
+                //Last empty span
+                if (html.substring(html.length - 7, html.length).toLowerCase() == '</span>')  {
+                    html = html.substring(0, html.length - 7);
+                }
+            }
+
+            for (var v in this.invalidHTML) {
+                if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) {
+                    if (Lang.isObject(v) && v.keepContents) {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1');
+                    } else {
+                        html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '');
+                    }
+                }
+            }
+
+            this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html });
+
+            return html;
+        },
+        /**
+        * @method filter_invalid_lists
+        * @param String html The HTML string to filter
+        * @description Filters invalid ol and ul list markup, converts this: <li></li><ol>..</ol> to this: <li></li><li><ol>..</ol></li>
+        */
+        filter_invalid_lists: function(html) {
+            html = html.replace(/<\/li>\n/gi, '</li>');
+
+            html = html.replace(/<\/li><ol>/gi, '</li><li><ol>');
+            html = html.replace(/<\/ol>/gi, '</ol></li>');
+            html = html.replace(/<\/ol><\/li>\n/gi, "</ol>\n");
+
+            html = html.replace(/<\/li><ul>/gi, '</li><li><ul>');
+            html = html.replace(/<\/ul>/gi, '</ul></li>');
+            html = html.replace(/<\/ul><\/li>\n/gi, "</ul>\n");
+
+            html = html.replace(/<\/li>/gi, "</li>\n");
+            html = html.replace(/<\/ol>/gi, "</ol>\n");
+            html = html.replace(/<ol>/gi, "<ol>\n");
+            html = html.replace(/<ul>/gi, "<ul>\n");
+            return html;
+        },
+        /**
+        * @method filter_safari
+        * @param String html The HTML string to filter
+        * @description Filters strings specific to Safari
+        * @return String
+        */
+        filter_safari: function(html) {
+            if (this.browser.webkit) {
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+                //Remove bogus LI's
+                html = html.replace(/<li><\/li>/gi, '');
+                html = html.replace(/<li> <\/li>/gi, '');
+                html = html.replace(/<li>  <\/li>/gi, '');
+                //Remove bogus DIV's
+                html = html.replace(/<div><\/div>/gi, '');
+                html = html.replace(/<div> <\/div>/gi, '');
+            }
+            return html;
+        },
+        /**
+        * @method filter_internals
+        * @param String html The HTML string to filter
+        * @description Filters internal RTE strings and bogus attrs we don't want
+        * @return String
+        */
+        filter_internals: function(html) {
+                   html = html.replace(/\r/g, '');
+            //Fix stuff we don't want
+               html = html.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+            //Fix last BR in LI
+                   html = html.replace(/<YUI_BR><\/li>/gi, '</li>');
+
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ style=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            if (this.browser.ie) {
+                       html = html.replace(/ class= /gi, '');
+                       html = html.replace(/ class= >/gi, '');
+                       html = html.replace(/_height="([^>])"/gi, '');
+                       html = html.replace(/_width="([^>])"/gi, '');
+            }
+            
+            return html;
+        },
+        /**
+        * @method filter_all_rgb
+        * @param String str The HTML string to filter
+        * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00"
+        * @return String
+        */
+        filter_all_rgb: function(str) {
+            var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi");
+            var arr = str.match(exp);
+            if (Lang.isArray(arr)) {
+                for (var i = 0; i < arr.length; i++) {
+                    var color = this.filter_rgb(arr[i]);
+                    str = str.replace(arr[i].toString(), color);
+                }
+            }
+            
+            return str;
+        },
+        /**
+        * @method filter_rgb
+        * @param String css The CSS string containing rgb(#,#,#);
+        * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00
+        * @return String
+        */
+        filter_rgb: function(css) {
+            if (css.toLowerCase().indexOf('rgb') != -1) {
+                var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+                var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(',');
+            
+                if (rgb.length == 5) {
+                    var r = parseInt(rgb[1], 10).toString(16);
+                    var g = parseInt(rgb[2], 10).toString(16);
+                    var b = parseInt(rgb[3], 10).toString(16);
+
+                    r = r.length == 1 ? '0' + r : r;
+                    g = g.length == 1 ? '0' + g : g;
+                    b = b.length == 1 ? '0' + b : b;
+
+                    css = "#" + r + g + b;
+                }
+            }
+            return css;
+        },
+        /**
+        * @method pre_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        pre_filter_linebreaks: function(html, markup) {
+            if (this.browser.webkit) {
+                       html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                       html = html.replace(/<br class="webkit-block-placeholder">/gi, '<YUI_BR>');
+            }
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br (.*?)>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<br \/>/gi, '<YUI_BR>');
+                   html = html.replace(/<div><YUI_BR><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+            //Fix last BR
+               html = html.replace(/<YUI_BR>$/, '');
+            //Fix last BR in P
+               html = html.replace(/<YUI_BR><\/p>/g, '</p>');
+            return html;
+        },
+        /**
+        * @method post_filter_linebreaks
+        * @param String html The HTML to filter
+        * @param String markup The markup type to filter to
+        * @description HTML Pre Filter
+        * @return String
+        */
+        post_filter_linebreaks: function(html, markup) {
+            if (markup == 'xhtml') {
+                       html = html.replace(/<YUI_BR>/g, '<br />');
+            } else {
+                       html = html.replace(/<YUI_BR>/g, '<br>');
+            }
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Override Method for Advanced Editor
+        */
+        _renderPanel: function() {
+        },
+        /**
+        * @method openWindow
+        * @description Override Method for Advanced Editor
+        */
+        openWindow: function(win) {
+        },
+        /**
+        * @method moveWindow
+        * @description Override Method for Advanced Editor
+        */
+        moveWindow: function() {
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        _closeWindow: function() {
+        },
+        /**
+        * @method closeWindow
+        * @description Override Method for Advanced Editor
+        */
+        closeWindow: function() {
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.resetAllButtons();
+            this._focusWindow();        
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            this.setStyle('visibility', 'hidden');
+            this.setStyle('position', 'absolute');
+            this.setStyle('top', '-9999px');
+            this.setStyle('left', '-9999px');
+            var textArea = this.get('element');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            this.set('handleSubmit', false); //Remove the submit handler
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'SimpleEditor';
+            if (this.get && this.get('element_cont')) {
+                str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event cleanHTML
+* @description Event is fired after the cleanHTML method is called.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property _instances
+        * @description A reference to all editors on the page.
+        * @type Object
+        */
+        _instances: {},
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>
+        */
+        panel: null,
+        /**
+        * @method getEditorById
+        * @description Returns a reference to the Editor object associated with the given textarea
+        * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of
+        * @return Object <a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a>
+        */
+        getEditorById: function(id) {
+            if (!YAHOO.lang.isString(id)) {
+                //Not a string, assume a node Reference
+                id = id.id;
+            }
+            if (this._instances[id]) {
+                return this._instances[id];
+            }
+            return false;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorInfo.
+        * @return {String}
+        */
+        toString: function() {
+            var len = 0;
+            for (var i in this._instances) {
+                len++;
+            }
+            return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')';
+        }
+    };
+
+
+
+    
+})();
+YAHOO.register("simpleeditor", YAHOO.widget.SimpleEditor, {version: "2.5.0", build: "895"});
index 595f2b679cbc7046309dc84cea6d0d12a52253d5..005bb0c95cdfcfd6a722fc56e59f79a08c37adc0 100755 (executable)
@@ -1,20 +1,25 @@
 Element Release Notes
 
+*** version 2.5.0 ***
+* SetAttributes now correctly handles false values
+
+*** version 2.4.0 ***
+no change
+
+*** version 2.3.1 ***
+no change
+
 *** version 2.3.0 ***
 * setAttributes now sets in order configs were added
 * added subscribe alias for on/addListener
 
-** version 2.2.2 ***
-
+*** version 2.2.2 ***
 * fixed contentReady timing regression
 
 *** version 2.2.1 ***
-
 * Added support for "dblclick", "focus", "blur", and "submit" event (for elements that support them)
 * Fixed scope correction for addListener/on/subscribe
 
 *** version 2.2.0 ***
-
 * beta introduction (broken out of TabView for general use)
-
 * The Element class provides a wrapper for HTMLElements in the DOM and makes simpler common tasks such as adding listeners, manipulating the DOM, and setting and getting attributes.
index f974b56cdc4150951ddccb37e2c75d210bba587a..c52384610d056a955c5913557ff075497f73b91e 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * Provides Attribute configurations.
@@ -217,7 +217,7 @@ YAHOO.util.Attribute.prototype = {
      * @uses YAHOO.util.EventProvider
      */
     YAHOO.util.AttributeProvider = function() {};
-    
+
     YAHOO.util.AttributeProvider.prototype = {
         
         /**
@@ -234,8 +234,8 @@ YAHOO.util.Attribute.prototype = {
          * @param {String} key The attribute whose value will be returned.
          */
         get: function(key){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 YAHOO.log(key + ' not found', 'error', 'AttributeProvider');
@@ -254,8 +254,8 @@ YAHOO.util.Attribute.prototype = {
          * @return {Boolean} Whether or not the value was set.
          */
         set: function(key, value, silent){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 YAHOO.log('set failed: ' + key + ' not found',
@@ -272,12 +272,12 @@ YAHOO.util.Attribute.prototype = {
          * @return {Array} An array of attribute names.
          */
         getAttributeKeys: function(){
-            var configs = this._configs;
+            this._configs = this._configs;
             var keys = [];
             var config;
-            for (var key in configs) {
-                config = configs[key];
-                if ( Lang.hasOwnProperty(configs, key) && 
+            for (var key in this._configs) {
+                config = this._configs[key];
+                if ( Lang.hasOwnProperty(this._configs, key) && 
                         !Lang.isUndefined(config) ) {
                     keys[keys.length] = key;
                 }
@@ -308,9 +308,9 @@ YAHOO.util.Attribute.prototype = {
          * @return {Boolean} Whether or not the value was set
          */
         resetValue: function(key, silent){
-            var configs = this._configs || {};
-            if (configs[key]) {
-                this.set(key, configs[key]._initialConfig.value, silent);
+            this._configs = this._configs || {};
+            if (this._configs[key]) {
+                this.set(key, this._configs[key]._initialConfig.value, silent);
                 return true;
             }
             return false;
@@ -323,17 +323,17 @@ YAHOO.util.Attribute.prototype = {
          * @param {Boolean} silent Whether or not to suppress change events
          */
         refresh: function(key, silent){
-            var configs = this._configs;
+            this._configs = this._configs;
             
             key = ( ( Lang.isString(key) ) ? [key] : key ) || 
                     this.getAttributeKeys();
             
             for (var i = 0, len = key.length; i < len; ++i) { 
                 if ( // only set if there is a value and not null
-                    configs[key[i]] && 
-                    ! Lang.isUndefined(configs[key[i]].value) &&
-                    ! Lang.isNull(configs[key[i]].value) ) {
-                    configs[key[i]].refresh(silent);
+                    this._configs[key[i]] && 
+                    ! Lang.isUndefined(this._configs[key[i]].value) &&
+                    ! Lang.isNull(this._configs[key[i]].value) ) {
+                    this._configs[key[i]].refresh(silent);
                 }
             }
         },
@@ -360,8 +360,8 @@ YAHOO.util.Attribute.prototype = {
          * attribute's properties.
          */
         getAttributeConfig: function(key) {
-            var configs = this._configs || {};
-            var config = configs[key] || {};
+            this._configs = this._configs || {};
+            var config = this._configs[key] || {};
             var map = {}; // returning a copy to prevent overrides
             
             for (key in config) {
@@ -381,13 +381,13 @@ YAHOO.util.Attribute.prototype = {
          * @param {Boolean} init Whether or not this should become the intial config.
          */
         setAttributeConfig: function(key, map, init) {
-            var configs = this._configs || {};
+            this._configs = this._configs || {};
             map = map || {};
-            if (!configs[key]) {
+            if (!this._configs[key]) {
                 map.name = key;
-                configs[key] = new YAHOO.util.Attribute(map, this);
+                this._configs[key] = this.createAttribute(map);
             } else {
-                configs[key].configure(map, init);
+                this._configs[key].configure(map, init);
             }
         },
         
@@ -410,10 +410,30 @@ YAHOO.util.Attribute.prototype = {
          * @private
          */
         resetAttributeConfig: function(key){
-            var configs = this._configs || {};
-            configs[key].resetConfig();
+            this._configs = this._configs || {};
+            this._configs[key].resetConfig();
         },
         
+        // wrapper for EventProvider.subscribe
+        // to create events on the fly
+        subscribe: function(type, callback) {
+            this._events = this._events || {};
+
+            if ( !(type in this._events) ) {
+                this._events[type] = this.createEvent(type);
+            }
+
+            YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
+        },
+
+        on: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
+        addListener: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
         /**
          * Fires the attribute's beforeChange event. 
          * @method fireBeforeChangeEvent
@@ -436,6 +456,10 @@ YAHOO.util.Attribute.prototype = {
         fireChangeEvent: function(e) {
             e.type += 'Change';
             return this.fireEvent(e.type, e);
+        },
+
+        createAttribute: function(map) {
+            return new YAHOO.util.Attribute(map, this);
         }
     };
     
@@ -773,7 +797,7 @@ YAHOO.util.Element.prototype = {
 
         // set based on configOrder
         for (var i = 0, len = this._configOrder.length; i < len; ++i) {
-            if (map[this._configOrder[i]]) {
+            if (map[this._configOrder[i]] !== undefined) {
                 this.set(this._configOrder[i], map[this._configOrder[i]], silent);
             }
         }
@@ -888,7 +912,7 @@ var _initElement = function(el, attr) {
 var _initHTMLElement = function(attr) {
     /**
      * The HTMLElement the Element instance refers to.
-     * @config element
+     * @attribute element
      * @type HTMLElement
      */
     this.setAttributeConfig('element', {
@@ -950,8 +974,33 @@ var _registerHTMLAttr = function(key, map) {
  * @event contentReady
  */
 
+/**
+ * Fires before the Element is appended to another Element.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> beforeAppendTo<br>
+ * <code>&lt;HTMLElement/Element&gt;
+ * target</code> the HTMLElement/Element being appended to 
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('beforeAppendTo', handler);</code></p>
+ * @event beforeAppendTo
+ */
+
+/**
+ * Fires after the Element is appended to another Element.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> appendTo<br>
+ * <code>&lt;HTMLElement/Element&gt;
+ * target</code> the HTMLElement/Element being appended to 
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('appendTo', handler);</code></p>
+ * @event appendTo
+ */
 
 YAHOO.augment(YAHOO.util.Element, AttributeProvider);
 })();
 
-YAHOO.register("element", YAHOO.util.Element, {version: "2.3.0", build: "442"});
+YAHOO.register("element", YAHOO.util.Element, {version: "2.5.0", build: "895"});
index 1def950a1ae08eac7698621161e6e1588d2bcb5b..406957a07baf658a6a02fafba403b865fd107f79 100755 (executable)
@@ -1,36 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}
-if(this.validator&&!this.validator.call(owner,value)){return false;}
-if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}
-if(this.method){this.method.call(owner,value);}
-this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}
-return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&YAHOO.lang.hasOwnProperty(map,key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;}
-return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}
-return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(Lang.hasOwnProperty(configs,key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}
-return keys;},setAttributes:function(map,silent){for(var key in map){if(Lang.hasOwnProperty(map,key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}
-return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this.setAttributeConfig(key,map);},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(Lang.hasOwnProperty(config,key)){map[key]=config[key];}}
-return map;},setAttributeConfig:function(key,map,init){var configs=this._configs||{};map=map||{};if(!configs[key]){map.name=key;configs[key]=new YAHOO.util.Attribute(map,this);}else{configs[key].configure(map,init);}},configureAttribute:function(key,map,init){this.setAttributeConfig(key,map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){},addListener:function(type,fn,obj,scope){var el=this.get('element');scope=scope||this;el=this.get('id')||el;var self=this;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}
-self.fireEvent(type,e);},obj,scope);}
-this.createEvent(type,this);}
-YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){var el=this.get('element');if(!el){return this._queue[this._queue.length]=['setStyle',arguments];}
-return Dom.setStyle(el,property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);this.fireEvent('beforeAppendTo',{type:'beforeAppendTo',target:parent});before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');if(!element){return false;}
-if(!parent){return false;}
-if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}
-this.fireEvent('appendTo',{type:'appendTo',target:parent});},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!YAHOO.lang.isUndefined(el.value[key])){return el.value[key];}
-return AttributeProvider.prototype.get.call(this,key);},setAttributes:function(map,silent){var el=this.get('element');for(var key in map){if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){this.setAttributeConfig(key);}}
-for(var i=0,len=this._configOrder.length;i<len;++i){if(map[this._configOrder[i]]){this.set(this._configOrder[i],map[this._configOrder[i]],silent);}}},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[this._queue.length]=['set',arguments];if(this._configs[key]){this._configs[key].value=value;}
-return;}
-if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key);}
-return AttributeProvider.prototype.set.apply(this,arguments);},setAttributeConfig:function(key,map,init){var el=this.get('element');if(el&&!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key,map);}else{AttributeProvider.prototype.setAttributeConfig.apply(this,arguments);}
-this._configOrder.push(key);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}
-return keys;},createEvent:function(type,scope){this._events[type]=true;AttributeProvider.prototype.createEvent.apply(this,arguments);},init:function(el,attr){_initElement.apply(this,arguments);}};var _initElement=function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'dblclick':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true,'focus':true,'blur':true,'submit':true};var isReady=false;if(YAHOO.lang.isString(el)){_registerHTMLAttr.call(this,'id',{value:attr.element});}
-if(Dom.get(el)){isReady=true;_initHTMLElement.call(this,attr);_initContent.call(this,attr);}
-YAHOO.util.Event.onAvailable(attr.element,function(){if(!isReady){_initHTMLElement.call(this,attr);}
-this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(attr.element,function(){if(!isReady){_initContent.call(this,attr);}
-this.fireEvent('contentReady',{type:'contentReady',target:attr.element});},this,true);};var _initHTMLElement=function(attr){this.setAttributeConfig('element',{value:Dom.get(attr.element),readOnly:true});};var _initContent=function(attr){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();};var _registerHTMLAttr=function(key,map){var el=this.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(this._configs[E[D]]&&!A.isUndefined(this._configs[E[D]].value)&&!A.isNull(this._configs[E[D]].value)){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var D=YAHOO.util.Dom,F=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(G,H){if(arguments.length){this.init(G,H);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(G){G=G.get?G.get("element"):G;this.get("element").appendChild(G);},getElementsByTagName:function(G){return this.get("element").getElementsByTagName(G);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(G,H){G=G.get?G.get("element"):G;H=(H&&H.get)?H.get("element"):H;this.get("element").insertBefore(G,H);},removeChild:function(G){G=G.get?G.get("element"):G;this.get("element").removeChild(G);return true;},replaceChild:function(G,H){G=G.get?G.get("element"):G;H=H.get?H.get("element"):H;return this.get("element").replaceChild(G,H);},initAttributes:function(G){},addListener:function(K,J,L,I){var H=this.get("element");I=I||this;H=this.get("id")||H;var G=this;if(!this._events[K]){if(this.DOM_EVENTS[K]){YAHOO.util.Event.addListener(H,K,function(M){if(M.srcElement&&!M.target){M.target=M.srcElement;}G.fireEvent(K,M);},L,I);}this.createEvent(K,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(H,G){this.unsubscribe.apply(this,arguments);},addClass:function(G){D.addClass(this.get("element"),G);},getElementsByClassName:function(H,G){return D.getElementsByClassName(H,G,this.get("element"));},hasClass:function(G){return D.hasClass(this.get("element"),G);},removeClass:function(G){return D.removeClass(this.get("element"),G);},replaceClass:function(H,G){return D.replaceClass(this.get("element"),H,G);},setStyle:function(I,H){var G=this.get("element");if(!G){return this._queue[this._queue.length]=["setStyle",arguments];}return D.setStyle(G,I,H);},getStyle:function(G){return D.getStyle(this.get("element"),G);},fireQueue:function(){var H=this._queue;for(var I=0,G=H.length;I<G;++I){this[H[I][0]].apply(this,H[I][1]);}},appendTo:function(H,I){H=(H.get)?H.get("element"):D.get(H);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:H});I=(I&&I.get)?I.get("element"):D.get(I);var G=this.get("element");if(!G){return false;}if(!H){return false;}if(G.parent!=H){if(I){H.insertBefore(G,I);}else{H.appendChild(G);}}this.fireEvent("appendTo",{type:"appendTo",target:H});},get:function(G){var I=this._configs||{};var H=I.element;if(H&&!I[G]&&!YAHOO.lang.isUndefined(H.value[G])){return H.value[G];}return F.prototype.get.call(this,G);},setAttributes:function(L,H){var K=this.get("element");
+for(var J in L){if(!this._configs[J]&&!YAHOO.lang.isUndefined(K[J])){this.setAttributeConfig(J);}}for(var I=0,G=this._configOrder.length;I<G;++I){if(L[this._configOrder[I]]!==undefined){this.set(this._configOrder[I],L[this._configOrder[I]],H);}}},set:function(H,J,G){var I=this.get("element");if(!I){this._queue[this._queue.length]=["set",arguments];if(this._configs[H]){this._configs[H].value=J;}return ;}if(!this._configs[H]&&!YAHOO.lang.isUndefined(I[H])){C.call(this,H);}return F.prototype.set.apply(this,arguments);},setAttributeConfig:function(G,I,J){var H=this.get("element");if(H&&!this._configs[G]&&!YAHOO.lang.isUndefined(H[G])){C.call(this,G,I);}else{F.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(G);},getAttributeKeys:function(){var H=this.get("element");var I=F.prototype.getAttributeKeys.call(this);for(var G in H){if(!this._configs[G]){I[G]=I[G]||H[G];}}return I;},createEvent:function(H,G){this._events[H]=true;F.prototype.createEvent.apply(this,arguments);},init:function(H,G){A.apply(this,arguments);}};var A=function(H,G){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];G=G||{};G.element=G.element||H||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var I=false;if(YAHOO.lang.isString(H)){C.call(this,"id",{value:G.element});}if(D.get(H)){I=true;E.call(this,G);B.call(this,G);}YAHOO.util.Event.onAvailable(G.element,function(){if(!I){E.call(this,G);}this.fireEvent("available",{type:"available",target:G.element});},this,true);YAHOO.util.Event.onContentReady(G.element,function(){if(!I){B.call(this,G);}this.fireEvent("contentReady",{type:"contentReady",target:G.element});},this,true);};var E=function(G){this.setAttributeConfig("element",{value:D.get(G.element),readOnly:true});};var B=function(G){this.initAttributes(G);this.setAttributes(G,true);this.fireQueue();};var C=function(G,I){var H=this.get("element");I=I||{};I.name=G;I.method=I.method||function(J){H[G]=J;};I.value=I.value||H[G];this._configs[G]=new YAHOO.util.Attribute(I,this);};YAHOO.augment(YAHOO.util.Element,F);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 7223fcb00c4740923a3043910b1e20b6d22c40e8..3da99552a8608671024d20cabfde71a2c006a530 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * Provides Attribute configurations.
@@ -211,7 +211,7 @@ YAHOO.util.Attribute.prototype = {
      * @uses YAHOO.util.EventProvider
      */
     YAHOO.util.AttributeProvider = function() {};
-    
+
     YAHOO.util.AttributeProvider.prototype = {
         
         /**
@@ -228,8 +228,8 @@ YAHOO.util.Attribute.prototype = {
          * @param {String} key The attribute whose value will be returned.
          */
         get: function(key){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 return undefined;
@@ -247,8 +247,8 @@ YAHOO.util.Attribute.prototype = {
          * @return {Boolean} Whether or not the value was set.
          */
         set: function(key, value, silent){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 return false;
@@ -263,12 +263,12 @@ YAHOO.util.Attribute.prototype = {
          * @return {Array} An array of attribute names.
          */
         getAttributeKeys: function(){
-            var configs = this._configs;
+            this._configs = this._configs;
             var keys = [];
             var config;
-            for (var key in configs) {
-                config = configs[key];
-                if ( Lang.hasOwnProperty(configs, key) && 
+            for (var key in this._configs) {
+                config = this._configs[key];
+                if ( Lang.hasOwnProperty(this._configs, key) && 
                         !Lang.isUndefined(config) ) {
                     keys[keys.length] = key;
                 }
@@ -299,9 +299,9 @@ YAHOO.util.Attribute.prototype = {
          * @return {Boolean} Whether or not the value was set
          */
         resetValue: function(key, silent){
-            var configs = this._configs || {};
-            if (configs[key]) {
-                this.set(key, configs[key]._initialConfig.value, silent);
+            this._configs = this._configs || {};
+            if (this._configs[key]) {
+                this.set(key, this._configs[key]._initialConfig.value, silent);
                 return true;
             }
             return false;
@@ -314,17 +314,17 @@ YAHOO.util.Attribute.prototype = {
          * @param {Boolean} silent Whether or not to suppress change events
          */
         refresh: function(key, silent){
-            var configs = this._configs;
+            this._configs = this._configs;
             
             key = ( ( Lang.isString(key) ) ? [key] : key ) || 
                     this.getAttributeKeys();
             
             for (var i = 0, len = key.length; i < len; ++i) { 
                 if ( // only set if there is a value and not null
-                    configs[key[i]] && 
-                    ! Lang.isUndefined(configs[key[i]].value) &&
-                    ! Lang.isNull(configs[key[i]].value) ) {
-                    configs[key[i]].refresh(silent);
+                    this._configs[key[i]] && 
+                    ! Lang.isUndefined(this._configs[key[i]].value) &&
+                    ! Lang.isNull(this._configs[key[i]].value) ) {
+                    this._configs[key[i]].refresh(silent);
                 }
             }
         },
@@ -351,8 +351,8 @@ YAHOO.util.Attribute.prototype = {
          * attribute's properties.
          */
         getAttributeConfig: function(key) {
-            var configs = this._configs || {};
-            var config = configs[key] || {};
+            this._configs = this._configs || {};
+            var config = this._configs[key] || {};
             var map = {}; // returning a copy to prevent overrides
             
             for (key in config) {
@@ -372,13 +372,13 @@ YAHOO.util.Attribute.prototype = {
          * @param {Boolean} init Whether or not this should become the intial config.
          */
         setAttributeConfig: function(key, map, init) {
-            var configs = this._configs || {};
+            this._configs = this._configs || {};
             map = map || {};
-            if (!configs[key]) {
+            if (!this._configs[key]) {
                 map.name = key;
-                configs[key] = new YAHOO.util.Attribute(map, this);
+                this._configs[key] = this.createAttribute(map);
             } else {
-                configs[key].configure(map, init);
+                this._configs[key].configure(map, init);
             }
         },
         
@@ -401,10 +401,30 @@ YAHOO.util.Attribute.prototype = {
          * @private
          */
         resetAttributeConfig: function(key){
-            var configs = this._configs || {};
-            configs[key].resetConfig();
+            this._configs = this._configs || {};
+            this._configs[key].resetConfig();
         },
         
+        // wrapper for EventProvider.subscribe
+        // to create events on the fly
+        subscribe: function(type, callback) {
+            this._events = this._events || {};
+
+            if ( !(type in this._events) ) {
+                this._events[type] = this.createEvent(type);
+            }
+
+            YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
+        },
+
+        on: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
+        addListener: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
         /**
          * Fires the attribute's beforeChange event. 
          * @method fireBeforeChangeEvent
@@ -427,6 +447,10 @@ YAHOO.util.Attribute.prototype = {
         fireChangeEvent: function(e) {
             e.type += 'Change';
             return this.fireEvent(e.type, e);
+        },
+
+        createAttribute: function(map) {
+            return new YAHOO.util.Attribute(map, this);
         }
     };
     
@@ -759,7 +783,7 @@ YAHOO.util.Element.prototype = {
 
         // set based on configOrder
         for (var i = 0, len = this._configOrder.length; i < len; ++i) {
-            if (map[this._configOrder[i]]) {
+            if (map[this._configOrder[i]] !== undefined) {
                 this.set(this._configOrder[i], map[this._configOrder[i]], silent);
             }
         }
@@ -874,7 +898,7 @@ var _initElement = function(el, attr) {
 var _initHTMLElement = function(attr) {
     /**
      * The HTMLElement the Element instance refers to.
-     * @config element
+     * @attribute element
      * @type HTMLElement
      */
     this.setAttributeConfig('element', {
@@ -936,8 +960,33 @@ var _registerHTMLAttr = function(key, map) {
  * @event contentReady
  */
 
+/**
+ * Fires before the Element is appended to another Element.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> beforeAppendTo<br>
+ * <code>&lt;HTMLElement/Element&gt;
+ * target</code> the HTMLElement/Element being appended to 
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('beforeAppendTo', handler);</code></p>
+ * @event beforeAppendTo
+ */
+
+/**
+ * Fires after the Element is appended to another Element.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> appendTo<br>
+ * <code>&lt;HTMLElement/Element&gt;
+ * target</code> the HTMLElement/Element being appended to 
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('appendTo', handler);</code></p>
+ * @event appendTo
+ */
 
 YAHOO.augment(YAHOO.util.Element, AttributeProvider);
 })();
 
-YAHOO.register("element", YAHOO.util.Element, {version: "2.3.0", build: "442"});
+YAHOO.register("element", YAHOO.util.Element, {version: "2.5.0", build: "895"});
index b1d980b80048055f51df8602f3fe9d75cec5e59a..f84a231b71adf03a6a07c076d298ada1a1407e98 100755 (executable)
@@ -1,6 +1,48 @@
 
 YUI Library - Event - Release Notes
 
+2.5.0
+  * Added try/catch to getTarget to suppress errors when targeting
+    ActiveX controls.
+  * Increased the default poll interval to 20ms, and decreased poll
+    retries to 2000 to reduce IE CPU usage.
+  * onDOMReady now uses the native DOMContentLoaded event for the
+    latest releases of WebKit since it support for it was added.
+  * Restored the code that removes all listeners during the unload event to
+    address issues caused by the way FireFox persists listeners through 
+    page refreshes.
+
+2.4.1
+  * Reverted clearAttributes() change to fix IE memory leak on iframes/windows
+
+2.4.0
+  * getListeners/purgeElement accepts either an element reference or an element id
+  * onAvailable/onContentReady accepts a single id or an array of ids
+  * No longer removing listeners during the unload event for non-IE browsers
+  * IE unload strategy for cross page memory leaks changed from removing each listener
+    to calling clearAttributes()
+  * the DOMReady property is now public
+  * Changed IE onDOMReady approach from the defered script node hack to the doScroll('left') hack
+  * getCharChode now Remaps SHIFT-TAB key code (25) to TAB (9) in Safari
+  * getCharCode provides the proper key codes for page up and page down in Safari
+  * Restored object check to _isValidCollection.
+  * In KeyListener, added keycode constants for some of the special keys.
+  * Rolled back the change added for hacking around IE errors from bubbled 
+    events that originally targeted an ActiveX control.
+
+2.3.1
+  * CustomEvent fire() now catches exceptions thrown by the subscribers so
+    that the rest of the subscribers execute.  The exception is logged and
+    stored in the "lastError" property.
+  * Performance tweak: _isValidCollection fails strings first.
+  * onAvailable/onContentReady will work if an element ref rather than an
+    id is provided.
+  * getListeners: fixed the values for the obj and adjust properties.
+    Added scope property.
+  * Added IE hack for when the event target is something that can't be
+    inspected (like a VML canvas).  In this case the target is set to
+    the element the listener is bound to.
+
 2.3.0
   * addListener now produces a logger warning if the supplied callback is 
     undefined.
index 307ab5245f6b4f578557071541d487b1acac2c31..9829438ec58bf7980905eefc7d58fd517076cc5f 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
 /**
@@ -110,6 +110,16 @@ YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {
                 new YAHOO.util.CustomEvent(onsubscribeType, this, true);
 
     } 
+
+
+    /**
+     * In order to make it possible to execute the rest of the subscriber
+     * stack when one thows an exception, the subscribers exceptions are
+     * caught.  The most recent exception is stored in this property
+     * @property lastError
+     * @type Error
+     */
+    this.lastError = null;
 };
 
 /**
@@ -216,8 +226,6 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
             args.push(arguments[i]);
         }
 
-        var argslength = args.length;
-
         if (!this.silent) {
             YAHOO.log( "Firing "       + this  + ", " + 
                        "args: "        + args  + ", " +
@@ -242,9 +250,22 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
                     if (args.length > 0) {
                         param = args[0];
                     }
-                    ret = s.fn.call(scope, param, s.obj);
+
+                    try {
+                        ret = s.fn.call(scope, param, s.obj);
+                    } catch(e) {
+                        this.lastError = e;
+                        YAHOO.log(this + " subscriber exception: " + e,
+                                  "error", "Event");
+                    }
                 } else {
-                    ret = s.fn.call(scope, this.type, args, s.obj);
+                    try {
+                        ret = s.fn.call(scope, this.type, args, s.obj);
+                    } catch(ex) {
+                        this.lastError = ex;
+                        YAHOO.log(this + " subscriber exception: " + ex,
+                                  "error", "Event");
+                    }
                 }
                 if (false === ret) {
                     if (!this.silent) {
@@ -260,8 +281,7 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
 
         if (rebuild) {
             var newlist=[],subs=this.subscribers;
-            for (i=0,len=subs.length; i<len; ++i) {
-                s = subs[i];
+            for (i=0,len=subs.length; i<len; i=i+1) {
                 newlist.push(subs[i]);
             }
 
@@ -431,15 +451,6 @@ if (!YAHOO.util.Event) {
          */
         var loadComplete =  false;
 
-        /**
-         * True when the document is initially usable
-         * @property DOMReady
-         * @type boolean
-         * @static
-         * @private
-         */
-        var DOMReady = false;
-
         /**
          * Cache of wrapped listeners
          * @property listeners
@@ -522,7 +533,11 @@ if (!YAHOO.util.Event) {
             63232: 38, // up
             63233: 40, // down
             63234: 37, // left
-            63235: 39  // right
+            63235: 39, // right
+            63276: 33, // page up
+            63277: 34, // page down
+            25: 9      // SHIFT-TAB (Safari provides a different key code in
+                       // this case, even though the shiftKey modifier is set)
         };
 
         return {
@@ -530,7 +545,7 @@ if (!YAHOO.util.Event) {
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
+             * has been loaded.  The default is 2000@amp;20 ms, so it will poll
              * for 40 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
@@ -538,7 +553,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_RETRYS: 4000,
+            POLL_RETRYS: 2000,
 
             /**
              * The poll interval in milliseconds
@@ -547,7 +562,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_INTERVAL: 10,
+            POLL_INTERVAL: 20,
 
             /**
              * Element to bind, int constant
@@ -587,13 +602,14 @@ if (!YAHOO.util.Event) {
 
             /**
              * Object passed in by the user that will be returned as a 
-             * parameter to the callback, int constant
+             * parameter to the callback, int constant.  Specific to
+             * unload listeners
              * @property OBJ
              * @type int
              * @static
              * @final
              */
-            OBJ: 3,
+            UNLOAD_OBJ: 3,
 
             /**
              * Adjusted scope, either the element we are registering the event
@@ -605,6 +621,24 @@ if (!YAHOO.util.Event) {
              */
             ADJ_SCOPE: 4,
 
+            /**
+             * The original obj passed into addListener
+             * @property OBJ
+             * @type int
+             * @static
+             * @final
+             */
+            OBJ: 5,
+
+            /**
+             * The original scope parameter passed into addListener
+             * @property OVERRIDE
+             * @type int
+             * @static
+             * @final
+             */
+            OVERRIDE: 6,
+
             /**
              * addListener/removeListener can throw errors in unexpected scenarios.
              * These errors are suppressed, the method returns false, and this property
@@ -651,6 +685,22 @@ if (!YAHOO.util.Event) {
              */
             _interval: null,
 
+            /**
+             * document readystate poll handle
+             * @property _dri
+             * @static
+             * @private
+             */
+             _dri: null,
+
+            /**
+             * True when the document is initially usable
+             * @property DOMReady
+             * @type boolean
+             * @static
+             */
+            DOMReady: false,
+
             /**
              * @method startInterval
              * @static
@@ -677,26 +727,56 @@ if (!YAHOO.util.Event) {
              *
              * @method onAvailable
              *
-             * @param {string}   p_id the id of the element to look for.
+             * @param {string||string[]}   p_id the id of the element, or an array
+             * of ids to look for.
              * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
              * @param {boolean|object}  p_override If set to true, p_fn will execute
              *                   in the scope of p_obj, if set to an object it
              *                   will execute in the scope of that object
-             *
+             * @param checkContent {boolean} check child node readiness (onContentReady)
              * @static
              */
-            onAvailable: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override, 
-                                     checkReady: false    } );
+            onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) {
+
+                var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id;
+
+                for (var i=0; i<a.length; i=i+1) {
+                    onAvailStack.push({id:         a[i], 
+                                       fn:         p_fn, 
+                                       obj:        p_obj, 
+                                       override:   p_override, 
+                                       checkReady: checkContent });
+                }
                 retryCount = this.POLL_RETRYS;
                 this.startInterval();
             },
 
+            /**
+             * Works the same way as onAvailable, but additionally checks the
+             * state of sibling elements to determine if the content of the
+             * available element is safe to modify.
+             *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
+             * @method onContentReady
+             *
+             * @param {string}   p_id the id of the element to look for.
+             * @param {function} p_fn what to execute when the element is ready.
+             * @param {object}   p_obj an optional object to be passed back as
+             *                   a parameter to p_fn.
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj.  If an object, p_fn will
+             *                   exectute in the scope of that object
+             *
+             * @static
+             */
+            onContentReady: function(p_id, p_fn, p_obj, p_override) {
+                this.onAvailable(p_id, p_fn, p_obj, p_override, true);
+            },
+
             /**
              * Executes the supplied callback when the DOM is first usable.  This
              * will execute immediately if called after the DOMReady event has
@@ -712,7 +792,7 @@ if (!YAHOO.util.Event) {
              * to it when it did so?
              *
              * <p>The callback is a CustomEvent, so the signature is:</p>
-             * <p>type <string>, args <array>, customobject <object></p>
+             * <p>type &lt;string&gt;, args &lt;array&gt;, customobject &lt;object&gt;</p>
              * <p>For DOMReady events, there are no fire argments, so the
              * signature is:</p>
              * <p>"DOMReady", [], obj</p>
@@ -730,7 +810,7 @@ if (!YAHOO.util.Event) {
              * @static
              */
             onDOMReady: function(p_fn, p_obj, p_override) {
-                if (DOMReady) {
+                if (this.DOMReady) {
                     setTimeout(function() {
                         var s = window;
                         if (p_override) {
@@ -747,37 +827,6 @@ if (!YAHOO.util.Event) {
                 }
             },
 
-            /**
-             * Works the same way as onAvailable, but additionally checks the
-             * state of sibling elements to determine if the content of the
-             * available element is safe to modify.
-             *
-             * <p>The callback is executed with a single parameter:
-             * the custom object parameter, if provided.</p>
-             *
-             * @method onContentReady
-             *
-             * @param {string}   p_id the id of the element to look for.
-             * @param {function} p_fn what to execute when the element is ready.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj.  If an object, p_fn will
-             *                   exectute in the scope of that object
-             *
-             * @static
-             */
-            onContentReady: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override,
-                                     checkReady: true      } );
-
-                retryCount = this.POLL_RETRYS;
-                this.startInterval();
-            },
-
             /**
              * Appends an event handler
              *
@@ -875,11 +924,11 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                 // wrap the function so we can return the obj object when
                 // the event fires;
                 var wrappedFn = function(e) {
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e), 
+                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
                                 obj);
                     };
 
-                var li = [el, sType, fn, wrappedFn, scope];
+                var li = [el, sType, fn, wrappedFn, scope, obj, override];
                 var index = listeners.length;
                 // cache the listener so we can try to automatically unload
                 listeners[index] = li;
@@ -1013,7 +1062,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * @static
              */
             removeListener: function(el, sType, fn) {
-                var i, len;
+                var i, len, li;
 
                 // The el argument can be a string
                 if (typeof el == "string") {
@@ -1036,7 +1085,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                 if ("unload" == sType) {
 
                     for (i=0, len=unloadListeners.length; i<len; i++) {
-                        var li = unloadListeners[i];
+                        li = unloadListeners[i];
                         if (li && 
                             li[0] == el && 
                             li[1] == sType && 
@@ -1057,7 +1106,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                 // try and take advantage of it, which is not possible.
                 var index = arguments[3];
   
-                if ("undefined" == typeof index) {
+                if ("undefined" === typeof index) {
                     index = this._getCacheIndex(el, sType, fn);
                 }
 
@@ -1135,12 +1184,14 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * @return {HTMLElement} the normized node
              * @static
              */
-            resolveTextNode: function(node) {
-                if (node && 3 == node.nodeType) {
-                    return node.parentNode;
-                } else {
-                    return node;
-                }
+            resolveTextNode: function(n) {
+                try {
+                    if (n && 3 == n.nodeType) {
+                        return n.parentNode;
+                    }
+                } catch(e) { }
+
+                return n;
             },
 
             /**
@@ -1284,10 +1335,11 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * this function at all.
              * @method getEvent
              * @param {Event} e the event parameter from the handler
+             * @param {HTMLElement} boundEl the element the listener is attached to
              * @return {Event} the event 
              * @static
              */
-            getEvent: function(e) {
+            getEvent: function(e, boundEl) {
                 var ev = e || window.event;
 
                 if (!ev) {
@@ -1314,7 +1366,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
             getCharCode: function(ev) {
                 var code = ev.keyCode || ev.charCode || 0;
 
-                // webkit normalization
+                // webkit key normalization
                 if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
                     code = webkitKeymap[code];
                 }
@@ -1377,15 +1429,15 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              */
             _isValidCollection: function(o) {
                 try {
-                    return ( o                    && // o is something
-                             o.length             && // o is indexed
-                             typeof o != "string" && // o is not a string
-                             !o.tagName           && // o is not an HTML element
-                             !o.alert             && // o is not a window
-                             typeof o[0] != "undefined" );
-                } catch(e) {
-                    YAHOO.log("_isValidCollection threw an error, assuming that " +
-                        " this is a cross frame problem and not a collection", warn);
+                    return ( o                     && // o is something
+                             typeof o !== "string" && // o is not a string
+                             o.length              && // o is indexed
+                             !o.tagName            && // o is not an HTML element
+                             !o.alert              && // o is not a window
+                             typeof o[0] !== "undefined" );
+                } catch(ex) {
+                    YAHOO.log("_isValidCollection error, assuming that " +
+                " this is a cross frame problem and not a collection", "warn");
                     return false;
                 }
 
@@ -1410,7 +1462,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * @deprecated Elements are not cached any longer
              */
             getEl: function(id) {
-                return document.getElementById(id);
+                return (typeof id === "string") ? document.getElementById(id) : id;
             },
 
             /**
@@ -1449,11 +1501,6 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                     // before the window load notification
                     EU._tryPreloadAttach();
 
-                    // Remove the listener to assist with the IE memory issue, but not
-                    // for other browsers because FF 1.0x does not like it.
-                    //if (this.isIE) {
-                        //EU._simpleRemove(window, "load", EU._load);
-                    //}
                 }
             },
 
@@ -1465,9 +1512,9 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * @private
              */
             _ready: function(e) {
-                if (!DOMReady) {
-                    DOMReady=true;
-                    var EU = YAHOO.util.Event;
+                var EU = YAHOO.util.Event;
+                if (!EU.DOMReady) {
+                    EU.DOMReady=true;
 
                     // Fire the content ready custom event
                     EU.DOMReadyEvent.fire();
@@ -1495,8 +1542,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                     // Hold off if DOMReady has not fired and check current
                     // readyState to protect against the IE operation aborted
                     // issue.
-                    //if (!DOMReady || "complete" !== document.readyState) {
-                    if (!DOMReady) {
+                    if (!this.DOMReady) {
                         this.startInterval();
                         return false;
                     }
@@ -1594,19 +1640,18 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * @static
              */
             purgeElement: function(el, recurse, sType) {
-                var elListeners = this.getListeners(el, sType);
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+                var elListeners = this.getListeners(oEl, sType), i, len;
                 if (elListeners) {
-                    for (var i=0,len=elListeners.length; i<len ; ++i) {
+                    for (i=0,len=elListeners.length; i<len ; ++i) {
                         var l = elListeners[i];
-                        // can't use the index on the changing collection
-                        this.removeListener(el, l.type, l.fn, l.index);
-                        //this.removeListener(el, l.type, l.fn);
+                        this.removeListener(oEl, l.type, l.fn, l.index);
                     }
                 }
 
-                if (recurse && el && el.childNodes) {
-                    for (i=0,len=el.childNodes.length; i<len ; ++i) {
-                        this.purgeElement(el.childNodes[i], recurse, sType);
+                if (recurse && oEl && oEl.childNodes) {
+                    for (i=0,len=oEl.childNodes.length; i<len ; ++i) {
+                        this.purgeElement(oEl.childNodes[i], recurse, sType);
                     }
                 }
             },
@@ -1615,14 +1660,15 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
              * Returns all listeners attached to the given element via addListener.
              * Optionally, you can specify a specific type of event to return.
              * @method getListeners
-             * @param el {HTMLElement} the element to inspect 
+             * @param el {HTMLElement|string} the element or element id to inspect 
              * @param sType {string} optional type of listener to return. If
              * left out, all listeners will be returned
              * @return {Object} the listener. Contains the following fields:
              * &nbsp;&nbsp;type:   (string)   the type of event
              * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
              * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
-             * &nbsp;&nbsp;adjust: (boolean)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
              * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
              * @static
              */           
@@ -1630,24 +1676,27 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                 var results=[], searchLists;
                 if (!sType) {
                     searchLists = [listeners, unloadListeners];
-                } else if (sType == "unload") {
+                } else if (sType === "unload") {
                     searchLists = [unloadListeners];
                 } else {
                     searchLists = [listeners];
                 }
 
-                for (var j=0;j<searchLists.length; ++j) {
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+
+                for (var j=0;j<searchLists.length; j=j+1) {
                     var searchList = searchLists[j];
                     if (searchList && searchList.length > 0) {
                         for (var i=0,len=searchList.length; i<len ; ++i) {
                             var l = searchList[i];
-                            if ( l  && l[this.EL] === el && 
+                            if ( l  && l[this.EL] === oEl && 
                                     (!sType || sType === l[this.TYPE]) ) {
                                 results.push({
                                     type:   l[this.TYPE],
                                     fn:     l[this.FN],
                                     obj:    l[this.OBJ],
-                                    adjust: l[this.ADJ_SCOPE],
+                                    adjust: l[this.OVERRIDE],
+                                    scope:  l[this.ADJ_SCOPE],
                                     index:  i
                                 });
                             }
@@ -1669,18 +1718,19 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
 
                 var EU = YAHOO.util.Event, i, j, l, len, index;
 
+                // execute and clear stored unload listeners
                 for (i=0,len=unloadListeners.length; i<len; ++i) {
                     l = unloadListeners[i];
                     if (l) {
                         var scope = window;
                         if (l[EU.ADJ_SCOPE]) {
                             if (l[EU.ADJ_SCOPE] === true) {
-                                scope = l[EU.OBJ];
+                                scope = l[EU.UNLOAD_OBJ];
                             } else {
                                 scope = l[EU.ADJ_SCOPE];
                             }
                         }
-                        l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );
+                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
                         unloadListeners[i] = null;
                         l=null;
                         scope=null;
@@ -1689,6 +1739,13 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
 
                 unloadListeners = null;
 
+                // Remove listeners to handle IE memory leaks
+                //if (YAHOO.env.ua.ie && listeners && listeners.length > 0) {
+                
+                // 2.5.0 listeners are removed for all browsers again.  FireFox preserves
+                // at least some listeners between page refreshes, potentially causing
+                // errors during page load (mouseover listeners firing before they
+                // should if the user moves the mouse at the correct moment).
                 if (listeners && listeners.length > 0) {
                     j = listeners.length;
                     while (j) {
@@ -1697,21 +1754,9 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                         if (l) {
                             EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
                         } 
-                        j = j - 1;
+                        j--;
                     }
                     l=null;
-
-                    EU.clearCache();
-                }
-
-                for (i=0,len=legacyEvents.length; i<len; ++i) {
-                    // dereference the element
-                    //delete legacyEvents[i][0];
-                    legacyEvents[i][0] = null;
-
-                    // delete the array item
-                    //delete legacyEvents[i];
-                    legacyEvents[i] = null;
                 }
 
                 legacyEvents = null;
@@ -1834,9 +1879,7 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
          */
         EU.on = EU.addListener;
 
-        /////////////////////////////////////////////////////////////
-        // DOMReady
-        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
 
         // Internet Explorer: use the readyState of a defered script.
         // This isolates what appears to be a safe moment to manipulate
@@ -1850,74 +1893,38 @@ YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event"
                     YAHOO.util.Event._tryPreloadAttach,
                     YAHOO.util.Event, true);
 
-            //YAHOO.log("-" + document.readyState + "-");
-
-            var el, d=document, b=d.body;
-
-            // If the library is being injected after window.onload, it
-            // is not safe to document.write the script tag.  Detecting
-            // this state doesn't appear possible, so we expect a flag
-            // in YAHOO_config to be set if the library is being injected.
-            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
-
-                //YAHOO.log("-head-");
-
-                //var dr = d.readyState;
-                //if ("complete" === dr || "interactive" === dr) {
-                    //YAHOO.util.Event._ready();
-                    //YAHOO.util.Event._tryPreloadAttach();
-                //} else {
-
-                    el = document.createElement("script");
-                    var p=d.getElementsByTagName("head")[0] || b;
-                    p.insertBefore(el, p.firstChild);
-
-                //}
-
-            } else {
-                //YAHOO.log("-dw-");
-    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
-                el=document.getElementById("_yui_eu_dr");
-            }
-            
-
-            if (el) {
-                el.onreadystatechange = function() {
-                    //YAHOO.log(";comp-" + this.readyState + ";");
-                    if ("complete" === this.readyState) {
-                        this.parentNode.removeChild(this);
-                        YAHOO.util.Event._ready();
-                    }
-                };
-            } else {
-                // The library was likely injected into the page
-                // rendering onDOMReady unreliable
-                // YAHOO.util.Event._ready();
-            }
-
-            el=null;
+            EU._dri = setInterval(function() {
+                var n = document.createElement('p');  
+                try {
+                    // throws an error if doc is not ready
+                    n.doScroll('left');
+                    clearInterval(EU._dri);
+                    EU._dri = null;
+                    EU._ready();
+                    n = null;
+                } catch (ex) { 
+                    n = null;
+                }
+            }, EU.POLL_INTERVAL); 
 
         
-        // Safari: The document's readyState in Safari currently will
+        // The document's readyState in Safari currently will
         // change to loaded/complete before images are loaded.
-        //} else if (EU.webkit) {
-        } else if (EU.webkit) {
+        } else if (EU.webkit && EU.webkit < 525) {
 
-            EU._drwatch = setInterval(function(){
+            EU._dri = setInterval(function() {
                 var rs=document.readyState;
                 if ("loaded" == rs || "complete" == rs) {
-                    clearInterval(EU._drwatch);
-                    EU._drwatch = null;
+                    clearInterval(EU._dri);
+                    EU._dri = null;
                     EU._ready();
                 }
             }, EU.POLL_INTERVAL); 
 
         // FireFox and Opera: These browsers provide a event for this
-        // moment.
+        // moment.  The latest WebKit releases now support this event.
         } else {
 
-            // @todo will this fire when the library is injected?
-
             EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
 
         }
@@ -2012,8 +2019,8 @@ YAHOO.util.EventProvider.prototype = {
                 return ce.unsubscribe(p_fn, p_obj);
             }
         } else {
+            var ret = true;
             for (var i in evts) {
-                var ret = true;
                 if (YAHOO.lang.hasOwnProperty(evts, i)) {
                     ret = ret && evts[i].unsubscribe(p_fn, p_obj);
                 }
@@ -2262,7 +2269,6 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
             e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
             
             var dataItem;
-            var keyPressed;
 
             if (keyData.keys instanceof Array) {
                 for (var i=0;i<keyData.keys.length;i++) {
@@ -2347,4 +2353,36 @@ YAHOO.util.KeyListener.KEYDOWN = "keydown";
 * @type String
 */
 YAHOO.util.KeyListener.KEYUP = "keyup";
-YAHOO.register("event", YAHOO.util.Event, {version: "2.3.0", build: "442"});
+
+/**
+ * keycode constants for a subset of the special keys
+ * @property KEY
+ * @static
+ * @final
+ */
+YAHOO.util.KeyListener.KEY = {
+    ALT          : 18,
+    BACK_SPACE   : 8,
+    CAPS_LOCK    : 20,
+    CONTROL      : 17,
+    DELETE       : 46,
+    DOWN         : 40,
+    END          : 35,
+    ENTER        : 13,
+    ESCAPE       : 27,
+    HOME         : 36,
+    LEFT         : 37,
+    META         : 224,
+    NUM_LOCK     : 144,
+    PAGE_DOWN    : 34,
+    PAGE_UP      : 33, 
+    PAUSE        : 19,
+    PRINTSCREEN  : 44,
+    RIGHT        : 39,
+    SCROLL_LOCK  : 145,
+    SHIFT        : 16,
+    SPACE        : 32,
+    TAB          : 9,
+    UP           : 38
+};
+YAHOO.register("event", YAHOO.util.Event, {version: "2.5.0", build: "895"});
index 00437966f679717770f9cf4d0bcd38f3d7a87116..0c322d87a7b7dcdea9c2b4c79dd1ec212af02b16 100755 (executable)
@@ -1,95 +1,11 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
-if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
-var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
-return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
-var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
-var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
-ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
-if(false===ret){if(!this.silent){}
-return false;}}}
-if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
-this.subscribers=newlist;}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
-this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
-p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
-if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
-if(!el){return false;}
-if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
-var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
-var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
-return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
-return ok;}
-if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
-return false;}
-var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
-if(index>=0){cacheItem=listeners[index];}
-if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
-return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
-return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
-return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
-c=c.caller;}}
-return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
-return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
-return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
-if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
-this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
-for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
-retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
-for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
-return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
-l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
-unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
-j=j-1;}
-l=null;EU.clearCache();}
-for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
-if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
-el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
-EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
-YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
-return ret;}
-return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
-this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
-var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
-return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
-return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
-if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
-var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
-if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
-function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
-if(!keyData.alt){keyData.alt=false;}
-if(!keyData.ctrl){keyData.ctrl=false;}
-if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
-this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
-this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
-this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
-(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[],F=true,C,I=false;for(C=0;C<arguments.length;++C){H.push(arguments[C]);}if(!this.silent){}for(C=0;C<D;++C){var L=this.subscribers[C];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=L.fn.call(K,A,L.obj);}catch(E){this.lastError=E;}}else{try{F=L.fn.call(K,this.type,H,L.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}if(I){var J=[],B=this.subscribers;for(C=0,D=B.length;C<D;C=C+1){J.push(B[C]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M];for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=0,R=L.length;O<R;++O){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=0,R=J.length;O<R;O++){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J[O]=null;return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M[O]=null;break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I[Q]=null;return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
+},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;++M){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!this.DOMReady){this.startInterval();return false;}}this.locked=true;var P=!H;if(!P){P=(C>0);}var O=[];var Q=function(S,T){var R=S;if(T.override){if(T.override===true){R=T.obj;}else{R=T.override;}}T.fn.call(R,T.obj);};var L,K,N,M;for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&!N.checkReady){M=this.getEl(N.id);if(M){Q(M,N);F[L]=null;}else{O.push(N);}}}for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&N.checkReady){M=this.getEl(N.id);if(M){if(H||M.nextSibling){Q(M,N);F[L]=null;}}else{O.push(N);}}}C=(O.length===0)?0:C-1;if(P){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=0,K=Q.length;N<K;++N){var L=Q[N];this.removeListener(M,L.type,L.fn,L.index);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var Q=YAHOO.util.Event,O,N,L,K,M;for(O=0,K=J.length;O<K;++O){L=J[O];if(L){var P=window;if(L[Q.ADJ_SCOPE]){if(L[Q.ADJ_SCOPE]===true){P=L[Q.UNLOAD_OBJ];}else{P=L[Q.ADJ_SCOPE];}}L[Q.FN].call(P,Q.getEvent(R,L[Q.EL]),L[Q.UNLOAD_OBJ]);J[O]=null;L=null;P=null;}}J=null;if(I&&I.length>0){N=I.length;while(N){M=N-1;L=I[M];if(L){Q.removeListener(L[Q.EL],L[Q.TYPE],L[Q.FN],M);}N--;}L=null;}G=null;Q._simpleRemove(window,"unload",Q._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);EU._dri=setInterval(function(){var n=document.createElement("p");try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){n=null;}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);
+var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 83815a8a9388471ea0b9bdd93f1a50cca7c54e5c..8b33ee2fe6b3e792dc5c409885b1571f49a0c7a1 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
 /**
@@ -109,6 +109,16 @@ YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {
                 new YAHOO.util.CustomEvent(onsubscribeType, this, true);
 
     } 
+
+
+    /**
+     * In order to make it possible to execute the rest of the subscriber
+     * stack when one thows an exception, the subscribers exceptions are
+     * caught.  The most recent exception is stored in this property
+     * @property lastError
+     * @type Error
+     */
+    this.lastError = null;
 };
 
 /**
@@ -215,8 +225,6 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
             args.push(arguments[i]);
         }
 
-        var argslength = args.length;
-
         if (!this.silent) {
         }
 
@@ -235,9 +243,18 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
                     if (args.length > 0) {
                         param = args[0];
                     }
-                    ret = s.fn.call(scope, param, s.obj);
+
+                    try {
+                        ret = s.fn.call(scope, param, s.obj);
+                    } catch(e) {
+                        this.lastError = e;
+                    }
                 } else {
-                    ret = s.fn.call(scope, this.type, args, s.obj);
+                    try {
+                        ret = s.fn.call(scope, this.type, args, s.obj);
+                    } catch(ex) {
+                        this.lastError = ex;
+                    }
                 }
                 if (false === ret) {
                     if (!this.silent) {
@@ -251,8 +268,7 @@ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
 
         if (rebuild) {
             var newlist=[],subs=this.subscribers;
-            for (i=0,len=subs.length; i<len; ++i) {
-                s = subs[i];
+            for (i=0,len=subs.length; i<len; i=i+1) {
                 newlist.push(subs[i]);
             }
 
@@ -422,15 +438,6 @@ if (!YAHOO.util.Event) {
          */
         var loadComplete =  false;
 
-        /**
-         * True when the document is initially usable
-         * @property DOMReady
-         * @type boolean
-         * @static
-         * @private
-         */
-        var DOMReady = false;
-
         /**
          * Cache of wrapped listeners
          * @property listeners
@@ -513,7 +520,11 @@ if (!YAHOO.util.Event) {
             63232: 38, // up
             63233: 40, // down
             63234: 37, // left
-            63235: 39  // right
+            63235: 39, // right
+            63276: 33, // page up
+            63277: 34, // page down
+            25: 9      // SHIFT-TAB (Safari provides a different key code in
+                       // this case, even though the shiftKey modifier is set)
         };
 
         return {
@@ -521,7 +532,7 @@ if (!YAHOO.util.Event) {
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
+             * has been loaded.  The default is 2000@amp;20 ms, so it will poll
              * for 40 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
@@ -529,7 +540,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_RETRYS: 4000,
+            POLL_RETRYS: 2000,
 
             /**
              * The poll interval in milliseconds
@@ -538,7 +549,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_INTERVAL: 10,
+            POLL_INTERVAL: 20,
 
             /**
              * Element to bind, int constant
@@ -578,13 +589,14 @@ if (!YAHOO.util.Event) {
 
             /**
              * Object passed in by the user that will be returned as a 
-             * parameter to the callback, int constant
+             * parameter to the callback, int constant.  Specific to
+             * unload listeners
              * @property OBJ
              * @type int
              * @static
              * @final
              */
-            OBJ: 3,
+            UNLOAD_OBJ: 3,
 
             /**
              * Adjusted scope, either the element we are registering the event
@@ -596,6 +608,24 @@ if (!YAHOO.util.Event) {
              */
             ADJ_SCOPE: 4,
 
+            /**
+             * The original obj passed into addListener
+             * @property OBJ
+             * @type int
+             * @static
+             * @final
+             */
+            OBJ: 5,
+
+            /**
+             * The original scope parameter passed into addListener
+             * @property OVERRIDE
+             * @type int
+             * @static
+             * @final
+             */
+            OVERRIDE: 6,
+
             /**
              * addListener/removeListener can throw errors in unexpected scenarios.
              * These errors are suppressed, the method returns false, and this property
@@ -642,6 +672,22 @@ if (!YAHOO.util.Event) {
              */
             _interval: null,
 
+            /**
+             * document readystate poll handle
+             * @property _dri
+             * @static
+             * @private
+             */
+             _dri: null,
+
+            /**
+             * True when the document is initially usable
+             * @property DOMReady
+             * @type boolean
+             * @static
+             */
+            DOMReady: false,
+
             /**
              * @method startInterval
              * @static
@@ -668,26 +714,56 @@ if (!YAHOO.util.Event) {
              *
              * @method onAvailable
              *
-             * @param {string}   p_id the id of the element to look for.
+             * @param {string||string[]}   p_id the id of the element, or an array
+             * of ids to look for.
              * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
              * @param {boolean|object}  p_override If set to true, p_fn will execute
              *                   in the scope of p_obj, if set to an object it
              *                   will execute in the scope of that object
-             *
+             * @param checkContent {boolean} check child node readiness (onContentReady)
              * @static
              */
-            onAvailable: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override, 
-                                     checkReady: false    } );
+            onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) {
+
+                var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id;
+
+                for (var i=0; i<a.length; i=i+1) {
+                    onAvailStack.push({id:         a[i], 
+                                       fn:         p_fn, 
+                                       obj:        p_obj, 
+                                       override:   p_override, 
+                                       checkReady: checkContent });
+                }
                 retryCount = this.POLL_RETRYS;
                 this.startInterval();
             },
 
+            /**
+             * Works the same way as onAvailable, but additionally checks the
+             * state of sibling elements to determine if the content of the
+             * available element is safe to modify.
+             *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
+             * @method onContentReady
+             *
+             * @param {string}   p_id the id of the element to look for.
+             * @param {function} p_fn what to execute when the element is ready.
+             * @param {object}   p_obj an optional object to be passed back as
+             *                   a parameter to p_fn.
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj.  If an object, p_fn will
+             *                   exectute in the scope of that object
+             *
+             * @static
+             */
+            onContentReady: function(p_id, p_fn, p_obj, p_override) {
+                this.onAvailable(p_id, p_fn, p_obj, p_override, true);
+            },
+
             /**
              * Executes the supplied callback when the DOM is first usable.  This
              * will execute immediately if called after the DOMReady event has
@@ -703,7 +779,7 @@ if (!YAHOO.util.Event) {
              * to it when it did so?
              *
              * <p>The callback is a CustomEvent, so the signature is:</p>
-             * <p>type <string>, args <array>, customobject <object></p>
+             * <p>type &lt;string&gt;, args &lt;array&gt;, customobject &lt;object&gt;</p>
              * <p>For DOMReady events, there are no fire argments, so the
              * signature is:</p>
              * <p>"DOMReady", [], obj</p>
@@ -721,7 +797,7 @@ if (!YAHOO.util.Event) {
              * @static
              */
             onDOMReady: function(p_fn, p_obj, p_override) {
-                if (DOMReady) {
+                if (this.DOMReady) {
                     setTimeout(function() {
                         var s = window;
                         if (p_override) {
@@ -738,37 +814,6 @@ if (!YAHOO.util.Event) {
                 }
             },
 
-            /**
-             * Works the same way as onAvailable, but additionally checks the
-             * state of sibling elements to determine if the content of the
-             * available element is safe to modify.
-             *
-             * <p>The callback is executed with a single parameter:
-             * the custom object parameter, if provided.</p>
-             *
-             * @method onContentReady
-             *
-             * @param {string}   p_id the id of the element to look for.
-             * @param {function} p_fn what to execute when the element is ready.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj.  If an object, p_fn will
-             *                   exectute in the scope of that object
-             *
-             * @static
-             */
-            onContentReady: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override,
-                                     checkReady: true      } );
-
-                retryCount = this.POLL_RETRYS;
-                this.startInterval();
-            },
-
             /**
              * Appends an event handler
              *
@@ -863,11 +908,11 @@ if (!YAHOO.util.Event) {
                 // wrap the function so we can return the obj object when
                 // the event fires;
                 var wrappedFn = function(e) {
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e), 
+                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
                                 obj);
                     };
 
-                var li = [el, sType, fn, wrappedFn, scope];
+                var li = [el, sType, fn, wrappedFn, scope, obj, override];
                 var index = listeners.length;
                 // cache the listener so we can try to automatically unload
                 listeners[index] = li;
@@ -1000,7 +1045,7 @@ if (!YAHOO.util.Event) {
              * @static
              */
             removeListener: function(el, sType, fn) {
-                var i, len;
+                var i, len, li;
 
                 // The el argument can be a string
                 if (typeof el == "string") {
@@ -1022,7 +1067,7 @@ if (!YAHOO.util.Event) {
                 if ("unload" == sType) {
 
                     for (i=0, len=unloadListeners.length; i<len; i++) {
-                        var li = unloadListeners[i];
+                        li = unloadListeners[i];
                         if (li && 
                             li[0] == el && 
                             li[1] == sType && 
@@ -1043,7 +1088,7 @@ if (!YAHOO.util.Event) {
                 // try and take advantage of it, which is not possible.
                 var index = arguments[3];
   
-                if ("undefined" == typeof index) {
+                if ("undefined" === typeof index) {
                     index = this._getCacheIndex(el, sType, fn);
                 }
 
@@ -1119,12 +1164,14 @@ if (!YAHOO.util.Event) {
              * @return {HTMLElement} the normized node
              * @static
              */
-            resolveTextNode: function(node) {
-                if (node && 3 == node.nodeType) {
-                    return node.parentNode;
-                } else {
-                    return node;
-                }
+            resolveTextNode: function(n) {
+                try {
+                    if (n && 3 == n.nodeType) {
+                        return n.parentNode;
+                    }
+                } catch(e) { }
+
+                return n;
             },
 
             /**
@@ -1268,10 +1315,11 @@ if (!YAHOO.util.Event) {
              * this function at all.
              * @method getEvent
              * @param {Event} e the event parameter from the handler
+             * @param {HTMLElement} boundEl the element the listener is attached to
              * @return {Event} the event 
              * @static
              */
-            getEvent: function(e) {
+            getEvent: function(e, boundEl) {
                 var ev = e || window.event;
 
                 if (!ev) {
@@ -1298,7 +1346,7 @@ if (!YAHOO.util.Event) {
             getCharCode: function(ev) {
                 var code = ev.keyCode || ev.charCode || 0;
 
-                // webkit normalization
+                // webkit key normalization
                 if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
                     code = webkitKeymap[code];
                 }
@@ -1361,13 +1409,13 @@ if (!YAHOO.util.Event) {
              */
             _isValidCollection: function(o) {
                 try {
-                    return ( o                    && // o is something
-                             o.length             && // o is indexed
-                             typeof o != "string" && // o is not a string
-                             !o.tagName           && // o is not an HTML element
-                             !o.alert             && // o is not a window
-                             typeof o[0] != "undefined" );
-                } catch(e) {
+                    return ( o                     && // o is something
+                             typeof o !== "string" && // o is not a string
+                             o.length              && // o is indexed
+                             !o.tagName            && // o is not an HTML element
+                             !o.alert              && // o is not a window
+                             typeof o[0] !== "undefined" );
+                } catch(ex) {
                     return false;
                 }
 
@@ -1392,7 +1440,7 @@ if (!YAHOO.util.Event) {
              * @deprecated Elements are not cached any longer
              */
             getEl: function(id) {
-                return document.getElementById(id);
+                return (typeof id === "string") ? document.getElementById(id) : id;
             },
 
             /**
@@ -1431,11 +1479,6 @@ if (!YAHOO.util.Event) {
                     // before the window load notification
                     EU._tryPreloadAttach();
 
-                    // Remove the listener to assist with the IE memory issue, but not
-                    // for other browsers because FF 1.0x does not like it.
-                    //if (this.isIE) {
-                        //EU._simpleRemove(window, "load", EU._load);
-                    //}
                 }
             },
 
@@ -1447,9 +1490,9 @@ if (!YAHOO.util.Event) {
              * @private
              */
             _ready: function(e) {
-                if (!DOMReady) {
-                    DOMReady=true;
-                    var EU = YAHOO.util.Event;
+                var EU = YAHOO.util.Event;
+                if (!EU.DOMReady) {
+                    EU.DOMReady=true;
 
                     // Fire the content ready custom event
                     EU.DOMReadyEvent.fire();
@@ -1477,8 +1520,7 @@ if (!YAHOO.util.Event) {
                     // Hold off if DOMReady has not fired and check current
                     // readyState to protect against the IE operation aborted
                     // issue.
-                    //if (!DOMReady || "complete" !== document.readyState) {
-                    if (!DOMReady) {
+                    if (!this.DOMReady) {
                         this.startInterval();
                         return false;
                     }
@@ -1575,19 +1617,18 @@ if (!YAHOO.util.Event) {
              * @static
              */
             purgeElement: function(el, recurse, sType) {
-                var elListeners = this.getListeners(el, sType);
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+                var elListeners = this.getListeners(oEl, sType), i, len;
                 if (elListeners) {
-                    for (var i=0,len=elListeners.length; i<len ; ++i) {
+                    for (i=0,len=elListeners.length; i<len ; ++i) {
                         var l = elListeners[i];
-                        // can't use the index on the changing collection
-                        this.removeListener(el, l.type, l.fn, l.index);
-                        //this.removeListener(el, l.type, l.fn);
+                        this.removeListener(oEl, l.type, l.fn, l.index);
                     }
                 }
 
-                if (recurse && el && el.childNodes) {
-                    for (i=0,len=el.childNodes.length; i<len ; ++i) {
-                        this.purgeElement(el.childNodes[i], recurse, sType);
+                if (recurse && oEl && oEl.childNodes) {
+                    for (i=0,len=oEl.childNodes.length; i<len ; ++i) {
+                        this.purgeElement(oEl.childNodes[i], recurse, sType);
                     }
                 }
             },
@@ -1596,14 +1637,15 @@ if (!YAHOO.util.Event) {
              * Returns all listeners attached to the given element via addListener.
              * Optionally, you can specify a specific type of event to return.
              * @method getListeners
-             * @param el {HTMLElement} the element to inspect 
+             * @param el {HTMLElement|string} the element or element id to inspect 
              * @param sType {string} optional type of listener to return. If
              * left out, all listeners will be returned
              * @return {Object} the listener. Contains the following fields:
              * &nbsp;&nbsp;type:   (string)   the type of event
              * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
              * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
-             * &nbsp;&nbsp;adjust: (boolean)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
              * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
              * @static
              */           
@@ -1611,24 +1653,27 @@ if (!YAHOO.util.Event) {
                 var results=[], searchLists;
                 if (!sType) {
                     searchLists = [listeners, unloadListeners];
-                } else if (sType == "unload") {
+                } else if (sType === "unload") {
                     searchLists = [unloadListeners];
                 } else {
                     searchLists = [listeners];
                 }
 
-                for (var j=0;j<searchLists.length; ++j) {
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+
+                for (var j=0;j<searchLists.length; j=j+1) {
                     var searchList = searchLists[j];
                     if (searchList && searchList.length > 0) {
                         for (var i=0,len=searchList.length; i<len ; ++i) {
                             var l = searchList[i];
-                            if ( l  && l[this.EL] === el && 
+                            if ( l  && l[this.EL] === oEl && 
                                     (!sType || sType === l[this.TYPE]) ) {
                                 results.push({
                                     type:   l[this.TYPE],
                                     fn:     l[this.FN],
                                     obj:    l[this.OBJ],
-                                    adjust: l[this.ADJ_SCOPE],
+                                    adjust: l[this.OVERRIDE],
+                                    scope:  l[this.ADJ_SCOPE],
                                     index:  i
                                 });
                             }
@@ -1650,18 +1695,19 @@ if (!YAHOO.util.Event) {
 
                 var EU = YAHOO.util.Event, i, j, l, len, index;
 
+                // execute and clear stored unload listeners
                 for (i=0,len=unloadListeners.length; i<len; ++i) {
                     l = unloadListeners[i];
                     if (l) {
                         var scope = window;
                         if (l[EU.ADJ_SCOPE]) {
                             if (l[EU.ADJ_SCOPE] === true) {
-                                scope = l[EU.OBJ];
+                                scope = l[EU.UNLOAD_OBJ];
                             } else {
                                 scope = l[EU.ADJ_SCOPE];
                             }
                         }
-                        l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );
+                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
                         unloadListeners[i] = null;
                         l=null;
                         scope=null;
@@ -1670,6 +1716,13 @@ if (!YAHOO.util.Event) {
 
                 unloadListeners = null;
 
+                // Remove listeners to handle IE memory leaks
+                //if (YAHOO.env.ua.ie && listeners && listeners.length > 0) {
+                
+                // 2.5.0 listeners are removed for all browsers again.  FireFox preserves
+                // at least some listeners between page refreshes, potentially causing
+                // errors during page load (mouseover listeners firing before they
+                // should if the user moves the mouse at the correct moment).
                 if (listeners && listeners.length > 0) {
                     j = listeners.length;
                     while (j) {
@@ -1678,21 +1731,9 @@ if (!YAHOO.util.Event) {
                         if (l) {
                             EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
                         } 
-                        j = j - 1;
+                        j--;
                     }
                     l=null;
-
-                    EU.clearCache();
-                }
-
-                for (i=0,len=legacyEvents.length; i<len; ++i) {
-                    // dereference the element
-                    //delete legacyEvents[i][0];
-                    legacyEvents[i][0] = null;
-
-                    // delete the array item
-                    //delete legacyEvents[i];
-                    legacyEvents[i] = null;
                 }
 
                 legacyEvents = null;
@@ -1815,9 +1856,7 @@ if (!YAHOO.util.Event) {
          */
         EU.on = EU.addListener;
 
-        /////////////////////////////////////////////////////////////
-        // DOMReady
-        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
 
         // Internet Explorer: use the readyState of a defered script.
         // This isolates what appears to be a safe moment to manipulate
@@ -1831,70 +1870,38 @@ if (!YAHOO.util.Event) {
                     YAHOO.util.Event._tryPreloadAttach,
                     YAHOO.util.Event, true);
 
-
-            var el, d=document, b=d.body;
-
-            // If the library is being injected after window.onload, it
-            // is not safe to document.write the script tag.  Detecting
-            // this state doesn't appear possible, so we expect a flag
-            // in YAHOO_config to be set if the library is being injected.
-            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
-
-
-                //var dr = d.readyState;
-                //if ("complete" === dr || "interactive" === dr) {
-                    //YAHOO.util.Event._ready();
-                    //YAHOO.util.Event._tryPreloadAttach();
-                //} else {
-
-                    el = document.createElement("script");
-                    var p=d.getElementsByTagName("head")[0] || b;
-                    p.insertBefore(el, p.firstChild);
-
-                //}
-
-            } else {
-    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
-                el=document.getElementById("_yui_eu_dr");
-            }
-            
-
-            if (el) {
-                el.onreadystatechange = function() {
-                    if ("complete" === this.readyState) {
-                        this.parentNode.removeChild(this);
-                        YAHOO.util.Event._ready();
-                    }
-                };
-            } else {
-                // The library was likely injected into the page
-                // rendering onDOMReady unreliable
-                // YAHOO.util.Event._ready();
-            }
-
-            el=null;
+            EU._dri = setInterval(function() {
+                var n = document.createElement('p');  
+                try {
+                    // throws an error if doc is not ready
+                    n.doScroll('left');
+                    clearInterval(EU._dri);
+                    EU._dri = null;
+                    EU._ready();
+                    n = null;
+                } catch (ex) { 
+                    n = null;
+                }
+            }, EU.POLL_INTERVAL); 
 
         
-        // Safari: The document's readyState in Safari currently will
+        // The document's readyState in Safari currently will
         // change to loaded/complete before images are loaded.
-        //} else if (EU.webkit) {
-        } else if (EU.webkit) {
+        } else if (EU.webkit && EU.webkit < 525) {
 
-            EU._drwatch = setInterval(function(){
+            EU._dri = setInterval(function() {
                 var rs=document.readyState;
                 if ("loaded" == rs || "complete" == rs) {
-                    clearInterval(EU._drwatch);
-                    EU._drwatch = null;
+                    clearInterval(EU._dri);
+                    EU._dri = null;
                     EU._ready();
                 }
             }, EU.POLL_INTERVAL); 
 
         // FireFox and Opera: These browsers provide a event for this
-        // moment.
+        // moment.  The latest WebKit releases now support this event.
         } else {
 
-            // @todo will this fire when the library is injected?
-
             EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
 
         }
@@ -1989,8 +1996,8 @@ YAHOO.util.EventProvider.prototype = {
                 return ce.unsubscribe(p_fn, p_obj);
             }
         } else {
+            var ret = true;
             for (var i in evts) {
-                var ret = true;
                 if (YAHOO.lang.hasOwnProperty(evts, i)) {
                     ret = ret && evts[i].unsubscribe(p_fn, p_obj);
                 }
@@ -2234,7 +2241,6 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
             e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
             
             var dataItem;
-            var keyPressed;
 
             if (keyData.keys instanceof Array) {
                 for (var i=0;i<keyData.keys.length;i++) {
@@ -2319,4 +2325,36 @@ YAHOO.util.KeyListener.KEYDOWN = "keydown";
 * @type String
 */
 YAHOO.util.KeyListener.KEYUP = "keyup";
-YAHOO.register("event", YAHOO.util.Event, {version: "2.3.0", build: "442"});
+
+/**
+ * keycode constants for a subset of the special keys
+ * @property KEY
+ * @static
+ * @final
+ */
+YAHOO.util.KeyListener.KEY = {
+    ALT          : 18,
+    BACK_SPACE   : 8,
+    CAPS_LOCK    : 20,
+    CONTROL      : 17,
+    DELETE       : 46,
+    DOWN         : 40,
+    END          : 35,
+    ENTER        : 13,
+    ESCAPE       : 27,
+    HOME         : 36,
+    LEFT         : 37,
+    META         : 224,
+    NUM_LOCK     : 144,
+    PAGE_DOWN    : 34,
+    PAGE_UP      : 33, 
+    PAUSE        : 19,
+    PRINTSCREEN  : 44,
+    RIGHT        : 39,
+    SCROLL_LOCK  : 145,
+    SHIFT        : 16,
+    SPACE        : 32,
+    TAB          : 9,
+    UP           : 38
+};
+YAHOO.register("event", YAHOO.util.Event, {version: "2.5.0", build: "895"});
index 259b40e84a1c7f83c4c93c32956fe56d59e34380..68985afbe04d6f36b2ff20b30ea2550f6ebbd387 100755 (executable)
@@ -1,5 +1,14 @@
 YUI Library - Fonts - Release Notes
 
+Version 2.5.0
+
+  * No changes.
+
+Version 2.4.0
+
+  * Rechanged core line-height from 1.22 to 1.231, sans units.
+  * Updated line-height value for monospcaed elements. 
+
 Version 2.3.0
 
   * Updated %-to-px conversion charted for increased accuracy
index 2ea440ffcb34bb7411f4a424b43747f187bc76fb..c5bc0e18f44fdaf6d83a295dfc3a721f394f0115 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:99%;}
+body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
index ffa12ffb53506242036d4b53bb8b535ea9f611df..6e2f45093c9d0644819e45cf17853a2df8bcd5e9 100755 (executable)
@@ -1,16 +1,16 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * Percents could work for IE, but for backCompat purposes, we are using keywords.
  * x-small is for IE6/7 quirks mode.
  */
-body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
+body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
 table {font-size:inherit;font:100%;}
 /**
  * Bump up IE to get to 13px equivalent
  */
-pre,code,kbd,samp,tt {font-family:monospace;*font-size:108%;line-height:99%;}
+pre,code,kbd,samp,tt {font-family:monospace;*font-size:108%;line-height:100%;}
diff --git a/lib/yui/get/README b/lib/yui/get/README
new file mode 100644 (file)
index 0000000..cf697a1
--- /dev/null
@@ -0,0 +1,11 @@
+get - Release Notes
+
+2.5.0
+    * autopurge no longer attempts to remove nodes that have been
+      removed previously.
+
+2.4.1
+   * No change
+
+2.4.0
+   * Inital release
diff --git a/lib/yui/get/get-debug.js b/lib/yui/get/get-debug.js
new file mode 100644 (file)
index 0000000..b666657
--- /dev/null
@@ -0,0 +1,645 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Provides a mechanism to fetch remote resources and
+ * insert them into a document
+ * @module get
+ * @requires yahoo
+ */
+
+/**
+ * Fetches and inserts one or more script or link nodes into the document 
+ * @namespace YAHOO.util
+ * @class YAHOO.util.Get
+ */
+YAHOO.util.Get = function() {
+
+    /**
+     * hash of queues to manage multiple requests
+     * @property queues
+     * @private
+     */
+    var queues={}, 
+        
+    /**
+     * queue index used to generate transaction ids
+     * @property qidx
+     * @type int
+     * @private
+     */
+        qidx=0, 
+        
+    /**
+     * node index used to generate unique node ids
+     * @property nidx
+     * @type int
+     * @private
+     */
+        nidx=0, 
+
+        // ridx=0,
+
+        // sandboxFrame=null,
+
+    /**
+     * interal property used to prevent multiple simultaneous purge 
+     * processes
+     * @property purging
+     * @type boolean
+     * @private
+     */
+        purging=false,
+
+        ua=YAHOO.env.ua, 
+        
+        lang=YAHOO.lang;
+    
+    /** 
+     * Generates an HTML element, this is not appended to a document
+     * @method _node
+     * @param type {string} the type of element
+     * @param attr {string} the attributes
+     * @param win {Window} optional window to create the element in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _node = function(type, attr, win) {
+        var w = win || window, d=w.document, n=d.createElement(type);
+
+        for (var i in attr) {
+            if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
+                n.setAttribute(i, attr[i]);
+            }
+        }
+
+        return n;
+    };
+
+    /**
+     * Generates a link node
+     * @method _linkNode
+     * @param url {string} the url for the css file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _linkNode = function(url, win) {
+        return _node("link", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/css",
+                "rel": "stylesheet",
+                "href": url
+            }, win);
+    };
+
+    /**
+     * Generates a script node
+     * @method _scriptNode
+     * @param url {string} the url for the script file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _scriptNode = function(url, win) {
+        return _node("script", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/javascript",
+                "src": url
+            }, win);
+    };
+
+    /**
+     * Returns the data payload for callback functions
+     * @method _returnData
+     * @private
+     */
+    var _returnData = function(q) {
+        return {
+                tId: q.tId,
+                win: q.win,
+                data: q.data,
+                nodes: q.nodes,
+                purge: function() {
+                    _purge(this.tId);
+                }
+            };
+    };
+
+    /*
+     * The request failed, execute fail handler with whatever
+     * was accomplished.  There isn't a failure case at the
+     * moment unless you count aborted transactions
+     * @method _fail
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _fail = function(id) {
+        var q = queues[id];
+        // execute failure callback
+        if (q.onFailure) {
+            var sc=q.scope || q.win;
+            q.onFailure.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * The request is complete, so executing the requester's callback
+     * @method _finish
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _finish = function(id) {
+        YAHOO.log("Finishing transaction " + id);
+        var q = queues[id];
+        q.finished = true;
+
+        if (q.aborted) {
+            YAHOO.log("transaction " + id + " was aborted", "info", "Get");
+            _fail(id);
+            return;
+        }
+
+        // execute success callback
+        if (q.onSuccess) {
+            var sc=q.scope || q.win;
+            q.onSuccess.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * Loads the next item for a given request
+     * @method _next
+     * @param id {string} the id of the request
+     * @param loaded {string} the url that was just loaded, if any
+     * @private
+     */
+    var _next = function(id, loaded) {
+        YAHOO.log("_next: " + id + ", loaded: " + loaded, "info", "Get");
+        var q = queues[id];
+
+        if (q.aborted) {
+            YAHOO.log("transaction " + id + " was aborted", "info", "Get");
+            _fail(id);
+            return;
+        }
+
+        if (loaded) {
+            q.url.shift(); 
+            if (q.varName) {
+                q.varName.shift(); 
+            }
+        } else {
+            // This is the first pass: make sure the url is an array
+            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
+            if (q.varName) {
+                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
+            }
+        }
+
+        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
+
+        if (q.url.length === 0) {
+            // Safari 2.x workaround - There is no way to know when 
+            // a script is ready in versions of Safari prior to 3.x.
+            // Adding an extra node reduces the problem, but doesn't
+            // eliminate it completely because the browser executes
+            // them asynchronously. 
+            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
+                    !q.finalpass && !q.varName) {
+                // Add another script node.  This does not guarantee that the
+                // scripts will execute in order, but it does appear to fix the
+                // problem on fast connections more effectively than using an
+                // arbitrary timeout.  It is possible that the browser does
+                // block subsequent script execution in this case for a limited
+                // time.
+                var extra = _scriptNode(null, q.win);
+                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
+                q.nodes.push(extra); h.appendChild(extra);
+
+            } else {
+                _finish(id);
+            }
+
+            return;
+        } 
+
+
+        var url = q.url[0];
+        YAHOO.log("attempting to load " + url, "info", "Get");
+
+        if (q.type === "script") {
+            n = _scriptNode(url, w);
+        } else {
+            n = _linkNode(url, w);
+        }
+
+        // track this node's load progress
+        _track(q.type, n, id, url, w, q.url.length);
+
+        // add the node to the queue so we can return it to the user supplied callback
+        q.nodes.push(n);
+
+        // add it to the head
+        h.appendChild(n);
+        
+        YAHOO.log("Appending node: " + url, "info", "Get");
+
+        // FireFox does not support the onload event for link nodes, so there is
+        // no way to make the css requests synchronous. This means that the css 
+        // rules in multiple files could be applied out of order in this browser
+        // if a later request returns before an earlier one.  Safari too.
+        if ((ua.webkit || ua.gecko) && q.type === "css") {
+            _next(id, url);
+        }
+    };
+
+    /**
+     * Removes processed queues and corresponding nodes
+     * @method _autoPurge
+     * @private
+     */
+    var _autoPurge = function() {
+
+        if (purging) {
+            return;
+        }
+
+        purging = true;
+        for (var i in queues) {
+            var q = queues[i];
+            if (q.autopurge && q.finished) {
+                _purge(q.tId);
+                delete queues[i];
+            }
+        }
+
+        purging = false;
+    };
+
+    /**
+     * Removes the nodes for the specified queue
+     * @method _purge
+     * @private
+     */
+    var _purge = function(tId) {
+        var q=queues[tId];
+        if (q) {
+            var n=q.nodes, l=n.length, d=q.win.document, 
+                h=d.getElementsByTagName("head")[0];
+            for (var i=0; i<l; i=i+1) {
+                h.removeChild(n[i]);
+            }
+        }
+        q.nodes = [];
+    };
+
+    /**
+     * Saves the state for the request and begins loading
+     * the requested urls
+     * @method queue
+     * @param type {string} the type of node to insert
+     * @param url {string} the url to load
+     * @param opts the hash of options for this request
+     * @private
+     */
+    var _queue = function(type, url, opts) {
+
+        var id = "q" + (qidx++);
+        opts = opts || {};
+
+        if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
+            _autoPurge();
+        }
+
+        queues[id] = lang.merge(opts, {
+            tId: id,
+            type: type,
+            url: url,
+            finished: false,
+            nodes: []
+        });
+
+        var q = queues[id];
+        q.win = q.win || window;
+        q.scope = q.scope || q.win;
+        q.autopurge = ("autopurge" in q) ? q.autopurge : 
+                      (type === "script") ? true : false;
+
+        lang.later(0, q, _next, id);
+
+        return {
+            tId: id
+        };
+    };
+
+    /**
+     * Detects when a node has been loaded.  In the case of
+     * script nodes, this does not guarantee that contained
+     * script is ready to use.
+     * @method _track
+     * @param type {string} the type of node to track
+     * @param n {HTMLElement} the node to track
+     * @param id {string} the id of the request
+     * @param url {string} the url that is being loaded
+     * @param win {Window} the targeted window
+     * @param qlength the number of remaining items in the queue,
+     * including this one
+     * @param trackfn {Function} function to execute when finished
+     * the default is _next
+     * @private
+     */
+    var _track = function(type, n, id, url, win, qlength, trackfn) {
+        var f = trackfn || _next;
+
+        // IE supports the readystatechange event for script and css nodes
+        if (ua.ie) {
+            n.onreadystatechange = function() {
+                var rs = this.readyState;
+                if ("loaded" === rs || "complete" === rs) {
+                    YAHOO.log(id + " onload " + url, "info", "Get");
+                    f(id, url);
+                }
+            };
+
+        // webkit prior to 3.x is problemmatic
+        } else if (ua.webkit) {
+
+            if (type === "script") {
+
+                // Safari 3.x supports the load event for script nodes (DOM2)
+                if (ua.webkit > 419) {
+
+                    n.addEventListener("load", function() {
+                        YAHOO.log(id + " DOM2 onload " + url, "info", "Get");
+                        f(id, url);
+                    });
+
+                // Nothing can be done with Safari < 3.x except to pause and hope
+                // for the best, particularly after last script is inserted. The
+                // scripts will always execute in the order they arrive, not
+                // necessarily the order in which they were inserted.  To support
+                // script nodes with complete reliability in these browsers, script
+                // nodes either need to invoke a function in the window once they
+                // are loaded or the implementer needs to provide a well-known
+                // property that the utility can poll for.
+                } else {
+                    // Poll for the existence of the named variable, if it
+                    // was supplied.
+                    var q = queues[id];
+                    if (q.varName) {
+                        var freq=YAHOO.util.Get.POLL_FREQ;
+                        YAHOO.log("Polling for " + q.varName[0]);
+                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
+                        q.attempts = 0;
+                        q._cache = q.varName[0].split(".");
+                        q.timer = lang.later(freq, q, function(o) {
+                            var a=this._cache, l=a.length, w=this.win, i;
+                            for (i=0; i<l; i=i+1) {
+                                w = w[a[i]];
+                                if (!w) {
+                                    // if we have exausted our attempts, give up
+                                    this.attempts++;
+                                    if (this.attempts++ > this.maxattempts) {
+                                        YAHOO.log("Over retry limit, giving up");
+                                        q.timer.cancel();
+                                        _fail(id);
+                                    } else {
+                                        YAHOO.log(a[i] + " failed, retrying");
+                                    }
+                                    return;
+                                }
+                            }
+                            
+                            YAHOO.log("Safari poll complete");
+
+                            q.timer.cancel();
+                            f(id, url);
+
+                        }, null, true);
+                    } else {
+                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
+                    }
+                }
+            } 
+
+        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
+        // script nodes.  Opera, but not FF, supports the onload event for link
+        // nodes.
+        } else { 
+            n.onload = function() {
+                YAHOO.log(id + " onload " + url, "info", "Get");
+                f(id, url);
+            };
+        }
+    };
+
+    return {
+
+        /**
+         * The default poll freqency in ms, when needed
+         * @property POLL_FREQ
+         * @static
+         * @type int
+         * @default 10
+         */
+        POLL_FREQ: 10,
+
+        /**
+         * The number of request required before an automatic purge.
+         * property PURGE_THRESH
+         * @static
+         * @type int
+         * @default 20
+         */
+        PURGE_THRESH: 20,
+
+        /**
+         * The length time to poll for varName when loading a script in
+         * Safari 2.x before the transaction fails.
+         * property TIMEOUT
+         * @static
+         * @type int
+         * @default 2000
+         */
+        TIMEOUT: 2000,
+        
+        /**
+         * Called by the the helper for detecting script load in Safari
+         * @method _finalize
+         * @param id {string} the transaction id
+         * @private
+         */
+        _finalize: function(id) {
+            YAHOO.log(id + " finalized ", "info", "Get");
+            lang.later(0, null, _finish, id);
+        },
+
+        /**
+         * Abort a transaction
+         * @method abort
+         * @param {string|object} either the tId or the object returned from
+         * script() or css()
+         */
+        abort: function(o) {
+            var id = (lang.isString(o)) ? o : o.tId;
+            var q = queues[id];
+            if (q) {
+                YAHOO.log("Aborting " + id, "info", "Get");
+                q.aborted = true;
+            }
+        }, 
+
+        /**
+         * Fetches and inserts one or more script nodes into the head
+         * of the current document or the document in a specified window.
+         *
+         * @method script
+         * @static
+         * @param url {string|string[]} the url or urls to the script(s)
+         * @param opts {object} Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the script(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>onFailure</dt>
+         * <dd>
+         * callback to execute when the script load operation fails
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted successfully</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove any nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>autopurge</dt>
+         * <dd>
+         * setting to true will let the utilities cleanup routine purge 
+         * the script once loaded
+         * </dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callback when the script(s) are
+         * loaded.
+         * </dd>
+         * <dt>varName</dt>
+         * <dd>
+         * variable that should be available when a script is finished
+         * loading.  Used to help Safari 2.x and below with script load 
+         * detection.  The type of this property should match what was
+         * passed into the url parameter: if loading a single url, a
+         * string can be supplied.  If loading multiple scripts, you
+         * must supply an array that contains the variable name for
+         * each script.
+         * </dd>
+         * </dl>
+         * <pre>
+         * // assumes yahoo, dom, and event are already on the page
+         * &nbsp;&nbsp;YAHOO.util.Get.script(
+         * &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
+         * &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YAHOO.log(o.data); // foo
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log("won't cause error because YAHOO is the scope");
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log(o.nodes.length === 2) // true
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// o.purge(); // optionally remove the script nodes immediately
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;onFailure: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YAHOO.log("transaction failed");
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;data: "foo",
+         * &nbsp;&nbsp;&nbsp;&nbsp;scope: YAHOO,
+         * &nbsp;&nbsp;&nbsp;&nbsp;// win: otherframe // target another window/frame
+         * &nbsp;&nbsp;&nbsp;&nbsp;autopurge: true // allow the utility to choose when to remove the nodes
+         * &nbsp;&nbsp;&#125;);
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        script: function(url, opts) { return _queue("script", url, opts); },
+
+        /**
+         * Fetches and inserts one or more css link nodes into the 
+         * head of the current document or the document in a specified
+         * window.
+         * @method css
+         * @static
+         * @param url {string} the url or urls to the css file(s)
+         * @param opts Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the css file(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>win</dl>
+         * <dd>the window the link nodes(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callbacks when the nodes(s) are
+         * loaded.
+         * </dd>
+         * </dl>
+         * <pre>
+         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
+         * </pre>
+         * <pre>
+         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
+         *                          "http://yui.yahooapis.com/2.3.1/build/logger/assets/skins/sam/logger.css"]);
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        css: function(url, opts) {
+            return _queue("css", url, opts); 
+        }
+    };
+}();
+
+YAHOO.register("get", YAHOO.util.Get, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/get/get-min.js b/lib/yui/get/get-min.js
new file mode 100644 (file)
index 0000000..2eda847
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.util.Get=function(){var I={},H=0,B=0,O=false,A=YAHOO.env.ua,D=YAHOO.lang;var Q=function(U,R,V){var S=V||window,W=S.document,X=W.createElement(U);for(var T in R){if(R[T]&&YAHOO.lang.hasOwnProperty(R,T)){X.setAttribute(T,R[T]);}}return X;};var N=function(R,S){return Q("link",{"id":"yui__dyn_"+(B++),"type":"text/css","rel":"stylesheet","href":R},S);};var M=function(R,S){return Q("script",{"id":"yui__dyn_"+(B++),"type":"text/javascript","src":R},S);};var K=function(R){return{tId:R.tId,win:R.win,data:R.data,nodes:R.nodes,purge:function(){J(this.tId);}};};var P=function(T){var R=I[T];if(R.onFailure){var S=R.scope||R.win;R.onFailure.call(S,K(R));}};var F=function(T){var R=I[T];R.finished=true;if(R.aborted){P(T);return ;}if(R.onSuccess){var S=R.scope||R.win;R.onSuccess.call(S,K(R));}};var E=function(T,W){var S=I[T];if(S.aborted){P(T);return ;}if(W){S.url.shift();if(S.varName){S.varName.shift();}}else{S.url=(D.isString(S.url))?[S.url]:S.url;if(S.varName){S.varName=(D.isString(S.varName))?[S.varName]:S.varName;}}var Z=S.win,Y=Z.document,X=Y.getElementsByTagName("head")[0],U;if(S.url.length===0){if(S.type==="script"&&A.webkit&&A.webkit<420&&!S.finalpass&&!S.varName){var V=M(null,S.win);V.innerHTML='YAHOO.util.Get._finalize("'+T+'");';S.nodes.push(V);X.appendChild(V);}else{F(T);}return ;}var R=S.url[0];if(S.type==="script"){U=M(R,Z);}else{U=N(R,Z);}G(S.type,U,T,R,Z,S.url.length);S.nodes.push(U);X.appendChild(U);if((A.webkit||A.gecko)&&S.type==="css"){E(T,R);}};var C=function(){if(O){return ;}O=true;for(var R in I){var S=I[R];if(S.autopurge&&S.finished){J(S.tId);delete I[R];}}O=false;};var J=function(X){var U=I[X];if(U){var W=U.nodes,R=W.length,V=U.win.document,T=V.getElementsByTagName("head")[0];for(var S=0;S<R;S=S+1){T.removeChild(W[S]);}}U.nodes=[];};var L=function(S,R,T){var V="q"+(H++);T=T||{};if(H%YAHOO.util.Get.PURGE_THRESH===0){C();}I[V]=D.merge(T,{tId:V,type:S,url:R,finished:false,nodes:[]});var U=I[V];U.win=U.win||window;U.scope=U.scope||U.win;U.autopurge=("autopurge" in U)?U.autopurge:(S==="script")?true:false;D.later(0,U,E,V);return{tId:V};};var G=function(a,V,U,S,W,X,Z){var Y=Z||E;if(A.ie){V.onreadystatechange=function(){var b=this.readyState;if("loaded"===b||"complete"===b){Y(U,S);}};}else{if(A.webkit){if(a==="script"){if(A.webkit>419){V.addEventListener("load",function(){Y(U,S);});}else{var R=I[U];if(R.varName){var T=YAHOO.util.Get.POLL_FREQ;R.maxattempts=YAHOO.util.Get.TIMEOUT/T;R.attempts=0;R._cache=R.varName[0].split(".");R.timer=D.later(T,R,function(f){var d=this._cache,c=d.length,b=this.win,e;for(e=0;e<c;e=e+1){b=b[d[e]];if(!b){this.attempts++;if(this.attempts++>this.maxattempts){R.timer.cancel();P(U);}else{}return ;}}R.timer.cancel();Y(U,S);},null,true);}else{D.later(YAHOO.util.Get.POLL_FREQ,null,Y,[U,S]);}}}}else{V.onload=function(){Y(U,S);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(R){D.later(0,null,F,R);},abort:function(S){var T=(D.isString(S))?S:S.tId;var R=I[T];if(R){R.aborted=true;}},script:function(R,S){return L("script",R,S);},css:function(R,S){return L("css",R,S);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/get/get.js b/lib/yui/get/get.js
new file mode 100644 (file)
index 0000000..55cd778
--- /dev/null
@@ -0,0 +1,627 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * Provides a mechanism to fetch remote resources and
+ * insert them into a document
+ * @module get
+ * @requires yahoo
+ */
+
+/**
+ * Fetches and inserts one or more script or link nodes into the document 
+ * @namespace YAHOO.util
+ * @class YAHOO.util.Get
+ */
+YAHOO.util.Get = function() {
+
+    /**
+     * hash of queues to manage multiple requests
+     * @property queues
+     * @private
+     */
+    var queues={}, 
+        
+    /**
+     * queue index used to generate transaction ids
+     * @property qidx
+     * @type int
+     * @private
+     */
+        qidx=0, 
+        
+    /**
+     * node index used to generate unique node ids
+     * @property nidx
+     * @type int
+     * @private
+     */
+        nidx=0, 
+
+        // ridx=0,
+
+        // sandboxFrame=null,
+
+    /**
+     * interal property used to prevent multiple simultaneous purge 
+     * processes
+     * @property purging
+     * @type boolean
+     * @private
+     */
+        purging=false,
+
+        ua=YAHOO.env.ua, 
+        
+        lang=YAHOO.lang;
+    
+    /** 
+     * Generates an HTML element, this is not appended to a document
+     * @method _node
+     * @param type {string} the type of element
+     * @param attr {string} the attributes
+     * @param win {Window} optional window to create the element in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _node = function(type, attr, win) {
+        var w = win || window, d=w.document, n=d.createElement(type);
+
+        for (var i in attr) {
+            if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
+                n.setAttribute(i, attr[i]);
+            }
+        }
+
+        return n;
+    };
+
+    /**
+     * Generates a link node
+     * @method _linkNode
+     * @param url {string} the url for the css file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _linkNode = function(url, win) {
+        return _node("link", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/css",
+                "rel": "stylesheet",
+                "href": url
+            }, win);
+    };
+
+    /**
+     * Generates a script node
+     * @method _scriptNode
+     * @param url {string} the url for the script file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _scriptNode = function(url, win) {
+        return _node("script", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/javascript",
+                "src": url
+            }, win);
+    };
+
+    /**
+     * Returns the data payload for callback functions
+     * @method _returnData
+     * @private
+     */
+    var _returnData = function(q) {
+        return {
+                tId: q.tId,
+                win: q.win,
+                data: q.data,
+                nodes: q.nodes,
+                purge: function() {
+                    _purge(this.tId);
+                }
+            };
+    };
+
+    /*
+     * The request failed, execute fail handler with whatever
+     * was accomplished.  There isn't a failure case at the
+     * moment unless you count aborted transactions
+     * @method _fail
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _fail = function(id) {
+        var q = queues[id];
+        // execute failure callback
+        if (q.onFailure) {
+            var sc=q.scope || q.win;
+            q.onFailure.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * The request is complete, so executing the requester's callback
+     * @method _finish
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _finish = function(id) {
+        var q = queues[id];
+        q.finished = true;
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        // execute success callback
+        if (q.onSuccess) {
+            var sc=q.scope || q.win;
+            q.onSuccess.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * Loads the next item for a given request
+     * @method _next
+     * @param id {string} the id of the request
+     * @param loaded {string} the url that was just loaded, if any
+     * @private
+     */
+    var _next = function(id, loaded) {
+        var q = queues[id];
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        if (loaded) {
+            q.url.shift(); 
+            if (q.varName) {
+                q.varName.shift(); 
+            }
+        } else {
+            // This is the first pass: make sure the url is an array
+            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
+            if (q.varName) {
+                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
+            }
+        }
+
+        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
+
+        if (q.url.length === 0) {
+            // Safari 2.x workaround - There is no way to know when 
+            // a script is ready in versions of Safari prior to 3.x.
+            // Adding an extra node reduces the problem, but doesn't
+            // eliminate it completely because the browser executes
+            // them asynchronously. 
+            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
+                    !q.finalpass && !q.varName) {
+                // Add another script node.  This does not guarantee that the
+                // scripts will execute in order, but it does appear to fix the
+                // problem on fast connections more effectively than using an
+                // arbitrary timeout.  It is possible that the browser does
+                // block subsequent script execution in this case for a limited
+                // time.
+                var extra = _scriptNode(null, q.win);
+                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
+                q.nodes.push(extra); h.appendChild(extra);
+
+            } else {
+                _finish(id);
+            }
+
+            return;
+        } 
+
+
+        var url = q.url[0];
+
+        if (q.type === "script") {
+            n = _scriptNode(url, w);
+        } else {
+            n = _linkNode(url, w);
+        }
+
+        // track this node's load progress
+        _track(q.type, n, id, url, w, q.url.length);
+
+        // add the node to the queue so we can return it to the user supplied callback
+        q.nodes.push(n);
+
+        // add it to the head
+        h.appendChild(n);
+        
+
+        // FireFox does not support the onload event for link nodes, so there is
+        // no way to make the css requests synchronous. This means that the css 
+        // rules in multiple files could be applied out of order in this browser
+        // if a later request returns before an earlier one.  Safari too.
+        if ((ua.webkit || ua.gecko) && q.type === "css") {
+            _next(id, url);
+        }
+    };
+
+    /**
+     * Removes processed queues and corresponding nodes
+     * @method _autoPurge
+     * @private
+     */
+    var _autoPurge = function() {
+
+        if (purging) {
+            return;
+        }
+
+        purging = true;
+        for (var i in queues) {
+            var q = queues[i];
+            if (q.autopurge && q.finished) {
+                _purge(q.tId);
+                delete queues[i];
+            }
+        }
+
+        purging = false;
+    };
+
+    /**
+     * Removes the nodes for the specified queue
+     * @method _purge
+     * @private
+     */
+    var _purge = function(tId) {
+        var q=queues[tId];
+        if (q) {
+            var n=q.nodes, l=n.length, d=q.win.document, 
+                h=d.getElementsByTagName("head")[0];
+            for (var i=0; i<l; i=i+1) {
+                h.removeChild(n[i]);
+            }
+        }
+        q.nodes = [];
+    };
+
+    /**
+     * Saves the state for the request and begins loading
+     * the requested urls
+     * @method queue
+     * @param type {string} the type of node to insert
+     * @param url {string} the url to load
+     * @param opts the hash of options for this request
+     * @private
+     */
+    var _queue = function(type, url, opts) {
+
+        var id = "q" + (qidx++);
+        opts = opts || {};
+
+        if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
+            _autoPurge();
+        }
+
+        queues[id] = lang.merge(opts, {
+            tId: id,
+            type: type,
+            url: url,
+            finished: false,
+            nodes: []
+        });
+
+        var q = queues[id];
+        q.win = q.win || window;
+        q.scope = q.scope || q.win;
+        q.autopurge = ("autopurge" in q) ? q.autopurge : 
+                      (type === "script") ? true : false;
+
+        lang.later(0, q, _next, id);
+
+        return {
+            tId: id
+        };
+    };
+
+    /**
+     * Detects when a node has been loaded.  In the case of
+     * script nodes, this does not guarantee that contained
+     * script is ready to use.
+     * @method _track
+     * @param type {string} the type of node to track
+     * @param n {HTMLElement} the node to track
+     * @param id {string} the id of the request
+     * @param url {string} the url that is being loaded
+     * @param win {Window} the targeted window
+     * @param qlength the number of remaining items in the queue,
+     * including this one
+     * @param trackfn {Function} function to execute when finished
+     * the default is _next
+     * @private
+     */
+    var _track = function(type, n, id, url, win, qlength, trackfn) {
+        var f = trackfn || _next;
+
+        // IE supports the readystatechange event for script and css nodes
+        if (ua.ie) {
+            n.onreadystatechange = function() {
+                var rs = this.readyState;
+                if ("loaded" === rs || "complete" === rs) {
+                    f(id, url);
+                }
+            };
+
+        // webkit prior to 3.x is problemmatic
+        } else if (ua.webkit) {
+
+            if (type === "script") {
+
+                // Safari 3.x supports the load event for script nodes (DOM2)
+                if (ua.webkit > 419) {
+
+                    n.addEventListener("load", function() {
+                        f(id, url);
+                    });
+
+                // Nothing can be done with Safari < 3.x except to pause and hope
+                // for the best, particularly after last script is inserted. The
+                // scripts will always execute in the order they arrive, not
+                // necessarily the order in which they were inserted.  To support
+                // script nodes with complete reliability in these browsers, script
+                // nodes either need to invoke a function in the window once they
+                // are loaded or the implementer needs to provide a well-known
+                // property that the utility can poll for.
+                } else {
+                    // Poll for the existence of the named variable, if it
+                    // was supplied.
+                    var q = queues[id];
+                    if (q.varName) {
+                        var freq=YAHOO.util.Get.POLL_FREQ;
+                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
+                        q.attempts = 0;
+                        q._cache = q.varName[0].split(".");
+                        q.timer = lang.later(freq, q, function(o) {
+                            var a=this._cache, l=a.length, w=this.win, i;
+                            for (i=0; i<l; i=i+1) {
+                                w = w[a[i]];
+                                if (!w) {
+                                    // if we have exausted our attempts, give up
+                                    this.attempts++;
+                                    if (this.attempts++ > this.maxattempts) {
+                                        q.timer.cancel();
+                                        _fail(id);
+                                    } else {
+                                    }
+                                    return;
+                                }
+                            }
+                            
+
+                            q.timer.cancel();
+                            f(id, url);
+
+                        }, null, true);
+                    } else {
+                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
+                    }
+                }
+            } 
+
+        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
+        // script nodes.  Opera, but not FF, supports the onload event for link
+        // nodes.
+        } else { 
+            n.onload = function() {
+                f(id, url);
+            };
+        }
+    };
+
+    return {
+
+        /**
+         * The default poll freqency in ms, when needed
+         * @property POLL_FREQ
+         * @static
+         * @type int
+         * @default 10
+         */
+        POLL_FREQ: 10,
+
+        /**
+         * The number of request required before an automatic purge.
+         * property PURGE_THRESH
+         * @static
+         * @type int
+         * @default 20
+         */
+        PURGE_THRESH: 20,
+
+        /**
+         * The length time to poll for varName when loading a script in
+         * Safari 2.x before the transaction fails.
+         * property TIMEOUT
+         * @static
+         * @type int
+         * @default 2000
+         */
+        TIMEOUT: 2000,
+        
+        /**
+         * Called by the the helper for detecting script load in Safari
+         * @method _finalize
+         * @param id {string} the transaction id
+         * @private
+         */
+        _finalize: function(id) {
+            lang.later(0, null, _finish, id);
+        },
+
+        /**
+         * Abort a transaction
+         * @method abort
+         * @param {string|object} either the tId or the object returned from
+         * script() or css()
+         */
+        abort: function(o) {
+            var id = (lang.isString(o)) ? o : o.tId;
+            var q = queues[id];
+            if (q) {
+                q.aborted = true;
+            }
+        }, 
+
+        /**
+         * Fetches and inserts one or more script nodes into the head
+         * of the current document or the document in a specified window.
+         *
+         * @method script
+         * @static
+         * @param url {string|string[]} the url or urls to the script(s)
+         * @param opts {object} Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the script(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>onFailure</dt>
+         * <dd>
+         * callback to execute when the script load operation fails
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted successfully</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove any nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>autopurge</dt>
+         * <dd>
+         * setting to true will let the utilities cleanup routine purge 
+         * the script once loaded
+         * </dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callback when the script(s) are
+         * loaded.
+         * </dd>
+         * <dt>varName</dt>
+         * <dd>
+         * variable that should be available when a script is finished
+         * loading.  Used to help Safari 2.x and below with script load 
+         * detection.  The type of this property should match what was
+         * passed into the url parameter: if loading a single url, a
+         * string can be supplied.  If loading multiple scripts, you
+         * must supply an array that contains the variable name for
+         * each script.
+         * </dd>
+         * </dl>
+         * <pre>
+         * // assumes yahoo, dom, and event are already on the page
+         * &nbsp;&nbsp;YAHOO.util.Get.script(
+         * &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
+         * &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log("won't cause error because YAHOO is the scope");
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log(o.nodes.length === 2) // true
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// o.purge(); // optionally remove the script nodes immediately
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;onFailure: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;data: "foo",
+         * &nbsp;&nbsp;&nbsp;&nbsp;scope: YAHOO,
+         * &nbsp;&nbsp;&nbsp;&nbsp;// win: otherframe // target another window/frame
+         * &nbsp;&nbsp;&nbsp;&nbsp;autopurge: true // allow the utility to choose when to remove the nodes
+         * &nbsp;&nbsp;&#125;);
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        script: function(url, opts) { return _queue("script", url, opts); },
+
+        /**
+         * Fetches and inserts one or more css link nodes into the 
+         * head of the current document or the document in a specified
+         * window.
+         * @method css
+         * @static
+         * @param url {string} the url or urls to the css file(s)
+         * @param opts Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the css file(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>win</dl>
+         * <dd>the window the link nodes(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callbacks when the nodes(s) are
+         * loaded.
+         * </dd>
+         * </dl>
+         * <pre>
+         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
+         * </pre>
+         * <pre>
+         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        css: function(url, opts) {
+            return _queue("css", url, opts); 
+        }
+    };
+}();
+
+YAHOO.register("get", YAHOO.util.Get, {version: "2.5.0", build: "895"});
index c87ff787c4dc81f4445280c9f2a4b66462cb6768..f8320f0276bb1b5e44265349024c0aa986929159 100755 (executable)
@@ -1,5 +1,20 @@
 YUI Library - Grids - Release Notes
 
+Version 2.5.0
+
+  * Tweaked em widths for "template presets" .yui-t1-6
+  * Pruned two redundant lines
+
+Version 2.4.0
+
+  * No changes.
+
+Version 2.3.1
+
+  * Fixed bug in 2.3.0 that transposed the columns in deeply-
+    nested grids. Sourceforge #1765553, Bugzilla #1419885    
+  * Improved precision and consistency of margins in nested grids.
+
 Version 2.3.0
 
   * Added more specific selectors to allow deeper nesting of both 
index e4aac3f34e6e6a28dfc5700cb31566d3227cce48..99ef52bd96c2ff3919fc784cc793752799a3adb0 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.117em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{_margin-left:1.2%;*margin-left:1.7%;}.yui-g .yui-gb .yui-u{_margin-left:.8%;}.yui-gb .yui-u{margin-left:2%;width:32%;float:right;*width:31.8%;}.yui-gb div.first{margin-left:0;*margin-right:1px;float:left;}.yui-gb .yui-gb div.first{*margin-right:0;width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first{float:left;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-gb .yui-gc .yui-u,.yui-g .yui-gc .yui-u{_float:right;width:32%;_width:29.9%;}.yui-gb .yui-gc div.first{width:66%;*width:64.5%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:1px;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{_width:48.1%;*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u{width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first{width:24%;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b {margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.50em;}.yui-t3 #yui-main .yui-b {margin-left:24.0759em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b {margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b {margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b {float:none;width:auto;}.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gb .yui-u,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:1.99%;width:32%;}#doc3 .yui-gb .yui-u{*width:31.9%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;color:red;}.yui-gb div.first{margin-left:0;float:left;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u {width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first {width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u {margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf {width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first {margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u {width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first {width:32%;}.yui-g .yui-gd div.first {_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first {width:24%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u {float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first {float:left;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first {*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
index 358df4837597846e55b1045c0acafbda5425f3c0..187c9d6858108acc31aeb3bf1cecad81296b9859 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* for all templates and grids */
 body{text-align:center;}
@@ -21,7 +21,7 @@ body{text-align:center;}
        width:auto;}
 /* 974 centered */
 #doc4 {
-       width:74.923em;*width:73.117em;}
+       width:74.923em;*width:73.05em;}
        
 /* below required for all fluid grids; adjust widths and margins above accordingly */
 
@@ -38,86 +38,70 @@ body{text-align:center;}
 .yui-t4 #yui-main,
 .yui-t5 #yui-main,
 .yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
+.yui-t1 .yui-b {float:left;width:12.30769em;*width:12.00em;}
+.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}
 
-.yui-t1 .yui-b {
-       float:left;
-    width:12.3207em;*width:12.0106em;}
-.yui-t1 #yui-main .yui-b{
-    margin-left:13.3207em;*margin-left:13.0106em;
-}
+.yui-t2 .yui-b {float:left;width:13.8461em;*width:13.50em;}
+.yui-t2 #yui-main .yui-b {margin-left:14.8461em;*margin-left:14.55em;}
 
-.yui-t2 .yui-b {
-       float:left;
-    width:13.8456em;*width:13.512em;}
-.yui-t2 #yui-main .yui-b {
-    margin-left:14.8456em;*margin-left:14.512em;
-}
+.yui-t3 .yui-b {float:left;width:23.0759em;*width:22.50em;}
+.yui-t3 #yui-main .yui-b {margin-left:24.0759em;*margin-left:23.62em;}
 
-.yui-t3 .yui-b {
-       float:left;
-    width:23.0759em;*width:22.52em;}
-.yui-t3 #yui-main .yui-b {
-    margin-left:24.0759em;*margin-left:23.52em;
-}
+.yui-t4 .yui-b {float:right;width:13.8456em;*width:13.50em;}
+.yui-t4 #yui-main .yui-b {margin-right:14.8456em;*margin-right:14.55em;}
 
-.yui-t4 .yui-b {
-       float:right;
-    width:13.8456em;*width:13.512em;}
-.yui-t4 #yui-main .yui-b {
-    margin-right:14.8456em;*margin-right:14.512em;
-}
+.yui-t5 .yui-b {float:right;width:18.4615em;*width:18.00em;}
+.yui-t5 #yui-main .yui-b {margin-right:19.4615em;*margin-right:19.125em;}
 
-.yui-t5 .yui-b {
-       float:right;
-    width:18.4608em;*width:18.016em;}
-.yui-t5 #yui-main .yui-b {
-    margin-right:19.4608em;*margin-right:19.016em;
-}
-
-.yui-t6 .yui-b {
-       float:right;
-    width:23.0759em;*width:22.52em;}
-.yui-t6 #yui-main .yui-b {
-    margin-right:24.0759em;*margin-right:23.52em;
-}
+.yui-t6 .yui-b {float:right;width:23.0759em;*width:22.50em;}
+.yui-t6 #yui-main .yui-b {margin-right:24.0759em;*margin-right:23.62em;}
 
 .yui-t7 #yui-main .yui-b {
        display:block;margin:0 0 1em 0;
 }
 #yui-main .yui-b {float:none;width:auto;}
+
+
 /* GRIDS (not TEMPLATES) */
 
+.yui-g .yui-gb .yui-u,
 .yui-gb .yui-g,/*new for nesting normal grids in special grids*/
 .yui-gb .yui-gb,/*new for nesting normal grids in special grids*/
-.yui-gb .yui-u, 
-.yui-g .yui-gb .yui-u,
 .yui-gb .yui-gc,
 .yui-gb .yui-gd,
 .yui-gb .yui-ge,
-.yui-gb .yui-gf, 
+.yui-gb .yui-gf,
+.yui-gb .yui-u, 
 .yui-gc .yui-u, 
 .yui-gc .yui-g,
-.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}
+.yui-gd .yui-u{float:left;margin-left:1.99%;width:32%;}
+
+#doc3 .yui-gb .yui-u {*width:31.9%;}/*for IE rounding issue in fluid page doc */
 
 .yui-gb .yui-gb .yui-u,
-.yui-gb .yui-gc .yui-u {_margin-left:1.2%;*margin-left:1.7%;}
-.yui-g .yui-gb .yui-u {_margin-left:.8%;} /* for #8-10 for IE6 */
-.yui-gb .yui-u {margin-left:2%;width:32%;float:right;*width:31.8%;}
-.yui-gb div.first {margin-left:0;*margin-right:1px;float:left;}
-.yui-gb .yui-gb div.first {*margin-right:0;width:31.7%;} /* for #29 for IE7*/
+.yui-gb .yui-gc .yui-u {*margin-left:1.8%;_margin-left:4%;}
+
+.yui-g .yui-gb .yui-u {_margin-left:1.0%;color:red;} /* for #8-10 for IE6 */
+
+
+
+.yui-gb div.first {margin-left:0;float:left;}
+
+.yui-g .yui-gb div.first,
+.yui-gb .yui-gb div.first {*margin-right:0;*width:32%;_width:31.7%;} /* for #29 for IE*/
+
 .yui-gb .yui-gc div.first, /* for #41 for IE7 */
 .yui-gb .yui-gd div.first  /* for #40 for IE7 */
         {*margin-right:0;}
 
-.yui-g .yui-gc div.first,
-.yui-g .yui-ge div.first {float:left;}
-
 .yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;} 
+
 .yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}
 
-.yui-gb .yui-gc .yui-u,
-.yui-g .yui-gc .yui-u {_float:right;width:32%;_width:29.9%;}
-.yui-gb .yui-gc div.first {width:66%;*width:64.5%;*float:left;*margin-left:0;}
+.yui-g .yui-gc .yui-u, 
+.yui-gb .yui-gc .yui-u {width:32%;_float:right;margin-right:0;_margin-left:0;}
+.yui-gb .yui-gc div.first {width:66%;*float:left;*margin-left:0;}
+
 .yui-gb .yui-ge .yui-u, 
 .yui-gb .yui-gf .yui-u {margin:0;}
 
@@ -135,10 +119,11 @@ body{text-align:center;}
        .yui-ge .yui-u, 
        .yui-ge .yui-g, 
        .yui-gf .yui-g,
-       .yui-gf .yui-u{float:right;display:inline;}
+       .yui-gf .yui-u{float:right;}
        
        /*Float units (and sub grids) to the left */
-       .yui-g div.first,
+       .yui-g .yui-gc div.first,
+       .yui-g .yui-ge div.first,
        .yui-g div.first, 
        .yui-gc div.first,
        .yui-gc div.first div.first,
@@ -151,16 +136,18 @@ body{text-align:center;}
 .yui-gc .yui-g .yui-u,
 .yui-gd .yui-g .yui-u,
 .yui-ge .yui-g .yui-u,
-.yui-gf .yui-g .yui-u {width:48.1%;*margin-left:0;}
+.yui-gf .yui-g .yui-u {width:49%;*width:48.1%;*margin-left:0;}
+
 .yui-g .yui-g div.first {*margin:0;}
-.yui-gb .yui-g div.first {*margin-right:1px;}
+.yui-gb .yui-g div.first {*margin-right:4%;_margin-right:1.3%;} /* pre 2.3.1 it was 1px */
 
 .yui-gb .yui-gb .yui-u {_margin-left:.7%;} /* for #23-32 for IE6*/
+
 .yui-gb .yui-g div.first, /* for #23 for IE6*/
 .yui-gb .yui-gb div.first {*margin-left:0;}
 
 .yui-gc .yui-g .yui-u,
-.yui-gd .yui-g .yui-u {_width:48.1%;*width:48.1%;*margin-left:0;}
+.yui-gd .yui-g .yui-u {*width:48.1%;*margin-left:0;}
 
 .yui-g .yui-u,
 .yui-g .yui-g,
@@ -188,6 +175,11 @@ body{text-align:center;}
 .yui-ge .yui-g,
 .yui-gf div.first {width:24%;}
 
+.yui-gb .yui-ge div.yui-u,
+.yui-gb .yui-gf div.yui-u {float:right;}
+.yui-gb .yui-ge div.first,
+.yui-gb .yui-gf div.first  {float:left;}
+
 .yui-ge div.first, 
 .yui-gf .yui-g,
 .yui-gf .yui-u{width:74.2%;}
@@ -213,4 +205,4 @@ body{text-align:center;}
 .yui-gc, 
 .yui-gd, 
 .yui-ge, 
-.yui-gf{zoom:1;}
\ No newline at end of file
+.yui-gf{zoom:1;}
index 84a9cccfbcd1367e19cca2f8a2a53e0799282fc9..c27785aae3422e7c40f9451771c8fed72ab87502 100755 (executable)
@@ -1,5 +1,18 @@
 YUI Library - History - Release Notes
 
+2.4.0
+
+  * Added onReady method (similar to the Event utility's DOMReady method)
+  * Fixed SourceForge bugs 1794347, 1490803, 1490818 and 1420015.
+  * Starting with YUI 2.4.0, the necessary markup (see documentation) must be
+    statically created in the HTML document, and passed to the Browser History
+    Manager initialize method. This has two major benefits over older versions:
+      - The Browser History Manager may be initialized much later than before,
+        allowing for the corresponding <script> tag to be embedded at the
+        bottom of the page (which is good for performance)
+      - IE had a tendency to "forget" part or all of the history when returning
+        to a page.
+
 2.3.0
 
   * The Browser History Manager now works on IE if used inside an IFrame
index c63060fd81c25dc448e59f13145066897edfa1a0..2fd7e0c79b037f6888d21e09c97ef0ef3d222122 100755 (executable)
@@ -1 +1 @@
-<html><head><title>bhm</title></head><body>&#160;</body></html>\r
\ No newline at end of file
+<html><head><title>bhm</title></head><body>&#160;</body></html>
diff --git a/lib/yui/history/history-debug.js b/lib/yui/history/history-debug.js
new file mode 100644 (file)
index 0000000..95ff9c1
--- /dev/null
@@ -0,0 +1,789 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The Browser History Manager provides the ability to use the back/forward
+ * navigation buttons in a DHTML application. It also allows a DHTML
+ * application to be bookmarked in a specific state.
+ *
+ * This library requires the following static markup:
+ *
+ * <iframe id="yui-history-iframe" src="path-to-real-asset-in-same-domain"></iframe>
+ * <input id="yui-history-field" type="hidden">
+ *
+ * @module history
+ * @requires yahoo,event
+ * @namespace YAHOO.util
+ * @title Browser History Manager
+ */
+
+/**
+ * The History class provides the ability to use the back/forward navigation
+ * buttons in a DHTML application. It also allows a DHTML application to
+ * be bookmarked in a specific state.
+ *
+ * @class History
+ * @constructor
+ */
+YAHOO.util.History = (function () {
+
+    /**
+     * Our hidden IFrame used to store the browsing history.
+     *
+     * @property _histFrame
+     * @type HTMLIFrameElement
+     * @default null
+     * @private
+     */
+    var _histFrame = null;
+
+    /**
+     * INPUT field (with type="hidden" or type="text") or TEXTAREA.
+     * This field keeps the value of the initial state, current state
+     * the list of all states across pages within a single browser session.
+     *
+     * @property _stateField
+     * @type HTMLInputElement|HTMLTextAreaElement
+     * @default null
+     * @private
+     */
+    var _stateField = null;
+
+    /**
+     * Flag used to tell whether YAHOO.util.History.initialize has been called.
+     *
+     * @property _initialized
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _initialized = false;
+
+    /**
+     * List of registered modules.
+     *
+     * @property _modules
+     * @type array
+     * @default []
+     * @private
+     */
+    var _modules = [];
+
+    /**
+     * List of fully qualified states. This is used only by Safari.
+     *
+     * @property _fqstates
+     * @type array
+     * @default []
+     * @private
+     */
+    var _fqstates = [];
+
+    /**
+     * location.hash is a bit buggy on Opera. I have seen instances where
+     * navigating the history using the back/forward buttons, and hence
+     * changing the URL, would not change location.hash. That's ok, the
+     * implementation of an equivalent is trivial.
+     *
+     * @method _getHash
+     * @return {string} The hash portion of the document's location
+     * @private
+     */
+    function _getHash() {
+        var i, href;
+        href = top.location.href;
+        i = href.indexOf("#");
+        return i >= 0 ? href.substr(i + 1) : null;
+    }
+
+    /**
+     * Stores all the registered modules' initial state and current state.
+     * On Safari, we also store all the fully qualified states visited by
+     * the application within a single browser session. The storage takes
+     * place in the form field specified during initialization.
+     *
+     * @method _storeStates
+     * @private
+     */
+    function _storeStates() {
+
+        var moduleName, moduleObj, initialStates = [], currentStates = [];
+
+        for (moduleName in _modules) {
+            if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                moduleObj = _modules[moduleName];
+                initialStates.push(moduleName + "=" + moduleObj.initialState);
+                currentStates.push(moduleName + "=" + moduleObj.currentState);
+            }
+        }
+
+        _stateField.value = initialStates.join("&") + "|" + currentStates.join("&");
+
+        if (YAHOO.env.ua.webkit) {
+            _stateField.value += "|" + _fqstates.join(",");
+        }
+    }
+
+    /**
+     * Sets the new currentState attribute of all modules depending on the new
+     * fully qualified state. Also notifies the modules which current state has
+     * changed.
+     *
+     * @method _handleFQStateChange
+     * @param {string} fqstate Fully qualified state
+     * @private
+     */
+    function _handleFQStateChange(fqstate) {
+
+        var i, len, moduleName, moduleObj, modules, states, tokens, currentState;
+
+        if (!fqstate) {
+            // Notifies all modules
+            for (moduleName in _modules) {
+                if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                    moduleObj = _modules[moduleName];
+                    moduleObj.currentState = moduleObj.initialState;
+                    moduleObj.onStateChange(unescape(moduleObj.currentState));
+                }
+            }
+            return;
+        }
+
+        modules = [];
+        states = fqstate.split("&");
+        for (i = 0, len = states.length; i < len; i++) {
+            tokens = states[i].split("=");
+            if (tokens.length === 2) {
+                moduleName = tokens[0];
+                currentState = tokens[1];
+                modules[moduleName] = currentState;
+            }
+        }
+
+        for (moduleName in _modules) {
+            if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                moduleObj = _modules[moduleName];
+                currentState = modules[moduleName];
+                if (!currentState || moduleObj.currentState !== currentState) {
+                    moduleObj.currentState = currentState || moduleObj.initialState;
+                    moduleObj.onStateChange(unescape(moduleObj.currentState));
+                }
+            }
+        }
+    }
+
+    /**
+     * Update the IFrame with our new state.
+     *
+     * @method _updateIFrame
+     * @private
+     * @return {boolean} true if successful. false otherwise.
+     */
+    function _updateIFrame (fqstate) {
+
+        var html, doc;
+
+        html = '<html><body><div id="state">' + fqstate + '</div></body></html>';
+
+        try {
+            doc = _histFrame.contentWindow.document;
+            doc.open();
+            doc.write(html);
+            doc.close();
+            return true;
+        } catch (e) {
+            return false;
+        }
+    }
+
+    /**
+     * Periodically checks whether our internal IFrame is ready to be used.
+     *
+     * @method _checkIframeLoaded
+     * @private
+     */
+    function _checkIframeLoaded() {
+
+        var doc, elem, fqstate, hash;
+
+        if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) {
+            // Check again in 10 msec...
+            setTimeout(_checkIframeLoaded, 10);
+            return;
+        }
+
+        // Start the thread that will have the responsibility to
+        // periodically check whether a navigate operation has been
+        // requested on the main window. This will happen when
+        // YAHOO.util.History.navigate has been called or after
+        // the user has hit the back/forward button.
+
+        doc = _histFrame.contentWindow.document;
+        elem = doc.getElementById("state");
+        // We must use innerText, and not innerHTML because our string contains
+        // the "&" character (which would end up being escaped as "&amp;") and
+        // the string comparison would fail...
+        fqstate = elem ? elem.innerText : null;
+
+        hash = _getHash();
+
+        setInterval(function () {
+
+            var newfqstate, states, moduleName, moduleObj, newHash, historyLength;
+
+            doc = _histFrame.contentWindow.document;
+            elem = doc.getElementById("state");
+            // See my comment above about using innerText instead of innerHTML...
+            newfqstate = elem ? elem.innerText : null;
+
+            newHash = _getHash();
+
+            if (newfqstate !== fqstate) {
+
+                fqstate = newfqstate;
+                _handleFQStateChange(fqstate);
+
+                if (!fqstate) {
+                    states = [];
+                    for (moduleName in _modules) {
+                        if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                            moduleObj = _modules[moduleName];
+                            states.push(moduleName + "=" + moduleObj.initialState);
+                        }
+                    }
+                    newHash = states.join("&");
+                } else {
+                    newHash = fqstate;
+                }
+
+                // Allow the state to be bookmarked by setting the top window's
+                // URL fragment identifier. Note that here, we are on IE, and
+                // IE does not touch the browser history when setting the hash
+                // (unlike all the other browsers). I used to write:
+                //     top.location.replace( "#" + hash );
+                // but this had a side effect when the page was not the top frame.
+                top.location.hash = newHash;
+                hash = newHash;
+
+                _storeStates();
+
+            } else if (newHash !== hash) {
+
+                // The hash has changed. The user might have clicked on a link,
+                // or modified the URL directly, or opened the same application
+                // bookmarked in a specific state using a bookmark. However, we
+                // know the hash change was not caused by a hit on the back or
+                // forward buttons, or by a call to navigate() (because it would
+                // have been handled above) We must handle these cases, which is
+                // why we also need to keep track of hash changes on IE!
+
+                // Note that IE6 has some major issues with this kind of user
+                // interaction (the history stack gets completely messed up)
+                // but it seems to work fine on IE7.
+
+                hash = newHash;
+
+                // Now, store a new history entry. The following will cause the
+                // code above to execute, doing all the dirty work for us...
+                _updateIFrame(newHash);
+            }
+
+        }, 50);
+
+        _initialized = true;
+        YAHOO.util.History.onLoadEvent.fire();
+    }
+
+    /**
+     * Finish up the initialization of the Browser History Manager.
+     *
+     * @method _initialize
+     * @private
+     */
+    function _initialize() {
+
+        var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;
+
+        // Decode the content of our storage field...
+        parts = _stateField.value.split("|");
+
+        if (parts.length > 1) {
+
+            initialStates = parts[0].split("&");
+            for (i = 0, len = initialStates.length; i < len; i++) {
+                tokens = initialStates[i].split("=");
+                if (tokens.length === 2) {
+                    moduleName = tokens[0];
+                    initialState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if (moduleObj) {
+                        moduleObj.initialState = initialState;
+                    }
+                }
+            }
+
+            currentStates = parts[1].split("&");
+            for (i = 0, len = currentStates.length; i < len; i++) {
+                tokens = currentStates[i].split("=");
+                if (tokens.length >= 2) {
+                    moduleName = tokens[0];
+                    currentState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if (moduleObj) {
+                        moduleObj.currentState = currentState;
+                    }
+                }
+            }
+        }
+
+        if (parts.length > 2) {
+            _fqstates = parts[2].split(",");
+        }
+
+        if (YAHOO.env.ua.ie) {
+
+            _checkIframeLoaded();
+
+        } else {
+
+            // Start the thread that will have the responsibility to
+            // periodically check whether a navigate operation has been
+            // requested on the main window. This will happen when
+            // YAHOO.util.History.navigate has been called or after
+            // the user has hit the back/forward button.
+
+            // On Safari 1.x and 2.0, the only way to catch a back/forward
+            // operation is to watch history.length... We basically exploit
+            // what I consider to be a bug (history.length is not supposed
+            // to change when going back/forward in the history...) This is
+            // why, in the following thread, we first compare the hash,
+            // because the hash thing will be fixed in the next major
+            // version of Safari. So even if they fix the history.length
+            // bug, all this will still work!
+            counter = history.length;
+
+            // On Gecko and Opera, we just need to watch the hash...
+            hash = _getHash();
+
+            setInterval(function () {
+
+                var state, newHash, newCounter;
+
+                newHash = _getHash();
+                newCounter = history.length;
+                if (newHash !== hash) {
+                    hash = newHash;
+                    counter = newCounter;
+                    _handleFQStateChange(hash);
+                    _storeStates();
+                } else if (newCounter !== counter && YAHOO.env.ua.webkit) {
+                    hash = newHash;
+                    counter = newCounter;
+                    state = _fqstates[counter - 1];
+                    _handleFQStateChange(state);
+                    _storeStates();
+                }
+
+            }, 50);
+
+            _initialized = true;
+            YAHOO.util.History.onLoadEvent.fire();
+        }
+    }
+
+    return {
+
+        /**
+         * Fired when the Browser History Manager is ready. If you subscribe to
+         * this event after the Browser History Manager has been initialized,
+         * it will not fire. Therefore, it is recommended to use the onReady
+         * method instead.
+         *
+         * @event onLoadEvent
+         * @see onReady
+         */
+        onLoadEvent: new YAHOO.util.CustomEvent("onLoad"),
+
+        /**
+         * Executes the supplied callback when the Browser History Manager is
+         * ready. This will execute immediately if called after the Browser
+         * History Manager onLoad event has fired.
+         *
+         * @method onReady
+         * @param {function} fn what to execute when the Browser History Manager is ready.
+         * @param {object} obj an optional object to be passed back as a parameter to fn.
+         * @param {boolean|object} override If true, the obj passed in becomes fn's execution scope.
+         * @see onLoadEvent
+         */
+        onReady: function (fn, obj, override) {
+
+            if (_initialized) {
+
+                setTimeout(function () {
+                    var ctx = window;
+                    if (override) {
+                        if (override === true) {
+                            ctx = obj;
+                        } else {
+                            ctx = override;
+                        }
+                    }
+                    fn.call(ctx, "onLoad", [], obj);
+                }, 0);
+
+            } else {
+
+                YAHOO.util.History.onLoadEvent.subscribe(fn, obj, override);
+
+            }
+        },
+
+        /**
+         * Registers a new module.
+         *
+         * @method register
+         * @param {string} module Non-empty string uniquely identifying the
+         *     module you wish to register.
+         * @param {string} initialState The initial state of the specified
+         *     module corresponding to its earliest history entry.
+         * @param {function} onStateChange Callback called when the
+         *     state of the specified module has changed.
+         * @param {object} obj An arbitrary object that will be passed as a
+         *     parameter to the handler.
+         * @param {boolean} override If true, the obj passed in becomes the
+         *     execution scope of the listener.
+         */
+        register: function (module, initialState, onStateChange, obj, override) {
+
+            var scope, wrappedFn;
+
+            if (typeof module !== "string" || YAHOO.lang.trim(module) === "" ||
+                typeof initialState !== "string" ||
+                typeof onStateChange !== "function") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (_modules[module]) {
+                // Here, we used to throw an exception. However, users have
+                // complained about this behavior, so we now just return.
+                return;
+            }
+
+            // Note: A module CANNOT be registered after calling
+            // YAHOO.util.History.initialize. Indeed, we set the initial state
+            // of each registered module in YAHOO.util.History.initialize.
+            // If you could register a module after initializing the Browser
+            // History Manager, you would not read the correct state using
+            // YAHOO.util.History.getCurrentState when coming back to the
+            // page using the back button.
+            if (_initialized) {
+                throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");
+            }
+
+            // Make sure the strings passed in do not contain our separators "," and "|"
+            module = escape(module);
+            initialState = escape(initialState);
+
+            // If the user chooses to override the scope, we use the
+            // custom object passed in as the execution scope.
+            scope = null;
+            if (override === true) {
+                scope = obj;
+            } else {
+                scope = override;
+            }
+
+            wrappedFn = function (state) {
+                return onStateChange.call(scope, state, obj);
+            };
+
+            _modules[module] = {
+                name: module,
+                initialState: initialState,
+                currentState: initialState,
+                onStateChange: wrappedFn
+            };
+        },
+
+        /**
+         * Initializes the Browser History Manager. Call this method
+         * from a script block located right after the opening body tag.
+         *
+         * @method initialize
+         * @param {string|HTML Element} stateField <input type="hidden"> used
+         *     to store application states. Must be in the static markup.
+         * @param {string|HTML Element} histFrame IFrame used to store
+         *     the history (only required on Internet Explorer)
+         * @public
+         */
+        initialize: function (stateField, histFrame) {
+
+            if (_initialized) {
+                // The browser history manager has already been initialized.
+                return;
+            }
+
+            if (YAHOO.env.ua.opera) {
+                // Opera cannot be supported because of several problems that
+                // have been reported to the Opera team, but never addressed:
+                //   1) Hash changes are not detected (started happening with
+                //      recent versions of Opera)
+                //   2) The entire DOM gets cached, so when you come back to
+                //      a page, the window's onload event does not get fired,
+                //      which prevents us from initializing the browser history
+                //      manager.
+                // As a consequence, the best thing we can do is to throw an
+                // exception. The application should catch it, and degrade
+                // gracefully. This is the sad state of history management.
+                throw new Error("Unsupported browser");
+            }
+
+            if (typeof stateField === "string") {
+                stateField = document.getElementById(stateField);
+            }
+
+            if (!stateField ||
+                stateField.tagName !== "TEXTAREA" &&
+                (stateField.tagName !== "INPUT" ||
+                 stateField.type !== "hidden" &&
+                 stateField.type !== "text")) {
+                throw new Error("Missing or invalid argument");
+            }
+
+            _stateField = stateField;
+
+            if (YAHOO.env.ua.ie) {
+
+                if (typeof histFrame === "string") {
+                    histFrame = document.getElementById(histFrame);
+                }
+
+                if (!histFrame || histFrame.tagName !== "IFRAME") {
+                    throw new Error("Missing or invalid argument");
+                }
+
+                _histFrame = histFrame;
+            }
+
+            // Note that the event utility MUST be included inline in the page.
+            // If it gets loaded later (which you may want to do to improve the
+            // loading speed of your site), the onDOMReady event never fires,
+            // and the history library never gets fully initialized.
+            YAHOO.util.Event.onDOMReady(_initialize);
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method navigate
+         * @param {string} module Non-empty string representing your module.
+         * @param {string} state String representing the new state of the specified module.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        navigate: function (module, state) {
+
+            var states;
+
+            if (typeof module !== "string" || typeof state !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            states = {};
+            states[module] = state;
+
+            return YAHOO.util.History.multiNavigate(states);
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method multiNavigate
+         * @param {object} states Associative array of module-state pairs to set simultaneously.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        multiNavigate: function (states) {
+
+            var currentStates, moduleName, moduleObj, currentState, fqstate;
+
+            if (typeof states !== "object") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (!_initialized) {
+                throw new Error("The Browser History Manager is not initialized");
+            }
+
+            for (moduleName in states) {
+                if (!_modules[moduleName]) {
+                    throw new Error("The following module has not been registered: " + moduleName);
+                }
+            }
+
+            // Generate our new full state string mod1=xxx&mod2=yyy
+            currentStates = [];
+
+            for (moduleName in _modules) {
+                if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                    moduleObj = _modules[moduleName];
+                    if (YAHOO.lang.hasOwnProperty(states, moduleName)) {
+                        currentState = states[moduleName];
+                    } else {
+                        currentState = moduleObj.currentState;
+                    }
+
+                    // Make sure the strings passed in do not contain our separators "," and "|"
+                    moduleName = escape(moduleName);
+                    currentState = escape(currentState);
+
+                    currentStates.push(moduleName + "=" + currentState);
+                }
+            }
+
+            fqstate = currentStates.join("&");
+
+            if (YAHOO.env.ua.ie) {
+
+                return _updateIFrame(fqstate);
+
+            } else {
+
+                // Known bug: On Safari 1.x and 2.0, if you have tab browsing
+                // enabled, Safari will show an endless loading icon in the
+                // tab. This has apparently been fixed in recent WebKit builds.
+                // One work around found by Dav Glass is to submit a form that
+                // points to the same document. This indeed works on Safari 1.x
+                // and 2.0 but creates bigger problems on WebKit. So for now,
+                // we'll consider this an acceptable bug, and hope that Apple
+                // comes out with their next version of Safari very soon.
+                top.location.hash = fqstate;
+                if (YAHOO.env.ua.webkit) {
+                    // The following two lines are only useful for Safari 1.x
+                    // and 2.0. Recent nightly builds of WebKit do not require
+                    // that, but unfortunately, it is not easy to differentiate
+                    // between the two. Once Safari 2.0 departs the A-grade
+                    // list, we can remove the following two lines...
+                    _fqstates[history.length] = fqstate;
+                    _storeStates();
+                }
+
+                return true;
+
+            }
+        },
+
+        /**
+         * Returns the current state of the specified module.
+         *
+         * @method getCurrentState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The current state of the specified module.
+         * @public
+         */
+        getCurrentState: function (module) {
+
+            var moduleObj;
+
+            if (typeof module !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (!_initialized) {
+                throw new Error("The Browser History Manager is not initialized");
+            }
+
+            moduleObj = _modules[module];
+            if (!moduleObj) {
+                throw new Error("No such registered module: " + module);
+            }
+
+            return unescape(moduleObj.currentState);
+        },
+
+        /**
+         * Returns the state of a module according to the URL fragment
+         * identifier. This method is useful to initialize your modules
+         * if your application was bookmarked from a particular state.
+         *
+         * @method getBookmarkedState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The bookmarked state of the specified module.
+         * @public
+         */
+        getBookmarkedState: function (module) {
+
+            var i, len, idx, hash, states, tokens, moduleName;
+
+            if (typeof module !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            // Use location.href instead of location.hash which is already
+            // URL-decoded, which creates problems if the state value
+            // contained special characters...
+            idx = top.location.href.indexOf("#");
+            hash = idx >= 0 ? top.location.href.substr(idx + 1) : top.location.href;
+
+            states = hash.split("&");
+            for (i = 0, len = states.length; i < len; i++) {
+                tokens = states[i].split("=");
+                if (tokens.length === 2) {
+                    moduleName = tokens[0];
+                    if (moduleName === module) {
+                        return unescape(tokens[1]);
+                    }
+                }
+            }
+
+            return null;
+        },
+
+        /**
+         * Returns the value of the specified query string parameter.
+         * This method is not used internally by the Browser History Manager.
+         * However, it is provided here as a helper since many applications
+         * using the Browser History Manager will want to read the value of
+         * url parameters to initialize themselves.
+         *
+         * @method getQueryStringParameter
+         * @param {string} paramName Name of the parameter we want to look up.
+         * @param {string} queryString Optional URL to look at. If not specified,
+         *     this method uses the URL in the address bar.
+         * @return {string} The value of the specified parameter, or null.
+         * @public
+         */
+        getQueryStringParameter: function (paramName, url) {
+
+            var i, len, idx, queryString, params, tokens;
+
+            url = url || top.location.href;
+
+            idx = url.indexOf("?");
+            queryString = idx >= 0 ? url.substr(idx + 1) : url;
+
+            // Remove the hash if any
+            idx = queryString.lastIndexOf("#");
+            queryString = idx >= 0 ? queryString.substr(0, idx) : queryString;
+
+            params = queryString.split("&");
+
+            for (i = 0, len = params.length; i < len; i++) {
+                tokens = params[i].split("=");
+                if (tokens.length >= 2) {
+                    if (tokens[0] === paramName) {
+                        return unescape(tokens[1]);
+                    }
+                }
+            }
+
+            return null;
+        }
+
+    };
+
+})();
+YAHOO.register("history", YAHOO.util.History, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/history/history-min.js b/lib/yui/history/history-min.js
new file mode 100644 (file)
index 0000000..8be4b1b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.util.History=(function(){var C=null;var K=null;var F=false;var D=[];var B=[];function I(){var M,L;L=top.location.href;M=L.indexOf("#");return M>=0?L.substr(M+1):null;}function A(){var M,N,O=[],L=[];for(M in D){if(YAHOO.lang.hasOwnProperty(D,M)){N=D[M];O.push(M+"="+N.initialState);L.push(M+"="+N.currentState);}}K.value=O.join("&")+"|"+L.join("&");if(YAHOO.env.ua.webkit){K.value+="|"+B.join(",");}}function H(L){var Q,R,M,O,P,T,S,N;if(!L){for(M in D){if(YAHOO.lang.hasOwnProperty(D,M)){O=D[M];O.currentState=O.initialState;O.onStateChange(unescape(O.currentState));}}return ;}P=[];T=L.split("&");for(Q=0,R=T.length;Q<R;Q++){S=T[Q].split("=");if(S.length===2){M=S[0];N=S[1];P[M]=N;}}for(M in D){if(YAHOO.lang.hasOwnProperty(D,M)){O=D[M];N=P[M];if(!N||O.currentState!==N){O.currentState=N||O.initialState;O.onStateChange(unescape(O.currentState));}}}}function J(O){var L,N;L="<html><body><div id=\"state\">"+O+"</div></body></html>";try{N=C.contentWindow.document;N.open();N.write(L);N.close();return true;}catch(M){return false;}}function G(){var O,L,N,M;if(!C.contentWindow||!C.contentWindow.document){setTimeout(G,10);return ;}O=C.contentWindow.document;L=O.getElementById("state");N=L?L.innerText:null;M=I();setInterval(function(){var U,Q,R,S,T,P;O=C.contentWindow.document;L=O.getElementById("state");U=L?L.innerText:null;T=I();if(U!==N){N=U;H(N);if(!N){Q=[];for(R in D){if(YAHOO.lang.hasOwnProperty(D,R)){S=D[R];Q.push(R+"="+S.initialState);}}T=Q.join("&");}else{T=N;}top.location.hash=T;M=T;A();}else{if(T!==M){M=T;J(T);}}},50);F=true;YAHOO.util.History.onLoadEvent.fire();}function E(){var S,U,Q,W,M,O,V,P,T,N,L,R;Q=K.value.split("|");if(Q.length>1){V=Q[0].split("&");for(S=0,U=V.length;S<U;S++){W=V[S].split("=");if(W.length===2){M=W[0];P=W[1];O=D[M];if(O){O.initialState=P;}}}T=Q[1].split("&");for(S=0,U=T.length;S<U;S++){W=T[S].split("=");if(W.length>=2){M=W[0];N=W[1];O=D[M];if(O){O.currentState=N;}}}}if(Q.length>2){B=Q[2].split(",");}if(YAHOO.env.ua.ie){G();}else{L=history.length;R=I();setInterval(function(){var Z,X,Y;X=I();Y=history.length;if(X!==R){R=X;L=Y;H(R);A();}else{if(Y!==L&&YAHOO.env.ua.webkit){R=X;L=Y;Z=B[L-1];H(Z);A();}}},50);F=true;YAHOO.util.History.onLoadEvent.fire();}}return{onLoadEvent:new YAHOO.util.CustomEvent("onLoad"),onReady:function(M,N,L){if(F){setTimeout(function(){var O=window;if(L){if(L===true){O=N;}else{O=L;}}M.call(O,"onLoad",[],N);},0);}else{YAHOO.util.History.onLoadEvent.subscribe(M,N,L);}},register:function(O,L,Q,R,N){var P,M;if(typeof O!=="string"||YAHOO.lang.trim(O)===""||typeof L!=="string"||typeof Q!=="function"){throw new Error("Missing or invalid argument");}if(D[O]){return ;}if(F){throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");}O=escape(O);L=escape(L);P=null;if(N===true){P=R;}else{P=N;}M=function(S){return Q.call(P,S,R);};D[O]={name:O,initialState:L,currentState:L,onStateChange:M};},initialize:function(L,M){if(F){return ;}if(YAHOO.env.ua.opera){throw new Error("Unsupported browser");}if(typeof L==="string"){L=document.getElementById(L);}if(!L||L.tagName!=="TEXTAREA"&&(L.tagName!=="INPUT"||L.type!=="hidden"&&L.type!=="text")){throw new Error("Missing or invalid argument");}K=L;if(YAHOO.env.ua.ie){if(typeof M==="string"){M=document.getElementById(M);}if(!M||M.tagName!=="IFRAME"){throw new Error("Missing or invalid argument");}C=M;}YAHOO.util.Event.onDOMReady(E);},navigate:function(M,N){var L;if(typeof M!=="string"||typeof N!=="string"){throw new Error("Missing or invalid argument");}L={};L[M]=N;return YAHOO.util.History.multiNavigate(L);},multiNavigate:function(M){var L,N,P,O,Q;if(typeof M!=="object"){throw new Error("Missing or invalid argument");}if(!F){throw new Error("The Browser History Manager is not initialized");}for(N in M){if(!D[N]){throw new Error("The following module has not been registered: "+N);}}L=[];for(N in D){if(YAHOO.lang.hasOwnProperty(D,N)){P=D[N];if(YAHOO.lang.hasOwnProperty(M,N)){O=M[N];}else{O=P.currentState;}N=escape(N);O=escape(O);L.push(N+"="+O);}}Q=L.join("&");if(YAHOO.env.ua.ie){return J(Q);}else{top.location.hash=Q;if(YAHOO.env.ua.webkit){B[history.length]=Q;A();}return true;}},getCurrentState:function(L){var M;if(typeof L!=="string"){throw new Error("Missing or invalid argument");}if(!F){throw new Error("The Browser History Manager is not initialized");}M=D[L];if(!M){throw new Error("No such registered module: "+L);}return unescape(M.currentState);},getBookmarkedState:function(Q){var P,M,L,S,N,R,O;if(typeof Q!=="string"){throw new Error("Missing or invalid argument");}L=top.location.href.indexOf("#");S=L>=0?top.location.href.substr(L+1):top.location.href;N=S.split("&");for(P=0,M=N.length;P<M;P++){R=N[P].split("=");if(R.length===2){O=R[0];if(O===Q){return unescape(R[1]);}}}return null;},getQueryStringParameter:function(Q,N){var O,M,L,S,R,P;N=N||top.location.href;L=N.indexOf("?");S=L>=0?N.substr(L+1):N;L=S.lastIndexOf("#");S=L>=0?S.substr(0,L):S;R=S.split("&");for(O=0,M=R.length;O<M;O++){P=R[O].split("=");if(P.length>=2){if(P[0]===Q){return unescape(P[1]);}}}return null;}};})();YAHOO.register("history",YAHOO.util.History,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/history/history.js b/lib/yui/history/history.js
new file mode 100644 (file)
index 0000000..95ff9c1
--- /dev/null
@@ -0,0 +1,789 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The Browser History Manager provides the ability to use the back/forward
+ * navigation buttons in a DHTML application. It also allows a DHTML
+ * application to be bookmarked in a specific state.
+ *
+ * This library requires the following static markup:
+ *
+ * <iframe id="yui-history-iframe" src="path-to-real-asset-in-same-domain"></iframe>
+ * <input id="yui-history-field" type="hidden">
+ *
+ * @module history
+ * @requires yahoo,event
+ * @namespace YAHOO.util
+ * @title Browser History Manager
+ */
+
+/**
+ * The History class provides the ability to use the back/forward navigation
+ * buttons in a DHTML application. It also allows a DHTML application to
+ * be bookmarked in a specific state.
+ *
+ * @class History
+ * @constructor
+ */
+YAHOO.util.History = (function () {
+
+    /**
+     * Our hidden IFrame used to store the browsing history.
+     *
+     * @property _histFrame
+     * @type HTMLIFrameElement
+     * @default null
+     * @private
+     */
+    var _histFrame = null;
+
+    /**
+     * INPUT field (with type="hidden" or type="text") or TEXTAREA.
+     * This field keeps the value of the initial state, current state
+     * the list of all states across pages within a single browser session.
+     *
+     * @property _stateField
+     * @type HTMLInputElement|HTMLTextAreaElement
+     * @default null
+     * @private
+     */
+    var _stateField = null;
+
+    /**
+     * Flag used to tell whether YAHOO.util.History.initialize has been called.
+     *
+     * @property _initialized
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _initialized = false;
+
+    /**
+     * List of registered modules.
+     *
+     * @property _modules
+     * @type array
+     * @default []
+     * @private
+     */
+    var _modules = [];
+
+    /**
+     * List of fully qualified states. This is used only by Safari.
+     *
+     * @property _fqstates
+     * @type array
+     * @default []
+     * @private
+     */
+    var _fqstates = [];
+
+    /**
+     * location.hash is a bit buggy on Opera. I have seen instances where
+     * navigating the history using the back/forward buttons, and hence
+     * changing the URL, would not change location.hash. That's ok, the
+     * implementation of an equivalent is trivial.
+     *
+     * @method _getHash
+     * @return {string} The hash portion of the document's location
+     * @private
+     */
+    function _getHash() {
+        var i, href;
+        href = top.location.href;
+        i = href.indexOf("#");
+        return i >= 0 ? href.substr(i + 1) : null;
+    }
+
+    /**
+     * Stores all the registered modules' initial state and current state.
+     * On Safari, we also store all the fully qualified states visited by
+     * the application within a single browser session. The storage takes
+     * place in the form field specified during initialization.
+     *
+     * @method _storeStates
+     * @private
+     */
+    function _storeStates() {
+
+        var moduleName, moduleObj, initialStates = [], currentStates = [];
+
+        for (moduleName in _modules) {
+            if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                moduleObj = _modules[moduleName];
+                initialStates.push(moduleName + "=" + moduleObj.initialState);
+                currentStates.push(moduleName + "=" + moduleObj.currentState);
+            }
+        }
+
+        _stateField.value = initialStates.join("&") + "|" + currentStates.join("&");
+
+        if (YAHOO.env.ua.webkit) {
+            _stateField.value += "|" + _fqstates.join(",");
+        }
+    }
+
+    /**
+     * Sets the new currentState attribute of all modules depending on the new
+     * fully qualified state. Also notifies the modules which current state has
+     * changed.
+     *
+     * @method _handleFQStateChange
+     * @param {string} fqstate Fully qualified state
+     * @private
+     */
+    function _handleFQStateChange(fqstate) {
+
+        var i, len, moduleName, moduleObj, modules, states, tokens, currentState;
+
+        if (!fqstate) {
+            // Notifies all modules
+            for (moduleName in _modules) {
+                if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                    moduleObj = _modules[moduleName];
+                    moduleObj.currentState = moduleObj.initialState;
+                    moduleObj.onStateChange(unescape(moduleObj.currentState));
+                }
+            }
+            return;
+        }
+
+        modules = [];
+        states = fqstate.split("&");
+        for (i = 0, len = states.length; i < len; i++) {
+            tokens = states[i].split("=");
+            if (tokens.length === 2) {
+                moduleName = tokens[0];
+                currentState = tokens[1];
+                modules[moduleName] = currentState;
+            }
+        }
+
+        for (moduleName in _modules) {
+            if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                moduleObj = _modules[moduleName];
+                currentState = modules[moduleName];
+                if (!currentState || moduleObj.currentState !== currentState) {
+                    moduleObj.currentState = currentState || moduleObj.initialState;
+                    moduleObj.onStateChange(unescape(moduleObj.currentState));
+                }
+            }
+        }
+    }
+
+    /**
+     * Update the IFrame with our new state.
+     *
+     * @method _updateIFrame
+     * @private
+     * @return {boolean} true if successful. false otherwise.
+     */
+    function _updateIFrame (fqstate) {
+
+        var html, doc;
+
+        html = '<html><body><div id="state">' + fqstate + '</div></body></html>';
+
+        try {
+            doc = _histFrame.contentWindow.document;
+            doc.open();
+            doc.write(html);
+            doc.close();
+            return true;
+        } catch (e) {
+            return false;
+        }
+    }
+
+    /**
+     * Periodically checks whether our internal IFrame is ready to be used.
+     *
+     * @method _checkIframeLoaded
+     * @private
+     */
+    function _checkIframeLoaded() {
+
+        var doc, elem, fqstate, hash;
+
+        if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) {
+            // Check again in 10 msec...
+            setTimeout(_checkIframeLoaded, 10);
+            return;
+        }
+
+        // Start the thread that will have the responsibility to
+        // periodically check whether a navigate operation has been
+        // requested on the main window. This will happen when
+        // YAHOO.util.History.navigate has been called or after
+        // the user has hit the back/forward button.
+
+        doc = _histFrame.contentWindow.document;
+        elem = doc.getElementById("state");
+        // We must use innerText, and not innerHTML because our string contains
+        // the "&" character (which would end up being escaped as "&amp;") and
+        // the string comparison would fail...
+        fqstate = elem ? elem.innerText : null;
+
+        hash = _getHash();
+
+        setInterval(function () {
+
+            var newfqstate, states, moduleName, moduleObj, newHash, historyLength;
+
+            doc = _histFrame.contentWindow.document;
+            elem = doc.getElementById("state");
+            // See my comment above about using innerText instead of innerHTML...
+            newfqstate = elem ? elem.innerText : null;
+
+            newHash = _getHash();
+
+            if (newfqstate !== fqstate) {
+
+                fqstate = newfqstate;
+                _handleFQStateChange(fqstate);
+
+                if (!fqstate) {
+                    states = [];
+                    for (moduleName in _modules) {
+                        if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                            moduleObj = _modules[moduleName];
+                            states.push(moduleName + "=" + moduleObj.initialState);
+                        }
+                    }
+                    newHash = states.join("&");
+                } else {
+                    newHash = fqstate;
+                }
+
+                // Allow the state to be bookmarked by setting the top window's
+                // URL fragment identifier. Note that here, we are on IE, and
+                // IE does not touch the browser history when setting the hash
+                // (unlike all the other browsers). I used to write:
+                //     top.location.replace( "#" + hash );
+                // but this had a side effect when the page was not the top frame.
+                top.location.hash = newHash;
+                hash = newHash;
+
+                _storeStates();
+
+            } else if (newHash !== hash) {
+
+                // The hash has changed. The user might have clicked on a link,
+                // or modified the URL directly, or opened the same application
+                // bookmarked in a specific state using a bookmark. However, we
+                // know the hash change was not caused by a hit on the back or
+                // forward buttons, or by a call to navigate() (because it would
+                // have been handled above) We must handle these cases, which is
+                // why we also need to keep track of hash changes on IE!
+
+                // Note that IE6 has some major issues with this kind of user
+                // interaction (the history stack gets completely messed up)
+                // but it seems to work fine on IE7.
+
+                hash = newHash;
+
+                // Now, store a new history entry. The following will cause the
+                // code above to execute, doing all the dirty work for us...
+                _updateIFrame(newHash);
+            }
+
+        }, 50);
+
+        _initialized = true;
+        YAHOO.util.History.onLoadEvent.fire();
+    }
+
+    /**
+     * Finish up the initialization of the Browser History Manager.
+     *
+     * @method _initialize
+     * @private
+     */
+    function _initialize() {
+
+        var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;
+
+        // Decode the content of our storage field...
+        parts = _stateField.value.split("|");
+
+        if (parts.length > 1) {
+
+            initialStates = parts[0].split("&");
+            for (i = 0, len = initialStates.length; i < len; i++) {
+                tokens = initialStates[i].split("=");
+                if (tokens.length === 2) {
+                    moduleName = tokens[0];
+                    initialState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if (moduleObj) {
+                        moduleObj.initialState = initialState;
+                    }
+                }
+            }
+
+            currentStates = parts[1].split("&");
+            for (i = 0, len = currentStates.length; i < len; i++) {
+                tokens = currentStates[i].split("=");
+                if (tokens.length >= 2) {
+                    moduleName = tokens[0];
+                    currentState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if (moduleObj) {
+                        moduleObj.currentState = currentState;
+                    }
+                }
+            }
+        }
+
+        if (parts.length > 2) {
+            _fqstates = parts[2].split(",");
+        }
+
+        if (YAHOO.env.ua.ie) {
+
+            _checkIframeLoaded();
+
+        } else {
+
+            // Start the thread that will have the responsibility to
+            // periodically check whether a navigate operation has been
+            // requested on the main window. This will happen when
+            // YAHOO.util.History.navigate has been called or after
+            // the user has hit the back/forward button.
+
+            // On Safari 1.x and 2.0, the only way to catch a back/forward
+            // operation is to watch history.length... We basically exploit
+            // what I consider to be a bug (history.length is not supposed
+            // to change when going back/forward in the history...) This is
+            // why, in the following thread, we first compare the hash,
+            // because the hash thing will be fixed in the next major
+            // version of Safari. So even if they fix the history.length
+            // bug, all this will still work!
+            counter = history.length;
+
+            // On Gecko and Opera, we just need to watch the hash...
+            hash = _getHash();
+
+            setInterval(function () {
+
+                var state, newHash, newCounter;
+
+                newHash = _getHash();
+                newCounter = history.length;
+                if (newHash !== hash) {
+                    hash = newHash;
+                    counter = newCounter;
+                    _handleFQStateChange(hash);
+                    _storeStates();
+                } else if (newCounter !== counter && YAHOO.env.ua.webkit) {
+                    hash = newHash;
+                    counter = newCounter;
+                    state = _fqstates[counter - 1];
+                    _handleFQStateChange(state);
+                    _storeStates();
+                }
+
+            }, 50);
+
+            _initialized = true;
+            YAHOO.util.History.onLoadEvent.fire();
+        }
+    }
+
+    return {
+
+        /**
+         * Fired when the Browser History Manager is ready. If you subscribe to
+         * this event after the Browser History Manager has been initialized,
+         * it will not fire. Therefore, it is recommended to use the onReady
+         * method instead.
+         *
+         * @event onLoadEvent
+         * @see onReady
+         */
+        onLoadEvent: new YAHOO.util.CustomEvent("onLoad"),
+
+        /**
+         * Executes the supplied callback when the Browser History Manager is
+         * ready. This will execute immediately if called after the Browser
+         * History Manager onLoad event has fired.
+         *
+         * @method onReady
+         * @param {function} fn what to execute when the Browser History Manager is ready.
+         * @param {object} obj an optional object to be passed back as a parameter to fn.
+         * @param {boolean|object} override If true, the obj passed in becomes fn's execution scope.
+         * @see onLoadEvent
+         */
+        onReady: function (fn, obj, override) {
+
+            if (_initialized) {
+
+                setTimeout(function () {
+                    var ctx = window;
+                    if (override) {
+                        if (override === true) {
+                            ctx = obj;
+                        } else {
+                            ctx = override;
+                        }
+                    }
+                    fn.call(ctx, "onLoad", [], obj);
+                }, 0);
+
+            } else {
+
+                YAHOO.util.History.onLoadEvent.subscribe(fn, obj, override);
+
+            }
+        },
+
+        /**
+         * Registers a new module.
+         *
+         * @method register
+         * @param {string} module Non-empty string uniquely identifying the
+         *     module you wish to register.
+         * @param {string} initialState The initial state of the specified
+         *     module corresponding to its earliest history entry.
+         * @param {function} onStateChange Callback called when the
+         *     state of the specified module has changed.
+         * @param {object} obj An arbitrary object that will be passed as a
+         *     parameter to the handler.
+         * @param {boolean} override If true, the obj passed in becomes the
+         *     execution scope of the listener.
+         */
+        register: function (module, initialState, onStateChange, obj, override) {
+
+            var scope, wrappedFn;
+
+            if (typeof module !== "string" || YAHOO.lang.trim(module) === "" ||
+                typeof initialState !== "string" ||
+                typeof onStateChange !== "function") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (_modules[module]) {
+                // Here, we used to throw an exception. However, users have
+                // complained about this behavior, so we now just return.
+                return;
+            }
+
+            // Note: A module CANNOT be registered after calling
+            // YAHOO.util.History.initialize. Indeed, we set the initial state
+            // of each registered module in YAHOO.util.History.initialize.
+            // If you could register a module after initializing the Browser
+            // History Manager, you would not read the correct state using
+            // YAHOO.util.History.getCurrentState when coming back to the
+            // page using the back button.
+            if (_initialized) {
+                throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");
+            }
+
+            // Make sure the strings passed in do not contain our separators "," and "|"
+            module = escape(module);
+            initialState = escape(initialState);
+
+            // If the user chooses to override the scope, we use the
+            // custom object passed in as the execution scope.
+            scope = null;
+            if (override === true) {
+                scope = obj;
+            } else {
+                scope = override;
+            }
+
+            wrappedFn = function (state) {
+                return onStateChange.call(scope, state, obj);
+            };
+
+            _modules[module] = {
+                name: module,
+                initialState: initialState,
+                currentState: initialState,
+                onStateChange: wrappedFn
+            };
+        },
+
+        /**
+         * Initializes the Browser History Manager. Call this method
+         * from a script block located right after the opening body tag.
+         *
+         * @method initialize
+         * @param {string|HTML Element} stateField <input type="hidden"> used
+         *     to store application states. Must be in the static markup.
+         * @param {string|HTML Element} histFrame IFrame used to store
+         *     the history (only required on Internet Explorer)
+         * @public
+         */
+        initialize: function (stateField, histFrame) {
+
+            if (_initialized) {
+                // The browser history manager has already been initialized.
+                return;
+            }
+
+            if (YAHOO.env.ua.opera) {
+                // Opera cannot be supported because of several problems that
+                // have been reported to the Opera team, but never addressed:
+                //   1) Hash changes are not detected (started happening with
+                //      recent versions of Opera)
+                //   2) The entire DOM gets cached, so when you come back to
+                //      a page, the window's onload event does not get fired,
+                //      which prevents us from initializing the browser history
+                //      manager.
+                // As a consequence, the best thing we can do is to throw an
+                // exception. The application should catch it, and degrade
+                // gracefully. This is the sad state of history management.
+                throw new Error("Unsupported browser");
+            }
+
+            if (typeof stateField === "string") {
+                stateField = document.getElementById(stateField);
+            }
+
+            if (!stateField ||
+                stateField.tagName !== "TEXTAREA" &&
+                (stateField.tagName !== "INPUT" ||
+                 stateField.type !== "hidden" &&
+                 stateField.type !== "text")) {
+                throw new Error("Missing or invalid argument");
+            }
+
+            _stateField = stateField;
+
+            if (YAHOO.env.ua.ie) {
+
+                if (typeof histFrame === "string") {
+                    histFrame = document.getElementById(histFrame);
+                }
+
+                if (!histFrame || histFrame.tagName !== "IFRAME") {
+                    throw new Error("Missing or invalid argument");
+                }
+
+                _histFrame = histFrame;
+            }
+
+            // Note that the event utility MUST be included inline in the page.
+            // If it gets loaded later (which you may want to do to improve the
+            // loading speed of your site), the onDOMReady event never fires,
+            // and the history library never gets fully initialized.
+            YAHOO.util.Event.onDOMReady(_initialize);
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method navigate
+         * @param {string} module Non-empty string representing your module.
+         * @param {string} state String representing the new state of the specified module.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        navigate: function (module, state) {
+
+            var states;
+
+            if (typeof module !== "string" || typeof state !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            states = {};
+            states[module] = state;
+
+            return YAHOO.util.History.multiNavigate(states);
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method multiNavigate
+         * @param {object} states Associative array of module-state pairs to set simultaneously.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        multiNavigate: function (states) {
+
+            var currentStates, moduleName, moduleObj, currentState, fqstate;
+
+            if (typeof states !== "object") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (!_initialized) {
+                throw new Error("The Browser History Manager is not initialized");
+            }
+
+            for (moduleName in states) {
+                if (!_modules[moduleName]) {
+                    throw new Error("The following module has not been registered: " + moduleName);
+                }
+            }
+
+            // Generate our new full state string mod1=xxx&mod2=yyy
+            currentStates = [];
+
+            for (moduleName in _modules) {
+                if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
+                    moduleObj = _modules[moduleName];
+                    if (YAHOO.lang.hasOwnProperty(states, moduleName)) {
+                        currentState = states[moduleName];
+                    } else {
+                        currentState = moduleObj.currentState;
+                    }
+
+                    // Make sure the strings passed in do not contain our separators "," and "|"
+                    moduleName = escape(moduleName);
+                    currentState = escape(currentState);
+
+                    currentStates.push(moduleName + "=" + currentState);
+                }
+            }
+
+            fqstate = currentStates.join("&");
+
+            if (YAHOO.env.ua.ie) {
+
+                return _updateIFrame(fqstate);
+
+            } else {
+
+                // Known bug: On Safari 1.x and 2.0, if you have tab browsing
+                // enabled, Safari will show an endless loading icon in the
+                // tab. This has apparently been fixed in recent WebKit builds.
+                // One work around found by Dav Glass is to submit a form that
+                // points to the same document. This indeed works on Safari 1.x
+                // and 2.0 but creates bigger problems on WebKit. So for now,
+                // we'll consider this an acceptable bug, and hope that Apple
+                // comes out with their next version of Safari very soon.
+                top.location.hash = fqstate;
+                if (YAHOO.env.ua.webkit) {
+                    // The following two lines are only useful for Safari 1.x
+                    // and 2.0. Recent nightly builds of WebKit do not require
+                    // that, but unfortunately, it is not easy to differentiate
+                    // between the two. Once Safari 2.0 departs the A-grade
+                    // list, we can remove the following two lines...
+                    _fqstates[history.length] = fqstate;
+                    _storeStates();
+                }
+
+                return true;
+
+            }
+        },
+
+        /**
+         * Returns the current state of the specified module.
+         *
+         * @method getCurrentState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The current state of the specified module.
+         * @public
+         */
+        getCurrentState: function (module) {
+
+            var moduleObj;
+
+            if (typeof module !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            if (!_initialized) {
+                throw new Error("The Browser History Manager is not initialized");
+            }
+
+            moduleObj = _modules[module];
+            if (!moduleObj) {
+                throw new Error("No such registered module: " + module);
+            }
+
+            return unescape(moduleObj.currentState);
+        },
+
+        /**
+         * Returns the state of a module according to the URL fragment
+         * identifier. This method is useful to initialize your modules
+         * if your application was bookmarked from a particular state.
+         *
+         * @method getBookmarkedState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The bookmarked state of the specified module.
+         * @public
+         */
+        getBookmarkedState: function (module) {
+
+            var i, len, idx, hash, states, tokens, moduleName;
+
+            if (typeof module !== "string") {
+                throw new Error("Missing or invalid argument");
+            }
+
+            // Use location.href instead of location.hash which is already
+            // URL-decoded, which creates problems if the state value
+            // contained special characters...
+            idx = top.location.href.indexOf("#");
+            hash = idx >= 0 ? top.location.href.substr(idx + 1) : top.location.href;
+
+            states = hash.split("&");
+            for (i = 0, len = states.length; i < len; i++) {
+                tokens = states[i].split("=");
+                if (tokens.length === 2) {
+                    moduleName = tokens[0];
+                    if (moduleName === module) {
+                        return unescape(tokens[1]);
+                    }
+                }
+            }
+
+            return null;
+        },
+
+        /**
+         * Returns the value of the specified query string parameter.
+         * This method is not used internally by the Browser History Manager.
+         * However, it is provided here as a helper since many applications
+         * using the Browser History Manager will want to read the value of
+         * url parameters to initialize themselves.
+         *
+         * @method getQueryStringParameter
+         * @param {string} paramName Name of the parameter we want to look up.
+         * @param {string} queryString Optional URL to look at. If not specified,
+         *     this method uses the URL in the address bar.
+         * @return {string} The value of the specified parameter, or null.
+         * @public
+         */
+        getQueryStringParameter: function (paramName, url) {
+
+            var i, len, idx, queryString, params, tokens;
+
+            url = url || top.location.href;
+
+            idx = url.indexOf("?");
+            queryString = idx >= 0 ? url.substr(idx + 1) : url;
+
+            // Remove the hash if any
+            idx = queryString.lastIndexOf("#");
+            queryString = idx >= 0 ? queryString.substr(0, idx) : queryString;
+
+            params = queryString.split("&");
+
+            for (i = 0, len = params.length; i < len; i++) {
+                tokens = params[i].split("=");
+                if (tokens.length >= 2) {
+                    if (tokens[0] === paramName) {
+                        return unescape(tokens[1]);
+                    }
+                }
+            }
+
+            return null;
+        }
+
+    };
+
+})();
+YAHOO.register("history", YAHOO.util.History, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/imagecropper/README b/lib/yui/imagecropper/README
new file mode 100644 (file)
index 0000000..84e27d4
--- /dev/null
@@ -0,0 +1,3 @@
+**** version 2.5.0 ***
+
+Initial Release
diff --git a/lib/yui/imagecropper/assets/imagecropper-core.css b/lib/yui/imagecropper/assets/imagecropper-core.css
new file mode 100644 (file)
index 0000000..f160052
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-crop {
+    position: relative;
+}
+.yui-crop .yui-crop-mask {
+    position: absolute;
+    top: 0;
+    left: 0;
+    height: 100%;
+    width: 100%;
+}
+
+.yui-crop .yui-resize {
+    position: absolute;
+    top: 10px;
+    left: 10px;
+}
+
+.yui-crop .yui-crop-resize-mask {
+    position: absolute;
+    top: 0;
+    left: 0;
+    height: 100%;
+    width: 100%;
+    background-position: -10px -10px;
+    overflow: hidden;
+}
diff --git a/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css b/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css
new file mode 100644 (file)
index 0000000..6b02f00
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-skin-sam .yui-crop .yui-crop-mask {
+    background-color: #000;
+    opacity: .5;
+    filter: alpha(opacity=50);
+}
+
+.yui-skin-sam .yui-crop .yui-resize {
+    border: 1px dashed #fff;   
+}
+
diff --git a/lib/yui/imagecropper/assets/skins/sam/imagecropper.css b/lib/yui/imagecropper/assets/skins/sam/imagecropper.css
new file mode 100644 (file)
index 0000000..66f861b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-crop{position:relative;}.yui-crop .yui-crop-mask{position:absolute;top:0;left:0;height:100%;width:100%;}.yui-crop .yui-resize{position:absolute;top:10px;left:10px;}.yui-crop .yui-crop-resize-mask{position:absolute;top:0;left:0;height:100%;width:100%;background-position:-10px -10px;overflow:hidden;}.yui-skin-sam .yui-crop .yui-crop-mask{background-color:#000;opacity:.5;filter:alpha(opacity=50);}.yui-skin-sam .yui-crop .yui-resize{border:1px dashed #fff;}
diff --git a/lib/yui/imagecropper/imagecropper-beta-debug.js b/lib/yui/imagecropper/imagecropper-beta-debug.js
new file mode 100644 (file)
index 0000000..22f795d
--- /dev/null
@@ -0,0 +1,825 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Creates a Image Cropper control.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, dragdrop, element, event, resize
+ * @module imagecropper
+ * @beta
+ */
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class ImageCropper
+     * @description <p>Creates a Image Cropper control.</p>
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The image element to make croppable.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    var Crop = function(el, config) {
+        YAHOO.log('Initializing', 'log', 'ImageCropper');
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Crop.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all ImageCropper instances
+    * @type Object
+    */ 
+    Crop._instances = {};
+    /**
+    * @static
+    * @method getCropperById 
+    * @description Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object.
+    * @return {Object} The ImageCropper Object
+    */ 
+    Crop.getCropperById = function(id) {
+        if (Crop._instances[id]) {
+            return Crop._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(Crop, YAHOO.util.Element, {
+        /**
+        * @private
+        * @property CSS_MAIN
+        * @description The CSS class used to wrap the element 
+        * @type String
+        */
+        CSS_MAIN: 'yui-crop',
+        /**
+        * @private
+        * @property CSS_MASK
+        * @description The CSS class for the mask element
+        * @type String
+        */
+        CSS_MASK: 'yui-crop-mask',
+        /**
+        * @private
+        * @property CSS_RESIZE_MASK
+        * @description The CSS class for the mask inside the resize element
+        * @type String
+        */
+        CSS_RESIZE_MASK: 'yui-crop-resize-mask',
+
+        /**
+        * @private
+        * @property _image
+        * @description The url of the image we are cropping
+        * @type String
+        */
+        _image: null,
+        /**
+        * @private
+        * @property _active
+        * @description Flag to determine if the crop region is active
+        * @type Boolean
+        */
+        _active: null,
+        /**
+        * @private
+        * @property _resize
+        * @description A reference to the Resize Utility used in this Cropper Instance
+        * @type Object
+        */
+        _resize: null,
+        /**
+        * @private
+        * @property _resizeEl
+        * @description The HTML Element used to create the Resize Oject
+        * @type HTMLElement
+        */
+        _resizeEl: null,
+        /**
+        * @private
+        * @property _resizeMaskEl
+        * @description The HTML Element used to create the Resize mask
+        * @type HTMLElement
+        */
+        _resizeMaskEl: null,
+        /**
+        * @private
+        * @property _wrap
+        * @description The HTML Element created to wrap the image
+        * @type HTMLElement
+        */
+        _wrap: null,
+        /**
+        * @private
+        * @property _mask
+        * @description The HTML Element created to "mask" the image being cropped
+        * @type HTMLElement
+        */
+        _mask: null,
+        /**
+        * @private
+        * @method _createWrap
+        * @description Creates the wrapper element used to wrap the image
+        */
+        _createWrap: function() {
+            YAHOO.log('Creating the wrap element', 'log', 'ImageCropper');
+            this._wrap = document.createElement('div');
+            this._wrap.id = this.get('element').id + '_wrap';
+            this._wrap.className = this.CSS_MAIN;
+            this._wrap.style.width = this.get('element').width + 'px';
+            this._wrap.style.height = this.get('element').height + 'px';
+            var par = this.get('element').parentNode;
+            par.replaceChild(this._wrap, this.get('element'));
+            this._wrap.appendChild(this.get('element'));
+
+            Event.on(this._wrap, 'mouseover', this._handleMouseOver, this, true);
+            Event.on(this._wrap, 'mouseout', this._handleMouseOut, this, true);
+
+            Event.on(this._wrap, 'click', function(ev) { Event.stopEvent(ev); }, this, true);
+        },
+
+        /**
+        * @private
+        * @method _createMask
+        * @description Creates the mask element used to mask the image
+        */
+        _createMask: function() {
+            YAHOO.log('Creating the Mask', 'log', 'ImageCropper');
+            this._mask = document.createElement('div');
+            this._mask.className = this.CSS_MASK;
+            this._wrap.appendChild(this._mask);
+        },
+
+        /**
+        * @private
+        * @method _createResize
+        * @description Creates the resize element and the instance of the Resize Utility
+        */
+        _createResize: function() {
+            YAHOO.log('Creating the Resize element', 'log', 'ImageCropper');
+            this._resizeEl = document.createElement('div');
+            this._resizeEl.className = YAHOO.util.Resize.prototype.CSS_RESIZE;
+            this._resizeEl.style.position = 'absolute';
+            
+            this._resizeEl.innerHTML = '<div class="' + this.CSS_RESIZE_MASK + '"></div>';
+            this._resizeMaskEl = this._resizeEl.firstChild;
+            this._wrap.appendChild(this._resizeEl);
+            this._resizeEl.style.top = this.get('initialXY')[0] + 'px';
+            this._resizeEl.style.left = this.get('initialXY')[1] + 'px';
+            this._resizeMaskEl.style.height = Math.floor(this.get('initHeight')) + 'px';
+            this._resizeMaskEl.style.width = Math.floor(this.get('initWidth')) + 'px';
+
+            this._resize = new YAHOO.util.Resize(this._resizeEl, {
+                knobHandles: true,
+                handles: 'all',
+                draggable: true,
+                status: this.get('status'),
+                minWidth: this.get('minWidth'),
+                minHeight: this.get('minHeight'),
+                ratio: this.get('ratio'),
+                autoRatio: this.get('autoRatio'),
+                height: this.get('initHeight'),
+                width: this.get('initWidth')
+            });
+
+            this._setBackgroundImage(this.get('element').getAttribute('src', 2));
+            this._setBackgroundPosition(-(this.get('initialXY')[0]),  -(this.get('initialXY')[1]));
+
+            this._resize.on('startResize', this._handleStartResizeEvent, this, true);
+            this._resize.on('dragEvent', this._handleDragEvent, this, true);
+            this._resize.on('beforeResize', this._handleBeforeResizeEvent, this, true);
+            this._resize.on('resize', this._handleResizeEvent, this, true);
+            this._resize.dd.on('b4StartDragEvent', this._handleB4DragEvent, this, true);
+        },
+
+        /**
+        * @private
+        * @method _handleMouseOver
+        * @description Handles the mouseover event
+        */
+        _handleMouseOver: function(ev) {
+            if (!this._active) {
+                this._active = true;
+                if (this.get('useKeys')) {
+                    Event.on(document, 'keypress', this._handleKeyPress, this, true);
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseOut
+        * @description Handles the mouseout event
+        */
+        _handleMouseOut: function(ev) {
+            this._active = false;
+            if (this.get('useKeys')) {
+                Event.removeListener(document, 'keypress', this._handleKeyPress);
+            }
+        },
+
+        /**
+        * @private
+        * @method _moveEl
+        * @description Moves the resize element based on the arrow keys
+        */
+        _moveEl: function(dir, inc) {
+            YAHOO.log('Moving the element', 'log', 'ImageCropper');
+            var t = 0, l = 0,
+                region = this._setConstraints(),
+                resize = true;
+
+            switch (dir) {
+                case 'down':
+                    t = -(inc);
+                    if ((region.bottom - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.top = (region.top + region.bottom) + 'px';
+                    }
+                    break;
+                case 'up':
+                    t = (inc);
+                    if ((region.top - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.top = '0px';
+                    }
+                    break;
+                case 'right':
+                    l = -(inc);
+                    if ((region.right - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.left = (region.left + region.right) + 'px';
+                    }
+                    break;
+                case 'left':
+                    l = inc;
+                    if ((region.left - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.left = '0px';
+                    }
+                    break;
+            }
+
+            if (resize) {
+                YAHOO.log('Moving via Key Listener: ' + dir, 'log', 'ImageCropper');
+                this._resizeEl.style.left = (parseInt(this._resizeEl.style.left, 10) - l) + 'px';
+                this._resizeEl.style.top = (parseInt(this._resizeEl.style.top, 10) - t) + 'px';
+                this.fireEvent('moveEvent', { target: 'keypress' });
+            } else {
+                this._setConstraints();
+            }
+            this._syncBackgroundPosition();
+        },
+
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @description Handles the keypress event
+        */
+        _handleKeyPress: function(ev) {
+            var kc = Event.getCharCode(ev),
+                stopEvent = false,
+                inc = ((ev.shiftKey) ? this.get('shiftKeyTick') : this.get('keyTick'));
+
+            switch (kc) {
+                case 0x25: // left
+                    this._moveEl('left', inc);
+                    stopEvent = true;
+                    break;
+                case 0x26: // up
+                    this._moveEl('up', inc);
+                    stopEvent = true;
+                    break;
+                case 0x27: // right
+                    this._moveEl('right', inc);
+                    stopEvent = true;
+                    break;
+                case 0x28: // down
+                    this._moveEl('down', inc);
+                    stopEvent = true;
+                    break;
+                default:
+            }
+            if (stopEvent) {
+                Event.preventDefault(ev);
+            }
+        },
+
+        /**
+        * @private
+        * @method _handleB4DragEvent
+        * @description Handles the DragDrop b4DragEvent event
+        */
+        _handleB4DragEvent: function() {
+            this._setConstraints();
+        },
+
+        /**
+        * @private
+        * @method _handleDragEvent
+        * @description Handles the DragDrop DragEvent event
+        */
+        _handleDragEvent: function() {
+            this._syncBackgroundPosition();
+            this.fireEvent('dragEvent', arguments);
+            this.fireEvent('moveEvent', { target: 'dragevent' });
+        },
+
+        /**
+        * @private
+        * @method _handleBeforeResizeEvent
+        * @description Handles the Resize Utilitys beforeResize event
+        */
+        _handleBeforeResizeEvent: function(args) {
+            //Nothing
+        },
+        /**
+        * @private
+        * @method _handleResizeEvent
+        * @param Event ev The Resize Utilitys resize event.
+        * @description Handles the Resize Utilitys Resize event
+        */
+        _handleResizeEvent: function(ev) {
+            this._resizeMaskEl.style.height = Math.floor(ev.height) + 'px';
+            this._resizeMaskEl.style.width = Math.floor(ev.width) + 'px';
+            this._setConstraints(true);
+            this._syncBackgroundPosition();
+            this.fireEvent('resizeEvent', arguments);
+            this.fireEvent('moveEvent', { target: 'resizeevent' });
+        },
+
+        /**
+        * @private
+        * @method _syncBackgroundPosition
+        * @description Syncs the packground position of the resize element with the resize elements top and left style position
+        */
+        _syncBackgroundPosition: function() {
+            this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left, 10)), -(parseInt(this._resizeEl.style.top, 10)));
+        },
+
+        /**
+        * @private
+        * @method _setBackgroundPosition
+        * @param Number l The left position
+        * @param Number t The top position
+        * @description Sets the background image position to the top and left position
+        */
+        _setBackgroundPosition: function(l, t) {
+            YAHOO.log('Setting the image background position of the mask to: (' + l + ', ' + t + ')', 'log', 'ImageCropper');
+            var mask = this._resize.getWrapEl().firstChild;
+            var pos = l + 'px ' + t + 'px';
+            mask.style.backgroundPosition = pos;
+        },
+
+        /**
+        * @private
+        * @method _setBackgroundImage
+        * @param String url The url of the image
+        * @description Sets the background image of the resize element
+        */
+        _setBackgroundImage: function(url) {
+            YAHOO.log('Setting the background image', 'log', 'ImageCropper');
+            var mask = this._resize.getWrapEl().firstChild;
+            this._image = url;
+            mask.style.backgroundImage = 'url(' + url + '#)';
+        },
+        
+        /**
+        * @private
+        * @method _handleStartResizeEvent
+        * @description Handles the Resize Utilitys startResizeEvent event
+        */
+        _handleStartResizeEvent: function() {
+            this._setConstraints(true);
+
+            var h = this._resize._cache.height,
+                 w = this._resize._cache.width,
+                 t = parseInt(this._resize.getWrapEl().style.top, 10),
+                 l = parseInt(this._resize.getWrapEl().style.left, 10),
+                 maxH = 0, maxW = 0;
+            switch (this._resize._currentHandle) {
+                case 'r':
+                    maxH = (h + t);
+                    maxW = (w + this._resize.dd.rightConstraint);
+                    break;
+                 case 'br':
+                     maxH = (h + this._resize.dd.bottomConstraint);
+                     maxW = (w + this._resize.dd.rightConstraint);
+                     break;
+                 case 'tr':
+                     maxH = (h + t);
+                     maxW = (w + this._resize.dd.rightConstraint);
+                     break;
+
+             }
+
+             if (maxH) {
+                YAHOO.log('Setting the maxHeight on the resize object to: ' + maxH, 'log', 'ImageCropper');
+                 this._resize.set('maxHeight', maxH);
+             }
+             if (maxW) {
+                YAHOO.log('Setting the maxWidth on the resize object to: ' + maxW, 'log', 'ImageCropper');
+                 this._resize.set('maxWidth', maxW);
+             }
+
+            this.fireEvent('startResizeEvent', arguments);
+        },
+        
+        /**
+        * @private
+        * @method _setConstraints
+        * @param Boolean inside Used when called from inside a resize event, false by default (dragging)
+        * @description Set the DragDrop constraints to keep the element inside the crop area.
+        * @return {Object} Object containing Top, Right, Bottom and Left constraints
+        */
+        _setConstraints: function(inside) {
+            YAHOO.log('Setting Contraints', 'log', 'ImageCropper');
+            var resize = this._resize;
+            resize.dd.resetConstraints();
+            var height = parseInt(resize.get('height'), 10),
+                width = parseInt(resize.get('width'), 10);
+
+            if (inside) {
+                //Called from inside the resize callback
+                height = resize._cache.height;
+                width = resize._cache.width;
+            }
+
+            //Get the top, right, bottom and left positions
+            var region = Dom.getRegion(this.get('element'));
+            //Get the element we are working on
+            var el = resize.getWrapEl();
+
+            //Get the xy position of it
+            var xy = Dom.getXY(el);
+
+            //Set left to x minus left
+            var left = xy[0] - region.left;
+
+            //Set right to right minus x minus width
+            var right = region.right - xy[0] - width;
+
+            //Set top to y minus top
+            var top = xy[1] - region.top;
+
+            //Set bottom to bottom minus y minus height
+            var bottom = region.bottom - xy[1] - height;
+            
+            resize.dd.setXConstraint(left, right); 
+            resize.dd.setYConstraint(top, bottom);
+            resize.set('minY', region.top);
+            resize.set('minX', region.left);
+
+            resize.set('maxY', region.bottom);
+            resize.set('maxX', region.right);
+
+            YAHOO.log('Constraints: ' + top + ',' + right + ',' + bottom + ',' + left, 'log', 'ImageCropper');
+
+            return {
+                top: top,
+                right: right,
+                bottom: bottom,
+                left: left
+            };
+
+            
+            
+        },
+        /**
+        * @method getCropCoords
+        * @description Returns the coordinates needed to crop the image
+        * @return {Object} The top, left, height, width and image url of the image being cropped
+        */
+        getCropCoords: function() {
+            var coords = {
+                top: parseInt(this._resize.getWrapEl().style.top, 10),
+                left: parseInt(this._resize.getWrapEl().style.left, 10),
+                height: this._resize._cache.height,
+                width: this._resize._cache.width,
+                image: this._image
+            };
+            YAHOO.log('Getting the crop coordinates: ' + Lang.dump(coords), 'log', 'ImageCropper');
+            return coords;
+        },
+        /**
+        * @method reset
+        * @description Resets the crop element back to it's original position
+        * @return {<a href="YAHOO.widget.ImageCropper.html">YAHOO.widget.ImageCropper</a>} The ImageCropper instance
+        */
+        reset: function() {
+            YAHOO.log('Resetting the control', 'log', 'ImageCropper');
+            this._resize.resize(null, this.get('initHeight'), this.get('initWidth'), 0, 0, true);
+            this._resizeEl.style.top = this.get('initialXY')[0] + 'px';
+            this._resizeEl.style.left = this.get('initialXY')[1] + 'px';
+            this._syncBackgroundPosition();
+            return this;
+        },
+
+        /**
+        * @method getEl
+        * @description Get the HTML reference for the image element.
+        * @return {HTMLElement} The image element
+        */      
+        getEl: function() {
+            return this.get('element');
+        },
+        /**
+        * @method getResizeEl
+        * @description Get the HTML reference for the resize element.
+        * @return {HTMLElement} The resize element
+        */      
+        getResizeEl: function() {
+            return this._resizeEl;
+        },
+        /**
+        * @method getWrapEl
+        * @description Get the HTML reference for the wrap element.
+        * @return {HTMLElement} The wrap element
+        */      
+        getWrapEl: function() {
+            return this._wrap;
+        },
+
+        /**
+        * @method getMaskEl
+        * @description Get the HTML reference for the mask element.
+        * @return {HTMLElement} The mask element
+        */      
+        getMaskEl: function() {
+            return this._mask;
+        },
+
+        /**
+        * @method getResizeMaskEl
+        * @description Get the HTML reference for the resizable object's mask element.
+        * @return {HTMLElement} The resize objects mask element.
+        */      
+        getResizeMaskEl: function() {
+            return this._resizeMaskEl;
+        },
+
+        /**
+        * @method getResizeObject
+        * @description Get the Resize Utility object.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */      
+        getResizeObject: function() {
+            return this._resize;
+        },
+
+        /** 
+        * @private
+        * @method init
+        * @description The ImageCropper class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'ImageCropper');
+            Crop.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            var id = p_oElement;
+
+            if (!Lang.isString(id)) {
+                if (id.tagName && (id.tagName.toLowerCase() == 'img')) {
+                    id = Dom.generateId(id);                    
+                } else {
+                    YAHOO.log('Element is not an image.', 'error', 'ImageCropper');
+                    return false;
+                }
+            } else {
+                var el = Dom.get(id);
+                if (el.tagName && el.tagName.toLowerCase() == 'img') {
+                    //All good
+                } else {
+                    YAHOO.log('Element is not an image.', 'error', 'ImageCropper');
+                    return false;
+                }
+            }
+            
+
+
+            Crop._instances[id] = this;
+            this._createWrap();
+            this._createMask();
+            this._createResize();
+            this._setConstraints();
+
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create a croppable element.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the widget.
+        */      
+
+        initAttributes: function(attr) {
+            Crop.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute initialXY
+            * @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10]
+            * @type Array
+            */
+            this.setAttributeConfig('initialXY', {
+                writeOnce: true,
+                validator: YAHOO.lang.isArray,
+                value: attr.initialXY || [10, 10]
+            });
+            /**
+            * @attribute keyTick
+            * @description The pixel tick for the arrow keys, defaults to 1
+            * @type Number
+            */
+            this.setAttributeConfig('keyTick', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.keyTick || 1
+            });
+
+            /**
+            * @attribute shiftKeyTick
+            * @description The pixel tick for shift + the arrow keys, defaults to 10
+            * @type Number
+            */
+            this.setAttributeConfig('shiftKeyTick', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.shiftKeyTick || 10
+            });
+
+            /**
+            * @attribute useKeys
+            * @description Should we use the Arrow keys to position the crop element, defaults to true
+            * @type Boolean
+            */
+            this.setAttributeConfig('useKeys', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.useKeys === false) ? false : true)
+            });
+
+            /**
+            * @attribute status
+            * @description Show the Resize Utility status, defaults to true
+            * @type Boolean
+            */
+            this.setAttributeConfig('status', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.status === false) ? false : true),
+                method: function(status) {
+                    if (this._resize) {
+                        this._resize.set('status', status);
+                    }
+                }
+            });
+
+            /**
+            * @attribute minHeight
+            * @description MinHeight of the crop area, default 50
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.minHeight || 50,
+                method: function(h) {
+                    if (this._resize) {
+                        this._resize.set('minHeight', h);
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description MinWidth of the crop area, default 50.
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.minWidth || 50,
+                method: function(w) {
+                    if (this._resize) {
+                        this._resize.set('minWidth', w);
+                    }
+                }
+            });
+
+            /**
+            * @attribute ratio
+            * @description Set the ratio config option of the Resize Utlility, default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('ratio', {
+                validator: YAHOO.lang.isBoolean,
+                value: attr.ratio || false,
+                method: function(r) {
+                    if (this._resize) {
+                        this._resize.set('ratio', r);
+                    }
+                }
+            });
+
+            /**
+            * @attribute ratio
+            * @description Set the autoRatio config option of the Resize Utlility, default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('autoRatio', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.autoRatio === false) ? false : true),
+                method: function(a) {
+                    if (this._resize) {
+                        this._resize.set('autoRatio', a);
+                    }
+                }
+            });
+
+            /**
+            * @attribute initHeight
+            * @description Set the initlal height of the crop area, defaults to 1/4 of the image height
+            * @type Number
+            */
+            this.setAttributeConfig('initHeight', {
+                writeOnce: true,
+                validator: YAHOO.lang.isNumber,
+                value: attr.initHeight || (this.get('element').height / 4)
+            });
+
+            /**
+            * @attribute initWidth
+            * @description Set the initlal width of the crop area, defaults to 1/4 of the image width
+            * @type Number
+            */
+            this.setAttributeConfig('initWidth', {
+                validator: YAHOO.lang.isNumber,
+                writeOnce: true,
+                value: attr.initWidth || (this.get('element').width / 4)
+            });
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the ImageCropper object and all of it's elements & listeners.
+        */        
+        destroy: function() {
+            YAHOO.log('Destroying the ImageCropper', 'info', 'ImageCropper');
+            this._resize.destroy();
+            this._resizeEl.parentNode.removeChild(this._resizeEl);
+            this._mask.parentNode.removeChild(this._mask);
+            Event.purgeElement(this._wrap);
+            this._wrap.parentNode.replaceChild(this.get('element'), this._wrap);
+            
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+                       
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the ImageCropper Object.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'ImageCropper (#' + this.get('id') + ')';
+            }
+            return 'Image Cropper';
+        }
+    });
+
+    YAHOO.widget.ImageCropper = Crop;
+
+/**
+* @event dragEvent
+* @description Fires when the DragDrop dragEvent
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event startResizeEvent
+* @description Fires when when a resize action is started.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event resizeEvent
+* @description Fires on every element resize.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event moveEvent
+* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent
+* @type YAHOO.util.CustomEvent
+*/
+
+})();
+
+YAHOO.register("imagecropper", YAHOO.widget.ImageCropper, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/imagecropper/imagecropper-beta-min.js b/lib/yui/imagecropper/imagecropper-beta-min.js
new file mode 100644 (file)
index 0000000..d9985f5
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;var B=function(F,E){var G={element:F,attributes:E||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getCropperById=function(E){if(B._instances[E]){return B._instances[E];}return false;};YAHOO.extend(B,YAHOO.util.Element,{CSS_MAIN:"yui-crop",CSS_MASK:"yui-crop-mask",CSS_RESIZE_MASK:"yui-crop-resize-mask",_image:null,_active:null,_resize:null,_resizeEl:null,_resizeMaskEl:null,_wrap:null,_mask:null,_createWrap:function(){this._wrap=document.createElement("div");this._wrap.id=this.get("element").id+"_wrap";this._wrap.className=this.CSS_MAIN;this._wrap.style.width=this.get("element").width+"px";this._wrap.style.height=this.get("element").height+"px";var E=this.get("element").parentNode;E.replaceChild(this._wrap,this.get("element"));this._wrap.appendChild(this.get("element"));A.on(this._wrap,"mouseover",this._handleMouseOver,this,true);A.on(this._wrap,"mouseout",this._handleMouseOut,this,true);A.on(this._wrap,"click",function(F){A.stopEvent(F);},this,true);},_createMask:function(){this._mask=document.createElement("div");this._mask.className=this.CSS_MASK;this._wrap.appendChild(this._mask);},_createResize:function(){this._resizeEl=document.createElement("div");this._resizeEl.className=YAHOO.util.Resize.prototype.CSS_RESIZE;this._resizeEl.style.position="absolute";this._resizeEl.innerHTML="<div class=\""+this.CSS_RESIZE_MASK+"\"></div>";this._resizeMaskEl=this._resizeEl.firstChild;this._wrap.appendChild(this._resizeEl);this._resizeEl.style.top=this.get("initialXY")[0]+"px";this._resizeEl.style.left=this.get("initialXY")[1]+"px";this._resizeMaskEl.style.height=Math.floor(this.get("initHeight"))+"px";this._resizeMaskEl.style.width=Math.floor(this.get("initWidth"))+"px";this._resize=new YAHOO.util.Resize(this._resizeEl,{knobHandles:true,handles:"all",draggable:true,status:this.get("status"),minWidth:this.get("minWidth"),minHeight:this.get("minHeight"),ratio:this.get("ratio"),autoRatio:this.get("autoRatio"),height:this.get("initHeight"),width:this.get("initWidth")});this._setBackgroundImage(this.get("element").getAttribute("src",2));this._setBackgroundPosition(-(this.get("initialXY")[0]),-(this.get("initialXY")[1]));this._resize.on("startResize",this._handleStartResizeEvent,this,true);this._resize.on("dragEvent",this._handleDragEvent,this,true);this._resize.on("beforeResize",this._handleBeforeResizeEvent,this,true);this._resize.on("resize",this._handleResizeEvent,this,true);this._resize.dd.on("b4StartDragEvent",this._handleB4DragEvent,this,true);},_handleMouseOver:function(E){if(!this._active){this._active=true;if(this.get("useKeys")){A.on(document,"keypress",this._handleKeyPress,this,true);}}},_handleMouseOut:function(E){this._active=false;if(this.get("useKeys")){A.removeListener(document,"keypress",this._handleKeyPress);}},_moveEl:function(G,J){var H=0,E=0,I=this._setConstraints(),F=true;switch(G){case"down":H=-(J);if((I.bottom-J)<0){F=false;this._resizeEl.style.top=(I.top+I.bottom)+"px";}break;case"up":H=(J);if((I.top-J)<0){F=false;this._resizeEl.style.top="0px";}break;case"right":E=-(J);if((I.right-J)<0){F=false;this._resizeEl.style.left=(I.left+I.right)+"px";}break;case"left":E=J;if((I.left-J)<0){F=false;this._resizeEl.style.left="0px";}break;}if(F){this._resizeEl.style.left=(parseInt(this._resizeEl.style.left,10)-E)+"px";this._resizeEl.style.top=(parseInt(this._resizeEl.style.top,10)-H)+"px";this.fireEvent("moveEvent",{target:"keypress"});}else{this._setConstraints();}this._syncBackgroundPosition();},_handleKeyPress:function(G){var E=A.getCharCode(G),F=false,H=((G.shiftKey)?this.get("shiftKeyTick"):this.get("keyTick"));switch(E){case 37:this._moveEl("left",H);F=true;break;case 38:this._moveEl("up",H);F=true;break;case 39:this._moveEl("right",H);F=true;break;case 40:this._moveEl("down",H);F=true;break;default:}if(F){A.preventDefault(G);}},_handleB4DragEvent:function(){this._setConstraints();},_handleDragEvent:function(){this._syncBackgroundPosition();this.fireEvent("dragEvent",arguments);this.fireEvent("moveEvent",{target:"dragevent"});},_handleBeforeResizeEvent:function(E){},_handleResizeEvent:function(E){this._resizeMaskEl.style.height=Math.floor(E.height)+"px";this._resizeMaskEl.style.width=Math.floor(E.width)+"px";this._setConstraints(true);this._syncBackgroundPosition();this.fireEvent("resizeEvent",arguments);this.fireEvent("moveEvent",{target:"resizeevent"});},_syncBackgroundPosition:function(){this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left,10)),-(parseInt(this._resizeEl.style.top,10)));},_setBackgroundPosition:function(F,G){var E=this._resize.getWrapEl().firstChild;var H=F+"px "+G+"px";E.style.backgroundPosition=H;},_setBackgroundImage:function(F){var E=this._resize.getWrapEl().firstChild;this._image=F;E.style.backgroundImage="url("+F+"#)";},_handleStartResizeEvent:function(){this._setConstraints(true);var I=this._resize._cache.height,F=this._resize._cache.width,H=parseInt(this._resize.getWrapEl().style.top,10),E=parseInt(this._resize.getWrapEl().style.left,10),G=0,J=0;switch(this._resize._currentHandle){case"r":G=(I+H);J=(F+this._resize.dd.rightConstraint);break;case"br":G=(I+this._resize.dd.bottomConstraint);J=(F+this._resize.dd.rightConstraint);break;case"tr":G=(I+H);J=(F+this._resize.dd.rightConstraint);break;}if(G){this._resize.set("maxHeight",G);}if(J){this._resize.set("maxWidth",J);}this.fireEvent("startResizeEvent",arguments);},_setConstraints:function(J){var H=this._resize;H.dd.resetConstraints();var N=parseInt(H.get("height"),10),F=parseInt(H.get("width"),10);if(J){N=H._cache.height;F=H._cache.width;}var L=C.getRegion(this.get("element"));var G=H.getWrapEl();var O=C.getXY(G);var I=O[0]-L.left;var M=L.right-O[0]-F;var K=O[1]-L.top;var E=L.bottom-O[1]-N;H.dd.setXConstraint(I,M);H.dd.setYConstraint(K,E);H.set("minY",L.top);H.set("minX",L.left);H.set("maxY",L.bottom);H.set("maxX",L.right);return{top:K,right:M,bottom:E,left:I};},getCropCoords:function(){var E={top:parseInt(this._resize.getWrapEl().style.top,10),left:parseInt(this._resize.getWrapEl().style.left,10),height:this._resize._cache.height,width:this._resize._cache.width,image:this._image};
+return E;},reset:function(){this._resize.resize(null,this.get("initHeight"),this.get("initWidth"),0,0,true);this._resizeEl.style.top=this.get("initialXY")[0]+"px";this._resizeEl.style.left=this.get("initialXY")[1]+"px";this._syncBackgroundPosition();return this;},getEl:function(){return this.get("element");},getResizeEl:function(){return this._resizeEl;},getWrapEl:function(){return this._wrap;},getMaskEl:function(){return this._mask;},getResizeMaskEl:function(){return this._resizeMaskEl;},getResizeObject:function(){return this._resize;},init:function(G,E){B.superclass.init.call(this,G,E);var H=G;if(!D.isString(H)){if(H.tagName&&(H.tagName.toLowerCase()=="img")){H=C.generateId(H);}else{return false;}}else{var F=C.get(H);if(F.tagName&&F.tagName.toLowerCase()=="img"){}else{return false;}}B._instances[H]=this;this._createWrap();this._createMask();this._createResize();this._setConstraints();},initAttributes:function(E){B.superclass.initAttributes.call(this,E);this.setAttributeConfig("initialXY",{writeOnce:true,validator:YAHOO.lang.isArray,value:E.initialXY||[10,10]});this.setAttributeConfig("keyTick",{validator:YAHOO.lang.isNumber,value:E.keyTick||1});this.setAttributeConfig("shiftKeyTick",{validator:YAHOO.lang.isNumber,value:E.shiftKeyTick||10});this.setAttributeConfig("useKeys",{validator:YAHOO.lang.isBoolean,value:((E.useKeys===false)?false:true)});this.setAttributeConfig("status",{validator:YAHOO.lang.isBoolean,value:((E.status===false)?false:true),method:function(F){if(this._resize){this._resize.set("status",F);}}});this.setAttributeConfig("minHeight",{validator:YAHOO.lang.isNumber,value:E.minHeight||50,method:function(F){if(this._resize){this._resize.set("minHeight",F);}}});this.setAttributeConfig("minWidth",{validator:YAHOO.lang.isNumber,value:E.minWidth||50,method:function(F){if(this._resize){this._resize.set("minWidth",F);}}});this.setAttributeConfig("ratio",{validator:YAHOO.lang.isBoolean,value:E.ratio||false,method:function(F){if(this._resize){this._resize.set("ratio",F);}}});this.setAttributeConfig("autoRatio",{validator:YAHOO.lang.isBoolean,value:((E.autoRatio===false)?false:true),method:function(F){if(this._resize){this._resize.set("autoRatio",F);}}});this.setAttributeConfig("initHeight",{writeOnce:true,validator:YAHOO.lang.isNumber,value:E.initHeight||(this.get("element").height/4)});this.setAttributeConfig("initWidth",{validator:YAHOO.lang.isNumber,writeOnce:true,value:E.initWidth||(this.get("element").width/4)});},destroy:function(){this._resize.destroy();this._resizeEl.parentNode.removeChild(this._resizeEl);this._mask.parentNode.removeChild(this._mask);A.purgeElement(this._wrap);this._wrap.parentNode.replaceChild(this.get("element"),this._wrap);for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}},toString:function(){if(this.get){return"ImageCropper (#"+this.get("id")+")";}return"Image Cropper";}});YAHOO.widget.ImageCropper=B;})();YAHOO.register("imagecropper",YAHOO.widget.ImageCropper,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/imagecropper/imagecropper-beta.js b/lib/yui/imagecropper/imagecropper-beta.js
new file mode 100644 (file)
index 0000000..e0af77c
--- /dev/null
@@ -0,0 +1,807 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Creates a Image Cropper control.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, dragdrop, element, event, resize
+ * @module imagecropper
+ * @beta
+ */
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class ImageCropper
+     * @description <p>Creates a Image Cropper control.</p>
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The image element to make croppable.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    var Crop = function(el, config) {
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Crop.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all ImageCropper instances
+    * @type Object
+    */ 
+    Crop._instances = {};
+    /**
+    * @static
+    * @method getCropperById 
+    * @description Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object.
+    * @return {Object} The ImageCropper Object
+    */ 
+    Crop.getCropperById = function(id) {
+        if (Crop._instances[id]) {
+            return Crop._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(Crop, YAHOO.util.Element, {
+        /**
+        * @private
+        * @property CSS_MAIN
+        * @description The CSS class used to wrap the element 
+        * @type String
+        */
+        CSS_MAIN: 'yui-crop',
+        /**
+        * @private
+        * @property CSS_MASK
+        * @description The CSS class for the mask element
+        * @type String
+        */
+        CSS_MASK: 'yui-crop-mask',
+        /**
+        * @private
+        * @property CSS_RESIZE_MASK
+        * @description The CSS class for the mask inside the resize element
+        * @type String
+        */
+        CSS_RESIZE_MASK: 'yui-crop-resize-mask',
+
+        /**
+        * @private
+        * @property _image
+        * @description The url of the image we are cropping
+        * @type String
+        */
+        _image: null,
+        /**
+        * @private
+        * @property _active
+        * @description Flag to determine if the crop region is active
+        * @type Boolean
+        */
+        _active: null,
+        /**
+        * @private
+        * @property _resize
+        * @description A reference to the Resize Utility used in this Cropper Instance
+        * @type Object
+        */
+        _resize: null,
+        /**
+        * @private
+        * @property _resizeEl
+        * @description The HTML Element used to create the Resize Oject
+        * @type HTMLElement
+        */
+        _resizeEl: null,
+        /**
+        * @private
+        * @property _resizeMaskEl
+        * @description The HTML Element used to create the Resize mask
+        * @type HTMLElement
+        */
+        _resizeMaskEl: null,
+        /**
+        * @private
+        * @property _wrap
+        * @description The HTML Element created to wrap the image
+        * @type HTMLElement
+        */
+        _wrap: null,
+        /**
+        * @private
+        * @property _mask
+        * @description The HTML Element created to "mask" the image being cropped
+        * @type HTMLElement
+        */
+        _mask: null,
+        /**
+        * @private
+        * @method _createWrap
+        * @description Creates the wrapper element used to wrap the image
+        */
+        _createWrap: function() {
+            this._wrap = document.createElement('div');
+            this._wrap.id = this.get('element').id + '_wrap';
+            this._wrap.className = this.CSS_MAIN;
+            this._wrap.style.width = this.get('element').width + 'px';
+            this._wrap.style.height = this.get('element').height + 'px';
+            var par = this.get('element').parentNode;
+            par.replaceChild(this._wrap, this.get('element'));
+            this._wrap.appendChild(this.get('element'));
+
+            Event.on(this._wrap, 'mouseover', this._handleMouseOver, this, true);
+            Event.on(this._wrap, 'mouseout', this._handleMouseOut, this, true);
+
+            Event.on(this._wrap, 'click', function(ev) { Event.stopEvent(ev); }, this, true);
+        },
+
+        /**
+        * @private
+        * @method _createMask
+        * @description Creates the mask element used to mask the image
+        */
+        _createMask: function() {
+            this._mask = document.createElement('div');
+            this._mask.className = this.CSS_MASK;
+            this._wrap.appendChild(this._mask);
+        },
+
+        /**
+        * @private
+        * @method _createResize
+        * @description Creates the resize element and the instance of the Resize Utility
+        */
+        _createResize: function() {
+            this._resizeEl = document.createElement('div');
+            this._resizeEl.className = YAHOO.util.Resize.prototype.CSS_RESIZE;
+            this._resizeEl.style.position = 'absolute';
+            
+            this._resizeEl.innerHTML = '<div class="' + this.CSS_RESIZE_MASK + '"></div>';
+            this._resizeMaskEl = this._resizeEl.firstChild;
+            this._wrap.appendChild(this._resizeEl);
+            this._resizeEl.style.top = this.get('initialXY')[0] + 'px';
+            this._resizeEl.style.left = this.get('initialXY')[1] + 'px';
+            this._resizeMaskEl.style.height = Math.floor(this.get('initHeight')) + 'px';
+            this._resizeMaskEl.style.width = Math.floor(this.get('initWidth')) + 'px';
+
+            this._resize = new YAHOO.util.Resize(this._resizeEl, {
+                knobHandles: true,
+                handles: 'all',
+                draggable: true,
+                status: this.get('status'),
+                minWidth: this.get('minWidth'),
+                minHeight: this.get('minHeight'),
+                ratio: this.get('ratio'),
+                autoRatio: this.get('autoRatio'),
+                height: this.get('initHeight'),
+                width: this.get('initWidth')
+            });
+
+            this._setBackgroundImage(this.get('element').getAttribute('src', 2));
+            this._setBackgroundPosition(-(this.get('initialXY')[0]),  -(this.get('initialXY')[1]));
+
+            this._resize.on('startResize', this._handleStartResizeEvent, this, true);
+            this._resize.on('dragEvent', this._handleDragEvent, this, true);
+            this._resize.on('beforeResize', this._handleBeforeResizeEvent, this, true);
+            this._resize.on('resize', this._handleResizeEvent, this, true);
+            this._resize.dd.on('b4StartDragEvent', this._handleB4DragEvent, this, true);
+        },
+
+        /**
+        * @private
+        * @method _handleMouseOver
+        * @description Handles the mouseover event
+        */
+        _handleMouseOver: function(ev) {
+            if (!this._active) {
+                this._active = true;
+                if (this.get('useKeys')) {
+                    Event.on(document, 'keypress', this._handleKeyPress, this, true);
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseOut
+        * @description Handles the mouseout event
+        */
+        _handleMouseOut: function(ev) {
+            this._active = false;
+            if (this.get('useKeys')) {
+                Event.removeListener(document, 'keypress', this._handleKeyPress);
+            }
+        },
+
+        /**
+        * @private
+        * @method _moveEl
+        * @description Moves the resize element based on the arrow keys
+        */
+        _moveEl: function(dir, inc) {
+            var t = 0, l = 0,
+                region = this._setConstraints(),
+                resize = true;
+
+            switch (dir) {
+                case 'down':
+                    t = -(inc);
+                    if ((region.bottom - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.top = (region.top + region.bottom) + 'px';
+                    }
+                    break;
+                case 'up':
+                    t = (inc);
+                    if ((region.top - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.top = '0px';
+                    }
+                    break;
+                case 'right':
+                    l = -(inc);
+                    if ((region.right - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.left = (region.left + region.right) + 'px';
+                    }
+                    break;
+                case 'left':
+                    l = inc;
+                    if ((region.left - inc) < 0) {
+                        resize = false;
+                        this._resizeEl.style.left = '0px';
+                    }
+                    break;
+            }
+
+            if (resize) {
+                this._resizeEl.style.left = (parseInt(this._resizeEl.style.left, 10) - l) + 'px';
+                this._resizeEl.style.top = (parseInt(this._resizeEl.style.top, 10) - t) + 'px';
+                this.fireEvent('moveEvent', { target: 'keypress' });
+            } else {
+                this._setConstraints();
+            }
+            this._syncBackgroundPosition();
+        },
+
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @description Handles the keypress event
+        */
+        _handleKeyPress: function(ev) {
+            var kc = Event.getCharCode(ev),
+                stopEvent = false,
+                inc = ((ev.shiftKey) ? this.get('shiftKeyTick') : this.get('keyTick'));
+
+            switch (kc) {
+                case 0x25: // left
+                    this._moveEl('left', inc);
+                    stopEvent = true;
+                    break;
+                case 0x26: // up
+                    this._moveEl('up', inc);
+                    stopEvent = true;
+                    break;
+                case 0x27: // right
+                    this._moveEl('right', inc);
+                    stopEvent = true;
+                    break;
+                case 0x28: // down
+                    this._moveEl('down', inc);
+                    stopEvent = true;
+                    break;
+                default:
+            }
+            if (stopEvent) {
+                Event.preventDefault(ev);
+            }
+        },
+
+        /**
+        * @private
+        * @method _handleB4DragEvent
+        * @description Handles the DragDrop b4DragEvent event
+        */
+        _handleB4DragEvent: function() {
+            this._setConstraints();
+        },
+
+        /**
+        * @private
+        * @method _handleDragEvent
+        * @description Handles the DragDrop DragEvent event
+        */
+        _handleDragEvent: function() {
+            this._syncBackgroundPosition();
+            this.fireEvent('dragEvent', arguments);
+            this.fireEvent('moveEvent', { target: 'dragevent' });
+        },
+
+        /**
+        * @private
+        * @method _handleBeforeResizeEvent
+        * @description Handles the Resize Utilitys beforeResize event
+        */
+        _handleBeforeResizeEvent: function(args) {
+            //Nothing
+        },
+        /**
+        * @private
+        * @method _handleResizeEvent
+        * @param Event ev The Resize Utilitys resize event.
+        * @description Handles the Resize Utilitys Resize event
+        */
+        _handleResizeEvent: function(ev) {
+            this._resizeMaskEl.style.height = Math.floor(ev.height) + 'px';
+            this._resizeMaskEl.style.width = Math.floor(ev.width) + 'px';
+            this._setConstraints(true);
+            this._syncBackgroundPosition();
+            this.fireEvent('resizeEvent', arguments);
+            this.fireEvent('moveEvent', { target: 'resizeevent' });
+        },
+
+        /**
+        * @private
+        * @method _syncBackgroundPosition
+        * @description Syncs the packground position of the resize element with the resize elements top and left style position
+        */
+        _syncBackgroundPosition: function() {
+            this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left, 10)), -(parseInt(this._resizeEl.style.top, 10)));
+        },
+
+        /**
+        * @private
+        * @method _setBackgroundPosition
+        * @param Number l The left position
+        * @param Number t The top position
+        * @description Sets the background image position to the top and left position
+        */
+        _setBackgroundPosition: function(l, t) {
+            var mask = this._resize.getWrapEl().firstChild;
+            var pos = l + 'px ' + t + 'px';
+            mask.style.backgroundPosition = pos;
+        },
+
+        /**
+        * @private
+        * @method _setBackgroundImage
+        * @param String url The url of the image
+        * @description Sets the background image of the resize element
+        */
+        _setBackgroundImage: function(url) {
+            var mask = this._resize.getWrapEl().firstChild;
+            this._image = url;
+            mask.style.backgroundImage = 'url(' + url + '#)';
+        },
+        
+        /**
+        * @private
+        * @method _handleStartResizeEvent
+        * @description Handles the Resize Utilitys startResizeEvent event
+        */
+        _handleStartResizeEvent: function() {
+            this._setConstraints(true);
+
+            var h = this._resize._cache.height,
+                 w = this._resize._cache.width,
+                 t = parseInt(this._resize.getWrapEl().style.top, 10),
+                 l = parseInt(this._resize.getWrapEl().style.left, 10),
+                 maxH = 0, maxW = 0;
+            switch (this._resize._currentHandle) {
+                case 'r':
+                    maxH = (h + t);
+                    maxW = (w + this._resize.dd.rightConstraint);
+                    break;
+                 case 'br':
+                     maxH = (h + this._resize.dd.bottomConstraint);
+                     maxW = (w + this._resize.dd.rightConstraint);
+                     break;
+                 case 'tr':
+                     maxH = (h + t);
+                     maxW = (w + this._resize.dd.rightConstraint);
+                     break;
+
+             }
+
+             if (maxH) {
+                 this._resize.set('maxHeight', maxH);
+             }
+             if (maxW) {
+                 this._resize.set('maxWidth', maxW);
+             }
+
+            this.fireEvent('startResizeEvent', arguments);
+        },
+        
+        /**
+        * @private
+        * @method _setConstraints
+        * @param Boolean inside Used when called from inside a resize event, false by default (dragging)
+        * @description Set the DragDrop constraints to keep the element inside the crop area.
+        * @return {Object} Object containing Top, Right, Bottom and Left constraints
+        */
+        _setConstraints: function(inside) {
+            var resize = this._resize;
+            resize.dd.resetConstraints();
+            var height = parseInt(resize.get('height'), 10),
+                width = parseInt(resize.get('width'), 10);
+
+            if (inside) {
+                //Called from inside the resize callback
+                height = resize._cache.height;
+                width = resize._cache.width;
+            }
+
+            //Get the top, right, bottom and left positions
+            var region = Dom.getRegion(this.get('element'));
+            //Get the element we are working on
+            var el = resize.getWrapEl();
+
+            //Get the xy position of it
+            var xy = Dom.getXY(el);
+
+            //Set left to x minus left
+            var left = xy[0] - region.left;
+
+            //Set right to right minus x minus width
+            var right = region.right - xy[0] - width;
+
+            //Set top to y minus top
+            var top = xy[1] - region.top;
+
+            //Set bottom to bottom minus y minus height
+            var bottom = region.bottom - xy[1] - height;
+            
+            resize.dd.setXConstraint(left, right); 
+            resize.dd.setYConstraint(top, bottom);
+            resize.set('minY', region.top);
+            resize.set('minX', region.left);
+
+            resize.set('maxY', region.bottom);
+            resize.set('maxX', region.right);
+
+
+            return {
+                top: top,
+                right: right,
+                bottom: bottom,
+                left: left
+            };
+
+            
+            
+        },
+        /**
+        * @method getCropCoords
+        * @description Returns the coordinates needed to crop the image
+        * @return {Object} The top, left, height, width and image url of the image being cropped
+        */
+        getCropCoords: function() {
+            var coords = {
+                top: parseInt(this._resize.getWrapEl().style.top, 10),
+                left: parseInt(this._resize.getWrapEl().style.left, 10),
+                height: this._resize._cache.height,
+                width: this._resize._cache.width,
+                image: this._image
+            };
+            return coords;
+        },
+        /**
+        * @method reset
+        * @description Resets the crop element back to it's original position
+        * @return {<a href="YAHOO.widget.ImageCropper.html">YAHOO.widget.ImageCropper</a>} The ImageCropper instance
+        */
+        reset: function() {
+            this._resize.resize(null, this.get('initHeight'), this.get('initWidth'), 0, 0, true);
+            this._resizeEl.style.top = this.get('initialXY')[0] + 'px';
+            this._resizeEl.style.left = this.get('initialXY')[1] + 'px';
+            this._syncBackgroundPosition();
+            return this;
+        },
+
+        /**
+        * @method getEl
+        * @description Get the HTML reference for the image element.
+        * @return {HTMLElement} The image element
+        */      
+        getEl: function() {
+            return this.get('element');
+        },
+        /**
+        * @method getResizeEl
+        * @description Get the HTML reference for the resize element.
+        * @return {HTMLElement} The resize element
+        */      
+        getResizeEl: function() {
+            return this._resizeEl;
+        },
+        /**
+        * @method getWrapEl
+        * @description Get the HTML reference for the wrap element.
+        * @return {HTMLElement} The wrap element
+        */      
+        getWrapEl: function() {
+            return this._wrap;
+        },
+
+        /**
+        * @method getMaskEl
+        * @description Get the HTML reference for the mask element.
+        * @return {HTMLElement} The mask element
+        */      
+        getMaskEl: function() {
+            return this._mask;
+        },
+
+        /**
+        * @method getResizeMaskEl
+        * @description Get the HTML reference for the resizable object's mask element.
+        * @return {HTMLElement} The resize objects mask element.
+        */      
+        getResizeMaskEl: function() {
+            return this._resizeMaskEl;
+        },
+
+        /**
+        * @method getResizeObject
+        * @description Get the Resize Utility object.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */      
+        getResizeObject: function() {
+            return this._resize;
+        },
+
+        /** 
+        * @private
+        * @method init
+        * @description The ImageCropper class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            Crop.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            var id = p_oElement;
+
+            if (!Lang.isString(id)) {
+                if (id.tagName && (id.tagName.toLowerCase() == 'img')) {
+                    id = Dom.generateId(id);                    
+                } else {
+                    return false;
+                }
+            } else {
+                var el = Dom.get(id);
+                if (el.tagName && el.tagName.toLowerCase() == 'img') {
+                    //All good
+                } else {
+                    return false;
+                }
+            }
+            
+
+
+            Crop._instances[id] = this;
+            this._createWrap();
+            this._createMask();
+            this._createResize();
+            this._setConstraints();
+
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create a croppable element.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the widget.
+        */      
+
+        initAttributes: function(attr) {
+            Crop.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute initialXY
+            * @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10]
+            * @type Array
+            */
+            this.setAttributeConfig('initialXY', {
+                writeOnce: true,
+                validator: YAHOO.lang.isArray,
+                value: attr.initialXY || [10, 10]
+            });
+            /**
+            * @attribute keyTick
+            * @description The pixel tick for the arrow keys, defaults to 1
+            * @type Number
+            */
+            this.setAttributeConfig('keyTick', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.keyTick || 1
+            });
+
+            /**
+            * @attribute shiftKeyTick
+            * @description The pixel tick for shift + the arrow keys, defaults to 10
+            * @type Number
+            */
+            this.setAttributeConfig('shiftKeyTick', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.shiftKeyTick || 10
+            });
+
+            /**
+            * @attribute useKeys
+            * @description Should we use the Arrow keys to position the crop element, defaults to true
+            * @type Boolean
+            */
+            this.setAttributeConfig('useKeys', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.useKeys === false) ? false : true)
+            });
+
+            /**
+            * @attribute status
+            * @description Show the Resize Utility status, defaults to true
+            * @type Boolean
+            */
+            this.setAttributeConfig('status', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.status === false) ? false : true),
+                method: function(status) {
+                    if (this._resize) {
+                        this._resize.set('status', status);
+                    }
+                }
+            });
+
+            /**
+            * @attribute minHeight
+            * @description MinHeight of the crop area, default 50
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.minHeight || 50,
+                method: function(h) {
+                    if (this._resize) {
+                        this._resize.set('minHeight', h);
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description MinWidth of the crop area, default 50.
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                validator: YAHOO.lang.isNumber,
+                value: attr.minWidth || 50,
+                method: function(w) {
+                    if (this._resize) {
+                        this._resize.set('minWidth', w);
+                    }
+                }
+            });
+
+            /**
+            * @attribute ratio
+            * @description Set the ratio config option of the Resize Utlility, default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('ratio', {
+                validator: YAHOO.lang.isBoolean,
+                value: attr.ratio || false,
+                method: function(r) {
+                    if (this._resize) {
+                        this._resize.set('ratio', r);
+                    }
+                }
+            });
+
+            /**
+            * @attribute ratio
+            * @description Set the autoRatio config option of the Resize Utlility, default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('autoRatio', {
+                validator: YAHOO.lang.isBoolean,
+                value: ((attr.autoRatio === false) ? false : true),
+                method: function(a) {
+                    if (this._resize) {
+                        this._resize.set('autoRatio', a);
+                    }
+                }
+            });
+
+            /**
+            * @attribute initHeight
+            * @description Set the initlal height of the crop area, defaults to 1/4 of the image height
+            * @type Number
+            */
+            this.setAttributeConfig('initHeight', {
+                writeOnce: true,
+                validator: YAHOO.lang.isNumber,
+                value: attr.initHeight || (this.get('element').height / 4)
+            });
+
+            /**
+            * @attribute initWidth
+            * @description Set the initlal width of the crop area, defaults to 1/4 of the image width
+            * @type Number
+            */
+            this.setAttributeConfig('initWidth', {
+                validator: YAHOO.lang.isNumber,
+                writeOnce: true,
+                value: attr.initWidth || (this.get('element').width / 4)
+            });
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the ImageCropper object and all of it's elements & listeners.
+        */        
+        destroy: function() {
+            this._resize.destroy();
+            this._resizeEl.parentNode.removeChild(this._resizeEl);
+            this._mask.parentNode.removeChild(this._mask);
+            Event.purgeElement(this._wrap);
+            this._wrap.parentNode.replaceChild(this.get('element'), this._wrap);
+            
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+                       
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the ImageCropper Object.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'ImageCropper (#' + this.get('id') + ')';
+            }
+            return 'Image Cropper';
+        }
+    });
+
+    YAHOO.widget.ImageCropper = Crop;
+
+/**
+* @event dragEvent
+* @description Fires when the DragDrop dragEvent
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event startResizeEvent
+* @description Fires when when a resize action is started.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event resizeEvent
+* @description Fires on every element resize.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event moveEvent
+* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent
+* @type YAHOO.util.CustomEvent
+*/
+
+})();
+
+YAHOO.register("imagecropper", YAHOO.widget.ImageCropper, {version: "2.5.0", build: "895"});
index b1d5eb86972206a5a0a0480adbb62716bf1f6aac..7b27ff41606536cf751642082d25247825a40c3e 100755 (executable)
@@ -1,4 +1,14 @@
 ImageLoader - Release Notes
 
+2.5.0
+   * Group object has an addCustomTrigger() function for adding custom event triggers
+   * PNG background images now support custom properties for AlphaImageLoader
+
+2.4.0
+   * No Change
+
+2.3.1
+   * No Change
+
 2.3.0
    * Initial release
diff --git a/lib/yui/imageloader/imageloader-debug.js b/lib/yui/imageloader/imageloader-debug.js
new file mode 100644 (file)
index 0000000..db44a61
--- /dev/null
@@ -0,0 +1,487 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The image loader is a framework to dynamically load images
+ * according to certain triggers, enabling faster load times
+ * and a more responsive UI.
+ *
+ * @module imageloader
+ * @namespace YAHOO.util
+ */
+
+if (typeof(YAHOO.util.ImageLoader) == 'undefined') {
+       YAHOO.util.ImageLoader = {};
+}
+
+/**
+ * A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints.
+ * @class YAHOO.util.ImageLoader.group
+ * @requires YAHOO.util.Dom
+ * @requires YAHOO.util.Event
+ * @constructor
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to. Can be null for no trigger
+ * @param {String}     trigAct The type of event to assign to trigEl. Can be null for no trigger
+ * @param {Number}     timeout Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit
+ */
+YAHOO.util.ImageLoader.group = function(trigEl, trigAct, timeout) {
+       /**
+        * Name for the group. Only used to identify the group in logging statements
+        * @property name
+        * @type String
+        */
+       this.name = 'unnamed';
+       
+       /**
+        * Collection of images registered with this group
+        * @property _imgObjs
+        * @private
+        * @type Object
+        */
+       this._imgObjs = {};
+       
+       /**
+        * Timeout (time limit) length, in seconds
+        * @property timeoutLen
+        * @type Number
+        */
+       this.timeoutLen = timeout;
+       
+       /**
+        * Timeout object to keep a handle on the time limit
+        * @property _timeout
+        * @private
+        * @type Object
+        */
+       this._timeout = null;
+       
+       /**
+        * Collection of triggers for this group.
+        * Keeps track of each trigger's element, event, and event-listener-callback "fetch" function
+        * @property _triggers
+        * @private
+        * @type Array
+        */
+       this._triggers = [];
+
+       /**
+        * Collection of custom-event triggers for this group.
+        * Keeps track of each trigger's event object and event-listener-callback "fetch" function
+        * @property _customTriggers
+        * @private
+        * @type Array
+        */
+       this._customTriggers = [];
+
+       /**
+        * Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately
+        * @property foldConditional
+        * @type Boolean
+        */
+       this.foldConditional = false;
+
+       /**
+        * Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images.
+        * This class should have, in its CSS style definition, "background:none !important;"
+        * @property className
+        * @type String
+        */
+       this.className = null;
+
+       /**
+        * HTML elements having the class name that is associated with this group
+        * Elements are stored during the _foldCheck function and reused later during the fetch function. Gives a slight performance improvement when className and foldConditional are both used
+        * @property _classImageEls
+        * @private
+        * @type Array
+        */
+       this._classImageEls = null;
+
+       // add a listener to set the time limit in the onload
+       YAHOO.util.Event.addListener(window, 'load', this._onloadTasks, this, true);
+       // add the trigger
+       this.addTrigger(trigEl, trigAct);
+
+};
+
+/**
+ * Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener
+ * @method addTrigger
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to
+ * @param {String} trigAct The type of event to assign to trigEl
+ */
+YAHOO.util.ImageLoader.group.prototype.addTrigger = function(trigEl, trigAct) {
+       if (! trigEl || ! trigAct) {
+               return;
+       }
+       /* Need to wrap the fetch function. Event Util can't distinguish prototyped functions of different instantiations
+        *   Leads to this scenario: groupA and groupZ both have window-scroll triggers. groupZ also has a 2-sec timeout (groupA has no timeout).
+        *   groupZ's timeout fires; we remove the triggers. The removeListener call finds the first window-scroll event with Y.u.IL.p.fetch, which is groupA's. 
+        *   groupA's trigger is removed and never fires, leaving images unfetched
+        */
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._triggers.push([trigEl, trigAct, wrappedFetch]);
+       YAHOO.util.Event.addListener(trigEl, trigAct, wrappedFetch, this, true);
+};
+
+/**
+ * Adds a custom event trigger to the group.
+ * @method addCustomTrigger
+ * @param {Object} event A YAHOO.util.CustomEvent object
+ */
+YAHOO.util.ImageLoader.group.prototype.addCustomTrigger = function(event) {
+       // make sure we're dealing with a CustomEvent object
+       if (! event || ! event instanceof YAHOO.util.CustomEvent) {
+               return;
+       }
+
+       // see comment in addTrigger()
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._customTriggers.push([event, wrappedFetch]);
+       event.subscribe(wrappedFetch, this, true);
+};
+
+/**
+ * Setup to do in the window's onload
+ * Initiates time limit for group; executes the fold check for the images
+ * @method _onloadTasks
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._onloadTasks = function() {
+       if (this.timeoutLen && typeof(this.timeoutLen) == 'number' && this.timeoutLen > 0) {
+               this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000);
+       }
+
+       if (this.foldConditional) {
+               this._foldCheck();
+       }
+};
+
+/**
+ * Returns the group's fetch method, with the proper closure, for use with setTimeout
+ * @method _getFetchTimeout
+ * @return {Function}  group's fetch method
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() {
+       var self = this;
+       return function() { self.fetch(); };
+};
+
+/**
+ * Registers a background image with the group
+ * @method registerBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    bgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers a src image with the group
+ * @method registerSrcImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ * @return {Object}    srcImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers an alpha-channel-type png background image with the group
+ * @method registerPngBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
+ *                    Valid properties are 'sizingMethod' and 'enabled'
+ * @return {Object}    pngBgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url, ailProps) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url, ailProps);
+       return this._imgObjs[domId];
+};
+
+/**
+ * Displays the images in the group
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.group.prototype.fetch = function() {
+       YAHOO.log('Fetching images in group: "' + this.name + '".', 'info', 'imageloader');
+
+       clearTimeout(this._timeout);
+       // remove all listeners
+       for (var i=0, len = this._triggers.length; i < len; i++) {
+               YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]);
+       }
+       // remove custom event subscriptions
+       for (var i=0, len = this._customTriggers.length; i < len; i++) {
+               this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1], this);
+       }
+
+       // fetch whatever we need to by className
+       this._fetchByClass();
+
+       // fetch registered images
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       this._imgObjs[id].fetch();
+               }
+       }
+};
+
+/**
+ * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately.
+ * @method _foldCheck
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._foldCheck = function() {
+       YAHOO.log('Checking for images above the fold in group: "' + this.name + '"', 'info', 'imageloader');
+       var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop;
+       var viewHeight = YAHOO.util.Dom.getViewportHeight();
+       var hLimit = scrollTop + viewHeight;
+       var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft;
+       var viewWidth = YAHOO.util.Dom.getViewportWidth();
+       var wLimit = scrollLeft + viewWidth;
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._imgObjs[id].domId + '" is above the fold. Fetching image.', 'info', 'imageloader');
+                               this._imgObjs[id].fetch();
+                       }
+               }
+       }
+       // and by class
+       if (this.className) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+               for (var i=0, len = this._classImageEls.length; i < len; i++) {
+                       var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._classImageEls[i].id + '" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)', 'info', 'imageloader');
+                               YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className);
+                       }
+               }
+       }
+};
+
+/**
+ * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching
+ * @method _fetchByClass
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() {
+       if (! this.className) {
+               return;
+       }
+
+       YAHOO.log('Fetching all images with class "' + this.className + '" in group "' + this.name + '".', 'info', 'imageloader');
+       // this._classImageEls may have been set during _foldCheck
+       if (this._classImageEls === null) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+       }
+       YAHOO.util.Dom.removeClass(this._classImageEls, this.className);
+};
+
+
+/**
+ * Base class for image objects to be registered with the groups
+ * @class YAHOO.util.ImageLoader.imgObj
+ * @constructor
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.imgObj = function(domId, url) {
+       /**
+        * HTML DOM id of the image element
+        * @property domId
+        * @type String
+        */
+       this.domId = domId;
+
+       /**
+        * URL for the image
+        * @property url
+        * @type String
+        */
+       this.url = url;
+
+       /**
+        * Pixel width of the image. Will be set as a "width" attribute after the image is fetched.
+        * Detaults to the natural width of the image.
+        * Only appropriate with src images
+        * @property width
+        * @type Int
+        */
+       this.width = null;
+
+       /**
+        * Pixel height of the image. Will be set as a "height" attribute after the image is fetched.
+        * Detaults to the natural height of the image.
+        * Only appropriate with src images
+        * @property height
+        * @type Int
+        */
+       this.height = null;
+
+       /**
+        * Whether the style.visibility should be set to "visible" after the image is fetched.
+        * Used when setting src images as visibility:hidden prior to image fetching
+        * @property setVisible
+        * @type Boolean
+        */
+       this.setVisible = false;
+
+       /**
+        * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice
+        * @property _fetched
+        * @type Boolean
+        * @private
+        */
+       this._fetched = false;
+};
+
+/**
+ * Displays the image; puts the URL into the DOM
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() {
+       if (this._fetched) {
+               return;
+       }
+       var el = document.getElementById(this.domId);
+       if (! el) {
+               return;
+       }
+       YAHOO.log('Fetching image with id "' + this.domId + '".', 'info', 'imageloader');
+       this._applyUrl(el);
+
+       if (this.setVisible) {
+               el.style.visibility = 'visible';
+       }
+       if (this.width) {
+               el.width = this.width;
+       }
+       if (this.height) {
+               el.height = this.height;
+       }
+       this._fetched = true;
+};
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Must be overridden by child class
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) {
+};
+
+/**
+ * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.bgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
+       el.style.backgroundImage = "url('" + this.url + "')";
+};
+
+/**
+ * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
+ * @class YAHOO.util.ImageLoader.srcImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ */
+YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
+       YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
+       this.width = width;
+       this.height = height;
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets src
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
+       el.src = this.url;
+};
+
+/**
+ * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.pngBgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
+ *                    Valid properties are 'sizingMethod' and 'enabled'
+ */
+YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) {
+       YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
+
+       /**
+        * AlphaImageLoader properties to be set for the image.
+        * Valid properties are "sizingMethod" and "enabled".
+        * @property props
+        * @type Object
+        */
+       this.props = ailProps || {};
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
+       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+               var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod;
+               var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled;
+               el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")';
+       }
+       else {
+               el.style.backgroundImage = "url('" + this.url + "')";
+       }
+};
+YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/imageloader/imageloader-min.js b/lib/yui/imageloader/imageloader-min.js
new file mode 100644 (file)
index 0000000..152c43f
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+if(typeof (YAHOO.util.ImageLoader)=="undefined"){YAHOO.util.ImageLoader={};}YAHOO.util.ImageLoader.group=function(A,B,C){this.name="unnamed";this._imgObjs={};this.timeoutLen=C;this._timeout=null;this._triggers=[];this._customTriggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;YAHOO.util.Event.addListener(window,"load",this._onloadTasks,this,true);this.addTrigger(A,B);};YAHOO.util.ImageLoader.group.prototype.addTrigger=function(B,C){if(!B||!C){return ;}var A=function(){this.fetch();};this._triggers.push([B,C,A]);YAHOO.util.Event.addListener(B,C,A,this,true);};YAHOO.util.ImageLoader.group.prototype.addCustomTrigger=function(B){if(!B||!B instanceof YAHOO.util.CustomEvent){return ;}var A=function(){this.fetch();};this._customTriggers.push([B,A]);B.subscribe(A,this,true);};YAHOO.util.ImageLoader.group.prototype._onloadTasks=function(){if(this.timeoutLen&&typeof (this.timeoutLen)=="number"&&this.timeoutLen>0){this._timeout=setTimeout(this._getFetchTimeout(),this.timeoutLen*1000);}if(this.foldConditional){this._foldCheck();}};YAHOO.util.ImageLoader.group.prototype._getFetchTimeout=function(){var A=this;return function(){A.fetch();};};YAHOO.util.ImageLoader.group.prototype.registerBgImage=function(B,A){this._imgObjs[B]=new YAHOO.util.ImageLoader.bgImgObj(B,A);return this._imgObjs[B];};YAHOO.util.ImageLoader.group.prototype.registerSrcImage=function(D,B,C,A){this._imgObjs[D]=new YAHOO.util.ImageLoader.srcImgObj(D,B,C,A);return this._imgObjs[D];};YAHOO.util.ImageLoader.group.prototype.registerPngBgImage=function(C,B,A){this._imgObjs[C]=new YAHOO.util.ImageLoader.pngBgImgObj(C,B,A);return this._imgObjs[C];};YAHOO.util.ImageLoader.group.prototype.fetch=function(){clearTimeout(this._timeout);for(var B=0,A=this._triggers.length;B<A;B++){YAHOO.util.Event.removeListener(this._triggers[B][0],this._triggers[B][1],this._triggers[B][2]);}for(var B=0,A=this._customTriggers.length;B<A;B++){this._customTriggers[B][0].unsubscribe(this._customTriggers[B][1],this);}this._fetchByClass();for(var C in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,C)){this._imgObjs[C].fetch();}}};YAHOO.util.ImageLoader.group.prototype._foldCheck=function(){var C=(document.compatMode!="CSS1Compat")?document.body.scrollTop:document.documentElement.scrollTop;var D=YAHOO.util.Dom.getViewportHeight();var A=C+D;var E=(document.compatMode!="CSS1Compat")?document.body.scrollLeft:document.documentElement.scrollLeft;var G=YAHOO.util.Dom.getViewportWidth();var I=E+G;for(var B in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,B)){var J=YAHOO.util.Dom.getXY(this._imgObjs[B].domId);if(J[1]<A&&J[0]<I){this._imgObjs[B].fetch();}}}if(this.className){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className);for(var F=0,H=this._classImageEls.length;F<H;F++){var J=YAHOO.util.Dom.getXY(this._classImageEls[F]);if(J[1]<A&&J[0]<I){YAHOO.util.Dom.removeClass(this._classImageEls[F],this.className);}}}};YAHOO.util.ImageLoader.group.prototype._fetchByClass=function(){if(!this.className){return ;}if(this._classImageEls===null){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className);}YAHOO.util.Dom.removeClass(this._classImageEls,this.className);};YAHOO.util.ImageLoader.imgObj=function(B,A){this.domId=B;this.url=A;this.width=null;this.height=null;this.setVisible=false;this._fetched=false;};YAHOO.util.ImageLoader.imgObj.prototype.fetch=function(){if(this._fetched){return ;}var A=document.getElementById(this.domId);if(!A){return ;}this._applyUrl(A);if(this.setVisible){A.style.visibility="visible";}if(this.width){A.width=this.width;}if(this.height){A.height=this.height;}this._fetched=true;};YAHOO.util.ImageLoader.imgObj.prototype._applyUrl=function(A){};YAHOO.util.ImageLoader.bgImgObj=function(B,A){YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this,B,A);};YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl=function(A){A.style.backgroundImage="url('"+this.url+"')";};YAHOO.util.ImageLoader.srcImgObj=function(D,B,C,A){YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this,D,B);this.width=C;this.height=A;};YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl=function(A){A.src=this.url;};YAHOO.util.ImageLoader.pngBgImgObj=function(C,B,A){YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this,C,B);this.props=A||{};};YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl=function(B){if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){var C=(YAHOO.lang.isUndefined(this.props.sizingMethod))?"scale":this.props.sizingMethod;var A=(YAHOO.lang.isUndefined(this.props.enabled))?"true":this.props.enabled;B.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.url+'", sizingMethod="'+C+'", enabled="'+A+'")';}else{B.style.backgroundImage="url('"+this.url+"')";}};YAHOO.register("imageloader",YAHOO.util.ImageLoader,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/imageloader/imageloader.js b/lib/yui/imageloader/imageloader.js
new file mode 100644 (file)
index 0000000..df0ede7
--- /dev/null
@@ -0,0 +1,481 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The image loader is a framework to dynamically load images
+ * according to certain triggers, enabling faster load times
+ * and a more responsive UI.
+ *
+ * @module imageloader
+ * @namespace YAHOO.util
+ */
+
+if (typeof(YAHOO.util.ImageLoader) == 'undefined') {
+       YAHOO.util.ImageLoader = {};
+}
+
+/**
+ * A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints.
+ * @class YAHOO.util.ImageLoader.group
+ * @requires YAHOO.util.Dom
+ * @requires YAHOO.util.Event
+ * @constructor
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to. Can be null for no trigger
+ * @param {String}     trigAct The type of event to assign to trigEl. Can be null for no trigger
+ * @param {Number}     timeout Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit
+ */
+YAHOO.util.ImageLoader.group = function(trigEl, trigAct, timeout) {
+       /**
+        * Name for the group. Only used to identify the group in logging statements
+        * @property name
+        * @type String
+        */
+       this.name = 'unnamed';
+       
+       /**
+        * Collection of images registered with this group
+        * @property _imgObjs
+        * @private
+        * @type Object
+        */
+       this._imgObjs = {};
+       
+       /**
+        * Timeout (time limit) length, in seconds
+        * @property timeoutLen
+        * @type Number
+        */
+       this.timeoutLen = timeout;
+       
+       /**
+        * Timeout object to keep a handle on the time limit
+        * @property _timeout
+        * @private
+        * @type Object
+        */
+       this._timeout = null;
+       
+       /**
+        * Collection of triggers for this group.
+        * Keeps track of each trigger's element, event, and event-listener-callback "fetch" function
+        * @property _triggers
+        * @private
+        * @type Array
+        */
+       this._triggers = [];
+
+       /**
+        * Collection of custom-event triggers for this group.
+        * Keeps track of each trigger's event object and event-listener-callback "fetch" function
+        * @property _customTriggers
+        * @private
+        * @type Array
+        */
+       this._customTriggers = [];
+
+       /**
+        * Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately
+        * @property foldConditional
+        * @type Boolean
+        */
+       this.foldConditional = false;
+
+       /**
+        * Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images.
+        * This class should have, in its CSS style definition, "background:none !important;"
+        * @property className
+        * @type String
+        */
+       this.className = null;
+
+       /**
+        * HTML elements having the class name that is associated with this group
+        * Elements are stored during the _foldCheck function and reused later during the fetch function. Gives a slight performance improvement when className and foldConditional are both used
+        * @property _classImageEls
+        * @private
+        * @type Array
+        */
+       this._classImageEls = null;
+
+       // add a listener to set the time limit in the onload
+       YAHOO.util.Event.addListener(window, 'load', this._onloadTasks, this, true);
+       // add the trigger
+       this.addTrigger(trigEl, trigAct);
+
+};
+
+/**
+ * Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener
+ * @method addTrigger
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to
+ * @param {String} trigAct The type of event to assign to trigEl
+ */
+YAHOO.util.ImageLoader.group.prototype.addTrigger = function(trigEl, trigAct) {
+       if (! trigEl || ! trigAct) {
+               return;
+       }
+       /* Need to wrap the fetch function. Event Util can't distinguish prototyped functions of different instantiations
+        *   Leads to this scenario: groupA and groupZ both have window-scroll triggers. groupZ also has a 2-sec timeout (groupA has no timeout).
+        *   groupZ's timeout fires; we remove the triggers. The removeListener call finds the first window-scroll event with Y.u.IL.p.fetch, which is groupA's. 
+        *   groupA's trigger is removed and never fires, leaving images unfetched
+        */
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._triggers.push([trigEl, trigAct, wrappedFetch]);
+       YAHOO.util.Event.addListener(trigEl, trigAct, wrappedFetch, this, true);
+};
+
+/**
+ * Adds a custom event trigger to the group.
+ * @method addCustomTrigger
+ * @param {Object} event A YAHOO.util.CustomEvent object
+ */
+YAHOO.util.ImageLoader.group.prototype.addCustomTrigger = function(event) {
+       // make sure we're dealing with a CustomEvent object
+       if (! event || ! event instanceof YAHOO.util.CustomEvent) {
+               return;
+       }
+
+       // see comment in addTrigger()
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._customTriggers.push([event, wrappedFetch]);
+       event.subscribe(wrappedFetch, this, true);
+};
+
+/**
+ * Setup to do in the window's onload
+ * Initiates time limit for group; executes the fold check for the images
+ * @method _onloadTasks
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._onloadTasks = function() {
+       if (this.timeoutLen && typeof(this.timeoutLen) == 'number' && this.timeoutLen > 0) {
+               this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000);
+       }
+
+       if (this.foldConditional) {
+               this._foldCheck();
+       }
+};
+
+/**
+ * Returns the group's fetch method, with the proper closure, for use with setTimeout
+ * @method _getFetchTimeout
+ * @return {Function}  group's fetch method
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() {
+       var self = this;
+       return function() { self.fetch(); };
+};
+
+/**
+ * Registers a background image with the group
+ * @method registerBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    bgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers a src image with the group
+ * @method registerSrcImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ * @return {Object}    srcImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers an alpha-channel-type png background image with the group
+ * @method registerPngBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
+ *                    Valid properties are 'sizingMethod' and 'enabled'
+ * @return {Object}    pngBgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url, ailProps) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url, ailProps);
+       return this._imgObjs[domId];
+};
+
+/**
+ * Displays the images in the group
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.group.prototype.fetch = function() {
+
+       clearTimeout(this._timeout);
+       // remove all listeners
+       for (var i=0, len = this._triggers.length; i < len; i++) {
+               YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]);
+       }
+       // remove custom event subscriptions
+       for (var i=0, len = this._customTriggers.length; i < len; i++) {
+               this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1], this);
+       }
+
+       // fetch whatever we need to by className
+       this._fetchByClass();
+
+       // fetch registered images
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       this._imgObjs[id].fetch();
+               }
+       }
+};
+
+/**
+ * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately.
+ * @method _foldCheck
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._foldCheck = function() {
+       var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop;
+       var viewHeight = YAHOO.util.Dom.getViewportHeight();
+       var hLimit = scrollTop + viewHeight;
+       var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft;
+       var viewWidth = YAHOO.util.Dom.getViewportWidth();
+       var wLimit = scrollLeft + viewWidth;
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               this._imgObjs[id].fetch();
+                       }
+               }
+       }
+       // and by class
+       if (this.className) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+               for (var i=0, len = this._classImageEls.length; i < len; i++) {
+                       var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className);
+                       }
+               }
+       }
+};
+
+/**
+ * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching
+ * @method _fetchByClass
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() {
+       if (! this.className) {
+               return;
+       }
+
+       // this._classImageEls may have been set during _foldCheck
+       if (this._classImageEls === null) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+       }
+       YAHOO.util.Dom.removeClass(this._classImageEls, this.className);
+};
+
+
+/**
+ * Base class for image objects to be registered with the groups
+ * @class YAHOO.util.ImageLoader.imgObj
+ * @constructor
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.imgObj = function(domId, url) {
+       /**
+        * HTML DOM id of the image element
+        * @property domId
+        * @type String
+        */
+       this.domId = domId;
+
+       /**
+        * URL for the image
+        * @property url
+        * @type String
+        */
+       this.url = url;
+
+       /**
+        * Pixel width of the image. Will be set as a "width" attribute after the image is fetched.
+        * Detaults to the natural width of the image.
+        * Only appropriate with src images
+        * @property width
+        * @type Int
+        */
+       this.width = null;
+
+       /**
+        * Pixel height of the image. Will be set as a "height" attribute after the image is fetched.
+        * Detaults to the natural height of the image.
+        * Only appropriate with src images
+        * @property height
+        * @type Int
+        */
+       this.height = null;
+
+       /**
+        * Whether the style.visibility should be set to "visible" after the image is fetched.
+        * Used when setting src images as visibility:hidden prior to image fetching
+        * @property setVisible
+        * @type Boolean
+        */
+       this.setVisible = false;
+
+       /**
+        * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice
+        * @property _fetched
+        * @type Boolean
+        * @private
+        */
+       this._fetched = false;
+};
+
+/**
+ * Displays the image; puts the URL into the DOM
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() {
+       if (this._fetched) {
+               return;
+       }
+       var el = document.getElementById(this.domId);
+       if (! el) {
+               return;
+       }
+       this._applyUrl(el);
+
+       if (this.setVisible) {
+               el.style.visibility = 'visible';
+       }
+       if (this.width) {
+               el.width = this.width;
+       }
+       if (this.height) {
+               el.height = this.height;
+       }
+       this._fetched = true;
+};
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Must be overridden by child class
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) {
+};
+
+/**
+ * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.bgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
+       el.style.backgroundImage = "url('" + this.url + "')";
+};
+
+/**
+ * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
+ * @class YAHOO.util.ImageLoader.srcImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ */
+YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
+       YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
+       this.width = width;
+       this.height = height;
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets src
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
+       el.src = this.url;
+};
+
+/**
+ * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.pngBgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
+ *                    Valid properties are 'sizingMethod' and 'enabled'
+ */
+YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) {
+       YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
+
+       /**
+        * AlphaImageLoader properties to be set for the image.
+        * Valid properties are "sizingMethod" and "enabled".
+        * @property props
+        * @type Object
+        */
+       this.props = ailProps || {};
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
+       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+               var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod;
+               var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled;
+               el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")';
+       }
+       else {
+               el.style.backgroundImage = "url('" + this.url + "')";
+       }
+};
+YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/json/README b/lib/yui/json/README
new file mode 100644 (file)
index 0000000..a5dd3c2
--- /dev/null
@@ -0,0 +1,11 @@
+JSON Utility - Release Notes
+
+2.5.0
+    * Restructured for customization and readability
+    * Extracted isValid method to test a JSON string
+    * Extracted dateToString method to allow overriding with custom serialization format
+    * Added stringToDate method to reconstitute Date instances from default JSON UTC date strings.  Use this in a filter method passed to lang.JSON.parse
+    * fixed walk method so filters are properly applied
+
+2.4.0
+    * Initial release
diff --git a/lib/yui/json/json-debug.js b/lib/yui/json/json-debug.js
new file mode 100644 (file)
index 0000000..0daf6f1
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace('lang');
+
+/**
+ * Provides methods to parse JSON strings and convert objects to JSON strings.
+ * @module json
+ * @requires yahoo
+ * @class YAHOO.lang.JSON
+ * @static
+ */
+YAHOO.lang.JSON = {
+    /**
+     * First step in the validation.  Regex used to replace all escape
+     * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character).
+     * @property RE_REPLACE_ESCAPES
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _ESCAPES : /\\./g,
+    /**
+     * Second step in the validation.  Regex used to replace all simple
+     * values with ']' characters.
+     * @property RE_REPLACE_VALUES
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _VALUES  : /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+    /**
+     * Third step in the validation.  Regex used to remove all open square
+     * brackets following a colon, comma, or at the beginning of the string.
+     * @property RE_REPLACE_BRACKETS
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _BRACKETS : /(?:^|:|,)(?:\s*\[)+/g,
+    /**
+     * Final step in the validation.  Regex used to test the string left after
+     * all previous replacements for invalid characters.
+     * @property RE_INVALID
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _INVALID  : /^[\],:{}\s]*$/,
+
+    /**
+     * Regex used to replace special characters in strings for JSON
+     * stringification.
+     * @property _SPECIAL_CHARS
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _SPECIAL_CHARS : /["\\\x00-\x1f]/g,
+
+    /**
+     * Regex used to reconstitute serialized Dates.
+     * @property _PARSE_DATE
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _PARSE_DATE : /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,
+
+    /**
+     * Character substitution map for common escapes and special characters.
+     * @property _CHARS
+     * @type {Object}
+     * @static
+     * @private
+     */
+    _CHARS : {
+        '\b': '\\b',
+        '\t': '\\t',
+        '\n': '\\n',
+        '\f': '\\f',
+        '\r': '\\r',
+        '"' : '\\"',
+        '\\': '\\\\'
+    },
+
+    /**
+     * Traverses nested objects, applying a filter or mutation function to
+     * each value.  The value returned from the function will replace the
+     * original value in the key:value pair.  If the value returned is
+     * undefined, the key will be omitted from the returned object.
+     * @method _applyFilter
+     * @param data {MIXED} Any JavaScript data
+     * @param filter {Function} filter or mutation function
+     * @return {MIXED} The results of the filtered data
+     * @static
+     * @private
+     */
+    _applyFilter : function (data, filter) {
+        var walk = function (k,v) {
+            var i, n;
+            if (v && typeof v === 'object') {
+                for (i in v) {
+                    if (YAHOO.lang.hasOwnProperty(v,i)) {
+                        n = walk(i, v[i]);
+                        if (n === undefined) {
+                            delete v[i];
+                        } else {
+                            v[i] = n;
+                        }
+                    }
+                }
+            }
+            return filter(k, v);
+        };
+
+        if (YAHOO.lang.isFunction(filter)) {
+            walk('',data);
+        }
+
+        return data;
+    },
+
+    /**
+     * Four step determination whether a string is valid JSON.  In three steps,
+     * escape sequences, safe values, and properly placed open square brackets
+     * are replaced with placeholders or removed.  Then in the final step, the
+     * result of all these replacements is checked for invalid characters.
+     * @method isValid
+     * @param str {String} JSON string to be tested
+     * @return {boolean} is the string safe for eval?
+     * @static
+     */
+    isValid : function (str) {
+        if (!YAHOO.lang.isString(str)) {
+            return false;
+        }
+
+        return this._INVALID.test(str.
+                replace(this._ESCAPES,'@').
+                replace(this._VALUES,']').
+                replace(this._BRACKETS,''));
+    },
+
+    /**
+     * Serializes a Date instance as a UTC date string.  Used internally by
+     * stringify.  Override this method if you need Dates serialized in a
+     * different format.
+     * @method dateToString
+     * @param d {Date} The Date to serialize
+     * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ
+     * @static
+     */
+    dateToString : function (d) {
+        function _zeroPad(v) {
+            return v < 10 ? '0' + v : v;
+        }
+
+        return '"' + d.getUTCFullYear()   + '-' +
+            _zeroPad(d.getUTCMonth() + 1) + '-' +
+            _zeroPad(d.getUTCDate())      + 'T' +
+            _zeroPad(d.getUTCHours())     + ':' +
+            _zeroPad(d.getUTCMinutes())   + ':' +
+            _zeroPad(d.getUTCSeconds())   + 'Z"';
+    },
+
+    /**
+     * Reconstitute Date instances from the default JSON UTC serialization.
+     * Reference this from a parse filter function to rebuild Dates during the
+     * parse operation.
+     * @method stringToDate
+     * @param str {String} String serialization of a Date
+     * @return {Date}
+     */
+    stringToDate : function (str) {
+        if (this._PARSE_DATE.test(str)) {
+            var d = new Date();
+            d.setUTCFullYear(RegExp.$1, (RegExp.$2|0)-1, RegExp.$3);
+            d.setUTCHours(RegExp.$4, RegExp.$5, RegExp.$6);
+            return d;
+        }
+    },
+
+    /**
+     * Parse a JSON string, returning the native JavaScript representation.
+     * Only minor modifications from http://www.json.org/json.js.
+     * @param s {string} JSON string data
+     * @param filter {function} (optional) function(k,v) passed each key value pair of object literals, allowing pruning or altering values
+     * @return {MIXED} the native JavaScript representation of the JSON string
+     * @throws SyntaxError
+     * @method parse
+     * @static
+     * @public
+     */
+    parse : function (s,filter) {
+        // Ensure valid JSON
+        if (this.isValid(s)) {
+            // Eval the text into a JavaScript data structure, apply any
+            // filter function, and return
+            return this._applyFilter( eval('(' + s + ')'), filter );
+        }
+
+        // The text is not JSON parsable
+        throw new SyntaxError('parseJSON');
+    },
+
+
+    /**
+     * Converts an arbitrary value to a JSON string representation.
+     * Cyclical object or array references are replaced with null.
+     * If a whitelist is provided, only matching object keys will be included.
+     * If a depth limit is provided, objects and arrays at that depth will
+     * be stringified as empty.
+     * @method stringify
+     * @param o {MIXED} any arbitrary object to convert to JSON string
+     * @param w {Array} (optional) whitelist of acceptable object keys to include
+     * @param d {number} (optional) depth limit to recurse objects/arrays (practical minimum 1)
+     * @return {string} JSON string representation of the input
+     * @static
+     * @public
+     */
+    stringify : function (o,w,d) {
+
+        var l      = YAHOO.lang,
+            J      = l.JSON,
+            m      = J._CHARS,
+            str_re = this._SPECIAL_CHARS,
+            pstack = []; // Processing stack used for cyclical ref protection
+
+        // escape encode special characters
+        var _char = function (c) {
+            if (!m[c]) {
+                var a = c.charCodeAt();
+                m[c] = '\\u00' + Math.floor(a / 16).toString(16) +
+                                           (a % 16).toString(16);
+            }
+            return m[c];
+        };
+
+        // Enclose the escaped string in double quotes
+        var _string = function (s) {
+            return '"' + s.replace(str_re, _char) + '"';
+        };
+
+        // Use the configured date conversion
+        var _date = this.dateToString;
+    
+        // Worker function.  Fork behavior on data type and recurse objects and
+        // arrays per the configured depth.
+        var _stringify = function (o,w,d) {
+            var t = typeof o,
+                i,len,j, // array iteration
+                k,v,     // object iteration
+                vt,      // typeof v during iteration
+                a;       // composition array for performance over string concat
+
+            // String
+            if (t === 'string') {
+                return _string(o);
+            }
+
+            // native boolean and Boolean instance
+            if (t === 'boolean' || o instanceof Boolean) {
+                return String(o);
+            }
+
+            // native number and Number instance
+            if (t === 'number' || o instanceof Number) {
+                return isFinite(o) ? String(o) : 'null';
+            }
+
+            // Date
+            if (o instanceof Date) {
+                return _date(o);
+            }
+
+            // Array
+            if (l.isArray(o)) {
+                // Check for cyclical references
+                for (i = pstack.length - 1; i >= 0; --i) {
+                    if (pstack[i] === o) {
+                        return 'null';
+                    }
+                }
+
+                // Add the array to the processing stack
+                pstack[pstack.length] = o;
+
+                a = [];
+                // Only recurse if we're above depth config
+                if (d > 0) {
+                    for (i = o.length - 1; i >= 0; --i) {
+                        a[i] = _stringify(o[i],w,d-1);
+                    }
+                }
+
+                // remove the array from the stack
+                pstack.pop();
+
+                return '[' + a.join(',') + ']';
+            }
+
+            // Object
+            if (t === 'object' && o) {
+                // Check for cyclical references
+                for (i = pstack.length - 1; i >= 0; --i) {
+                    if (pstack[i] === o) {
+                        return 'null';
+                    }
+                }
+
+                // Add the object to the  processing stack
+                pstack[pstack.length] = o;
+
+                a = [];
+                // Only recurse if we're above depth config
+                if (d > 0) {
+
+                    // If whitelist provided, take only those keys
+                    if (w) {
+                        for (i = 0, j = 0, len = w.length; i < len; ++i) {
+                            v = o[w[i]];
+                            vt = typeof v;
+
+                            // Omit invalid values
+                            if (vt !== 'undefined' && vt !== 'function') {
+                                a[j++] = _string(w[i]) + ':' + _stringify(v,w,d-1);
+                            }
+                        }
+
+                    // Otherwise, take all valid object properties
+                    // omitting the prototype chain properties
+                    } else {
+                        j = 0;
+                        for (k in o) {
+                            if (typeof k === 'string' && l.hasOwnProperty(o,k)) {
+                                v = o[k];
+                                vt = typeof v;
+                                if (vt !== 'undefined' && vt !== 'function') {
+                                    a[j++] = _string(k) + ':' + _stringify(v,w,d-1);
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // Remove the object from processing stack
+                pstack.pop();
+
+                return '{' + a.join(',') + '}';
+            }
+
+            return 'null';
+        };
+
+        // process the input
+        d = d >= 0 ? d : 1/0;  // Default depth to POSITIVE_INFINITY
+        return _stringify(o,w,d);
+    }
+};
+YAHOO.register("json", YAHOO.lang.JSON, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/json/json-min.js b/lib/yui/json/json-min.js
new file mode 100644 (file)
index 0000000..4b6f9f6
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\./g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=this.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1);}}B.pop();return"["+S.join(",")+"]";}if(W==="object"&&J){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P<Q;++P){U=J[T[P]];V=typeof U;if(V!=="undefined"&&V!=="function"){S[O++]=M(T[P])+":"+G(U,T,R-1);}}}else{O=0;for(N in J){if(typeof N==="string"&&E.hasOwnProperty(J,N)){U=J[N];V=typeof U;if(V!=="undefined"&&V!=="function"){S[O++]=M(N)+":"+G(U,T,R-1);}}}}}B.pop();return"{"+S.join(",")+"}";}return"null";};F=F>=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/json/json.js b/lib/yui/json/json.js
new file mode 100644 (file)
index 0000000..0daf6f1
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace('lang');
+
+/**
+ * Provides methods to parse JSON strings and convert objects to JSON strings.
+ * @module json
+ * @requires yahoo
+ * @class YAHOO.lang.JSON
+ * @static
+ */
+YAHOO.lang.JSON = {
+    /**
+     * First step in the validation.  Regex used to replace all escape
+     * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character).
+     * @property RE_REPLACE_ESCAPES
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _ESCAPES : /\\./g,
+    /**
+     * Second step in the validation.  Regex used to replace all simple
+     * values with ']' characters.
+     * @property RE_REPLACE_VALUES
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _VALUES  : /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+    /**
+     * Third step in the validation.  Regex used to remove all open square
+     * brackets following a colon, comma, or at the beginning of the string.
+     * @property RE_REPLACE_BRACKETS
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _BRACKETS : /(?:^|:|,)(?:\s*\[)+/g,
+    /**
+     * Final step in the validation.  Regex used to test the string left after
+     * all previous replacements for invalid characters.
+     * @property RE_INVALID
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _INVALID  : /^[\],:{}\s]*$/,
+
+    /**
+     * Regex used to replace special characters in strings for JSON
+     * stringification.
+     * @property _SPECIAL_CHARS
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _SPECIAL_CHARS : /["\\\x00-\x1f]/g,
+
+    /**
+     * Regex used to reconstitute serialized Dates.
+     * @property _PARSE_DATE
+     * @type {RegExp}
+     * @static
+     * @private
+     */
+    _PARSE_DATE : /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,
+
+    /**
+     * Character substitution map for common escapes and special characters.
+     * @property _CHARS
+     * @type {Object}
+     * @static
+     * @private
+     */
+    _CHARS : {
+        '\b': '\\b',
+        '\t': '\\t',
+        '\n': '\\n',
+        '\f': '\\f',
+        '\r': '\\r',
+        '"' : '\\"',
+        '\\': '\\\\'
+    },
+
+    /**
+     * Traverses nested objects, applying a filter or mutation function to
+     * each value.  The value returned from the function will replace the
+     * original value in the key:value pair.  If the value returned is
+     * undefined, the key will be omitted from the returned object.
+     * @method _applyFilter
+     * @param data {MIXED} Any JavaScript data
+     * @param filter {Function} filter or mutation function
+     * @return {MIXED} The results of the filtered data
+     * @static
+     * @private
+     */
+    _applyFilter : function (data, filter) {
+        var walk = function (k,v) {
+            var i, n;
+            if (v && typeof v === 'object') {
+                for (i in v) {
+                    if (YAHOO.lang.hasOwnProperty(v,i)) {
+                        n = walk(i, v[i]);
+                        if (n === undefined) {
+                            delete v[i];
+                        } else {
+                            v[i] = n;
+                        }
+                    }
+                }
+            }
+            return filter(k, v);
+        };
+
+        if (YAHOO.lang.isFunction(filter)) {
+            walk('',data);
+        }
+
+        return data;
+    },
+
+    /**
+     * Four step determination whether a string is valid JSON.  In three steps,
+     * escape sequences, safe values, and properly placed open square brackets
+     * are replaced with placeholders or removed.  Then in the final step, the
+     * result of all these replacements is checked for invalid characters.
+     * @method isValid
+     * @param str {String} JSON string to be tested
+     * @return {boolean} is the string safe for eval?
+     * @static
+     */
+    isValid : function (str) {
+        if (!YAHOO.lang.isString(str)) {
+            return false;
+        }
+
+        return this._INVALID.test(str.
+                replace(this._ESCAPES,'@').
+                replace(this._VALUES,']').
+                replace(this._BRACKETS,''));
+    },
+
+    /**
+     * Serializes a Date instance as a UTC date string.  Used internally by
+     * stringify.  Override this method if you need Dates serialized in a
+     * different format.
+     * @method dateToString
+     * @param d {Date} The Date to serialize
+     * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ
+     * @static
+     */
+    dateToString : function (d) {
+        function _zeroPad(v) {
+            return v < 10 ? '0' + v : v;
+        }
+
+        return '"' + d.getUTCFullYear()   + '-' +
+            _zeroPad(d.getUTCMonth() + 1) + '-' +
+            _zeroPad(d.getUTCDate())      + 'T' +
+            _zeroPad(d.getUTCHours())     + ':' +
+            _zeroPad(d.getUTCMinutes())   + ':' +
+            _zeroPad(d.getUTCSeconds())   + 'Z"';
+    },
+
+    /**
+     * Reconstitute Date instances from the default JSON UTC serialization.
+     * Reference this from a parse filter function to rebuild Dates during the
+     * parse operation.
+     * @method stringToDate
+     * @param str {String} String serialization of a Date
+     * @return {Date}
+     */
+    stringToDate : function (str) {
+        if (this._PARSE_DATE.test(str)) {
+            var d = new Date();
+            d.setUTCFullYear(RegExp.$1, (RegExp.$2|0)-1, RegExp.$3);
+            d.setUTCHours(RegExp.$4, RegExp.$5, RegExp.$6);
+            return d;
+        }
+    },
+
+    /**
+     * Parse a JSON string, returning the native JavaScript representation.
+     * Only minor modifications from http://www.json.org/json.js.
+     * @param s {string} JSON string data
+     * @param filter {function} (optional) function(k,v) passed each key value pair of object literals, allowing pruning or altering values
+     * @return {MIXED} the native JavaScript representation of the JSON string
+     * @throws SyntaxError
+     * @method parse
+     * @static
+     * @public
+     */
+    parse : function (s,filter) {
+        // Ensure valid JSON
+        if (this.isValid(s)) {
+            // Eval the text into a JavaScript data structure, apply any
+            // filter function, and return
+            return this._applyFilter( eval('(' + s + ')'), filter );
+        }
+
+        // The text is not JSON parsable
+        throw new SyntaxError('parseJSON');
+    },
+
+
+    /**
+     * Converts an arbitrary value to a JSON string representation.
+     * Cyclical object or array references are replaced with null.
+     * If a whitelist is provided, only matching object keys will be included.
+     * If a depth limit is provided, objects and arrays at that depth will
+     * be stringified as empty.
+     * @method stringify
+     * @param o {MIXED} any arbitrary object to convert to JSON string
+     * @param w {Array} (optional) whitelist of acceptable object keys to include
+     * @param d {number} (optional) depth limit to recurse objects/arrays (practical minimum 1)
+     * @return {string} JSON string representation of the input
+     * @static
+     * @public
+     */
+    stringify : function (o,w,d) {
+
+        var l      = YAHOO.lang,
+            J      = l.JSON,
+            m      = J._CHARS,
+            str_re = this._SPECIAL_CHARS,
+            pstack = []; // Processing stack used for cyclical ref protection
+
+        // escape encode special characters
+        var _char = function (c) {
+            if (!m[c]) {
+                var a = c.charCodeAt();
+                m[c] = '\\u00' + Math.floor(a / 16).toString(16) +
+                                           (a % 16).toString(16);
+            }
+            return m[c];
+        };
+
+        // Enclose the escaped string in double quotes
+        var _string = function (s) {
+            return '"' + s.replace(str_re, _char) + '"';
+        };
+
+        // Use the configured date conversion
+        var _date = this.dateToString;
+    
+        // Worker function.  Fork behavior on data type and recurse objects and
+        // arrays per the configured depth.
+        var _stringify = function (o,w,d) {
+            var t = typeof o,
+                i,len,j, // array iteration
+                k,v,     // object iteration
+                vt,      // typeof v during iteration
+                a;       // composition array for performance over string concat
+
+            // String
+            if (t === 'string') {
+                return _string(o);
+            }
+
+            // native boolean and Boolean instance
+            if (t === 'boolean' || o instanceof Boolean) {
+                return String(o);
+            }
+
+            // native number and Number instance
+            if (t === 'number' || o instanceof Number) {
+                return isFinite(o) ? String(o) : 'null';
+            }
+
+            // Date
+            if (o instanceof Date) {
+                return _date(o);
+            }
+
+            // Array
+            if (l.isArray(o)) {
+                // Check for cyclical references
+                for (i = pstack.length - 1; i >= 0; --i) {
+                    if (pstack[i] === o) {
+                        return 'null';
+                    }
+                }
+
+                // Add the array to the processing stack
+                pstack[pstack.length] = o;
+
+                a = [];
+                // Only recurse if we're above depth config
+                if (d > 0) {
+                    for (i = o.length - 1; i >= 0; --i) {
+                        a[i] = _stringify(o[i],w,d-1);
+                    }
+                }
+
+                // remove the array from the stack
+                pstack.pop();
+
+                return '[' + a.join(',') + ']';
+            }
+
+            // Object
+            if (t === 'object' && o) {
+                // Check for cyclical references
+                for (i = pstack.length - 1; i >= 0; --i) {
+                    if (pstack[i] === o) {
+                        return 'null';
+                    }
+                }
+
+                // Add the object to the  processing stack
+                pstack[pstack.length] = o;
+
+                a = [];
+                // Only recurse if we're above depth config
+                if (d > 0) {
+
+                    // If whitelist provided, take only those keys
+                    if (w) {
+                        for (i = 0, j = 0, len = w.length; i < len; ++i) {
+                            v = o[w[i]];
+                            vt = typeof v;
+
+                            // Omit invalid values
+                            if (vt !== 'undefined' && vt !== 'function') {
+                                a[j++] = _string(w[i]) + ':' + _stringify(v,w,d-1);
+                            }
+                        }
+
+                    // Otherwise, take all valid object properties
+                    // omitting the prototype chain properties
+                    } else {
+                        j = 0;
+                        for (k in o) {
+                            if (typeof k === 'string' && l.hasOwnProperty(o,k)) {
+                                v = o[k];
+                                vt = typeof v;
+                                if (vt !== 'undefined' && vt !== 'function') {
+                                    a[j++] = _string(k) + ':' + _stringify(v,w,d-1);
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // Remove the object from processing stack
+                pstack.pop();
+
+                return '{' + a.join(',') + '}';
+            }
+
+            return 'null';
+        };
+
+        // process the input
+        d = d >= 0 ? d : 1/0;  // Default depth to POSITIVE_INFINITY
+        return _stringify(o,w,d);
+    }
+};
+YAHOO.register("json", YAHOO.lang.JSON, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/layout/README b/lib/yui/layout/README
new file mode 100644 (file)
index 0000000..84e27d4
--- /dev/null
@@ -0,0 +1,3 @@
+**** version 2.5.0 ***
+
+Initial Release
diff --git a/lib/yui/layout/assets/layout-core.css b/lib/yui/layout/assets/layout-core.css
new file mode 100644 (file)
index 0000000..72b8eea
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-layout-loading {
+    visibility: hidden;
+}
+
+body.yui-layout {
+    overflow: hidden;
+    position: relative;
+    padding: 0;
+    margin: 0;
+}
+
+.yui-layout-doc {
+    position: relative;
+}
+
+.yui-layout-unit {
+    height: 50px;
+    width: 50px;
+    padding: 0;
+    margin: 0;
+    float: none;
+    z-index: 0;
+    overflow: hidden;
+}
+
+.yui-layout-unit-top {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+}
+
+.yui-layout-unit-left {
+    position: absolute;
+    top: 0;
+    left: 0;
+}
+
+.yui-layout-unit-right {
+    position: absolute;
+    top: 0;
+    right: 0;
+}
+
+.yui-layout-unit-bottom {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+}
+
+.yui-layout-unit-center {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+}
+
+.yui-layout div.yui-layout-hd {
+    position: absolute;
+    top: 0;
+    left: 0;
+    zoom: 1;
+    width: 100%;
+    overflow: hidden;
+}
+.yui-layout div.yui-layout-bd {
+    position: absolute;
+    top: 0;
+    left: 0;
+    zoom: 1;
+    width: 100%;
+    overflow: hidden;
+}
+.yui-layout .yui-layout-scroll div.yui-layout-bd {
+    overflow: auto;
+}
+.yui-layout div.yui-layout-ft {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    zoom: 1;
+    overflow: hidden;
+}
+
+.yui-layout .yui-layout-unit div.yui-layout-hd h2 {
+    text-align: left;
+}
+
+.yui-layout .yui-layout-unit div.yui-layout-hd .collapse {
+    cursor: pointer;
+    height: 13px;
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 17px;
+    font-size: 0;
+}
+
+.yui-layout .yui-layout-unit div.yui-layout-hd .close {
+    cursor: pointer;
+    height: 13px;
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 17px;
+    font-size: 0;
+}
+.yui-layout .yui-layout-unit div.yui-layout-hd .collapse-close {
+    right: 25px;
+}
+
+
+.yui-layout .yui-layout-clip {
+    position: absolute;
+    height: 20px;
+    background-color: #c0c0c0;
+    display: none;
+}
+
+.yui-layout .yui-layout-clip .collapse {
+    cursor: pointer;
+    height: 13px;
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 17px;
+    font-size: 0px;
+}
+
+.yui-layout .yui-layout-wrap {
+    height: 100%;
+    width: 100%;
+    position: absolute;
+    left: 0;
+}
+
+.yui-layout .yui-layout-unit .yui-content {
+    overflow: hidden;
+}
+.yui-layout .yui-layout-unit .yui-layout-scroll {
+    overflow: auto;
+}
diff --git a/lib/yui/layout/assets/skins/sam/layout-skin.css b/lib/yui/layout/assets/skins/sam/layout-skin.css
new file mode 100644 (file)
index 0000000..44be390
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/* Remove the dotted border on the resize proxy */
+.yui-skin-sam .yui-layout .yui-resize-proxy {
+    border: none;
+    font-size: 0;
+    margin: 0;
+    padding: 0;
+}
+/* During resize, hide the handles */
+.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle {
+    opacity: 0;
+    filter: alpha(opacity=0);
+}
+/* Style the div inside the resize proxy */
+.yui-skin-sam .yui-layout .yui-resize-proxy div {
+    position: absolute;
+    border: 1px solid #808080;
+    background-color: #EDF5FF;
+}
+/* Set the color of the Active resize handle */
+.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active {
+    background-color: #EDF5FF;
+}
+/* Styles for the left handle */
+.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l {
+    width: 5px;
+    height: 100%;
+    top: 0;
+    left: 0;
+}
+/* Styles for the right handle */
+.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r {
+    width: 5px;
+    top: 0;
+    right: 0;
+    height: 100%;
+}
+/* Styles for the bottom handle */
+.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b {
+    width: 100%;
+    bottom: 0;
+    left: 0;
+    height: 5px;
+}
+/* Styles for the top handle */
+.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t {
+    width: 100%;
+    top: 0;
+    left: 0;
+    height: 5px;
+}
+
+/* Left Collapse button */
+.yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -160px;
+    border: 1px solid #808080;
+}
+/* Left Collapsed Expand Button */
+.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -140px;
+    border: 1px solid #808080;
+}
+/* Right Collapse Button */
+.yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -200px;
+    border: 1px solid #808080;
+}
+/* Right Collapsed Expand Button */
+.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -120px;
+    border: 1px solid #808080;
+}
+/* Top Collapse Button */
+.yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -220px;
+    border: 1px solid #808080;
+}
+/* Top Collapsed Expand Button */
+.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -240px;
+    border: 1px solid #808080;
+}
+/* Bottom Collapse Button */
+.yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -260px;
+    border: 1px solid #808080;
+}
+/* Bottom Collapsed Expand Button */
+.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse {
+    background: transparent url(layout_sprite.png) no-repeat -20px -180px;
+    border: 1px solid #808080;
+}
+/* Close Button */
+.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close {
+    background: transparent url(layout_sprite.png) no-repeat -20px -100px;
+    border: 1px solid #808080;
+}
+
+/* Give the header a blue backgorund */
+.yui-skin-sam .yui-layout .yui-layout-hd {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;
+    border: 1px solid #808080;
+}
+/* Set the background color */
+.yui-skin-sam .yui-layout {
+    background-color: #EDF5FF;
+}
+/* Style the text in the header */
+.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2 {
+    font-weight: bold;
+    color: #fff;
+    padding: 3px;
+}
+/* Style the body */
+.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {
+    border: 1px solid #808080;
+    border-bottom: none;
+    border-top: none;
+    *border-bottom-width: 0;
+    *border-top-width: 0;
+    background-color: #f2f2f2;
+    text-align: left;
+}
+/* Add a border to the bottom of the body because there is no footer */
+.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft {
+    border-bottom: 1px solid #808080;
+}
+/* Add a border to the top of the body because there is no header */
+.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd {
+    border-top: 1px solid #808080;
+}
+
+/* Style the Clip */
+.yui-skin-sam .yui-layout .yui-layout-clip {
+    position: absolute;
+    height: 20px;
+    background-color: #EDF5FF;
+    display: none;
+    border: 1px solid #808080;
+}
+/* Style the footer */
+.yui-skin-sam .yui-layout div.yui-layout-ft {
+    border: 1px solid #808080;
+    border-top: none;
+    *border-top-width: 0;
+    background-color: #f2f2f2;
+}
+
+/* Remove the color from the resize handle */
+.yui-skin-sam .yui-layout-unit .yui-resize-handle {
+    background-color: transparent;
+}
+/* Reposition the handles */
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-r {
+    right: 0;
+    top: 0;
+    background-image: none;
+}
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-l {
+    left: 0;
+    top: 0;
+    background-image: none;
+}
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-b {
+    right: 0;
+    bottom: 0;
+    background-image: none;
+}
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-t {
+    right: 0;
+    top: 0;
+    background-image: none;
+}
+/* Add the gripper */
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob,
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob {
+    position: absolute;
+    height: 16px;
+    width: 6px;
+    top: 45%;
+    left: 0px;
+    background: transparent url(layout_sprite.png) no-repeat 0 -5px;
+}
+/* Add the gripper */
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob,
+.yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob {
+    position: absolute;
+    height: 6px;
+    width: 16px;
+    left: 45%;
+    background: transparent url(layout_sprite.png) no-repeat -20px 0;
+}
diff --git a/lib/yui/layout/assets/skins/sam/layout.css b/lib/yui/layout/assets/skins/sam/layout.css
new file mode 100644 (file)
index 0000000..c9decba
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-layout-loading{visibility:hidden;}body.yui-layout{overflow:hidden;position:relative;padding:0;margin:0;}.yui-layout-doc{position:relative;}.yui-layout-unit{height:50px;width:50px;padding:0;margin:0;float:none;z-index:0;overflow:hidden;}.yui-layout-unit-top{position:absolute;top:0;left:0;width:100%;}.yui-layout-unit-left{position:absolute;top:0;left:0;}.yui-layout-unit-right{position:absolute;top:0;right:0;}.yui-layout-unit-bottom{position:absolute;bottom:0;left:0;width:100%;}.yui-layout-unit-center{position:absolute;top:0;left:0;width:100%;}.yui-layout div.yui-layout-hd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout div.yui-layout-bd{position:absolute;top:0;left:0;zoom:1;width:100%;overflow:hidden;}.yui-layout .yui-layout-scroll div.yui-layout-bd{overflow:auto;}.yui-layout div.yui-layout-ft{position:absolute;bottom:0;left:0;width:100%;zoom:1;overflow:hidden;}.yui-layout .yui-layout-unit div.yui-layout-hd h2{text-align:left;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .close{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse-close{right:25px;}.yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#c0c0c0;display:none;}.yui-layout .yui-layout-clip .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0px;}.yui-layout .yui-layout-wrap{height:100%;width:100%;position:absolute;left:0;}.yui-layout .yui-layout-unit .yui-content{overflow:hidden;}.yui-layout .yui-layout-unit .yui-layout-scroll{overflow:auto;}.yui-skin-sam .yui-layout .yui-resize-proxy{border:none;font-size:0;margin:0;padding:0;}.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-skin-sam .yui-layout .yui-resize-proxy div{position:absolute;border:1px solid #808080;background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r{width:5px;top:0;right:0;height:100%;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b{width:100%;bottom:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t{width:100%;top:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -160px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -140px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -200px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -120px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -220px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -240px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -260px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -180px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close{background:transparent url(layout_sprite.png) no-repeat -20px -100px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-hd{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;border:1px solid #808080;}.yui-skin-sam .yui-layout{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2{font-weight:bold;color:#fff;padding:3px;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd{border:1px solid #808080;border-bottom:none;border-top:none;*border-bottom-width:0;*border-top-width:0;background-color:#f2f2f2;text-align:left;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft{border-bottom:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd{border-top:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#EDF5FF;display:none;border:1px solid #808080;}.yui-skin-sam .yui-layout div.yui-layout-ft{border:1px solid #808080;border-top:none;*border-top-width:0;background-color:#f2f2f2;}.yui-skin-sam .yui-layout-unit .yui-resize-handle{background-color:transparent;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-b{right:0;bottom:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob{position:absolute;height:16px;width:6px;top:45%;left:0px;background:transparent url(layout_sprite.png) no-repeat 0 -5px;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob{position:absolute;height:6px;width:16px;left:45%;background:transparent url(layout_sprite.png) no-repeat -20px 0;}
diff --git a/lib/yui/layout/assets/skins/sam/layout_sprite.png b/lib/yui/layout/assets/skins/sam/layout_sprite.png
new file mode 100644 (file)
index 0000000..d6fce3c
Binary files /dev/null and b/lib/yui/layout/assets/skins/sam/layout_sprite.png differ
diff --git a/lib/yui/layout/layout-beta-debug.js b/lib/yui/layout/layout-beta-debug.js
new file mode 100644 (file)
index 0000000..34a1dbd
--- /dev/null
@@ -0,0 +1,2009 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ * @module layout
+ * @beta
+ */
+(function() {
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class Layout
+     * @extends YAHOO.util.Element
+     * @description <p>Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.</p>
+     * @param {String/HTMLElement} el The element to make contain a layout.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var Layout = function(el, config) {
+        YAHOO.log('Creating the Layout Object', 'info', 'Layout');
+        if (Lang.isObject(el) && !el.tagName) {
+            config = el;
+            el = null;
+        }
+        if (Lang.isString(el)) {
+            if (Dom.get(el)) {
+                el = Dom.get(el);
+            }
+        }
+        if (!el) {
+            el = document.body;
+        }
+
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Layout.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all layout instances
+    * @type Object
+    */ 
+    Layout._instances = {};
+    /**
+    * @static
+    * @method getLayoutById 
+    * @description Get's a layout object by the HTML id of the element associated with the Layout object.
+    * @return {Object} The Layout Object
+    */ 
+    Layout.getLayoutById = function(id) {
+        if (Layout._instances[id]) {
+            return Layout._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(Layout, YAHOO.util.Element, {
+        /**
+        * @property browser
+        * @description A modified version of the YAHOO.env.ua object
+        * @type Object
+        */
+        browser: function() {
+            var b = YAHOO.env.ua;
+            b.standardsMode = false;
+            b.secure = false;
+            return b;
+        }(),
+        /**
+        * @private
+        * @property _rendered
+        * @description Set to true when the layout is rendered
+        * @type Boolean
+        */
+        _rendered: null,
+        /**
+        * @private
+        * @property _zIndex
+        * @description The zIndex to set all LayoutUnits to
+        * @type Number
+        */
+        _zIndex: null,
+        /**
+        * @private
+        * @property _sizes
+        * @description A collection of the current sizes of all usable LayoutUnits to be used for calculations
+        * @type Object
+        */
+        _sizes: null,
+        /**
+        * @private
+        * @method _setBodySize
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the body size of the layout, sets the height and width of the parent container
+        */
+        _setBodySize: function(set) {
+            var h = 0, w = 0;
+            set = ((set === false) ? false : true);
+
+            if (this._isBody) {
+                h = Dom.getClientHeight();
+                w = Dom.getClientWidth();
+            } else {
+                h = parseInt(this.getStyle('height'), 10);
+                w = parseInt(this.getStyle('width'), 10);
+                if (isNaN(w)) {
+                    w = this.get('element').clientWidth;
+                }
+                if (isNaN(h)) {
+                    h = this.get('element').clientHeight;
+                }
+            }
+            if (this.get('minWidth')) {
+                if (w < this.get('minWidth')) {
+                    w = this.get('minWidth');
+                }
+            }
+            if (this.get('minHeight')) {
+                if (h < this.get('minHeight')) {
+                    h = this.get('minHeight');
+                }
+            }
+            if (set) {
+                Dom.setStyle(this._doc, 'height', h + 'px');
+                Dom.setStyle(this._doc, 'width', w + 'px');
+            }
+            this._sizes.doc = { h: h, w: w };
+            YAHOO.log('Setting Body height and width: (' + h + ',' + w + ')', 'info', 'Layout');
+            this._setSides(set);
+        },
+        /**
+        * @private
+        * @method _setSides
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the size and position of the left, right, top and bottom units
+        */
+        _setSides: function(set) {
+            YAHOO.log('Setting side units', 'info', 'Layout');
+            var h1 = ((this._top) ? this._top.get('height') : 0),
+                h2 = ((this._bottom) ? this._bottom.get('height') : 0),
+                h = this._sizes.doc.h,
+                w = this._sizes.doc.w;
+            set = ((set === false) ? false : true);
+
+            this._sizes.top = {
+                h: h1, w: ((this._top) ? w : 0),
+                t: 0
+            };
+            this._sizes.bottom = {
+                h: h2, w: ((this._bottom) ? w : 0)
+            };
+            
+            var newH = (h - (h1 + h2));
+
+            this._sizes.left = {
+                h: newH, w: ((this._left) ? this._left.get('width') : 0)
+            };
+            this._sizes.right = {
+                h: newH, w: ((this._right) ? this._right.get('width') : 0),
+                l: ((this._right) ? (w - this._right.get('width')) : 0),
+                t: this._sizes.top.h
+            };
+            
+            if (this._right && set) {
+                if (this._top) {
+                    this._right.set('top', this._sizes.right.t);
+                }
+                if (!this._right._collapsing) { 
+                    this._right.set('left', this._sizes.right.l);
+                }
+                this._right.set('height', this._sizes.right.h, true);
+            }
+            if (this._left) {
+                if (this._top) {
+                    this._sizes.left.t = this._sizes.top.h;
+                    this._sizes.left.l = 0;
+                    if (set) {
+                        this._left.set('top', this._sizes.top.h);
+                        this._left.set('left', 0);
+                    }
+                }
+                if (set) {
+                    this._left.set('height', this._sizes.left.h, true);
+                }
+            }
+            if (this._bottom) {
+                this._sizes.bottom.t = this._sizes.top.h + this._sizes.left.h;
+                if (set) {
+                    this._bottom.set('top', this._sizes.bottom.t);
+                    this._bottom.set('width', this._sizes.bottom.w, true);
+                }
+            }
+            if (this._top) {
+                if (set) {
+                    this._top.set('width', this._sizes.top.w, true);
+                }
+            }
+            YAHOO.log('Setting sizes: (' + Lang.dump(this._sizes) + ')', 'info', 'Layout');
+            this._setCenter(set);
+        },
+        /**
+        * @private
+        * @method _setCenter
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the size and position of the center unit
+        */
+        _setCenter: function(set) {
+            set = ((set === false) ? false : true);
+            var h = this._sizes.left.h;
+            var w = (this._sizes.doc.w - (this._sizes.left.w + this._sizes.right.w));
+            if (set) {
+                this._center.set('height', h, true);
+                this._center.set('width', w, true);
+                this._center.set('top', this._sizes.top.h);
+                this._center.set('left', this._sizes.left.w);
+            }
+            this._sizes.center = { h: h, w: w, t: this._sizes.top.h, l: this._sizes.left.w };
+            YAHOO.log('Setting Center size to: (' + h + ', ' + w + ')', 'info', 'Layout');
+        },
+        /**
+        * @method getSizes
+        * @description Get a reference to the internal Layout Unit sizes
+        * @return {Object} An object of the layout unit sizes
+        */
+        getSizes: function() {
+            return this._sizes;
+        },
+        /**
+        * @method getUnitById
+        * @param {String} id The HTML element id of the unit
+        * @description Get the LayoutUnit by it's HTML id
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        getUnitById: function(id) {
+            return YAHOO.widget.LayoutUnit.getLayoutUnitById(id);
+        },
+        /**
+        * @method getUnitByPosition
+        * @param {String} pos The position of the unit in this layout
+        * @description Get the LayoutUnit by it's position in this layout
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        getUnitByPosition: function(pos) {
+            if (pos) {
+                pos = pos.toLowerCase();
+                if (this['_' + pos]) {
+                    return this['_' + pos];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method removeUnit
+        * @param {Object} unit The LayoutUnit that you want to remove
+        * @description Remove the unit from this layout and resize the layout.
+        */
+        removeUnit: function(unit) {
+            this['_' + unit.get('position')] = null;
+            this.resize();
+        },
+        /**
+        * @method addUnit
+        * @param {Object} cfg The config for the LayoutUnit that you want to add
+        * @description Add a unit to this layout and if the layout is rendered, resize the layout. 
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        addUnit: function(cfg) {
+            if (!cfg.position) {
+                YAHOO.log('No position property passed', 'error', 'Layout');
+                return false;
+            }
+            if (this['_' + cfg.position]) {
+                YAHOO.log('Position already exists', 'error', 'Layout');
+                return false;
+            }
+            YAHOO.log('Adding Unit at position: ' + cfg.position, 'info', 'Layout');
+            var element = null,
+                el = null;
+
+            if (cfg.id) {
+                if (Dom.get(cfg.id)) {
+                    element = Dom.get(cfg.id);
+                    delete cfg.id;
+
+                }
+            }
+            if (cfg.element) {
+                element = cfg.element;
+            }
+
+            if (!el) {
+                el = document.createElement('div');
+                var id = Dom.generateId();
+                el.id = id;
+            }
+
+            if (!element) {
+                element = document.createElement('div');
+            }
+            Dom.addClass(element, 'yui-layout-wrap');
+            if (this.browser.ie && !this.browser.standardsMode) {
+                el.style.zoom = 1;
+                element.style.zoom = 1;
+            }
+
+            if (el.firstChild) {
+                el.insertBefore(element, el.firstChild);
+            } else {
+                el.appendChild(element);
+            }
+            this._doc.appendChild(el);
+
+            var h = false, w = false;
+
+            if (cfg.height) {
+                h = parseInt(cfg.height, 10);
+            }
+            if (cfg.width) {
+                w = parseInt(cfg.width, 10);
+            }
+            var unitConfig = {};
+            YAHOO.lang.augmentObject(unitConfig, cfg); // break obj ref
+
+            unitConfig.parent = this;
+            unitConfig.wrap = element;
+            unitConfig.height = h;
+            unitConfig.width = w;
+
+            var unit = new YAHOO.widget.LayoutUnit(el, unitConfig);
+
+            unit.on('heightChange', this.resize, this, true);
+            unit.on('widthChange', this.resize, this, true);
+            unit.on('gutterChange', this.resize, this, true);
+            this['_' + cfg.position] = unit;
+
+            if (this._rendered) {
+                this.resize();
+            }
+
+            return unit;
+        },
+        /**
+        * @private
+        * @method _createUnits
+        * @description Private method to create units from the config that was passed in.
+        */
+        _createUnits: function() {
+            var units = this.get('units');
+            for (var i in units) {
+                if (Lang.hasOwnProperty(units, i)) {
+                    this.addUnit(units[i]);
+                }
+            }
+        },
+        /**
+        * @method resize
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Starts the chain of resize routines that will resize all the units.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The Layout instance
+        */
+        resize: function(set) {
+            set = ((set === false) ? false : true);
+            if (set) {
+                var retVal = this.fireEvent('beforeResize');
+                if (retVal === false) {
+                    set = false;
+                }
+                if (this.browser.ie) {
+                    if (this._isBody) {
+                        Dom.removeClass(document.documentElement, 'yui-layout');
+                        Dom.addClass(document.documentElement, 'yui-layout');
+                    } else {
+                        this.removeClass('yui-layout');
+                        this.addClass('yui-layout');
+                    }
+                }
+            }
+            this._setBodySize(set);
+            if (set) {
+                this.fireEvent('resize', { target: this, sizes: this._sizes });
+            }
+            return this;
+        },
+        /**
+        * @private
+        * @method _setupBodyElements
+        * @description Sets up the main doc element when using the body as the main element.
+        */
+        _setupBodyElements: function() {
+            this._doc = Dom.get('doc');
+            if (!this._doc) {
+                this._doc = document.createElement('div');
+                this._doc.id = 'layout-doc';
+                if (document.body.firstChild) {
+                    document.body.insertBefore(this._doc, document.body.firstChild);
+                } else {
+                    document.body.appendChild(this._doc);
+                }
+            }
+            this._createUnits();
+            this._setBodySize();
+            Event.on(window, 'resize', this.resize, this, true);
+            Dom.addClass(this._doc, 'yui-layout-doc');
+        },
+        /**
+        * @private
+        * @method _setupElements
+        * @description Sets up the main doc element when not using the body as the main element.
+        */
+        _setupElements: function() {
+            this._doc = this.getElementsByClassName('doc')[0];
+            if (!this._doc) {
+                this._doc = document.createElement('div');
+                this.get('element').appendChild(this._doc);
+            }
+            this._createUnits();
+            this._setBodySize();
+            Event.on(window, 'resize', this.resize, this, true);
+            Dom.addClass(this._doc, 'yui-layout-doc');
+        },
+        /**
+        * @private
+        * @property _isBody
+        * @description Flag to determine if we are using the body as the root element.
+        * @type Boolean
+        */
+        _isBody: null,
+        /**
+        * @private
+        * @property _doc
+        * @description Reference to the root element
+        * @type HTMLElement
+        */
+        _doc: null,
+        /**
+        * @private
+        * @property _left
+        * @description Reference to the left LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _left: null,
+        /**
+        * @private
+        * @property _right
+        * @description Reference to the right LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _right: null,
+        /**
+        * @private
+        * @property _top
+        * @description Reference to the top LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _top: null,
+        /**
+        * @private
+        * @property _bottom
+        * @description Reference to the bottom LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _bottom: null,
+        /**
+        * @private
+        * @property _center
+        * @description Reference to the center LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _center: null,
+        /**
+        * @private
+        * @method init
+        * @description The Layout class' initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'Layout');
+            this._zIndex = 0;
+            Layout.superclass.init.call(this, p_oElement, p_oAttributes);
+            
+            if (this.get('parent')) {
+                this._zIndex = this.get('parent')._zIndex + 10;
+            }
+
+            this._sizes = {};
+
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = Dom.generateId(id);
+            }
+            Layout._instances[id] = this;
+        },
+        /**
+        * @method render
+        * @description This method starts the render process, applying classnames and creating elements
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The Layout instance
+        */        
+        render: function() {
+            YAHOO.log('Render', 'info', 'Layout');
+            this._stamp();
+            var el = this.get('element');
+            if (el && el.tagName && (el.tagName.toLowerCase() == 'body')) {
+                this._isBody = true;
+                Dom.addClass(document.body, 'yui-layout');
+                if (Dom.hasClass(document.body, 'yui-skin-sam')) {
+                    //Move the class up so we can have a css chain
+                    Dom.addClass(document.documentElement, 'yui-skin-sam');
+                    Dom.removeClass(document.body, 'yui-skin-sam');
+                }
+                this._setupBodyElements();
+            } else {
+                this._isBody = false;
+                this.addClass('yui-layout');
+                this._setupElements();
+            }
+            this.resize();
+            this._rendered = true;
+            this.fireEvent('render');
+
+            return this;
+        },
+        /**
+        * @private
+        * @method _stamp
+        * @description Stamps the root node with a secure classname for ease of use. Also sets the this.browser.standardsMode variable.
+        */        
+        _stamp: function() {
+            if (document.compatMode == 'CSS1Compat') {
+                this.browser.standardsMode = true;
+            }
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+                Dom.addClass(document.documentElement, 'secure');
+                this.browser.secure = true;
+            }
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Processes the config
+        */        
+        initAttributes: function(attr) {
+            Layout.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute units
+            * @description An array of config definitions for the LayoutUnits to add to this layout
+            * @type Array
+            */
+            this.setAttributeConfig('units', {
+                writeOnce: true,
+                validator: YAHOO.lang.isArray,
+                value: attr.units || []
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minimum height in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minimum width in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute height
+            * @description The height in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || false,
+                validator: YAHOO.lang.isNumber,
+                method: function(h) {
+                    this.setStyle('height', h + 'px');
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width || false,
+                validator: YAHOO.lang.isNumber,
+                method: function(w) {
+                    this.setStyle('width', w + 'px');
+                }
+            });
+
+            /**
+            * @attribute parent
+            * @description If this layout is to be used as a child of another Layout instance, this config will bind the resize events together.
+            * @type Object YAHOO.widget.Layout
+            */
+            this.setAttributeConfig('parent', {
+                writeOnce: true,
+                value: attr.parent || false,
+                method: function(p) {
+                    if (p) {
+                        p.on('resize', this.resize, this, true);
+                    }
+                }
+            });
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the Layout.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'Layout #' + this.get('id');
+            }
+            return 'Layout';
+        }
+    });
+    /**
+    * @event resize
+    * @description Fired when this.resize is called
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event startResize
+    * @description Fired when the Resize Utility for a Unit fires it's startResize Event.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event beforeResize
+    * @description Firef at the beginning of the resize method. If you return false, the resize is cancelled.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event render
+    * @description Fired after the render method completes.
+    * @type YAHOO.util.CustomEvent
+    */
+
+    YAHOO.widget.Layout = Layout;
+})();
+/**
+ * @description <p>Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, layout
+ * @optional animation, dragdrop, selector
+ * @beta
+ */
+(function() {
+    var Dom = YAHOO.util.Dom,
+        Sel = YAHOO.util.Selector,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class LayoutUnit
+     * @extends YAHOO.util.Element
+     * @description <p>Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.</p>
+     * @param {String/HTMLElement} el The element to make a unit.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var LayoutUnit = function(el, config) {
+        
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        LayoutUnit.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all layout unit instances
+    * @type Object
+    */ 
+    LayoutUnit._instances = {};
+    /**
+    * @static
+    * @method getLayoutUnitById 
+    * @description Get's a layout unit object by the HTML id of the element associated with the Layout Unit object.
+    * @return {Object} The Layout Object
+    */ 
+    LayoutUnit.getLayoutUnitById = function(id) {
+        if (LayoutUnit._instances[id]) {
+            return LayoutUnit._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(LayoutUnit, YAHOO.util.Element, {
+        /**
+        * @property STR_CLOSE
+        * @description String used for close button title
+        * @type {String}
+        */
+        STR_CLOSE: 'Click to close this pane.',
+        /**
+        * @property STR_COLLAPSE
+        * @description String used for collapse button title
+        * @type {String}
+        */
+        STR_COLLAPSE: 'Click to collapse this pane.',
+        /**
+        * @property STR_EXPAND
+        * @description String used for expand button title
+        * @type {String}
+        */
+        STR_EXPAND: 'Click to expand this pane.',
+        /**
+        * @property browser
+        * @description A modified version of the YAHOO.env.ua object
+        * @type Object
+        */
+        browser: null,
+        /**
+        * @private
+        * @property _sizes
+        * @description A collection of the current sizes of the contents of this Layout Unit
+        * @type Object
+        */
+        _sizes: null,
+        /**
+        * @private
+        * @property _anim
+        * @description A reference to the Animation instance used by this LayouUnit
+        * @type YAHOO.util.Anim
+        */
+        _anim: null,
+        /**
+        * @private
+        * @property _resize
+        * @description A reference to the Resize instance used by this LayoutUnit
+        * @type YAHOO.util.Resize
+        */
+        _resize: null,
+        /**
+        * @private
+        * @property _clip
+        * @description A reference to the clip element used when collapsing the unit
+        * @type HTMLElement
+        */
+        _clip: null,
+        /**
+        * @private
+        * @property _gutter
+        * @description A simple hash table used to store the gutter to apply to the Unit
+        * @type Object
+        */
+        _gutter: null,
+        /**
+        * @property header
+        * @description A reference to the HTML element used for the Header
+        * @type HTMLELement
+        */
+        header: null,
+        /**
+        * @property body
+        * @description A reference to the HTML element used for the body
+        * @type HTMLElement
+        */
+        body: null,
+        /**
+        * @property footer
+        * @description A reference to the HTML element used for the footer
+        * @type HTMLElement
+        */
+        footer: null,
+        /**
+        * @private
+        * @property _collapsed
+        * @description Flag to determine if the unit is collapsed or not.
+        * @type Boolean
+        */
+        _collapsed: null,
+        /**
+        * @private
+        * @property _collapsing
+        * @description A flag set while the unit is being collapsed, used so we don't fire events while animating the size
+        * @type Boolean
+        */
+        _collapsing: null,
+        /**
+        * @private
+        * @property _lastWidth
+        * @description A holder for the last known width of the unit
+        * @type Number
+        */
+        _lastWidth: null,
+        /**
+        * @private
+        * @property _lastHeight
+        * @description A holder for the last known height of the unit
+        * @type Number
+        */
+        _lastHeight: null,
+        /**
+        * @private
+        * @property _lastTop
+        * @description A holder for the last known top of the unit
+        * @type Number
+        */
+        _lastTop: null,
+        /**
+        * @private
+        * @property _lastLeft
+        * @description A holder for the last known left of the unit
+        * @type Number
+        */
+        _lastLeft: null,
+        /**
+        * @private
+        * @property _lastScroll
+        * @description A holder for the last known scroll state of the unit
+        * @type Boolean
+        */
+        _lastScroll: null,
+        /**
+        * @method resize
+        * @description Resize either the unit or it's clipped state, also updating the box inside
+        * @param {Boolean} force This will force full calculations even when the unit is collapsed
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        resize: function(force) {
+            YAHOO.log('Resize', 'info', 'LayoutUnit');
+            var retVal = this.fireEvent('beforeResize');
+            if (retVal === false) {
+                return this;
+            }
+            if (!this._collapsing || (force === true)) {
+                var scroll = this.get('scroll');
+                this.set('scroll', false);
+
+
+                var hd = this._getBoxSize(this.header),
+                    ft = this._getBoxSize(this.footer),
+                    box = [this.get('height'), this.get('width')];
+
+
+                var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom),
+                    nw = box[1] - (this._gutter.left + this._gutter.right);
+
+                var wrapH = (nh + (hd[0] + ft[0])),
+                    wrapW = nw;
+
+                if (this._collapsed && !this._collapsing) {
+                    this._setHeight(this._clip, wrapH);
+                    this._setWidth(this._clip, wrapW);
+                    Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px');
+                    Dom.setStyle(this._clip, 'left', this.get('left') + this._gutter.left + 'px');
+                } else if (!this._collapsed || (this._collapsed && this._collapsing)) {
+                    wrapH = this._setHeight(this.get('wrap'), wrapH);
+                    wrapW = this._setWidth(this.get('wrap'), wrapW);
+                    this._sizes.wrap.h = wrapH;
+                    this._sizes.wrap.w = wrapW;
+
+                    Dom.setStyle(this.get('wrap'), 'top', this._gutter.top + 'px');
+                    Dom.setStyle(this.get('wrap'), 'left', this._gutter.left + 'px');
+
+                    this._sizes.header.w = this._setWidth(this.header, wrapW);
+                    this._sizes.header.h = hd[0];
+
+                    this._sizes.footer.w = this._setWidth(this.footer, wrapW);
+                    this._sizes.footer.h = ft[0];
+
+                    Dom.setStyle(this.footer, 'bottom', '0px');
+
+                    this._sizes.body.h = this._setHeight(this.body, (wrapH - (hd[0] + ft[0])));
+                    this._sizes.body.w =this._setWidth(this.body, wrapW);
+                    Dom.setStyle(this.body, 'top', hd[0] + 'px');
+
+                    this.set('scroll', scroll);
+                    this.fireEvent('resize');
+                }
+            }
+            return this;
+        },
+        /**
+        * @private
+        * @method _setWidth
+        * @description Sets the width of the element based on the border size of the element.
+        * @param {HTMLElement} el The HTMLElement to have it's width set
+        * @param {Number} w The width that you want it the element set to
+        * @return {Number} The new width, fixed for borders and IE QuirksMode
+        */
+        _setWidth: function(el, w) {
+            if (el) {
+                var b = this._getBorderSizes(el);
+                w = (w - (b[1] + b[3]));
+                w = this._fixQuirks(el, w, 'w');
+                Dom.setStyle(el, 'width', w + 'px');
+            }
+            return w;
+        },
+        /**
+        * @private
+        * @method _setHeight
+        * @description Sets the height of the element based on the border size of the element.
+        * @param {HTMLElement} el The HTMLElement to have it's height set
+        * @param {Number} h The height that you want it the element set to
+        * @return {Number} The new height, fixed for borders and IE QuirksMode
+        */
+        _setHeight: function(el, h) {
+            if (el) {
+                var b = this._getBorderSizes(el);
+                h = (h - (b[0] + b[2]));
+                h = this._fixQuirks(el, h, 'h');
+                Dom.setStyle(el, 'height', h + 'px');
+            }
+            return h;
+        },
+        /**
+        * @private
+        * @method _fixQuirks
+        * @description Fixes the box calculations for IE in QuirksMode
+        * @param {HTMLElement} el The HTMLElement to set the dimension on
+        * @param {Number} dim The number of the dimension to fix
+        * @param {String} side The dimension (h or w) to fix. Defaults to h
+        * @return {Number} The fixed dimension
+        */
+        _fixQuirks: function(el, dim, side) {
+            var i1 = 0, i2 = 2;
+            if (side == 'w') {
+                i1 = 1;
+                i2 = 3;
+            }
+            if (this.browser.ie && !this.browser.standardsMode) {
+                //Internet Explorer - Quirks Mode
+                var b = this._getBorderSizes(el),
+                    bp = this._getBorderSizes(el.parentNode);
+                if ((b[i1] === 0) && (b[i2] === 0)) { //No Borders, check parent
+                    if ((bp[i1] !== 0) && (bp[i2] !== 0)) { //Parent has Borders
+                        dim = (dim - (bp[i1] + bp[i2]));
+                    }
+                } else {
+                    if ((bp[i1] === 0) && (bp[i2] === 0)) {
+                        dim = (dim + (b[i1] + b[i2]));
+                    }
+                }
+            }
+            return dim;
+        },
+        /**
+        * @private
+        * @method _getBoxSize
+        * @description Get's the elements clientHeight and clientWidth plus the size of the borders
+        * @param {HTMLElement} el The HTMLElement to get the size of
+        * @return {Array} An array of height and width
+        */
+        _getBoxSize: function(el) {
+            var size = [0, 0];
+            if (el) {
+                if (this.browser.ie && !this.browser.standardsMode) {
+                    el.style.zoom = 1;
+                }
+                var b = this._getBorderSizes(el);
+                size[0] = el.clientHeight + (b[0] + b[2]);
+                size[1] = el.clientWidth + (b[1] + b[3]);
+            }
+            return size;
+        },
+        /**
+        * @private
+        * @method _getBorderSizes
+        * @description Get the CSS border size of the element passed.
+        * @param {HTMLElement} el The element to get the border size of
+        * @return {Array} An array of the top, right, bottom, left borders.
+        */
+        _getBorderSizes: function(el) {
+            var s = [];
+            el = el || this.get('element');
+            if (this.browser.ie && !this.browser.standardsMode) {
+                el.style.zoom = 1;
+            }
+            s[0] = parseInt(Dom.getStyle(el, 'borderTopWidth'), 10);
+            s[1] = parseInt(Dom.getStyle(el, 'borderRightWidth'), 10);
+            s[2] = parseInt(Dom.getStyle(el, 'borderBottomWidth'), 10);
+            s[3] = parseInt(Dom.getStyle(el, 'borderLeftWidth'), 10);
+            
+            //IE will return NaN on these if they are set to auto, we'll set them to 0
+            for (var i = 0; i < s.length; i++) {
+                if (isNaN(s[i])) {
+                    s[i] = 0;
+                }
+            }
+            return s;
+        },
+        /**
+        * @private
+        * @method _createClip
+        * @description Create the clip element used when the Unit is collapsed
+        */
+        _createClip: function() {
+            if (!this._clip) {
+                this._clip = document.createElement('div');
+                this._clip.className = 'yui-layout-clip yui-layout-clip-' + this.get('position');
+                this._clip.innerHTML = '<div class="collapse"></div>';
+                var c = this._clip.firstChild;
+                c.title = this.STR_EXPAND;
+                Event.on(c, 'click', this.expand, this, true);
+                this.get('element').parentNode.appendChild(this._clip);
+            }
+        },
+        /**
+        * @private
+        * @method _toggleClip
+        * @description Toggle th current state of the Clip element and set it's height, width and position
+        */
+        _toggleClip: function() {
+            if (!this._collapsed) {
+                //show
+                var hd = this._getBoxSize(this.header),
+                    ft = this._getBoxSize(this.footer),
+                    box = [this.get('height'), this.get('width')];
+
+
+                var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom),
+                    nw = box[1] - (this._gutter.left + this._gutter.right),
+                    wrapH = (nh + (hd[0] + ft[0]));
+
+                switch (this.get('position')) {
+                    case 'top':
+                    case 'bottom':
+                        this._setWidth(this._clip, nw);
+                        this._setHeight(this._clip, this.get('collapseSize'));
+                        Dom.setStyle(this._clip, 'left', (this._lastLeft + this._gutter.left) + 'px');
+                        if (this.get('position') == 'bottom') {
+                            Dom.setStyle(this._clip, 'top', ((this._lastTop + this._lastHeight) - (this.get('collapseSize') - this._gutter.top)) + 'px');
+                        } else {
+                            Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px');
+                        }
+                        break;
+                    case 'left':
+                    case 'right':
+                        this._setWidth(this._clip, this.get('collapseSize'));
+                        this._setHeight(this._clip, wrapH);
+                        Dom.setStyle(this._clip, 'top', (this.get('top') + this._gutter.top) + 'px');
+                        if (this.get('position') == 'right') {
+                            Dom.setStyle(this._clip, 'left', (((this._lastLeft + this._lastWidth) - this.get('collapseSize')) - this._gutter.left) + 'px');
+                        } else {
+                            Dom.setStyle(this._clip, 'left', (this.get('left') + this._gutter.left) + 'px');
+                        }
+                        break;
+                }
+
+                Dom.setStyle(this._clip, 'display', 'block');
+                this.setStyle('display', 'none');
+            } else {
+                //Hide
+                Dom.setStyle(this._clip, 'display', 'none');
+            }
+        },
+        /**
+        * @method getSizes
+        * @description Get a reference to the internal sizes object
+        * @return {Object} An object of the sizes used for calculations
+        */
+        getSizes: function() {
+            return this._sizes;
+        },
+        /**
+        * @method toggle
+        * @description Toggles the Unit, replacing it with a clipped version.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        toggle: function() {
+            if (this._collapsed) {
+                this.expand();
+            } else {
+                this.collapse();
+            }
+            return this;
+        },
+        /**
+        * @method expand
+        * @description Expand the Unit if it is collapsed.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        expand: function() {
+            if (!this.get('collapse')) {
+                return this;
+            }
+            if (!this._collapsed) {
+                return this;
+            }
+
+            this._collapsing = true;
+            this.setStyle('zIndex', this.get('parent')._zIndex + 1);
+
+            if (this._anim) {
+                this.setStyle('display', 'none');
+                //Animation Fails Here
+                var attr = {}, s;
+
+                switch (this.get('position')) {
+                    case 'left':
+                    case 'right':
+                        this.set('width', this._lastWidth, true);
+                        this.setStyle('width', this._lastWidth + 'px');
+                        this.get('parent').resize(false);
+                        s = this.get('parent').getSizes()[this.get('position')];
+                        this.set('height', s.h, true);
+                        var left = s.l;
+                        attr = {
+                            left: {
+                                to: left
+                            }
+                        };
+                        if (this.get('position') == 'left') {
+                            attr.left.from = (left - s.w);
+                            this.setStyle('left', (left - s.w) + 'px');
+                        }
+                        break;
+                    case 'top':
+                    case 'bottom':
+                        this.set('height', this._lastHeight, true);
+                        this.setStyle('height', this._lastHeight + 'px');
+                        this.get('parent').resize(false);
+                        s = this.get('parent').getSizes()[this.get('position')];
+                        this.set('width', s.w, true);
+                        var top = s.t;
+                        attr = {
+                            top: {
+                                to: top
+                            }
+                        };
+                        if (this.get('position') == 'top') {
+                            this.setStyle('top',  (top - s.h) + 'px');
+                            attr.top.from = (top - s.h);
+                        }
+                        break;
+                }
+
+                this._anim.attributes = attr;
+                var exStart = function() {
+                    this.setStyle('display', 'block');
+                    this.resize(true);
+                    this._anim.onStart.unsubscribe(exStart, this, true);
+                };
+                var expand = function() {
+                    this._collapsing = false;
+                    this.setStyle('zIndex', this.get('parent')._zIndex);
+                    this.set('width', this._lastWidth);
+                    this.set('height', this._lastHeight);
+                    this._collapsed = false;
+                    this.resize();
+                    this.set('scroll', this._lastScroll);
+                    this._anim.onComplete.unsubscribe(expand, this, true);
+                    this.fireEvent('expand');
+                };
+                this._anim.onStart.subscribe(exStart, this, true);
+                this._anim.onComplete.subscribe(expand, this, true);
+                this._anim.animate();
+                this._toggleClip();
+            } else {
+                this._collapsing = false;
+                this._toggleClip();
+                this.setStyle('zIndex', this.get('parent')._zIndex);
+                this.setStyle('display', 'block');
+                this.set('width', this._lastWidth);
+                this.set('height', this._lastHeight);
+                this._collapsed = false;
+                this.resize();
+                this.set('scroll', this._lastScroll);
+                this.fireEvent('expand');
+            }
+            return this;
+        },
+        /**
+        * @method collapse
+        * @description Collapse the Unit if it is not collapsed.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        collapse: function() {
+            if (!this.get('collapse')) {
+                return this;
+            }
+            if (this._collapsed) {
+                return this;
+            }
+            if (!this._clip) {
+                this._createClip();
+            }
+            this._collapsing = true;
+            var w = this.get('width'),
+                h = this.get('height'),
+                attr = {};
+            this._lastWidth = w;
+            this._lastHeight = h;
+            this._lastScroll = this.get('scroll');
+            this.set('scroll', false, true);
+            this._lastLeft = parseInt(this.get('element').style.left, 10);
+            this._lastTop = parseInt(this.get('element').style.top, 10);
+            if (isNaN(this._lastTop)) {
+                this._lastTop = 0;
+                this.set('top', 0);
+            }
+            if (isNaN(this._lastLeft)) {
+                this._lastLeft = 0;
+                this.set('left', 0);
+            }
+            this.setStyle('zIndex', this.get('parent')._zIndex + 1);
+            var pos = this.get('position');
+
+            switch (pos) {
+                case 'top':
+                case 'bottom':
+                    this.set('height', (this.get('collapseSize') + (this._gutter.top + this._gutter.bottom)));
+                    attr = {
+                        top: {
+                            to: (this.get('top') - h)
+                        }
+                    };
+                    if (pos == 'bottom') {
+                        attr.top.to = (this.get('top') + h);
+                    }
+                    break;
+                case 'left':
+                case 'right':
+                    this.set('width', (this.get('collapseSize') + (this._gutter.left + this._gutter.right)));
+                    attr = {
+                        left: {
+                            to: -(this._lastWidth)
+                        }
+                    };
+                    if (pos == 'right') {
+                        attr.left = {
+                            to: (this.get('left') + w)
+                        };
+                    }
+                    break;
+            }
+            if (this._anim) {
+                this._anim.attributes = attr;
+                var collapse = function() {
+                    this._collapsing = false;
+                    this._toggleClip();
+                    this.setStyle('zIndex', this.get('parent')._zIndex);
+                    this._collapsed = true;
+                    this.get('parent').resize();
+                    this._anim.onComplete.unsubscribe(collapse, this, true);
+                    this.fireEvent('collapse');
+                };
+                this._anim.onComplete.subscribe(collapse, this, true);
+                this._anim.animate();
+            } else {
+                this._collapsing = false;
+                this.setStyle('display', 'none');
+                this._toggleClip();
+                this.setStyle('zIndex', this.get('parent')._zIndex);
+                this.get('parent').resize();
+                this._collapsed = true;
+                this.fireEvent('collapse');
+            }
+            return this;
+        },
+        /**
+        * @method close
+        * @description Close the unit, removing it from the parent Layout.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The parent Layout instance
+        */
+        close: function() {
+            this.setStyle('display', 'none');
+            this.get('parent').removeUnit(this);
+            this.fireEvent('close');
+            if (this._clip) {
+                this._clip.parentNode.removeChild(this._clip);
+                this._clip = null;
+            }
+            return this.get('parent');
+        },
+        /**
+        * @private
+        * @method init
+        * @description The initalization method inherited from Element.
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'LayoutUnit');
+            this._gutter = {
+                left: 0,
+                right: 0,
+                top: 0,
+                bottom: 0
+            };
+            this._sizes = {
+                wrap: {
+                    h: 0,
+                    w: 0
+                },
+                header: {
+                    h: 0,
+                    w: 0
+                },
+                body: {
+                    h: 0,
+                    w: 0
+                },
+                footer: {
+                    h: 0,
+                    w: 0
+                }
+            };
+            
+            LayoutUnit.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.browser = this.get('parent').browser;
+            
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = Dom.generateId(id);
+            }
+            LayoutUnit._instances[id] = this;
+
+            this.setStyle('position', 'absolute');
+
+            this.addClass('yui-layout-unit');
+            this.addClass('yui-layout-unit-' + this.get('position'));
+
+
+            var header = this.getElementsByClassName('yui-layout-hd', 'div')[0];
+            if (header) {
+                this.header = header;
+            }
+            var body = this.getElementsByClassName('yui-layout-bd', 'div')[0];
+            if (body) {
+                this.body = body;
+            }
+            var footer = this.getElementsByClassName('yui-layout-ft', 'div')[0];
+            if (footer) {
+                this.footer = footer;
+            }
+
+            this.on('contentChange', this.resize, this, true);
+            
+            this.set('animate', this.get('animate'));
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Processes the config
+        */        
+        initAttributes: function(attr) {
+            LayoutUnit.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @private
+            * @attribute wrap
+            * @description A reference to the wrap element
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('wrap', {
+                value: attr.wrap || null,
+                method: function(w) {
+                    if (w) {
+                        var id = Dom.generateId(w);
+                        LayoutUnit._instances[id] = this;
+                    }
+                }
+            });
+            /**
+            * @attribute grids
+            * @description Set this option to true if you want the LayoutUnit to fix the first layer of YUI CSS Grids (margins)
+            * @type Boolean
+            */
+            this.setAttributeConfig('grids', {
+                value: attr.grids || false
+            });
+            /**
+            * @private
+            * @attribute top
+            * @description The current top positioning of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('top', {
+                value: attr.top || 0,
+                validator: Lang.isNumber,
+                method: function(t) {
+                    if (!this._collapsing) {
+                        this.setStyle('top', t + 'px');
+                    }
+                }
+            });
+            /**
+            * @private
+            * @attribute left
+            * @description The current left position of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('left', {
+                value: attr.left || 0,
+                validator: Lang.isNumber,
+                method: function(l) {
+                    if (!this._collapsing) {
+                        this.setStyle('left', l + 'px');
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minWidth parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxWidth
+            * @description The maxWidth parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('maxWidth', {
+                value: attr.maxWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minHeight parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxHeight
+            * @description The maxHeight parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('maxHeight', {
+                value: attr.maxHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute height
+            * @description The height of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height,
+                validator: Lang.isNumber,
+                method: function(h) {
+                    if (!this._collapsing) {
+                        this.setStyle('height', h + 'px');
+                    }
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width,
+                validator: Lang.isNumber,
+                method: function(w) {
+                    if (!this._collapsing) {
+                        this.setStyle('width', w + 'px');
+                    }
+                }
+            });
+            /**
+            * @attribute position
+            * @description The position (top, right, bottom, left or center) of the Unit in the Layout
+            * @type {String}
+            */
+            this.setAttributeConfig('position', {
+                value: attr.position
+            });
+            /**
+            * @attribute gutter
+            * @description The gutter that we should apply to the parent Layout around this Unit. Supports standard CSS markup: (2 4 0 5) or (2) or (2 5)
+            * @type String
+            */
+            this.setAttributeConfig('gutter', {
+                value: attr.gutter || 0,
+                validator: YAHOO.lang.isString,
+                method: function(gutter) {
+                    var p = gutter.split(' ');
+                    if (p.length) {
+                        this._gutter.top = parseInt(p[0], 10);
+                        if (p[1]) {
+                            this._gutter.right = parseInt(p[1], 10);
+                        } else {
+                            this._gutter.right = this._gutter.top;
+                        }
+                        if (p[2]) {
+                            this._gutter.bottom = parseInt(p[2], 10);
+                        } else {
+                            this._gutter.bottom = this._gutter.top;
+                        }
+                        if (p[3]) {
+                            this._gutter.left = parseInt(p[3], 10);
+                        } else if (p[1]) {
+                            this._gutter.left = this._gutter.right;
+                        } else {
+                            this._gutter.left = this._gutter.top;
+                        }
+                    }
+                }
+            });
+            /**
+            * @attribute parent
+            * @description The parent Layout that we are assigned to
+            * @type {Object} YAHOO.widget.Layout
+            */
+            this.setAttributeConfig('parent', {
+                writeOnce: true,
+                value: attr.parent || false,
+                method: function(p) {
+                    if (p) {
+                        p.on('resize', this.resize, this, true);
+                    }
+
+                }
+            });
+            /**
+            * @attribute collapseSize
+            * @description The pixel size of the Clip that we will collapse to
+            * @type Number
+            */
+            this.setAttributeConfig('collapseSize', {
+                value: attr.collapseSize || 25,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @attribute duration
+            * @description The duration to give the Animation Utility when animating the opening and closing of Units
+            */
+            this.setAttributeConfig('duration', {
+                value: attr.duration || 0.5
+            });
+            /**
+            * @attribute easing
+            * @description The Animation Easing to apply to the Animation instance for this unit.
+            */
+            this.setAttributeConfig('easing', {
+                value: attr.easing || ((YAHOO.util && YAHOO.util.Easing) ? YAHOO.util.Easing.BounceIn : 'false')
+            });
+            /**
+            * @attribute animate
+            * @description Use animation to collapse/expand the unit
+            * @type Boolean
+            */
+            this.setAttributeConfig('animate', {
+                value: ((attr.animate === false) ? false : true),
+                validator: function() {
+                    var anim = false;
+                    if (YAHOO.util.Anim) {
+                        anim = true;
+                    }
+                    return anim;
+                },
+                method: function(anim) {
+                    if (anim) {
+                        this._anim = new YAHOO.util.Anim(this.get('element'), {}, this.get('duration'), this.get('easing'));
+                    } else {
+                        this._anim = false;
+                    }
+                }
+            });
+            /**
+            * @attribute header
+            * @description The text to use as the Header of the Unit
+            */
+            this.setAttributeConfig('header', {
+                value: attr.header || false,
+                method: function(txt) {
+                    if (txt === false) {
+                        //Remove the footer
+                        if (this.header) {
+                            Dom.addClass(this.body, 'yui-layout-bd-nohd');
+                            this.header.parentNode.removeChild(this.header);
+                            this.header = null;
+                        }
+                    } else {
+                        if (!this.header) {
+                            var header = this.getElementsByClassName('yui-layout-hd', 'div')[0];
+                            if (!header) {
+                                header = this._createHeader();
+                            }
+                            this.header = header;
+                        }
+                        var h = this.header.getElementsByTagName('h2')[0];
+                        if (!h) {
+                            h = document.createElement('h2');
+                            this.header.appendChild(h);
+                        }
+                        h.innerHTML = txt;
+                        if (this.body) {
+                            Dom.removeClass(this.body, 'yui-layout-bd-nohd');
+                        }
+                    }
+                    this.fireEvent('contentChange', { target: 'header' });
+                }
+            });
+            /**
+            * @attribute proxy
+            * @description Use the proxy config setting for the Resize Utility
+            * @type Boolean
+            */
+            this.setAttributeConfig('proxy', {
+                writeOnce: true,
+                value: ((attr.proxy === false) ? false : true)
+            });
+            /**
+            * @attribute body
+            * @description The content for the body. If we find an element in the page with an id that matches the passed option we will move that element into the body of this unit.
+            */
+            this.setAttributeConfig('body', {
+                value: attr.body || false,
+                method: function(content) {
+                    if (!this.body) {
+                        var body = this.getElementsByClassName('yui-layout-bd', 'div')[0];
+                        if (body) {
+                            this.body = body;
+                        } else {
+                            body = document.createElement('div');
+                            body.className = 'yui-layout-bd';
+                            this.body = body;
+                            this.get('wrap').appendChild(body);
+                        }
+                    }
+                    if (!this.header) {
+                        Dom.addClass(this.body, 'yui-layout-bd-nohd');
+                    }
+                    Dom.addClass(this.body, 'yui-layout-bd-noft');
+
+
+                    var el = null;
+                    if (Lang.isString(content)) {
+                        el = Dom.get(content);
+                    } else if (content && content.tagName) {
+                        el = content;
+                    }
+                    if (el) {
+                        var id = Dom.generateId(el);
+                        LayoutUnit._instances[id] = this;
+                        this.body.appendChild(el);
+                    } else {
+                        this.body.innerHTML = content;
+                    }
+
+                    this._cleanGrids();
+
+                    this.fireEvent('contentChange', { target: 'body' });
+                }
+            });
+
+            /**
+            * @attribute footer
+            * @description The content for the footer. If we find an element in the page with an id that matches the passed option we will move that element into the footer of this unit.
+            */
+            this.setAttributeConfig('footer', {
+                value: attr.footer || false,
+                method: function(content) {
+                    if (content === false) {
+                        //Remove the footer
+                        if (this.footer) {
+                            Dom.addClass(this.body, 'yui-layout-bd-noft');
+                            this.footer.parentNode.removeChild(this.footer);
+                            this.footer = null;
+                        }
+                    } else {
+                        if (!this.footer) {
+                            var ft = this.getElementsByClassName('yui-layout-ft', 'div')[0];
+                            if (!ft) {
+                                ft = document.createElement('div');
+                                ft.className = 'yui-layout-ft';
+                                this.footer = ft;
+                                this.get('wrap').appendChild(ft);
+                            } else {
+                                this.footer = ft;
+                            }
+                        }
+                        var el = null;
+                        if (Lang.isString(content)) {
+                            el = Dom.get(content);
+                        } else if (content && content.tagName) {
+                            el = content;
+                        }
+                        if (el) {
+                            this.footer.appendChild(el);
+                        } else {
+                            this.footer.innerHTML = content;
+                        }
+                        Dom.removeClass(this.body, 'yui-layout-bd-noft');
+                    }
+                    this.fireEvent('contentChange', { target: 'footer' });
+                }
+            });
+            /**
+            * @attribute close
+            * @description Adds a close icon to the unit
+            */
+            this.setAttributeConfig('close', {
+                value: attr.close || false,
+                method: function(close) {
+                    //Position Center doesn't get this
+                    if (this.get('position') == 'center') {
+                        YAHOO.log('Position center unit cannot have close', 'error', 'LayoutUnit');
+                        return false;
+                    }
+                    if (!this.header) {
+                        this._createHeader();
+                    }
+                    var c = Dom.getElementsByClassName('close', 'div', this.header)[0];
+                    if (close) {
+                        if (!c) {
+                            c = document.createElement('div');
+                            c.className = 'close';
+                            this.header.appendChild(c);
+                            Event.on(c, 'click', this.close, this, true);
+                        }
+                        c.title = this.STR_CLOSE;
+                    } else if (c) {
+                        Event.purgeElement(c);
+                        c.parentNode.removeChild(c);
+                    }
+                    this._configs.close.value = close;
+                    this.set('collapse', this.get('collapse')); //Reset so we get the right classnames
+                }
+            });
+
+            /**
+            * @attribute collapse
+            * @description Adds a collapse icon to the unit
+            */
+            this.setAttributeConfig('collapse', {
+                value: attr.collapse || false,
+                method: function(collapse) {
+                    //Position Center doesn't get this
+                    if (this.get('position') == 'center') {
+                        YAHOO.log('Position center unit cannot have collapse', 'error', 'LayoutUnit');
+                        return false;
+                    }
+                    if (!this.header) {
+                        this._createHeader();
+                    }
+                    var c = Dom.getElementsByClassName('collapse', 'div', this.header)[0];
+                    if (collapse) {
+                        if (!c) {
+                            c = document.createElement('div');
+                            this.header.appendChild(c);
+                            Event.on(c, 'click', this.collapse, this, true);
+                        }
+                        c.title = this.STR_COLLAPSE;
+                        c.className = 'collapse' + ((this.get('close')) ? ' collapse-close' : '');
+                    } else if (c) {
+                        Event.purgeElement(c);
+                        c.parentNode.removeChild(c);
+                    }
+                }
+            });
+            /**
+            * @attribute scroll
+            * @description Adds a class to the unit to allow for overflow: auto, default is overflow: hidden
+            */
+
+            this.setAttributeConfig('scroll', {
+                value: attr.scroll || false,
+                method: function(scroll) {
+                    if (scroll) {
+                        this.addClass('yui-layout-scroll');
+                    } else {
+                        this.removeClass('yui-layout-scroll');
+                    }
+                }
+            });
+            /**
+            * @attribute hover
+            * @description Config option to pass to the Resize Utility
+            */
+            this.setAttributeConfig('hover', {
+                writeOnce: true,
+                value: attr.hover || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @attribute resize
+            * @description Should a Resize instance be added to this unit
+            */
+
+            this.setAttributeConfig('resize', {
+                value: attr.resize || false,
+                validator: function(r) {
+                    if (YAHOO.util && YAHOO.util.Resize) {
+                        return true;
+                    }
+                    return false;
+                },
+                method: function(resize) {
+                    if (resize && !this._resize) {
+                        //Position Center doesn't get this
+                        if (this.get('position') == 'center') {
+                            YAHOO.log('Position center unit cannot have resize', 'error', 'LayoutUnit');
+                            return false;
+                        }
+                        var handle = false; //To catch center
+                        switch (this.get('position')) {
+                            case 'top':
+                                handle = 'b';
+                                break;
+                            case 'bottom':
+                                handle = 't';
+                                break;
+                            case 'right':
+                                handle = 'l';
+                                break;
+                            case 'left':
+                                handle = 'r';
+                                break;
+                        }
+
+                        this.setStyle('position', 'absolute'); //Make sure Resize get's a position
+                        
+                        if (handle) {
+                            this._resize = new YAHOO.util.Resize(this.get('element'), {
+                                proxy: this.get('proxy'),
+                                hover: this.get('hover'),
+                                status: false,
+                                autoRatio: false,
+                                handles: [handle],
+                                minWidth: this.get('minWidth'),
+                                maxWidth: this.get('maxWidth'),
+                                minHeight: this.get('minHeight'),
+                                maxHeight: this.get('maxHeight'),
+                                height: this.get('height'),
+                                width: this.get('width'),
+                                setSize: false
+                            });
+                            
+                            this._resize._handles[handle].innerHTML = '<div class="yui-layout-resize-knob"></div>';
+
+                            if (this.get('proxy')) {
+                                var proxy = this._resize.getProxyEl();
+                                proxy.innerHTML = '<div class="yui-layout-handle-' + handle + '"></div>';
+                            }
+                            this._resize.on('startResize', function(ev) {
+                                this._lastScroll = this.get('scroll');
+                                this.set('scroll', false);
+                                if (this.get('parent')) {
+                                    this.get('parent').fireEvent('startResize');
+                                }
+                                this.fireEvent('startResize');
+                            }, this, true);
+                            this._resize.on('resize', function(ev) {
+                                this.set('height', ev.height);
+                                this.set('width', ev.width);
+                                this.set('scroll', this._lastScroll);
+                            }, this, true);
+                        }
+                    } else {
+                        if (this._resize) {
+                            this._resize.destroy();
+                        }
+                    }
+                }
+            });
+        },
+        /**
+        * @private
+        * @method _cleanGrids
+        * @description This method attempts to clean up the first level of the YUI CSS Grids, YAHOO.util.Selector is required for this operation.
+        */
+        _cleanGrids: function() {
+            if (this.get('grids')) {
+                var b = Sel.query('div.yui-b', this.body, true);
+                if (b) {
+                    Dom.removeClass(b, 'yui-b');
+                }
+                Event.onAvailable('yui-main', function() {
+                    Dom.setStyle(Sel.query('#yui-main'), 'margin-left', '0');
+                    Dom.setStyle(Sel.query('#yui-main'), 'margin-right', '0');
+                });
+            }
+        },
+        /**
+        * @private
+        * @method _createHeader
+        * @description Creates the HTMLElement for the header
+        * @return {HTMLElement} The new HTMLElement
+        */
+        _createHeader: function() {
+            var header = document.createElement('div');
+            header.className = 'yui-layout-hd';
+            if (this.get('firstChild')) {
+                this.get('wrap').insertBefore(header, this.get('wrap').firstChild);
+            } else {
+                this.get('wrap').appendChild(header);
+            }
+            this.header = header;
+            return header;
+        },
+        /**
+        * @method destroy
+        * @description Removes this unit from the parent and cleans up after itself.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The parent Layout instance
+        */
+        destroy: function() {
+            if (this._resize) {
+                this._resize.destroy();
+            }
+            var par = this.get('parent');
+
+            this.setStyle('display', 'none');
+            par.removeUnit(this);
+            if (this._clip) {
+                this._clip.parentNode.removeChild(this._clip);
+                this._clip = null;
+            }
+
+            Event.purgeElement(this.get('element'));
+            this.get('parentNode').removeChild(this.get('element'));
+
+            delete YAHOO.widget.LayoutUnit._instances[this.get('id')];
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                    delete this[i];
+                }
+            }
+        
+            return par;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the LayoutUnit.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'LayoutUnit #' + this.get('id') + ' (' + this.get('position') + ')';
+            }
+            return 'LayoutUnit';
+        }
+    /**
+    * @event resize
+    * @description Fired when this.resize is called
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event startResize
+    * @description Fired when the Resize Utility fires it's startResize Event.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event beforeResize
+    * @description Firef at the beginning of the resize method. If you return false, the resize is cancelled.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event contentChange
+    * @description Fired when the content in the header, body or footer is changed via the API
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event close
+    * @description Fired when the unit is closed
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event collapse
+    * @description Fired when the unit is collapsed
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event expand
+    * @description Fired when the unit is exanded
+    * @type YAHOO.util.CustomEvent
+    */
+    });
+
+    YAHOO.widget.LayoutUnit = LayoutUnit;
+})();
+YAHOO.register("layout", YAHOO.widget.Layout, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/layout/layout-beta-min.js b/lib/yui/layout/layout-beta-min.js
new file mode 100644 (file)
index 0000000..0749e9e
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;var B=function(F,E){if(D.isObject(F)&&!F.tagName){E=F;F=null;}if(D.isString(F)){if(C.get(F)){F=C.get(F);}}if(!F){F=document.body;}var G={element:F,attributes:E||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getLayoutById=function(E){if(B._instances[E]){return B._instances[E];}return false;};YAHOO.extend(B,YAHOO.util.Element,{browser:function(){var E=YAHOO.env.ua;E.standardsMode=false;E.secure=false;return E;}(),_rendered:null,_zIndex:null,_sizes:null,_setBodySize:function(G){var F=0,E=0;G=((G===false)?false:true);if(this._isBody){F=C.getClientHeight();E=C.getClientWidth();}else{F=parseInt(this.getStyle("height"),10);E=parseInt(this.getStyle("width"),10);if(isNaN(E)){E=this.get("element").clientWidth;}if(isNaN(F)){F=this.get("element").clientHeight;}}if(this.get("minWidth")){if(E<this.get("minWidth")){E=this.get("minWidth");}}if(this.get("minHeight")){if(F<this.get("minHeight")){F=this.get("minHeight");}}if(G){C.setStyle(this._doc,"height",F+"px");C.setStyle(this._doc,"width",E+"px");}this._sizes.doc={h:F,w:E};this._setSides(G);},_setSides:function(J){var H=((this._top)?this._top.get("height"):0),G=((this._bottom)?this._bottom.get("height"):0),I=this._sizes.doc.h,E=this._sizes.doc.w;J=((J===false)?false:true);this._sizes.top={h:H,w:((this._top)?E:0),t:0};this._sizes.bottom={h:G,w:((this._bottom)?E:0)};var F=(I-(H+G));this._sizes.left={h:F,w:((this._left)?this._left.get("width"):0)};this._sizes.right={h:F,w:((this._right)?this._right.get("width"):0),l:((this._right)?(E-this._right.get("width")):0),t:this._sizes.top.h};if(this._right&&J){if(this._top){this._right.set("top",this._sizes.right.t);}if(!this._right._collapsing){this._right.set("left",this._sizes.right.l);}this._right.set("height",this._sizes.right.h,true);}if(this._left){if(this._top){this._sizes.left.t=this._sizes.top.h;this._sizes.left.l=0;if(J){this._left.set("top",this._sizes.top.h);this._left.set("left",0);}}if(J){this._left.set("height",this._sizes.left.h,true);}}if(this._bottom){this._sizes.bottom.t=this._sizes.top.h+this._sizes.left.h;if(J){this._bottom.set("top",this._sizes.bottom.t);this._bottom.set("width",this._sizes.bottom.w,true);}}if(this._top){if(J){this._top.set("width",this._sizes.top.w,true);}}this._setCenter(J);},_setCenter:function(G){G=((G===false)?false:true);var F=this._sizes.left.h;var E=(this._sizes.doc.w-(this._sizes.left.w+this._sizes.right.w));if(G){this._center.set("height",F,true);this._center.set("width",E,true);this._center.set("top",this._sizes.top.h);this._center.set("left",this._sizes.left.w);}this._sizes.center={h:F,w:E,t:this._sizes.top.h,l:this._sizes.left.w};},getSizes:function(){return this._sizes;},getUnitById:function(E){return YAHOO.widget.LayoutUnit.getLayoutUnitById(E);},getUnitByPosition:function(E){if(E){E=E.toLowerCase();if(this["_"+E]){return this["_"+E];}}return false;},removeUnit:function(E){this["_"+E.get("position")]=null;this.resize();},addUnit:function(G){if(!G.position){return false;}if(this["_"+G.position]){return false;}var H=null,J=null;if(G.id){if(C.get(G.id)){H=C.get(G.id);delete G.id;}}if(G.element){H=G.element;}if(!J){J=document.createElement("div");var L=C.generateId();J.id=L;}if(!H){H=document.createElement("div");}C.addClass(H,"yui-layout-wrap");if(this.browser.ie&&!this.browser.standardsMode){J.style.zoom=1;H.style.zoom=1;}if(J.firstChild){J.insertBefore(H,J.firstChild);}else{J.appendChild(H);}this._doc.appendChild(J);var I=false,F=false;if(G.height){I=parseInt(G.height,10);}if(G.width){F=parseInt(G.width,10);}var E={};YAHOO.lang.augmentObject(E,G);E.parent=this;E.wrap=H;E.height=I;E.width=F;var K=new YAHOO.widget.LayoutUnit(J,E);K.on("heightChange",this.resize,this,true);K.on("widthChange",this.resize,this,true);K.on("gutterChange",this.resize,this,true);this["_"+G.position]=K;if(this._rendered){this.resize();}return K;},_createUnits:function(){var E=this.get("units");for(var F in E){if(D.hasOwnProperty(E,F)){this.addUnit(E[F]);}}},resize:function(F){F=((F===false)?false:true);if(F){var E=this.fireEvent("beforeResize");if(E===false){F=false;}if(this.browser.ie){if(this._isBody){C.removeClass(document.documentElement,"yui-layout");C.addClass(document.documentElement,"yui-layout");}else{this.removeClass("yui-layout");this.addClass("yui-layout");}}}this._setBodySize(F);if(F){this.fireEvent("resize",{target:this,sizes:this._sizes});}return this;},_setupBodyElements:function(){this._doc=C.get("doc");if(!this._doc){this._doc=document.createElement("div");this._doc.id="layout-doc";if(document.body.firstChild){document.body.insertBefore(this._doc,document.body.firstChild);}else{document.body.appendChild(this._doc);}}this._createUnits();this._setBodySize();A.on(window,"resize",this.resize,this,true);C.addClass(this._doc,"yui-layout-doc");},_setupElements:function(){this._doc=this.getElementsByClassName("doc")[0];if(!this._doc){this._doc=document.createElement("div");this.get("element").appendChild(this._doc);}this._createUnits();this._setBodySize();A.on(window,"resize",this.resize,this,true);C.addClass(this._doc,"yui-layout-doc");},_isBody:null,_doc:null,_left:null,_right:null,_top:null,_bottom:null,_center:null,init:function(F,E){this._zIndex=0;B.superclass.init.call(this,F,E);if(this.get("parent")){this._zIndex=this.get("parent")._zIndex+10;}this._sizes={};var G=F;if(!D.isString(G)){G=C.generateId(G);}B._instances[G]=this;},render:function(){this._stamp();var E=this.get("element");if(E&&E.tagName&&(E.tagName.toLowerCase()=="body")){this._isBody=true;C.addClass(document.body,"yui-layout");if(C.hasClass(document.body,"yui-skin-sam")){C.addClass(document.documentElement,"yui-skin-sam");C.removeClass(document.body,"yui-skin-sam");}this._setupBodyElements();}else{this._isBody=false;this.addClass("yui-layout");this._setupElements();}this.resize();this._rendered=true;this.fireEvent("render");return this;},_stamp:function(){if(document.compatMode=="CSS1Compat"){this.browser.standardsMode=true;
+}if(window.location.href.toLowerCase().indexOf("https")===0){C.addClass(document.documentElement,"secure");this.browser.secure=true;}},initAttributes:function(E){B.superclass.initAttributes.call(this,E);this.setAttributeConfig("units",{writeOnce:true,validator:YAHOO.lang.isArray,value:E.units||[]});this.setAttributeConfig("minHeight",{value:E.minHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minWidth",{value:E.minWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("height",{value:E.height||false,validator:YAHOO.lang.isNumber,method:function(F){this.setStyle("height",F+"px");}});this.setAttributeConfig("width",{value:E.width||false,validator:YAHOO.lang.isNumber,method:function(F){this.setStyle("width",F+"px");}});this.setAttributeConfig("parent",{writeOnce:true,value:E.parent||false,method:function(F){if(F){F.on("resize",this.resize,this,true);}}});},toString:function(){if(this.get){return"Layout #"+this.get("id");}return"Layout";}});YAHOO.widget.Layout=B;})();(function(){var D=YAHOO.util.Dom,C=YAHOO.util.Selector,A=YAHOO.util.Event,E=YAHOO.lang;var B=function(G,F){var H={element:G,attributes:F||{}};B.superclass.constructor.call(this,H.element,H.attributes);};B._instances={};B.getLayoutUnitById=function(F){if(B._instances[F]){return B._instances[F];}return false;};YAHOO.extend(B,YAHOO.util.Element,{STR_CLOSE:"Click to close this pane.",STR_COLLAPSE:"Click to collapse this pane.",STR_EXPAND:"Click to expand this pane.",browser:null,_sizes:null,_anim:null,_resize:null,_clip:null,_gutter:null,header:null,body:null,footer:null,_collapsed:null,_collapsing:null,_lastWidth:null,_lastHeight:null,_lastTop:null,_lastLeft:null,_lastScroll:null,resize:function(F){var G=this.fireEvent("beforeResize");if(G===false){return this;}if(!this._collapsing||(F===true)){var N=this.get("scroll");this.set("scroll",false);var K=this._getBoxSize(this.header),J=this._getBoxSize(this.footer),L=[this.get("height"),this.get("width")];var H=(L[0]-K[0]-J[0])-(this._gutter.top+this._gutter.bottom),M=L[1]-(this._gutter.left+this._gutter.right);var O=(H+(K[0]+J[0])),I=M;if(this._collapsed&&!this._collapsing){this._setHeight(this._clip,O);this._setWidth(this._clip,I);D.setStyle(this._clip,"top",this.get("top")+this._gutter.top+"px");D.setStyle(this._clip,"left",this.get("left")+this._gutter.left+"px");}else{if(!this._collapsed||(this._collapsed&&this._collapsing)){O=this._setHeight(this.get("wrap"),O);I=this._setWidth(this.get("wrap"),I);this._sizes.wrap.h=O;this._sizes.wrap.w=I;D.setStyle(this.get("wrap"),"top",this._gutter.top+"px");D.setStyle(this.get("wrap"),"left",this._gutter.left+"px");this._sizes.header.w=this._setWidth(this.header,I);this._sizes.header.h=K[0];this._sizes.footer.w=this._setWidth(this.footer,I);this._sizes.footer.h=J[0];D.setStyle(this.footer,"bottom","0px");this._sizes.body.h=this._setHeight(this.body,(O-(K[0]+J[0])));this._sizes.body.w=this._setWidth(this.body,I);D.setStyle(this.body,"top",K[0]+"px");this.set("scroll",N);this.fireEvent("resize");}}}return this;},_setWidth:function(H,G){if(H){var F=this._getBorderSizes(H);G=(G-(F[1]+F[3]));G=this._fixQuirks(H,G,"w");D.setStyle(H,"width",G+"px");}return G;},_setHeight:function(H,G){if(H){var F=this._getBorderSizes(H);G=(G-(F[0]+F[2]));G=this._fixQuirks(H,G,"h");D.setStyle(H,"height",G+"px");}return G;},_fixQuirks:function(I,L,G){var K=0,H=2;if(G=="w"){K=1;H=3;}if(this.browser.ie&&!this.browser.standardsMode){var F=this._getBorderSizes(I),J=this._getBorderSizes(I.parentNode);if((F[K]===0)&&(F[H]===0)){if((J[K]!==0)&&(J[H]!==0)){L=(L-(J[K]+J[H]));}}else{if((J[K]===0)&&(J[H]===0)){L=(L+(F[K]+F[H]));}}}return L;},_getBoxSize:function(H){var G=[0,0];if(H){if(this.browser.ie&&!this.browser.standardsMode){H.style.zoom=1;}var F=this._getBorderSizes(H);G[0]=H.clientHeight+(F[0]+F[2]);G[1]=H.clientWidth+(F[1]+F[3]);}return G;},_getBorderSizes:function(H){var G=[];H=H||this.get("element");if(this.browser.ie&&!this.browser.standardsMode){H.style.zoom=1;}G[0]=parseInt(D.getStyle(H,"borderTopWidth"),10);G[1]=parseInt(D.getStyle(H,"borderRightWidth"),10);G[2]=parseInt(D.getStyle(H,"borderBottomWidth"),10);G[3]=parseInt(D.getStyle(H,"borderLeftWidth"),10);for(var F=0;F<G.length;F++){if(isNaN(G[F])){G[F]=0;}}return G;},_createClip:function(){if(!this._clip){this._clip=document.createElement("div");this._clip.className="yui-layout-clip yui-layout-clip-"+this.get("position");this._clip.innerHTML="<div class=\"collapse\"></div>";var F=this._clip.firstChild;F.title=this.STR_EXPAND;A.on(F,"click",this.expand,this,true);this.get("element").parentNode.appendChild(this._clip);}},_toggleClip:function(){if(!this._collapsed){var J=this._getBoxSize(this.header),K=this._getBoxSize(this.footer),I=[this.get("height"),this.get("width")];var H=(I[0]-J[0]-K[0])-(this._gutter.top+this._gutter.bottom),F=I[1]-(this._gutter.left+this._gutter.right),G=(H+(J[0]+K[0]));switch(this.get("position")){case"top":case"bottom":this._setWidth(this._clip,F);this._setHeight(this._clip,this.get("collapseSize"));D.setStyle(this._clip,"left",(this._lastLeft+this._gutter.left)+"px");if(this.get("position")=="bottom"){D.setStyle(this._clip,"top",((this._lastTop+this._lastHeight)-(this.get("collapseSize")-this._gutter.top))+"px");}else{D.setStyle(this._clip,"top",this.get("top")+this._gutter.top+"px");}break;case"left":case"right":this._setWidth(this._clip,this.get("collapseSize"));this._setHeight(this._clip,G);D.setStyle(this._clip,"top",(this.get("top")+this._gutter.top)+"px");if(this.get("position")=="right"){D.setStyle(this._clip,"left",(((this._lastLeft+this._lastWidth)-this.get("collapseSize"))-this._gutter.left)+"px");}else{D.setStyle(this._clip,"left",(this.get("left")+this._gutter.left)+"px");}break;}D.setStyle(this._clip,"display","block");this.setStyle("display","none");}else{D.setStyle(this._clip,"display","none");}},getSizes:function(){return this._sizes;},toggle:function(){if(this._collapsed){this.expand();}else{this.collapse();}return this;},expand:function(){if(!this.get("collapse")){return this;
+}if(!this._collapsed){return this;}this._collapsing=true;this.setStyle("zIndex",this.get("parent")._zIndex+1);if(this._anim){this.setStyle("display","none");var F={},H;switch(this.get("position")){case"left":case"right":this.set("width",this._lastWidth,true);this.setStyle("width",this._lastWidth+"px");this.get("parent").resize(false);H=this.get("parent").getSizes()[this.get("position")];this.set("height",H.h,true);var K=H.l;F={left:{to:K}};if(this.get("position")=="left"){F.left.from=(K-H.w);this.setStyle("left",(K-H.w)+"px");}break;case"top":case"bottom":this.set("height",this._lastHeight,true);this.setStyle("height",this._lastHeight+"px");this.get("parent").resize(false);H=this.get("parent").getSizes()[this.get("position")];this.set("width",H.w,true);var J=H.t;F={top:{to:J}};if(this.get("position")=="top"){this.setStyle("top",(J-H.h)+"px");F.top.from=(J-H.h);}break;}this._anim.attributes=F;var I=function(){this.setStyle("display","block");this.resize(true);this._anim.onStart.unsubscribe(I,this,true);};var G=function(){this._collapsing=false;this.setStyle("zIndex",this.get("parent")._zIndex);this.set("width",this._lastWidth);this.set("height",this._lastHeight);this._collapsed=false;this.resize();this.set("scroll",this._lastScroll);this._anim.onComplete.unsubscribe(G,this,true);this.fireEvent("expand");};this._anim.onStart.subscribe(I,this,true);this._anim.onComplete.subscribe(G,this,true);this._anim.animate();this._toggleClip();}else{this._collapsing=false;this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this.setStyle("display","block");this.set("width",this._lastWidth);this.set("height",this._lastHeight);this._collapsed=false;this.resize();this.set("scroll",this._lastScroll);this.fireEvent("expand");}return this;},collapse:function(){if(!this.get("collapse")){return this;}if(this._collapsed){return this;}if(!this._clip){this._createClip();}this._collapsing=true;var G=this.get("width"),H=this.get("height"),F={};this._lastWidth=G;this._lastHeight=H;this._lastScroll=this.get("scroll");this.set("scroll",false,true);this._lastLeft=parseInt(this.get("element").style.left,10);this._lastTop=parseInt(this.get("element").style.top,10);if(isNaN(this._lastTop)){this._lastTop=0;this.set("top",0);}if(isNaN(this._lastLeft)){this._lastLeft=0;this.set("left",0);}this.setStyle("zIndex",this.get("parent")._zIndex+1);var J=this.get("position");switch(J){case"top":case"bottom":this.set("height",(this.get("collapseSize")+(this._gutter.top+this._gutter.bottom)));F={top:{to:(this.get("top")-H)}};if(J=="bottom"){F.top.to=(this.get("top")+H);}break;case"left":case"right":this.set("width",(this.get("collapseSize")+(this._gutter.left+this._gutter.right)));F={left:{to:-(this._lastWidth)}};if(J=="right"){F.left={to:(this.get("left")+G)};}break;}if(this._anim){this._anim.attributes=F;var I=function(){this._collapsing=false;this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this._collapsed=true;this.get("parent").resize();this._anim.onComplete.unsubscribe(I,this,true);this.fireEvent("collapse");};this._anim.onComplete.subscribe(I,this,true);this._anim.animate();}else{this._collapsing=false;this.setStyle("display","none");this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this.get("parent").resize();this._collapsed=true;this.fireEvent("collapse");}return this;},close:function(){this.setStyle("display","none");this.get("parent").removeUnit(this);this.fireEvent("close");if(this._clip){this._clip.parentNode.removeChild(this._clip);this._clip=null;}return this.get("parent");},init:function(H,G){this._gutter={left:0,right:0,top:0,bottom:0};this._sizes={wrap:{h:0,w:0},header:{h:0,w:0},body:{h:0,w:0},footer:{h:0,w:0}};B.superclass.init.call(this,H,G);this.browser=this.get("parent").browser;var K=H;if(!E.isString(K)){K=D.generateId(K);}B._instances[K]=this;this.setStyle("position","absolute");this.addClass("yui-layout-unit");this.addClass("yui-layout-unit-"+this.get("position"));var J=this.getElementsByClassName("yui-layout-hd","div")[0];if(J){this.header=J;}var F=this.getElementsByClassName("yui-layout-bd","div")[0];if(F){this.body=F;}var I=this.getElementsByClassName("yui-layout-ft","div")[0];if(I){this.footer=I;}this.on("contentChange",this.resize,this,true);this.set("animate",this.get("animate"));},initAttributes:function(F){B.superclass.initAttributes.call(this,F);this.setAttributeConfig("wrap",{value:F.wrap||null,method:function(G){if(G){var H=D.generateId(G);B._instances[H]=this;}}});this.setAttributeConfig("grids",{value:F.grids||false});this.setAttributeConfig("top",{value:F.top||0,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("top",G+"px");}}});this.setAttributeConfig("left",{value:F.left||0,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("left",G+"px");}}});this.setAttributeConfig("minWidth",{value:F.minWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:F.maxWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:F.minHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:F.maxHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("height",{value:F.height,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("height",G+"px");}}});this.setAttributeConfig("width",{value:F.width,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("width",G+"px");}}});this.setAttributeConfig("position",{value:F.position});this.setAttributeConfig("gutter",{value:F.gutter||0,validator:YAHOO.lang.isString,method:function(H){var G=H.split(" ");if(G.length){this._gutter.top=parseInt(G[0],10);if(G[1]){this._gutter.right=parseInt(G[1],10);}else{this._gutter.right=this._gutter.top;}if(G[2]){this._gutter.bottom=parseInt(G[2],10);}else{this._gutter.bottom=this._gutter.top;}if(G[3]){this._gutter.left=parseInt(G[3],10);}else{if(G[1]){this._gutter.left=this._gutter.right;}else{this._gutter.left=this._gutter.top;
+}}}}});this.setAttributeConfig("parent",{writeOnce:true,value:F.parent||false,method:function(G){if(G){G.on("resize",this.resize,this,true);}}});this.setAttributeConfig("collapseSize",{value:F.collapseSize||25,validator:YAHOO.lang.isNumber});this.setAttributeConfig("duration",{value:F.duration||0.5});this.setAttributeConfig("easing",{value:F.easing||((YAHOO.util&&YAHOO.util.Easing)?YAHOO.util.Easing.BounceIn:"false")});this.setAttributeConfig("animate",{value:((F.animate===false)?false:true),validator:function(){var G=false;if(YAHOO.util.Anim){G=true;}return G;},method:function(G){if(G){this._anim=new YAHOO.util.Anim(this.get("element"),{},this.get("duration"),this.get("easing"));}else{this._anim=false;}}});this.setAttributeConfig("header",{value:F.header||false,method:function(G){if(G===false){if(this.header){D.addClass(this.body,"yui-layout-bd-nohd");this.header.parentNode.removeChild(this.header);this.header=null;}}else{if(!this.header){var I=this.getElementsByClassName("yui-layout-hd","div")[0];if(!I){I=this._createHeader();}this.header=I;}var H=this.header.getElementsByTagName("h2")[0];if(!H){H=document.createElement("h2");this.header.appendChild(H);}H.innerHTML=G;if(this.body){D.removeClass(this.body,"yui-layout-bd-nohd");}}this.fireEvent("contentChange",{target:"header"});}});this.setAttributeConfig("proxy",{writeOnce:true,value:((F.proxy===false)?false:true)});this.setAttributeConfig("body",{value:F.body||false,method:function(I){if(!this.body){var G=this.getElementsByClassName("yui-layout-bd","div")[0];if(G){this.body=G;}else{G=document.createElement("div");G.className="yui-layout-bd";this.body=G;this.get("wrap").appendChild(G);}}if(!this.header){D.addClass(this.body,"yui-layout-bd-nohd");}D.addClass(this.body,"yui-layout-bd-noft");var H=null;if(E.isString(I)){H=D.get(I);}else{if(I&&I.tagName){H=I;}}if(H){var J=D.generateId(H);B._instances[J]=this;this.body.appendChild(H);}else{this.body.innerHTML=I;}this._cleanGrids();this.fireEvent("contentChange",{target:"body"});}});this.setAttributeConfig("footer",{value:F.footer||false,method:function(H){if(H===false){if(this.footer){D.addClass(this.body,"yui-layout-bd-noft");this.footer.parentNode.removeChild(this.footer);this.footer=null;}}else{if(!this.footer){var I=this.getElementsByClassName("yui-layout-ft","div")[0];if(!I){I=document.createElement("div");I.className="yui-layout-ft";this.footer=I;this.get("wrap").appendChild(I);}else{this.footer=I;}}var G=null;if(E.isString(H)){G=D.get(H);}else{if(H&&H.tagName){G=H;}}if(G){this.footer.appendChild(G);}else{this.footer.innerHTML=H;}D.removeClass(this.body,"yui-layout-bd-noft");}this.fireEvent("contentChange",{target:"footer"});}});this.setAttributeConfig("close",{value:F.close||false,method:function(G){if(this.get("position")=="center"){return false;}if(!this.header){this._createHeader();}var H=D.getElementsByClassName("close","div",this.header)[0];if(G){if(!H){H=document.createElement("div");H.className="close";this.header.appendChild(H);A.on(H,"click",this.close,this,true);}H.title=this.STR_CLOSE;}else{if(H){A.purgeElement(H);H.parentNode.removeChild(H);}}this._configs.close.value=G;this.set("collapse",this.get("collapse"));}});this.setAttributeConfig("collapse",{value:F.collapse||false,method:function(G){if(this.get("position")=="center"){return false;}if(!this.header){this._createHeader();}var H=D.getElementsByClassName("collapse","div",this.header)[0];if(G){if(!H){H=document.createElement("div");this.header.appendChild(H);A.on(H,"click",this.collapse,this,true);}H.title=this.STR_COLLAPSE;H.className="collapse"+((this.get("close"))?" collapse-close":"");}else{if(H){A.purgeElement(H);H.parentNode.removeChild(H);}}}});this.setAttributeConfig("scroll",{value:F.scroll||false,method:function(G){if(G){this.addClass("yui-layout-scroll");}else{this.removeClass("yui-layout-scroll");}}});this.setAttributeConfig("hover",{writeOnce:true,value:F.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("resize",{value:F.resize||false,validator:function(G){if(YAHOO.util&&YAHOO.util.Resize){return true;}return false;},method:function(G){if(G&&!this._resize){if(this.get("position")=="center"){return false;}var I=false;switch(this.get("position")){case"top":I="b";break;case"bottom":I="t";break;case"right":I="l";break;case"left":I="r";break;}this.setStyle("position","absolute");if(I){this._resize=new YAHOO.util.Resize(this.get("element"),{proxy:this.get("proxy"),hover:this.get("hover"),status:false,autoRatio:false,handles:[I],minWidth:this.get("minWidth"),maxWidth:this.get("maxWidth"),minHeight:this.get("minHeight"),maxHeight:this.get("maxHeight"),height:this.get("height"),width:this.get("width"),setSize:false});this._resize._handles[I].innerHTML="<div class=\"yui-layout-resize-knob\"></div>";if(this.get("proxy")){var H=this._resize.getProxyEl();H.innerHTML="<div class=\"yui-layout-handle-"+I+"\"></div>";}this._resize.on("startResize",function(J){this._lastScroll=this.get("scroll");this.set("scroll",false);if(this.get("parent")){this.get("parent").fireEvent("startResize");}this.fireEvent("startResize");},this,true);this._resize.on("resize",function(J){this.set("height",J.height);this.set("width",J.width);this.set("scroll",this._lastScroll);},this,true);}}else{if(this._resize){this._resize.destroy();}}}});},_cleanGrids:function(){if(this.get("grids")){var F=C.query("div.yui-b",this.body,true);if(F){D.removeClass(F,"yui-b");}A.onAvailable("yui-main",function(){D.setStyle(C.query("#yui-main"),"margin-left","0");D.setStyle(C.query("#yui-main"),"margin-right","0");});}},_createHeader:function(){var F=document.createElement("div");F.className="yui-layout-hd";if(this.get("firstChild")){this.get("wrap").insertBefore(F,this.get("wrap").firstChild);}else{this.get("wrap").appendChild(F);}this.header=F;return F;},destroy:function(){if(this._resize){this._resize.destroy();}var G=this.get("parent");this.setStyle("display","none");G.removeUnit(this);if(this._clip){this._clip.parentNode.removeChild(this._clip);
+this._clip=null;}A.purgeElement(this.get("element"));this.get("parentNode").removeChild(this.get("element"));delete YAHOO.widget.LayoutUnit._instances[this.get("id")];for(var F in this){if(E.hasOwnProperty(this,F)){this[F]=null;delete this[F];}}return G;},toString:function(){if(this.get){return"LayoutUnit #"+this.get("id")+" ("+this.get("position")+")";}return"LayoutUnit";}});YAHOO.widget.LayoutUnit=B;})();YAHOO.register("layout",YAHOO.widget.Layout,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/layout/layout-beta.js b/lib/yui/layout/layout-beta.js
new file mode 100644 (file)
index 0000000..126f1e3
--- /dev/null
@@ -0,0 +1,1994 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ * @module layout
+ * @beta
+ */
+(function() {
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class Layout
+     * @extends YAHOO.util.Element
+     * @description <p>Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.</p>
+     * @param {String/HTMLElement} el The element to make contain a layout.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var Layout = function(el, config) {
+        if (Lang.isObject(el) && !el.tagName) {
+            config = el;
+            el = null;
+        }
+        if (Lang.isString(el)) {
+            if (Dom.get(el)) {
+                el = Dom.get(el);
+            }
+        }
+        if (!el) {
+            el = document.body;
+        }
+
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Layout.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all layout instances
+    * @type Object
+    */ 
+    Layout._instances = {};
+    /**
+    * @static
+    * @method getLayoutById 
+    * @description Get's a layout object by the HTML id of the element associated with the Layout object.
+    * @return {Object} The Layout Object
+    */ 
+    Layout.getLayoutById = function(id) {
+        if (Layout._instances[id]) {
+            return Layout._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(Layout, YAHOO.util.Element, {
+        /**
+        * @property browser
+        * @description A modified version of the YAHOO.env.ua object
+        * @type Object
+        */
+        browser: function() {
+            var b = YAHOO.env.ua;
+            b.standardsMode = false;
+            b.secure = false;
+            return b;
+        }(),
+        /**
+        * @private
+        * @property _rendered
+        * @description Set to true when the layout is rendered
+        * @type Boolean
+        */
+        _rendered: null,
+        /**
+        * @private
+        * @property _zIndex
+        * @description The zIndex to set all LayoutUnits to
+        * @type Number
+        */
+        _zIndex: null,
+        /**
+        * @private
+        * @property _sizes
+        * @description A collection of the current sizes of all usable LayoutUnits to be used for calculations
+        * @type Object
+        */
+        _sizes: null,
+        /**
+        * @private
+        * @method _setBodySize
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the body size of the layout, sets the height and width of the parent container
+        */
+        _setBodySize: function(set) {
+            var h = 0, w = 0;
+            set = ((set === false) ? false : true);
+
+            if (this._isBody) {
+                h = Dom.getClientHeight();
+                w = Dom.getClientWidth();
+            } else {
+                h = parseInt(this.getStyle('height'), 10);
+                w = parseInt(this.getStyle('width'), 10);
+                if (isNaN(w)) {
+                    w = this.get('element').clientWidth;
+                }
+                if (isNaN(h)) {
+                    h = this.get('element').clientHeight;
+                }
+            }
+            if (this.get('minWidth')) {
+                if (w < this.get('minWidth')) {
+                    w = this.get('minWidth');
+                }
+            }
+            if (this.get('minHeight')) {
+                if (h < this.get('minHeight')) {
+                    h = this.get('minHeight');
+                }
+            }
+            if (set) {
+                Dom.setStyle(this._doc, 'height', h + 'px');
+                Dom.setStyle(this._doc, 'width', w + 'px');
+            }
+            this._sizes.doc = { h: h, w: w };
+            this._setSides(set);
+        },
+        /**
+        * @private
+        * @method _setSides
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the size and position of the left, right, top and bottom units
+        */
+        _setSides: function(set) {
+            var h1 = ((this._top) ? this._top.get('height') : 0),
+                h2 = ((this._bottom) ? this._bottom.get('height') : 0),
+                h = this._sizes.doc.h,
+                w = this._sizes.doc.w;
+            set = ((set === false) ? false : true);
+
+            this._sizes.top = {
+                h: h1, w: ((this._top) ? w : 0),
+                t: 0
+            };
+            this._sizes.bottom = {
+                h: h2, w: ((this._bottom) ? w : 0)
+            };
+            
+            var newH = (h - (h1 + h2));
+
+            this._sizes.left = {
+                h: newH, w: ((this._left) ? this._left.get('width') : 0)
+            };
+            this._sizes.right = {
+                h: newH, w: ((this._right) ? this._right.get('width') : 0),
+                l: ((this._right) ? (w - this._right.get('width')) : 0),
+                t: this._sizes.top.h
+            };
+            
+            if (this._right && set) {
+                if (this._top) {
+                    this._right.set('top', this._sizes.right.t);
+                }
+                if (!this._right._collapsing) { 
+                    this._right.set('left', this._sizes.right.l);
+                }
+                this._right.set('height', this._sizes.right.h, true);
+            }
+            if (this._left) {
+                if (this._top) {
+                    this._sizes.left.t = this._sizes.top.h;
+                    this._sizes.left.l = 0;
+                    if (set) {
+                        this._left.set('top', this._sizes.top.h);
+                        this._left.set('left', 0);
+                    }
+                }
+                if (set) {
+                    this._left.set('height', this._sizes.left.h, true);
+                }
+            }
+            if (this._bottom) {
+                this._sizes.bottom.t = this._sizes.top.h + this._sizes.left.h;
+                if (set) {
+                    this._bottom.set('top', this._sizes.bottom.t);
+                    this._bottom.set('width', this._sizes.bottom.w, true);
+                }
+            }
+            if (this._top) {
+                if (set) {
+                    this._top.set('width', this._sizes.top.w, true);
+                }
+            }
+            this._setCenter(set);
+        },
+        /**
+        * @private
+        * @method _setCenter
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Used to set the size and position of the center unit
+        */
+        _setCenter: function(set) {
+            set = ((set === false) ? false : true);
+            var h = this._sizes.left.h;
+            var w = (this._sizes.doc.w - (this._sizes.left.w + this._sizes.right.w));
+            if (set) {
+                this._center.set('height', h, true);
+                this._center.set('width', w, true);
+                this._center.set('top', this._sizes.top.h);
+                this._center.set('left', this._sizes.left.w);
+            }
+            this._sizes.center = { h: h, w: w, t: this._sizes.top.h, l: this._sizes.left.w };
+        },
+        /**
+        * @method getSizes
+        * @description Get a reference to the internal Layout Unit sizes
+        * @return {Object} An object of the layout unit sizes
+        */
+        getSizes: function() {
+            return this._sizes;
+        },
+        /**
+        * @method getUnitById
+        * @param {String} id The HTML element id of the unit
+        * @description Get the LayoutUnit by it's HTML id
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        getUnitById: function(id) {
+            return YAHOO.widget.LayoutUnit.getLayoutUnitById(id);
+        },
+        /**
+        * @method getUnitByPosition
+        * @param {String} pos The position of the unit in this layout
+        * @description Get the LayoutUnit by it's position in this layout
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        getUnitByPosition: function(pos) {
+            if (pos) {
+                pos = pos.toLowerCase();
+                if (this['_' + pos]) {
+                    return this['_' + pos];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method removeUnit
+        * @param {Object} unit The LayoutUnit that you want to remove
+        * @description Remove the unit from this layout and resize the layout.
+        */
+        removeUnit: function(unit) {
+            this['_' + unit.get('position')] = null;
+            this.resize();
+        },
+        /**
+        * @method addUnit
+        * @param {Object} cfg The config for the LayoutUnit that you want to add
+        * @description Add a unit to this layout and if the layout is rendered, resize the layout. 
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        addUnit: function(cfg) {
+            if (!cfg.position) {
+                return false;
+            }
+            if (this['_' + cfg.position]) {
+                return false;
+            }
+            var element = null,
+                el = null;
+
+            if (cfg.id) {
+                if (Dom.get(cfg.id)) {
+                    element = Dom.get(cfg.id);
+                    delete cfg.id;
+
+                }
+            }
+            if (cfg.element) {
+                element = cfg.element;
+            }
+
+            if (!el) {
+                el = document.createElement('div');
+                var id = Dom.generateId();
+                el.id = id;
+            }
+
+            if (!element) {
+                element = document.createElement('div');
+            }
+            Dom.addClass(element, 'yui-layout-wrap');
+            if (this.browser.ie && !this.browser.standardsMode) {
+                el.style.zoom = 1;
+                element.style.zoom = 1;
+            }
+
+            if (el.firstChild) {
+                el.insertBefore(element, el.firstChild);
+            } else {
+                el.appendChild(element);
+            }
+            this._doc.appendChild(el);
+
+            var h = false, w = false;
+
+            if (cfg.height) {
+                h = parseInt(cfg.height, 10);
+            }
+            if (cfg.width) {
+                w = parseInt(cfg.width, 10);
+            }
+            var unitConfig = {};
+            YAHOO.lang.augmentObject(unitConfig, cfg); // break obj ref
+
+            unitConfig.parent = this;
+            unitConfig.wrap = element;
+            unitConfig.height = h;
+            unitConfig.width = w;
+
+            var unit = new YAHOO.widget.LayoutUnit(el, unitConfig);
+
+            unit.on('heightChange', this.resize, this, true);
+            unit.on('widthChange', this.resize, this, true);
+            unit.on('gutterChange', this.resize, this, true);
+            this['_' + cfg.position] = unit;
+
+            if (this._rendered) {
+                this.resize();
+            }
+
+            return unit;
+        },
+        /**
+        * @private
+        * @method _createUnits
+        * @description Private method to create units from the config that was passed in.
+        */
+        _createUnits: function() {
+            var units = this.get('units');
+            for (var i in units) {
+                if (Lang.hasOwnProperty(units, i)) {
+                    this.addUnit(units[i]);
+                }
+            }
+        },
+        /**
+        * @method resize
+        * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
+        * @description Starts the chain of resize routines that will resize all the units.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The Layout instance
+        */
+        resize: function(set) {
+            set = ((set === false) ? false : true);
+            if (set) {
+                var retVal = this.fireEvent('beforeResize');
+                if (retVal === false) {
+                    set = false;
+                }
+                if (this.browser.ie) {
+                    if (this._isBody) {
+                        Dom.removeClass(document.documentElement, 'yui-layout');
+                        Dom.addClass(document.documentElement, 'yui-layout');
+                    } else {
+                        this.removeClass('yui-layout');
+                        this.addClass('yui-layout');
+                    }
+                }
+            }
+            this._setBodySize(set);
+            if (set) {
+                this.fireEvent('resize', { target: this, sizes: this._sizes });
+            }
+            return this;
+        },
+        /**
+        * @private
+        * @method _setupBodyElements
+        * @description Sets up the main doc element when using the body as the main element.
+        */
+        _setupBodyElements: function() {
+            this._doc = Dom.get('doc');
+            if (!this._doc) {
+                this._doc = document.createElement('div');
+                this._doc.id = 'layout-doc';
+                if (document.body.firstChild) {
+                    document.body.insertBefore(this._doc, document.body.firstChild);
+                } else {
+                    document.body.appendChild(this._doc);
+                }
+            }
+            this._createUnits();
+            this._setBodySize();
+            Event.on(window, 'resize', this.resize, this, true);
+            Dom.addClass(this._doc, 'yui-layout-doc');
+        },
+        /**
+        * @private
+        * @method _setupElements
+        * @description Sets up the main doc element when not using the body as the main element.
+        */
+        _setupElements: function() {
+            this._doc = this.getElementsByClassName('doc')[0];
+            if (!this._doc) {
+                this._doc = document.createElement('div');
+                this.get('element').appendChild(this._doc);
+            }
+            this._createUnits();
+            this._setBodySize();
+            Event.on(window, 'resize', this.resize, this, true);
+            Dom.addClass(this._doc, 'yui-layout-doc');
+        },
+        /**
+        * @private
+        * @property _isBody
+        * @description Flag to determine if we are using the body as the root element.
+        * @type Boolean
+        */
+        _isBody: null,
+        /**
+        * @private
+        * @property _doc
+        * @description Reference to the root element
+        * @type HTMLElement
+        */
+        _doc: null,
+        /**
+        * @private
+        * @property _left
+        * @description Reference to the left LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _left: null,
+        /**
+        * @private
+        * @property _right
+        * @description Reference to the right LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _right: null,
+        /**
+        * @private
+        * @property _top
+        * @description Reference to the top LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _top: null,
+        /**
+        * @private
+        * @property _bottom
+        * @description Reference to the bottom LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _bottom: null,
+        /**
+        * @private
+        * @property _center
+        * @description Reference to the center LayoutUnit Object
+        * @type {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} A LayoutUnit instance
+        */
+        _center: null,
+        /**
+        * @private
+        * @method init
+        * @description The Layout class' initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            this._zIndex = 0;
+            Layout.superclass.init.call(this, p_oElement, p_oAttributes);
+            
+            if (this.get('parent')) {
+                this._zIndex = this.get('parent')._zIndex + 10;
+            }
+
+            this._sizes = {};
+
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = Dom.generateId(id);
+            }
+            Layout._instances[id] = this;
+        },
+        /**
+        * @method render
+        * @description This method starts the render process, applying classnames and creating elements
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The Layout instance
+        */        
+        render: function() {
+            this._stamp();
+            var el = this.get('element');
+            if (el && el.tagName && (el.tagName.toLowerCase() == 'body')) {
+                this._isBody = true;
+                Dom.addClass(document.body, 'yui-layout');
+                if (Dom.hasClass(document.body, 'yui-skin-sam')) {
+                    //Move the class up so we can have a css chain
+                    Dom.addClass(document.documentElement, 'yui-skin-sam');
+                    Dom.removeClass(document.body, 'yui-skin-sam');
+                }
+                this._setupBodyElements();
+            } else {
+                this._isBody = false;
+                this.addClass('yui-layout');
+                this._setupElements();
+            }
+            this.resize();
+            this._rendered = true;
+            this.fireEvent('render');
+
+            return this;
+        },
+        /**
+        * @private
+        * @method _stamp
+        * @description Stamps the root node with a secure classname for ease of use. Also sets the this.browser.standardsMode variable.
+        */        
+        _stamp: function() {
+            if (document.compatMode == 'CSS1Compat') {
+                this.browser.standardsMode = true;
+            }
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+                Dom.addClass(document.documentElement, 'secure');
+                this.browser.secure = true;
+            }
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Processes the config
+        */        
+        initAttributes: function(attr) {
+            Layout.superclass.initAttributes.call(this, attr);
+            /**
+            * @attribute units
+            * @description An array of config definitions for the LayoutUnits to add to this layout
+            * @type Array
+            */
+            this.setAttributeConfig('units', {
+                writeOnce: true,
+                validator: YAHOO.lang.isArray,
+                value: attr.units || []
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minimum height in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minimum width in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute height
+            * @description The height in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || false,
+                validator: YAHOO.lang.isNumber,
+                method: function(h) {
+                    this.setStyle('height', h + 'px');
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width in pixels
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width || false,
+                validator: YAHOO.lang.isNumber,
+                method: function(w) {
+                    this.setStyle('width', w + 'px');
+                }
+            });
+
+            /**
+            * @attribute parent
+            * @description If this layout is to be used as a child of another Layout instance, this config will bind the resize events together.
+            * @type Object YAHOO.widget.Layout
+            */
+            this.setAttributeConfig('parent', {
+                writeOnce: true,
+                value: attr.parent || false,
+                method: function(p) {
+                    if (p) {
+                        p.on('resize', this.resize, this, true);
+                    }
+                }
+            });
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the Layout.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'Layout #' + this.get('id');
+            }
+            return 'Layout';
+        }
+    });
+    /**
+    * @event resize
+    * @description Fired when this.resize is called
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event startResize
+    * @description Fired when the Resize Utility for a Unit fires it's startResize Event.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event beforeResize
+    * @description Firef at the beginning of the resize method. If you return false, the resize is cancelled.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event render
+    * @description Fired after the render method completes.
+    * @type YAHOO.util.CustomEvent
+    */
+
+    YAHOO.widget.Layout = Layout;
+})();
+/**
+ * @description <p>Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, layout
+ * @optional animation, dragdrop, selector
+ * @beta
+ */
+(function() {
+    var Dom = YAHOO.util.Dom,
+        Sel = YAHOO.util.Selector,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class LayoutUnit
+     * @extends YAHOO.util.Element
+     * @description <p>Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.</p>
+     * @param {String/HTMLElement} el The element to make a unit.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var LayoutUnit = function(el, config) {
+        
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        LayoutUnit.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all layout unit instances
+    * @type Object
+    */ 
+    LayoutUnit._instances = {};
+    /**
+    * @static
+    * @method getLayoutUnitById 
+    * @description Get's a layout unit object by the HTML id of the element associated with the Layout Unit object.
+    * @return {Object} The Layout Object
+    */ 
+    LayoutUnit.getLayoutUnitById = function(id) {
+        if (LayoutUnit._instances[id]) {
+            return LayoutUnit._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(LayoutUnit, YAHOO.util.Element, {
+        /**
+        * @property STR_CLOSE
+        * @description String used for close button title
+        * @type {String}
+        */
+        STR_CLOSE: 'Click to close this pane.',
+        /**
+        * @property STR_COLLAPSE
+        * @description String used for collapse button title
+        * @type {String}
+        */
+        STR_COLLAPSE: 'Click to collapse this pane.',
+        /**
+        * @property STR_EXPAND
+        * @description String used for expand button title
+        * @type {String}
+        */
+        STR_EXPAND: 'Click to expand this pane.',
+        /**
+        * @property browser
+        * @description A modified version of the YAHOO.env.ua object
+        * @type Object
+        */
+        browser: null,
+        /**
+        * @private
+        * @property _sizes
+        * @description A collection of the current sizes of the contents of this Layout Unit
+        * @type Object
+        */
+        _sizes: null,
+        /**
+        * @private
+        * @property _anim
+        * @description A reference to the Animation instance used by this LayouUnit
+        * @type YAHOO.util.Anim
+        */
+        _anim: null,
+        /**
+        * @private
+        * @property _resize
+        * @description A reference to the Resize instance used by this LayoutUnit
+        * @type YAHOO.util.Resize
+        */
+        _resize: null,
+        /**
+        * @private
+        * @property _clip
+        * @description A reference to the clip element used when collapsing the unit
+        * @type HTMLElement
+        */
+        _clip: null,
+        /**
+        * @private
+        * @property _gutter
+        * @description A simple hash table used to store the gutter to apply to the Unit
+        * @type Object
+        */
+        _gutter: null,
+        /**
+        * @property header
+        * @description A reference to the HTML element used for the Header
+        * @type HTMLELement
+        */
+        header: null,
+        /**
+        * @property body
+        * @description A reference to the HTML element used for the body
+        * @type HTMLElement
+        */
+        body: null,
+        /**
+        * @property footer
+        * @description A reference to the HTML element used for the footer
+        * @type HTMLElement
+        */
+        footer: null,
+        /**
+        * @private
+        * @property _collapsed
+        * @description Flag to determine if the unit is collapsed or not.
+        * @type Boolean
+        */
+        _collapsed: null,
+        /**
+        * @private
+        * @property _collapsing
+        * @description A flag set while the unit is being collapsed, used so we don't fire events while animating the size
+        * @type Boolean
+        */
+        _collapsing: null,
+        /**
+        * @private
+        * @property _lastWidth
+        * @description A holder for the last known width of the unit
+        * @type Number
+        */
+        _lastWidth: null,
+        /**
+        * @private
+        * @property _lastHeight
+        * @description A holder for the last known height of the unit
+        * @type Number
+        */
+        _lastHeight: null,
+        /**
+        * @private
+        * @property _lastTop
+        * @description A holder for the last known top of the unit
+        * @type Number
+        */
+        _lastTop: null,
+        /**
+        * @private
+        * @property _lastLeft
+        * @description A holder for the last known left of the unit
+        * @type Number
+        */
+        _lastLeft: null,
+        /**
+        * @private
+        * @property _lastScroll
+        * @description A holder for the last known scroll state of the unit
+        * @type Boolean
+        */
+        _lastScroll: null,
+        /**
+        * @method resize
+        * @description Resize either the unit or it's clipped state, also updating the box inside
+        * @param {Boolean} force This will force full calculations even when the unit is collapsed
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        resize: function(force) {
+            var retVal = this.fireEvent('beforeResize');
+            if (retVal === false) {
+                return this;
+            }
+            if (!this._collapsing || (force === true)) {
+                var scroll = this.get('scroll');
+                this.set('scroll', false);
+
+
+                var hd = this._getBoxSize(this.header),
+                    ft = this._getBoxSize(this.footer),
+                    box = [this.get('height'), this.get('width')];
+
+
+                var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom),
+                    nw = box[1] - (this._gutter.left + this._gutter.right);
+
+                var wrapH = (nh + (hd[0] + ft[0])),
+                    wrapW = nw;
+
+                if (this._collapsed && !this._collapsing) {
+                    this._setHeight(this._clip, wrapH);
+                    this._setWidth(this._clip, wrapW);
+                    Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px');
+                    Dom.setStyle(this._clip, 'left', this.get('left') + this._gutter.left + 'px');
+                } else if (!this._collapsed || (this._collapsed && this._collapsing)) {
+                    wrapH = this._setHeight(this.get('wrap'), wrapH);
+                    wrapW = this._setWidth(this.get('wrap'), wrapW);
+                    this._sizes.wrap.h = wrapH;
+                    this._sizes.wrap.w = wrapW;
+
+                    Dom.setStyle(this.get('wrap'), 'top', this._gutter.top + 'px');
+                    Dom.setStyle(this.get('wrap'), 'left', this._gutter.left + 'px');
+
+                    this._sizes.header.w = this._setWidth(this.header, wrapW);
+                    this._sizes.header.h = hd[0];
+
+                    this._sizes.footer.w = this._setWidth(this.footer, wrapW);
+                    this._sizes.footer.h = ft[0];
+
+                    Dom.setStyle(this.footer, 'bottom', '0px');
+
+                    this._sizes.body.h = this._setHeight(this.body, (wrapH - (hd[0] + ft[0])));
+                    this._sizes.body.w =this._setWidth(this.body, wrapW);
+                    Dom.setStyle(this.body, 'top', hd[0] + 'px');
+
+                    this.set('scroll', scroll);
+                    this.fireEvent('resize');
+                }
+            }
+            return this;
+        },
+        /**
+        * @private
+        * @method _setWidth
+        * @description Sets the width of the element based on the border size of the element.
+        * @param {HTMLElement} el The HTMLElement to have it's width set
+        * @param {Number} w The width that you want it the element set to
+        * @return {Number} The new width, fixed for borders and IE QuirksMode
+        */
+        _setWidth: function(el, w) {
+            if (el) {
+                var b = this._getBorderSizes(el);
+                w = (w - (b[1] + b[3]));
+                w = this._fixQuirks(el, w, 'w');
+                Dom.setStyle(el, 'width', w + 'px');
+            }
+            return w;
+        },
+        /**
+        * @private
+        * @method _setHeight
+        * @description Sets the height of the element based on the border size of the element.
+        * @param {HTMLElement} el The HTMLElement to have it's height set
+        * @param {Number} h The height that you want it the element set to
+        * @return {Number} The new height, fixed for borders and IE QuirksMode
+        */
+        _setHeight: function(el, h) {
+            if (el) {
+                var b = this._getBorderSizes(el);
+                h = (h - (b[0] + b[2]));
+                h = this._fixQuirks(el, h, 'h');
+                Dom.setStyle(el, 'height', h + 'px');
+            }
+            return h;
+        },
+        /**
+        * @private
+        * @method _fixQuirks
+        * @description Fixes the box calculations for IE in QuirksMode
+        * @param {HTMLElement} el The HTMLElement to set the dimension on
+        * @param {Number} dim The number of the dimension to fix
+        * @param {String} side The dimension (h or w) to fix. Defaults to h
+        * @return {Number} The fixed dimension
+        */
+        _fixQuirks: function(el, dim, side) {
+            var i1 = 0, i2 = 2;
+            if (side == 'w') {
+                i1 = 1;
+                i2 = 3;
+            }
+            if (this.browser.ie && !this.browser.standardsMode) {
+                //Internet Explorer - Quirks Mode
+                var b = this._getBorderSizes(el),
+                    bp = this._getBorderSizes(el.parentNode);
+                if ((b[i1] === 0) && (b[i2] === 0)) { //No Borders, check parent
+                    if ((bp[i1] !== 0) && (bp[i2] !== 0)) { //Parent has Borders
+                        dim = (dim - (bp[i1] + bp[i2]));
+                    }
+                } else {
+                    if ((bp[i1] === 0) && (bp[i2] === 0)) {
+                        dim = (dim + (b[i1] + b[i2]));
+                    }
+                }
+            }
+            return dim;
+        },
+        /**
+        * @private
+        * @method _getBoxSize
+        * @description Get's the elements clientHeight and clientWidth plus the size of the borders
+        * @param {HTMLElement} el The HTMLElement to get the size of
+        * @return {Array} An array of height and width
+        */
+        _getBoxSize: function(el) {
+            var size = [0, 0];
+            if (el) {
+                if (this.browser.ie && !this.browser.standardsMode) {
+                    el.style.zoom = 1;
+                }
+                var b = this._getBorderSizes(el);
+                size[0] = el.clientHeight + (b[0] + b[2]);
+                size[1] = el.clientWidth + (b[1] + b[3]);
+            }
+            return size;
+        },
+        /**
+        * @private
+        * @method _getBorderSizes
+        * @description Get the CSS border size of the element passed.
+        * @param {HTMLElement} el The element to get the border size of
+        * @return {Array} An array of the top, right, bottom, left borders.
+        */
+        _getBorderSizes: function(el) {
+            var s = [];
+            el = el || this.get('element');
+            if (this.browser.ie && !this.browser.standardsMode) {
+                el.style.zoom = 1;
+            }
+            s[0] = parseInt(Dom.getStyle(el, 'borderTopWidth'), 10);
+            s[1] = parseInt(Dom.getStyle(el, 'borderRightWidth'), 10);
+            s[2] = parseInt(Dom.getStyle(el, 'borderBottomWidth'), 10);
+            s[3] = parseInt(Dom.getStyle(el, 'borderLeftWidth'), 10);
+            
+            //IE will return NaN on these if they are set to auto, we'll set them to 0
+            for (var i = 0; i < s.length; i++) {
+                if (isNaN(s[i])) {
+                    s[i] = 0;
+                }
+            }
+            return s;
+        },
+        /**
+        * @private
+        * @method _createClip
+        * @description Create the clip element used when the Unit is collapsed
+        */
+        _createClip: function() {
+            if (!this._clip) {
+                this._clip = document.createElement('div');
+                this._clip.className = 'yui-layout-clip yui-layout-clip-' + this.get('position');
+                this._clip.innerHTML = '<div class="collapse"></div>';
+                var c = this._clip.firstChild;
+                c.title = this.STR_EXPAND;
+                Event.on(c, 'click', this.expand, this, true);
+                this.get('element').parentNode.appendChild(this._clip);
+            }
+        },
+        /**
+        * @private
+        * @method _toggleClip
+        * @description Toggle th current state of the Clip element and set it's height, width and position
+        */
+        _toggleClip: function() {
+            if (!this._collapsed) {
+                //show
+                var hd = this._getBoxSize(this.header),
+                    ft = this._getBoxSize(this.footer),
+                    box = [this.get('height'), this.get('width')];
+
+
+                var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom),
+                    nw = box[1] - (this._gutter.left + this._gutter.right),
+                    wrapH = (nh + (hd[0] + ft[0]));
+
+                switch (this.get('position')) {
+                    case 'top':
+                    case 'bottom':
+                        this._setWidth(this._clip, nw);
+                        this._setHeight(this._clip, this.get('collapseSize'));
+                        Dom.setStyle(this._clip, 'left', (this._lastLeft + this._gutter.left) + 'px');
+                        if (this.get('position') == 'bottom') {
+                            Dom.setStyle(this._clip, 'top', ((this._lastTop + this._lastHeight) - (this.get('collapseSize') - this._gutter.top)) + 'px');
+                        } else {
+                            Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px');
+                        }
+                        break;
+                    case 'left':
+                    case 'right':
+                        this._setWidth(this._clip, this.get('collapseSize'));
+                        this._setHeight(this._clip, wrapH);
+                        Dom.setStyle(this._clip, 'top', (this.get('top') + this._gutter.top) + 'px');
+                        if (this.get('position') == 'right') {
+                            Dom.setStyle(this._clip, 'left', (((this._lastLeft + this._lastWidth) - this.get('collapseSize')) - this._gutter.left) + 'px');
+                        } else {
+                            Dom.setStyle(this._clip, 'left', (this.get('left') + this._gutter.left) + 'px');
+                        }
+                        break;
+                }
+
+                Dom.setStyle(this._clip, 'display', 'block');
+                this.setStyle('display', 'none');
+            } else {
+                //Hide
+                Dom.setStyle(this._clip, 'display', 'none');
+            }
+        },
+        /**
+        * @method getSizes
+        * @description Get a reference to the internal sizes object
+        * @return {Object} An object of the sizes used for calculations
+        */
+        getSizes: function() {
+            return this._sizes;
+        },
+        /**
+        * @method toggle
+        * @description Toggles the Unit, replacing it with a clipped version.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        toggle: function() {
+            if (this._collapsed) {
+                this.expand();
+            } else {
+                this.collapse();
+            }
+            return this;
+        },
+        /**
+        * @method expand
+        * @description Expand the Unit if it is collapsed.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        expand: function() {
+            if (!this.get('collapse')) {
+                return this;
+            }
+            if (!this._collapsed) {
+                return this;
+            }
+
+            this._collapsing = true;
+            this.setStyle('zIndex', this.get('parent')._zIndex + 1);
+
+            if (this._anim) {
+                this.setStyle('display', 'none');
+                //Animation Fails Here
+                var attr = {}, s;
+
+                switch (this.get('position')) {
+                    case 'left':
+                    case 'right':
+                        this.set('width', this._lastWidth, true);
+                        this.setStyle('width', this._lastWidth + 'px');
+                        this.get('parent').resize(false);
+                        s = this.get('parent').getSizes()[this.get('position')];
+                        this.set('height', s.h, true);
+                        var left = s.l;
+                        attr = {
+                            left: {
+                                to: left
+                            }
+                        };
+                        if (this.get('position') == 'left') {
+                            attr.left.from = (left - s.w);
+                            this.setStyle('left', (left - s.w) + 'px');
+                        }
+                        break;
+                    case 'top':
+                    case 'bottom':
+                        this.set('height', this._lastHeight, true);
+                        this.setStyle('height', this._lastHeight + 'px');
+                        this.get('parent').resize(false);
+                        s = this.get('parent').getSizes()[this.get('position')];
+                        this.set('width', s.w, true);
+                        var top = s.t;
+                        attr = {
+                            top: {
+                                to: top
+                            }
+                        };
+                        if (this.get('position') == 'top') {
+                            this.setStyle('top',  (top - s.h) + 'px');
+                            attr.top.from = (top - s.h);
+                        }
+                        break;
+                }
+
+                this._anim.attributes = attr;
+                var exStart = function() {
+                    this.setStyle('display', 'block');
+                    this.resize(true);
+                    this._anim.onStart.unsubscribe(exStart, this, true);
+                };
+                var expand = function() {
+                    this._collapsing = false;
+                    this.setStyle('zIndex', this.get('parent')._zIndex);
+                    this.set('width', this._lastWidth);
+                    this.set('height', this._lastHeight);
+                    this._collapsed = false;
+                    this.resize();
+                    this.set('scroll', this._lastScroll);
+                    this._anim.onComplete.unsubscribe(expand, this, true);
+                    this.fireEvent('expand');
+                };
+                this._anim.onStart.subscribe(exStart, this, true);
+                this._anim.onComplete.subscribe(expand, this, true);
+                this._anim.animate();
+                this._toggleClip();
+            } else {
+                this._collapsing = false;
+                this._toggleClip();
+                this.setStyle('zIndex', this.get('parent')._zIndex);
+                this.setStyle('display', 'block');
+                this.set('width', this._lastWidth);
+                this.set('height', this._lastHeight);
+                this._collapsed = false;
+                this.resize();
+                this.set('scroll', this._lastScroll);
+                this.fireEvent('expand');
+            }
+            return this;
+        },
+        /**
+        * @method collapse
+        * @description Collapse the Unit if it is not collapsed.
+        * @return {<a href="YAHOO.widget.LayoutUnit.html">YAHOO.widget.LayoutUnit</a>} The LayoutUnit instance
+        */
+        collapse: function() {
+            if (!this.get('collapse')) {
+                return this;
+            }
+            if (this._collapsed) {
+                return this;
+            }
+            if (!this._clip) {
+                this._createClip();
+            }
+            this._collapsing = true;
+            var w = this.get('width'),
+                h = this.get('height'),
+                attr = {};
+            this._lastWidth = w;
+            this._lastHeight = h;
+            this._lastScroll = this.get('scroll');
+            this.set('scroll', false, true);
+            this._lastLeft = parseInt(this.get('element').style.left, 10);
+            this._lastTop = parseInt(this.get('element').style.top, 10);
+            if (isNaN(this._lastTop)) {
+                this._lastTop = 0;
+                this.set('top', 0);
+            }
+            if (isNaN(this._lastLeft)) {
+                this._lastLeft = 0;
+                this.set('left', 0);
+            }
+            this.setStyle('zIndex', this.get('parent')._zIndex + 1);
+            var pos = this.get('position');
+
+            switch (pos) {
+                case 'top':
+                case 'bottom':
+                    this.set('height', (this.get('collapseSize') + (this._gutter.top + this._gutter.bottom)));
+                    attr = {
+                        top: {
+                            to: (this.get('top') - h)
+                        }
+                    };
+                    if (pos == 'bottom') {
+                        attr.top.to = (this.get('top') + h);
+                    }
+                    break;
+                case 'left':
+                case 'right':
+                    this.set('width', (this.get('collapseSize') + (this._gutter.left + this._gutter.right)));
+                    attr = {
+                        left: {
+                            to: -(this._lastWidth)
+                        }
+                    };
+                    if (pos == 'right') {
+                        attr.left = {
+                            to: (this.get('left') + w)
+                        };
+                    }
+                    break;
+            }
+            if (this._anim) {
+                this._anim.attributes = attr;
+                var collapse = function() {
+                    this._collapsing = false;
+                    this._toggleClip();
+                    this.setStyle('zIndex', this.get('parent')._zIndex);
+                    this._collapsed = true;
+                    this.get('parent').resize();
+                    this._anim.onComplete.unsubscribe(collapse, this, true);
+                    this.fireEvent('collapse');
+                };
+                this._anim.onComplete.subscribe(collapse, this, true);
+                this._anim.animate();
+            } else {
+                this._collapsing = false;
+                this.setStyle('display', 'none');
+                this._toggleClip();
+                this.setStyle('zIndex', this.get('parent')._zIndex);
+                this.get('parent').resize();
+                this._collapsed = true;
+                this.fireEvent('collapse');
+            }
+            return this;
+        },
+        /**
+        * @method close
+        * @description Close the unit, removing it from the parent Layout.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The parent Layout instance
+        */
+        close: function() {
+            this.setStyle('display', 'none');
+            this.get('parent').removeUnit(this);
+            this.fireEvent('close');
+            if (this._clip) {
+                this._clip.parentNode.removeChild(this._clip);
+                this._clip = null;
+            }
+            return this.get('parent');
+        },
+        /**
+        * @private
+        * @method init
+        * @description The initalization method inherited from Element.
+        */
+        init: function(p_oElement, p_oAttributes) {
+            this._gutter = {
+                left: 0,
+                right: 0,
+                top: 0,
+                bottom: 0
+            };
+            this._sizes = {
+                wrap: {
+                    h: 0,
+                    w: 0
+                },
+                header: {
+                    h: 0,
+                    w: 0
+                },
+                body: {
+                    h: 0,
+                    w: 0
+                },
+                footer: {
+                    h: 0,
+                    w: 0
+                }
+            };
+            
+            LayoutUnit.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.browser = this.get('parent').browser;
+            
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = Dom.generateId(id);
+            }
+            LayoutUnit._instances[id] = this;
+
+            this.setStyle('position', 'absolute');
+
+            this.addClass('yui-layout-unit');
+            this.addClass('yui-layout-unit-' + this.get('position'));
+
+
+            var header = this.getElementsByClassName('yui-layout-hd', 'div')[0];
+            if (header) {
+                this.header = header;
+            }
+            var body = this.getElementsByClassName('yui-layout-bd', 'div')[0];
+            if (body) {
+                this.body = body;
+            }
+            var footer = this.getElementsByClassName('yui-layout-ft', 'div')[0];
+            if (footer) {
+                this.footer = footer;
+            }
+
+            this.on('contentChange', this.resize, this, true);
+            
+            this.set('animate', this.get('animate'));
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Processes the config
+        */        
+        initAttributes: function(attr) {
+            LayoutUnit.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @private
+            * @attribute wrap
+            * @description A reference to the wrap element
+            * @type HTMLElement
+            */
+            this.setAttributeConfig('wrap', {
+                value: attr.wrap || null,
+                method: function(w) {
+                    if (w) {
+                        var id = Dom.generateId(w);
+                        LayoutUnit._instances[id] = this;
+                    }
+                }
+            });
+            /**
+            * @attribute grids
+            * @description Set this option to true if you want the LayoutUnit to fix the first layer of YUI CSS Grids (margins)
+            * @type Boolean
+            */
+            this.setAttributeConfig('grids', {
+                value: attr.grids || false
+            });
+            /**
+            * @private
+            * @attribute top
+            * @description The current top positioning of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('top', {
+                value: attr.top || 0,
+                validator: Lang.isNumber,
+                method: function(t) {
+                    if (!this._collapsing) {
+                        this.setStyle('top', t + 'px');
+                    }
+                }
+            });
+            /**
+            * @private
+            * @attribute left
+            * @description The current left position of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('left', {
+                value: attr.left || 0,
+                validator: Lang.isNumber,
+                method: function(l) {
+                    if (!this._collapsing) {
+                        this.setStyle('left', l + 'px');
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minWidth parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxWidth
+            * @description The maxWidth parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('maxWidth', {
+                value: attr.maxWidth || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minHeight parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxHeight
+            * @description The maxHeight parameter passed to the Resize Utility
+            * @type Number
+            */
+            this.setAttributeConfig('maxHeight', {
+                value: attr.maxHeight || false,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute height
+            * @description The height of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height,
+                validator: Lang.isNumber,
+                method: function(h) {
+                    if (!this._collapsing) {
+                        this.setStyle('height', h + 'px');
+                    }
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width of the Unit
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width,
+                validator: Lang.isNumber,
+                method: function(w) {
+                    if (!this._collapsing) {
+                        this.setStyle('width', w + 'px');
+                    }
+                }
+            });
+            /**
+            * @attribute position
+            * @description The position (top, right, bottom, left or center) of the Unit in the Layout
+            * @type {String}
+            */
+            this.setAttributeConfig('position', {
+                value: attr.position
+            });
+            /**
+            * @attribute gutter
+            * @description The gutter that we should apply to the parent Layout around this Unit. Supports standard CSS markup: (2 4 0 5) or (2) or (2 5)
+            * @type String
+            */
+            this.setAttributeConfig('gutter', {
+                value: attr.gutter || 0,
+                validator: YAHOO.lang.isString,
+                method: function(gutter) {
+                    var p = gutter.split(' ');
+                    if (p.length) {
+                        this._gutter.top = parseInt(p[0], 10);
+                        if (p[1]) {
+                            this._gutter.right = parseInt(p[1], 10);
+                        } else {
+                            this._gutter.right = this._gutter.top;
+                        }
+                        if (p[2]) {
+                            this._gutter.bottom = parseInt(p[2], 10);
+                        } else {
+                            this._gutter.bottom = this._gutter.top;
+                        }
+                        if (p[3]) {
+                            this._gutter.left = parseInt(p[3], 10);
+                        } else if (p[1]) {
+                            this._gutter.left = this._gutter.right;
+                        } else {
+                            this._gutter.left = this._gutter.top;
+                        }
+                    }
+                }
+            });
+            /**
+            * @attribute parent
+            * @description The parent Layout that we are assigned to
+            * @type {Object} YAHOO.widget.Layout
+            */
+            this.setAttributeConfig('parent', {
+                writeOnce: true,
+                value: attr.parent || false,
+                method: function(p) {
+                    if (p) {
+                        p.on('resize', this.resize, this, true);
+                    }
+
+                }
+            });
+            /**
+            * @attribute collapseSize
+            * @description The pixel size of the Clip that we will collapse to
+            * @type Number
+            */
+            this.setAttributeConfig('collapseSize', {
+                value: attr.collapseSize || 25,
+                validator: YAHOO.lang.isNumber
+            });
+            /**
+            * @attribute duration
+            * @description The duration to give the Animation Utility when animating the opening and closing of Units
+            */
+            this.setAttributeConfig('duration', {
+                value: attr.duration || 0.5
+            });
+            /**
+            * @attribute easing
+            * @description The Animation Easing to apply to the Animation instance for this unit.
+            */
+            this.setAttributeConfig('easing', {
+                value: attr.easing || ((YAHOO.util && YAHOO.util.Easing) ? YAHOO.util.Easing.BounceIn : 'false')
+            });
+            /**
+            * @attribute animate
+            * @description Use animation to collapse/expand the unit
+            * @type Boolean
+            */
+            this.setAttributeConfig('animate', {
+                value: ((attr.animate === false) ? false : true),
+                validator: function() {
+                    var anim = false;
+                    if (YAHOO.util.Anim) {
+                        anim = true;
+                    }
+                    return anim;
+                },
+                method: function(anim) {
+                    if (anim) {
+                        this._anim = new YAHOO.util.Anim(this.get('element'), {}, this.get('duration'), this.get('easing'));
+                    } else {
+                        this._anim = false;
+                    }
+                }
+            });
+            /**
+            * @attribute header
+            * @description The text to use as the Header of the Unit
+            */
+            this.setAttributeConfig('header', {
+                value: attr.header || false,
+                method: function(txt) {
+                    if (txt === false) {
+                        //Remove the footer
+                        if (this.header) {
+                            Dom.addClass(this.body, 'yui-layout-bd-nohd');
+                            this.header.parentNode.removeChild(this.header);
+                            this.header = null;
+                        }
+                    } else {
+                        if (!this.header) {
+                            var header = this.getElementsByClassName('yui-layout-hd', 'div')[0];
+                            if (!header) {
+                                header = this._createHeader();
+                            }
+                            this.header = header;
+                        }
+                        var h = this.header.getElementsByTagName('h2')[0];
+                        if (!h) {
+                            h = document.createElement('h2');
+                            this.header.appendChild(h);
+                        }
+                        h.innerHTML = txt;
+                        if (this.body) {
+                            Dom.removeClass(this.body, 'yui-layout-bd-nohd');
+                        }
+                    }
+                    this.fireEvent('contentChange', { target: 'header' });
+                }
+            });
+            /**
+            * @attribute proxy
+            * @description Use the proxy config setting for the Resize Utility
+            * @type Boolean
+            */
+            this.setAttributeConfig('proxy', {
+                writeOnce: true,
+                value: ((attr.proxy === false) ? false : true)
+            });
+            /**
+            * @attribute body
+            * @description The content for the body. If we find an element in the page with an id that matches the passed option we will move that element into the body of this unit.
+            */
+            this.setAttributeConfig('body', {
+                value: attr.body || false,
+                method: function(content) {
+                    if (!this.body) {
+                        var body = this.getElementsByClassName('yui-layout-bd', 'div')[0];
+                        if (body) {
+                            this.body = body;
+                        } else {
+                            body = document.createElement('div');
+                            body.className = 'yui-layout-bd';
+                            this.body = body;
+                            this.get('wrap').appendChild(body);
+                        }
+                    }
+                    if (!this.header) {
+                        Dom.addClass(this.body, 'yui-layout-bd-nohd');
+                    }
+                    Dom.addClass(this.body, 'yui-layout-bd-noft');
+
+
+                    var el = null;
+                    if (Lang.isString(content)) {
+                        el = Dom.get(content);
+                    } else if (content && content.tagName) {
+                        el = content;
+                    }
+                    if (el) {
+                        var id = Dom.generateId(el);
+                        LayoutUnit._instances[id] = this;
+                        this.body.appendChild(el);
+                    } else {
+                        this.body.innerHTML = content;
+                    }
+
+                    this._cleanGrids();
+
+                    this.fireEvent('contentChange', { target: 'body' });
+                }
+            });
+
+            /**
+            * @attribute footer
+            * @description The content for the footer. If we find an element in the page with an id that matches the passed option we will move that element into the footer of this unit.
+            */
+            this.setAttributeConfig('footer', {
+                value: attr.footer || false,
+                method: function(content) {
+                    if (content === false) {
+                        //Remove the footer
+                        if (this.footer) {
+                            Dom.addClass(this.body, 'yui-layout-bd-noft');
+                            this.footer.parentNode.removeChild(this.footer);
+                            this.footer = null;
+                        }
+                    } else {
+                        if (!this.footer) {
+                            var ft = this.getElementsByClassName('yui-layout-ft', 'div')[0];
+                            if (!ft) {
+                                ft = document.createElement('div');
+                                ft.className = 'yui-layout-ft';
+                                this.footer = ft;
+                                this.get('wrap').appendChild(ft);
+                            } else {
+                                this.footer = ft;
+                            }
+                        }
+                        var el = null;
+                        if (Lang.isString(content)) {
+                            el = Dom.get(content);
+                        } else if (content && content.tagName) {
+                            el = content;
+                        }
+                        if (el) {
+                            this.footer.appendChild(el);
+                        } else {
+                            this.footer.innerHTML = content;
+                        }
+                        Dom.removeClass(this.body, 'yui-layout-bd-noft');
+                    }
+                    this.fireEvent('contentChange', { target: 'footer' });
+                }
+            });
+            /**
+            * @attribute close
+            * @description Adds a close icon to the unit
+            */
+            this.setAttributeConfig('close', {
+                value: attr.close || false,
+                method: function(close) {
+                    //Position Center doesn't get this
+                    if (this.get('position') == 'center') {
+                        return false;
+                    }
+                    if (!this.header) {
+                        this._createHeader();
+                    }
+                    var c = Dom.getElementsByClassName('close', 'div', this.header)[0];
+                    if (close) {
+                        if (!c) {
+                            c = document.createElement('div');
+                            c.className = 'close';
+                            this.header.appendChild(c);
+                            Event.on(c, 'click', this.close, this, true);
+                        }
+                        c.title = this.STR_CLOSE;
+                    } else if (c) {
+                        Event.purgeElement(c);
+                        c.parentNode.removeChild(c);
+                    }
+                    this._configs.close.value = close;
+                    this.set('collapse', this.get('collapse')); //Reset so we get the right classnames
+                }
+            });
+
+            /**
+            * @attribute collapse
+            * @description Adds a collapse icon to the unit
+            */
+            this.setAttributeConfig('collapse', {
+                value: attr.collapse || false,
+                method: function(collapse) {
+                    //Position Center doesn't get this
+                    if (this.get('position') == 'center') {
+                        return false;
+                    }
+                    if (!this.header) {
+                        this._createHeader();
+                    }
+                    var c = Dom.getElementsByClassName('collapse', 'div', this.header)[0];
+                    if (collapse) {
+                        if (!c) {
+                            c = document.createElement('div');
+                            this.header.appendChild(c);
+                            Event.on(c, 'click', this.collapse, this, true);
+                        }
+                        c.title = this.STR_COLLAPSE;
+                        c.className = 'collapse' + ((this.get('close')) ? ' collapse-close' : '');
+                    } else if (c) {
+                        Event.purgeElement(c);
+                        c.parentNode.removeChild(c);
+                    }
+                }
+            });
+            /**
+            * @attribute scroll
+            * @description Adds a class to the unit to allow for overflow: auto, default is overflow: hidden
+            */
+
+            this.setAttributeConfig('scroll', {
+                value: attr.scroll || false,
+                method: function(scroll) {
+                    if (scroll) {
+                        this.addClass('yui-layout-scroll');
+                    } else {
+                        this.removeClass('yui-layout-scroll');
+                    }
+                }
+            });
+            /**
+            * @attribute hover
+            * @description Config option to pass to the Resize Utility
+            */
+            this.setAttributeConfig('hover', {
+                writeOnce: true,
+                value: attr.hover || false,
+                validator: YAHOO.lang.isBoolean
+            });
+            /**
+            * @attribute resize
+            * @description Should a Resize instance be added to this unit
+            */
+
+            this.setAttributeConfig('resize', {
+                value: attr.resize || false,
+                validator: function(r) {
+                    if (YAHOO.util && YAHOO.util.Resize) {
+                        return true;
+                    }
+                    return false;
+                },
+                method: function(resize) {
+                    if (resize && !this._resize) {
+                        //Position Center doesn't get this
+                        if (this.get('position') == 'center') {
+                            return false;
+                        }
+                        var handle = false; //To catch center
+                        switch (this.get('position')) {
+                            case 'top':
+                                handle = 'b';
+                                break;
+                            case 'bottom':
+                                handle = 't';
+                                break;
+                            case 'right':
+                                handle = 'l';
+                                break;
+                            case 'left':
+                                handle = 'r';
+                                break;
+                        }
+
+                        this.setStyle('position', 'absolute'); //Make sure Resize get's a position
+                        
+                        if (handle) {
+                            this._resize = new YAHOO.util.Resize(this.get('element'), {
+                                proxy: this.get('proxy'),
+                                hover: this.get('hover'),
+                                status: false,
+                                autoRatio: false,
+                                handles: [handle],
+                                minWidth: this.get('minWidth'),
+                                maxWidth: this.get('maxWidth'),
+                                minHeight: this.get('minHeight'),
+                                maxHeight: this.get('maxHeight'),
+                                height: this.get('height'),
+                                width: this.get('width'),
+                                setSize: false
+                            });
+                            
+                            this._resize._handles[handle].innerHTML = '<div class="yui-layout-resize-knob"></div>';
+
+                            if (this.get('proxy')) {
+                                var proxy = this._resize.getProxyEl();
+                                proxy.innerHTML = '<div class="yui-layout-handle-' + handle + '"></div>';
+                            }
+                            this._resize.on('startResize', function(ev) {
+                                this._lastScroll = this.get('scroll');
+                                this.set('scroll', false);
+                                if (this.get('parent')) {
+                                    this.get('parent').fireEvent('startResize');
+                                }
+                                this.fireEvent('startResize');
+                            }, this, true);
+                            this._resize.on('resize', function(ev) {
+                                this.set('height', ev.height);
+                                this.set('width', ev.width);
+                                this.set('scroll', this._lastScroll);
+                            }, this, true);
+                        }
+                    } else {
+                        if (this._resize) {
+                            this._resize.destroy();
+                        }
+                    }
+                }
+            });
+        },
+        /**
+        * @private
+        * @method _cleanGrids
+        * @description This method attempts to clean up the first level of the YUI CSS Grids, YAHOO.util.Selector is required for this operation.
+        */
+        _cleanGrids: function() {
+            if (this.get('grids')) {
+                var b = Sel.query('div.yui-b', this.body, true);
+                if (b) {
+                    Dom.removeClass(b, 'yui-b');
+                }
+                Event.onAvailable('yui-main', function() {
+                    Dom.setStyle(Sel.query('#yui-main'), 'margin-left', '0');
+                    Dom.setStyle(Sel.query('#yui-main'), 'margin-right', '0');
+                });
+            }
+        },
+        /**
+        * @private
+        * @method _createHeader
+        * @description Creates the HTMLElement for the header
+        * @return {HTMLElement} The new HTMLElement
+        */
+        _createHeader: function() {
+            var header = document.createElement('div');
+            header.className = 'yui-layout-hd';
+            if (this.get('firstChild')) {
+                this.get('wrap').insertBefore(header, this.get('wrap').firstChild);
+            } else {
+                this.get('wrap').appendChild(header);
+            }
+            this.header = header;
+            return header;
+        },
+        /**
+        * @method destroy
+        * @description Removes this unit from the parent and cleans up after itself.
+        * @return {<a href="YAHOO.widget.Layout.html">YAHOO.widget.Layout</a>} The parent Layout instance
+        */
+        destroy: function() {
+            if (this._resize) {
+                this._resize.destroy();
+            }
+            var par = this.get('parent');
+
+            this.setStyle('display', 'none');
+            par.removeUnit(this);
+            if (this._clip) {
+                this._clip.parentNode.removeChild(this._clip);
+                this._clip = null;
+            }
+
+            Event.purgeElement(this.get('element'));
+            this.get('parentNode').removeChild(this.get('element'));
+
+            delete YAHOO.widget.LayoutUnit._instances[this.get('id')];
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                    delete this[i];
+                }
+            }
+        
+            return par;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the LayoutUnit.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'LayoutUnit #' + this.get('id') + ' (' + this.get('position') + ')';
+            }
+            return 'LayoutUnit';
+        }
+    /**
+    * @event resize
+    * @description Fired when this.resize is called
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event startResize
+    * @description Fired when the Resize Utility fires it's startResize Event.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event beforeResize
+    * @description Firef at the beginning of the resize method. If you return false, the resize is cancelled.
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event contentChange
+    * @description Fired when the content in the header, body or footer is changed via the API
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event close
+    * @description Fired when the unit is closed
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event collapse
+    * @description Fired when the unit is collapsed
+    * @type YAHOO.util.CustomEvent
+    */
+    /**
+    * @event expand
+    * @description Fired when the unit is exanded
+    * @type YAHOO.util.CustomEvent
+    */
+    });
+
+    YAHOO.widget.LayoutUnit = LayoutUnit;
+})();
+YAHOO.register("layout", YAHOO.widget.Layout, {version: "2.5.0", build: "895"});
index 478f308a7ee376f9fe8106bf8dc66d044c9bc521..801bffe37b373e7da2af2d7172e22b8e11b3139d 100755 (executable)
@@ -1,5 +1,24 @@
 Logger Release Notes
 
+*** version 2.5.0 ***
+
+* No changes.
+
+
+
+*** version 2.4.0 ***
+
+* Global window error event no longer being handled by default. Implemented
+ handleWindowErrors() and unhandleWindowErrors().
+
+
+
+*** version 2.3.1 ***
+
+* No changes.
+
+
+
 **** version 2.3.0 ****
 
 * Applied new skinning model.
index 921fad9617ae6604f08b5d987ba4ea59c6bb00fc..38a466d85d883cce0f62ee31791e555167d7b43b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* This file intentionally left blank */\r
+/* This file intentionally left blank */
index 0d41c177a1c93deabc0ff2d39abb8cc092c5c75e..8ae8909a2124a6b82ee9324a5698b75aa308a4a9 100755 (executable)
@@ -1,57 +1,57 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* logger default styles */\r
-/* default width: 31em */\r
-/* default font-size 77% */\r
-.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}\r
-\r
-/* for containers built from scratch */\r
-.yui-log-container {position:absolute;top:1em;right:1em;}\r
-\r
-/* buttons */\r
-.yui-log input {\r
-    margin:0;padding:0;\r
-    font-family:arial;\r
-    font-size:100%;\r
-    font-weight:normal;\r
-}\r
-.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}\r
-\r
-/* header */\r
-.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;}\r
-.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;}\r
-\r
-/* body */\r
-\r
-.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/\r
-.yui-log p {margin:1px;padding:.1em;}\r
-.yui-log pre {margin:0;padding:0;}\r
-\r
-/* for pre to respect newlines yet wrap long lines */\r
-/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */\r
-.yui-log pre.yui-log-verbose {\r
-    white-space: pre-wrap; /* css-3 */\r
-    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */\r
-    white-space: -pre-wrap; /* Opera 4-6 */\r
-    white-space: -o-pre-wrap; /* Opera 7 */\r
-    word-wrap: break-word; /* Internet Explorer 5.5+ */\r
-}\r
-\r
-/* footer */\r
-.yui-log .yui-log-ft {margin-top:.5em;}\r
-.yui-log .yui-log-ft .yui-log-categoryfilters {}\r
-.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}\r
-.yui-log .yui-log-filtergrp {margin-right:.5em;}\r
-/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8}\r
-.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/\r
-\r
-/* logs */\r
-.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */\r
-.yui-log .warn {background-color:#F58516;} /* F58516 orange */\r
-.yui-log .error {background-color:#E32F0B;} /* E32F0B red */\r
-.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */\r
-.yui-log .window {background-color:#F2E886;} /* F2E886 tan */\r
+/* logger default styles */
+/* default width: 31em */
+/* default font-size 77% */
+.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}
+
+/* for containers built from scratch */
+.yui-log-container {position:absolute;top:1em;right:1em;}
+
+/* buttons */
+.yui-log input {
+    margin:0;padding:0;
+    font-family:arial;
+    font-size:100%;
+    font-weight:normal;
+}
+.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
+
+/* header */
+.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;}
+.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;}
+
+/* body */
+
+.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/
+.yui-log p {margin:1px;padding:.1em;}
+.yui-log pre {margin:0;padding:0;}
+
+/* for pre to respect newlines yet wrap long lines */
+/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+.yui-log pre.yui-log-verbose {
+    white-space: pre-wrap; /* css-3 */
+    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+    white-space: -pre-wrap; /* Opera 4-6 */
+    white-space: -o-pre-wrap; /* Opera 7 */
+    word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
+/* footer */
+.yui-log .yui-log-ft {margin-top:.5em;}
+.yui-log .yui-log-ft .yui-log-categoryfilters {}
+.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
+.yui-log .yui-log-filtergrp {margin-right:.5em;}
+/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8}
+.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/
+
+/* logs */
+.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
+.yui-log .warn {background-color:#F58516;} /* F58516 orange */
+.yui-log .error {background-color:#E32F0B;} /* E32F0B red */
+.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
+.yui-log .window {background-color:#F2E886;} /* F2E886 tan */
index de83af6fa9356eb9d26e1535fa1566c8363e2329..34d174ec561b07e0de3a431573a6a934eb417447 100755 (executable)
@@ -1,55 +1,55 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/* logger default styles */\r
-/* default width: 31em */\r
-/* default font-size 77% */\r
-.yui-skin-sam .yui-log { padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000; }\r
-\r
-/* for containers built from scratch */\r
-.yui-skin-sam .yui-log-container { position:absolute;top:1em;right:1em; }\r
-\r
-/* buttons */\r
-.yui-skin-sam .yui-log input {\r
-    margin:0;padding:0;\r
-    font-family:arial;\r
-    font-size:100%;\r
-    font-weight:normal;\r
-}\r
-.yui-skin-sam .yui-log .yui-log-btns { position:relative;float:right;bottom:.25em; }\r
-\r
-/* header */\r
-.yui-skin-sam .yui-log .yui-log-hd { margin-top:1em;padding:.5em;background-color:#575757; }\r
-.yui-skin-sam .yui-log .yui-log-hd h4 { margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF; }\r
-\r
-/* body */\r
-\r
-.yui-skin-sam .yui-log .yui-log-bd { width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto; } /* height is controlled here: default 20em*/\r
-.yui-skin-sam .yui-log p { margin:1px;padding:.1em; }\r
-.yui-skin-sam .yui-log pre { margin:0;padding:0; }\r
-\r
-/* for pre to respect newlines yet wrap long lines */\r
-/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */\r
-.yui-skin-sam .yui-log pre.yui-log-verbose {\r
-    white-space: pre-wrap; /* css-3 */\r
-    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */\r
-    white-space: -pre-wrap; /* Opera 4-6 */\r
-    white-space: -o-pre-wrap; /* Opera 7 */\r
-    word-wrap: break-word; /* Internet Explorer 5.5+ */\r
-}\r
-\r
-/* footer */\r
-.yui-skin-sam .yui-log .yui-log-ft { margin-top:.5em; }\r
-.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters { }\r
-.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters { width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em; }\r
-.yui-skin-sam .yui-log .yui-log-filtergrp { margin-right:.5em; }\r
-\r
-/* logs */\r
-.yui-skin-sam .yui-log .info { background-color:#A7CC25; } /* A7CC25 green */\r
-.yui-skin-sam .yui-log .warn { background-color:#F58516; } /* F58516 orange */\r
-.yui-skin-sam .yui-log .error { background-color:#E32F0B; } /* E32F0B red */\r
-.yui-skin-sam .yui-log .time { background-color:#A6C9D7; } /* A6C9D7 blue */\r
-.yui-skin-sam .yui-log .window { background-color:#F2E886; } /* F2E886 tan */\r
+/* logger default styles */
+/* default width: 31em */
+/* default font-size 77% */
+.yui-skin-sam .yui-log { padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000; }
+
+/* for containers built from scratch */
+.yui-skin-sam .yui-log-container { position:absolute;top:1em;right:1em; }
+
+/* buttons */
+.yui-skin-sam .yui-log input {
+    margin:0;padding:0;
+    font-family:arial;
+    font-size:100%;
+    font-weight:normal;
+}
+.yui-skin-sam .yui-log .yui-log-btns { position:relative;float:right;bottom:.25em; }
+
+/* header */
+.yui-skin-sam .yui-log .yui-log-hd { margin-top:1em;padding:.5em;background-color:#575757; }
+.yui-skin-sam .yui-log .yui-log-hd h4 { margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF; }
+
+/* body */
+
+.yui-skin-sam .yui-log .yui-log-bd { width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto; } /* height is controlled here: default 20em*/
+.yui-skin-sam .yui-log p { margin:1px;padding:.1em; }
+.yui-skin-sam .yui-log pre { margin:0;padding:0; }
+
+/* for pre to respect newlines yet wrap long lines */
+/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+.yui-skin-sam .yui-log pre.yui-log-verbose {
+    white-space: pre-wrap; /* css-3 */
+    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+    white-space: -pre-wrap; /* Opera 4-6 */
+    white-space: -o-pre-wrap; /* Opera 7 */
+    word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
+/* footer */
+.yui-skin-sam .yui-log .yui-log-ft { margin-top:.5em; }
+.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters { }
+.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters { width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em; }
+.yui-skin-sam .yui-log .yui-log-filtergrp { margin-right:.5em; }
+
+/* logs */
+.yui-skin-sam .yui-log .info { background-color:#A7CC25; } /* A7CC25 green */
+.yui-skin-sam .yui-log .warn { background-color:#F58516; } /* F58516 orange */
+.yui-skin-sam .yui-log .error { background-color:#E32F0B; } /* E32F0B red */
+.yui-skin-sam .yui-log .time { background-color:#A6C9D7; } /* A6C9D7 blue */
+.yui-skin-sam .yui-log .window { background-color:#F2E886; } /* F2E886 tan */
index 5b8077f1848b3196603008c57f7034fb66621afd..f91c8c333e71e40dc3782a77bc62b82afea9a839 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
index 583eda200fde4326696ad4cc0790ed861e3e8c86..65a67e92262243feaebf342070023eaa326910fb 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /****************************************************************************/
 /****************************************************************************/
@@ -653,8 +653,9 @@ YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {
     // not the absolute previous item in the stack
 
     var time = oLogMsg.time;
+    var localTime;
     if (time.toLocaleTimeString) {
-        var localTime  = time.toLocaleTimeString();
+        localTime  = time.toLocaleTimeString();
     }
     else {
         localTime = time.toString();
@@ -1540,7 +1541,9 @@ if(!YAHOO.widget.Logger) {
         _stack: [], // holds all log msgs
         maxStackEntries: 2500,
         _startTime: new Date().getTime(), // static start timestamp
-        _lastTime: null // timestamp of last logged message
+        _lastTime: null, // timestamp of last logged message
+        _windowErrorsHandled: false,
+        _origOnWindowError: null
     };
 
     /////////////////////////////////////////////////////////////////////////////
@@ -1751,6 +1754,53 @@ if(!YAHOO.widget.Logger) {
         YAHOO.log("Logger output to the function console.log() has been enabled.");
     };
 
+    /**
+     * Surpresses native JavaScript errors and outputs to console. By default,
+     * Logger does not handle JavaScript window error events.
+     * NB: Not all browsers support the window.onerror event.
+     *
+     * @method handleWindowErrors
+     */
+    YAHOO.widget.Logger.handleWindowErrors = function() {
+        if(!YAHOO.widget.Logger._windowErrorsHandled) {
+            // Save any previously defined handler to call
+            if(window.error) {
+                YAHOO.widget.Logger._origOnWindowError = window.onerror;
+            }
+            window.onerror = YAHOO.widget.Logger._onWindowError;
+            YAHOO.widget.Logger._windowErrorsHandled = true;
+            YAHOO.log("Logger handling of window.onerror has been enabled.");
+        }
+        else {
+            YAHOO.log("Logger handling of window.onerror had already been enabled.");
+        }
+    };
+
+    /**
+     * Unsurpresses native JavaScript errors. By default,
+     * Logger does not handle JavaScript window error events.
+     * NB: Not all browsers support the window.onerror event.
+     *
+     * @method unhandleWindowErrors
+     */
+    YAHOO.widget.Logger.unhandleWindowErrors = function() {
+        if(YAHOO.widget.Logger._windowErrorsHandled) {
+            // Revert to any previously defined handler to call
+            if(YAHOO.widget.Logger._origOnWindowError) {
+                window.onerror = YAHOO.widget.Logger._origOnWindowError;
+                YAHOO.widget.Logger._origOnWindowError = null;
+            }
+            else {
+                window.onerror = null;
+            }
+            YAHOO.widget.Logger._windowErrorsHandled = false;
+            YAHOO.log("Logger handling of window.onerror has been disabled.");
+        }
+        else {
+            YAHOO.log("Logger handling of window.onerror had already been disabled.");
+        }
+    };
+    
     /////////////////////////////////////////////////////////////////////////////
     //
     // Public events
@@ -1869,8 +1919,9 @@ if(!YAHOO.widget.Logger) {
             var label = oEntry.category.substring(0,4).toUpperCase();
 
             var time = oEntry.time;
+            var localTime;
             if (time.toLocaleTimeString) {
-                var localTime  = time.toLocaleTimeString();
+                localTime  = time.toLocaleTimeString();
             }
             else {
                 localTime = time.toString();
@@ -1919,19 +1970,6 @@ if(!YAHOO.widget.Logger) {
         }
     };
 
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Enable handling of native JavaScript errors
-    // NB: Not all browsers support the window.onerror event
-    //
-    /////////////////////////////////////////////////////////////////////////////
-
-    if(window.onerror) {
-        // Save any previously defined handler to call
-        YAHOO.widget.Logger._origOnWindowError = window.onerror;
-    }
-    window.onerror = YAHOO.widget.Logger._onWindowError;
-
     /////////////////////////////////////////////////////////////////////////////
     //
     // First log
@@ -1942,4 +1980,4 @@ if(!YAHOO.widget.Logger) {
 }
 
 
-YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.3.0", build: "442"});
+YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.5.0", build: "895"});
index ceddbdade34304211e0bb3c5e72c30c4266cef0c..53bed14d0156fbd73626bac19fcfb8caf6a938b6 100755 (executable)
@@ -1,64 +1,10 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.widget.LogMsg=function(oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var param in oConfigs){this[param]=oConfigs[param];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
-this._source=sSource;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(sMsg,sCategory){YAHOO.widget.Logger.log(sMsg,sCategory,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(sSource){if(!sSource){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}
-else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(oConfigs&&(oConfigs.constructor==Object)){for(var param in oConfigs){this[param]=oConfigs[param];}}
-this._initContainerEl(elContainer);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+
-elContainer,"error",this.toString());return;}
-this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.outputBuffer=100;YAHOO.widget.LogReader.prototype.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.isCollapsed=false;YAHOO.widget.LogReader.prototype.isPaused=false;YAHOO.widget.LogReader.prototype.draggable=true;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this.isPaused=true;this._btnPause.value="Resume";this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.isPaused=false;this._btnPause.value="Pause";this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._elContainer.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._elContainer.style.display="block";};YAHOO.widget.LogReader.prototype.collapse=function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}
-this._btnCollapse.value="Expand";this.isCollapsed=true;};YAHOO.widget.LogReader.prototype.expand=function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}
-this._btnCollapse.value="Collapse";this.isCollapsed=false;};YAHOO.widget.LogReader.prototype.getCheckbox=function(filter){return this._filterCheckboxes[filter];};YAHOO.widget.LogReader.prototype.getCategories=function(){return this._categoryFilters;};YAHOO.widget.LogReader.prototype.showCategory=function(sCategory){var filtersArray=this._categoryFilters;if(filtersArray.indexOf){if(filtersArray.indexOf(sCategory)>-1){return;}}
-else{for(var i=0;i<filtersArray.length;i++){if(filtersArray[i]===sCategory){return;}}}
-this._categoryFilters.push(sCategory);this._filterLogs();var elCheckbox=this.getCheckbox(sCategory);if(elCheckbox){elCheckbox.checked=true;}};YAHOO.widget.LogReader.prototype.hideCategory=function(sCategory){var filtersArray=this._categoryFilters;for(var i=0;i<filtersArray.length;i++){if(sCategory==filtersArray[i]){filtersArray.splice(i,1);break;}}
-this._filterLogs();var elCheckbox=this.getCheckbox(sCategory);if(elCheckbox){elCheckbox.checked=false;}};YAHOO.widget.LogReader.prototype.getSources=function(){return this._sourceFilters;};YAHOO.widget.LogReader.prototype.showSource=function(sSource){var filtersArray=this._sourceFilters;if(filtersArray.indexOf){if(filtersArray.indexOf(sSource)>-1){return;}}
-else{for(var i=0;i<filtersArray.length;i++){if(sSource==filtersArray[i]){return;}}}
-filtersArray.push(sSource);this._filterLogs();var elCheckbox=this.getCheckbox(sSource);if(elCheckbox){elCheckbox.checked=true;}};YAHOO.widget.LogReader.prototype.hideSource=function(sSource){var filtersArray=this._sourceFilters;for(var i=0;i<filtersArray.length;i++){if(sSource==filtersArray[i]){filtersArray.splice(i,1);break;}}
-this._filterLogs();var elCheckbox=this.getCheckbox(sSource);if(elCheckbox){elCheckbox.checked=false;}};YAHOO.widget.LogReader.prototype.clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var elConsole=this._elConsole;while(elConsole.hasChildNodes()){elConsole.removeChild(elConsole.firstChild);}};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){this._title.innerHTML=this.html2Text(sTitle);};YAHOO.widget.LogReader.prototype.getLastTime=function(){return this._lastTime;};YAHOO.widget.LogReader.prototype.formatMsg=function(oLogMsg){var category=oLogMsg.category;var label=category.substring(0,4).toUpperCase();var time=oLogMsg.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
-else{localTime=time.toString();}
-var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this.getLastTime();var source=oLogMsg.source;var sourceDetail=oLogMsg.sourceDetail;var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var msg=this.html2Text(YAHOO.lang.dump(oLogMsg.msg));var output=(this.verboseOutput)?["<pre class=\"yui-log-verbose\"><p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ","</p><p>",sourceAndDetail,": </p><p>",msg,"</p></pre>"]:["<pre><p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ",sourceAndDetail,": ",msg,"</p></pre>"];return output.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}
-return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._consoleMsgCount=0;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._filterCheckboxes=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._elContainer=null;YAHOO.widget.LogReader.prototype._elHd=null;YAHOO.widget.LogReader.prototype._elCollapse=null;YAHOO.widget.LogReader.prototype._btnCollapse=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._elConsole=null;YAHOO.widget.LogReader.prototype._elFt=null;YAHOO.widget.LogReader.prototype._elBtns=null;YAHOO.widget.LogReader.prototype._elCategoryFilters=null;YAHOO.widget.LogReader.prototype._elSourceFilters=null;YAHOO.widget.LogReader.prototype._btnPause=null;YAHOO.widget.LogReader.prototype._btnClear=null;YAHOO.widget.LogReader.prototype._initContainerEl=function(elContainer){elContainer=YAHOO.util.Dom.get(elContainer);if(elContainer&&elContainer.tagName&&(elContainer.tagName.toLowerCase()=="div")){this._elContainer=elContainer;YAHOO.util.Dom.addClass(this._elContainer,"yui-log");}
-else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log");YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}
-if(this.right){containerStyle.right=this.right;}
-if(this.top){containerStyle.top=this.top;}
-if(this.left){containerStyle.left=this.left;containerStyle.right="auto";}
-if(this.bottom){containerStyle.bottom=this.bottom;containerStyle.top="auto";}
-if(this.fontSize){containerStyle.fontSize=this.fontSize;}
-if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+='';}}};YAHOO.widget.LogReader.prototype._initHeaderEl=function(){var oSelf=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML="";}
-this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";};YAHOO.widget.LogReader.prototype._initConsoleEl=function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}
-this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}};YAHOO.widget.LogReader.prototype._initFooterEl=function(){var oSelf=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML="";}
-this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}};YAHOO.widget.LogReader.prototype._initDragDrop=function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var ylog_dd=new YAHOO.util.DD(this._elContainer);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}};YAHOO.widget.LogReader.prototype._initCategories=function(){this._categoryFilters=[];var aInitialCategories=YAHOO.widget.Logger.categories;for(var j=0;j<aInitialCategories.length;j++){var sCategory=aInitialCategories[j];this._categoryFilters.push(sCategory);if(this._elCategoryFilters){this._createCategoryCheckbox(sCategory);}}};YAHOO.widget.LogReader.prototype._initSources=function(){this._sourceFilters=[];var aInitialSources=YAHOO.widget.Logger.sources;for(var j=0;j<aInitialSources.length;j++){var sSource=aInitialSources[j];this._sourceFilters.push(sSource);if(this._elSourceFilters){this._createSourceCheckbox(sSource);}}};YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(sCategory){var oSelf=this;if(this._elFt){var elParent=this._elCategoryFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkCategory=document.createElement("input");chkCategory.id="yui-log-filter-"+sCategory+this._sName;chkCategory.className="yui-log-filter-"+sCategory;chkCategory.type="checkbox";chkCategory.category=sCategory;chkCategory=elFilter.appendChild(chkCategory);chkCategory.checked=true;YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);var lblCategory=elFilter.appendChild(document.createElement("label"));lblCategory.htmlFor=chkCategory.id;lblCategory.className=sCategory;lblCategory.innerHTML=sCategory;this._filterCheckboxes[sCategory]=chkCategory;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(sSource){var oSelf=this;if(this._elFt){var elParent=this._elSourceFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkSource=document.createElement("input");chkSource.id="yui-log-filter"+sSource+this._sName;chkSource.className="yui-log-filter"+sSource;chkSource.type="checkbox";chkSource.source=sSource;chkSource=elFilter.appendChild(chkSource);chkSource.checked=true;YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);var lblSource=elFilter.appendChild(document.createElement("label"));lblSource.htmlFor=chkSource.id;lblSource.className=sSource;lblSource.innerHTML=sSource;this._filterCheckboxes[sSource]=chkSource;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._elConsole!==null){var thresholdMax=this.thresholdMax;thresholdMax=(thresholdMax&&!isNaN(thresholdMax))?thresholdMax:500;if(this._consoleMsgCount<thresholdMax){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
-this._buffer=[];this._printToConsole(entries);}
-else{this._filterLogs();}
-if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var thresholdMin=this.thresholdMin;if(isNaN(thresholdMin)||(thresholdMin>this.thresholdMax)){thresholdMin=0;}
-var entriesStartIndex=(entriesLen>thresholdMin)?(entriesLen-thresholdMin):0;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=entriesStartIndex;i<entriesLen;i++){var okToPrint=false;var okToFilterCats=false;var entry=aEntries[i];var source=entry.source;var category=entry.category;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
-if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
-if(okToPrint){var output=this.formatMsg(entry);if(this.newestOnTop){this._elConsole.innerHTML=output+this._elConsole.innerHTML;}
-else{this._elConsole.innerHTML+=output;}
-this._consoleMsgCount++;this._lastTime=entry.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(sType,aArgs,oSelf){var category=aArgs[0];oSelf._categoryFilters.push(category);if(oSelf._elFt){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(sType,aArgs,oSelf){var source=aArgs[0];oSelf._sourceFilters.push(source);if(oSelf._elFt){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var category=this.category;if(!this.checked){oSelf.hideCategory(category);}
-else{oSelf.showCategory(category);}};YAHOO.widget.LogReader.prototype._onCheckSource=function(v,oSelf){var source=this.source;if(!this.checked){oSelf.hideSource(source);}
-else{oSelf.showSource(source);}};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){if(!oSelf.isCollapsed){oSelf.collapse();}
-else{oSelf.expand();}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){if(!oSelf.isPaused){oSelf.pause();}
-else{oSelf.resume();}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf.clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(sType,aArgs,oSelf){var logEntry=aArgs[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},oSelf.outputBuffer);}};YAHOO.widget.LogReader.prototype._onReset=function(sType,aArgs,oSelf){oSelf._filterLogs();};if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
-else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}
-var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
-else{sClass=sSource;}
-if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
-var timestamp=new Date();var logEntry=new YAHOO.widget.LogMsg({msg:sMsg,time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail});var stack=this._stack;var maxStackEntries=this.maxStackEntries;if(maxStackEntries&&!isNaN(maxStackEntries)&&(stack.length>=maxStackEntries)){stack.shift();}
-stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}
-return true;}
-else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(sCategory){this.categories.push(sCategory);this.categoryCreateEvent.fire(sCategory);};YAHOO.widget.Logger._isNewCategory=function(sCategory){for(var i=0;i<this.categories.length;i++){if(sCategory==this.categories[i]){return false;}}
-return true;};YAHOO.widget.Logger._createNewSource=function(sSource){this.sources.push(sSource);this.sourceCreateEvent.fire(sSource);};YAHOO.widget.Logger._isNewSource=function(sSource){if(sSource){for(var i=0;i<this.sources.length;i++){if(sSource==this.sources[i]){return false;}}
-return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(oEntry){if(window.console&&console.log){var category=oEntry.category;var label=oEntry.category.substring(0,4).toUpperCase();var time=oEntry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
-else{localTime=time.toString();}
-var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
-elapsedTime+"ms): "+
-oEntry.source+": "+
-oEntry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(sMsg,sUrl,sLine){try{YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
-catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
-window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");}
-YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.widget.LogMsg=function(A){if(A&&(A.constructor==Object)){for(var B in A){this[B]=A[B];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(A){if(!A){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return ;}this._source=A;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(A,B){YAHOO.widget.Logger.log(A,B,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(A){if(!A){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return ;}else{this._sSource=A;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(B,A){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(A&&(A.constructor==Object)){for(var C in A){this[C]=A[C];}}this._initContainerEl(B);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+B,"error",this.toString());return ;}this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.outputBuffer=100;YAHOO.widget.LogReader.prototype.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.isCollapsed=false;YAHOO.widget.LogReader.prototype.isPaused=false;YAHOO.widget.LogReader.prototype.draggable=true;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this.isPaused=true;this._btnPause.value="Resume";this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.isPaused=false;this._btnPause.value="Pause";this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._elContainer.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._elContainer.style.display="block";};YAHOO.widget.LogReader.prototype.collapse=function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;};YAHOO.widget.LogReader.prototype.expand=function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;};YAHOO.widget.LogReader.prototype.getCheckbox=function(A){return this._filterCheckboxes[A];};YAHOO.widget.LogReader.prototype.getCategories=function(){return this._categoryFilters;};YAHOO.widget.LogReader.prototype.showCategory=function(B){var D=this._categoryFilters;if(D.indexOf){if(D.indexOf(B)>-1){return ;}}else{for(var A=0;A<D.length;A++){if(D[A]===B){return ;}}}this._categoryFilters.push(B);this._filterLogs();var C=this.getCheckbox(B);if(C){C.checked=true;}};YAHOO.widget.LogReader.prototype.hideCategory=function(B){var D=this._categoryFilters;for(var A=0;A<D.length;A++){if(B==D[A]){D.splice(A,1);break;}}this._filterLogs();var C=this.getCheckbox(B);if(C){C.checked=false;}};YAHOO.widget.LogReader.prototype.getSources=function(){return this._sourceFilters;};YAHOO.widget.LogReader.prototype.showSource=function(A){var D=this._sourceFilters;if(D.indexOf){if(D.indexOf(A)>-1){return ;}}else{for(var B=0;B<D.length;B++){if(A==D[B]){return ;}}}D.push(A);this._filterLogs();var C=this.getCheckbox(A);if(C){C.checked=true;}};YAHOO.widget.LogReader.prototype.hideSource=function(A){var D=this._sourceFilters;for(var B=0;B<D.length;B++){if(A==D[B]){D.splice(B,1);break;}}this._filterLogs();var C=this.getCheckbox(A);if(C){C.checked=false;}};YAHOO.widget.LogReader.prototype.clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var A=this._elConsole;while(A.hasChildNodes()){A.removeChild(A.firstChild);}};YAHOO.widget.LogReader.prototype.setTitle=function(A){this._title.innerHTML=this.html2Text(A);};YAHOO.widget.LogReader.prototype.getLastTime=function(){return this._lastTime;};YAHOO.widget.LogReader.prototype.formatMsg=function(D){var E=D.category;var L=E.substring(0,4).toUpperCase();var I=D.time;var J;if(I.toLocaleTimeString){J=I.toLocaleTimeString();}else{J=I.toString();}var B=I.getTime();var F=YAHOO.widget.Logger.getStartTime();var C=B-F;var N=B-this.getLastTime();var A=D.source;var M=D.sourceDetail;var K=(M)?A+" "+M:A;var H=this.html2Text(YAHOO.lang.dump(D.msg));var G=(this.verboseOutput)?["<pre class=\"yui-log-verbose\"><p><span class='",E,"'>",L,"</span> ",C,"ms (+",N,") ",J,": ","</p><p>",K,": </p><p>",H,"</p></pre>"]:["<pre><p><span class='",E,"'>",L,"</span> ",C,"ms (+",N,") ",J,": ",K,": ",H,"</p></pre>"];return G.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(A){if(A){A+="";return A.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");
+}return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._consoleMsgCount=0;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._filterCheckboxes=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._elContainer=null;YAHOO.widget.LogReader.prototype._elHd=null;YAHOO.widget.LogReader.prototype._elCollapse=null;YAHOO.widget.LogReader.prototype._btnCollapse=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._elConsole=null;YAHOO.widget.LogReader.prototype._elFt=null;YAHOO.widget.LogReader.prototype._elBtns=null;YAHOO.widget.LogReader.prototype._elCategoryFilters=null;YAHOO.widget.LogReader.prototype._elSourceFilters=null;YAHOO.widget.LogReader.prototype._btnPause=null;YAHOO.widget.LogReader.prototype._btnClear=null;YAHOO.widget.LogReader.prototype._initContainerEl=function(B){B=YAHOO.util.Dom.get(B);if(B&&B.tagName&&(B.tagName.toLowerCase()=="div")){this._elContainer=B;YAHOO.util.Dom.addClass(this._elContainer,"yui-log");}else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log");YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var A=this._elContainer.style;if(this.width){A.width=this.width;}if(this.right){A.right=this.right;}if(this.top){A.top=this.top;}if(this.left){A.left=this.left;A.right="auto";}if(this.bottom){A.bottom=this.bottom;A.top="auto";}if(this.fontSize){A.fontSize=this.fontSize;}if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+="";}}};YAHOO.widget.LogReader.prototype._initHeaderEl=function(){var A=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(A._btnCollapse,"click",A._onClickCollapseBtn,A);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";};YAHOO.widget.LogReader.prototype._initConsoleEl=function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}};YAHOO.widget.LogReader.prototype._initFooterEl=function(){var A=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(A._btnPause,"click",A._onClickPauseBtn,A);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(A._btnClear,"click",A._onClickClearBtn,A);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}};YAHOO.widget.LogReader.prototype._initDragDrop=function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var A=new YAHOO.util.DD(this._elContainer);A.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}};YAHOO.widget.LogReader.prototype._initCategories=function(){this._categoryFilters=[];var C=YAHOO.widget.Logger.categories;for(var A=0;A<C.length;A++){var B=C[A];this._categoryFilters.push(B);if(this._elCategoryFilters){this._createCategoryCheckbox(B);}}};YAHOO.widget.LogReader.prototype._initSources=function(){this._sourceFilters=[];var C=YAHOO.widget.Logger.sources;for(var B=0;B<C.length;B++){var A=C[B];this._sourceFilters.push(A);if(this._elSourceFilters){this._createSourceCheckbox(A);}}};YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(B){var A=this;if(this._elFt){var E=this._elCategoryFilters;var D=E.appendChild(document.createElement("span"));D.className="yui-log-filtergrp";var C=document.createElement("input");C.id="yui-log-filter-"+B+this._sName;C.className="yui-log-filter-"+B;C.type="checkbox";C.category=B;C=D.appendChild(C);C.checked=true;YAHOO.util.Event.addListener(C,"click",A._onCheckCategory,A);var F=D.appendChild(document.createElement("label"));F.htmlFor=C.id;F.className=B;F.innerHTML=B;this._filterCheckboxes[B]=C;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(A){var D=this;if(this._elFt){var F=this._elSourceFilters;var E=F.appendChild(document.createElement("span"));E.className="yui-log-filtergrp";var C=document.createElement("input");C.id="yui-log-filter"+A+this._sName;C.className="yui-log-filter"+A;C.type="checkbox";C.source=A;C=E.appendChild(C);C.checked=true;YAHOO.util.Event.addListener(C,"click",D._onCheckSource,D);var B=E.appendChild(document.createElement("label"));B.htmlFor=C.id;B.className=A;B.innerHTML=A;this._filterCheckboxes[A]=C;
+}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._elConsole!==null){var B=this.thresholdMax;B=(B&&!isNaN(B))?B:500;if(this._consoleMsgCount<B){var A=[];for(var C=0;C<this._buffer.length;C++){A[C]=this._buffer[C];}this._buffer=[];this._printToConsole(A);}else{this._filterLogs();}if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(J){var B=J.length;var O=this.thresholdMin;if(isNaN(O)||(O>this.thresholdMax)){O=0;}var L=(B>O)?(B-O):0;var C=this._sourceFilters.length;var M=this._categoryFilters.length;for(var I=L;I<B;I++){var F=false;var K=false;var N=J[I];var A=N.source;var D=N.category;for(var H=0;H<C;H++){if(A==this._sourceFilters[H]){K=true;break;}}if(K){for(var G=0;G<M;G++){if(D==this._categoryFilters[G]){F=true;break;}}}if(F){var E=this.formatMsg(N);if(this.newestOnTop){this._elConsole.innerHTML=E+this._elConsole.innerHTML;}else{this._elConsole.innerHTML+=E;}this._consoleMsgCount++;this._lastTime=N.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(D,C,A){var B=C[0];A._categoryFilters.push(B);if(A._elFt){A._createCategoryCheckbox(B);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(D,C,A){var B=C[0];A._sourceFilters.push(B);if(A._elFt){A._createSourceCheckbox(B);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(A,B){var C=this.category;if(!this.checked){B.hideCategory(C);}else{B.showCategory(C);}};YAHOO.widget.LogReader.prototype._onCheckSource=function(A,B){var C=this.source;if(!this.checked){B.hideSource(C);}else{B.showSource(C);}};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(A,B){if(!B.isCollapsed){B.collapse();}else{B.expand();}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(A,B){if(!B.isPaused){B.pause();}else{B.resume();}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(A,B){B.clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(D,C,A){var B=C[0];A._buffer.push(B);if(A.logReaderEnabled===true&&A._timeout===null){A._timeout=setTimeout(function(){A._printBuffer();},A.outputBuffer);}};YAHOO.widget.LogReader.prototype._onReset=function(C,B,A){A._filterLogs();};if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null,_windowErrorsHandled:false,_origOnWindowError:null};YAHOO.widget.Logger.log=function(B,F,G){if(this.loggerEnabled){if(!F){F="info";}else{F=F.toLocaleLowerCase();if(this._isNewCategory(F)){this._createNewCategory(F);}}var C="global";var A=null;if(G){var D=G.indexOf(" ");if(D>0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A<this.categories.length;A++){if(B==this.categories[A]){return false;}}return true;};YAHOO.widget.Logger._createNewSource=function(A){this.sources.push(A);this.sourceCreateEvent.fire(A);};YAHOO.widget.Logger._isNewSource=function(A){if(A){for(var B=0;B<this.sources.length;B++){if(A==this.sources[B]){return false;}}return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(C){if(window.console&&console.log){var E=C.category;var D=C.category.substring(0,4).toUpperCase();var G=C.time;var F;if(G.toLocaleTimeString){F=G.toLocaleTimeString();}else{F=G.toString();}var H=G.getTime();var B=(YAHOO.widget.Logger._lastTime)?(H-YAHOO.widget.Logger._lastTime):0;
+YAHOO.widget.Logger._lastTime=H;var A=F+" ("+B+"ms): "+C.source+": "+C.msg;console.log(A);}};YAHOO.widget.Logger._onWindowError=function(A,C,B){try{YAHOO.widget.Logger.log(A+" ("+C+", line "+B+")","window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}catch(D){return false;}};YAHOO.widget.Logger.log("Logger initialized");}YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 583eda200fde4326696ad4cc0790ed861e3e8c86..65a67e92262243feaebf342070023eaa326910fb 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /****************************************************************************/
 /****************************************************************************/
@@ -653,8 +653,9 @@ YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {
     // not the absolute previous item in the stack
 
     var time = oLogMsg.time;
+    var localTime;
     if (time.toLocaleTimeString) {
-        var localTime  = time.toLocaleTimeString();
+        localTime  = time.toLocaleTimeString();
     }
     else {
         localTime = time.toString();
@@ -1540,7 +1541,9 @@ if(!YAHOO.widget.Logger) {
         _stack: [], // holds all log msgs
         maxStackEntries: 2500,
         _startTime: new Date().getTime(), // static start timestamp
-        _lastTime: null // timestamp of last logged message
+        _lastTime: null, // timestamp of last logged message
+        _windowErrorsHandled: false,
+        _origOnWindowError: null
     };
 
     /////////////////////////////////////////////////////////////////////////////
@@ -1751,6 +1754,53 @@ if(!YAHOO.widget.Logger) {
         YAHOO.log("Logger output to the function console.log() has been enabled.");
     };
 
+    /**
+     * Surpresses native JavaScript errors and outputs to console. By default,
+     * Logger does not handle JavaScript window error events.
+     * NB: Not all browsers support the window.onerror event.
+     *
+     * @method handleWindowErrors
+     */
+    YAHOO.widget.Logger.handleWindowErrors = function() {
+        if(!YAHOO.widget.Logger._windowErrorsHandled) {
+            // Save any previously defined handler to call
+            if(window.error) {
+                YAHOO.widget.Logger._origOnWindowError = window.onerror;
+            }
+            window.onerror = YAHOO.widget.Logger._onWindowError;
+            YAHOO.widget.Logger._windowErrorsHandled = true;
+            YAHOO.log("Logger handling of window.onerror has been enabled.");
+        }
+        else {
+            YAHOO.log("Logger handling of window.onerror had already been enabled.");
+        }
+    };
+
+    /**
+     * Unsurpresses native JavaScript errors. By default,
+     * Logger does not handle JavaScript window error events.
+     * NB: Not all browsers support the window.onerror event.
+     *
+     * @method unhandleWindowErrors
+     */
+    YAHOO.widget.Logger.unhandleWindowErrors = function() {
+        if(YAHOO.widget.Logger._windowErrorsHandled) {
+            // Revert to any previously defined handler to call
+            if(YAHOO.widget.Logger._origOnWindowError) {
+                window.onerror = YAHOO.widget.Logger._origOnWindowError;
+                YAHOO.widget.Logger._origOnWindowError = null;
+            }
+            else {
+                window.onerror = null;
+            }
+            YAHOO.widget.Logger._windowErrorsHandled = false;
+            YAHOO.log("Logger handling of window.onerror has been disabled.");
+        }
+        else {
+            YAHOO.log("Logger handling of window.onerror had already been disabled.");
+        }
+    };
+    
     /////////////////////////////////////////////////////////////////////////////
     //
     // Public events
@@ -1869,8 +1919,9 @@ if(!YAHOO.widget.Logger) {
             var label = oEntry.category.substring(0,4).toUpperCase();
 
             var time = oEntry.time;
+            var localTime;
             if (time.toLocaleTimeString) {
-                var localTime  = time.toLocaleTimeString();
+                localTime  = time.toLocaleTimeString();
             }
             else {
                 localTime = time.toString();
@@ -1919,19 +1970,6 @@ if(!YAHOO.widget.Logger) {
         }
     };
 
-    /////////////////////////////////////////////////////////////////////////////
-    //
-    // Enable handling of native JavaScript errors
-    // NB: Not all browsers support the window.onerror event
-    //
-    /////////////////////////////////////////////////////////////////////////////
-
-    if(window.onerror) {
-        // Save any previously defined handler to call
-        YAHOO.widget.Logger._origOnWindowError = window.onerror;
-    }
-    window.onerror = YAHOO.widget.Logger._onWindowError;
-
     /////////////////////////////////////////////////////////////////////////////
     //
     // First log
@@ -1942,4 +1980,4 @@ if(!YAHOO.widget.Logger) {
 }
 
 
-YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.3.0", build: "442"});
+YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.5.0", build: "895"});
index ee978b3037d70d9e4fea3dd6a3ef8a29e02534ba..32fac95a869dd9e89ba2a49e6edee93bcf5eeb82 100755 (executable)
@@ -1,4 +1,236 @@
-*** version 2.3.0 ***
+*** version 2.5.0 ***
+
+Fixed the following bugs:
+-------------------------
+
++ Corrected the paths to all images in the original Menu CSS file so that checked MenuItems now
+  render correctly.
+
++ Clicking on a disabled MenuItem instance will no longer cause the browser to navigate to 
+  the top of the current page.
+
++ Removed the use of the "yui-skin-sam" class name from the Menu core CSS file.
+
++ Scrolling Menus now render correctly in IE 6 and IE 7.
+
++ Submenus are no longer hidden then re-shown when the mouse is moving from a visible submenu back
+  to its parent MenuItem instance.
+
+
+
+*** version 2.4.1 ***
+
++ No changes
+
+
+
+*** version 2.4.0 ***
+
+
+Fixed the following bugs:
+-------------------------
+
++ The "context" property of YAHOO.widget.Menu works better in IE 6.
+
++ Immediate submenus of a YAHOO.widget.MenuBar instance will now re-align 
+  themselves to their parent YAHOO.widget.MenuBarItem instance to remain inside 
+  the boundaries of the browser viewport when the "constraintoviewport" 
+  property is set to "true."
+
++ A submenu will now appear in the correct position when its parent menu 
+  is scrolled.
+
++ YAHOO.widget.MenuItem instances will no longer increase in height when their
+  submenu is made visible.
+
++ Removed superfluous white space between YAHOO.widget.MenuItem instances in 
+  IE 6 (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode).
+  
++ Statically positioned YAHOO.widget.MenuBar instances will no longer be 
+  rendered in the wrong position when the Container CSS file is included in 
+  the page.
+
++ Usage of the "maxheight" configuration property will no longer change the 
+  position of a YAHOO.widget.Menu instance's shadow element 
+  (<DIV class="yui-menu-shadow">).  The shadow element will alway be the last 
+  child node of a menu's root element.
+
++ YAHOO.widget.MenuBar instances with their "position" configuration property 
+  set to "dynamic" are no longer rendered with scrollbars in Firefox for 
+  Mac OS X.
+               
+
+
+Added the following features:
+-----------------------------
+
++ Added a new "minscrollheight" configuration property to YAHOO.widget.Menu
+  that defines the minimum threshold for the "maxheight" configuration property.
+
++ Added a new "scrollincrement" configuration property to YAHOO.widget.Menu 
+  which can be used to increase or decrease the scroll speed of scolled menu.
+
++ Hidden YAHOO.widget.Menu instances are now positioned off screen to 
+  prevent them from introducing scrollbars on the browser viewport.  The 
+  default off-screen position is -10000 for both the x and y coordinates and is
+  defined in a new constant: "YAHOO.widget.Menu.prototype.OFF_SCREEN_POSITION".
+  The method responsible for moving a menu off the screen is 
+  "YAHOO.widget.Menu.prototype.positionOffScreen" which is called in response
+  to the firing of the "hide" event.
+    
+
+Changes:
+--------
+
++ Setting "iframe" configuration property on a YAHOO.widget.MenuBar instance
+  will now result in the property cascading down to all submenus.
+
++ The "position" configuration property no longer automatically enables the 
+  iframe shim for YAHOO.widget.Menu instances.  Previously, setting the 
+  "position" configuration property to "static" would automatically 
+  set the "iframe" configuration property to "false," and setting "position" to
+  "dynamic" would set the "iframe" configuration property to "true" for IE 6.
+
++ YAHOO.widget.Menu instances no longer have their widths set automatically 
+  as they are rendered.
+
++ Modified the DOM structure for a YAHOO.widget.MenuItem instance so that the 
+  submenu indicator node (<EM class="submenuindicator" />) and checked 
+  indicator node (<EM class="checkedindicator" />) that were previously direct 
+  descendants of the <A/> node are no longer present.  The updated DOM
+  structure of a YAHOO.widget.MenuItem instance is now:
+
+    <LI class="yuimenuitem">
+    
+        <A class="yuimenuitemlabel">
+    
+            Text Label
+    
+            <EM class="helptext"> Help Text </EM>   (Optional)
+    
+        </A>
+    
+        <DIV class="yuimenu"> ... </DIV> (Optional submenu node)
+    
+    </LI>
+
+
+  With the removal of the submenu indicator and checked indicator nodes,
+  the following YAHOO.widget.MenuItem constants, used to define the inner 
+  text of these nodes, have been removed:
+
+    - YAHOO.widget.MenuItem.prototype.COLLAPSED_SUBMENU_INDICATOR_TEXT
+    - YAHOO.widget.MenuItem.prototype.EXPANDED_SUBMENU_INDICATOR_TEXT
+    - YAHOO.widget.MenuItem.prototype.DISABLED_SUBMENU_INDICATOR_TEXT
+    - YAHOO.widget.MenuItem.prototype.CHECKED_TEXT
+    - YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_TEXT
+    
+  The "submenuIndicator" property of YAHOO.widget.MenuItem has also 
+  been removed.
+
+
++ Modified the CSS class names used to represent the state of 
+  YAHOO.widget.MenuItem and YAHOO.widget.MenuBarItem instances.  Previous to 
+  2.4.0 the following CSS class names were applied only to the <A> element 
+  representing the text label for YAHOO.widget.MenuItem and 
+  YAHOO.widget.MenuBarItem instances:
+
+    + hashelptext
+    + checked
+    + hassubmenu
+    + selected
+    + disabled
+
+
+  To provide more flexibility and facilitate easier styling of state, a set of
+  new CSS class names have been created that are applied to both the root 
+  <LI> node and its child <A> node for YAHOO.widget.MenuItem and 
+  YAHOO.widget.MenuBarItem instances:
+  
+
+    New YAHOO.widget.MenuItem CSS classes:
+    --------------------------------------
+    
+    The following are applied to the <LI> element:
+    
+    .yuimenuitem-hassubmenu
+    .yuimenuitem-checked
+    .yuimenuitem-selected
+    .yuimenuitem-disabled
+    
+    .yuimenuitem-checked-selected
+    .yuimenuitem-checked-disabled
+    
+    .yuimenuitem-hassubmenu-selected
+    .yuimenuitem-hassubmenu-disabled
+    
+
+    The following are applied to the <A> element:
+
+    .yuimenuitemlabel-hassubmenu
+    .yuimenuitemlabel-checked
+    .yuimenuitemlabel-selected
+    .yuimenuitemlabel-disabled
+    
+    .yuimenuitemlabel-checked-selected
+    .yuimenuitemlabel-checked-disabled
+    
+    .yuimenuitemlabel-hassubmenu-selected
+    .yuimenuitemlabel-hassubmenu-disabled
+
+
+    New YAHOO.widget.MenuBarItem CSS classes:
+    -----------------------------------------
+    
+    The following are applied to the <LI> element:
+    
+    .yuimenubaritem-hassubmenu
+    .yuimenubaritem-selected
+    .yuimenubaritem-disabled
+    
+    .yuimenubaritem-hassubmenu-selected
+    .yuimenubaritem-hassubmenu-disabled
+    
+
+    The following are applied to the <A> element:
+    
+    .yuimenubaritemlabel-hassubmenu
+    .yuimenubaritemlabel-selected
+    .yuimenubaritemlabel-disabled
+    
+    .yuimenubaritemlabel-hassubmenu-selected
+    .yuimenubaritemlabel-hassubmenu-disabled
+
+
++ Deprecated the YAHOO.widget.ContextMenuItem class and replaced it 
+  with YAHOO.widget.MenuItem.
+
++ All submenus of a YAHOO.widget.ContextMenu instance are now of type
+  YAHOO.widget.Menu.
+
++ Updated the behavior of the "clicktohide" configuration property of 
+  YAHOO.widget.Menu so that it behaves as documented: controls whether or not 
+  clicking outside a menu results in the menu hiding.
+
+
+
+*** version 2.3.1 ***
+
+Fixed the following bugs:
+-------------------------
+
++ Including the Container CSS along with Menu CSS on a page will no longer 
+  result in statically positioned Menu instances rendering as hidden.
+
++ The focus outline for MenuItem instances no longer sticks in Opera.
+
++ Clicking MenuItem instances without a value for the "url" configuration 
+  property will no longer result in the MenuItem losing focus.
+  
++ Improved compatibility with Menu CSS and YUI Base CSS.
+
+
+*** version 2.3 ***
 
 Fixed the following bugs:
 -------------------------
index 5dee704b2a1094cd40b71331a6be8c82517d5c4d..cde3be79b95a44ca6328b584a6260ad5f18d7832 100755 (executable)
@@ -1,21 +1,30 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* Menu & MenuBar styles */
 
+.yuimenubar {
+
+    visibility: visible;
+    position: static;
+
+}
+
 .yuimenu .yuimenu,
 .yuimenubar .yuimenu {
 
-    position: absolute;
     visibility: hidden;
+    position: absolute;
+    top: -10000px;
+    left: -10000px;
 
 }
 
-.yuimenubar ul
-.yuimenu ul {
+.yuimenubar li
+.yuimenu li {
 
     list-style-type: none;    
 
@@ -36,13 +45,83 @@ version: 2.3.0
 .yuimenuitemlabel,
 .yuimenubaritemlabel {
 
+    text-align: left;
     white-space: nowrap;
 
 }
 
 
+/* 
+    The following style rule trigger the "hasLayout" property in 
+    IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
+    MenuBar instance's <ul> element, allowing both to clear their floated 
+    child <li> elements.
+*/
+
+.yuimenubar ul {
+
+    *zoom: 1;
+
+}
+
+
+/* 
+    Remove the "hasLayout" trigger for submenus of MenuBar instances as it 
+    is unnecessary. 
+*/
+
+.yuimenubar .yuimenu ul {
+
+    *zoom: normal;
+
+}
+
 /*
-    PLEASE NOTE: The <DIV> element used for a menu's shadow is appended 
+    The following style rule allows a MenuBar instance's <ul> element to clear
+    its floated <li> elements in Firefox, Safari and and Opera.
+*/
+
+.yuimenubar>.bd>ul:after {
+
+    content: ".";
+    display: block;
+    clear: both;
+    visibility: hidden;
+    height: 0;
+    line-height: 0;
+
+}
+
+.yuimenubaritem {
+
+    float: left;
+
+}
+
+.yuimenubaritemlabel,
+.yuimenuitemlabel {
+
+    display: block;
+
+}
+
+.yuimenuitemlabel .helptext {
+
+    font-style: normal;
+    display: block;
+    
+    /*
+        The value for the left margin controls how much the help text is
+        offset from the text of the menu item.  This value will need to 
+        be customized depending on the longest text label of a menu item.
+    */
+    
+    margin: -1em 0 0 10em;
+    
+}
+
+/*
+    PLEASE NOTE: The <div> element used for a menu's shadow is appended 
     to its root element via JavaScript once it has been rendered.  The 
     code that creates the shadow lives in the menu's public "onRender" 
     event handler that is a prototype method of YAHOO.widget.Menu.  
@@ -53,9 +132,20 @@ version: 2.3.0
 .yui-menu-shadow {
 
     position: absolute;
+    visibility: hidden;
+    z-index: -1;
 
 }
 
+.yui-menu-shadow-visible {
+
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    visibility: visible;
+
+}
 
 
 /*
@@ -77,7 +167,7 @@ To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
        as its "visibility" configuration property is toggled between 
        "false" and "true."
     
-    2) The "display" property of <SELECT> elements that are child nodes of the 
+    2) The "display" property of <select> elements that are child nodes of the 
        Menu instance's root element is set to "none" when it is hidden.
 
 PLEASE NOTE:  
@@ -123,19 +213,22 @@ when one of its submenus is visible.
 
 */
 
-.yuimenu.show-scrollbars {
+.yuimenu.show-scrollbars,
+.yuimenubar.show-scrollbars {
 
        overflow: visible; 
 
 }
 
-.yuimenu.hide-scrollbars .yui-menu-shadow {
+.yuimenu.hide-scrollbars .yui-menu-shadow,
+.yuimenubar.hide-scrollbars .yui-menu-shadow {
 
     overflow: hidden;
 
 }
 
-.yuimenu.show-scrollbars .yui-menu-shadow {
+.yuimenu.show-scrollbars .yui-menu-shadow,
+.yuimenubar.show-scrollbars .yui-menu-shadow {
 
     overflow: auto;
 
index 21a0ab9693bed9097eafeaafeea0ca15a5ae309c..68e9571e2d8dcafe40f539471af06619ff6a0ec3 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* Menu & MenuBar styles */
 
-.yuimenu {
+.yuimenubar {
+
+    visibility: visible;
+    position: static;
+
+}
+
+.yuimenu .yuimenu,
+.yuimenubar .yuimenu {
+
+    visibility: hidden;
+    position: absolute;
+    top: -10000px;
+    left: -10000px;
+
+}
+
+.yuimenubar li, 
+.yuimenu li {
+
+    list-style-type: none;    
+
+}
+
+.yuimenubar ul, 
+.yuimenu ul,
+.yuimenubar li, 
+.yuimenu li,
+.yuimenu h6,
+.yuimenubar h6 { 
+
+    margin: 0;
+    padding: 0;
+
+}
+
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
+
+    text-align: left;
+    white-space: nowrap;
+
+}
+
+
+/* 
+    The following style rule trigger the "hasLayout" property in 
+    IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
+    MenuBar instance's <ul> element, allowing both to clear their floated 
+    child <li> elements.
+*/
+
+.yuimenubar ul {
+
+    *zoom: 1;
+
+}
+
+
+/* 
+    Remove the "hasLayout" trigger for submenus of MenuBar instances as it 
+    is unnecessary. 
+*/
 
-    background-color:#f6f7ee;
-    border:solid 1px #c4c4be;
-    padding:1px;
+.yuimenubar .yuimenu ul {
+
+    *zoom: normal;
+
+}
+
+/*
+    The following style rule allows a MenuBar instance's <ul> element to clear
+    its floated <li> elements in Firefox, Safari and and Opera.
+*/
+
+.yuimenubar>.bd>ul:after {
+
+    content: ".";
+    display: block;
+    clear: both;
+    visibility: hidden;
+    height: 0;
+    line-height: 0;
+
+}
+
+.yuimenubaritem {
+
+    float: left;
+
+}
+
+.yuimenubaritemlabel,
+.yuimenuitemlabel {
+
+    display: block;
+
+}
+
+.yuimenuitemlabel .helptext {
+
+    font-style: normal;
+    display: block;
+    
+    /*
+        The value for the left margin controls how much the help text is
+        offset from the text of the menu item.  This value will need to 
+        be customized depending on the longest text label of a menu item.
+    */
+    
+    margin: -1em 0 0 10em;
     
 }
 
+/*
+    PLEASE NOTE: The <div> element used for a menu's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the menu's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Menu.  
+    Implementers wishing to remove a menu's shadow or add any other markup
+    required for a given skin for menu should override the "onRender" method.
+*/
+
+.yui-menu-shadow {
+
+    position: absolute;
+    visibility: hidden;
+    z-index: -1;
+
+}
+
+.yui-menu-shadow-visible {
+
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    visibility: visible;
+
+}
+
+
+/*
+
+There are two known issues with YAHOO.widget.Overlay (the superclass class of 
+Menu) that manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
+
+    1) The "overflow" property of a Menu instance's shadow element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <select> elements that are child nodes of the 
+       Menu instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Menu CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
+*/
+
+.hide-scrollbars * {
+
+       overflow: hidden;
+
+}
+
+.hide-scrollbars select {
+
+       display: none;
+
+}
+
+
 /*
 
 The following style rule (".yuimenu.show-scrollbars") overrides the 
-".show-scrollbars" rule defined in container.css which sets the 
+".show-scrollbars" rule defined in container-core.css which sets the 
 "overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
 "auto" when it is visible.  Without this override, a Menu would have scrollbars
 when one of its submenus is visible.
 
 */
 
-.yuimenu.show-scrollbars {
+.yuimenu.show-scrollbars,
+.yuimenubar.show-scrollbars {
 
        overflow: visible; 
 
 }
 
-.yui-menu-shadow {
+.yuimenu.hide-scrollbars .yui-menu-shadow,
+.yuimenubar.hide-scrollbars .yui-menu-shadow {
 
-    display: none;
+    overflow: hidden;
 
 }
 
-.yuimenu .yuimenu,
-.yuimenubar .yuimenu {
+.yuimenu.show-scrollbars .yui-menu-shadow,
+.yuimenubar.show-scrollbars .yui-menu-shadow {
 
-    position:absolute;
-    visibility:hidden;
+    overflow: auto;
 
 }
 
+
+/* MenuBar style rules */
+
 .yuimenubar {
 
-    background-color:#f6f7ee;
+    background-color: #f6f7ee;
     
 }
 
-.yuimenubar ul {
 
-    *zoom:1;
 
+/* Menu style rules */
+
+.yuimenu {
+
+    background-color: #f6f7ee;
+    border: solid 1px #c4c4be;
+    padding: 1px;
+    
 }
 
-.yuimenubar ul:after {
+.yui-menu-shadow {
 
-    content:".";
-    display:block;
-    clear:both;
-    visibility:hidden;
-    height:0;
-    line-height:0;
+    display: none;
 
 }
 
-.yuimenu h6,
-.yuimenubar h6 { 
+.yuimenu ul {
 
-    font-size:100%;
-    font-weight:normal;
-    margin:0;
-    border:solid 1px #c4c4be;
-    color:#b9b9b9;    
+    border: solid 1px #c4c4be;
+    border-width: 1px 0 0 0;
+    padding: 10px 0;
 
 }
 
-.yuimenubar h6 {
+.yuimenu .yui-menu-body-scrolled {
 
-    float:left;
-    padding:4px 12px;
-    border-width:0 1px 0 0;
+    overflow: hidden;
 
 }
 
-.yuimenubar .yuimenu h6 {
 
-    float:none;
+/* Group titles */
+
+.yuimenu h6,
+.yuimenubar h6 { 
+
+    font-size: 100%;
+    font-weight: normal;
+    border: solid 1px #c4c4be;
+    color: #b9b9b9;    
 
 }
 
-.yuimenu h6 {
+.yuimenubar h6 {
 
-    border-width:1px 0 0 0;
-    padding:5px 10px 0 10px;
+    float: left;
+    padding: 4px 12px;
+    border-width: 0 1px 0 0;
 
 }
 
-.yuimenubar ul {
+.yuimenubar .yuimenu h6 {
 
-    list-style-type:none;
-    margin:0;
-    padding:0;
+    float: none;
 
 }
 
-.yuimenu ul {
+.yuimenu h6 {
 
-    list-style-type:none;
-    border:solid 1px #c4c4be;
-    border-width:1px 0 0 0;
-    margin:0;
-    padding:10px 0;
+    border-width: 1px 0 0 0;
+    padding: 5px 10px 0 10px;
 
 }
 
@@ -121,224 +313,182 @@ when one of its submenus is visible.
 .yuimenu ul.hastitle,
 .yuimenu h6.first-of-type {
 
-    border-width:0;
+    border-width: 0;
 
 }
 
+
+
+/* Top and bottom scroll controls */
+
 .yuimenu .topscrollbar,
 .yuimenu .bottomscrollbar {
 
-    height:16px;
-    background-image:url(map.gif);
-    background-repeat:no-repeat;
+    height: 16px;
+    background-position: center center;
+    background-repeat: no-repeat;
 
 }
 
 .yuimenu .topscrollbar {
 
-    background-image:url(map.gif);
-    background-position:center -72px;
+    background-image: url(menu_up_arrow.png);
 
 }
 
 .yuimenu .topscrollbar_disabled {
 
-    background-image:url(map.gif);
-    background-position:center -88px;
+    background-image: url(menu_up_arrow_disabled.png);
 
 }
 
 .yuimenu .bottomscrollbar {
 
-    background-image:url(map.gif);
-    background-position:center -104px;
+    background-image: url(menu_down_arrow.png);
 
 }
 
 .yuimenu .bottomscrollbar_disabled {
 
-    background-image:url(map.gif);
-    background-position:center -120px;
+    background-image: url(menu_down_arrow_disabled.png);
 
 }
 
 
 /* MenuItem and MenuBarItem styles */
 
-.yuimenubaritem {
+.yuimenuitem {
+
+    /*
+        For IE: Used to collapse superfluous white space between <li> elements
+        that is triggered by the "display" property of the <a> elements being
+        set to "block."
+    */
 
-    float:left;
+    *border-bottom: solid 1px #f6f7ee;
 
 }
 
 .yuimenuitemlabel,
 .yuimenubaritemlabel {
 
-    white-space: nowrap;
-    font-size:85%;
-    display:block;
-    color:#000;
-    text-decoration:none;
+    font-size: 85%;
+    color: #000;
+    text-decoration: none;
 
 }
 
 .yuimenuitemlabel {
 
-    padding:2px 24px;
-    outline:none;
+    padding: 2px 24px;
     
 }
 
 .yuimenubaritemlabel {
 
-    border-width:0 0 0 1px;
-    border-style:solid;
-    border-color:#c4c4be;
-    padding:4px 24px;
-
-}
-
-li.first-of-type .yuimenubaritemlabel {
-
-    border-width:0;
-
-}
-
-.yuimenuitemlabel .helptext {
-
-    font-style:normal;
-    margin:0 0 0 40px;
-    
-}
-
-.yuimenuitemlabel .submenuindicator,
-.yuimenuitemlabel .checkedindicator, 
-.yuimenubaritemlabel .submenuindicator {
-    
-    display:block;
-    height:8px;
-    width:8px;
-    overflow:hidden;
-    vertical-align:middle;
-    text-indent:9px;
-    background-image:url(http://yui.yahooapis.com/2.2.2/build/menu/assets/map.gif);
-    background-repeat:no-repeat;
+    border-width: 0 0 0 1px;
+    border-style: solid;
+    border-color: #c4c4be;
+    padding: 4px 24px;
 
 }
 
-.yuimenubaritemlabel .submenuindicator {
+.yuimenubar li.first-of-type .yuimenubaritemlabel {
 
-    display:-moz-inline-stack; /* Gecko */
-    display:inline-block; /* IE, Opera and Safari */
-    font:0/0 arial; /* Gecko */
+    border-width: 0;
 
 }
 
-.yuimenuitemlabel .submenuindicator {
+.yuimenubaritem-hassubmenu {
 
-    background-position:0 0;
+    background: url(menubaritem_submenuindicator.png) right center no-repeat;
 
 }
 
-.yuimenubaritemlabel .submenuindicator {
+.yuimenuitem-hassubmenu {
 
-    background-position:0 -24px;
-    margin:0 0 0 10px;
+    background: url(menuitem_submenuindicator.png) right center no-repeat;
 
 }
 
-.yuimenuitemlabel .checkedindicator {
+.yuimenuitem-checked {
 
-    background-position:0 -48px;
+    background: url(menuitem_checkbox.png) left center no-repeat;
 
 }
 
-.visible .yuimenuitem,
-.visible .yuimenuitemlabel {
-
-    *zoom:1;
+.yuimenuitemlabel .helptext {
 
+    margin-top: -1.1em;
+    *margin-top: -1.2em;  /* For IE*/
+    
 }
 
-.visible .yuimenuitemlabel .helptext {
 
-    float:right;
-    width:100%;
-    text-align:right;
-    margin:-1.2em 0 0 0;
-    *cursor:hand; /* Required to restore the style of the cursor in IE */
 
-}
+/* MenuItem states */
 
-.visible .yuimenuitemlabel .submenuindicator {
 
-    margin:-.9em -16px 4px auto;
-    *margin:-.9em -16px 0 105%;
+/* Selected MenuItem */
 
-}
+.yuimenubaritem-selected,
+.yuimenuitem-selected {
 
-.visible .yuimenuitemlabel .checkedindicator {
-
-    margin:-.9em auto 4px -16px;
-    *margin-bottom:0;
+    background-color: #8c8ad0;
 
 }
 
+.yuimenubaritemlabel-selected,
+.yuimenuitemlabel-selected {
 
-
-/* Matches selected menu items */
-
-.yuimenuitem a.selected,
-.yuimenubaritem a.selected {
-
-    background-color:#8c8ad0;
-    text-decoration:underline;
-    color:#fff;
+    text-decoration: underline;
+    color: #fff;
 
 }
 
-.yuimenubaritem a.selected .submenuindicator {
+.yuimenubaritem-hassubmenu-selected {
 
-    background-position:0 -32px;
+    background-image: url(menubaritem_submenuindicator_selected.png);
 
 }
 
-.yuimenuitem a.selected .submenuindicator {
+.yuimenuitem-hassubmenu-selected {
 
-    background-position:0 -8px;
+    background-image: url(menuitem_submenuindicator_selected.png);
 
 }
 
-.yuimenuitem a.selected .checkedindicator {
+.yuimenuitem-checked-selected {
 
-    background-position:0 -56px;
+    background-image: url(menuitem_checkbox_selected.png);
 
 }
 
 
-/* Matches disabled menu items */
+/* Disabled MenuItem */
 
-.yuimenubaritem a.disabled .submenuindicator {
+.yuimenubaritemlabel-disabled,
+.yuimenuitemlabel-disabled {
 
-    background-position:0 -40px;
+    cursor: default;
+    color: #b9b9b9;
 
 }
 
-.yuimenuitem a.disabled {
+.yuimenubaritem-hassubmenu-disabled {
 
-    cursor:default;
-    color:#b9b9b9;
+    background-image: url(menubaritem_submenuindicator_disabled.png);
 
 }
 
-.yuimenuitem a.disabled .submenuindicator {
+.yuimenuitem-hassubmenu-disabled {
 
-    background-position:0 -16px;
+    background-image: url(menuitem_submenuindicator_disabled.png);
 
 }
 
-.yuimenuitem a.disabled .checkedindicator {
+.yuimenuitem-checked-disabled {
 
-    background-position:0 -64px;
+    background-image: url(menuitem_checkbox_disabled.png);
 
 }
\ No newline at end of file
diff --git a/lib/yui/menu/assets/menu_down_arrow.png b/lib/yui/menu/assets/menu_down_arrow.png
new file mode 100644 (file)
index 0000000..86d885d
Binary files /dev/null and b/lib/yui/menu/assets/menu_down_arrow.png differ
diff --git a/lib/yui/menu/assets/menu_down_arrow_disabled.png b/lib/yui/menu/assets/menu_down_arrow_disabled.png
new file mode 100644 (file)
index 0000000..98b3988
Binary files /dev/null and b/lib/yui/menu/assets/menu_down_arrow_disabled.png differ
diff --git a/lib/yui/menu/assets/menu_up_arrow.png b/lib/yui/menu/assets/menu_up_arrow.png
new file mode 100644 (file)
index 0000000..d83a6be
Binary files /dev/null and b/lib/yui/menu/assets/menu_up_arrow.png differ
diff --git a/lib/yui/menu/assets/menu_up_arrow_disabled.png b/lib/yui/menu/assets/menu_up_arrow_disabled.png
new file mode 100644 (file)
index 0000000..63b5638
Binary files /dev/null and b/lib/yui/menu/assets/menu_up_arrow_disabled.png differ
diff --git a/lib/yui/menu/assets/menubaritem_submenuindicator.png b/lib/yui/menu/assets/menubaritem_submenuindicator.png
new file mode 100644 (file)
index 0000000..921b267
Binary files /dev/null and b/lib/yui/menu/assets/menubaritem_submenuindicator.png differ
diff --git a/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png b/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..63e0c3c
Binary files /dev/null and b/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png differ
diff --git a/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png b/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png
new file mode 100644 (file)
index 0000000..51078d7
Binary files /dev/null and b/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png differ
diff --git a/lib/yui/menu/assets/menuitem_checkbox.png b/lib/yui/menu/assets/menuitem_checkbox.png
new file mode 100644 (file)
index 0000000..12e74dd
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_checkbox.png differ
diff --git a/lib/yui/menu/assets/menuitem_checkbox_disabled.png b/lib/yui/menu/assets/menuitem_checkbox_disabled.png
new file mode 100644 (file)
index 0000000..0063391
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_checkbox_disabled.png differ
diff --git a/lib/yui/menu/assets/menuitem_checkbox_selected.png b/lib/yui/menu/assets/menuitem_checkbox_selected.png
new file mode 100644 (file)
index 0000000..6f26c81
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_checkbox_selected.png differ
diff --git a/lib/yui/menu/assets/menuitem_submenuindicator.png b/lib/yui/menu/assets/menuitem_submenuindicator.png
new file mode 100644 (file)
index 0000000..ee69fe4
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_submenuindicator.png differ
diff --git a/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png b/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..a0ee793
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png differ
diff --git a/lib/yui/menu/assets/menuitem_submenuindicator_selected.png b/lib/yui/menu/assets/menuitem_submenuindicator_selected.png
new file mode 100644 (file)
index 0000000..a96c7b5
Binary files /dev/null and b/lib/yui/menu/assets/menuitem_submenuindicator_selected.png differ
index 5524977606bc73a333a736e8401252c32c98b7d0..1f46b02cbe3806c953f6dabbdc679a2d5956f91d 100755 (executable)
@@ -1,50 +1,24 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* MenuBar style rules */
 
 .yui-skin-sam .yuimenubar {
 
+    font-size: 93%;  /* 12px */
+    line-height: 2;  /* ~24px */
+    *line-height: 1.9; /* For IE */
     border: solid 1px #808080;
     background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
 
 }
 
-/* 
-    The following two style rules cause a MenuBar's UL to clear its 
-    floating LIs.
-*/
-
-.yui-skin-sam .yuimenubar .bd,
-.yui-skin-sam .yuimenubar ul {
-
-    *zoom: 1;   /* For IE */
-
-}
-
-.yui-skin-sam .yuimenubar>.bd>ul:after {
-
-    content: ".";
-    display: block;
-    clear: both;
-    visibility: hidden;
-    height: 0;
-    line-height: 0;
-
-}
-
 
 /* MenuBarItem style rules */
 
-.yui-skin-sam .yuimenubaritem {
-
-    float: left;
-
-}
-
 .yui-skin-sam .yuimenubarnav .yuimenubaritem {
 
     border-right: solid 1px #ccc;
@@ -53,20 +27,14 @@ version: 2.3.0
 
 .yui-skin-sam .yuimenubaritemlabel {
 
-    display: block;
-    *display: inline-block; /* For IE */
-    font-size: 93%;  /* 12px */
-    line-height: 2;  /* ~24px */
-    *line-height: 1.9; /* For IE */
     padding: 0 10px;
     color: #000;
     text-decoration: none;
-    outline: none;
     cursor: default;
     border-style: solid;
     border-color: #808080;
     border-width: 1px 0;
-    position: relative;
+    *position: relative; /*  Necessary to get negative margins in IE. */
     margin: -1px 0;
 
 }
@@ -75,48 +43,41 @@ version: 2.3.0
 
     padding-right: 20px;
 
-}
-
-.yui-skin-sam .yuimenubaritemlabel .submenuindicator {
-    
     /*
-        Set height and width to 1px so screen readers announce the content of 
-        the element.
+        Prevents the label from shifting left in IE when the 
+        ".yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected" 
+        rule us applied.
     */
 
-    width: 1px;
-    height: 1px;
-    top: 0;
-    left: 0;
+    *display: inline-block;
 
 }
 
-.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator {
-    
-    top: 50%;
-    right: 8px;
-    left: auto; /* Override "left" property set by previous style rule */
-    margin-top: -3px;
-    height: 4px;
-    width: 7px;
-    text-indent: 8px;
-    background-position: -16px -856px;
+.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu {
+
+    background: url(menubaritem_submenuindicator.png) right center no-repeat;
 
 }
 
 
+
 /* MenuBarItem states */
 
 /* Selected MenuBarItem */
 
-.yui-skin-sam .yuimenubaritem a.selected {
+.yui-skin-sam .yuimenubaritem-selected {
 
     background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;
+
+}
+
+.yui-skin-sam .yuimenubaritemlabel-selected {
+
     border-color: #7D98B8;
 
 }
 
-.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected {
+.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected {
 
     border-left-width: 1px;
     margin-left: -1px;
@@ -124,50 +85,45 @@ version: 2.3.0
 
 }
 
-.yui-skin-sam .yuimenubar a.selected .submenuindicator {
 
-    background: transparent;
+/* Disabled  MenuBarItem */
 
-}
+.yui-skin-sam .yuimenubaritemlabel-disabled {
 
-.yui-skin-sam .yuimenubarnav a.selected .submenuindicator {
+    cursor: default;
+    color: #A6A6A6;
 
-    /*
-        Reset the value of the "background" property since it is set to 
-        "transparent" by the previous rule.
-    */
+}
 
-    background: url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px;
+.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled {
+
+    background-image: url(menubaritem_submenuindicator_disabled.png);
 
 }
 
 
-/* Disabled  MenuBarItem */
 
-.yui-skin-sam .yuimenubaritem a.disabled {
+/* Menu style rules */
+
+.yui-skin-sam .yuimenu {
 
-    cursor: default;
-    color: #A6A6A6;
+    font-size: 93%;  /* 12px */
+    line-height: 1.5;  /* 18px */
+    *line-height: 1.45; /* For IE */
 
 }
 
-.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator {
+.yui-skin-sam .yuimenubar .yuimenu,
+.yui-skin-sam .yuimenu .yuimenu {
 
-    background-position: -16px -881px;
+    font-size: 100%;
 
 }
 
-
-/* Menu style rules */
-
 .yui-skin-sam .yuimenu .bd {
 
-    position: relative;
-    top: 0;
-    left: 0;
     border: solid 1px #808080;
     background-color: #fff;
-    z-index: 1;
     
 }
 
@@ -191,10 +147,7 @@ version: 2.3.0
 
 .yui-skin-sam .yuimenu h6 { 
 
-    font-size: 93%;  /* 12px */
     font-weight: bold;
-    line-height: 1.5;  /* 18px */
-    *line-height: 1.45; /* For IE */
     border-style: solid;
     border-color: #ccc;
     border-width: 1px 0 0 0;
@@ -213,10 +166,16 @@ version: 2.3.0
 
 /* Top and bottom scroll controls */
 
+.yui-skin-sam .yuimenu .yui-menu-body-scrolled {
+
+    border-color: #ccc #808080;
+    overflow: hidden;
+
+}
+
 .yui-skin-sam .yuimenu .topscrollbar,
 .yui-skin-sam .yuimenu .bottomscrollbar {
 
-    position: relative;
     height: 16px;
     border: solid 1px #808080;
     background: #fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;
@@ -225,9 +184,7 @@ version: 2.3.0
 
 .yui-skin-sam .yuimenu .topscrollbar {
 
-    z-index: 2;
-    border-bottom-color: #ccc;
-    margin-bottom: -1px;
+    border-bottom-width: 0;
     background-position: center -950px;
 
 }
@@ -240,9 +197,7 @@ version: 2.3.0
 
 .yui-skin-sam .yuimenu .bottomscrollbar {
 
-    z-index: 3;
-    border-top-color: #ccc;
-    margin-top: -1px;
+    border-top-width: 0;
     background-position: center -850px;
 
 }
@@ -256,163 +211,102 @@ version: 2.3.0
 
 /* MenuItem style rules */
 
+.yui-skin-sam .yuimenuitem {
+
+    /*
+        For IE 7 Quirks and IE 6 Strict Mode and Quirks Mode:
+        Used to collapse superfluous white space between <li> elements
+        that is triggered by the "display" property of the <a> elements being
+        set to "block."
+    */
+
+    _border-bottom: solid 1px #fff;
+
+}
+
 .yui-skin-sam .yuimenuitemlabel {
 
-    font-size: 93%;  /* 12px */
-    line-height: 1.5;  /* 18px */
-    *line-height: 1.45; /* For IE */
     padding: 0 20px;
-    display: block;
     color: #000;
     text-decoration: none;
-    outline: none;
-    position: relative;
     cursor: default;
 
 }
 
 .yui-skin-sam .yuimenuitemlabel .helptext {
 
-    font-style: normal;
-    margin: 0 0 0 40px;
+    margin-top: -1.5em;
+    *margin-top: -1.45em;  /* For IE*/
     
 }
 
-.yui-skin-sam .yuimenuitemlabel .submenuindicator,
-.yui-skin-sam .yuimenuitemlabel .checkedindicator,
-.yui-skin-sam .yuimenubaritemlabel .submenuindicator {
-    
-    position: absolute;
-    overflow: hidden;
-    background: url(../../../../assets/skins/sam/sprite.png) no-repeat;
+.yui-skin-sam .yuimenuitem-hassubmenu {
 
-}
-
-.yui-skin-sam .yuimenuitemlabel .submenuindicator {
-
-    top: 50%;
-    right: 8px;
-    margin-top: -3px;
-    height: 7px;
-    width: 4px;
-    text-indent: 5px;
-    background-position: 0 -906px;
+    background-image: url(menuitem_submenuindicator.png);
+    background-position: right center;
+    background-repeat: no-repeat;
 
 }
 
-.yui-skin-sam .yuimenuitemlabel .checkedindicator {
+.yui-skin-sam .yuimenuitem-checked {
 
-    top: 50%;
-    left: 8px;
-    margin-top: -3px;
-    height: 7px;
-    width: 7px;
-    text-indent: 8px;
-    background-position: 0 -1006px;
+    background-image: url(menuitem_checkbox.png);
+    background-position: left center;
+    background-repeat: no-repeat;
 
 }
 
 
 /* Menu states */
 
+
 /* Visible Menu */
 
 .yui-skin-sam .yui-menu-shadow-visible {
 
-    top: 2px;
-    right: -3px;
-    left: -3px;
-    bottom: -3px;
     background-color: #000;
-    opacity: .12;
-    *filter: alpha(opacity=12);  /* For IE */
-    visibility: visible;
-
-}
-
-.yui-skin-sam .visible .bd,
-.yui-skin-sam .visible .yuimenuitem {
-
-    _zoom: 1;   /* For IE 7 Quirks Mode and IE 6 Standards and Quirks Mode */
-
-}
-
-.yui-skin-sam .visible .yuimenuitemlabel {
-
-    *zoom: 1;   /* For IE */
-
-}
-
-.yui-skin-sam .visible .yuimenuitemlabel .helptext {
-
-    float: right;
-    width: 100%;
-    text-align: right;
-    margin: -1.5em 0 0 0;
-    *margin: -1.45em 0 0 0;  /* For IE*/
-
-}
-
-
-/* MenuItem states */
-
-/* Selected MenuItem */
-
-.yui-skin-sam .yuimenuitem a.selected {
 
     /*
-        Use "background" over "background-color" to clear background imag
-        set by the ".yuimenubaritem a.selected" rule.
+        Opacity can be expensive, so defer the use of opacity until th
+        menu is visible.
     */
 
-    background: #B3D4FF;
+    opacity: .12;
+    *filter: alpha(opacity=12);  /* For IE */
 
 }
 
-/*
-    Redefine the background for MenuItem instances that are children of
-    a Menubar since the 
-    ".yui-skin-sam .yuimenubar a.selected .submenuindicator" rule sets the 
-    "background" property to "transparent"
-*/
 
-.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator {
 
-    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px;
+/* MenuItem states */
 
-}
 
-/*
-    Remove borders and margin added by the style rule 
-    ".yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected"
-*/
+/* Selected MenuItem */
 
-.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected {
+.yui-skin-sam .yuimenuitem-selected {
 
-    border-width: 0;
-    margin: 0;
-    *left: 0;   /* For IE */
+    background-color: #B3D4FF;
 
 }
 
 
 /* Disabled MenuItem */
 
-.yui-skin-sam .yuimenuitem a.disabled {
+.yui-skin-sam .yuimenuitemlabel-disabled {
 
     cursor: default;
     color: #A6A6A6;
 
 }
 
-.yui-skin-sam .yuimenuitem a.disabled .submenuindicator {
+.yui-skin-sam .yuimenuitem-hassubmenu-disabled {
 
-    background-position: 0 -931px;
+    background-image: url(menuitem_submenuindicator_disabled.png);
 
 }
 
-.yui-skin-sam .yuimenuitem a.disabled .checkedindicator {
+.yui-skin-sam .yuimenuitem-checked-disabled {
 
-    background-position: 0 -1031px;
+    background-image: url(menuitem_checkbox_disabled.png);
 
 }
\ No newline at end of file
index 61d063bdc0b34e113698b0f8f84ecd69b05d29d3..8a3c43376e07bd7ab520e8478b9c28df1e0eff9e 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(../../../../assets/skins/sam/sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
+.yuimenubar{visibility:visible;position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{visibility:hidden;position:absolute;top:-10000px;left:-10000px;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);}
diff --git a/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png b/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png
new file mode 100644 (file)
index 0000000..030941c
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png differ
diff --git a/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..6c16122
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png differ
diff --git a/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png b/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png
new file mode 100644 (file)
index 0000000..1437a4f
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png differ
diff --git a/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png b/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png
new file mode 100644 (file)
index 0000000..5d5b998
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png differ
diff --git a/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png b/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png
new file mode 100644 (file)
index 0000000..ea4f660
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png differ
diff --git a/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png b/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png
new file mode 100644 (file)
index 0000000..427d60a
Binary files /dev/null and b/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png differ
index 44fdcfe426f5b9966c2a125f704412b51e401fbb..f0818e08becde8f9039662f70661201a9716504d 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
 
@@ -14,7 +14,6 @@ version: 2.3.0
 * context menus, or application-style menu bars with just a small amount of 
 * scripting.</p><p>The Menu family of controls features:</p>
 * <ul>
-*    <li>Screen-reader accessibility.</li>
 *    <li>Keyboard and mouse navigation.</li>
 *    <li>A rich event model that provides access to all of a menu's 
 *    interesting moments.</li>
@@ -270,11 +269,11 @@ version: 2.3.0
                     dynamically positioned menus
                 */
                 
-                for (var i in m_oMenus) {
+                for (var i in m_oVisibleMenus) {
         
-                    if (YAHOO.lang.hasOwnProperty(m_oMenus,i)) {
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
         
-                        oMenu = m_oMenus[i];
+                        oMenu = m_oVisibleMenus[i];
         
                         if (oMenu.cfg.getProperty("clicktohide") && 
                             !(oMenu instanceof YAHOO.widget.MenuBar) && 
@@ -417,22 +416,31 @@ version: 2.3.0
         */
         function onItemDestroy(p_sType, p_aArgs) {
     
-            var sId = this.id;
+            removeItem(this);
+    
+        }
+
+    
+        function removeItem(p_oMenuItem) {
+
+            var sId = p_oMenuItem.id;
     
             if (sId && m_oItems[sId]) {
     
-                if (m_oFocusedMenuItem == this) {
+                if (m_oFocusedMenuItem == p_oMenuItem) {
     
                     m_oFocusedMenuItem = null;
     
                 }
     
                 delete m_oItems[sId];
+                
+                p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy);
     
-                m_oLogger.log(this + " successfully unregistered.");
+                m_oLogger.log(p_oMenuItem + " successfully unregistered.");
     
             }
-    
+
         }
     
     
@@ -484,11 +492,8 @@ version: 2.3.0
     
                 var oDoc;
     
-                if (
-                    p_oMenu instanceof YAHOO.widget.Menu && 
-                    p_oMenu.id && 
-                    !m_oMenus[p_oMenu.id]
-                ) {
+                if (p_oMenu instanceof YAHOO.widget.Menu && p_oMenu.id && 
+                    !m_oMenus[p_oMenu.id]) {
         
                     m_oMenus[p_oMenu.id] = p_oMenu;
                 
@@ -513,14 +518,11 @@ version: 2.3.0
             
                     }
             
-                    p_oMenu.destroyEvent.subscribe(
-                                            onMenuDestroy, 
-                                            p_oMenu, 
-                                            this);
-    
-                    p_oMenu.cfg.subscribeToConfigEvent(
-                        "visible", 
+                    p_oMenu.cfg.subscribeToConfigEvent("visible", 
                         onMenuVisibleConfigChange);
+
+                    p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, 
+                                            this);
             
                     p_oMenu.itemAddedEvent.subscribe(onItemAdded);
                     p_oMenu.focusEvent.subscribe(onMenuFocus);
@@ -541,30 +543,72 @@ version: 2.3.0
             */
             removeMenu: function (p_oMenu) {
     
-                var sId;
+                var sId,
+                    aItems,
+                    i;
         
                 if (p_oMenu) {
     
                     sId = p_oMenu.id;
         
                     if (m_oMenus[sId] == p_oMenu) {
-            
+
+                        // Unregister each menu item
+
+                        aItems = p_oMenu.getItems();
+
+                        if (aItems && aItems.length > 0) {
+
+                            i = aItems.length - 1;
+
+                            do {
+
+                                removeItem(aItems[i]);
+
+                            }
+                            while (i--);
+
+                        }
+
+
+                        // Unregister the menu
+
                         delete m_oMenus[sId];
             
                         m_oLogger.log(p_oMenu + " successfully unregistered.");
         
-        
+
+                        /*
+                             Unregister the menu from the collection of 
+                             visible menus
+                        */
+
                         if (m_oVisibleMenus[sId] == p_oMenu) {
             
                             delete m_oVisibleMenus[sId];
                             
-                            m_oLogger.log( 
-                                        p_oMenu + 
-                                        " unregistered from the" + 
+                            m_oLogger.log(p_oMenu + " unregistered from the" + 
                                         " collection of visible menus.");
-                                
+       
                         }
-            
+
+
+                        // Unsubscribe event listeners
+
+                        if (p_oMenu.cfg) {
+
+                            p_oMenu.cfg.unsubscribeFromConfigEvent("visible", 
+                                onMenuVisibleConfigChange);
+                            
+                        }
+
+                        p_oMenu.destroyEvent.unsubscribe(onMenuDestroy, 
+                            p_oMenu);
+                
+                        p_oMenu.itemAddedEvent.unsubscribe(onItemAdded);
+                        p_oMenu.focusEvent.unsubscribe(onMenuFocus);
+                        p_oMenu.blurEvent.unsubscribe(onMenuBlur);
+
                     }
                 
                 }
@@ -583,7 +627,7 @@ version: 2.3.0
         
                 for (var i in m_oVisibleMenus) {
         
-                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)) {
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
         
                         oMenu = m_oVisibleMenus[i];
         
@@ -599,11 +643,24 @@ version: 2.3.0
                 }        
     
             },
-    
+
+
+            /**
+            * @method getVisible
+            * @description Returns a collection of all visible menus registered
+            * with the menu manger.
+            * @return {Array}
+            */
+            getVisible: function () {
+            
+                return m_oVisibleMenus;
+            
+            },
+
     
             /**
             * @method getMenus
-            * @description Returns an array of all menus registered with the 
+            * @description Returns a collection of all menus registered with the 
             * menu manger.
             * @return {Array}
             */
@@ -838,6 +895,7 @@ var Dom = YAHOO.util.Dom,
     MenuManager = YAHOO.widget.MenuManager,
     CustomEvent = YAHOO.util.CustomEvent,
     Lang = YAHOO.lang,
+    UA = YAHOO.env.ua,
     
     m_oShadowTemplate,
 
@@ -897,19 +955,22 @@ var Dom = YAHOO.util.Dom,
     
         "SUBMENU_ALIGNMENT": { 
             key: "submenualignment", 
-            value: ["tl","tr"]
+            value: ["tl","tr"],
+            suppressEvent: true
         },
     
         "AUTO_SUBMENU_DISPLAY": { 
             key: "autosubmenudisplay", 
             value: true, 
-            validator: Lang.isBoolean 
+            validator: Lang.isBoolean,
+            suppressEvent: true
         }, 
     
         "SHOW_DELAY": { 
             key: "showdelay", 
             value: 250, 
-            validator: Lang.isNumber 
+            validator: Lang.isNumber, 
+            suppressEvent: true
         }, 
     
         "HIDE_DELAY": { 
@@ -922,36 +983,58 @@ var Dom = YAHOO.util.Dom,
         "SUBMENU_HIDE_DELAY": { 
             key: "submenuhidedelay", 
             value: 250, 
-            validator: Lang.isNumber
+            validator: Lang.isNumber,
+            suppressEvent: true
         }, 
     
         "CLICK_TO_HIDE": { 
             key: "clicktohide", 
             value: true, 
-            validator: Lang.isBoolean
+            validator: Lang.isBoolean,
+            suppressEvent: true
         },
     
         "CONTAINER": { 
-            key: "container"
+            key: "container",
+            suppressEvent: true
         }, 
+
+        "SCROLL_INCREMENT": { 
+            key: "scrollincrement", 
+            value: 1, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },
+
+        "MIN_SCROLL_HEIGHT": { 
+            key: "minscrollheight", 
+            value: 90, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },    
     
         "MAX_HEIGHT": { 
             key: "maxheight", 
             value: 0, 
             validator: Lang.isNumber,
-            supercedes: ["iframe"]
+            supercedes: ["iframe"],
+            suppressEvent: true
         }, 
     
         "CLASS_NAME": { 
             key: "classname", 
             value: null, 
-            validator: Lang.isString
+            validator: Lang.isString,
+            suppressEvent: true
         }, 
     
         "DISABLED": { 
             key: "disabled", 
             value: false, 
-            validator: Lang.isBoolean
+            validator: Lang.isBoolean,
+            suppressEvent: true
         }
     
     };
@@ -999,6 +1082,17 @@ ITEM_TYPE: null,
 GROUP_TITLE_TAG_NAME: "h6",
 
 
+/**
+* @property OFF_SCREEN_POSITION
+* @description Array representing the default x and y position that a menu 
+* should have when it is positioned outside the viewport by the 
+* "poistionOffScreen" method.
+* @default [-10000, -10000]
+* @final
+* @type Array
+*/
+OFF_SCREEN_POSITION: [-10000, -10000],
+
 
 // Private properties
 
@@ -1124,17 +1218,6 @@ _aListElements: null,
 _nCurrentMouseX: 0,
 
 
-/**
-* @property _nMaxHeight
-* @description The original value of the "maxheight" configuration property 
-* as set by the user.
-* @default -1
-* @private
-* @type Number
-*/
-_nMaxHeight: -1,
-
-
 /**
 * @property _bStopMouseEventHandlers
 * @description Stops "mouseover," "mouseout," and "mousemove" event handlers 
@@ -1156,15 +1239,6 @@ _bStopMouseEventHandlers: false,
 _sClassName: null,
 
 
-/**
-* @property _bDisabled
-* @description The current value of the "disabled" configuration attribute.
-* @default false
-* @private
-* @type Boolean
-*/
-_bDisabled: false,
-
 
 // Public properties
 
@@ -1459,16 +1533,21 @@ init: function (p_oElement, p_oConfig) {
         this.renderEvent.subscribe(this._onRender);
         this.renderEvent.subscribe(this.onRender);
         this.beforeShowEvent.subscribe(this._onBeforeShow);
+        this.hideEvent.subscribe(this.positionOffScreen);
         this.showEvent.subscribe(this._onShow);
         this.beforeHideEvent.subscribe(this._onBeforeHide);
-        this.hideEvent.subscribe(this._onHide);
         this.mouseOverEvent.subscribe(this._onMouseOver);
         this.mouseOutEvent.subscribe(this._onMouseOut);
         this.clickEvent.subscribe(this._onClick);
         this.keyDownEvent.subscribe(this._onKeyDown);
         this.keyPressEvent.subscribe(this._onKeyPress);
+        
+
+        if (UA.gecko || UA.webkit) {
 
-        Module.textResizeEvent.subscribe(this._onTextResize, this, true);
+            this.cfg.subscribeToConfigEvent("y", this._onYChange);
+
+        }
 
 
         if (p_oConfig) {
@@ -1725,7 +1804,6 @@ _getFirstEnabledItem: function () {
 _addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) {
 
     var oItem,
-        bDisabled = this.cfg.getProperty("disabled"),
         nGroupIndex,
         aGroup,
         oGroupItem,
@@ -2162,17 +2240,15 @@ _configureSubmenu: function (p_oItem) {
 
         this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true);
 
-        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow, null, 
-            oSubmenu);
-
-        oSubmenu.showEvent.subscribe(this._onSubmenuShow, null, p_oItem);
-        oSubmenu.hideEvent.subscribe(this._onSubmenuHide, null, p_oItem);
+        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow);
 
     }
 
 },
 
 
+
+
 /**
 * @method _subscribeToItemEvents
 * @description Subscribes a menu to a menu item's event.
@@ -2186,124 +2262,14 @@ _subscribeToItemEvents: function (p_oItem) {
 
     p_oItem.blurEvent.subscribe(this._onMenuItemBlur);
 
+    p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy, p_oItem, this);
+
     p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,
         p_oItem, this);
 
 },
 
 
-/**
-* @method _getOffsetWidth
-* @description Returns the offset width of the menu's 
-* <code>&#60;div&#62;</code> element.
-* @private
-*/
-_getOffsetWidth: function () {
-
-    var oClone = this.element.cloneNode(true);
-
-    Dom.removeClass(oClone, "visible");
-
-    Dom.setStyle(oClone, "width", "");
-
-    document.body.appendChild(oClone);
-
-    var sWidth = oClone.offsetWidth;
-
-    document.body.removeChild(oClone);
-
-    return sWidth;
-
-},
-
-
-/**
-* @method _setWidth
-* @description Sets the width of the menu's root <code>&#60;div&#62;</code> 
-* element to its offsetWidth.
-* @private
-*/
-_setWidth: function () {
-
-    var oElement = this.element,
-        bVisible = false,
-        sWidth;
-
-    if (oElement.parentNode.tagName.toUpperCase() == "BODY") {
-
-        if (YAHOO.env.ua.opera) {
-
-            sWidth = this._getOffsetWidth();
-        
-        }
-        else {
-
-            if (Dom.hasClass(oElement, "visible")) {
-
-                bVisible = true;
-                
-                Dom.removeClass(oElement, "visible");
-
-            }
-
-            Dom.setStyle(oElement, "width", "auto");
-            
-            sWidth = oElement.offsetWidth;
-        
-        }
-
-    }
-    else {
-    
-        sWidth = this._getOffsetWidth();
-    
-    }
-
-    this.cfg.setProperty("width", (sWidth + "px"));
-    
-
-    if (bVisible) {
-    
-        Dom.addClass(oElement, "visible");
-    
-    }
-
-},
-
-
-/**
-* @method _onWidthChange
-* @description Change event handler for the the menu's "width" configuration
-* property.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onWidthChange: function (p_sType, p_aArgs) {
-
-    var sWidth = p_aArgs[0];
-    
-    if (sWidth && !this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.subscribe(this._setWidth);
-        this.itemRemovedEvent.subscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = true;
-
-    }
-    else if (this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.unsubscribe(this._setWidth);
-        this.itemRemovedEvent.unsubscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = false;
-
-    }
-
-},
-
-
 /**
 * @method _onVisibleChange
 * @description Change event handler for the the menu's "visible" configuration
@@ -2581,7 +2547,11 @@ _onMouseOver: function (p_sType, p_aArgs) {
         Event.on(this.element, "mousemove", this._onMouseMove, this, true);
 
 
-        this.clearActiveItem();
+               if (!Dom.isAncestor(oItem.element, Event.getRelatedTarget(oEvent))) {
+
+               this.clearActiveItem();
+        
+        }
 
 
         if (this.parent && this._nSubmenuHideDelayId) {
@@ -2811,88 +2781,102 @@ _onMouseMove: function (p_oEvent, p_oMenu) {
 */
 _onClick: function (p_sType, p_aArgs) {
 
-    var oEvent = p_aArgs[0],
-        oItem = p_aArgs[1],
-        oTarget,
-        oItemCfg,
-        oSubmenu,
-        sURL,
-        oRoot;
-
-
-    if (oItem && !oItem.cfg.getProperty("disabled")) {
-
-        oTarget = Event.getTarget(oEvent);
-        oItemCfg = oItem.cfg;
-        oSubmenu = oItemCfg.getProperty("submenu");
-
-
-        /*
-            ACCESSIBILITY FEATURE FOR SCREEN READERS: 
-            Expand/collapse the submenu when the user clicks 
-            on the submenu indicator image.
-        */        
-
-        if (oTarget == oItem.submenuIndicator && oSubmenu) {
-
-            if (oSubmenu.cfg.getProperty("visible")) {
-
-                oSubmenu.hide();
-                
-                oSubmenu.parent.focus();
-    
-            }
-            else {
-
-                this.clearActiveItem();
-
-                oItemCfg.setProperty("selected", true);
-
-                oSubmenu.show();
-                
-                oSubmenu.setInitialFocus();
-    
-            }
-
-            Event.preventDefault(oEvent);
-    
-        }
-        else {
-
-            sURL = oItemCfg.getProperty("url");
-
-            //  Prevent the browser from following links equal to "#"
-            
-            if ((sURL.substr((sURL.length-1),1) == "#")) {
-
-                Event.preventDefault(oEvent);
-
-                oItem.focus();
-            
-            }
-
-
-            if (!oSubmenu) {
-    
-                oRoot = this.getRoot();
-                
-                if (oRoot instanceof YAHOO.widget.MenuBar || 
-                    oRoot.cfg.getProperty("position") == "static") {
-    
-                    oRoot.clearActiveItem();
-    
-                }
-                else if (oRoot.cfg.getProperty("clicktohide")) {
+       var Event = YAHOO.util.Event,
+               Dom = YAHOO.util.Dom,
+               oEvent = p_aArgs[0],
+               oItem = p_aArgs[1],
+               oSubmenu,
+               bInMenuAnchor = false,
+               oRoot,
+               sId,
+               sURL,
+               nHashPos,
+               nLen;
+
+
+       if (oItem) {
+       
+               if (oItem.cfg.getProperty("disabled")) {
+               
+                       Event.preventDefault(oEvent);
+
+               }
+               else {
+
+                       oSubmenu = oItem.cfg.getProperty("submenu");
+       
+                       
+                       /*
+                                Check if the URL of the anchor is pointing to an element that is 
+                                a child of the menu.
+                       */
+                       
+                       sURL = oItem.cfg.getProperty("url");
+
+               
+                       if (sURL) {
+       
+                               nHashPos = sURL.indexOf("#");
+       
+                               nLen = sURL.length;
+       
+       
+                               if (nHashPos != -1) {
+       
+                                       sURL = sURL.substr(nHashPos, nLen);
+               
+                                       nLen = sURL.length;
+       
+       
+                                       if (nLen > 1) {
+       
+                                               sId = sURL.substr(1, nLen);
+       
+                                               bInMenuAnchor = Dom.isAncestor(this.element, sId);
+                                               
+                                       }
+                                       else if (nLen === 1) {
+       
+                                               bInMenuAnchor = true;
+                                       
+                                       }
+       
+                               }
+                       
+                       }
 
-                    oRoot.hide();
-                
-                }
-    
-            }
 
-        }                    
-    
-    }
+       
+                       if (bInMenuAnchor && !oItem.cfg.getProperty("target")) {
+       
+                               Event.preventDefault(oEvent);
+       
+                               oItem.focus();
+                       
+                       }
+       
+       
+                       if (!oSubmenu) {
+       
+                               oRoot = this.getRoot();
+                               
+                               if (oRoot instanceof YAHOO.widget.MenuBar || 
+                                       oRoot.cfg.getProperty("position") == "static") {
+       
+                                       oRoot.clearActiveItem();
+       
+                               }
+                               else {
+       
+                                       oRoot.hide();
+                               
+                               }
+       
+                       }
+                       
+               }
+       
+       }
 
 },
 
@@ -3226,38 +3210,52 @@ _onKeyPress: function (p_sType, p_aArgs) {
 
 
 /**
-* @method _onTextResize
-* @description "textresize" event handler for the menu.
+* @method _onYChange
+* @description "y" event handler for a Menu instance.
 * @protected
-* @param {String} p_sType String representing the name of the event that 
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
 * was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onTextResize: function (p_sType, p_aArgs, p_oMenu) {
-
-    if (YAHOO.env.ua.gecko && !this._handleResize) {
-
-        this._handleResize = true;
-        return;
-    
-    }
+_onYChange: function (p_sType, p_aArgs) {
 
+    var oParent = this.parent,
+        nScrollTop,
+        oIFrame,
+        nY;
 
-    var oConfig = this.cfg;
 
-    if (oConfig.getProperty("position") == "dynamic") {
+    if (oParent) {
 
-        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));
+        nScrollTop = oParent.parent.body.scrollTop;
 
-    }
 
-},
+        if (nScrollTop > 0) {
+    
+            nY = (this.cfg.getProperty("y") - nScrollTop);
+            
+            Dom.setY(this.element, nY);
 
+            oIFrame = this.iframe;            
+    
 
-/**
-* @method _onScrollTargetMouseOver
+            if (oIFrame) {
+    
+                Dom.setY(oIFrame, nY);
+    
+            }
+            
+            this.cfg.setProperty("y", nY, true);
+        
+        }
+    
+    }
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOver
 * @description "mouseover" event handler for the menu's "header" and "footer" 
 * elements.  Used to scroll the body of the menu up and down when the 
 * menu's "maxheight" configuration property is set to a value greater than 0.
@@ -3274,6 +3272,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
     var oTarget = Event.getTarget(p_oEvent),
         oBody = this.body,
         me = this,
+        nScrollIncrement = this.cfg.getProperty("scrollincrement"),
         nScrollTarget,
         fnScrollFunction;
 
@@ -3285,7 +3284,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
 
         if (nScrollTop < nScrollTarget) {
 
-            oBody.scrollTop = (nScrollTop + 1);
+            oBody.scrollTop = (nScrollTop + nScrollIncrement);
 
             me._enableScrollHeader();
 
@@ -3310,7 +3309,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
 
         if (nScrollTop > 0) {
 
-            oBody.scrollTop = (nScrollTop - 1);
+            oBody.scrollTop = (nScrollTop - nScrollIncrement);
 
             me._enableScrollFooter();
 
@@ -3381,7 +3380,6 @@ _onScrollTargetMouseOut: function (p_oEvent, p_oMenu) {
 */
 _onInit: function (p_sType, p_aArgs) {
 
-    this.cfg.subscribeToConfigEvent("width", this._onWidthChange);
     this.cfg.subscribeToConfigEvent("visible", this._onVisibleChange);
 
     var bRootMenu = !this.parent,
@@ -3441,8 +3439,7 @@ _onInit: function (p_sType, p_aArgs) {
 */
 _onBeforeRender: function (p_sType, p_aArgs) {
 
-    var oConfig = this.cfg,
-        oEl = this.element,
+    var oEl = this.element,
         nListElements = this._aListElements.length,
         bFirstList = true,
         i = 0,
@@ -3509,16 +3506,22 @@ _onBeforeRender: function (p_sType, p_aArgs) {
 */
 _onRender: function (p_sType, p_aArgs) {
 
-    if (this.cfg.getProperty("position") == "dynamic" && 
-        !this.cfg.getProperty("width")) {
+    if (this.cfg.getProperty("position") == "dynamic") { 
+
+        if (!this.cfg.getProperty("visible")) {
+
+            this.positionOffScreen();
 
-        this._setWidth();
+        }
     
     }
 
 },
 
 
+
+
+
 /**
 * @method _onBeforeShow
 * @description "beforeshow" event handler for the menu.
@@ -3533,8 +3536,6 @@ _onBeforeShow: function (p_sType, p_aArgs) {
         n,
         nViewportHeight,
         oRegion,
-        nMaxHeight,
-        oBody,
         oSrcElement;
 
 
@@ -3611,7 +3612,6 @@ _onBeforeShow: function (p_sType, p_aArgs) {
             else {
 
                 this.render(this.cfg.getProperty("container"));
-                this.cfg.refireEvent("xy");
 
             }                
 
@@ -3620,55 +3620,65 @@ _onBeforeShow: function (p_sType, p_aArgs) {
     }
 
 
-    if (!(this instanceof YAHOO.widget.MenuBar) && 
-        this.cfg.getProperty("position") == "dynamic") {
-
-        nViewportHeight = Dom.getViewportHeight();
+    var nMaxHeight = this.cfg.getProperty("maxheight"),
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        bDynamicPos = this.cfg.getProperty("position") == "dynamic";
 
 
-        if (this.parent && this.parent.parent instanceof YAHOO.widget.MenuBar) {
-           
-            oRegion = YAHOO.util.Region.getRegion(this.parent.element);
-            
-            nViewportHeight = (nViewportHeight - oRegion.bottom);
+    if (!this.parent && bDynamicPos) {
 
-        }
+        this.cfg.refireEvent("xy");
+   
+    }
 
 
-        if (this.element.offsetHeight >= nViewportHeight) {
+    function clearMaxHeight() {
     
-            nMaxHeight = this.cfg.getProperty("maxheight");
-
-            /*
-                Cache the original value for the "maxheight" configuration  
-                property so that we can set it back when the menu is hidden.
-            */
+        this.cfg.setProperty("maxheight", 0);
+    
+        this.hideEvent.unsubscribe(clearMaxHeight);
     
-            this._nMaxHeight = nMaxHeight;
+    }
 
-            this.cfg.setProperty("maxheight", (nViewportHeight - 20));
-        
-        }
+
+    if (!(this instanceof YAHOO.widget.MenuBar) && bDynamicPos) {
+
+
+        if (nMaxHeight === 0) {
+
+            nViewportHeight = Dom.getViewportHeight();
     
     
-        if (this.cfg.getProperty("maxheight") > 0) {
+            if (this.parent && 
+                this.parent.parent instanceof YAHOO.widget.MenuBar) {
+               
+                oRegion = YAHOO.util.Region.getRegion(this.parent.element);
+                
+                nViewportHeight = (nViewportHeight - oRegion.bottom);
     
-            oBody = this.body;
+            }
     
-            if (oBody.scrollTop > 0) {
     
-                oBody.scrollTop = 0;
+            if (this.element.offsetHeight >= nViewportHeight) {
     
-            }
+                nMaxHeight = (nViewportHeight - (Overlay.VIEWPORT_OFFSET * 2));
 
-            this._disableScrollHeader();
-            this._enableScrollFooter();
-    
+                if (nMaxHeight < nMinScrollHeight) {
+
+                    nMaxHeight = nMinScrollHeight;
+                
+                }
+
+                this.cfg.setProperty("maxheight", nMaxHeight);
+
+                this.hideEvent.subscribe(clearMaxHeight);
+
+            }
+        
         }
 
     }
 
-
 },
 
 
@@ -3791,27 +3801,6 @@ _onBeforeHide: function (p_sType, p_aArgs) {
 },
 
 
-/**
-* @method _onHide
-* @description "hide" event handler for the menu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onHide: function (p_sType, p_aArgs) {
-
-    if (this._nMaxHeight != -1) {
-
-        this.cfg.setProperty("maxheight", this._nMaxHeight);
-
-        this._nMaxHeight = -1;
-
-    }
-
-},
-
-
 /**
 * @method _onParentMenuConfigChange
 * @description "configchange" event handler for a submenu.
@@ -3837,6 +3826,8 @@ _onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
         case "clicktohide":
         case "effect":
         case "classname":
+        case "scrollincrement":
+        case "minscrollheight":
 
             p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);
                 
@@ -3860,45 +3851,37 @@ _onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
 */
 _onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
 
-    var oParentMenu = p_oSubmenu.parent.parent,
+    var oParentCfg = p_oSubmenu.parent.parent.cfg,
 
         oConfig = {
 
-            constraintoviewport: 
-                oParentMenu.cfg.getProperty("constraintoviewport"),
+            constraintoviewport: oParentCfg.getProperty("constraintoviewport"),
 
             xy: [0,0],
+
+            clicktohide: oParentCfg.getProperty("clicktohide"),
                 
-            clicktohide: oParentMenu.cfg.getProperty("clicktohide"),
-                
-            effect: oParentMenu.cfg.getProperty("effect"),
+            effect: oParentCfg.getProperty("effect"),
 
-            showdelay: oParentMenu.cfg.getProperty("showdelay"),
+            showdelay: oParentCfg.getProperty("showdelay"),
             
-            hidedelay: oParentMenu.cfg.getProperty("hidedelay"),
+            hidedelay: oParentCfg.getProperty("hidedelay"),
 
-            submenuhidedelay: oParentMenu.cfg.getProperty("submenuhidedelay"),
+            submenuhidedelay: oParentCfg.getProperty("submenuhidedelay"),
 
-            classname: oParentMenu.cfg.getProperty("classname")
+            classname: oParentCfg.getProperty("classname"),
+            
+            scrollincrement: oParentCfg.getProperty("scrollincrement"),
+            
+            minscrollheight: oParentCfg.getProperty("minscrollheight"),
+            
+            iframe: oParentCfg.getProperty("iframe")
 
         },
         
         oLI;
 
 
-    /*
-        Only sync the "iframe" configuration property if the parent
-        menu's "position" configuration is the same.
-    */
-
-    if (this.cfg.getProperty("position") == 
-        oParentMenu.cfg.getProperty("position")) {
-
-        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");
-    
-    }
-               
-
     p_oSubmenu.cfg.applyConfig(oConfig);
 
 
@@ -3931,19 +3914,20 @@ _onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
 _onSubmenuBeforeShow: function (p_sType, p_aArgs) {
-    
+
     var oParent = this.parent,
         aAlignment = oParent.parent.cfg.getProperty("submenualignment");
 
-    this.cfg.setProperty("context", 
-        [oParent.element, aAlignment[0], aAlignment[1]]);
-
 
-    var nScrollTop = oParent.parent.body.scrollTop;
+    if (!this.cfg.getProperty("context")) {
+    
+        this.cfg.setProperty("context", 
+            [oParent.element, aAlignment[0], aAlignment[1]]);
 
-    if ((YAHOO.env.ua.gecko || YAHOO.env.ua.webkit) && nScrollTop > 0) {
+    }
+    else {
 
-         this.cfg.setProperty("y", (this.cfg.getProperty("y") - nScrollTop));
+        this.align();
     
     }
 
@@ -3951,61 +3935,48 @@ _onSubmenuBeforeShow: function (p_sType, p_aArgs) {
 
 
 /**
-* @method _onSubmenuShow
-* @description "show" event handler for a submenu.
+* @method _onMenuItemFocus
+* @description "focus" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onSubmenuShow: function (p_sType, p_aArgs) {
-    
-    this.submenuIndicator.innerHTML = this.EXPANDED_SUBMENU_INDICATOR_TEXT;
-
-},
-
+_onMenuItemFocus: function (p_sType, p_aArgs) {
 
-/**
-* @method _onSubmenuHide
-* @description "hide" Custom Event handler for a submenu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onSubmenuHide: function (p_sType, p_aArgs) {
-    
-    this.submenuIndicator.innerHTML = this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+    this.parent.focusEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemFocus
-* @description "focus" event handler for the menu's items.
+* @method _onMenuItemBlur
+* @description "blur" event handler for the menu's items.
 * @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
+* @param {String} p_sType String representing the name of the event 
+* that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onMenuItemFocus: function (p_sType, p_aArgs) {
+_onMenuItemBlur: function (p_sType, p_aArgs) {
 
-    this.parent.focusEvent.fire(this);
+    this.parent.blurEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemBlur
-* @description "blur" event handler for the menu's items.
+* @method _onMenuItemDestroy
+* @description "destroy" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event 
 * that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
+* that fired the event.
 */
-_onMenuItemBlur: function (p_sType, p_aArgs) {
+_onMenuItemDestroy: function (p_sType, p_aArgs, p_oItem) {
 
-    this.parent.blurEvent.fire(this);
+    this._removeItemFromGroupByValue(p_oItem.groupIndex, p_oItem);
 
 },
 
@@ -4024,9 +3995,9 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 
     var sPropertyName = p_aArgs[0][0],
         oPropertyValue = p_aArgs[0][1],
-        sWidth,
         oSubmenu;
 
+
     switch(sPropertyName) {
 
         case "selected":
@@ -4051,25 +4022,6 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 
         break;
 
-        case "text":
-        case "helptext":
-
-            /*
-                A change to an item's "text" or "helptext"
-                configuration properties requires the width of the parent
-                menu to be recalculated.
-            */
-
-            if (this.element.style.width) {
-    
-                sWidth = this._getOffsetWidth() + "px";
-
-                Dom.setStyle(this.element, "width", sWidth);
-
-            }
-
-        break;
-
     }
 
 },
@@ -4092,69 +4044,56 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 enforceConstraints: function (type, args, obj) {
 
     var oParentMenuItem = this.parent,
-        oElement,
-        oConfig,
-        pos,
-        x,
-        y,
-        offsetHeight,
-        offsetWidth,
-        viewPortWidth,
-        viewPortHeight,
-        scrollX,
-        scrollY,
-        nPadding,
+        nViewportOffset = Overlay.VIEWPORT_OFFSET,
+        oElement = this.element,
+        oConfig = this.cfg,
+        pos = args[0],
+        offsetHeight = oElement.offsetHeight,
+        offsetWidth = oElement.offsetWidth,
+        viewPortWidth = Dom.getViewportWidth(),
+        viewPortHeight = Dom.getViewportHeight(),
+        nPadding = (oParentMenuItem && 
+            oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 
+            0 : nViewportOffset,
+        aContext = oConfig.getProperty("context"),
+        oContextElement = aContext ? aContext[0] : null,
         topConstraint,
         leftConstraint,
         bottomConstraint,
         rightConstraint,
-        aContext,
-        oContextElement;
-
+        scrollX,
+        scrollY,
+        x,
+        y;
+    
 
-    if (oParentMenuItem && 
-        !(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)) {
+    if (offsetWidth < viewPortWidth) {
 
-        oElement = this.element;
-    
-        oConfig = this.cfg;
-        pos = args[0];
-        
         x = pos[0];
-        y = pos[1];
-        
-        offsetHeight = oElement.offsetHeight;
-        offsetWidth = oElement.offsetWidth;
-        
-        viewPortWidth = Dom.getViewportWidth();
-        viewPortHeight = Dom.getViewportHeight();
-        
         scrollX = Dom.getDocumentScrollLeft();
-        scrollY = Dom.getDocumentScrollTop();
-        
-        nPadding = 
-            (oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 0 : 10;
-        
-        topConstraint = scrollY + nPadding;
         leftConstraint = scrollX + nPadding;
-        
-        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
         rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding;
-        
-        aContext = oConfig.getProperty("context");
-        oContextElement = aContext ? aContext[0] : null;
-    
-    
-        if (x < 10) {
+
+        if (x < nViewportOffset) {
     
             x = leftConstraint;
     
         } else if ((x + offsetWidth) > viewPortWidth) {
     
-            if (oContextElement &&
+            if(oContextElement &&
                 ((x - oContextElement.offsetWidth) > offsetWidth)) {
     
-                x = (x - (oContextElement.offsetWidth + offsetWidth));
+                if (oParentMenuItem && 
+                    oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) {
+    
+                    x = (x - (offsetWidth - oContextElement.offsetWidth));
+    
+                }
+                else {
+    
+                    x = (x - (oContextElement.offsetWidth + offsetWidth));
+    
+                }
     
             }
             else {
@@ -4165,7 +4104,19 @@ enforceConstraints: function (type, args, obj) {
     
         }
     
-        if (y < 10) {
+    }
+
+
+    if (offsetHeight < viewPortHeight) {
+
+        y = pos[1];
+        scrollY = Dom.getDocumentScrollTop();
+        topConstraint = scrollY + nPadding;
+        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
+
+
+
+        if (y < nViewportOffset) {
     
             y = topConstraint;
     
@@ -4179,23 +4130,20 @@ enforceConstraints: function (type, args, obj) {
             else {
     
                 y = bottomConstraint;
+                
+
     
             }
     
         }
-    
-        oConfig.setProperty("x", x, true);
-        oConfig.setProperty("y", y, true);
-        oConfig.setProperty("xy", [x,y], true);
-    
-    }
-    else if (this == this.getRoot() && 
-        this.cfg.getProperty("position") == "dynamic") {
-    
-        Menu.superclass.enforceConstraints.call(this, type, args, obj);
-    
+
     }
 
+
+    oConfig.setProperty("x", x, true);
+    oConfig.setProperty("y", y, true);
+    oConfig.setProperty("xy", [x,y], true);
+
 },
 
 
@@ -4224,6 +4172,8 @@ configVisible: function (p_sType, p_aArgs, p_oMenu) {
         bVisible = p_aArgs[0];
         sDisplay = Dom.getStyle(this.element, "display");
 
+        Dom.setStyle(this.element, "visibility", "visible");
+
         if (bVisible) {
 
             if (sDisplay != "block") {
@@ -4262,39 +4212,24 @@ configPosition: function (p_sType, p_aArgs, p_oMenu) {
 
     var oElement = this.element,
         sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
-        sCurrentPosition = Dom.getStyle(oElement, "position"),
         oCfg = this.cfg,
         nZIndex;
 
 
-    Dom.setStyle(this.element, "position", sCSSPosition);
+    Dom.setStyle(oElement, "position", sCSSPosition);
 
 
     if (sCSSPosition == "static") {
 
-        /*
-            Remove the iframe for statically positioned menus since it will 
-            intercept mouse events.
-        */
-
-        oCfg.setProperty("iframe", false);
-
-
         // Statically positioned menus are visible by default
         
-        Dom.setStyle(this.element, "display", "block");
+        Dom.setStyle(oElement, "display", "block");
 
         oCfg.setProperty("visible", true);
 
     }
     else {
 
-        if (sCurrentPosition != "absolute") {
-
-            oCfg.setProperty("iframe", (YAHOO.env.ua.ie == 6 ? true : false));
-
-        }
-
         /*
             Even though the "visible" property is queued to 
             "false" by default, we need to set the "visibility" property to 
@@ -4303,7 +4238,7 @@ configPosition: function (p_sType, p_aArgs, p_oMenu) {
             or not to show an Overlay instance.
         */
 
-        Dom.setStyle(this.element, "visibility", "hidden");
+        Dom.setStyle(oElement, "visibility", "hidden");
     
     }
 
@@ -4398,7 +4333,7 @@ configHideDelay: function (p_sType, p_aArgs, p_oMenu) {
 /**
 * @method configContainer
 * @description Event handler for when the "container" configuration property 
-of the menu changes.
+of the menu changes.
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
@@ -4452,12 +4387,23 @@ _setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) {
 configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
 
     var nMaxHeight = p_aArgs[0],
+        oElement = this.element,
         oBody = this.body,
         oHeader = this.header,
         oFooter = this.footer,
         fnMouseOver = this._onScrollTargetMouseOver,
         fnMouseOut = this._onScrollTargetMouseOut,
-        nHeight;
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        nHeight,
+        nOffsetWidth,
+        sWidth;
+
+
+    if (nMaxHeight !== 0 && nMaxHeight < nMinScrollHeight) {
+    
+        nMaxHeight = nMinScrollHeight;
+    
+    }
 
 
     if (this.lazyLoad && !oBody) {
@@ -4474,59 +4420,106 @@ configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
     
     }
 
-    Dom.setStyle(oBody, "height", "auto");
-    Dom.setStyle(oBody, "overflow", "visible");    
 
+    Dom.setStyle(oBody, "height", "");
+    Dom.removeClass(oBody, "yui-menu-body-scrolled");
 
-    if ((nMaxHeight > 0) && (oBody.offsetHeight > nMaxHeight)) {
 
-        if (!this.cfg.getProperty("width")) {
+    /*
+        There is a bug in gecko-based browsers where an element whose 
+        "position" property is set to "absolute" and "overflow" property is set 
+        to "hidden" will not render at the correct width when its 
+        offsetParent's "position" property is also set to "absolute."  It is 
+        possible to work around this bug by specifying a value for the width 
+        property in addition to overflow.
+
+               In IE it is also necessary to give the Menu a width when the scrollbars are 
+               rendered to prevent the Menu from rendering with a width that is 100% of
+               the browser viewport.
+    */
 
-            this._setWidth();
+       var bSetWidth = ((UA.gecko && this.parent && this.parent.parent && 
+        this.parent.parent.cfg.getProperty("position") == "dynamic") || UA.ie);
 
-        }
 
-        if (!oHeader && !oFooter) {
+    if (bSetWidth) {
 
-            this.setHeader("&#32;");
-            this.setFooter("&#32;");
+               if (!this.cfg.getProperty("width")) {
 
-            oHeader = this.header;
-            oFooter = this.footer;
+                       nOffsetWidth = oElement.offsetWidth;
+       
+                       /*
+                               Measuring the difference of the offsetWidth before and after
+                               setting the "width" style attribute allows us to compute the 
+                               about of padding and borders applied to the element, which in 
+                               turn allows us to set the "width" property correctly.
+                       */
+                       
+                       oElement.style.width = nOffsetWidth + "px";
+       
+                       sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px";
+       
+                       this.cfg.setProperty("width", sWidth);
+               
+               }
 
-            Dom.addClass(oHeader, "topscrollbar");
-            Dom.addClass(oFooter, "bottomscrollbar");
-            
-            this.element.insertBefore(oHeader, oBody);
-            this.element.appendChild(oFooter);
+    }
 
-            Event.on(oHeader, "mouseover", fnMouseOver, this, true);
-            Event.on(oHeader, "mouseout", fnMouseOut, this, true);
-            Event.on(oFooter, "mouseover", fnMouseOver, this, true);
-            Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+
+    if (!oHeader && !oFooter) {
+
+        this.setHeader("&#32;");
+        this.setFooter("&#32;");
+
+        oHeader = this.header;
+        oFooter = this.footer;
+
+        Dom.addClass(oHeader, "topscrollbar");
+        Dom.addClass(oFooter, "bottomscrollbar");
         
-        }
+        oElement.insertBefore(oHeader, oBody);
+        oElement.appendChild(oFooter);
+    
+    }
+
 
-        nHeight = (nMaxHeight - (this.footer.offsetHeight + 
-                    this.header.offsetHeight));
+    nHeight = (nMaxHeight - (oHeader.offsetHeight + oHeader.offsetHeight));
 
+
+    if (nHeight > 0 && (oBody.offsetHeight > nMaxHeight)) {
+
+        Dom.addClass(oBody, "yui-menu-body-scrolled");
         Dom.setStyle(oBody, "height", (nHeight + "px"));
-        Dom.setStyle(oBody, "overflow", "hidden");
+
+        Event.on(oHeader, "mouseover", fnMouseOver, this, true);
+        Event.on(oHeader, "mouseout", fnMouseOut, this, true);
+        Event.on(oFooter, "mouseover", fnMouseOver, this, true);
+        Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+
+        this._disableScrollHeader();
+        this._enableScrollFooter();
 
     }
     else if (oHeader && oFooter) {
 
-        Dom.setStyle(oBody, "height", "auto");
-        Dom.setStyle(oBody, "overflow", "visible");
+               if (bSetWidth) {
+
+                       this.cfg.setProperty("width", "");
+               
+               }
+
+
+        this._enableScrollHeader();
+        this._enableScrollFooter();
 
         Event.removeListener(oHeader, "mouseover", fnMouseOver);
         Event.removeListener(oHeader, "mouseout", fnMouseOut);
         Event.removeListener(oFooter, "mouseover", fnMouseOver);
         Event.removeListener(oFooter, "mouseout", fnMouseOut);
 
-        this.element.removeChild(oHeader);
-        this.element.removeChild(oFooter);
-    
+        oElement.removeChild(oHeader);
+        oElement.removeChild(oFooter);
+
         this.header = null;
         this.footer = null;
     
@@ -4593,15 +4586,14 @@ _onItemAdded: function (p_sType, p_aArgs) {
 configDisabled: function (p_sType, p_aArgs, p_oMenu) {
 
     var bDisabled = p_aArgs[0],
-        aItems,
+        aItems = this.getItems(),
         nItems,
         i;
 
-    if (this._bDisabled != bDisabled) {
+    if (Lang.isArray(aItems)) {
 
-        aItems = this.getItems();
         nItems = aItems.length;
-
+    
         if (nItems > 0) {
         
             i = nItems - 1;
@@ -4614,14 +4606,25 @@ configDisabled: function (p_sType, p_aArgs, p_oMenu) {
             while (i--);
         
         }
-    
-        Dom[(bDisabled ? "addClass" : "removeClass")](this.element, "disabled");    
 
-        this.itemAddedEvent[(bDisabled ? "subscribe" : "unsubscribe")](
-            this._onItemAdded);
-    
-        this._bDisabled = bDisabled;
-    
+
+        if (bDisabled) {
+
+            this.clearActiveItem(true);
+
+            Dom.addClass(this.element, "disabled");
+
+            this.itemAddedEvent.subscribe(this._onItemAdded);
+
+        }
+        else {
+
+            Dom.removeClass(this.element, "disabled");
+
+            this.itemAddedEvent.unsubscribe(this._onItemAdded);
+
+        }
+        
     }
 
 },
@@ -4641,7 +4644,7 @@ onRender: function (p_sType, p_aArgs) {
         var oElement = this.element,
             oShadow = this._shadow;
     
-        if (oShadow) {
+        if (oShadow && oElement) {
 
             oShadow.style.width = (oElement.offsetWidth + 6) + "px";
             oShadow.style.height = (oElement.offsetHeight + 1) + "px";
@@ -4651,6 +4654,13 @@ onRender: function (p_sType, p_aArgs) {
     }
 
 
+    function replaceShadow() {
+
+        this.element.appendChild(this._shadow);
+
+    }
+
+
     function addShadowVisibleClass() {
     
         Dom.addClass(this._shadow, "yui-menu-shadow-visible");
@@ -4679,7 +4689,8 @@ onRender: function (p_sType, p_aArgs) {
             if (!m_oShadowTemplate) {
 
                 m_oShadowTemplate = document.createElement("div");
-                m_oShadowTemplate.className = "yui-menu-shadow";
+                m_oShadowTemplate.className = 
+                    "yui-menu-shadow yui-menu-shadow-visible";
             
             }
 
@@ -4689,12 +4700,10 @@ onRender: function (p_sType, p_aArgs) {
             
             this._shadow = oShadow;
 
-            addShadowVisibleClass.call(this);
-
             this.beforeShowEvent.subscribe(addShadowVisibleClass);
             this.beforeHideEvent.subscribe(removeShadowVisibleClass);
 
-            if (YAHOO.env.ua.ie) {
+            if (UA.ie) {
         
                 /*
                      Need to call sizeShadow & syncIframe via setTimeout for 
@@ -4712,6 +4721,7 @@ onRender: function (p_sType, p_aArgs) {
 
                 this.cfg.subscribeToConfigEvent("width", sizeShadow);
                 this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                this.cfg.subscribeToConfigEvent("maxheight", sizeShadow);
                 this.changeContentEvent.subscribe(sizeShadow);
 
                 Module.textResizeEvent.subscribe(sizeShadow, me, true);
@@ -4723,7 +4733,9 @@ onRender: function (p_sType, p_aArgs) {
                 });
         
             }
-        
+
+            this.cfg.subscribeToConfigEvent("maxheight", replaceShadow);
+
         }
 
     }
@@ -4811,8 +4823,30 @@ initEvents: function () {
 
 
 /**
-* @method getRoot
-* @description Finds the menu's root menu.
+* @method positionOffScreen
+* @description Positions the menu outside of the boundaries of the browser's 
+* viewport.  Called automatically when a menu is hidden to ensure that 
+* it doesn't force the browser to render uncessary scrollbars.
+*/
+positionOffScreen: function () {
+
+    var oIFrame = this.iframe,
+        aPos = this.OFF_SCREEN_POSITION;
+
+    Dom.setXY(this.element, aPos);
+    
+    if (oIFrame) {
+
+        Dom.setXY(oIFrame, aPos);
+    
+    }
+
+},
+
+
+/**
+* @method getRoot
+* @description Finds the menu's root menu.
 */
 getRoot: function () {
 
@@ -5084,10 +5118,17 @@ removeItem: function (p_oObject, p_nGroupIndex) {
 getItems: function () {
 
     var aGroups = this._aItemGroups,
+        nGroups,
+        aItems = [];
+
+    if (Lang.isArray(aGroups)) {
+
         nGroups = aGroups.length;
 
-    return ((nGroups == 1) ? aGroups[0] : 
-                (Array.prototype.concat.apply([], aGroups)));
+        return ((nGroups == 1) ? aGroups[0] : 
+                    (Array.prototype.concat.apply(aItems, aGroups)));
+
+    }
 
 },
 
@@ -5177,6 +5218,7 @@ getSubmenus: function () {
 
 },
 
+
 /**
 * @method clearContent
 * @description Removes all of the content from the menu, including the menu 
@@ -5250,11 +5292,12 @@ clearContent: function () {
 
     }
 
+    this.activeItem = null;
 
     this._aItemGroups = [];
     this._aListElements = [];
     this._aGroupTitleElements = [];
-    
+
     this.cfg.setProperty("width", null);
 
 },
@@ -5267,9 +5310,6 @@ clearContent: function () {
 */
 destroy: function () {
 
-    Module.textResizeEvent.unsubscribe(this._onTextResize, this);
-
-
     // Remove all items
 
     this.clearContent();
@@ -5446,34 +5486,60 @@ subscribe: function () {
     }
 
 
+    function onSubmenuAdded(p_sType, p_aArgs, p_oObject) { 
+    
+        var oSubmenu = this.cfg.getProperty("submenu");
+        
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+        
+        }
+    
+    }
+
+
     Menu.superclass.subscribe.apply(this, arguments);
     Menu.superclass.subscribe.call(this, "itemAdded", onItemAdded, arguments);
 
 
-    var aSubmenus = this.getSubmenus(),
-        nSubmenus,
+    var aItems = this.getItems(),
+        nItems,
+        oItem,
         oSubmenu,
         i;
+        
 
-    if (aSubmenus) {
-
-        nSubmenus = aSubmenus.length;
+    if (aItems) {
 
-        if (nSubmenus > 0) {
+        nItems = aItems.length;
         
-            i = nSubmenus - 1;
+        if (nItems > 0) {
+        
+            i = nItems - 1;
             
             do {
-    
-                oSubmenu = aSubmenus[i];
+
+                oItem = aItems[i];
                 
-                oSubmenu.subscribe.apply(oSubmenu, arguments);
-    
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+                
+                    oSubmenu.subscribe.apply(oSubmenu, arguments);
+                
+                }
+                else {
+                
+                    oItem.cfg.subscribeToConfigEvent("submenu", onSubmenuAdded, arguments);
+                
+                }
+
             }
-            while(i--);
+            while (i--);
         
         }
-    
+
     }
 
 },
@@ -5490,6 +5556,98 @@ initDefaultConfig: function () {
 
     var oConfig = this.cfg;
 
+
+    // Module documentation overrides
+
+    /**
+    * @config effect
+    * @description Object or array of objects representing the ContainerEffect 
+    * classes that are active for animating the container.  When set this 
+    * property is automatically applied to all submenus.
+    * @type Object
+    * @default null
+    */
+
+    // Overlay documentation overrides
+
+
+    /**
+    * @config x
+    * @description Number representing the absolute x-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+
+    /**
+    * @config y
+    * @description Number representing the absolute y-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+
+
+    /**
+    * @description Array of the absolute x and y positions of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @config xy
+    * @type Number[]
+    * @default null
+    */
+    
+
+    /**
+    * @config context
+    * @description Array of context arguments for context-sensitive positioning.  
+    * The format is: [id or element, element corner, context corner]. 
+    * For example, setting this property to ["img1", "tl", "bl"] would 
+    * align the Mnu's top left corner to the context element's 
+    * bottom left corner.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Array
+    * @default null
+    */
+    
+    
+    /**
+    * @config fixedcenter
+    * @description Boolean indicating if the Menu should be anchored to the 
+    * center of the viewport.  This property is only applied when the 
+    * "position" configuration property is set to dynamic.
+    * @type Boolean
+    * @default false
+    */
+
+    
+    /**
+    * @config zindex
+    * @description Number representing the CSS z-index of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+    
+    /**
+    * @config iframe
+    * @description Boolean indicating whether or not the Menu should 
+    * have an IFRAME shim; used to prevent SELECT elements from 
+    * poking through an Overlay instance in IE6.  When set to "true", 
+    * the iframe shim is created when the Menu instance is intially
+    * made visible.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
+    * @type Boolean
+    * @default true for IE6 and below, false for all other browsers.
+    */
+
+
        // Add configuration attributes
 
     /*
@@ -5528,7 +5686,9 @@ initDefaultConfig: function () {
     /**
     * @config constraintoviewport
     * @description Boolean indicating if the menu will try to remain inside 
-    * the boundaries of the size of viewport.
+    * the boundaries of the size of viewport.  This property is only applied 
+    * when the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5577,7 +5737,8 @@ initDefaultConfig: function () {
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         { 
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value 
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -5593,7 +5754,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
           { 
               value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+              suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -5602,7 +5764,9 @@ initDefaultConfig: function () {
     * @config showdelay
     * @description Number indicating the time (in milliseconds) that should 
     * expire before a submenu is made visible when the user mouses over 
-    * the menu's items.
+    * the menu's items.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
     * @default 250
     * @type Number
     */
@@ -5610,7 +5774,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.SHOW_DELAY.key, 
           { 
               value: DEFAULT_CONFIG.SHOW_DELAY.value, 
-              validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+              validator: DEFAULT_CONFIG.SHOW_DELAY.validator,
+              suppressEvent: DEFAULT_CONFIG.SHOW_DELAY.suppressEvent
        } 
     );
 
@@ -5618,7 +5783,9 @@ initDefaultConfig: function () {
     /**
     * @config hidedelay
     * @description Number indicating the time (in milliseconds) that should 
-    * expire before the menu is hidden.
+    * expire before the menu is hidden.  This property is only applied when 
+    * the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default 0
     * @type Number
     */
@@ -5639,6 +5806,8 @@ initDefaultConfig: function () {
     * expire before a submenu is hidden when the user mouses out of a menu item 
     * heading in the direction of a submenu.  The value must be greater than or 
     * equal to the value specified for the "showdelay" configuration property.
+    * This property is only applied when the "position" configuration property 
+    * is set to dynamic and is automatically applied to all submenus.
     * @default 250
     * @type Number
     */
@@ -5646,7 +5815,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key, 
           { 
               value: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value, 
-              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator
+              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator,
+              suppressEvent: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.suppressEvent
        } 
     );
 
@@ -5654,7 +5824,9 @@ initDefaultConfig: function () {
     /**
     * @config clicktohide
     * @description Boolean indicating if the menu will automatically be 
-    * hidden if the user clicks outside of it.
+    * hidden if the user clicks outside of it.  This property is only 
+    * applied when the "position" configuration property is set to dynamic 
+    * and is automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5662,7 +5834,8 @@ initDefaultConfig: function () {
         DEFAULT_CONFIG.CLICK_TO_HIDE.key,
         {
             value: DEFAULT_CONFIG.CLICK_TO_HIDE.value,
-            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator
+            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator,
+            suppressEvent: DEFAULT_CONFIG.CLICK_TO_HIDE.suppressEvent
         }
     );
 
@@ -5680,15 +5853,58 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.CONTAINER.key, 
           { 
               handler: this.configContainer,
-              value: document.body
+              value: document.body,
+           suppressEvent: DEFAULT_CONFIG.CONTAINER.suppressEvent
        } 
    );
 
 
+    /**
+    * @config scrollincrement
+    * @description Number used to control the scroll speed of a menu.  Used to 
+    * increment the "scrollTop" property of the menu's body by when a menu's 
+    * content is scrolling.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 1
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SCROLL_INCREMENT.key, 
+        { 
+            value: DEFAULT_CONFIG.SCROLL_INCREMENT.value, 
+            validator: DEFAULT_CONFIG.SCROLL_INCREMENT.validator,
+            supercedes: DEFAULT_CONFIG.SCROLL_INCREMENT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.SCROLL_INCREMENT.suppressEvent
+        }
+    );
+
+
+    /**
+    * @config minscrollheight
+    * @description Number defining the minimum threshold for the "maxheight" 
+    * configuration property.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 90
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.key, 
+        { 
+            value: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.value, 
+            validator: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.validator,
+            supercedes: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.suppressEvent
+        }
+    );
+
+
     /**
     * @config maxheight
-    * @description Defines the maximum height (in pixels) for a menu before the
-    * contents of the body are scrolled.
+    * @description Number defining the maximum height (in pixels) for a menu's 
+    * body element (<code>&#60;div class="bd"&#60;</code>).  Once a menu's body 
+    * exceeds this height, the contents of the body are scrolled to maintain 
+    * this value.  This value cannot be set lower than the value of the 
+    * "minscrollheight" configuration property.
     * @default 0
     * @type Number
     */
@@ -5697,17 +5913,20 @@ initDefaultConfig: function () {
        {
             handler: this.configMaxHeight,
             value: DEFAULT_CONFIG.MAX_HEIGHT.value,
-            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator
+            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator,
+            suppressEvent: DEFAULT_CONFIG.MAX_HEIGHT.suppressEvent,
+            supercedes: DEFAULT_CONFIG.MAX_HEIGHT.supercedes            
        } 
     );
 
 
     /**
     * @config classname
-    * @description CSS class to be applied to the menu's root 
-    * <code>&#60;div&#62;</code> element.  The specified class(es) are 
-    * appended in addition to the default class as specified by the menu's
-    * CSS_CLASS_NAME constant.
+    * @description String representing the CSS class to be applied to the 
+    * menu's root <code>&#60;div&#62;</code> element.  The specified class(es)  
+    * are appended in addition to the default class as specified by the menu's
+    * CSS_CLASS_NAME constant. When set this property is automatically 
+    * applied to all submenus.
     * @default null
     * @type String
     */
@@ -5716,7 +5935,8 @@ initDefaultConfig: function () {
         { 
             handler: this.configClassName,
             value: DEFAULT_CONFIG.CLASS_NAME.value, 
-            validator: DEFAULT_CONFIG.CLASS_NAME.validator
+            validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+            supercedes: DEFAULT_CONFIG.CLASS_NAME.supercedes      
         }
     );
 
@@ -5736,7 +5956,8 @@ initDefaultConfig: function () {
         { 
             handler: this.configDisabled,
             value: DEFAULT_CONFIG.DISABLED.value, 
-            validator: DEFAULT_CONFIG.DISABLED.validator
+            validator: DEFAULT_CONFIG.DISABLED.validator,
+            suppressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
         }
     );
 
@@ -5748,7 +5969,7 @@ initDefaultConfig: function () {
 
 
 
-(function() {
+(function () {
 
 
 /**
@@ -5770,11 +5991,11 @@ initDefaultConfig: function () {
 * @class MenuItem
 * @constructor
 */
-YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
+YAHOO.widget.MenuItem = function (p_oObject, p_oConfig) {
 
-    if(p_oObject) {
+    if (p_oObject) {
 
-        if(p_oConfig) {
+        if (p_oConfig) {
     
             this.parent = p_oConfig.parent;
             this.value = p_oConfig.value;
@@ -5788,6 +6009,7 @@ YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
 
 };
 
+
 var Dom = YAHOO.util.Dom,
     Module = YAHOO.widget.Module,
     Menu = YAHOO.widget.Menu,
@@ -5840,7 +6062,8 @@ var Dom = YAHOO.util.Dom,
     
         "HELP_TEXT": { 
             key: "helptext",
-            supercedes: ["text"]
+            supercedes: ["text"], 
+            suppressEvent: true 
         },
     
         "URL": { 
@@ -5875,15 +6098,21 @@ var Dom = YAHOO.util.Dom,
             value: false, 
             validator: Lang.isBoolean, 
             suppressEvent: true, 
-            supercedes: ["text"]
+            supercedes: ["disabled", "selected"]
         }, 
+
+        "SUBMENU": { 
+            key: "submenu",
+            suppressEvent: true,
+            supercedes: ["disabled", "selected"]
+        },
     
         "DISABLED": { 
             key: "disabled", 
             value: false, 
             validator: Lang.isBoolean, 
             suppressEvent: true,
-            supercedes: ["text"]
+            supercedes: ["text", "selected"]
         },
     
         "SELECTED": { 
@@ -5893,19 +6122,16 @@ var Dom = YAHOO.util.Dom,
             suppressEvent: true
         },
     
-        "SUBMENU": { 
-            key: "submenu",
-            supercedes: ["text"]
-        },
-    
         "ONCLICK": { 
-            key: "onclick"
+            key: "onclick",
+            suppressEvent: true
         },
     
         "CLASS_NAME": { 
             key: "classname", 
             value: null, 
-            validator: Lang.isString
+            validator: Lang.isString,
+            suppressEvent: true
         }
     
     };
@@ -5913,66 +6139,6 @@ var Dom = YAHOO.util.Dom,
 
 MenuItem.prototype = {
 
-    // Constants
-
-    /**
-    * @property COLLAPSED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the <code>&#60;em&#62;</code>
-    * element used for the submenu arrow indicator.
-    * @default "Submenu collapsed.  Click to expand submenu."
-    * @final
-    * @type String
-    */
-    COLLAPSED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu collapsed.  Click to expand submenu.",
-
-
-    /**
-    * @property EXPANDED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the submenu is visible.
-    * @default "Submenu expanded.  Click to collapse submenu."
-    * @final
-    * @type String
-    */
-    EXPANDED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu expanded.  Click to collapse submenu.",
-
-
-    /**
-    * @property DISABLED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the menu item is disabled.
-    * @default "Submenu collapsed.  (Item disabled.)."
-    * @final
-    * @type String
-    */
-    DISABLED_SUBMENU_INDICATOR_TEXT: "Submenu collapsed.  (Item disabled.)",
-
-
-    /**
-    * @property CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>).
-    * @default "Checked."
-    * @final
-    * @type String
-    */
-    CHECKED_TEXT: "Menu item checked.",
-    
-    
-    /**
-    * @property DISABLED_CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>) when the menu item 
-    * is disabled.
-    * @default "Checked. (Item disabled.)"
-    * @final
-    * @type String
-    */
-    DISABLED_CHECKED_TEXT: "Checked. (Item disabled.)",
-
-
     /**
     * @property CSS_CLASS_NAME
     * @description String representing the CSS class(es) to be applied to the 
@@ -6041,18 +6207,6 @@ MenuItem.prototype = {
     * @type YAHOO.widget.Menu
     */
     _oSubmenu: null,
-    
-
-    /**
-    * @property _oCheckedIndicator
-    * @description Object reference to the menu item's checkmark image.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @private
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    _oCheckedIndicator: null,
 
 
     /** 
@@ -6158,18 +6312,6 @@ MenuItem.prototype = {
     value: null,
 
 
-    /**
-    * @property submenuIndicator
-    * @description Object reference to the <code>&#60;em&#62;</code> element 
-    * used to create the submenu indicator for the menu item.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    submenuIndicator: null,
-
-
        /**
     * @property browser
     * @deprecated Use YAHOO.env.ua
@@ -6312,10 +6454,10 @@ MenuItem.prototype = {
     * configuration for the menu item. See configuration class documentation 
     * for more details.
     */
-    init: function(p_oObject, p_oConfig) {
+    init: function (p_oObject, p_oConfig) {
 
 
-        if(!this.SUBMENU_TYPE) {
+        if (!this.SUBMENU_TYPE) {
     
             this.SUBMENU_TYPE = Menu;
     
@@ -6337,14 +6479,14 @@ MenuItem.prototype = {
             sId;
 
 
-        if(Lang.isString(p_oObject)) {
+        if (Lang.isString(p_oObject)) {
 
             this._createRootNodeStructure();
 
             oConfig.queueProperty("text", p_oObject);
 
         }
-        else if(p_oObject && p_oObject.tagName) {
+        else if (p_oObject && p_oObject.tagName) {
 
             switch(p_oObject.tagName.toUpperCase()) {
 
@@ -6353,6 +6495,9 @@ MenuItem.prototype = {
                     this._createRootNodeStructure();
 
                     oConfig.queueProperty("text", p_oObject.text);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
+
+                    this.value = p_oObject.value;
 
                     this.srcElement = p_oObject;
 
@@ -6363,6 +6508,7 @@ MenuItem.prototype = {
                     this._createRootNodeStructure();
 
                     oConfig.queueProperty("text", p_oObject.label);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
 
                     this.srcElement = p_oObject;
 
@@ -6379,10 +6525,11 @@ MenuItem.prototype = {
 
                     // Capture the "text" and/or the "URL"
 
-                    if(oAnchor) {
+                    if (oAnchor) {
 
                         sURL = oAnchor.getAttribute("href");
                         sTarget = oAnchor.getAttribute("target");
+
                         sText = oAnchor.innerHTML;
 
                     }
@@ -6410,11 +6557,11 @@ MenuItem.prototype = {
         }
 
 
-        if(this.element) {
+        if (this.element) {
 
-            sId = this.element.id;
+            sId = (this.srcElement || this.element).id;
 
-            if(!sId) {
+            if (!sId) {
 
                 sId = this.id || Dom.generateId();
 
@@ -6464,7 +6611,7 @@ MenuItem.prototype = {
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY);
             this.destroyEvent.signature = SIGNATURE;
 
-            if(p_oConfig) {
+            if (p_oConfig) {
     
                 oConfig.applyConfig(p_oConfig);
     
@@ -6491,7 +6638,7 @@ MenuItem.prototype = {
         var oElement,
             oAnchor;
 
-        if(!m_oMenuItemTemplate) {
+        if (!m_oMenuItemTemplate) {
 
             m_oMenuItemTemplate = document.createElement("li");
             m_oMenuItemTemplate.innerHTML = "<a href=\"#\"></a>";
@@ -6516,7 +6663,7 @@ MenuItem.prototype = {
     * the child nodes to instantiate other menus.
     * @private
     */
-    _initSubTree: function() {
+    _initSubTree: function () {
 
         var oSrcEl = this.srcElement,
             oConfig = this.cfg,
@@ -6527,9 +6674,9 @@ MenuItem.prototype = {
             n;
 
 
-        if(oSrcEl.childNodes.length > 0) {
+        if (oSrcEl.childNodes.length > 0) {
 
-            if(this.parent.lazyLoad && this.parent.srcElement && 
+            if (this.parent.lazyLoad && this.parent.srcElement && 
                 this.parent.srcElement.tagName.toUpperCase() == "SELECT") {
 
                 oConfig.setProperty(
@@ -6545,7 +6692,7 @@ MenuItem.prototype = {
     
                 do {
     
-                    if(oNode && oNode.tagName) {
+                    if (oNode && oNode.tagName) {
     
                         switch(oNode.tagName.toUpperCase()) {
                 
@@ -6571,7 +6718,7 @@ MenuItem.prototype = {
     
                 nOptions = aOptions.length;
     
-                if(nOptions > 0) {
+                if (nOptions > 0) {
     
                     oMenu = new this.SUBMENU_TYPE(Dom.generateId());
                     
@@ -6606,16 +6753,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configText: function(p_sType, p_aArgs, p_oItem) {
+    configText: function (p_sType, p_aArgs, p_oItem) {
 
         var sText = p_aArgs[0],
             oConfig = this.cfg,
             oAnchor = this._oAnchor,
             sHelpText = oConfig.getProperty("helptext"),
             sHelpTextHTML = "",
-            sCheckHTML = "",
-            oSubmenu = oConfig.getProperty("submenu"),
-            sSubmenuIndicatorHTML = "",
             sEmphasisStartTag = "",
             sEmphasisEndTag = "";
 
@@ -6630,25 +6774,6 @@ MenuItem.prototype = {
             }
 
 
-            if (oConfig.getProperty("checked")) {
-
-                sCheckHTML = "<em class=\"checkedindicator\">" + 
-                    this.CHECKED_TEXT + "</em>";
-            
-            }
-            
-            
-            if (oSubmenu) {
-
-                sSubmenuIndicatorHTML =  "<em class=\"submenuindicator\">" + 
-                    ((oSubmenu instanceof Menu && 
-                    oSubmenu.cfg.getProperty("visible")) ? 
-                    this.EXPANDED_SUBMENU_INDICATOR_TEXT : 
-                    this.COLLAPSED_SUBMENU_INDICATOR_TEXT) + "</em>";
-            
-            }
-            
-
             if (oConfig.getProperty("emphasis")) {
 
                 sEmphasisStartTag = "<em>";
@@ -6666,15 +6791,7 @@ MenuItem.prototype = {
 
 
             oAnchor.innerHTML = (sEmphasisStartTag + sText + 
-                sEmphasisEndTag + sHelpTextHTML + 
-                sCheckHTML + sSubmenuIndicatorHTML);
-
-
-            if (oSubmenu) {
-
-                this.submenuIndicator = oAnchor.lastChild;
-            
-            }
+                sEmphasisEndTag + sHelpTextHTML);
 
         }
 
@@ -6691,21 +6808,7 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configHelpText: function(p_sType, p_aArgs, p_oItem) {
-
-        var sHelpText = p_aArgs[0],
-            oAnchor = this._oAnchor;
-
-        if (sHelpText) {
-
-            Dom.addClass(oAnchor, "hashelptext");
-
-        }
-        else {
-
-            Dom.removeClass(oAnchor, "hashelptext");
-        
-        }
+    configHelpText: function (p_sType, p_aArgs, p_oItem) {
 
         this.cfg.refireEvent("text");
 
@@ -6722,17 +6825,25 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configURL: function(p_sType, p_aArgs, p_oItem) {
+    configURL: function (p_sType, p_aArgs, p_oItem) {
 
         var sURL = p_aArgs[0];
 
-        if(!sURL) {
+        if (!sURL) {
 
             sURL = "#";
 
         }
 
-        this._oAnchor.setAttribute("href", sURL);
+        var oAnchor = this._oAnchor;
+
+        if (YAHOO.env.ua.opera) {
+
+            oAnchor.removeAttribute("href");
+        
+        }
+
+        oAnchor.setAttribute("href", sURL);
 
     },
 
@@ -6747,12 +6858,12 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configTarget: function(p_sType, p_aArgs, p_oItem) {
+    configTarget: function (p_sType, p_aArgs, p_oItem) {
 
         var sTarget = p_aArgs[0],
             oAnchor = this._oAnchor;
 
-        if(sTarget && sTarget.length > 0) {
+        if (sTarget && sTarget.length > 0) {
 
             oAnchor.setAttribute("target", sTarget);
 
@@ -6776,13 +6887,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
         var bEmphasis = p_aArgs[0],
             oConfig = this.cfg;
 
 
-        if(bEmphasis && oConfig.getProperty("strongemphasis")) {
+        if (bEmphasis && oConfig.getProperty("strongemphasis")) {
 
             oConfig.setProperty("strongemphasis", false);
 
@@ -6804,13 +6915,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configStrongEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
         var bStrongEmphasis = p_aArgs[0],
             oConfig = this.cfg;
 
 
-        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {
+        if (bStrongEmphasis && oConfig.getProperty("emphasis")) {
 
             oConfig.setProperty("emphasis", false);
 
@@ -6822,8 +6933,146 @@ MenuItem.prototype = {
 
 
     /**
-    * @method configChecked
-    * @description Event handler for when the "checked" configuration property 
+    * @method configChecked
+    * @description Event handler for when the "checked" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configChecked: function (p_sType, p_aArgs, p_oItem) {
+
+        var bChecked = p_aArgs[0],
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            oConfig = this.cfg,
+            sState = "-checked",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState;
+
+
+        if (bChecked) {
+
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+        
+        }
+
+
+        oConfig.refireEvent("text");
+
+
+        if (oConfig.getProperty("disabled")) {
+
+            oConfig.refireEvent("disabled");
+
+        }
+
+
+        if (oConfig.getProperty("selected")) {
+
+            oConfig.refireEvent("selected");
+
+        }
+
+    },
+
+
+
+    /**
+    * @method configDisabled
+    * @description Event handler for when the "disabled" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configDisabled: function (p_sType, p_aArgs, p_oItem) {
+
+        var bDisabled = p_aArgs[0],
+            oConfig = this.cfg,
+            oSubmenu = oConfig.getProperty("submenu"),
+            bChecked = oConfig.getProperty("checked"),
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            sState = "-disabled",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
+
+
+        if (bDisabled) {
+
+            if (oConfig.getProperty("selected")) {
+
+                oConfig.setProperty("selected", false);
+
+            }
+
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
+
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
+            
+
+            if (bChecked) {
+
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
+
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
+
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
+            
+
+            if (bChecked) {
+
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
+
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configSelected
+    * @description Event handler for when the "selected" configuration property 
     * of the menu item changes. 
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
@@ -6831,103 +7080,116 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configChecked: function(p_sType, p_aArgs, p_oItem) {
-
-        var bChecked = p_aArgs[0],
-            oAnchor = this._oAnchor;
+    configSelected: function (p_sType, p_aArgs, p_oItem) {
 
-        if (bChecked) {
+        var oConfig = this.cfg,
+            bSelected = p_aArgs[0],
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            bChecked = oConfig.getProperty("checked"),
+            oSubmenu = oConfig.getProperty("submenu"),
+            sState = "-selected",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
 
-            Dom.addClass(oAnchor, "checked");
 
-        }
-        else {
+        if (YAHOO.env.ua.opera) {
 
-            Dom.removeClass(oAnchor, "checked");
+            oAnchor.blur();
         
         }
 
-        this.cfg.refireEvent("text");
 
-    },
+        if (bSelected && !oConfig.getProperty("disabled")) {
 
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
 
 
-    /**
-    * @method configDisabled
-    * @description Event handler for when the "disabled" configuration property 
-    * of the menu item changes. 
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configDisabled: function(p_sType, p_aArgs, p_oItem) {
+            if (oSubmenu) {
 
-        var bDisabled = p_aArgs[0],
-            oConfig = this.cfg,
-            oAnchor = this._oAnchor;
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
 
 
-        if(bDisabled) {
+            if (bChecked) {
 
-            if(oConfig.getProperty("selected")) {
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
 
-                oConfig.setProperty("selected", false);
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
 
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
             }
 
-            oAnchor.removeAttribute("href");
+        
+            if (bChecked) {
 
-            Dom.addClass(oAnchor, "disabled");
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
 
-        }
-        else {
+            }
 
-            oAnchor.setAttribute("href", oConfig.getProperty("url"));
+        }
 
-            Dom.removeClass(oAnchor, "disabled");
 
+        if (this.hasFocus() && YAHOO.env.ua.opera) {
+        
+            oAnchor.focus();
+        
         }
 
     },
 
 
     /**
-    * @method configSelected
-    * @description Event handler for when the "selected" configuration property 
-    * of the menu item changes. 
+    * @method _onSubmenuBeforeHide
+    * @description "beforehide" Custom Event handler for a submenu.
+    * @private
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
     * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configSelected: function(p_sType, p_aArgs, p_oItem) {
+    */
+    _onSubmenuBeforeHide: function (p_sType, p_aArgs) {
 
-        var bSelected,
-            oAnchor;
+        var oItem = this.parent,
+            oMenu;
 
-        if(!this.cfg.getProperty("disabled")) {
+        function onHide() {
 
-            bSelected = p_aArgs[0];
-            oAnchor = this._oAnchor;
+            oItem._oAnchor.blur();
+            oMenu.beforeHideEvent.unsubscribe(onHide);
+        
+        }
 
 
-            if(bSelected) {
-    
-                Dom.addClass(oAnchor, "selected");
-    
-            }
-            else {
-    
-                Dom.removeClass(oAnchor, "selected");
-    
-            }
+        if (oItem.hasFocus()) {
 
-        }
+            oMenu = oItem.parent;
 
+            oMenu.beforeHideEvent.subscribe(onHide);
+        
+        }
+    
     },
 
 
@@ -6941,28 +7203,31 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configSubmenu: function(p_sType, p_aArgs, p_oItem) {
+    configSubmenu: function (p_sType, p_aArgs, p_oItem) {
 
-        var oAnchor = this._oAnchor,
-            oSubmenu = p_aArgs[0],
-            oSubmenuIndicator = this.submenuIndicator,
+        var oSubmenu = p_aArgs[0],
             oConfig = this.cfg,
+            oElement = this.element,
+            oAnchor = this._oAnchor,
             bLazyLoad = this.parent && this.parent.lazyLoad,
+            sState = "-hassubmenu",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
             oMenu,
             sSubmenuId,
             oSubmenuConfig;
 
 
-        if(oSubmenu) {
+        if (oSubmenu) {
 
-            if(oSubmenu instanceof Menu) {
+            if (oSubmenu instanceof Menu) {
 
                 oMenu = oSubmenu;
                 oMenu.parent = this;
                 oMenu.lazyLoad = bLazyLoad;
 
             }
-            else if(typeof oSubmenu == "object" && oSubmenu.id && 
+            else if (typeof oSubmenu == "object" && oSubmenu.id && 
                 !oSubmenu.nodeType) {
 
                 sSubmenuId = oSubmenu.id;
@@ -6976,7 +7241,7 @@ MenuItem.prototype = {
 
                 // Set the value of the property to the Menu instance
 
-                this.cfg.setProperty("submenu", oMenu, true);
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
             else {
@@ -6987,39 +7252,53 @@ MenuItem.prototype = {
 
                 // Set the value of the property to the Menu instance
                 
-                this.cfg.setProperty("submenu", oMenu, true);
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
 
 
-            if(oMenu) {
+            if (oMenu) {
 
-                Dom.addClass(oAnchor, "hassubmenu");
+                Dom.addClass(oElement, sClassName);
+                Dom.addClass(oAnchor, sLabelClassName);
 
                 this._oSubmenu = oMenu;
+
+                if (YAHOO.env.ua.opera) {
+                
+                    oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);               
+                
+                }
             
             }
 
         }
         else {
 
-            Dom.removeClass(oAnchor, "hassubmenu");
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
 
-            if(oSubmenuIndicator) {
+            if (this._oSubmenu) {
 
-                oAnchor.removeChild(oSubmenuIndicator);
+                this._oSubmenu.destroy();
 
             }
 
-            if(this._oSubmenu) {
+        }
 
-                this._oSubmenu.destroy();
 
-            }
+        if (oConfig.getProperty("disabled")) {
+
+            oConfig.refireEvent("disabled");
+
+        }
+
+
+        if (oConfig.getProperty("selected")) {
+
+            oConfig.refireEvent("selected");
 
         }
-        
-        oConfig.refireEvent("text");
 
     },
 
@@ -7034,7 +7313,7 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configOnClick: function(p_sType, p_aArgs, p_oItem) {
+    configOnClick: function (p_sType, p_aArgs, p_oItem) {
 
         var oObject = p_aArgs[0];
 
@@ -7043,7 +7322,7 @@ MenuItem.prototype = {
             already been specified.
         */
 
-        if(this._oOnclickAttributeValue && 
+        if (this._oOnclickAttributeValue && 
             (this._oOnclickAttributeValue != oObject)) {
 
             this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, 
@@ -7054,7 +7333,7 @@ MenuItem.prototype = {
         }
 
 
-        if(!this._oOnclickAttributeValue && typeof oObject == "object" && 
+        if (!this._oOnclickAttributeValue && typeof oObject == "object" && 
             typeof oObject.fn == "function") {
             
             this.clickEvent.subscribe(oObject.fn, 
@@ -7078,11 +7357,11 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configClassName: function(p_sType, p_aArgs, p_oItem) {
+    configClassName: function (p_sType, p_aArgs, p_oItem) {
     
         var sClassName = p_aArgs[0];
     
-        if(this._sClassName) {
+        if (this._sClassName) {
     
             Dom.removeClass(this.element, this._sClassName);
     
@@ -7102,7 +7381,7 @@ MenuItem.prototype = {
     * @method initDefaultConfig
        * @description Initializes an item's configurable properties.
        */
-       initDefaultConfig : function() {
+       initDefaultConfig : function () {
 
         var oConfig = this.cfg;
 
@@ -7134,7 +7413,7 @@ MenuItem.prototype = {
         * accompany the text for the menu item.
         * @deprecated Use "text" configuration property to add help text markup.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "Copy &#60;em 
-        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#60;");</code>
+        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#62;");</code>
         * @default null
         * @type String|<a href="http://www.w3.org/TR/
         * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
@@ -7142,7 +7421,11 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.HELP_TEXT.key,
-            { handler: this.configHelpText }
+            {
+                handler: this.configHelpText, 
+                supercedes: DEFAULT_CONFIG.HELP_TEXT.supercedes,
+                suppressEvent: DEFAULT_CONFIG.HELP_TEXT.suppressEvent 
+            }
         );
 
 
@@ -7190,7 +7473,7 @@ MenuItem.prototype = {
         * rendered with emphasis.
         * @deprecated Use "text" configuration property to add emphasis.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;em&#62;Some 
-        * Text&#60;/em&#60;");</code>
+        * Text&#60;/em&#62;");</code>
         * @default false
         * @type Boolean
         */
@@ -7200,7 +7483,8 @@ MenuItem.prototype = {
                 handler: this.configEmphasis, 
                 value: DEFAULT_CONFIG.EMPHASIS.value, 
                 validator: DEFAULT_CONFIG.EMPHASIS.validator, 
-                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent 
+                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.EMPHASIS.supercedes
             }
         );
 
@@ -7211,7 +7495,7 @@ MenuItem.prototype = {
         * rendered with strong emphasis.
         * @deprecated Use "text" configuration property to add strong emphasis.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;strong&#62; 
-        * Some Text&#60;/strong&#60;");</code>
+        * Some Text&#60;/strong&#62;");</code>
         * @default false
         * @type Boolean
         */
@@ -7221,7 +7505,8 @@ MenuItem.prototype = {
                 handler: this.configStrongEmphasis,
                 value: DEFAULT_CONFIG.STRONG_EMPHASIS.value,
                 validator: DEFAULT_CONFIG.STRONG_EMPHASIS.validator,
-                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent
+                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.STRONG_EMPHASIS.supercedes
             }
         );
 
@@ -7300,7 +7585,11 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.SUBMENU.key, 
-            { handler: this.configSubmenu }
+            {
+                handler: this.configSubmenu, 
+                supercedes: DEFAULT_CONFIG.SUBMENU.supercedes,
+                suppressEvent: DEFAULT_CONFIG.SUBMENU.suppressEvent
+            }
         );
 
 
@@ -7318,7 +7607,10 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.ONCLICK.key, 
-            { handler: this.configOnClick }
+            {
+                handler: this.configOnClick, 
+                suppressEvent: DEFAULT_CONFIG.ONCLICK.suppressEvent 
+            }
         );
 
 
@@ -7336,7 +7628,8 @@ MenuItem.prototype = {
             { 
                 handler: this.configClassName,
                 value: DEFAULT_CONFIG.CLASS_NAME.value, 
-                validator: DEFAULT_CONFIG.CLASS_NAME.validator
+                validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+                suppressEvent: DEFAULT_CONFIG.CLASS_NAME.suppressEvent 
             }
         );
 
@@ -7348,7 +7641,7 @@ MenuItem.prototype = {
     * @description Finds the menu item's next enabled sibling.
     * @return YAHOO.widget.MenuItem
     */
-    getNextEnabledSibling: function() {
+    getNextEnabledSibling: function () {
 
         var nGroupIndex,
             aItemGroups,
@@ -7363,13 +7656,13 @@ MenuItem.prototype = {
 
         }
 
-        if(this.parent instanceof Menu) {
+        if (this.parent instanceof Menu) {
 
             nGroupIndex = this.groupIndex;
     
             aItemGroups = this.parent.getItemGroups();
     
-            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {
+            if (this.index < (aItemGroups[nGroupIndex].length - 1)) {
     
                 oNextItem = getNextArrayItem(aItemGroups[nGroupIndex], 
                         (this.index+1));
@@ -7377,7 +7670,7 @@ MenuItem.prototype = {
             }
             else {
     
-                if(nGroupIndex < (aItemGroups.length - 1)) {
+                if (nGroupIndex < (aItemGroups.length - 1)) {
     
                     nNextGroupIndex = nGroupIndex + 1;
     
@@ -7410,7 +7703,7 @@ MenuItem.prototype = {
     * @description Finds the menu item's previous enabled sibling.
     * @return {YAHOO.widget.MenuItem}
     */
-    getPreviousEnabledSibling: function() {
+    getPreviousEnabledSibling: function () {
 
         var nGroupIndex,
             aItemGroups,
@@ -7432,13 +7725,13 @@ MenuItem.prototype = {
 
         }
 
-       if(this.parent instanceof Menu) {
+       if (this.parent instanceof Menu) {
 
             nGroupIndex = this.groupIndex;
             aItemGroups = this.parent.getItemGroups();
 
     
-            if(this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
+            if (this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
     
                 oPreviousItem = getPreviousArrayItem(aItemGroups[nGroupIndex], 
                         (this.index-1));
@@ -7446,7 +7739,7 @@ MenuItem.prototype = {
             }
             else {
     
-                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
+                if (nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
     
                     nPreviousGroupIndex = nGroupIndex - 1;
     
@@ -7479,7 +7772,7 @@ MenuItem.prototype = {
     * @description Causes the menu item to receive the focus and fires the 
     * focus event.
     */
-    focus: function() {
+    focus: function () {
 
         var oParent = this.parent,
             oAnchor = this._oAnchor,
@@ -7497,7 +7790,15 @@ MenuItem.prototype = {
                 
                 }
 
+                if (oActiveItem) {
+    
+                    oActiveItem.blurEvent.fire();
+    
+                }
+
                 oAnchor.focus();
+                
+                me.focusEvent.fire();
 
             }
             catch(e) {
@@ -7507,16 +7808,10 @@ MenuItem.prototype = {
         }
 
 
-        if(!this.cfg.getProperty("disabled") && oParent && 
+        if (!this.cfg.getProperty("disabled") && oParent && 
             oParent.cfg.getProperty("visible") && 
             this.element.style.display != "none") {
 
-            if(oActiveItem) {
-
-                oActiveItem.blur();
-
-            }
-
 
             /*
                 Setting focus via a timer fixes a race condition in Firefox, IE 
@@ -7525,8 +7820,6 @@ MenuItem.prototype = {
             */
 
             window.setTimeout(setFocus, 0);
-            
-            this.focusEvent.fire();
 
         }
 
@@ -7538,16 +7831,29 @@ MenuItem.prototype = {
     * @description Causes the menu item to lose focus and fires the 
     * blur event.
     */    
-    blur: function() {
+    blur: function () {
 
         var oParent = this.parent;
 
-        if(!this.cfg.getProperty("disabled") && oParent && 
+        if (!this.cfg.getProperty("disabled") && oParent && 
             oParent.cfg.getProperty("visible")) {
 
-            this._oAnchor.blur();
 
-            this.blurEvent.fire();
+            var me = this;
+            
+            window.setTimeout(function () {
+
+                try {
+    
+                    me._oAnchor.blur();
+                    me.blurEvent.fire();    
+
+                } 
+                catch (e) {
+                
+                }
+                
+            }, 0);
 
         }
 
@@ -7560,7 +7866,7 @@ MenuItem.prototype = {
     * has focus.
     * @return {Boolean}
     */
-    hasFocus: function() {
+    hasFocus: function () {
     
         return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this);
     
@@ -7572,20 +7878,20 @@ MenuItem.prototype = {
        * @description Removes the menu item's <code>&#60;li&#62;</code> element 
        * from its parent <code>&#60;ul&#62;</code> element.
        */
-    destroy: function() {
+    destroy: function () {
 
         var oEl = this.element,
             oSubmenu,
             oParentNode;
 
-        if(oEl) {
+        if (oEl) {
 
 
             // If the item has a submenu, destroy it first
 
             oSubmenu = this.cfg.getProperty("submenu");
 
-            if(oSubmenu) {
+            if (oSubmenu) {
             
                 oSubmenu.destroy();
             
@@ -7611,7 +7917,7 @@ MenuItem.prototype = {
 
             oParentNode = oEl.parentNode;
 
-            if(oParentNode) {
+            if (oParentNode) {
 
                 oParentNode.removeChild(oEl);
 
@@ -7631,12 +7937,12 @@ MenuItem.prototype = {
     * @description Returns a string representing the menu item.
     * @return {String}
     */
-    toString: function() {
+    toString: function () {
 
         var sReturnVal = "MenuItem",
             sId = this.id;
 
-        if(sId) {
+        if (sId) {
     
             sReturnVal += (" " + sId);
         
@@ -7685,16 +7991,19 @@ YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {
 
 };
 
+
 var Event = YAHOO.util.Event,
     ContextMenu = YAHOO.widget.ContextMenu,
 
-/**
-* Constant representing the name of the ContextMenu's events
-* @property EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
+
+
+    /**
+    * Constant representing the name of the ContextMenu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
     EVENT_TYPES = {
 
         "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
@@ -7714,12 +8023,31 @@ var Event = YAHOO.util.Event,
     DEFAULT_CONFIG = {
     
         "TRIGGER": { 
-            key: "trigger" 
+            key: "trigger",
+            suppressEvent: true
         }
     
     };
 
 
+/**
+* @method position
+* @description "beforeShow" event handler used to position the contextmenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {Array} p_aPos Array representing the xy position for the context menu.
+*/
+function position(p_sType, p_aArgs, p_aPos) {
+
+    this.cfg.setProperty("xy", p_aPos);
+    
+    this.beforeShowEvent.unsubscribe(position, p_aPos);
+
+}
+
+
 YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, {
 
 
@@ -7803,12 +8131,6 @@ triggerContextMenuEvent: null,
 */
 init: function(p_oElement, p_oConfig) {
 
-    if(!this.ITEM_TYPE) {
-
-        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;
-
-    }
-
 
     // Call the init of the superclass (YAHOO.widget.Menu)
 
@@ -7898,6 +8220,7 @@ _removeEventHandlers: function() {
 // Private event handlers
 
 
+
 /**
 * @method _onTriggerClick
 * @description "click" event handler for the HTML element(s) identified as the 
@@ -7931,13 +8254,16 @@ _onTriggerClick: function(p_oEvent, p_oMenu) {
 */
 _onTriggerContextMenu: function(p_oEvent, p_oMenu) {
 
-    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
+    if (p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
 
         return;
 
     }
 
 
+    var aXY;
+
+
     /*
         Prevent the browser's default context menu from appearing and 
         stop the propagation of the "contextmenu" event so that 
@@ -7947,21 +8273,35 @@ _onTriggerContextMenu: function(p_oEvent, p_oMenu) {
     Event.stopEvent(p_oEvent);
 
 
-    // Hide any other ContextMenu instances that might be visible
+    this.contextEventTarget = Event.getTarget(p_oEvent);
 
-    YAHOO.widget.MenuManager.hideVisible();
+    this.triggerContextMenuEvent.fire(p_oEvent);
 
 
-    this.contextEventTarget = Event.getTarget(p_oEvent);
+    // Hide any other Menu instances that might be visible
 
-    this.triggerContextMenuEvent.fire(p_oEvent);
+    YAHOO.widget.MenuManager.hideVisible();
+    
 
 
     if(!this._bCancelled) {
 
         // Position and display the context menu
-    
-        this.cfg.setProperty("xy", Event.getXY(p_oEvent));
+
+        aXY = Event.getXY(p_oEvent);
+
+
+        if (!YAHOO.util.Dom.inDocument(this.element)) {
+
+            this.beforeShowEvent.subscribe(position, aXY);
+
+        }
+        else {
+
+            this.cfg.setProperty("xy", aXY);
+        
+        }
+
 
         this.show();
 
@@ -8017,7 +8357,11 @@ initDefaultConfig: function() {
     * level-one-html.html#ID-58190037">HTMLElement</a>|Array
     */
     this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key, 
-        { handler: this.configTrigger });
+        {
+            handler: this.configTrigger, 
+            suppressEvent: DEFAULT_CONFIG.TRIGGER.suppressEvent 
+        }
+    );
 
 },
 
@@ -8032,7 +8376,7 @@ destroy: function() {
     // Remove the DOM event handlers from the current trigger(s)
 
     this._removeEventHandlers();
-    
+
 
     // Continue with the superclass implementation of this method
 
@@ -8131,93 +8475,10 @@ configTrigger: function(p_sType, p_aArgs, p_oMenu) {
 * @class ContextMenuItem
 * @constructor
 * @extends YAHOO.widget.MenuItem
+* @deprecated As of version 2.4.0 items for YAHOO.widget.ContextMenu instances
+* are of type YAHOO.widget.MenuItem.
 */
-YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {
-
-    YAHOO.widget.ContextMenuItem.superclass.constructor.call(this, 
-        p_oObject, p_oConfig);
-
-};
-
-YAHOO.lang.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {
-
-
-/**
-* @method init
-* @description The ContextMenuItem class's initialization method. This method 
-* is automatically called by the constructor, and sets up all DOM references 
-* for pre-existing markup, and creates required markup if it is not 
-* already present.
-* @param {String} p_oObject String specifying the text of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
-* <code>&#60;li&#62;</code> element of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
-* specifying the <code>&#60;optgroup&#62;</code> element of the context 
-* menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
-* the <code>&#60;option&#62;</code> element of the context menu item.
-* @param {Object} p_oConfig Optional. Object literal specifying the 
-* configuration for the context menu item. See configuration class 
-* documentation for more details.
-*/
-init: function(p_oObject, p_oConfig) {
-    
-    if(!this.SUBMENU_TYPE) {
-
-        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;
-
-    }
-
-
-    /* 
-        Call the init of the superclass (YAHOO.widget.MenuItem)
-        Note: We don't pass the user config in here yet 
-        because we only want it executed once, at the lowest 
-        subclass level.
-    */ 
-
-    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);
-
-    var oConfig = this.cfg;
-
-    if(p_oConfig) {
-
-        oConfig.applyConfig(p_oConfig, true);
-
-    }
-
-    oConfig.fireQueue();
-
-},
-
-
-
-// Public methods
-
-
-/**
-* @method toString
-* @description Returns a string representing the context menu item.
-* @return {String}
-*/
-toString: function() {
-
-    var sReturnVal = "ContextMenuItem";
-
-    if(this.cfg && this.cfg.getProperty("text")) {
-
-        sReturnVal += (": " + this.cfg.getProperty("text"));
-
-    }
-
-    return sReturnVal;
-
-}
-    
-}); // END YAHOO.lang.extend
+YAHOO.widget.ContextMenuItem = YAHOO.widget.MenuItem;
 (function () {
 
 
@@ -8272,7 +8533,6 @@ function checkPosition(p_sPosition) {
 
 
 var Event = YAHOO.util.Event,
-    Dom = YAHOO.util.Dom,
     MenuBar = YAHOO.widget.MenuBar,
 
     /**
@@ -8293,13 +8553,15 @@ var Event = YAHOO.util.Event,
     
         "SUBMENU_ALIGNMENT": { 
             key: "submenualignment", 
-            value: ["tl","bl"] 
+            value: ["tl","bl"],
+            suppressEvent: true 
         },
     
         "AUTO_SUBMENU_DISPLAY": { 
             key: "autosubmenudisplay", 
             value: false, 
-            validator: YAHOO.lang.isBoolean 
+            validator: YAHOO.lang.isBoolean,
+            suppressEvent: true
         }
     
     };
@@ -8554,7 +8816,7 @@ _onClick: function(p_sType, p_aArgs, p_oMenuBar) {
         oSubmenu = oItem.cfg.getProperty("submenu");
 
 
-        if(oSubmenu && oTarget != oItem.submenuIndicator) {
+        if(oSubmenu) {
         
             if(oSubmenu.cfg.getProperty("visible")) {
             
@@ -8656,7 +8918,8 @@ initDefaultConfig: function() {
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         {
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -8677,7 +8940,8 @@ initDefaultConfig: function() {
           DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
           {
               value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+              suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -8821,4 +9085,4 @@ toString: function() {
 }
     
 }); // END YAHOO.lang.extend
-YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.3.0", build: "442"});
+YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.5.0", build: "895"});
index c49713ded14cdbc2ec377ad51fda256e141e9d44..d91d760cd5e5617889efdc3f46e1f1f3dce3d406 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.MenuManager=function(){var m_bInitializedEventHandlers=false,m_oMenus={},m_oVisibleMenus={},m_oItems={},m_oEventTypes={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},m_oFocusedMenuItem=null;function getMenuRootElement(p_oElement){var oParentNode;if(p_oElement&&p_oElement.tagName){switch(p_oElement.tagName.toUpperCase()){case"DIV":oParentNode=p_oElement.parentNode;if((Dom.hasClass(p_oElement,"hd")||Dom.hasClass(p_oElement,"bd")||Dom.hasClass(p_oElement,"ft"))&&oParentNode&&oParentNode.tagName&&oParentNode.tagName.toUpperCase()=="DIV")
-{return oParentNode;}
-else{return p_oElement;}
-break;case"LI":return p_oElement;default:oParentNode=p_oElement.parentNode;if(oParentNode){return getMenuRootElement(oParentNode);}
-break;}}}
-function onDOMEvent(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oElement=getMenuRootElement(oTarget),sCustomEventType,sTagName,sId,oMenuItem,oMenu;if(oElement){sTagName=oElement.tagName.toUpperCase();if(sTagName=="LI"){sId=oElement.id;if(sId&&m_oItems[sId]){oMenuItem=m_oItems[sId];oMenu=oMenuItem.parent;}}
-else if(sTagName=="DIV"){if(oElement.id){oMenu=m_oMenus[oElement.id];}}}
-if(oMenu){sCustomEventType=m_oEventTypes[p_oEvent.type];if(oMenuItem&&!oMenuItem.cfg.getProperty("disabled")){oMenuItem[sCustomEventType].fire(p_oEvent);if(p_oEvent.type=="keyup"||p_oEvent.type=="mousedown")
-{if(m_oFocusedMenuItem!=oMenuItem){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();}
-oMenuItem.focusEvent.fire();}}}
-oMenu[sCustomEventType].fire(p_oEvent,oMenuItem);}
-else if(p_oEvent.type=="mousedown"){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();m_oFocusedMenuItem=null;}
-for(var i in m_oMenus){if(YAHOO.lang.hasOwnProperty(m_oMenus,i)){oMenu=m_oMenus[i];if(oMenu.cfg.getProperty("clicktohide")&&!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}
-else{oMenu.clearActiveItem(true);}}}}
-else if(p_oEvent.type=="keyup"){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();m_oFocusedMenuItem=null;}}}
-function onMenuDestroy(p_sType,p_aArgs,p_oMenu){if(m_oMenus[p_oMenu.id]){this.removeMenu(p_oMenu);}}
-function onMenuFocus(p_sType,p_aArgs){var oItem=p_aArgs[0];if(oItem){m_oFocusedMenuItem=oItem;}}
-function onMenuBlur(p_sType,p_aArgs){m_oFocusedMenuItem=null;}
-function onMenuVisibleConfigChange(p_sType,p_aArgs){var bVisible=p_aArgs[0],sId=this.id;if(bVisible){m_oVisibleMenus[sId]=this;}
-else if(m_oVisibleMenus[sId]){delete m_oVisibleMenus[sId];}}
-function onItemDestroy(p_sType,p_aArgs){var sId=this.id;if(sId&&m_oItems[sId]){if(m_oFocusedMenuItem==this){m_oFocusedMenuItem=null;}
-delete m_oItems[sId];}}
-function onItemAdded(p_sType,p_aArgs){var oItem=p_aArgs[0],sId;if(oItem instanceof YAHOO.widget.MenuItem){sId=oItem.id;if(!m_oItems[sId]){m_oItems[sId]=oItem;oItem.destroyEvent.subscribe(onItemDestroy);}}}
-return{addMenu:function(p_oMenu){var oDoc;if(p_oMenu instanceof YAHOO.widget.Menu&&p_oMenu.id&&!m_oMenus[p_oMenu.id]){m_oMenus[p_oMenu.id]=p_oMenu;if(!m_bInitializedEventHandlers){oDoc=document;Event.on(oDoc,"mouseover",onDOMEvent,this,true);Event.on(oDoc,"mouseout",onDOMEvent,this,true);Event.on(oDoc,"mousedown",onDOMEvent,this,true);Event.on(oDoc,"mouseup",onDOMEvent,this,true);Event.on(oDoc,"click",onDOMEvent,this,true);Event.on(oDoc,"keydown",onDOMEvent,this,true);Event.on(oDoc,"keyup",onDOMEvent,this,true);Event.on(oDoc,"keypress",onDOMEvent,this,true);m_bInitializedEventHandlers=true;}
-p_oMenu.destroyEvent.subscribe(onMenuDestroy,p_oMenu,this);p_oMenu.cfg.subscribeToConfigEvent("visible",onMenuVisibleConfigChange);p_oMenu.itemAddedEvent.subscribe(onItemAdded);p_oMenu.focusEvent.subscribe(onMenuFocus);p_oMenu.blurEvent.subscribe(onMenuBlur);}},removeMenu:function(p_oMenu){var sId;if(p_oMenu){sId=p_oMenu.id;if(m_oMenus[sId]==p_oMenu){delete m_oMenus[sId];if(m_oVisibleMenus[sId]==p_oMenu){delete m_oVisibleMenus[sId];}}}},hideVisible:function(){var oMenu;for(var i in m_oVisibleMenus){if(YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)){oMenu=m_oVisibleMenus[i];if(!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}}}},getMenus:function(){return m_oMenus;},getMenu:function(p_sId){var oMenu=m_oMenus[p_sId];if(oMenu){return oMenu;}},getMenuItem:function(p_sId){var oItem=m_oItems[p_sId];if(oItem){return oItem;}},getMenuItemGroup:function(p_sId){var oUL=Dom.get(p_sId),aItems,oNode,oItem,sId;if(oUL&&oUL.tagName&&oUL.tagName.toUpperCase()=="UL"){oNode=oUL.firstChild;if(oNode){aItems=[];do{sId=oNode.id;if(sId){oItem=this.getMenuItem(sId);if(oItem){aItems[aItems.length]=oItem;}}}
-while((oNode=oNode.nextSibling));if(aItems.length>0){return aItems;}}}},getFocusedMenuItem:function(){return m_oFocusedMenuItem;},getFocusedMenu:function(){if(m_oFocusedMenuItem){return(m_oFocusedMenuItem.parent.getRoot());}},toString:function(){return"MenuManager";}};}();})();(function(){YAHOO.widget.Menu=function(p_oElement,p_oConfig){if(p_oConfig){this.parent=p_oConfig.parent;this.lazyLoad=p_oConfig.lazyLoad||p_oConfig.lazyload;this.itemData=p_oConfig.itemData||p_oConfig.itemdata;}
-YAHOO.widget.Menu.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){if(typeof p_sPosition=="string"){return("dynamic,static".indexOf((p_sPosition.toLowerCase()))!=-1);}}
-var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Module=YAHOO.widget.Module,Overlay=YAHOO.widget.Overlay,Menu=YAHOO.widget.Menu,MenuManager=YAHOO.widget.MenuManager,CustomEvent=YAHOO.util.CustomEvent,Lang=YAHOO.lang,m_oShadowTemplate,EVENT_TYPES={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","FOCUS":"focus","BLUR":"blur","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:false,validator:Lang.isBoolean},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:true,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"POSITION":{key:"position",value:"dynamic",validator:checkPosition,supercedes:["visible","iframe"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","tr"]},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:true,validator:Lang.isBoolean},"SHOW_DELAY":{key:"showdelay",value:250,validator:Lang.isNumber},"HIDE_DELAY":{key:"hidedelay",value:0,validator:Lang.isNumber,suppressEvent:true},"SUBMENU_HIDE_DELAY":{key:"submenuhidedelay",value:250,validator:Lang.isNumber},"CLICK_TO_HIDE":{key:"clicktohide",value:true,validator:Lang.isBoolean},"CONTAINER":{key:"container"},"MAX_HEIGHT":{key:"maxheight",value:0,validator:Lang.isNumber,supercedes:["iframe"]},"CLASS_NAME":{key:"classname",value:null,validator:Lang.isString},"DISABLED":{key:"disabled",value:false,validator:Lang.isBoolean}};YAHOO.lang.extend(Menu,Overlay,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",_nHideDelayId:null,_nShowDelayId:null,_nSubmenuHideDelayId:null,_nBodyScrollId:null,_bHideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,_nCurrentMouseX:0,_nMaxHeight:-1,_bStopMouseEventHandlers:false,_sClassName:null,_bDisabled:false,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,itemAddedEvent:null,itemRemovedEvent:null,init:function(p_oElement,p_oConfig){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}
-var oElement;if(typeof p_oElement=="string"){oElement=document.getElementById(p_oElement);}
-else if(p_oElement.tagName){oElement=p_oElement;}
-if(oElement&&oElement.tagName){switch(oElement.tagName.toUpperCase()){case"DIV":this.srcElement=oElement;if(!oElement.id){oElement.setAttribute("id",Dom.generateId());}
-Menu.superclass.init.call(this,oElement);this.beforeInitEvent.fire(Menu);break;case"SELECT":this.srcElement=oElement;Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(Menu);break;}}
-else{Menu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(Menu);}
-if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit);this.beforeRenderEvent.subscribe(this._onBeforeRender);this.renderEvent.subscribe(this._onRender);this.renderEvent.subscribe(this.onRender);this.beforeShowEvent.subscribe(this._onBeforeShow);this.showEvent.subscribe(this._onShow);this.beforeHideEvent.subscribe(this._onBeforeHide);this.hideEvent.subscribe(this._onHide);this.mouseOverEvent.subscribe(this._onMouseOver);this.mouseOutEvent.subscribe(this._onMouseOut);this.clickEvent.subscribe(this._onClick);this.keyDownEvent.subscribe(this._onKeyDown);this.keyPressEvent.subscribe(this._onKeyPress);Module.textResizeEvent.subscribe(this._onTextResize,this,true);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-MenuManager.addMenu(this);this.initEvent.fire(Menu);}},_initSubTree:function(){var oSrcElement=this.srcElement,sSrcElementTagName,nGroup,sGroupTitleTagName,oNode,aListElements,nListElements,i;if(oSrcElement){sSrcElementTagName=(oSrcElement.tagName&&oSrcElement.tagName.toUpperCase());if(sSrcElementTagName=="DIV"){oNode=this.body.firstChild;if(oNode){nGroup=0;sGroupTitleTagName=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case sGroupTitleTagName:this._aGroupTitleElements[nGroup]=oNode;break;case"UL":this._aListElements[nGroup]=oNode;this._aItemGroups[nGroup]=[];nGroup++;break;}}}
-while((oNode=oNode.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}}
-oNode=null;if(sSrcElementTagName){switch(sSrcElementTagName){case"DIV":aListElements=this._aListElements;nListElements=aListElements.length;if(nListElements>0){i=nListElements-1;do{oNode=aListElements[i].firstChild;if(oNode){do{if(oNode&&oNode.tagName&&oNode.tagName.toUpperCase()=="LI"){this.addItem(new this.ITEM_TYPE(oNode,{parent:this}),i);}}
-while((oNode=oNode.nextSibling));}}
-while(i--);}
-break;case"SELECT":oNode=oSrcElement.firstChild;do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"OPTGROUP":case"OPTION":this.addItem(new this.ITEM_TYPE(oNode,{parent:this}));break;}}}
-while((oNode=oNode.nextSibling));break;}}}},_getFirstEnabledItem:function(){var aItems=this.getItems(),nItems=aItems.length,oItem;for(var i=0;i<nItems;i++){oItem=aItems[i];if(oItem&&!oItem.cfg.getProperty("disabled")&&oItem.element.style.display!="none"){return oItem;}}},_addItemToGroup:function(p_nGroupIndex,p_oItem,p_nItemIndex){var oItem,bDisabled=this.cfg.getProperty("disabled"),nGroupIndex,aGroup,oGroupItem,bAppend,oNextItemSibling,nItemIndex;function getNextItemSibling(p_aArray,p_nStartIndex){return(p_aArray[p_nStartIndex]||getNextItemSibling(p_aArray,(p_nStartIndex+1)));}
-if(p_oItem instanceof this.ITEM_TYPE){oItem=p_oItem;oItem.parent=this;}
-else if(typeof p_oItem=="string"){oItem=new this.ITEM_TYPE(p_oItem,{parent:this});}
-else if(typeof p_oItem=="object"){p_oItem.parent=this;oItem=new this.ITEM_TYPE(p_oItem.text,p_oItem);}
-if(oItem){if(oItem.cfg.getProperty("selected")){this.activeItem=oItem;}
-nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0;aGroup=this._getItemGroup(nGroupIndex);if(!aGroup){aGroup=this._createItemGroup(nGroupIndex);}
-if(typeof p_nItemIndex=="number"){bAppend=(p_nItemIndex>=aGroup.length);if(aGroup[p_nItemIndex]){aGroup.splice(p_nItemIndex,0,oItem);}
-else{aGroup[p_nItemIndex]=oItem;}
-oGroupItem=aGroup[p_nItemIndex];if(oGroupItem){if(bAppend&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}
-else{oNextItemSibling=getNextItemSibling(aGroup,(p_nItemIndex+1));if(oNextItemSibling&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].insertBefore(oGroupItem.element,oNextItemSibling.element);}}
-oGroupItem.parent=this;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);this._updateItemProperties(nGroupIndex);this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();return oGroupItem;}}
-else{nItemIndex=aGroup.length;aGroup[nItemIndex]=oItem;oGroupItem=aGroup[nItemIndex];if(oGroupItem){if(!Dom.isAncestor(this._aListElements[nGroupIndex],oGroupItem.element)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}
-oGroupItem.element.setAttribute("groupindex",nGroupIndex);oGroupItem.element.setAttribute("index",nItemIndex);oGroupItem.parent=this;oGroupItem.index=nItemIndex;oGroupItem.groupIndex=nGroupIndex;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);if(nItemIndex===0){Dom.addClass(oGroupItem.element,"first-of-type");}
-this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();return oGroupItem;}}}},_removeItemFromGroupByIndex:function(p_nGroupIndex,p_nItemIndex){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex),aArray,oItem,oUL;if(aGroup){aArray=aGroup.splice(p_nItemIndex,1);oItem=aArray[0];if(oItem){this._updateItemProperties(nGroupIndex);if(aGroup.length===0){oUL=this._aListElements[nGroupIndex];if(this.body&&oUL){this.body.removeChild(oUL);}
-this._aItemGroups.splice(nGroupIndex,1);this._aListElements.splice(nGroupIndex,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,"first-of-type");}}
-this.itemRemovedEvent.fire(oItem);this.changeContentEvent.fire();return oItem;}}},_removeItemFromGroupByValue:function(p_nGroupIndex,p_oItem){var aGroup=this._getItemGroup(p_nGroupIndex),nItems,nItemIndex,i;if(aGroup){nItems=aGroup.length;nItemIndex=-1;if(nItems>0){i=nItems-1;do{if(aGroup[i]==p_oItem){nItemIndex=i;break;}}
-while(i--);if(nItemIndex>-1){return(this._removeItemFromGroupByIndex(p_nGroupIndex,nItemIndex));}}}},_updateItemProperties:function(p_nGroupIndex){var aGroup=this._getItemGroup(p_nGroupIndex),nItems=aGroup.length,oItem,oLI,i;if(nItems>0){i=nItems-1;do{oItem=aGroup[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=p_nGroupIndex;oLI.setAttribute("groupindex",p_nGroupIndex);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}
-while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(p_nIndex){var oUL;if(!this._aItemGroups[p_nIndex]){this._aItemGroups[p_nIndex]=[];oUL=document.createElement("ul");this._aListElements[p_nIndex]=oUL;return this._aItemGroups[p_nIndex];}},_getItemGroup:function(p_nIndex){var nIndex=((typeof p_nIndex=="number")?p_nIndex:0);return this._aItemGroups[nIndex];},_configureSubmenu:function(p_oItem){var oSubmenu=p_oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,oSubmenu,true);this.renderEvent.subscribe(this._onParentMenuRender,oSubmenu,true);oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,null,oSubmenu);oSubmenu.showEvent.subscribe(this._onSubmenuShow,null,p_oItem);oSubmenu.hideEvent.subscribe(this._onSubmenuHide,null,p_oItem);}},_subscribeToItemEvents:function(p_oItem){p_oItem.focusEvent.subscribe(this._onMenuItemFocus);p_oItem.blurEvent.subscribe(this._onMenuItemBlur);p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,p_oItem,this);},_getOffsetWidth:function(){var oClone=this.element.cloneNode(true);Dom.removeClass(oClone,"visible");Dom.setStyle(oClone,"width","");document.body.appendChild(oClone);var sWidth=oClone.offsetWidth;document.body.removeChild(oClone);return sWidth;},_setWidth:function(){var oElement=this.element,bVisible=false,sWidth;if(oElement.parentNode.tagName.toUpperCase()=="BODY"){if(YAHOO.env.ua.opera){sWidth=this._getOffsetWidth();}
-else{if(Dom.hasClass(oElement,"visible")){bVisible=true;Dom.removeClass(oElement,"visible");}
-Dom.setStyle(oElement,"width","auto");sWidth=oElement.offsetWidth;}}
-else{sWidth=this._getOffsetWidth();}
-this.cfg.setProperty("width",(sWidth+"px"));if(bVisible){Dom.addClass(oElement,"visible");}},_onWidthChange:function(p_sType,p_aArgs){var sWidth=p_aArgs[0];if(sWidth&&!this._hasSetWidthHandlers){this.itemAddedEvent.subscribe(this._setWidth);this.itemRemovedEvent.subscribe(this._setWidth);this._hasSetWidthHandlers=true;}
-else if(this._hasSetWidthHandlers){this.itemAddedEvent.unsubscribe(this._setWidth);this.itemRemovedEvent.unsubscribe(this._setWidth);this._hasSetWidthHandlers=false;}},_onVisibleChange:function(p_sType,p_aArgs){var bVisible=p_aArgs[0];if(bVisible){Dom.addClass(this.element,"visible");}
-else{Dom.removeClass(this.element,"visible");}},_cancelHideDelay:function(){var oRoot=this.getRoot();if(oRoot._nHideDelayId){window.clearTimeout(oRoot._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var oRoot=this.getRoot(),me=this;function hideMenu(){if(oRoot.activeItem){oRoot.clearActiveItem();}
-if(oRoot==me&&!(me instanceof YAHOO.widget.MenuBar)&&me.cfg.getProperty("position")=="dynamic"){me.hide();}}
-oRoot._nHideDelayId=window.setTimeout(hideMenu,oRoot.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var oRoot=this.getRoot();if(oRoot._nShowDelayId){window.clearTimeout(oRoot._nShowDelayId);}},_execShowDelay:function(p_oMenu){var oRoot=this.getRoot();function showMenu(){if(p_oMenu.parent.cfg.getProperty("selected")){p_oMenu.show();}}
-oRoot._nShowDelayId=window.setTimeout(showMenu,oRoot.cfg.getProperty("showdelay"));},_execSubmenuHideDelay:function(p_oSubmenu,p_nMouseX,p_nHideDelay){var me=this;p_oSubmenu._nSubmenuHideDelayId=window.setTimeout(function(){if(me._nCurrentMouseX>(p_nMouseX+10)){p_oSubmenu._nSubmenuHideDelayId=window.setTimeout(function(){p_oSubmenu.hide();},p_nHideDelay);}
-else{p_oSubmenu.hide();}},50);},_disableScrollHeader:function(){if(!this._bHeaderDisabled){Dom.addClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){Dom.addClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){Dom.removeClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){Dom.removeClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=false;}},_onMouseOver:function(p_sType,p_aArgs){if(this._bStopMouseEventHandlers){return false;}
-var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent),oParentMenu,nShowDelay,bShowDelay,oActiveItem,oItemCfg,oSubmenu;if(!this._bHandledMouseOverEvent&&(oTarget==this.element||Dom.isAncestor(this.element,oTarget))){this._nCurrentMouseX=0;Event.on(this.element,"mousemove",this._onMouseMove,this,true);this.clearActiveItem();if(this.parent&&this._nSubmenuHideDelayId){window.clearTimeout(this._nSubmenuHideDelayId);this.parent.cfg.setProperty("selected",true);oParentMenu=this.parent.parent;oParentMenu._bHandledMouseOutEvent=true;oParentMenu._bHandledMouseOverEvent=false;}
-this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}
-if(oItem&&!oItem.handledMouseOverEvent&&!oItem.cfg.getProperty("disabled")&&(oTarget==oItem.element||Dom.isAncestor(oItem.element,oTarget))){nShowDelay=this.cfg.getProperty("showdelay");bShowDelay=(nShowDelay>0);if(bShowDelay){this._cancelShowDelay();}
-oActiveItem=this.activeItem;if(oActiveItem){oActiveItem.cfg.setProperty("selected",false);}
-oItemCfg=oItem.cfg;oItemCfg.setProperty("selected",true);if(this.hasFocus()){oItem.focus();}
-if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(bShowDelay){this._execShowDelay(oSubmenu);}
-else{oSubmenu.show();}}}
-oItem.handledMouseOverEvent=true;oItem.handledMouseOutEvent=false;}},_onMouseOut:function(p_sType,p_aArgs){if(this._bStopMouseEventHandlers){return false;}
-var oEvent=p_aArgs[0],oItem=p_aArgs[1],oRelatedTarget=Event.getRelatedTarget(oEvent),bMovingToSubmenu=false,oItemCfg,oSubmenu,nSubmenuHideDelay,nShowDelay;if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu&&(oRelatedTarget==oSubmenu.element||Dom.isAncestor(oSubmenu.element,oRelatedTarget))){bMovingToSubmenu=true;}
-if(!oItem.handledMouseOutEvent&&((oRelatedTarget!=oItem.element&&!Dom.isAncestor(oItem.element,oRelatedTarget))||bMovingToSubmenu)){if(!bMovingToSubmenu){oItem.cfg.setProperty("selected",false);if(oSubmenu){nSubmenuHideDelay=this.cfg.getProperty("submenuhidedelay");nShowDelay=this.cfg.getProperty("showdelay");if(!(this instanceof YAHOO.widget.MenuBar)&&nSubmenuHideDelay>0&&nShowDelay>=nSubmenuHideDelay){this._execSubmenuHideDelay(oSubmenu,Event.getPageX(oEvent),nSubmenuHideDelay);}
-else{oSubmenu.hide();}}}
-oItem.handledMouseOutEvent=true;oItem.handledMouseOverEvent=false;}}
-if(!this._bHandledMouseOutEvent&&((oRelatedTarget!=this.element&&!Dom.isAncestor(this.element,oRelatedTarget))||bMovingToSubmenu)){Event.removeListener(this.element,"mousemove",this._onMouseMove);this._nCurrentMouseX=Event.getPageX(oEvent);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onMouseMove:function(p_oEvent,p_oMenu){if(this._bStopMouseEventHandlers){return false;}
-this._nCurrentMouseX=Event.getPageX(p_oEvent);},_onClick:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget,oItemCfg,oSubmenu,sURL,oRoot;if(oItem&&!oItem.cfg.getProperty("disabled")){oTarget=Event.getTarget(oEvent);oItemCfg=oItem.cfg;oSubmenu=oItemCfg.getProperty("submenu");if(oTarget==oItem.submenuIndicator&&oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();oSubmenu.parent.focus();}
-else{this.clearActiveItem();oItemCfg.setProperty("selected",true);oSubmenu.show();oSubmenu.setInitialFocus();}
-Event.preventDefault(oEvent);}
-else{sURL=oItemCfg.getProperty("url");if((sURL.substr((sURL.length-1),1)=="#")){Event.preventDefault(oEvent);oItem.focus();}
-if(!oSubmenu){oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar||oRoot.cfg.getProperty("position")=="static"){oRoot.clearActiveItem();}
-else if(oRoot.cfg.getProperty("clicktohide")){oRoot.hide();}}}}},_onKeyDown:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],me=this,oSubmenu,oItemCfg,oParentItem,oRoot,oNextItem,oBody,nBodyScrollTop,nBodyOffsetHeight,aItems,nItems,nNextItemOffsetTop,nScrollTarget,oParentMenu;function stopMouseEventHandlers(){me._bStopMouseEventHandlers=true;window.setTimeout(function(){me._bStopMouseEventHandlers=false;},10);}
-if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;oParentItem=this.parent;switch(oEvent.keyCode){case 38:case 40:oNextItem=(oEvent.keyCode==38)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oNextItem.focus();if(this.cfg.getProperty("maxheight")>0){oBody=this.body;nBodyScrollTop=oBody.scrollTop;nBodyOffsetHeight=oBody.offsetHeight;aItems=this.getItems();nItems=aItems.length-1;nNextItemOffsetTop=oNextItem.element.offsetTop;if(oEvent.keyCode==40){if(nNextItemOffsetTop>=(nBodyOffsetHeight+nBodyScrollTop)){oBody.scrollTop=nNextItemOffsetTop-nBodyOffsetHeight;}
-else if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=0;}
-if(oNextItem==aItems[nItems]){oBody.scrollTop=oNextItem.element.offsetTop;}}
-else{if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=nNextItemOffsetTop-oNextItem.element.offsetHeight;}
-else if(nNextItemOffsetTop>=(nBodyScrollTop+nBodyOffsetHeight)){oBody.scrollTop=nNextItemOffsetTop;}
-if(oNextItem==aItems[0]){oBody.scrollTop=0;}}
-nBodyScrollTop=oBody.scrollTop;nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;if(nBodyScrollTop===0){this._disableScrollHeader();this._enableScrollFooter();}
-else if(nBodyScrollTop==nScrollTarget){this._enableScrollHeader();this._disableScrollFooter();}
-else{this._enableScrollHeader();this._enableScrollFooter();}}}
-Event.preventDefault(oEvent);stopMouseEventHandlers();break;case 39:oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
-oSubmenu.show();oSubmenu.setInitialFocus();oSubmenu.setInitialSelection();}
-else{oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar){oNextItem=oRoot.activeItem.getNextEnabledSibling();if(oNextItem){oRoot.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}
-oNextItem.focus();}}}
-Event.preventDefault(oEvent);stopMouseEventHandlers();break;case 37:if(oParentItem){oParentMenu=oParentItem.parent;if(oParentMenu instanceof YAHOO.widget.MenuBar){oNextItem=oParentMenu.activeItem.getPreviousEnabledSibling();if(oNextItem){oParentMenu.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}
-oNextItem.focus();}}
-else{this.hide();oParentItem.focus();}}
-Event.preventDefault(oEvent);stopMouseEventHandlers();break;}}
-if(oEvent.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}
-else if(this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}
-else{this.activeItem.blur();this.activeItem.cfg.setProperty("selected",false);}}
-Event.preventDefault(oEvent);}},_onKeyPress:function(p_sType,p_aArgs){var oEvent=p_aArgs[0];if(oEvent.keyCode==40||oEvent.keyCode==38){Event.preventDefault(oEvent);}},_onTextResize:function(p_sType,p_aArgs,p_oMenu){if(YAHOO.env.ua.gecko&&!this._handleResize){this._handleResize=true;return;}
-var oConfig=this.cfg;if(oConfig.getProperty("position")=="dynamic"){oConfig.setProperty("width",(this._getOffsetWidth()+"px"));}},_onScrollTargetMouseOver:function(p_oEvent,p_oMenu){this._cancelHideDelay();var oTarget=Event.getTarget(p_oEvent),oBody=this.body,me=this,nScrollTarget,fnScrollFunction;function scrollBodyDown(){var nScrollTop=oBody.scrollTop;if(nScrollTop<nScrollTarget){oBody.scrollTop=(nScrollTop+1);me._enableScrollHeader();}
-else{oBody.scrollTop=nScrollTarget;window.clearInterval(me._nBodyScrollId);me._disableScrollFooter();}}
-function scrollBodyUp(){var nScrollTop=oBody.scrollTop;if(nScrollTop>0){oBody.scrollTop=(nScrollTop-1);me._enableScrollFooter();}
-else{oBody.scrollTop=0;window.clearInterval(me._nBodyScrollId);me._disableScrollHeader();}}
-if(Dom.hasClass(oTarget,"hd")){fnScrollFunction=scrollBodyUp;}
-else{nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;fnScrollFunction=scrollBodyDown;}
-this._nBodyScrollId=window.setInterval(fnScrollFunction,10);},_onScrollTargetMouseOut:function(p_oEvent,p_oMenu){window.clearInterval(this._nBodyScrollId);this._cancelHideDelay();},_onInit:function(p_sType,p_aArgs){this.cfg.subscribeToConfigEvent("width",this._onWidthChange);this.cfg.subscribeToConfigEvent("visible",this._onVisibleChange);var bRootMenu=!this.parent,bLazyLoad=this.lazyLoad;if(((bRootMenu&&!bLazyLoad)||(bRootMenu&&(this.cfg.getProperty("visible")||this.cfg.getProperty("position")=="static"))||(!bRootMenu&&!bLazyLoad))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}
-if(this.itemData){this.addItems(this.itemData);}}
-else if(bLazyLoad){this.cfg.fireQueue();}},_onBeforeRender:function(p_sType,p_aArgs){var oConfig=this.cfg,oEl=this.element,nListElements=this._aListElements.length,bFirstList=true,i=0,oUL,oGroupTitle;if(nListElements>0){do{oUL=this._aListElements[i];if(oUL){if(bFirstList){Dom.addClass(oUL,"first-of-type");bFirstList=false;}
-if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}
-oGroupTitle=this._aGroupTitleElements[i];if(oGroupTitle){if(!Dom.isAncestor(oEl,oGroupTitle)){oUL.parentNode.insertBefore(oGroupTitle,oUL);}
-Dom.addClass(oUL,"hastitle");}}
-i++;}
-while(i<nListElements);}},_onRender:function(p_sType,p_aArgs){if(this.cfg.getProperty("position")=="dynamic"&&!this.cfg.getProperty("width")){this._setWidth();}},_onBeforeShow:function(p_sType,p_aArgs){var nOptions,n,nViewportHeight,oRegion,nMaxHeight,oBody,oSrcElement;if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}
-if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()=="SELECT"){nOptions=this.itemData.length;for(n=0;n<nOptions;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}
-else{this.addItems(this.itemData);}}
-oSrcElement=this.srcElement;if(oSrcElement){if(oSrcElement.tagName.toUpperCase()=="SELECT"){if(Dom.inDocument(oSrcElement)){this.render(oSrcElement.parentNode);}
-else{this.render(this.cfg.getProperty("container"));}}
-else{this.render();}}
-else{if(this.parent){this.render(this.parent.element);}
-else{this.render(this.cfg.getProperty("container"));this.cfg.refireEvent("xy");}}}
-if(!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty("position")=="dynamic"){nViewportHeight=Dom.getViewportHeight();if(this.parent&&this.parent.parent instanceof YAHOO.widget.MenuBar){oRegion=YAHOO.util.Region.getRegion(this.parent.element);nViewportHeight=(nViewportHeight-oRegion.bottom);}
-if(this.element.offsetHeight>=nViewportHeight){nMaxHeight=this.cfg.getProperty("maxheight");this._nMaxHeight=nMaxHeight;this.cfg.setProperty("maxheight",(nViewportHeight-20));}
-if(this.cfg.getProperty("maxheight")>0){oBody=this.body;if(oBody.scrollTop>0){oBody.scrollTop=0;}
-this._disableScrollHeader();this._enableScrollFooter();}}},_onShow:function(p_sType,p_aArgs){var oParent=this.parent,oParentMenu,aParentAlignment,aAlignment;function disableAutoSubmenuDisplay(p_oEvent){var oTarget;if(p_oEvent.type=="mousedown"||(p_oEvent.type=="keydown"&&p_oEvent.keyCode==27)){oTarget=Event.getTarget(p_oEvent);if(oTarget!=oParentMenu.element||!Dom.isAncestor(oParentMenu.element,oTarget)){oParentMenu.cfg.setProperty("autosubmenudisplay",false);Event.removeListener(document,"mousedown",disableAutoSubmenuDisplay);Event.removeListener(document,"keydown",disableAutoSubmenuDisplay);}}}
-if(oParent){oParentMenu=oParent.parent;aParentAlignment=oParentMenu.cfg.getProperty("submenualignment");aAlignment=this.cfg.getProperty("submenualignment");if((aParentAlignment[0]!=aAlignment[0])&&(aParentAlignment[1]!=aAlignment[1])){this.cfg.setProperty("submenualignment",[aParentAlignment[0],aParentAlignment[1]]);}
-if(!oParentMenu.cfg.getProperty("autosubmenudisplay")&&(oParentMenu instanceof YAHOO.widget.MenuBar||oParentMenu.cfg.getProperty("position")=="static")){oParentMenu.cfg.setProperty("autosubmenudisplay",true);Event.on(document,"mousedown",disableAutoSubmenuDisplay);Event.on(document,"keydown",disableAutoSubmenuDisplay);}}},_onBeforeHide:function(p_sType,p_aArgs){var oActiveItem=this.activeItem,oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}}
-if(this.getRoot()==this){this.blur();}},_onHide:function(p_sType,p_aArgs){if(this._nMaxHeight!=-1){this.cfg.setProperty("maxheight",this._nMaxHeight);this._nMaxHeight=-1;}},_onParentMenuConfigChange:function(p_sType,p_aArgs,p_oSubmenu){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1];switch(sPropertyName){case"iframe":case"constraintoviewport":case"hidedelay":case"showdelay":case"submenuhidedelay":case"clicktohide":case"effect":case"classname":p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);break;}},_onParentMenuRender:function(p_sType,p_aArgs,p_oSubmenu){var oParentMenu=p_oSubmenu.parent.parent,oConfig={constraintoviewport:oParentMenu.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:oParentMenu.cfg.getProperty("clicktohide"),effect:oParentMenu.cfg.getProperty("effect"),showdelay:oParentMenu.cfg.getProperty("showdelay"),hidedelay:oParentMenu.cfg.getProperty("hidedelay"),submenuhidedelay:oParentMenu.cfg.getProperty("submenuhidedelay"),classname:oParentMenu.cfg.getProperty("classname")},oLI;if(this.cfg.getProperty("position")==oParentMenu.cfg.getProperty("position")){oConfig.iframe=oParentMenu.cfg.getProperty("iframe");}
-p_oSubmenu.cfg.applyConfig(oConfig);if(!this.lazyLoad){oLI=this.parent.element;if(this.element.parentNode==oLI){this.render();}
-else{this.render(oLI);}}},_onSubmenuBeforeShow:function(p_sType,p_aArgs){var oParent=this.parent,aAlignment=oParent.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[oParent.element,aAlignment[0],aAlignment[1]]);var nScrollTop=oParent.parent.body.scrollTop;if((YAHOO.env.ua.gecko||YAHOO.env.ua.webkit)&&nScrollTop>0){this.cfg.setProperty("y",(this.cfg.getProperty("y")-nScrollTop));}},_onSubmenuShow:function(p_sType,p_aArgs){this.submenuIndicator.innerHTML=this.EXPANDED_SUBMENU_INDICATOR_TEXT;},_onSubmenuHide:function(p_sType,p_aArgs){this.submenuIndicator.innerHTML=this.COLLAPSED_SUBMENU_INDICATOR_TEXT;},_onMenuItemFocus:function(p_sType,p_aArgs){this.parent.focusEvent.fire(this);},_onMenuItemBlur:function(p_sType,p_aArgs){this.parent.blurEvent.fire(this);},_onMenuItemConfigChange:function(p_sType,p_aArgs,p_oItem){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1],sWidth,oSubmenu;switch(sPropertyName){case"selected":if(oPropertyValue===true){this.activeItem=p_oItem;}
-break;case"submenu":oSubmenu=p_aArgs[0][1];if(oSubmenu){this._configureSubmenu(p_oItem);}
-break;case"text":case"helptext":if(this.element.style.width){sWidth=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",sWidth);}
-break;}},enforceConstraints:function(type,args,obj){var oParentMenuItem=this.parent,oElement,oConfig,pos,x,y,offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY,nPadding,topConstraint,leftConstraint,bottomConstraint,rightConstraint,aContext,oContextElement;if(oParentMenuItem&&!(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)){oElement=this.element;oConfig=this.cfg;pos=args[0];x=pos[0];y=pos[1];offsetHeight=oElement.offsetHeight;offsetWidth=oElement.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();nPadding=(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)?0:10;topConstraint=scrollY+nPadding;leftConstraint=scrollX+nPadding;bottomConstraint=scrollY+viewPortHeight-offsetHeight-nPadding;rightConstraint=scrollX+viewPortWidth-offsetWidth-nPadding;aContext=oConfig.getProperty("context");oContextElement=aContext?aContext[0]:null;if(x<10){x=leftConstraint;}else if((x+offsetWidth)>viewPortWidth){if(oContextElement&&((x-oContextElement.offsetWidth)>offsetWidth)){x=(x-(oContextElement.offsetWidth+offsetWidth));}
-else{x=rightConstraint;}}
-if(y<10){y=topConstraint;}else if(y>bottomConstraint){if(oContextElement&&(y>offsetHeight)){y=((y+oContextElement.offsetHeight)-offsetHeight);}
-else{y=bottomConstraint;}}
-oConfig.setProperty("x",x,true);oConfig.setProperty("y",y,true);oConfig.setProperty("xy",[x,y],true);}
-else if(this==this.getRoot()&&this.cfg.getProperty("position")=="dynamic"){Menu.superclass.enforceConstraints.call(this,type,args,obj);}},configVisible:function(p_sType,p_aArgs,p_oMenu){var bVisible,sDisplay;if(this.cfg.getProperty("position")=="dynamic"){Menu.superclass.configVisible.call(this,p_sType,p_aArgs,p_oMenu);}
-else{bVisible=p_aArgs[0];sDisplay=Dom.getStyle(this.element,"display");if(bVisible){if(sDisplay!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}
-else{if(sDisplay=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(p_sType,p_aArgs,p_oMenu){var oElement=this.element,sCSSPosition=p_aArgs[0]=="static"?"static":"absolute",sCurrentPosition=Dom.getStyle(oElement,"position"),oCfg=this.cfg,nZIndex;Dom.setStyle(this.element,"position",sCSSPosition);if(sCSSPosition=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}
-else{if(sCurrentPosition!="absolute"){oCfg.setProperty("iframe",(YAHOO.env.ua.ie==6?true:false));}
-Dom.setStyle(this.element,"visibility","hidden");}
-if(sCSSPosition=="absolute"){nZIndex=oCfg.getProperty("zindex");if(!nZIndex||nZIndex===0){nZIndex=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",nZIndex);}}},configIframe:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){Menu.superclass.configIframe.call(this,p_sType,p_aArgs,p_oMenu);}},configHideDelay:function(p_sType,p_aArgs,p_oMenu){var nHideDelay=p_aArgs[0],oMouseOutEvent=this.mouseOutEvent,oMouseOverEvent=this.mouseOverEvent,oKeyDownEvent=this.keyDownEvent;if(nHideDelay>0){if(!this._bHideDelayEventHandlersAssigned){oMouseOutEvent.subscribe(this._execHideDelay);oMouseOverEvent.subscribe(this._cancelHideDelay);oKeyDownEvent.subscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=true;}}
-else{oMouseOutEvent.unsubscribe(this._execHideDelay);oMouseOverEvent.unsubscribe(this._cancelHideDelay);oKeyDownEvent.unsubscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=false;}},configContainer:function(p_sType,p_aArgs,p_oMenu){var oElement=p_aArgs[0];if(typeof oElement=='string'){this.cfg.setProperty("container",document.getElementById(oElement),true);}},_setMaxHeight:function(p_sType,p_aArgs,p_nMaxHeight){this.cfg.setProperty("maxheight",p_nMaxHeight);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(p_sType,p_aArgs,p_oMenu){var nMaxHeight=p_aArgs[0],oBody=this.body,oHeader=this.header,oFooter=this.footer,fnMouseOver=this._onScrollTargetMouseOver,fnMouseOut=this._onScrollTargetMouseOut,nHeight;if(this.lazyLoad&&!oBody){this.renderEvent.unsubscribe(this._setMaxHeight);if(nMaxHeight>0){this.renderEvent.subscribe(this._setMaxHeight,nMaxHeight,this);}
-return;}
-Dom.setStyle(oBody,"height","auto");Dom.setStyle(oBody,"overflow","visible");if((nMaxHeight>0)&&(oBody.offsetHeight>nMaxHeight)){if(!this.cfg.getProperty("width")){this._setWidth();}
-if(!oHeader&&!oFooter){this.setHeader("&#32;");this.setFooter("&#32;");oHeader=this.header;oFooter=this.footer;Dom.addClass(oHeader,"topscrollbar");Dom.addClass(oFooter,"bottomscrollbar");this.element.insertBefore(oHeader,oBody);this.element.appendChild(oFooter);Event.on(oHeader,"mouseover",fnMouseOver,this,true);Event.on(oHeader,"mouseout",fnMouseOut,this,true);Event.on(oFooter,"mouseover",fnMouseOver,this,true);Event.on(oFooter,"mouseout",fnMouseOut,this,true);}
-nHeight=(nMaxHeight-(this.footer.offsetHeight+
-this.header.offsetHeight));Dom.setStyle(oBody,"height",(nHeight+"px"));Dom.setStyle(oBody,"overflow","hidden");}
-else if(oHeader&&oFooter){Dom.setStyle(oBody,"height","auto");Dom.setStyle(oBody,"overflow","visible");Event.removeListener(oHeader,"mouseover",fnMouseOver);Event.removeListener(oHeader,"mouseout",fnMouseOut);Event.removeListener(oFooter,"mouseover",fnMouseOver);Event.removeListener(oFooter,"mouseout",fnMouseOut);this.element.removeChild(oHeader);this.element.removeChild(oFooter);this.header=null;this.footer=null;}
-this.cfg.refireEvent("iframe");},configClassName:function(p_sType,p_aArgs,p_oMenu){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}
-Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},_onItemAdded:function(p_sType,p_aArgs){var oItem=p_aArgs[0];if(oItem){oItem.cfg.setProperty("disabled",true);}},configDisabled:function(p_sType,p_aArgs,p_oMenu){var bDisabled=p_aArgs[0],aItems,nItems,i;if(this._bDisabled!=bDisabled){aItems=this.getItems();nItems=aItems.length;if(nItems>0){i=nItems-1;do{aItems[i].cfg.setProperty("disabled",bDisabled);}
-while(i--);}
-Dom[(bDisabled?"addClass":"removeClass")](this.element,"disabled");this.itemAddedEvent[(bDisabled?"subscribe":"unsubscribe")](this._onItemAdded);this._bDisabled=bDisabled;}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this._shadow;if(oShadow){oShadow.style.width=(oElement.offsetWidth+6)+"px";oShadow.style.height=(oElement.offsetHeight+1)+"px";}}
-function addShadowVisibleClass(){Dom.addClass(this._shadow,"yui-menu-shadow-visible");}
-function removeShadowVisibleClass(){Dom.removeClass(this._shadow,"yui-menu-shadow-visible");}
-function createShadow(){var oShadow=this._shadow,oElement,me;if(!oShadow){oElement=this.element;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-menu-shadow";}
-oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;addShadowVisibleClass.call(this);this.beforeShowEvent.subscribe(addShadowVisibleClass);this.beforeHideEvent.subscribe(removeShadowVisibleClass);if(YAHOO.env.ua.ie){window.setTimeout(function(){sizeShadow.call(me);me.syncIframe();},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.changeContentEvent.subscribe(sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,me,true);this.destroyEvent.subscribe(function(){Module.textResizeEvent.unsubscribe(sizeShadow,me);});}}}
-function onBeforeShow(){createShadow.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);}
-if(this.cfg.getProperty("position")=="dynamic"){if(this.cfg.getProperty("visible")){createShadow.call(this);}
-else{this.beforeShowEvent.subscribe(onBeforeShow);}}},initEvents:function(){Menu.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.mouseOverEvent=this.createEvent(EVENT_TYPES.MOUSE_OVER);this.mouseOverEvent.signature=SIGNATURE;this.mouseOutEvent=this.createEvent(EVENT_TYPES.MOUSE_OUT);this.mouseOutEvent.signature=SIGNATURE;this.mouseDownEvent=this.createEvent(EVENT_TYPES.MOUSE_DOWN);this.mouseDownEvent.signature=SIGNATURE;this.mouseUpEvent=this.createEvent(EVENT_TYPES.MOUSE_UP);this.mouseUpEvent.signature=SIGNATURE;this.clickEvent=this.createEvent(EVENT_TYPES.CLICK);this.clickEvent.signature=SIGNATURE;this.keyPressEvent=this.createEvent(EVENT_TYPES.KEY_PRESS);this.keyPressEvent.signature=SIGNATURE;this.keyDownEvent=this.createEvent(EVENT_TYPES.KEY_DOWN);this.keyDownEvent.signature=SIGNATURE;this.keyUpEvent=this.createEvent(EVENT_TYPES.KEY_UP);this.keyUpEvent.signature=SIGNATURE;this.focusEvent=this.createEvent(EVENT_TYPES.FOCUS);this.focusEvent.signature=SIGNATURE;this.blurEvent=this.createEvent(EVENT_TYPES.BLUR);this.blurEvent.signature=SIGNATURE;this.itemAddedEvent=this.createEvent(EVENT_TYPES.ITEM_ADDED);this.itemAddedEvent.signature=SIGNATURE;this.itemRemovedEvent=this.createEvent(EVENT_TYPES.ITEM_REMOVED);this.itemRemovedEvent.signature=SIGNATURE;},getRoot:function(){var oItem=this.parent,oParentMenu;if(oItem){oParentMenu=oItem.parent;return oParentMenu?oParentMenu.getRoot():this;}
-else{return this;}},toString:function(){var sReturnVal="Menu",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
-return sReturnVal;},setItemGroupTitle:function(p_sGroupTitle,p_nGroupIndex){var nGroupIndex,oTitle,i,nFirstIndex;if(typeof p_sGroupTitle=="string"&&p_sGroupTitle.length>0){nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0;oTitle=this._aGroupTitleElements[nGroupIndex];if(oTitle){oTitle.innerHTML=p_sGroupTitle;}
-else{oTitle=document.createElement(this.GROUP_TITLE_TAG_NAME);oTitle.innerHTML=p_sGroupTitle;this._aGroupTitleElements[nGroupIndex]=oTitle;}
-i=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");nFirstIndex=i;}}
-while(i--);if(nFirstIndex!==null){Dom.addClass(this._aGroupTitleElements[nFirstIndex],"first-of-type");}
-this.changeContentEvent.fire();}},addItem:function(p_oItem,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem);}},addItems:function(p_aItems,p_nGroupIndex){var nItems,aItems,oItem,i;if(Lang.isArray(p_aItems)){nItems=p_aItems.length;aItems=[];for(i=0;i<nItems;i++){oItem=p_aItems[i];if(oItem){if(Lang.isArray(oItem)){aItems[aItems.length]=this.addItems(oItem,i);}
-else{aItems[aItems.length]=this._addItemToGroup(p_nGroupIndex,oItem);}}}
-if(aItems.length){return aItems;}}},insertItem:function(p_oItem,p_nItemIndex,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem,p_nItemIndex);}},removeItem:function(p_oObject,p_nGroupIndex){var oItem;if(typeof p_oObject!="undefined"){if(p_oObject instanceof YAHOO.widget.MenuItem){oItem=this._removeItemFromGroupByValue(p_nGroupIndex,p_oObject);}
-else if(typeof p_oObject=="number"){oItem=this._removeItemFromGroupByIndex(p_nGroupIndex,p_oObject);}
-if(oItem){oItem.destroy();return oItem;}}},getItems:function(){var aGroups=this._aItemGroups,nGroups=aGroups.length;return((nGroups==1)?aGroups[0]:(Array.prototype.concat.apply([],aGroups)));},getItemGroups:function(){return this._aItemGroups;},getItem:function(p_nItemIndex,p_nGroupIndex){var aGroup;if(typeof p_nItemIndex=="number"){aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){return aGroup[p_nItemIndex];}}},getSubmenus:function(){var aItems=this.getItems(),nItems=aItems.length,aSubmenus,oSubmenu,oItem,i;if(nItems>0){aSubmenus=[];for(i=0;i<nItems;i++){oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){aSubmenus[aSubmenus.length]=oSubmenu;}}}}
-return aSubmenus;},clearContent:function(){var aItems=this.getItems(),nItems=aItems.length,oElement=this.element,oBody=this.body,oHeader=this.header,oFooter=this.footer,oItem,oSubmenu,i;if(nItems>0){i=nItems-1;do{oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,oSubmenu);this.renderEvent.unsubscribe(this._onParentMenuRender,oSubmenu);}
-this.removeItem(oItem);}}
-while(i--);}
-if(oHeader){Event.purgeElement(oHeader);oElement.removeChild(oHeader);}
-if(oFooter){Event.purgeElement(oFooter);oElement.removeChild(oFooter);}
-if(oBody){Event.purgeElement(oBody);oBody.innerHTML="";}
-this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty("width",null);},destroy:function(){Module.textResizeEvent.unsubscribe(this._onTextResize,this);this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;Menu.superclass.destroy.call(this);},setInitialFocus:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.focus();}},setInitialSelection:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.cfg.setProperty("selected",true);}},clearActiveItem:function(p_bBlur){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}
-var oActiveItem=this.activeItem,oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;if(p_bBlur){oActiveItem.blur();}
-oConfig.setProperty("selected",false);oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}
-this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var oItem;if(this.hasFocus()){oItem=MenuManager.getFocusedMenuItem();if(oItem){oItem.blur();}}},hasFocus:function(){return(MenuManager.getFocusedMenu()==this.getRoot());},subscribe:function(){function onItemAdded(p_sType,p_aArgs,p_oObject){var oItem=p_aArgs[0],oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.subscribe.apply(oSubmenu,p_oObject);}}
-Menu.superclass.subscribe.apply(this,arguments);Menu.superclass.subscribe.call(this,"itemAdded",onItemAdded,arguments);var aSubmenus=this.getSubmenus(),nSubmenus,oSubmenu,i;if(aSubmenus){nSubmenus=aSubmenus.length;if(nSubmenus>0){i=nSubmenus-1;do{oSubmenu=aSubmenus[i];oSubmenu.subscribe.apply(oSubmenu,arguments);}
-while(i--);}}},initDefaultConfig:function(){Menu.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});oConfig.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});oConfig.addProperty(DEFAULT_CONFIG.POSITION.key,{handler:this.configPosition,value:DEFAULT_CONFIG.POSITION.value,validator:DEFAULT_CONFIG.POSITION.validator,supercedes:DEFAULT_CONFIG.POSITION.supercedes});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key,{value:DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value});oConfig.addProperty(DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key,{value:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value,validator:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator});oConfig.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{value:DEFAULT_CONFIG.SHOW_DELAY.value,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});oConfig.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator,suppressEvent:DEFAULT_CONFIG.HIDE_DELAY.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key,{value:DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value,validator:DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator});oConfig.addProperty(DEFAULT_CONFIG.CLICK_TO_HIDE.key,{value:DEFAULT_CONFIG.CLICK_TO_HIDE.value,validator:DEFAULT_CONFIG.CLICK_TO_HIDE.validator});oConfig.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});oConfig.addProperty(DEFAULT_CONFIG.MAX_HEIGHT.key,{handler:this.configMaxHeight,value:DEFAULT_CONFIG.MAX_HEIGHT.value,validator:DEFAULT_CONFIG.MAX_HEIGHT.validator});oConfig.addProperty(DEFAULT_CONFIG.CLASS_NAME.key,{handler:this.configClassName,value:DEFAULT_CONFIG.CLASS_NAME.value,validator:DEFAULT_CONFIG.CLASS_NAME.validator});oConfig.addProperty(DEFAULT_CONFIG.DISABLED.key,{handler:this.configDisabled,value:DEFAULT_CONFIG.DISABLED.value,validator:DEFAULT_CONFIG.DISABLED.validator});}});})();(function(){YAHOO.widget.MenuItem=function(p_oObject,p_oConfig){if(p_oObject){if(p_oConfig){this.parent=p_oConfig.parent;this.value=p_oConfig.value;this.id=p_oConfig.id;}
-this.init(p_oObject,p_oConfig);}};var Dom=YAHOO.util.Dom,Module=YAHOO.widget.Module,Menu=YAHOO.widget.Menu,MenuItem=YAHOO.widget.MenuItem,CustomEvent=YAHOO.util.CustomEvent,Lang=YAHOO.lang,m_oMenuItemTemplate,EVENT_TYPES={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved","FOCUS":"focus","BLUR":"blur","DESTROY":"destroy"},DEFAULT_CONFIG={"TEXT":{key:"text",value:"",validator:Lang.isString,suppressEvent:true},"HELP_TEXT":{key:"helptext",supercedes:["text"]},"URL":{key:"url",value:"#",suppressEvent:true},"TARGET":{key:"target",suppressEvent:true},"EMPHASIS":{key:"emphasis",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"STRONG_EMPHASIS":{key:"strongemphasis",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"CHECKED":{key:"checked",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"DISABLED":{key:"disabled",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"SELECTED":{key:"selected",value:false,validator:Lang.isBoolean,suppressEvent:true},"SUBMENU":{key:"submenu",supercedes:["text"]},"ONCLICK":{key:"onclick"},"CLASS_NAME":{key:"classname",value:null,validator:Lang.isString}};MenuItem.prototype={COLLAPSED_SUBMENU_INDICATOR_TEXT:"Submenu collapsed.  Click to expand submenu.",EXPANDED_SUBMENU_INDICATOR_TEXT:"Submenu expanded.  Click to collapse submenu.",DISABLED_SUBMENU_INDICATOR_TEXT:"Submenu collapsed.  (Item disabled.)",CHECKED_TEXT:"Menu item checked.",DISABLED_CHECKED_TEXT:"Checked. (Item disabled.)",CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oCheckedIndicator:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:MenuItem,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:Module.prototype.browser,id:null,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}
-this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var SIGNATURE=CustomEvent.LIST,oConfig=this.cfg,sURL="#",oAnchor,sTarget,sText,sId;if(Lang.isString(p_oObject)){this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject);}
-else if(p_oObject&&p_oObject.tagName){switch(p_oObject.tagName.toUpperCase()){case"OPTION":this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject.text);this.srcElement=p_oObject;break;case"OPTGROUP":this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject.label);this.srcElement=p_oObject;this._initSubTree();break;case"LI":oAnchor=Dom.getFirstChild(p_oObject);if(oAnchor){sURL=oAnchor.getAttribute("href");sTarget=oAnchor.getAttribute("target");sText=oAnchor.innerHTML;}
-this.srcElement=p_oObject;this.element=p_oObject;this._oAnchor=oAnchor;oConfig.setProperty("text",sText,true);oConfig.setProperty("url",sURL,true);oConfig.setProperty("target",sTarget,true);this._initSubTree();break;}}
-if(this.element){sId=this.element.id;if(!sId){sId=this.id||Dom.generateId();this.element.id=sId;}
-this.id=sId;Dom.addClass(this.element,this.CSS_CLASS_NAME);Dom.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);this.mouseOverEvent=this.createEvent(EVENT_TYPES.MOUSE_OVER);this.mouseOverEvent.signature=SIGNATURE;this.mouseOutEvent=this.createEvent(EVENT_TYPES.MOUSE_OUT);this.mouseOutEvent.signature=SIGNATURE;this.mouseDownEvent=this.createEvent(EVENT_TYPES.MOUSE_DOWN);this.mouseDownEvent.signature=SIGNATURE;this.mouseUpEvent=this.createEvent(EVENT_TYPES.MOUSE_UP);this.mouseUpEvent.signature=SIGNATURE;this.clickEvent=this.createEvent(EVENT_TYPES.CLICK);this.clickEvent.signature=SIGNATURE;this.keyPressEvent=this.createEvent(EVENT_TYPES.KEY_PRESS);this.keyPressEvent.signature=SIGNATURE;this.keyDownEvent=this.createEvent(EVENT_TYPES.KEY_DOWN);this.keyDownEvent.signature=SIGNATURE;this.keyUpEvent=this.createEvent(EVENT_TYPES.KEY_UP);this.keyUpEvent.signature=SIGNATURE;this.focusEvent=this.createEvent(EVENT_TYPES.FOCUS);this.focusEvent.signature=SIGNATURE;this.blurEvent=this.createEvent(EVENT_TYPES.BLUR);this.blurEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTROY);this.destroyEvent.signature=SIGNATURE;if(p_oConfig){oConfig.applyConfig(p_oConfig);}
-oConfig.fireQueue();}},_createRootNodeStructure:function(){var oElement,oAnchor;if(!m_oMenuItemTemplate){m_oMenuItemTemplate=document.createElement("li");m_oMenuItemTemplate.innerHTML="<a href=\"#\"></a>";}
-oElement=m_oMenuItemTemplate.cloneNode(true);oElement.className=this.CSS_CLASS_NAME;oAnchor=oElement.firstChild;oAnchor.className=this.CSS_LABEL_CLASS_NAME;this.element=oElement;this._oAnchor=oAnchor;},_initSubTree:function(){var oSrcEl=this.srcElement,oConfig=this.cfg,oNode,aOptions,nOptions,oMenu,n;if(oSrcEl.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){oConfig.setProperty("submenu",{id:Dom.generateId(),itemdata:oSrcEl.childNodes});}
-else{oNode=oSrcEl.firstChild;aOptions=[];do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"DIV":oConfig.setProperty("submenu",oNode);break;case"OPTION":aOptions[aOptions.length]=oNode;break;}}}
-while((oNode=oNode.nextSibling));nOptions=aOptions.length;if(nOptions>0){oMenu=new this.SUBMENU_TYPE(Dom.generateId());oConfig.setProperty("submenu",oMenu);for(n=0;n<nOptions;n++){oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));}}}}},configText:function(p_sType,p_aArgs,p_oItem){var sText=p_aArgs[0],oConfig=this.cfg,oAnchor=this._oAnchor,sHelpText=oConfig.getProperty("helptext"),sHelpTextHTML="",sCheckHTML="",oSubmenu=oConfig.getProperty("submenu"),sSubmenuIndicatorHTML="",sEmphasisStartTag="",sEmphasisEndTag="";if(sText){if(sHelpText){sHelpTextHTML="<em class=\"helptext\">"+sHelpText+"</em>";}
-if(oConfig.getProperty("checked")){sCheckHTML="<em class=\"checkedindicator\">"+
-this.CHECKED_TEXT+"</em>";}
-if(oSubmenu){sSubmenuIndicatorHTML="<em class=\"submenuindicator\">"+
-((oSubmenu instanceof Menu&&oSubmenu.cfg.getProperty("visible"))?this.EXPANDED_SUBMENU_INDICATOR_TEXT:this.COLLAPSED_SUBMENU_INDICATOR_TEXT)+"</em>";}
-if(oConfig.getProperty("emphasis")){sEmphasisStartTag="<em>";sEmphasisEndTag="</em>";}
-if(oConfig.getProperty("strongemphasis")){sEmphasisStartTag="<strong>";sEmphasisEndTag="</strong>";}
-oAnchor.innerHTML=(sEmphasisStartTag+sText+
-sEmphasisEndTag+sHelpTextHTML+
-sCheckHTML+sSubmenuIndicatorHTML);if(oSubmenu){this.submenuIndicator=oAnchor.lastChild;}}},configHelpText:function(p_sType,p_aArgs,p_oItem){var sHelpText=p_aArgs[0],oAnchor=this._oAnchor;if(sHelpText){Dom.addClass(oAnchor,"hashelptext");}
-else{Dom.removeClass(oAnchor,"hashelptext");}
-this.cfg.refireEvent("text");},configURL:function(p_sType,p_aArgs,p_oItem){var sURL=p_aArgs[0];if(!sURL){sURL="#";}
-this._oAnchor.setAttribute("href",sURL);},configTarget:function(p_sType,p_aArgs,p_oItem){var sTarget=p_aArgs[0],oAnchor=this._oAnchor;if(sTarget&&sTarget.length>0){oAnchor.setAttribute("target",sTarget);}
-else{oAnchor.removeAttribute("target");}},configEmphasis:function(p_sType,p_aArgs,p_oItem){var bEmphasis=p_aArgs[0],oConfig=this.cfg;if(bEmphasis&&oConfig.getProperty("strongemphasis")){oConfig.setProperty("strongemphasis",false);}
-oConfig.refireEvent("text");},configStrongEmphasis:function(p_sType,p_aArgs,p_oItem){var bStrongEmphasis=p_aArgs[0],oConfig=this.cfg;if(bStrongEmphasis&&oConfig.getProperty("emphasis")){oConfig.setProperty("emphasis",false);}
-oConfig.refireEvent("text");},configChecked:function(p_sType,p_aArgs,p_oItem){var bChecked=p_aArgs[0],oAnchor=this._oAnchor;if(bChecked){Dom.addClass(oAnchor,"checked");}
-else{Dom.removeClass(oAnchor,"checked");}
-this.cfg.refireEvent("text");},configDisabled:function(p_sType,p_aArgs,p_oItem){var bDisabled=p_aArgs[0],oConfig=this.cfg,oAnchor=this._oAnchor;if(bDisabled){if(oConfig.getProperty("selected")){oConfig.setProperty("selected",false);}
-oAnchor.removeAttribute("href");Dom.addClass(oAnchor,"disabled");}
-else{oAnchor.setAttribute("href",oConfig.getProperty("url"));Dom.removeClass(oAnchor,"disabled");}},configSelected:function(p_sType,p_aArgs,p_oItem){var bSelected,oAnchor;if(!this.cfg.getProperty("disabled")){bSelected=p_aArgs[0];oAnchor=this._oAnchor;if(bSelected){Dom.addClass(oAnchor,"selected");}
-else{Dom.removeClass(oAnchor,"selected");}}},configSubmenu:function(p_sType,p_aArgs,p_oItem){var oAnchor=this._oAnchor,oSubmenu=p_aArgs[0],oSubmenuIndicator=this.submenuIndicator,oConfig=this.cfg,bLazyLoad=this.parent&&this.parent.lazyLoad,oMenu,sSubmenuId,oSubmenuConfig;if(oSubmenu){if(oSubmenu instanceof Menu){oMenu=oSubmenu;oMenu.parent=this;oMenu.lazyLoad=bLazyLoad;}
-else if(typeof oSubmenu=="object"&&oSubmenu.id&&!oSubmenu.nodeType){sSubmenuId=oSubmenu.id;oSubmenuConfig=oSubmenu;oSubmenuConfig.lazyload=bLazyLoad;oSubmenuConfig.parent=this;oMenu=new this.SUBMENU_TYPE(sSubmenuId,oSubmenuConfig);this.cfg.setProperty("submenu",oMenu,true);}
-else{oMenu=new this.SUBMENU_TYPE(oSubmenu,{lazyload:bLazyLoad,parent:this});this.cfg.setProperty("submenu",oMenu,true);}
-if(oMenu){Dom.addClass(oAnchor,"hassubmenu");this._oSubmenu=oMenu;}}
-else{Dom.removeClass(oAnchor,"hassubmenu");if(oSubmenuIndicator){oAnchor.removeChild(oSubmenuIndicator);}
-if(this._oSubmenu){this._oSubmenu.destroy();}}
-oConfig.refireEvent("text");},configOnClick:function(p_sType,p_aArgs,p_oItem){var oObject=p_aArgs[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=oObject)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}
-if(!this._oOnclickAttributeValue&&typeof oObject=="object"&&typeof oObject.fn=="function"){this.clickEvent.subscribe(oObject.fn,((!YAHOO.lang.isUndefined(oObject.obj))?oObject.obj:this),oObject.scope);this._oOnclickAttributeValue=oObject;}},configClassName:function(p_sType,p_aArgs,p_oItem){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}
-Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},initDefaultConfig:function(){var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,validator:DEFAULT_CONFIG.TEXT.validator,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.HELP_TEXT.key,{handler:this.configHelpText});oConfig.addProperty(DEFAULT_CONFIG.URL.key,{handler:this.configURL,value:DEFAULT_CONFIG.URL.value,suppressEvent:DEFAULT_CONFIG.URL.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.TARGET.key,{handler:this.configTarget,suppressEvent:DEFAULT_CONFIG.TARGET.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.EMPHASIS.key,{handler:this.configEmphasis,value:DEFAULT_CONFIG.EMPHASIS.value,validator:DEFAULT_CONFIG.EMPHASIS.validator,suppressEvent:DEFAULT_CONFIG.EMPHASIS.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.STRONG_EMPHASIS.key,{handler:this.configStrongEmphasis,value:DEFAULT_CONFIG.STRONG_EMPHASIS.value,validator:DEFAULT_CONFIG.STRONG_EMPHASIS.validator,suppressEvent:DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.CHECKED.key,{handler:this.configChecked,value:DEFAULT_CONFIG.CHECKED.value,validator:DEFAULT_CONFIG.CHECKED.validator,suppressEvent:DEFAULT_CONFIG.CHECKED.suppressEvent,supercedes:DEFAULT_CONFIG.CHECKED.supercedes});oConfig.addProperty(DEFAULT_CONFIG.DISABLED.key,{handler:this.configDisabled,value:DEFAULT_CONFIG.DISABLED.value,validator:DEFAULT_CONFIG.DISABLED.validator,suppressEvent:DEFAULT_CONFIG.DISABLED.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SELECTED.key,{handler:this.configSelected,value:DEFAULT_CONFIG.SELECTED.value,validator:DEFAULT_CONFIG.SELECTED.validator,suppressEvent:DEFAULT_CONFIG.SELECTED.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU.key,{handler:this.configSubmenu});oConfig.addProperty(DEFAULT_CONFIG.ONCLICK.key,{handler:this.configOnClick});oConfig.addProperty(DEFAULT_CONFIG.CLASS_NAME.key,{handler:this.configClassName,value:DEFAULT_CONFIG.CLASS_NAME.value,validator:DEFAULT_CONFIG.CLASS_NAME.validator});},getNextEnabledSibling:function(){var nGroupIndex,aItemGroups,oNextItem,nNextGroupIndex,aNextGroup;function getNextArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getNextArrayItem(p_aArray,(p_nStartIndex+1));}
-if(this.parent instanceof Menu){nGroupIndex=this.groupIndex;aItemGroups=this.parent.getItemGroups();if(this.index<(aItemGroups[nGroupIndex].length-1)){oNextItem=getNextArrayItem(aItemGroups[nGroupIndex],(this.index+1));}
-else{if(nGroupIndex<(aItemGroups.length-1)){nNextGroupIndex=nGroupIndex+1;}
-else{nNextGroupIndex=0;}
-aNextGroup=getNextArrayItem(aItemGroups,nNextGroupIndex);oNextItem=getNextArrayItem(aNextGroup,0);}
-return(oNextItem.cfg.getProperty("disabled")||oNextItem.element.style.display=="none")?oNextItem.getNextEnabledSibling():oNextItem;}},getPreviousEnabledSibling:function(){var nGroupIndex,aItemGroups,oPreviousItem,nPreviousGroupIndex,aPreviousGroup;function getPreviousArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getPreviousArrayItem(p_aArray,(p_nStartIndex-1));}
-function getFirstItemIndex(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]?p_nStartIndex:getFirstItemIndex(p_aArray,(p_nStartIndex+1));}
-if(this.parent instanceof Menu){nGroupIndex=this.groupIndex;aItemGroups=this.parent.getItemGroups();if(this.index>getFirstItemIndex(aItemGroups[nGroupIndex],0)){oPreviousItem=getPreviousArrayItem(aItemGroups[nGroupIndex],(this.index-1));}
-else{if(nGroupIndex>getFirstItemIndex(aItemGroups,0)){nPreviousGroupIndex=nGroupIndex-1;}
-else{nPreviousGroupIndex=aItemGroups.length-1;}
-aPreviousGroup=getPreviousArrayItem(aItemGroups,nPreviousGroupIndex);oPreviousItem=getPreviousArrayItem(aPreviousGroup,(aPreviousGroup.length-1));}
-return(oPreviousItem.cfg.getProperty("disabled")||oPreviousItem.element.style.display=="none")?oPreviousItem.getPreviousEnabledSibling():oPreviousItem;}},focus:function(){var oParent=this.parent,oAnchor=this._oAnchor,oActiveItem=oParent.activeItem,me=this;function setFocus(){try{if(YAHOO.env.ua.ie&&!document.hasFocus()){return;}
-oAnchor.focus();}
-catch(e){}}
-if(!this.cfg.getProperty("disabled")&&oParent&&oParent.cfg.getProperty("visible")&&this.element.style.display!="none"){if(oActiveItem){oActiveItem.blur();}
-window.setTimeout(setFocus,0);this.focusEvent.fire();}},blur:function(){var oParent=this.parent;if(!this.cfg.getProperty("disabled")&&oParent&&oParent.cfg.getProperty("visible")){this._oAnchor.blur();this.blurEvent.fire();}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var oEl=this.element,oSubmenu,oParentNode;if(oEl){oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.destroy();}
-this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();oParentNode=oEl.parentNode;if(oParentNode){oParentNode.removeChild(oEl);this.destroyEvent.fire();}
-this.destroyEvent.unsubscribeAll();}},toString:function(){var sReturnVal="MenuItem",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
-return sReturnVal;}};Lang.augmentProto(MenuItem,YAHOO.util.EventProvider);})();(function(){YAHOO.widget.ContextMenu=function(p_oElement,p_oConfig){YAHOO.widget.ContextMenu.superclass.constructor.call(this,p_oElement,p_oConfig);};var Event=YAHOO.util.Event,ContextMenu=YAHOO.widget.ContextMenu,EVENT_TYPES={"TRIGGER_CONTEXT_MENU":"triggerContextMenu","CONTEXT_MENU":(YAHOO.env.ua.opera?"mousedown":"contextmenu"),"CLICK":"click"},DEFAULT_CONFIG={"TRIGGER":{key:"trigger"}};YAHOO.lang.extend(ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}
-ContextMenu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(ContextMenu);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-this.initEvent.fire(ContextMenu);},initEvents:function(){ContextMenu.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var oTrigger=this._oTrigger;if(oTrigger){Event.removeListener(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu);if(YAHOO.env.ua.opera){Event.removeListener(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(p_oEvent,p_oMenu){if(p_oEvent.ctrlKey){Event.stopEvent(p_oEvent);}},_onTriggerContextMenu:function(p_oEvent,p_oMenu){if(p_oEvent.type=="mousedown"&&!p_oEvent.ctrlKey){return;}
-Event.stopEvent(p_oEvent);YAHOO.widget.MenuManager.hideVisible();this.contextEventTarget=Event.getTarget(p_oEvent);this.triggerContextMenuEvent.fire(p_oEvent);if(!this._bCancelled){this.cfg.setProperty("xy",Event.getXY(p_oEvent));this.show();}
-this._bCancelled=false;},toString:function(){var sReturnVal="ContextMenu",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
-return sReturnVal;},initDefaultConfig:function(){ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key,{handler:this.configTrigger});},destroy:function(){this._removeEventHandlers();ContextMenu.superclass.destroy.call(this);},configTrigger:function(p_sType,p_aArgs,p_oMenu){var oTrigger=p_aArgs[0];if(oTrigger){if(this._oTrigger){this._removeEventHandlers();}
-this._oTrigger=oTrigger;Event.on(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(YAHOO.env.ua.opera){Event.on(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick,this,true);}}
-else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=function(p_oObject,p_oConfig){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.lang.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}
-YAHOO.widget.ContextMenuItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}
-oConfig.fireQueue();},toString:function(){var sReturnVal="ContextMenuItem";if(this.cfg&&this.cfg.getProperty("text")){sReturnVal+=(": "+this.cfg.getProperty("text"));}
-return sReturnVal;}});(function(){YAHOO.widget.MenuBar=function(p_oElement,p_oConfig){YAHOO.widget.MenuBar.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){if(typeof p_sPosition=="string"){return("dynamic,static".indexOf((p_sPosition.toLowerCase()))!=-1);}}
-var Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,MenuBar=YAHOO.widget.MenuBar,DEFAULT_CONFIG={"POSITION":{key:"position",value:"static",validator:checkPosition,supercedes:["visible"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","bl"]},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:false,validator:YAHOO.lang.isBoolean}};YAHOO.lang.extend(MenuBar,YAHOO.widget.Menu,{init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}
-MenuBar.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(MenuBar);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-this.initEvent.fire(MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(p_sType,p_aArgs,p_oMenuBar){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu,oItemCfg,oNextItem;if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;switch(oEvent.keyCode){case 37:case 39:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
-else{oNextItem=(oEvent.keyCode==37)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}}
-oNextItem.focus();}}
-Event.preventDefault(oEvent);break;case 40:if(this.activeItem!=oItem){this.clearActiveItem();oItemCfg.setProperty("selected",true);oItem.focus();}
-oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.setInitialSelection();oSubmenu.setInitialFocus();}
-else{oSubmenu.show();}}
-Event.preventDefault(oEvent);break;}}
-if(oEvent.keyCode==27&&this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}
-else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}
-Event.preventDefault(oEvent);}},_onClick:function(p_sType,p_aArgs,p_oMenuBar){MenuBar.superclass._onClick.call(this,p_sType,p_aArgs,p_oMenuBar);var oItem=p_aArgs[1],oEvent,oTarget,oActiveItem,oConfig,oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){oEvent=p_aArgs[0];oTarget=Event.getTarget(oEvent);oActiveItem=this.activeItem;oConfig=this.cfg;if(oActiveItem&&oActiveItem!=oItem){this.clearActiveItem();}
-oItem.cfg.setProperty("selected",true);oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu&&oTarget!=oItem.submenuIndicator){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}
-else{oSubmenu.show();}}}},toString:function(){var sReturnVal="MenuBar",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
-return sReturnVal;},initDefaultConfig:function(){MenuBar.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.POSITION.key,{handler:this.configPosition,value:DEFAULT_CONFIG.POSITION.value,validator:DEFAULT_CONFIG.POSITION.validator,supercedes:DEFAULT_CONFIG.POSITION.supercedes});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key,{value:DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value});oConfig.addProperty(DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key,{value:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value,validator:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator});}});}());YAHOO.widget.MenuBarItem=function(p_oObject,p_oConfig){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}
-YAHOO.widget.MenuBarItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}
-oConfig.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var sReturnVal="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){sReturnVal+=(": "+this.cfg.getProperty("text"));}
-return sReturnVal;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event;YAHOO.widget.MenuManager=function(){var N=false,F={},Q={},J={},E={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},K=null;function D(S){var R;if(S&&S.tagName){switch(S.tagName.toUpperCase()){case"DIV":R=S.parentNode;if((B.hasClass(S,"hd")||B.hasClass(S,"bd")||B.hasClass(S,"ft"))&&R&&R.tagName&&R.tagName.toUpperCase()=="DIV"){return R;}else{return S;}break;case"LI":return S;default:R=S.parentNode;if(R){return D(R);}break;}}}function G(V){var R=A.getTarget(V),S=D(R),X,T,U,Z,Y;if(S){T=S.tagName.toUpperCase();if(T=="LI"){U=S.id;if(U&&J[U]){Z=J[U];Y=Z.parent;}}else{if(T=="DIV"){if(S.id){Y=F[S.id];}}}}if(Y){X=E[V.type];if(Z&&!Z.cfg.getProperty("disabled")){Z[X].fire(V);if(V.type=="keyup"||V.type=="mousedown"){if(K!=Z){if(K){K.blurEvent.fire();}Z.focusEvent.fire();}}}Y[X].fire(V,Z);}else{if(V.type=="mousedown"){if(K){K.blurEvent.fire();K=null;}for(var W in Q){if(YAHOO.lang.hasOwnProperty(Q,W)){Y=Q[W];if(Y.cfg.getProperty("clicktohide")&&!(Y instanceof YAHOO.widget.MenuBar)&&Y.cfg.getProperty("position")=="dynamic"){Y.hide();}else{Y.clearActiveItem(true);}}}}else{if(V.type=="keyup"){if(K){K.blurEvent.fire();K=null;}}}}}function P(S,R,T){if(F[T.id]){this.removeMenu(T);}}function M(S,R){var T=R[0];if(T){K=T;}}function H(S,R){K=null;}function C(T,S){var R=S[0],U=this.id;if(R){Q[U]=this;}else{if(Q[U]){delete Q[U];}}}function L(S,R){O(this);}function O(S){var R=S.id;if(R&&J[R]){if(K==S){K=null;}delete J[R];S.destroyEvent.unsubscribe(L);}}function I(S,R){var U=R[0],T;if(U instanceof YAHOO.widget.MenuItem){T=U.id;if(!J[T]){J[T]=U;U.destroyEvent.subscribe(L);}}}return{addMenu:function(S){var R;if(S instanceof YAHOO.widget.Menu&&S.id&&!F[S.id]){F[S.id]=S;if(!N){R=document;A.on(R,"mouseover",G,this,true);A.on(R,"mouseout",G,this,true);A.on(R,"mousedown",G,this,true);A.on(R,"mouseup",G,this,true);A.on(R,"click",G,this,true);A.on(R,"keydown",G,this,true);A.on(R,"keyup",G,this,true);A.on(R,"keypress",G,this,true);N=true;}S.cfg.subscribeToConfigEvent("visible",C);S.destroyEvent.subscribe(P,S,this);S.itemAddedEvent.subscribe(I);S.focusEvent.subscribe(M);S.blurEvent.subscribe(H);}},removeMenu:function(U){var S,R,T;if(U){S=U.id;if(F[S]==U){R=U.getItems();if(R&&R.length>0){T=R.length-1;do{O(R[T]);}while(T--);}delete F[S];if(Q[S]==U){delete Q[S];}if(U.cfg){U.cfg.unsubscribeFromConfigEvent("visible",C);}U.destroyEvent.unsubscribe(P,U);U.itemAddedEvent.unsubscribe(I);U.focusEvent.unsubscribe(M);U.blurEvent.unsubscribe(H);}}},hideVisible:function(){var R;for(var S in Q){if(YAHOO.lang.hasOwnProperty(Q,S)){R=Q[S];if(!(R instanceof YAHOO.widget.MenuBar)&&R.cfg.getProperty("position")=="dynamic"){R.hide();}}}},getVisible:function(){return Q;},getMenus:function(){return F;},getMenu:function(S){var R=F[S];if(R){return R;}},getMenuItem:function(R){var S=J[R];if(S){return S;}},getMenuItemGroup:function(U){var S=B.get(U),R,W,V,T;if(S&&S.tagName&&S.tagName.toUpperCase()=="UL"){W=S.firstChild;if(W){R=[];do{T=W.id;if(T){V=this.getMenuItem(T);if(V){R[R.length]=V;}}}while((W=W.nextSibling));if(R.length>0){return R;}}}},getFocusedMenuItem:function(){return K;},getFocusedMenu:function(){if(K){return(K.parent.getRoot());}},toString:function(){return"MenuManager";}};}();})();(function(){YAHOO.widget.Menu=function(O,N){if(N){this.parent=N.parent;this.lazyLoad=N.lazyLoad||N.lazyload;this.itemData=N.itemData||N.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,O,N);};function I(N){if(typeof N=="string"){return("dynamic,static".indexOf((N.toLowerCase()))!=-1);}}var C=YAHOO.util.Dom,M=YAHOO.util.Event,D=YAHOO.widget.Module,B=YAHOO.widget.Overlay,F=YAHOO.widget.Menu,K=YAHOO.widget.MenuManager,L=YAHOO.util.CustomEvent,E=YAHOO.lang,H=YAHOO.env.ua,G,A={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","FOCUS":"focus","BLUR":"blur","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved"},J={"VISIBLE":{key:"visible",value:false,validator:E.isBoolean},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:true,validator:E.isBoolean,supercedes:["iframe","x","y","xy"]},"POSITION":{key:"position",value:"dynamic",validator:I,supercedes:["visible","iframe"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","tr"],suppressEvent:true},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:true,validator:E.isBoolean,suppressEvent:true},"SHOW_DELAY":{key:"showdelay",value:250,validator:E.isNumber,suppressEvent:true},"HIDE_DELAY":{key:"hidedelay",value:0,validator:E.isNumber,suppressEvent:true},"SUBMENU_HIDE_DELAY":{key:"submenuhidedelay",value:250,validator:E.isNumber,suppressEvent:true},"CLICK_TO_HIDE":{key:"clicktohide",value:true,validator:E.isBoolean,suppressEvent:true},"CONTAINER":{key:"container",suppressEvent:true},"SCROLL_INCREMENT":{key:"scrollincrement",value:1,validator:E.isNumber,supercedes:["maxheight"],suppressEvent:true},"MIN_SCROLL_HEIGHT":{key:"minscrollheight",value:90,validator:E.isNumber,supercedes:["maxheight"],suppressEvent:true},"MAX_HEIGHT":{key:"maxheight",value:0,validator:E.isNumber,supercedes:["iframe"],suppressEvent:true},"CLASS_NAME":{key:"classname",value:null,validator:E.isString,suppressEvent:true},"DISABLED":{key:"disabled",value:false,validator:E.isBoolean,suppressEvent:true}};YAHOO.lang.extend(F,B,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",OFF_SCREEN_POSITION:[-10000,-10000],_nHideDelayId:null,_nShowDelayId:null,_nSubmenuHideDelayId:null,_nBodyScrollId:null,_bHideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,_nCurrentMouseX:0,_bStopMouseEventHandlers:false,_sClassName:null,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,itemAddedEvent:null,itemRemovedEvent:null,init:function(P,O){this._aItemGroups=[];
+this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var N;if(typeof P=="string"){N=document.getElementById(P);}else{if(P.tagName){N=P;}}if(N&&N.tagName){switch(N.tagName.toUpperCase()){case"DIV":this.srcElement=N;if(!N.id){N.setAttribute("id",C.generateId());}F.superclass.init.call(this,N);this.beforeInitEvent.fire(F);break;case"SELECT":this.srcElement=N;F.superclass.init.call(this,C.generateId());this.beforeInitEvent.fire(F);break;}}else{F.superclass.init.call(this,P);this.beforeInitEvent.fire(F);}if(this.element){C.addClass(this.element,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit);this.beforeRenderEvent.subscribe(this._onBeforeRender);this.renderEvent.subscribe(this._onRender);this.renderEvent.subscribe(this.onRender);this.beforeShowEvent.subscribe(this._onBeforeShow);this.hideEvent.subscribe(this.positionOffScreen);this.showEvent.subscribe(this._onShow);this.beforeHideEvent.subscribe(this._onBeforeHide);this.mouseOverEvent.subscribe(this._onMouseOver);this.mouseOutEvent.subscribe(this._onMouseOut);this.clickEvent.subscribe(this._onClick);this.keyDownEvent.subscribe(this._onKeyDown);this.keyPressEvent.subscribe(this._onKeyPress);if(H.gecko||H.webkit){this.cfg.subscribeToConfigEvent("y",this._onYChange);}if(O){this.cfg.applyConfig(O,true);}K.addMenu(this);this.initEvent.fire(F);}},_initSubTree:function(){var O=this.srcElement,N,Q,T,U,S,R,P;if(O){N=(O.tagName&&O.tagName.toUpperCase());if(N=="DIV"){U=this.body.firstChild;if(U){Q=0;T=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(U&&U.tagName){switch(U.tagName.toUpperCase()){case T:this._aGroupTitleElements[Q]=U;break;case"UL":this._aListElements[Q]=U;this._aItemGroups[Q]=[];Q++;break;}}}while((U=U.nextSibling));if(this._aListElements[0]){C.addClass(this._aListElements[0],"first-of-type");}}}U=null;if(N){switch(N){case"DIV":S=this._aListElements;R=S.length;if(R>0){P=R-1;do{U=S[P].firstChild;if(U){do{if(U&&U.tagName&&U.tagName.toUpperCase()=="LI"){this.addItem(new this.ITEM_TYPE(U,{parent:this}),P);}}while((U=U.nextSibling));}}while(P--);}break;case"SELECT":U=O.firstChild;do{if(U&&U.tagName){switch(U.tagName.toUpperCase()){case"OPTGROUP":case"OPTION":this.addItem(new this.ITEM_TYPE(U,{parent:this}));break;}}}while((U=U.nextSibling));break;}}}},_getFirstEnabledItem:function(){var N=this.getItems(),Q=N.length,P;for(var O=0;O<Q;O++){P=N[O];if(P&&!P.cfg.getProperty("disabled")&&P.element.style.display!="none"){return P;}}},_addItemToGroup:function(S,T,W){var U,X,Q,V,R,O,P;function N(Y,Z){return(Y[Z]||N(Y,(Z+1)));}if(T instanceof this.ITEM_TYPE){U=T;U.parent=this;}else{if(typeof T=="string"){U=new this.ITEM_TYPE(T,{parent:this});}else{if(typeof T=="object"){T.parent=this;U=new this.ITEM_TYPE(T.text,T);}}}if(U){if(U.cfg.getProperty("selected")){this.activeItem=U;}X=typeof S=="number"?S:0;Q=this._getItemGroup(X);if(!Q){Q=this._createItemGroup(X);}if(typeof W=="number"){R=(W>=Q.length);if(Q[W]){Q.splice(W,0,U);}else{Q[W]=U;}V=Q[W];if(V){if(R&&(!V.element.parentNode||V.element.parentNode.nodeType==11)){this._aListElements[X].appendChild(V.element);}else{O=N(Q,(W+1));if(O&&(!V.element.parentNode||V.element.parentNode.nodeType==11)){this._aListElements[X].insertBefore(V.element,O.element);}}V.parent=this;this._subscribeToItemEvents(V);this._configureSubmenu(V);this._updateItemProperties(X);this.itemAddedEvent.fire(V);this.changeContentEvent.fire();return V;}}else{P=Q.length;Q[P]=U;V=Q[P];if(V){if(!C.isAncestor(this._aListElements[X],V.element)){this._aListElements[X].appendChild(V.element);}V.element.setAttribute("groupindex",X);V.element.setAttribute("index",P);V.parent=this;V.index=P;V.groupIndex=X;this._subscribeToItemEvents(V);this._configureSubmenu(V);if(P===0){C.addClass(V.element,"first-of-type");}this.itemAddedEvent.fire(V);this.changeContentEvent.fire();return V;}}}},_removeItemFromGroupByIndex:function(Q,O){var P=typeof Q=="number"?Q:0,R=this._getItemGroup(P),T,S,N;if(R){T=R.splice(O,1);S=T[0];if(S){this._updateItemProperties(P);if(R.length===0){N=this._aListElements[P];if(this.body&&N){this.body.removeChild(N);}this._aItemGroups.splice(P,1);this._aListElements.splice(P,1);N=this._aListElements[0];if(N){C.addClass(N,"first-of-type");}}this.itemRemovedEvent.fire(S);this.changeContentEvent.fire();return S;}}},_removeItemFromGroupByValue:function(P,N){var R=this._getItemGroup(P),S,Q,O;if(R){S=R.length;Q=-1;if(S>0){O=S-1;do{if(R[O]==N){Q=O;break;}}while(O--);if(Q>-1){return(this._removeItemFromGroupByIndex(P,Q));}}}},_updateItemProperties:function(O){var P=this._getItemGroup(O),S=P.length,R,Q,N;if(S>0){N=S-1;do{R=P[N];if(R){Q=R.element;R.index=N;R.groupIndex=O;Q.setAttribute("groupindex",O);Q.setAttribute("index",N);C.removeClass(Q,"first-of-type");}}while(N--);if(Q){C.addClass(Q,"first-of-type");}}},_createItemGroup:function(O){var N;if(!this._aItemGroups[O]){this._aItemGroups[O]=[];N=document.createElement("ul");this._aListElements[O]=N;return this._aItemGroups[O];}},_getItemGroup:function(O){var N=((typeof O=="number")?O:0);return this._aItemGroups[N];},_configureSubmenu:function(N){var O=N.cfg.getProperty("submenu");if(O){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,O,true);this.renderEvent.subscribe(this._onParentMenuRender,O,true);O.beforeShowEvent.subscribe(this._onSubmenuBeforeShow);}},_subscribeToItemEvents:function(N){N.focusEvent.subscribe(this._onMenuItemFocus);N.blurEvent.subscribe(this._onMenuItemBlur);N.destroyEvent.subscribe(this._onMenuItemDestroy,N,this);N.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,N,this);},_onVisibleChange:function(P,O){var N=O[0];if(N){C.addClass(this.element,"visible");}else{C.removeClass(this.element,"visible");}},_cancelHideDelay:function(){var N=this.getRoot();if(N._nHideDelayId){window.clearTimeout(N._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var O=this.getRoot(),P=this;function N(){if(O.activeItem){O.clearActiveItem();}if(O==P&&!(P instanceof YAHOO.widget.MenuBar)&&P.cfg.getProperty("position")=="dynamic"){P.hide();
+}}O._nHideDelayId=window.setTimeout(N,O.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var N=this.getRoot();if(N._nShowDelayId){window.clearTimeout(N._nShowDelayId);}},_execShowDelay:function(P){var O=this.getRoot();function N(){if(P.parent.cfg.getProperty("selected")){P.show();}}O._nShowDelayId=window.setTimeout(N,O.cfg.getProperty("showdelay"));},_execSubmenuHideDelay:function(Q,O,N){var P=this;Q._nSubmenuHideDelayId=window.setTimeout(function(){if(P._nCurrentMouseX>(O+10)){Q._nSubmenuHideDelayId=window.setTimeout(function(){Q.hide();},N);}else{Q.hide();}},50);},_disableScrollHeader:function(){if(!this._bHeaderDisabled){C.addClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){C.addClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){C.removeClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){C.removeClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=false;}},_onMouseOver:function(W,R){if(this._bStopMouseEventHandlers){return false;}var X=R[0],V=R[1],N=M.getTarget(X),O,Q,U,P,T,S;if(!this._bHandledMouseOverEvent&&(N==this.element||C.isAncestor(this.element,N))){this._nCurrentMouseX=0;M.on(this.element,"mousemove",this._onMouseMove,this,true);if(!C.isAncestor(V.element,M.getRelatedTarget(X))){this.clearActiveItem();}if(this.parent&&this._nSubmenuHideDelayId){window.clearTimeout(this._nSubmenuHideDelayId);this.parent.cfg.setProperty("selected",true);O=this.parent.parent;O._bHandledMouseOutEvent=true;O._bHandledMouseOverEvent=false;}this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(V&&!V.handledMouseOverEvent&&!V.cfg.getProperty("disabled")&&(N==V.element||C.isAncestor(V.element,N))){Q=this.cfg.getProperty("showdelay");U=(Q>0);if(U){this._cancelShowDelay();}P=this.activeItem;if(P){P.cfg.setProperty("selected",false);}T=V.cfg;T.setProperty("selected",true);if(this.hasFocus()){V.focus();}if(this.cfg.getProperty("autosubmenudisplay")){S=T.getProperty("submenu");if(S){if(U){this._execShowDelay(S);}else{S.show();}}}V.handledMouseOverEvent=true;V.handledMouseOutEvent=false;}},_onMouseOut:function(V,P){if(this._bStopMouseEventHandlers){return false;}var W=P[0],T=P[1],Q=M.getRelatedTarget(W),U=false,S,R,N,O;if(T&&!T.cfg.getProperty("disabled")){S=T.cfg;R=S.getProperty("submenu");if(R&&(Q==R.element||C.isAncestor(R.element,Q))){U=true;}if(!T.handledMouseOutEvent&&((Q!=T.element&&!C.isAncestor(T.element,Q))||U)){if(!U){T.cfg.setProperty("selected",false);if(R){N=this.cfg.getProperty("submenuhidedelay");O=this.cfg.getProperty("showdelay");if(!(this instanceof YAHOO.widget.MenuBar)&&N>0&&O>=N){this._execSubmenuHideDelay(R,M.getPageX(W),N);}else{R.hide();}}}T.handledMouseOutEvent=true;T.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent&&((Q!=this.element&&!C.isAncestor(this.element,Q))||U)){M.removeListener(this.element,"mousemove",this._onMouseMove);this._nCurrentMouseX=M.getPageX(W);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onMouseMove:function(O,N){if(this._bStopMouseEventHandlers){return false;}this._nCurrentMouseX=M.getPageX(O);},_onClick:function(Y,Q){var W=YAHOO.util.Event,P=YAHOO.util.Dom,Z=Q[0],T=Q[1],R,V=false,O,N,S,U,X;if(T){if(T.cfg.getProperty("disabled")){W.preventDefault(Z);}else{R=T.cfg.getProperty("submenu");S=T.cfg.getProperty("url");if(S){U=S.indexOf("#");X=S.length;if(U!=-1){S=S.substr(U,X);X=S.length;if(X>1){N=S.substr(1,X);V=P.isAncestor(this.element,N);}else{if(X===1){V=true;}}}}if(V&&!T.cfg.getProperty("target")){W.preventDefault(Z);T.focus();}if(!R){O=this.getRoot();if(O instanceof YAHOO.widget.MenuBar||O.cfg.getProperty("position")=="static"){O.clearActiveItem();}else{O.hide();}}}}},_onKeyDown:function(b,V){var Y=V[0],X=V[1],f=this,U,Z,O,S,c,N,e,R,a,Q,W,d,T;function P(){f._bStopMouseEventHandlers=true;window.setTimeout(function(){f._bStopMouseEventHandlers=false;},10);}if(X&&!X.cfg.getProperty("disabled")){Z=X.cfg;O=this.parent;switch(Y.keyCode){case 38:case 40:c=(Y.keyCode==38)?X.getPreviousEnabledSibling():X.getNextEnabledSibling();if(c){this.clearActiveItem();c.cfg.setProperty("selected",true);c.focus();if(this.cfg.getProperty("maxheight")>0){N=this.body;e=N.scrollTop;R=N.offsetHeight;a=this.getItems();Q=a.length-1;W=c.element.offsetTop;if(Y.keyCode==40){if(W>=(R+e)){N.scrollTop=W-R;}else{if(W<=e){N.scrollTop=0;}}if(c==a[Q]){N.scrollTop=c.element.offsetTop;}}else{if(W<=e){N.scrollTop=W-c.element.offsetHeight;}else{if(W>=(e+R)){N.scrollTop=W;}}if(c==a[0]){N.scrollTop=0;}}e=N.scrollTop;d=N.scrollHeight-N.offsetHeight;if(e===0){this._disableScrollHeader();this._enableScrollFooter();}else{if(e==d){this._enableScrollHeader();this._disableScrollFooter();}else{this._enableScrollHeader();this._enableScrollFooter();}}}}M.preventDefault(Y);P();break;case 39:U=Z.getProperty("submenu");if(U){if(!Z.getProperty("selected")){Z.setProperty("selected",true);}U.show();U.setInitialFocus();U.setInitialSelection();}else{S=this.getRoot();if(S instanceof YAHOO.widget.MenuBar){c=S.activeItem.getNextEnabledSibling();if(c){S.clearActiveItem();c.cfg.setProperty("selected",true);U=c.cfg.getProperty("submenu");if(U){U.show();}c.focus();}}}M.preventDefault(Y);P();break;case 37:if(O){T=O.parent;if(T instanceof YAHOO.widget.MenuBar){c=T.activeItem.getPreviousEnabledSibling();if(c){T.clearActiveItem();c.cfg.setProperty("selected",true);U=c.cfg.getProperty("submenu");if(U){U.show();}c.focus();}}else{this.hide();O.focus();}}M.preventDefault(Y);P();break;}}if(Y.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}else{if(this.activeItem){U=this.activeItem.cfg.getProperty("submenu");if(U&&U.cfg.getProperty("visible")){U.hide();this.activeItem.focus();}else{this.activeItem.blur();this.activeItem.cfg.setProperty("selected",false);
+}}}M.preventDefault(Y);}},_onKeyPress:function(P,O){var N=O[0];if(N.keyCode==40||N.keyCode==38){M.preventDefault(N);}},_onYChange:function(O,N){var Q=this.parent,S,P,R;if(Q){S=Q.parent.body.scrollTop;if(S>0){R=(this.cfg.getProperty("y")-S);C.setY(this.element,R);P=this.iframe;if(P){C.setY(P,R);}this.cfg.setProperty("y",R,true);}}},_onScrollTargetMouseOver:function(T,W){this._cancelHideDelay();var P=M.getTarget(T),R=this.body,V=this,Q=this.cfg.getProperty("scrollincrement"),N,O;function U(){var X=R.scrollTop;if(X<N){R.scrollTop=(X+Q);V._enableScrollHeader();}else{R.scrollTop=N;window.clearInterval(V._nBodyScrollId);V._disableScrollFooter();}}function S(){var X=R.scrollTop;if(X>0){R.scrollTop=(X-Q);V._enableScrollFooter();}else{R.scrollTop=0;window.clearInterval(V._nBodyScrollId);V._disableScrollHeader();}}if(C.hasClass(P,"hd")){O=S;}else{N=R.scrollHeight-R.offsetHeight;O=U;}this._nBodyScrollId=window.setInterval(O,10);},_onScrollTargetMouseOut:function(O,N){window.clearInterval(this._nBodyScrollId);this._cancelHideDelay();},_onInit:function(O,N){this.cfg.subscribeToConfigEvent("visible",this._onVisibleChange);var P=!this.parent,Q=this.lazyLoad;if(((P&&!Q)||(P&&(this.cfg.getProperty("visible")||this.cfg.getProperty("position")=="static"))||(!P&&!Q))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(Q){this.cfg.fireQueue();}}},_onBeforeRender:function(Q,P){var R=this.element,U=this._aListElements.length,O=true,T=0,N,S;if(U>0){do{N=this._aListElements[T];if(N){if(O){C.addClass(N,"first-of-type");O=false;}if(!C.isAncestor(R,N)){this.appendToBody(N);}S=this._aGroupTitleElements[T];if(S){if(!C.isAncestor(R,S)){N.parentNode.insertBefore(S,N);}C.addClass(N,"hastitle");}}T++;}while(T<U);}},_onRender:function(O,N){if(this.cfg.getProperty("position")=="dynamic"){if(!this.cfg.getProperty("visible")){this.positionOffScreen();}}},_onBeforeShow:function(W,R){var V,O,S,Q,T;if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()=="SELECT"){V=this.itemData.length;for(O=0;O<V;O++){if(this.itemData[O].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[O])));}}}else{this.addItems(this.itemData);}}T=this.srcElement;if(T){if(T.tagName.toUpperCase()=="SELECT"){if(C.inDocument(T)){this.render(T.parentNode);}else{this.render(this.cfg.getProperty("container"));}}else{this.render();}}else{if(this.parent){this.render(this.parent.element);}else{this.render(this.cfg.getProperty("container"));}}}var P=this.cfg.getProperty("maxheight"),N=this.cfg.getProperty("minscrollheight"),U=this.cfg.getProperty("position")=="dynamic";if(!this.parent&&U){this.cfg.refireEvent("xy");}function X(){this.cfg.setProperty("maxheight",0);this.hideEvent.unsubscribe(X);}if(!(this instanceof YAHOO.widget.MenuBar)&&U){if(P===0){S=C.getViewportHeight();if(this.parent&&this.parent.parent instanceof YAHOO.widget.MenuBar){Q=YAHOO.util.Region.getRegion(this.parent.element);S=(S-Q.bottom);}if(this.element.offsetHeight>=S){P=(S-(B.VIEWPORT_OFFSET*2));if(P<N){P=N;}this.cfg.setProperty("maxheight",P);this.hideEvent.subscribe(X);}}}},_onShow:function(Q,P){var T=this.parent,S,N,O;function R(V){var U;if(V.type=="mousedown"||(V.type=="keydown"&&V.keyCode==27)){U=M.getTarget(V);if(U!=S.element||!C.isAncestor(S.element,U)){S.cfg.setProperty("autosubmenudisplay",false);M.removeListener(document,"mousedown",R);M.removeListener(document,"keydown",R);}}}if(T){S=T.parent;N=S.cfg.getProperty("submenualignment");O=this.cfg.getProperty("submenualignment");if((N[0]!=O[0])&&(N[1]!=O[1])){this.cfg.setProperty("submenualignment",[N[0],N[1]]);}if(!S.cfg.getProperty("autosubmenudisplay")&&(S instanceof YAHOO.widget.MenuBar||S.cfg.getProperty("position")=="static")){S.cfg.setProperty("autosubmenudisplay",true);M.on(document,"mousedown",R);M.on(document,"keydown",R);}}},_onBeforeHide:function(P,O){var N=this.activeItem,R,Q;if(N){R=N.cfg;R.setProperty("selected",false);Q=R.getProperty("submenu");if(Q){Q.hide();}}if(this.getRoot()==this){this.blur();}},_onParentMenuConfigChange:function(O,N,R){var P=N[0][0],Q=N[0][1];switch(P){case"iframe":case"constraintoviewport":case"hidedelay":case"showdelay":case"submenuhidedelay":case"clicktohide":case"effect":case"classname":case"scrollincrement":case"minscrollheight":R.cfg.setProperty(P,Q);break;}},_onParentMenuRender:function(O,N,S){var P=S.parent.parent.cfg,Q={constraintoviewport:P.getProperty("constraintoviewport"),xy:[0,0],clicktohide:P.getProperty("clicktohide"),effect:P.getProperty("effect"),showdelay:P.getProperty("showdelay"),hidedelay:P.getProperty("hidedelay"),submenuhidedelay:P.getProperty("submenuhidedelay"),classname:P.getProperty("classname"),scrollincrement:P.getProperty("scrollincrement"),minscrollheight:P.getProperty("minscrollheight"),iframe:P.getProperty("iframe")},R;S.cfg.applyConfig(Q);if(!this.lazyLoad){R=this.parent.element;if(this.element.parentNode==R){this.render();}else{this.render(R);}}},_onSubmenuBeforeShow:function(P,O){var Q=this.parent,N=Q.parent.cfg.getProperty("submenualignment");if(!this.cfg.getProperty("context")){this.cfg.setProperty("context",[Q.element,N[0],N[1]]);}else{this.align();}},_onMenuItemFocus:function(O,N){this.parent.focusEvent.fire(this);},_onMenuItemBlur:function(O,N){this.parent.blurEvent.fire(this);},_onMenuItemDestroy:function(P,O,N){this._removeItemFromGroupByValue(N.groupIndex,N);},_onMenuItemConfigChange:function(P,O,N){var R=O[0][0],S=O[0][1],Q;switch(R){case"selected":if(S===true){this.activeItem=N;}break;case"submenu":Q=O[0][1];if(Q){this._configureSubmenu(N);}break;}},enforceConstraints:function(Q,P,W){var j=this.parent,f=B.VIEWPORT_OFFSET,b=this.element,S=this.cfg,T=P[0],R=b.offsetHeight,c=b.offsetWidth,i=C.getViewportWidth(),a=C.getViewportHeight(),Z=(j&&j.parent instanceof YAHOO.widget.MenuBar)?0:f,d=S.getProperty("context"),X=d?d[0]:null,Y,h,O,N,g,e,V,U;
+if(c<i){V=T[0];g=C.getDocumentScrollLeft();h=g+Z;N=g+i-c-Z;if(V<f){V=h;}else{if((V+c)>i){if(X&&((V-X.offsetWidth)>c)){if(j&&j.parent instanceof YAHOO.widget.MenuBar){V=(V-(c-X.offsetWidth));}else{V=(V-(X.offsetWidth+c));}}else{V=N;}}}}if(R<a){U=T[1];e=C.getDocumentScrollTop();Y=e+Z;O=e+a-R-Z;if(U<f){U=Y;}else{if(U>O){if(X&&(U>R)){U=((U+X.offsetHeight)-R);}else{U=O;}}}}S.setProperty("x",V,true);S.setProperty("y",U,true);S.setProperty("xy",[V,U],true);},configVisible:function(P,O,Q){var N,R;if(this.cfg.getProperty("position")=="dynamic"){F.superclass.configVisible.call(this,P,O,Q);}else{N=O[0];R=C.getStyle(this.element,"display");C.setStyle(this.element,"visibility","visible");if(N){if(R!="block"){this.beforeShowEvent.fire();C.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(R=="block"){this.beforeHideEvent.fire();C.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(P,O,S){var R=this.element,Q=O[0]=="static"?"static":"absolute",T=this.cfg,N;C.setStyle(R,"position",Q);if(Q=="static"){C.setStyle(R,"display","block");T.setProperty("visible",true);}else{C.setStyle(R,"visibility","hidden");}if(Q=="absolute"){N=T.getProperty("zindex");if(!N||N===0){N=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;T.setProperty("zindex",N);}}},configIframe:function(O,N,P){if(this.cfg.getProperty("position")=="dynamic"){F.superclass.configIframe.call(this,O,N,P);}},configHideDelay:function(O,N,R){var T=N[0],S=this.mouseOutEvent,P=this.mouseOverEvent,Q=this.keyDownEvent;if(T>0){if(!this._bHideDelayEventHandlersAssigned){S.subscribe(this._execHideDelay);P.subscribe(this._cancelHideDelay);Q.subscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=true;}}else{S.unsubscribe(this._execHideDelay);P.unsubscribe(this._cancelHideDelay);Q.unsubscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=false;}},configContainer:function(O,N,Q){var P=N[0];if(typeof P=="string"){this.cfg.setProperty("container",document.getElementById(P),true);}},_setMaxHeight:function(O,N,P){this.cfg.setProperty("maxheight",P);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(a,U,X){var T=U[0],Q=this.element,R=this.body,Y=this.header,O=this.footer,W=this._onScrollTargetMouseOver,b=this._onScrollTargetMouseOut,N=this.cfg.getProperty("minscrollheight"),V,S,P;if(T!==0&&T<N){T=N;}if(this.lazyLoad&&!R){this.renderEvent.unsubscribe(this._setMaxHeight);if(T>0){this.renderEvent.subscribe(this._setMaxHeight,T,this);}return ;}C.setStyle(R,"height","");C.removeClass(R,"yui-menu-body-scrolled");var Z=((H.gecko&&this.parent&&this.parent.parent&&this.parent.parent.cfg.getProperty("position")=="dynamic")||H.ie);if(Z){if(!this.cfg.getProperty("width")){S=Q.offsetWidth;Q.style.width=S+"px";P=(S-(Q.offsetWidth-S))+"px";this.cfg.setProperty("width",P);}}if(!Y&&!O){this.setHeader("&#32;");this.setFooter("&#32;");Y=this.header;O=this.footer;C.addClass(Y,"topscrollbar");C.addClass(O,"bottomscrollbar");Q.insertBefore(Y,R);Q.appendChild(O);}V=(T-(Y.offsetHeight+Y.offsetHeight));if(V>0&&(R.offsetHeight>T)){C.addClass(R,"yui-menu-body-scrolled");C.setStyle(R,"height",(V+"px"));M.on(Y,"mouseover",W,this,true);M.on(Y,"mouseout",b,this,true);M.on(O,"mouseover",W,this,true);M.on(O,"mouseout",b,this,true);this._disableScrollHeader();this._enableScrollFooter();}else{if(Y&&O){if(Z){this.cfg.setProperty("width","");}this._enableScrollHeader();this._enableScrollFooter();M.removeListener(Y,"mouseover",W);M.removeListener(Y,"mouseout",b);M.removeListener(O,"mouseover",W);M.removeListener(O,"mouseout",b);Q.removeChild(Y);Q.removeChild(O);this.header=null;this.footer=null;}}this.cfg.refireEvent("iframe");},configClassName:function(P,O,Q){var N=O[0];if(this._sClassName){C.removeClass(this.element,this._sClassName);}C.addClass(this.element,N);this._sClassName=N;},_onItemAdded:function(O,N){var P=N[0];if(P){P.cfg.setProperty("disabled",true);}},configDisabled:function(P,O,S){var R=O[0],N=this.getItems(),T,Q;if(E.isArray(N)){T=N.length;if(T>0){Q=T-1;do{N[Q].cfg.setProperty("disabled",R);}while(Q--);}if(R){this.clearActiveItem(true);C.addClass(this.element,"disabled");this.itemAddedEvent.subscribe(this._onItemAdded);}else{C.removeClass(this.element,"disabled");this.itemAddedEvent.unsubscribe(this._onItemAdded);}}},onRender:function(R,Q){function S(){var W=this.element,V=this._shadow;if(V&&W){V.style.width=(W.offsetWidth+6)+"px";V.style.height=(W.offsetHeight+1)+"px";}}function U(){this.element.appendChild(this._shadow);}function O(){C.addClass(this._shadow,"yui-menu-shadow-visible");}function N(){C.removeClass(this._shadow,"yui-menu-shadow-visible");}function T(){var W=this._shadow,V,X;if(!W){V=this.element;X=this;if(!G){G=document.createElement("div");G.className="yui-menu-shadow yui-menu-shadow-visible";}W=G.cloneNode(false);V.appendChild(W);this._shadow=W;this.beforeShowEvent.subscribe(O);this.beforeHideEvent.subscribe(N);if(H.ie){window.setTimeout(function(){S.call(X);X.syncIframe();},0);this.cfg.subscribeToConfigEvent("width",S);this.cfg.subscribeToConfigEvent("height",S);this.cfg.subscribeToConfigEvent("maxheight",S);this.changeContentEvent.subscribe(S);D.textResizeEvent.subscribe(S,X,true);this.destroyEvent.subscribe(function(){D.textResizeEvent.unsubscribe(S,X);});}this.cfg.subscribeToConfigEvent("maxheight",U);}}function P(){T.call(this);this.beforeShowEvent.unsubscribe(P);}if(this.cfg.getProperty("position")=="dynamic"){if(this.cfg.getProperty("visible")){T.call(this);}else{this.beforeShowEvent.subscribe(P);}}},initEvents:function(){F.superclass.initEvents.call(this);var N=L.LIST;this.mouseOverEvent=this.createEvent(A.MOUSE_OVER);this.mouseOverEvent.signature=N;this.mouseOutEvent=this.createEvent(A.MOUSE_OUT);this.mouseOutEvent.signature=N;this.mouseDownEvent=this.createEvent(A.MOUSE_DOWN);this.mouseDownEvent.signature=N;this.mouseUpEvent=this.createEvent(A.MOUSE_UP);this.mouseUpEvent.signature=N;this.clickEvent=this.createEvent(A.CLICK);this.clickEvent.signature=N;
+this.keyPressEvent=this.createEvent(A.KEY_PRESS);this.keyPressEvent.signature=N;this.keyDownEvent=this.createEvent(A.KEY_DOWN);this.keyDownEvent.signature=N;this.keyUpEvent=this.createEvent(A.KEY_UP);this.keyUpEvent.signature=N;this.focusEvent=this.createEvent(A.FOCUS);this.focusEvent.signature=N;this.blurEvent=this.createEvent(A.BLUR);this.blurEvent.signature=N;this.itemAddedEvent=this.createEvent(A.ITEM_ADDED);this.itemAddedEvent.signature=N;this.itemRemovedEvent=this.createEvent(A.ITEM_REMOVED);this.itemRemovedEvent.signature=N;},positionOffScreen:function(){var O=this.iframe,N=this.OFF_SCREEN_POSITION;C.setXY(this.element,N);if(O){C.setXY(O,N);}},getRoot:function(){var O=this.parent,N;if(O){N=O.parent;return N?N.getRoot():this;}else{return this;}},toString:function(){var O="Menu",N=this.id;if(N){O+=(" "+N);}return O;},setItemGroupTitle:function(S,R){var Q,P,O,N;if(typeof S=="string"&&S.length>0){Q=typeof R=="number"?R:0;P=this._aGroupTitleElements[Q];if(P){P.innerHTML=S;}else{P=document.createElement(this.GROUP_TITLE_TAG_NAME);P.innerHTML=S;this._aGroupTitleElements[Q]=P;}O=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[O]){C.removeClass(this._aGroupTitleElements[O],"first-of-type");N=O;}}while(O--);if(N!==null){C.addClass(this._aGroupTitleElements[N],"first-of-type");}this.changeContentEvent.fire();}},addItem:function(N,O){if(N){return this._addItemToGroup(O,N);}},addItems:function(Q,P){var S,N,R,O;if(E.isArray(Q)){S=Q.length;N=[];for(O=0;O<S;O++){R=Q[O];if(R){if(E.isArray(R)){N[N.length]=this.addItems(R,O);}else{N[N.length]=this._addItemToGroup(P,R);}}}if(N.length){return N;}}},insertItem:function(N,O,P){if(N){return this._addItemToGroup(P,N,O);}},removeItem:function(N,O){var P;if(typeof N!="undefined"){if(N instanceof YAHOO.widget.MenuItem){P=this._removeItemFromGroupByValue(O,N);}else{if(typeof N=="number"){P=this._removeItemFromGroupByIndex(O,N);}}if(P){P.destroy();return P;}}},getItems:function(){var P=this._aItemGroups,O,N=[];if(E.isArray(P)){O=P.length;return((O==1)?P[0]:(Array.prototype.concat.apply(N,P)));}},getItemGroups:function(){return this._aItemGroups;},getItem:function(N,O){var P;if(typeof N=="number"){P=this._getItemGroup(O);if(P){return P[N];}}},getSubmenus:function(){var O=this.getItems(),S=O.length,N,P,R,Q;if(S>0){N=[];for(Q=0;Q<S;Q++){R=O[Q];if(R){P=R.cfg.getProperty("submenu");if(P){N[N.length]=P;}}}}return N;},clearContent:function(){var R=this.getItems(),O=R.length,P=this.element,Q=this.body,V=this.header,N=this.footer,U,T,S;if(O>0){S=O-1;do{U=R[S];if(U){T=U.cfg.getProperty("submenu");if(T){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,T);this.renderEvent.unsubscribe(this._onParentMenuRender,T);}this.removeItem(U);}}while(S--);}if(V){M.purgeElement(V);P.removeChild(V);}if(N){M.purgeElement(N);P.removeChild(N);}if(Q){M.purgeElement(Q);Q.innerHTML="";}this.activeItem=null;this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty("width",null);},destroy:function(){this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;F.superclass.destroy.call(this);},setInitialFocus:function(){var N=this._getFirstEnabledItem();if(N){N.focus();}},setInitialSelection:function(){var N=this._getFirstEnabledItem();if(N){N.cfg.setProperty("selected",true);}},clearActiveItem:function(P){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}var N=this.activeItem,Q,O;if(N){Q=N.cfg;if(P){N.blur();}Q.setProperty("selected",false);O=Q.getProperty("submenu");if(O){O.hide();}this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var N;if(this.hasFocus()){N=K.getFocusedMenuItem();if(N){N.blur();}}},hasFocus:function(){return(K.getFocusedMenu()==this.getRoot());},subscribe:function(){function Q(V,U,X){var Y=U[0],W=Y.cfg.getProperty("submenu");if(W){W.subscribe.apply(W,X);}}function T(V,U,X){var W=this.cfg.getProperty("submenu");if(W){W.subscribe.apply(W,X);}}F.superclass.subscribe.apply(this,arguments);F.superclass.subscribe.call(this,"itemAdded",Q,arguments);var N=this.getItems(),S,R,O,P;if(N){S=N.length;if(S>0){P=S-1;do{R=N[P];O=R.cfg.getProperty("submenu");if(O){O.subscribe.apply(O,arguments);}else{R.cfg.subscribeToConfigEvent("submenu",T,arguments);}}while(P--);}}},initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);var N=this.cfg;N.addProperty(J.VISIBLE.key,{handler:this.configVisible,value:J.VISIBLE.value,validator:J.VISIBLE.validator});N.addProperty(J.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:J.CONSTRAIN_TO_VIEWPORT.value,validator:J.CONSTRAIN_TO_VIEWPORT.validator,supercedes:J.CONSTRAIN_TO_VIEWPORT.supercedes});N.addProperty(J.POSITION.key,{handler:this.configPosition,value:J.POSITION.value,validator:J.POSITION.validator,supercedes:J.POSITION.supercedes});N.addProperty(J.SUBMENU_ALIGNMENT.key,{value:J.SUBMENU_ALIGNMENT.value,suppressEvent:J.SUBMENU_ALIGNMENT.suppressEvent});N.addProperty(J.AUTO_SUBMENU_DISPLAY.key,{value:J.AUTO_SUBMENU_DISPLAY.value,validator:J.AUTO_SUBMENU_DISPLAY.validator,suppressEvent:J.AUTO_SUBMENU_DISPLAY.suppressEvent});N.addProperty(J.SHOW_DELAY.key,{value:J.SHOW_DELAY.value,validator:J.SHOW_DELAY.validator,suppressEvent:J.SHOW_DELAY.suppressEvent});N.addProperty(J.HIDE_DELAY.key,{handler:this.configHideDelay,value:J.HIDE_DELAY.value,validator:J.HIDE_DELAY.validator,suppressEvent:J.HIDE_DELAY.suppressEvent});N.addProperty(J.SUBMENU_HIDE_DELAY.key,{value:J.SUBMENU_HIDE_DELAY.value,validator:J.SUBMENU_HIDE_DELAY.validator,suppressEvent:J.SUBMENU_HIDE_DELAY.suppressEvent});N.addProperty(J.CLICK_TO_HIDE.key,{value:J.CLICK_TO_HIDE.value,validator:J.CLICK_TO_HIDE.validator,suppressEvent:J.CLICK_TO_HIDE.suppressEvent});N.addProperty(J.CONTAINER.key,{handler:this.configContainer,value:document.body,suppressEvent:J.CONTAINER.suppressEvent});N.addProperty(J.SCROLL_INCREMENT.key,{value:J.SCROLL_INCREMENT.value,validator:J.SCROLL_INCREMENT.validator,supercedes:J.SCROLL_INCREMENT.supercedes,suppressEvent:J.SCROLL_INCREMENT.suppressEvent});
+N.addProperty(J.MIN_SCROLL_HEIGHT.key,{value:J.MIN_SCROLL_HEIGHT.value,validator:J.MIN_SCROLL_HEIGHT.validator,supercedes:J.MIN_SCROLL_HEIGHT.supercedes,suppressEvent:J.MIN_SCROLL_HEIGHT.suppressEvent});N.addProperty(J.MAX_HEIGHT.key,{handler:this.configMaxHeight,value:J.MAX_HEIGHT.value,validator:J.MAX_HEIGHT.validator,suppressEvent:J.MAX_HEIGHT.suppressEvent,supercedes:J.MAX_HEIGHT.supercedes});N.addProperty(J.CLASS_NAME.key,{handler:this.configClassName,value:J.CLASS_NAME.value,validator:J.CLASS_NAME.validator,supercedes:J.CLASS_NAME.supercedes});N.addProperty(J.DISABLED.key,{handler:this.configDisabled,value:J.DISABLED.value,validator:J.DISABLED.validator,suppressEvent:J.DISABLED.suppressEvent});}});})();(function(){YAHOO.widget.MenuItem=function(K,J){if(K){if(J){this.parent=J.parent;this.value=J.value;this.id=J.id;}this.init(K,J);}};var B=YAHOO.util.Dom,C=YAHOO.widget.Module,E=YAHOO.widget.Menu,H=YAHOO.widget.MenuItem,I=YAHOO.util.CustomEvent,F=YAHOO.lang,D,A={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved","FOCUS":"focus","BLUR":"blur","DESTROY":"destroy"},G={"TEXT":{key:"text",value:"",validator:F.isString,suppressEvent:true},"HELP_TEXT":{key:"helptext",supercedes:["text"],suppressEvent:true},"URL":{key:"url",value:"#",suppressEvent:true},"TARGET":{key:"target",suppressEvent:true},"EMPHASIS":{key:"emphasis",value:false,validator:F.isBoolean,suppressEvent:true,supercedes:["text"]},"STRONG_EMPHASIS":{key:"strongemphasis",value:false,validator:F.isBoolean,suppressEvent:true,supercedes:["text"]},"CHECKED":{key:"checked",value:false,validator:F.isBoolean,suppressEvent:true,supercedes:["disabled","selected"]},"SUBMENU":{key:"submenu",suppressEvent:true,supercedes:["disabled","selected"]},"DISABLED":{key:"disabled",value:false,validator:F.isBoolean,suppressEvent:true,supercedes:["text","selected"]},"SELECTED":{key:"selected",value:false,validator:F.isBoolean,suppressEvent:true},"ONCLICK":{key:"onclick",suppressEvent:true},"CLASS_NAME":{key:"classname",value:null,validator:F.isString,suppressEvent:true}};H.prototype={CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:H,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,browser:C.prototype.browser,id:null,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(J,R){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=E;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var O=I.LIST,N=this.cfg,P="#",Q,K,M,L;if(F.isString(J)){this._createRootNodeStructure();N.queueProperty("text",J);}else{if(J&&J.tagName){switch(J.tagName.toUpperCase()){case"OPTION":this._createRootNodeStructure();N.queueProperty("text",J.text);N.queueProperty("disabled",J.disabled);this.value=J.value;this.srcElement=J;break;case"OPTGROUP":this._createRootNodeStructure();N.queueProperty("text",J.label);N.queueProperty("disabled",J.disabled);this.srcElement=J;this._initSubTree();break;case"LI":Q=B.getFirstChild(J);if(Q){P=Q.getAttribute("href");K=Q.getAttribute("target");M=Q.innerHTML;}this.srcElement=J;this.element=J;this._oAnchor=Q;N.setProperty("text",M,true);N.setProperty("url",P,true);N.setProperty("target",K,true);this._initSubTree();break;}}}if(this.element){L=(this.srcElement||this.element).id;if(!L){L=this.id||B.generateId();this.element.id=L;}this.id=L;B.addClass(this.element,this.CSS_CLASS_NAME);B.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);this.mouseOverEvent=this.createEvent(A.MOUSE_OVER);this.mouseOverEvent.signature=O;this.mouseOutEvent=this.createEvent(A.MOUSE_OUT);this.mouseOutEvent.signature=O;this.mouseDownEvent=this.createEvent(A.MOUSE_DOWN);this.mouseDownEvent.signature=O;this.mouseUpEvent=this.createEvent(A.MOUSE_UP);this.mouseUpEvent.signature=O;this.clickEvent=this.createEvent(A.CLICK);this.clickEvent.signature=O;this.keyPressEvent=this.createEvent(A.KEY_PRESS);this.keyPressEvent.signature=O;this.keyDownEvent=this.createEvent(A.KEY_DOWN);this.keyDownEvent.signature=O;this.keyUpEvent=this.createEvent(A.KEY_UP);this.keyUpEvent.signature=O;this.focusEvent=this.createEvent(A.FOCUS);this.focusEvent.signature=O;this.blurEvent=this.createEvent(A.BLUR);this.blurEvent.signature=O;this.destroyEvent=this.createEvent(A.DESTROY);this.destroyEvent.signature=O;if(R){N.applyConfig(R);}N.fireQueue();}},_createRootNodeStructure:function(){var J,K;if(!D){D=document.createElement("li");D.innerHTML="<a href=\"#\"></a>";}J=D.cloneNode(true);J.className=this.CSS_CLASS_NAME;K=J.firstChild;K.className=this.CSS_LABEL_CLASS_NAME;this.element=J;this._oAnchor=K;},_initSubTree:function(){var P=this.srcElement,L=this.cfg,N,M,K,J,O;if(P.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){L.setProperty("submenu",{id:B.generateId(),itemdata:P.childNodes});}else{N=P.firstChild;M=[];do{if(N&&N.tagName){switch(N.tagName.toUpperCase()){case"DIV":L.setProperty("submenu",N);break;case"OPTION":M[M.length]=N;break;}}}while((N=N.nextSibling));K=M.length;if(K>0){J=new this.SUBMENU_TYPE(B.generateId());L.setProperty("submenu",J);for(O=0;O<K;O++){J.addItem((new J.ITEM_TYPE(M[O])));}}}}},configText:function(S,L,N){var K=L[0],M=this.cfg,Q=this._oAnchor,J=M.getProperty("helptext"),R="",O="",P="";if(K){if(J){R="<em class=\"helptext\">"+J+"</em>";}if(M.getProperty("emphasis")){O="<em>";P="</em>";}if(M.getProperty("strongemphasis")){O="<strong>";P="</strong>";}Q.innerHTML=(O+K+P+R);}},configHelpText:function(L,K,J){this.cfg.refireEvent("text");},configURL:function(L,K,J){var N=K[0];if(!N){N="#";}var M=this._oAnchor;if(YAHOO.env.ua.opera){M.removeAttribute("href");
+}M.setAttribute("href",N);},configTarget:function(M,L,K){var J=L[0],N=this._oAnchor;if(J&&J.length>0){N.setAttribute("target",J);}else{N.removeAttribute("target");}},configEmphasis:function(L,K,J){var N=K[0],M=this.cfg;if(N&&M.getProperty("strongemphasis")){M.setProperty("strongemphasis",false);}M.refireEvent("text");},configStrongEmphasis:function(M,L,K){var J=L[0],N=this.cfg;if(J&&N.getProperty("emphasis")){N.setProperty("emphasis",false);}N.refireEvent("text");},configChecked:function(S,M,O){var R=M[0],K=this.element,Q=this._oAnchor,N=this.cfg,J="-checked",L=this.CSS_CLASS_NAME+J,P=this.CSS_LABEL_CLASS_NAME+J;if(R){B.addClass(K,L);B.addClass(Q,P);}else{B.removeClass(K,L);B.removeClass(Q,P);}N.refireEvent("text");if(N.getProperty("disabled")){N.refireEvent("disabled");}if(N.getProperty("selected")){N.refireEvent("selected");}},configDisabled:function(X,R,a){var Z=R[0],L=this.cfg,P=L.getProperty("submenu"),O=L.getProperty("checked"),S=this.element,V=this._oAnchor,U="-disabled",W="-checked"+U,Y="-hassubmenu"+U,M=this.CSS_CLASS_NAME+U,N=this.CSS_LABEL_CLASS_NAME+U,T=this.CSS_CLASS_NAME+W,Q=this.CSS_LABEL_CLASS_NAME+W,K=this.CSS_CLASS_NAME+Y,J=this.CSS_LABEL_CLASS_NAME+Y;if(Z){if(L.getProperty("selected")){L.setProperty("selected",false);}B.addClass(S,M);B.addClass(V,N);if(P){B.addClass(S,K);B.addClass(V,J);}if(O){B.addClass(S,T);B.addClass(V,Q);}}else{B.removeClass(S,M);B.removeClass(V,N);if(P){B.removeClass(S,K);B.removeClass(V,J);}if(O){B.removeClass(S,T);B.removeClass(V,Q);}}},configSelected:function(X,R,a){var L=this.cfg,Y=R[0],S=this.element,V=this._oAnchor,O=L.getProperty("checked"),P=L.getProperty("submenu"),U="-selected",W="-checked"+U,Z="-hassubmenu"+U,M=this.CSS_CLASS_NAME+U,N=this.CSS_LABEL_CLASS_NAME+U,T=this.CSS_CLASS_NAME+W,Q=this.CSS_LABEL_CLASS_NAME+W,K=this.CSS_CLASS_NAME+Z,J=this.CSS_LABEL_CLASS_NAME+Z;if(YAHOO.env.ua.opera){V.blur();}if(Y&&!L.getProperty("disabled")){B.addClass(S,M);B.addClass(V,N);if(P){B.addClass(S,K);B.addClass(V,J);}if(O){B.addClass(S,T);B.addClass(V,Q);}}else{B.removeClass(S,M);B.removeClass(V,N);if(P){B.removeClass(S,K);B.removeClass(V,J);}if(O){B.removeClass(S,T);B.removeClass(V,Q);}}if(this.hasFocus()&&YAHOO.env.ua.opera){V.focus();}},_onSubmenuBeforeHide:function(M,L){var N=this.parent,J;function K(){N._oAnchor.blur();J.beforeHideEvent.unsubscribe(K);}if(N.hasFocus()){J=N.parent;J.beforeHideEvent.subscribe(K);}},configSubmenu:function(V,O,R){var Q=O[0],P=this.cfg,K=this.element,T=this._oAnchor,N=this.parent&&this.parent.lazyLoad,J="-hassubmenu",L=this.CSS_CLASS_NAME+J,S=this.CSS_LABEL_CLASS_NAME+J,U,W,M;if(Q){if(Q instanceof E){U=Q;U.parent=this;U.lazyLoad=N;}else{if(typeof Q=="object"&&Q.id&&!Q.nodeType){W=Q.id;M=Q;M.lazyload=N;M.parent=this;U=new this.SUBMENU_TYPE(W,M);P.setProperty("submenu",U,true);}else{U=new this.SUBMENU_TYPE(Q,{lazyload:N,parent:this});P.setProperty("submenu",U,true);}}if(U){B.addClass(K,L);B.addClass(T,S);this._oSubmenu=U;if(YAHOO.env.ua.opera){U.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);}}}else{B.removeClass(K,L);B.removeClass(T,S);if(this._oSubmenu){this._oSubmenu.destroy();}}if(P.getProperty("disabled")){P.refireEvent("disabled");}if(P.getProperty("selected")){P.refireEvent("selected");}},configOnClick:function(L,K,J){var M=K[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=M)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}if(!this._oOnclickAttributeValue&&typeof M=="object"&&typeof M.fn=="function"){this.clickEvent.subscribe(M.fn,((!YAHOO.lang.isUndefined(M.obj))?M.obj:this),M.scope);this._oOnclickAttributeValue=M;}},configClassName:function(M,L,K){var J=L[0];if(this._sClassName){B.removeClass(this.element,this._sClassName);}B.addClass(this.element,J);this._sClassName=J;},initDefaultConfig:function(){var J=this.cfg;J.addProperty(G.TEXT.key,{handler:this.configText,value:G.TEXT.value,validator:G.TEXT.validator,suppressEvent:G.TEXT.suppressEvent});J.addProperty(G.HELP_TEXT.key,{handler:this.configHelpText,supercedes:G.HELP_TEXT.supercedes,suppressEvent:G.HELP_TEXT.suppressEvent});J.addProperty(G.URL.key,{handler:this.configURL,value:G.URL.value,suppressEvent:G.URL.suppressEvent});J.addProperty(G.TARGET.key,{handler:this.configTarget,suppressEvent:G.TARGET.suppressEvent});J.addProperty(G.EMPHASIS.key,{handler:this.configEmphasis,value:G.EMPHASIS.value,validator:G.EMPHASIS.validator,suppressEvent:G.EMPHASIS.suppressEvent,supercedes:G.EMPHASIS.supercedes});J.addProperty(G.STRONG_EMPHASIS.key,{handler:this.configStrongEmphasis,value:G.STRONG_EMPHASIS.value,validator:G.STRONG_EMPHASIS.validator,suppressEvent:G.STRONG_EMPHASIS.suppressEvent,supercedes:G.STRONG_EMPHASIS.supercedes});J.addProperty(G.CHECKED.key,{handler:this.configChecked,value:G.CHECKED.value,validator:G.CHECKED.validator,suppressEvent:G.CHECKED.suppressEvent,supercedes:G.CHECKED.supercedes});J.addProperty(G.DISABLED.key,{handler:this.configDisabled,value:G.DISABLED.value,validator:G.DISABLED.validator,suppressEvent:G.DISABLED.suppressEvent});J.addProperty(G.SELECTED.key,{handler:this.configSelected,value:G.SELECTED.value,validator:G.SELECTED.validator,suppressEvent:G.SELECTED.suppressEvent});J.addProperty(G.SUBMENU.key,{handler:this.configSubmenu,supercedes:G.SUBMENU.supercedes,suppressEvent:G.SUBMENU.suppressEvent});J.addProperty(G.ONCLICK.key,{handler:this.configOnClick,suppressEvent:G.ONCLICK.suppressEvent});J.addProperty(G.CLASS_NAME.key,{handler:this.configClassName,value:G.CLASS_NAME.value,validator:G.CLASS_NAME.validator,suppressEvent:G.CLASS_NAME.suppressEvent});},getNextEnabledSibling:function(){var L,O,J,N,M;function K(P,Q){return P[Q]||K(P,(Q+1));}if(this.parent instanceof E){L=this.groupIndex;O=this.parent.getItemGroups();if(this.index<(O[L].length-1)){J=K(O[L],(this.index+1));}else{if(L<(O.length-1)){N=L+1;}else{N=0;}M=K(O,N);J=K(M,0);}return(J.cfg.getProperty("disabled")||J.element.style.display=="none")?J.getNextEnabledSibling():J;}},getPreviousEnabledSibling:function(){var N,P,K,J,M;
+function O(Q,R){return Q[R]||O(Q,(R-1));}function L(Q,R){return Q[R]?R:L(Q,(R+1));}if(this.parent instanceof E){N=this.groupIndex;P=this.parent.getItemGroups();if(this.index>L(P[N],0)){K=O(P[N],(this.index-1));}else{if(N>L(P,0)){J=N-1;}else{J=P.length-1;}M=O(P,J);K=O(M,(M.length-1));}return(K.cfg.getProperty("disabled")||K.element.style.display=="none")?K.getPreviousEnabledSibling():K;}},focus:function(){var N=this.parent,M=this._oAnchor,J=N.activeItem,L=this;function K(){try{if(YAHOO.env.ua.ie&&!document.hasFocus()){return ;}if(J){J.blurEvent.fire();}M.focus();L.focusEvent.fire();}catch(O){}}if(!this.cfg.getProperty("disabled")&&N&&N.cfg.getProperty("visible")&&this.element.style.display!="none"){window.setTimeout(K,0);}},blur:function(){var K=this.parent;if(!this.cfg.getProperty("disabled")&&K&&K.cfg.getProperty("visible")){var J=this;window.setTimeout(function(){try{J._oAnchor.blur();J.blurEvent.fire();}catch(L){}},0);}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var L=this.element,K,J;if(L){K=this.cfg.getProperty("submenu");if(K){K.destroy();}this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();J=L.parentNode;if(J){J.removeChild(L);this.destroyEvent.fire();}this.destroyEvent.unsubscribeAll();}},toString:function(){var K="MenuItem",J=this.id;if(J){K+=(" "+J);}return K;}};F.augmentProto(H,YAHOO.util.EventProvider);})();(function(){YAHOO.widget.ContextMenu=function(G,F){YAHOO.widget.ContextMenu.superclass.constructor.call(this,G,F);};var B=YAHOO.util.Event,E=YAHOO.widget.ContextMenu,D={"TRIGGER_CONTEXT_MENU":"triggerContextMenu","CONTEXT_MENU":(YAHOO.env.ua.opera?"mousedown":"contextmenu"),"CLICK":"click"},C={"TRIGGER":{key:"trigger",suppressEvent:true}};function A(G,F,H){this.cfg.setProperty("xy",H);this.beforeShowEvent.unsubscribe(A,H);}YAHOO.lang.extend(E,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(G,F){E.superclass.init.call(this,G);this.beforeInitEvent.fire(E);if(F){this.cfg.applyConfig(F,true);}this.initEvent.fire(E);},initEvents:function(){E.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(D.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var F=this._oTrigger;if(F){B.removeListener(F,D.CONTEXT_MENU,this._onTriggerContextMenu);if(YAHOO.env.ua.opera){B.removeListener(F,D.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(G,F){if(G.ctrlKey){B.stopEvent(G);}},_onTriggerContextMenu:function(H,F){if(H.type=="mousedown"&&!H.ctrlKey){return ;}var G;B.stopEvent(H);this.contextEventTarget=B.getTarget(H);this.triggerContextMenuEvent.fire(H);YAHOO.widget.MenuManager.hideVisible();if(!this._bCancelled){G=B.getXY(H);if(!YAHOO.util.Dom.inDocument(this.element)){this.beforeShowEvent.subscribe(A,G);}else{this.cfg.setProperty("xy",G);}this.show();}this._bCancelled=false;},toString:function(){var G="ContextMenu",F=this.id;if(F){G+=(" "+F);}return G;},initDefaultConfig:function(){E.superclass.initDefaultConfig.call(this);this.cfg.addProperty(C.TRIGGER.key,{handler:this.configTrigger,suppressEvent:C.TRIGGER.suppressEvent});},destroy:function(){this._removeEventHandlers();E.superclass.destroy.call(this);},configTrigger:function(G,F,I){var H=F[0];if(H){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=H;B.on(H,D.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(YAHOO.env.ua.opera){B.on(H,D.CLICK,this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=YAHOO.widget.MenuItem;(function(){YAHOO.widget.MenuBar=function(F,E){YAHOO.widget.MenuBar.superclass.constructor.call(this,F,E);};function D(E){if(typeof E=="string"){return("dynamic,static".indexOf((E.toLowerCase()))!=-1);}}var B=YAHOO.util.Event,A=YAHOO.widget.MenuBar,C={"POSITION":{key:"position",value:"static",validator:D,supercedes:["visible"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","bl"],suppressEvent:true},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:false,validator:YAHOO.lang.isBoolean,suppressEvent:true}};YAHOO.lang.extend(A,YAHOO.widget.Menu,{init:function(F,E){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}A.superclass.init.call(this,F);this.beforeInitEvent.fire(A);if(E){this.cfg.applyConfig(E,true);}this.initEvent.fire(A);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(G,F,K){var E=F[0],L=F[1],I,J,H;if(L&&!L.cfg.getProperty("disabled")){J=L.cfg;switch(E.keyCode){case 37:case 39:if(L==this.activeItem&&!J.getProperty("selected")){J.setProperty("selected",true);}else{H=(E.keyCode==37)?L.getPreviousEnabledSibling():L.getNextEnabledSibling();if(H){this.clearActiveItem();H.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){I=H.cfg.getProperty("submenu");if(I){I.show();}}H.focus();}}B.preventDefault(E);break;case 40:if(this.activeItem!=L){this.clearActiveItem();J.setProperty("selected",true);L.focus();}I=J.getProperty("submenu");if(I){if(I.cfg.getProperty("visible")){I.setInitialSelection();I.setInitialFocus();}else{I.show();}}B.preventDefault(E);break;}}if(E.keyCode==27&&this.activeItem){I=this.activeItem.cfg.getProperty("submenu");if(I&&I.cfg.getProperty("visible")){I.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}B.preventDefault(E);}},_onClick:function(L,G,J){A.superclass._onClick.call(this,L,G,J);var K=G[1],M,E,F,H,I;if(K&&!K.cfg.getProperty("disabled")){M=G[0];E=B.getTarget(M);F=this.activeItem;H=this.cfg;if(F&&F!=K){this.clearActiveItem();
+}K.cfg.setProperty("selected",true);I=K.cfg.getProperty("submenu");if(I){if(I.cfg.getProperty("visible")){I.hide();}else{I.show();}}}},toString:function(){var F="MenuBar",E=this.id;if(E){F+=(" "+E);}return F;},initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);var E=this.cfg;E.addProperty(C.POSITION.key,{handler:this.configPosition,value:C.POSITION.value,validator:C.POSITION.validator,supercedes:C.POSITION.supercedes});E.addProperty(C.SUBMENU_ALIGNMENT.key,{value:C.SUBMENU_ALIGNMENT.value,suppressEvent:C.SUBMENU_ALIGNMENT.suppressEvent});E.addProperty(C.AUTO_SUBMENU_DISPLAY.key,{value:C.AUTO_SUBMENU_DISPLAY.value,validator:C.AUTO_SUBMENU_DISPLAY.validator,suppressEvent:C.AUTO_SUBMENU_DISPLAY.suppressEvent});}});}());YAHOO.widget.MenuBarItem=function(B,A){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,B,A);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(B,A){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,B);var C=this.cfg;if(A){C.applyConfig(A,true);}C.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var A="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){A+=(": "+this.cfg.getProperty("text"));}return A;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.5.0",build:"895"});
\ No newline at end of file
index f6c776389c15fe08a1b76c25dfd8ff4cbdb5ec82..2b6dfda6e836ba0c2287aa0a000959effa1b6998 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
 
@@ -14,7 +14,6 @@ version: 2.3.0
 * context menus, or application-style menu bars with just a small amount of 
 * scripting.</p><p>The Menu family of controls features:</p>
 * <ul>
-*    <li>Screen-reader accessibility.</li>
 *    <li>Keyboard and mouse navigation.</li>
 *    <li>A rich event model that provides access to all of a menu's 
 *    interesting moments.</li>
@@ -269,11 +268,11 @@ version: 2.3.0
                     dynamically positioned menus
                 */
                 
-                for (var i in m_oMenus) {
+                for (var i in m_oVisibleMenus) {
         
-                    if (YAHOO.lang.hasOwnProperty(m_oMenus,i)) {
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
         
-                        oMenu = m_oMenus[i];
+                        oMenu = m_oVisibleMenus[i];
         
                         if (oMenu.cfg.getProperty("clicktohide") && 
                             !(oMenu instanceof YAHOO.widget.MenuBar) && 
@@ -410,21 +409,30 @@ version: 2.3.0
         */
         function onItemDestroy(p_sType, p_aArgs) {
     
-            var sId = this.id;
+            removeItem(this);
+    
+        }
+
+    
+        function removeItem(p_oMenuItem) {
+
+            var sId = p_oMenuItem.id;
     
             if (sId && m_oItems[sId]) {
     
-                if (m_oFocusedMenuItem == this) {
+                if (m_oFocusedMenuItem == p_oMenuItem) {
     
                     m_oFocusedMenuItem = null;
     
                 }
     
                 delete m_oItems[sId];
+                
+                p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy);
     
     
             }
-    
+
         }
     
     
@@ -475,11 +483,8 @@ version: 2.3.0
     
                 var oDoc;
     
-                if (
-                    p_oMenu instanceof YAHOO.widget.Menu && 
-                    p_oMenu.id && 
-                    !m_oMenus[p_oMenu.id]
-                ) {
+                if (p_oMenu instanceof YAHOO.widget.Menu && p_oMenu.id && 
+                    !m_oMenus[p_oMenu.id]) {
         
                     m_oMenus[p_oMenu.id] = p_oMenu;
                 
@@ -503,14 +508,11 @@ version: 2.3.0
             
                     }
             
-                    p_oMenu.destroyEvent.subscribe(
-                                            onMenuDestroy, 
-                                            p_oMenu, 
-                                            this);
-    
-                    p_oMenu.cfg.subscribeToConfigEvent(
-                        "visible", 
+                    p_oMenu.cfg.subscribeToConfigEvent("visible", 
                         onMenuVisibleConfigChange);
+
+                    p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, 
+                                            this);
             
                     p_oMenu.itemAddedEvent.subscribe(onItemAdded);
                     p_oMenu.focusEvent.subscribe(onMenuFocus);
@@ -530,25 +532,69 @@ version: 2.3.0
             */
             removeMenu: function (p_oMenu) {
     
-                var sId;
+                var sId,
+                    aItems,
+                    i;
         
                 if (p_oMenu) {
     
                     sId = p_oMenu.id;
         
                     if (m_oMenus[sId] == p_oMenu) {
-            
+
+                        // Unregister each menu item
+
+                        aItems = p_oMenu.getItems();
+
+                        if (aItems && aItems.length > 0) {
+
+                            i = aItems.length - 1;
+
+                            do {
+
+                                removeItem(aItems[i]);
+
+                            }
+                            while (i--);
+
+                        }
+
+
+                        // Unregister the menu
+
                         delete m_oMenus[sId];
             
         
-        
+
+                        /*
+                             Unregister the menu from the collection of 
+                             visible menus
+                        */
+
                         if (m_oVisibleMenus[sId] == p_oMenu) {
             
                             delete m_oVisibleMenus[sId];
                             
-                                
+       
                         }
-            
+
+
+                        // Unsubscribe event listeners
+
+                        if (p_oMenu.cfg) {
+
+                            p_oMenu.cfg.unsubscribeFromConfigEvent("visible", 
+                                onMenuVisibleConfigChange);
+                            
+                        }
+
+                        p_oMenu.destroyEvent.unsubscribe(onMenuDestroy, 
+                            p_oMenu);
+                
+                        p_oMenu.itemAddedEvent.unsubscribe(onItemAdded);
+                        p_oMenu.focusEvent.unsubscribe(onMenuFocus);
+                        p_oMenu.blurEvent.unsubscribe(onMenuBlur);
+
                     }
                 
                 }
@@ -567,7 +613,7 @@ version: 2.3.0
         
                 for (var i in m_oVisibleMenus) {
         
-                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)) {
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
         
                         oMenu = m_oVisibleMenus[i];
         
@@ -583,11 +629,24 @@ version: 2.3.0
                 }        
     
             },
-    
+
+
+            /**
+            * @method getVisible
+            * @description Returns a collection of all visible menus registered
+            * with the menu manger.
+            * @return {Array}
+            */
+            getVisible: function () {
+            
+                return m_oVisibleMenus;
+            
+            },
+
     
             /**
             * @method getMenus
-            * @description Returns an array of all menus registered with the 
+            * @description Returns a collection of all menus registered with the 
             * menu manger.
             * @return {Array}
             */
@@ -822,6 +881,7 @@ var Dom = YAHOO.util.Dom,
     MenuManager = YAHOO.widget.MenuManager,
     CustomEvent = YAHOO.util.CustomEvent,
     Lang = YAHOO.lang,
+    UA = YAHOO.env.ua,
     
     m_oShadowTemplate,
 
@@ -881,19 +941,22 @@ var Dom = YAHOO.util.Dom,
     
         "SUBMENU_ALIGNMENT": { 
             key: "submenualignment", 
-            value: ["tl","tr"]
+            value: ["tl","tr"],
+            suppressEvent: true
         },
     
         "AUTO_SUBMENU_DISPLAY": { 
             key: "autosubmenudisplay", 
             value: true, 
-            validator: Lang.isBoolean 
+            validator: Lang.isBoolean,
+            suppressEvent: true
         }, 
     
         "SHOW_DELAY": { 
             key: "showdelay", 
             value: 250, 
-            validator: Lang.isNumber 
+            validator: Lang.isNumber, 
+            suppressEvent: true
         }, 
     
         "HIDE_DELAY": { 
@@ -906,36 +969,58 @@ var Dom = YAHOO.util.Dom,
         "SUBMENU_HIDE_DELAY": { 
             key: "submenuhidedelay", 
             value: 250, 
-            validator: Lang.isNumber
+            validator: Lang.isNumber,
+            suppressEvent: true
         }, 
     
         "CLICK_TO_HIDE": { 
             key: "clicktohide", 
             value: true, 
-            validator: Lang.isBoolean
+            validator: Lang.isBoolean,
+            suppressEvent: true
         },
     
         "CONTAINER": { 
-            key: "container"
+            key: "container",
+            suppressEvent: true
         }, 
+
+        "SCROLL_INCREMENT": { 
+            key: "scrollincrement", 
+            value: 1, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },
+
+        "MIN_SCROLL_HEIGHT": { 
+            key: "minscrollheight", 
+            value: 90, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },    
     
         "MAX_HEIGHT": { 
             key: "maxheight", 
             value: 0, 
             validator: Lang.isNumber,
-            supercedes: ["iframe"]
+            supercedes: ["iframe"],
+            suppressEvent: true
         }, 
     
         "CLASS_NAME": { 
             key: "classname", 
             value: null, 
-            validator: Lang.isString
+            validator: Lang.isString,
+            suppressEvent: true
         }, 
     
         "DISABLED": { 
             key: "disabled", 
             value: false, 
-            validator: Lang.isBoolean
+            validator: Lang.isBoolean,
+            suppressEvent: true
         }
     
     };
@@ -983,6 +1068,17 @@ ITEM_TYPE: null,
 GROUP_TITLE_TAG_NAME: "h6",
 
 
+/**
+* @property OFF_SCREEN_POSITION
+* @description Array representing the default x and y position that a menu 
+* should have when it is positioned outside the viewport by the 
+* "poistionOffScreen" method.
+* @default [-10000, -10000]
+* @final
+* @type Array
+*/
+OFF_SCREEN_POSITION: [-10000, -10000],
+
 
 // Private properties
 
@@ -1108,17 +1204,6 @@ _aListElements: null,
 _nCurrentMouseX: 0,
 
 
-/**
-* @property _nMaxHeight
-* @description The original value of the "maxheight" configuration property 
-* as set by the user.
-* @default -1
-* @private
-* @type Number
-*/
-_nMaxHeight: -1,
-
-
 /**
 * @property _bStopMouseEventHandlers
 * @description Stops "mouseover," "mouseout," and "mousemove" event handlers 
@@ -1140,15 +1225,6 @@ _bStopMouseEventHandlers: false,
 _sClassName: null,
 
 
-/**
-* @property _bDisabled
-* @description The current value of the "disabled" configuration attribute.
-* @default false
-* @private
-* @type Boolean
-*/
-_bDisabled: false,
-
 
 // Public properties
 
@@ -1436,16 +1512,21 @@ init: function (p_oElement, p_oConfig) {
         this.renderEvent.subscribe(this._onRender);
         this.renderEvent.subscribe(this.onRender);
         this.beforeShowEvent.subscribe(this._onBeforeShow);
+        this.hideEvent.subscribe(this.positionOffScreen);
         this.showEvent.subscribe(this._onShow);
         this.beforeHideEvent.subscribe(this._onBeforeHide);
-        this.hideEvent.subscribe(this._onHide);
         this.mouseOverEvent.subscribe(this._onMouseOver);
         this.mouseOutEvent.subscribe(this._onMouseOut);
         this.clickEvent.subscribe(this._onClick);
         this.keyDownEvent.subscribe(this._onKeyDown);
         this.keyPressEvent.subscribe(this._onKeyPress);
+        
+
+        if (UA.gecko || UA.webkit) {
 
-        Module.textResizeEvent.subscribe(this._onTextResize, this, true);
+            this.cfg.subscribeToConfigEvent("y", this._onYChange);
+
+        }
 
 
         if (p_oConfig) {
@@ -1689,7 +1770,6 @@ _getFirstEnabledItem: function () {
 _addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) {
 
     var oItem,
-        bDisabled = this.cfg.getProperty("disabled"),
         nGroupIndex,
         aGroup,
         oGroupItem,
@@ -2118,17 +2198,15 @@ _configureSubmenu: function (p_oItem) {
 
         this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true);
 
-        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow, null, 
-            oSubmenu);
-
-        oSubmenu.showEvent.subscribe(this._onSubmenuShow, null, p_oItem);
-        oSubmenu.hideEvent.subscribe(this._onSubmenuHide, null, p_oItem);
+        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow);
 
     }
 
 },
 
 
+
+
 /**
 * @method _subscribeToItemEvents
 * @description Subscribes a menu to a menu item's event.
@@ -2142,124 +2220,14 @@ _subscribeToItemEvents: function (p_oItem) {
 
     p_oItem.blurEvent.subscribe(this._onMenuItemBlur);
 
+    p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy, p_oItem, this);
+
     p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,
         p_oItem, this);
 
 },
 
 
-/**
-* @method _getOffsetWidth
-* @description Returns the offset width of the menu's 
-* <code>&#60;div&#62;</code> element.
-* @private
-*/
-_getOffsetWidth: function () {
-
-    var oClone = this.element.cloneNode(true);
-
-    Dom.removeClass(oClone, "visible");
-
-    Dom.setStyle(oClone, "width", "");
-
-    document.body.appendChild(oClone);
-
-    var sWidth = oClone.offsetWidth;
-
-    document.body.removeChild(oClone);
-
-    return sWidth;
-
-},
-
-
-/**
-* @method _setWidth
-* @description Sets the width of the menu's root <code>&#60;div&#62;</code> 
-* element to its offsetWidth.
-* @private
-*/
-_setWidth: function () {
-
-    var oElement = this.element,
-        bVisible = false,
-        sWidth;
-
-    if (oElement.parentNode.tagName.toUpperCase() == "BODY") {
-
-        if (YAHOO.env.ua.opera) {
-
-            sWidth = this._getOffsetWidth();
-        
-        }
-        else {
-
-            if (Dom.hasClass(oElement, "visible")) {
-
-                bVisible = true;
-                
-                Dom.removeClass(oElement, "visible");
-
-            }
-
-            Dom.setStyle(oElement, "width", "auto");
-            
-            sWidth = oElement.offsetWidth;
-        
-        }
-
-    }
-    else {
-    
-        sWidth = this._getOffsetWidth();
-    
-    }
-
-    this.cfg.setProperty("width", (sWidth + "px"));
-    
-
-    if (bVisible) {
-    
-        Dom.addClass(oElement, "visible");
-    
-    }
-
-},
-
-
-/**
-* @method _onWidthChange
-* @description Change event handler for the the menu's "width" configuration
-* property.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onWidthChange: function (p_sType, p_aArgs) {
-
-    var sWidth = p_aArgs[0];
-    
-    if (sWidth && !this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.subscribe(this._setWidth);
-        this.itemRemovedEvent.subscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = true;
-
-    }
-    else if (this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.unsubscribe(this._setWidth);
-        this.itemRemovedEvent.unsubscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = false;
-
-    }
-
-},
-
-
 /**
 * @method _onVisibleChange
 * @description Change event handler for the the menu's "visible" configuration
@@ -2537,7 +2505,11 @@ _onMouseOver: function (p_sType, p_aArgs) {
         Event.on(this.element, "mousemove", this._onMouseMove, this, true);
 
 
-        this.clearActiveItem();
+               if (!Dom.isAncestor(oItem.element, Event.getRelatedTarget(oEvent))) {
+
+               this.clearActiveItem();
+        
+        }
 
 
         if (this.parent && this._nSubmenuHideDelayId) {
@@ -2767,88 +2739,102 @@ _onMouseMove: function (p_oEvent, p_oMenu) {
 */
 _onClick: function (p_sType, p_aArgs) {
 
-    var oEvent = p_aArgs[0],
-        oItem = p_aArgs[1],
-        oTarget,
-        oItemCfg,
-        oSubmenu,
-        sURL,
-        oRoot;
-
-
-    if (oItem && !oItem.cfg.getProperty("disabled")) {
-
-        oTarget = Event.getTarget(oEvent);
-        oItemCfg = oItem.cfg;
-        oSubmenu = oItemCfg.getProperty("submenu");
-
-
-        /*
-            ACCESSIBILITY FEATURE FOR SCREEN READERS: 
-            Expand/collapse the submenu when the user clicks 
-            on the submenu indicator image.
-        */        
-
-        if (oTarget == oItem.submenuIndicator && oSubmenu) {
-
-            if (oSubmenu.cfg.getProperty("visible")) {
-
-                oSubmenu.hide();
-                
-                oSubmenu.parent.focus();
-    
-            }
-            else {
-
-                this.clearActiveItem();
-
-                oItemCfg.setProperty("selected", true);
-
-                oSubmenu.show();
-                
-                oSubmenu.setInitialFocus();
-    
-            }
-
-            Event.preventDefault(oEvent);
-    
-        }
-        else {
-
-            sURL = oItemCfg.getProperty("url");
-
-            //  Prevent the browser from following links equal to "#"
-            
-            if ((sURL.substr((sURL.length-1),1) == "#")) {
-
-                Event.preventDefault(oEvent);
-
-                oItem.focus();
-            
-            }
-
-
-            if (!oSubmenu) {
-    
-                oRoot = this.getRoot();
-                
-                if (oRoot instanceof YAHOO.widget.MenuBar || 
-                    oRoot.cfg.getProperty("position") == "static") {
-    
-                    oRoot.clearActiveItem();
-    
-                }
-                else if (oRoot.cfg.getProperty("clicktohide")) {
+       var Event = YAHOO.util.Event,
+               Dom = YAHOO.util.Dom,
+               oEvent = p_aArgs[0],
+               oItem = p_aArgs[1],
+               oSubmenu,
+               bInMenuAnchor = false,
+               oRoot,
+               sId,
+               sURL,
+               nHashPos,
+               nLen;
+
+
+       if (oItem) {
+       
+               if (oItem.cfg.getProperty("disabled")) {
+               
+                       Event.preventDefault(oEvent);
+
+               }
+               else {
+
+                       oSubmenu = oItem.cfg.getProperty("submenu");
+       
+                       
+                       /*
+                                Check if the URL of the anchor is pointing to an element that is 
+                                a child of the menu.
+                       */
+                       
+                       sURL = oItem.cfg.getProperty("url");
+
+               
+                       if (sURL) {
+       
+                               nHashPos = sURL.indexOf("#");
+       
+                               nLen = sURL.length;
+       
+       
+                               if (nHashPos != -1) {
+       
+                                       sURL = sURL.substr(nHashPos, nLen);
+               
+                                       nLen = sURL.length;
+       
+       
+                                       if (nLen > 1) {
+       
+                                               sId = sURL.substr(1, nLen);
+       
+                                               bInMenuAnchor = Dom.isAncestor(this.element, sId);
+                                               
+                                       }
+                                       else if (nLen === 1) {
+       
+                                               bInMenuAnchor = true;
+                                       
+                                       }
+       
+                               }
+                       
+                       }
 
-                    oRoot.hide();
-                
-                }
-    
-            }
 
-        }                    
-    
-    }
+       
+                       if (bInMenuAnchor && !oItem.cfg.getProperty("target")) {
+       
+                               Event.preventDefault(oEvent);
+       
+                               oItem.focus();
+                       
+                       }
+       
+       
+                       if (!oSubmenu) {
+       
+                               oRoot = this.getRoot();
+                               
+                               if (oRoot instanceof YAHOO.widget.MenuBar || 
+                                       oRoot.cfg.getProperty("position") == "static") {
+       
+                                       oRoot.clearActiveItem();
+       
+                               }
+                               else {
+       
+                                       oRoot.hide();
+                               
+                               }
+       
+                       }
+                       
+               }
+       
+       }
 
 },
 
@@ -3182,38 +3168,52 @@ _onKeyPress: function (p_sType, p_aArgs) {
 
 
 /**
-* @method _onTextResize
-* @description "textresize" event handler for the menu.
+* @method _onYChange
+* @description "y" event handler for a Menu instance.
 * @protected
-* @param {String} p_sType String representing the name of the event that 
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
 * was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onTextResize: function (p_sType, p_aArgs, p_oMenu) {
-
-    if (YAHOO.env.ua.gecko && !this._handleResize) {
-
-        this._handleResize = true;
-        return;
-    
-    }
+_onYChange: function (p_sType, p_aArgs) {
 
+    var oParent = this.parent,
+        nScrollTop,
+        oIFrame,
+        nY;
 
-    var oConfig = this.cfg;
 
-    if (oConfig.getProperty("position") == "dynamic") {
+    if (oParent) {
 
-        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));
+        nScrollTop = oParent.parent.body.scrollTop;
 
-    }
 
-},
+        if (nScrollTop > 0) {
+    
+            nY = (this.cfg.getProperty("y") - nScrollTop);
+            
+            Dom.setY(this.element, nY);
 
+            oIFrame = this.iframe;            
+    
 
-/**
-* @method _onScrollTargetMouseOver
+            if (oIFrame) {
+    
+                Dom.setY(oIFrame, nY);
+    
+            }
+            
+            this.cfg.setProperty("y", nY, true);
+        
+        }
+    
+    }
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOver
 * @description "mouseover" event handler for the menu's "header" and "footer" 
 * elements.  Used to scroll the body of the menu up and down when the 
 * menu's "maxheight" configuration property is set to a value greater than 0.
@@ -3230,6 +3230,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
     var oTarget = Event.getTarget(p_oEvent),
         oBody = this.body,
         me = this,
+        nScrollIncrement = this.cfg.getProperty("scrollincrement"),
         nScrollTarget,
         fnScrollFunction;
 
@@ -3241,7 +3242,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
 
         if (nScrollTop < nScrollTarget) {
 
-            oBody.scrollTop = (nScrollTop + 1);
+            oBody.scrollTop = (nScrollTop + nScrollIncrement);
 
             me._enableScrollHeader();
 
@@ -3266,7 +3267,7 @@ _onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
 
         if (nScrollTop > 0) {
 
-            oBody.scrollTop = (nScrollTop - 1);
+            oBody.scrollTop = (nScrollTop - nScrollIncrement);
 
             me._enableScrollFooter();
 
@@ -3337,7 +3338,6 @@ _onScrollTargetMouseOut: function (p_oEvent, p_oMenu) {
 */
 _onInit: function (p_sType, p_aArgs) {
 
-    this.cfg.subscribeToConfigEvent("width", this._onWidthChange);
     this.cfg.subscribeToConfigEvent("visible", this._onVisibleChange);
 
     var bRootMenu = !this.parent,
@@ -3397,8 +3397,7 @@ _onInit: function (p_sType, p_aArgs) {
 */
 _onBeforeRender: function (p_sType, p_aArgs) {
 
-    var oConfig = this.cfg,
-        oEl = this.element,
+    var oEl = this.element,
         nListElements = this._aListElements.length,
         bFirstList = true,
         i = 0,
@@ -3465,16 +3464,22 @@ _onBeforeRender: function (p_sType, p_aArgs) {
 */
 _onRender: function (p_sType, p_aArgs) {
 
-    if (this.cfg.getProperty("position") == "dynamic" && 
-        !this.cfg.getProperty("width")) {
+    if (this.cfg.getProperty("position") == "dynamic") { 
+
+        if (!this.cfg.getProperty("visible")) {
+
+            this.positionOffScreen();
 
-        this._setWidth();
+        }
     
     }
 
 },
 
 
+
+
+
 /**
 * @method _onBeforeShow
 * @description "beforeshow" event handler for the menu.
@@ -3489,8 +3494,6 @@ _onBeforeShow: function (p_sType, p_aArgs) {
         n,
         nViewportHeight,
         oRegion,
-        nMaxHeight,
-        oBody,
         oSrcElement;
 
 
@@ -3567,7 +3570,6 @@ _onBeforeShow: function (p_sType, p_aArgs) {
             else {
 
                 this.render(this.cfg.getProperty("container"));
-                this.cfg.refireEvent("xy");
 
             }                
 
@@ -3576,55 +3578,65 @@ _onBeforeShow: function (p_sType, p_aArgs) {
     }
 
 
-    if (!(this instanceof YAHOO.widget.MenuBar) && 
-        this.cfg.getProperty("position") == "dynamic") {
-
-        nViewportHeight = Dom.getViewportHeight();
+    var nMaxHeight = this.cfg.getProperty("maxheight"),
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        bDynamicPos = this.cfg.getProperty("position") == "dynamic";
 
 
-        if (this.parent && this.parent.parent instanceof YAHOO.widget.MenuBar) {
-           
-            oRegion = YAHOO.util.Region.getRegion(this.parent.element);
-            
-            nViewportHeight = (nViewportHeight - oRegion.bottom);
+    if (!this.parent && bDynamicPos) {
 
-        }
+        this.cfg.refireEvent("xy");
+   
+    }
 
 
-        if (this.element.offsetHeight >= nViewportHeight) {
+    function clearMaxHeight() {
     
-            nMaxHeight = this.cfg.getProperty("maxheight");
-
-            /*
-                Cache the original value for the "maxheight" configuration  
-                property so that we can set it back when the menu is hidden.
-            */
+        this.cfg.setProperty("maxheight", 0);
+    
+        this.hideEvent.unsubscribe(clearMaxHeight);
     
-            this._nMaxHeight = nMaxHeight;
+    }
 
-            this.cfg.setProperty("maxheight", (nViewportHeight - 20));
-        
-        }
+
+    if (!(this instanceof YAHOO.widget.MenuBar) && bDynamicPos) {
+
+
+        if (nMaxHeight === 0) {
+
+            nViewportHeight = Dom.getViewportHeight();
     
     
-        if (this.cfg.getProperty("maxheight") > 0) {
+            if (this.parent && 
+                this.parent.parent instanceof YAHOO.widget.MenuBar) {
+               
+                oRegion = YAHOO.util.Region.getRegion(this.parent.element);
+                
+                nViewportHeight = (nViewportHeight - oRegion.bottom);
     
-            oBody = this.body;
+            }
     
-            if (oBody.scrollTop > 0) {
     
-                oBody.scrollTop = 0;
+            if (this.element.offsetHeight >= nViewportHeight) {
     
-            }
+                nMaxHeight = (nViewportHeight - (Overlay.VIEWPORT_OFFSET * 2));
 
-            this._disableScrollHeader();
-            this._enableScrollFooter();
-    
+                if (nMaxHeight < nMinScrollHeight) {
+
+                    nMaxHeight = nMinScrollHeight;
+                
+                }
+
+                this.cfg.setProperty("maxheight", nMaxHeight);
+
+                this.hideEvent.subscribe(clearMaxHeight);
+
+            }
+        
         }
 
     }
 
-
 },
 
 
@@ -3747,27 +3759,6 @@ _onBeforeHide: function (p_sType, p_aArgs) {
 },
 
 
-/**
-* @method _onHide
-* @description "hide" event handler for the menu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onHide: function (p_sType, p_aArgs) {
-
-    if (this._nMaxHeight != -1) {
-
-        this.cfg.setProperty("maxheight", this._nMaxHeight);
-
-        this._nMaxHeight = -1;
-
-    }
-
-},
-
-
 /**
 * @method _onParentMenuConfigChange
 * @description "configchange" event handler for a submenu.
@@ -3793,6 +3784,8 @@ _onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
         case "clicktohide":
         case "effect":
         case "classname":
+        case "scrollincrement":
+        case "minscrollheight":
 
             p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);
                 
@@ -3816,45 +3809,37 @@ _onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
 */
 _onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
 
-    var oParentMenu = p_oSubmenu.parent.parent,
+    var oParentCfg = p_oSubmenu.parent.parent.cfg,
 
         oConfig = {
 
-            constraintoviewport: 
-                oParentMenu.cfg.getProperty("constraintoviewport"),
+            constraintoviewport: oParentCfg.getProperty("constraintoviewport"),
 
             xy: [0,0],
+
+            clicktohide: oParentCfg.getProperty("clicktohide"),
                 
-            clicktohide: oParentMenu.cfg.getProperty("clicktohide"),
-                
-            effect: oParentMenu.cfg.getProperty("effect"),
+            effect: oParentCfg.getProperty("effect"),
 
-            showdelay: oParentMenu.cfg.getProperty("showdelay"),
+            showdelay: oParentCfg.getProperty("showdelay"),
             
-            hidedelay: oParentMenu.cfg.getProperty("hidedelay"),
+            hidedelay: oParentCfg.getProperty("hidedelay"),
 
-            submenuhidedelay: oParentMenu.cfg.getProperty("submenuhidedelay"),
+            submenuhidedelay: oParentCfg.getProperty("submenuhidedelay"),
 
-            classname: oParentMenu.cfg.getProperty("classname")
+            classname: oParentCfg.getProperty("classname"),
+            
+            scrollincrement: oParentCfg.getProperty("scrollincrement"),
+            
+            minscrollheight: oParentCfg.getProperty("minscrollheight"),
+            
+            iframe: oParentCfg.getProperty("iframe")
 
         },
         
         oLI;
 
 
-    /*
-        Only sync the "iframe" configuration property if the parent
-        menu's "position" configuration is the same.
-    */
-
-    if (this.cfg.getProperty("position") == 
-        oParentMenu.cfg.getProperty("position")) {
-
-        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");
-    
-    }
-               
-
     p_oSubmenu.cfg.applyConfig(oConfig);
 
 
@@ -3887,19 +3872,20 @@ _onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
 _onSubmenuBeforeShow: function (p_sType, p_aArgs) {
-    
+
     var oParent = this.parent,
         aAlignment = oParent.parent.cfg.getProperty("submenualignment");
 
-    this.cfg.setProperty("context", 
-        [oParent.element, aAlignment[0], aAlignment[1]]);
-
 
-    var nScrollTop = oParent.parent.body.scrollTop;
+    if (!this.cfg.getProperty("context")) {
+    
+        this.cfg.setProperty("context", 
+            [oParent.element, aAlignment[0], aAlignment[1]]);
 
-    if ((YAHOO.env.ua.gecko || YAHOO.env.ua.webkit) && nScrollTop > 0) {
+    }
+    else {
 
-         this.cfg.setProperty("y", (this.cfg.getProperty("y") - nScrollTop));
+        this.align();
     
     }
 
@@ -3907,61 +3893,48 @@ _onSubmenuBeforeShow: function (p_sType, p_aArgs) {
 
 
 /**
-* @method _onSubmenuShow
-* @description "show" event handler for a submenu.
+* @method _onMenuItemFocus
+* @description "focus" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onSubmenuShow: function (p_sType, p_aArgs) {
-    
-    this.submenuIndicator.innerHTML = this.EXPANDED_SUBMENU_INDICATOR_TEXT;
-
-},
-
+_onMenuItemFocus: function (p_sType, p_aArgs) {
 
-/**
-* @method _onSubmenuHide
-* @description "hide" Custom Event handler for a submenu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onSubmenuHide: function (p_sType, p_aArgs) {
-    
-    this.submenuIndicator.innerHTML = this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+    this.parent.focusEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemFocus
-* @description "focus" event handler for the menu's items.
+* @method _onMenuItemBlur
+* @description "blur" event handler for the menu's items.
 * @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
+* @param {String} p_sType String representing the name of the event 
+* that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onMenuItemFocus: function (p_sType, p_aArgs) {
+_onMenuItemBlur: function (p_sType, p_aArgs) {
 
-    this.parent.focusEvent.fire(this);
+    this.parent.blurEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemBlur
-* @description "blur" event handler for the menu's items.
+* @method _onMenuItemDestroy
+* @description "destroy" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event 
 * that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
+* that fired the event.
 */
-_onMenuItemBlur: function (p_sType, p_aArgs) {
+_onMenuItemDestroy: function (p_sType, p_aArgs, p_oItem) {
 
-    this.parent.blurEvent.fire(this);
+    this._removeItemFromGroupByValue(p_oItem.groupIndex, p_oItem);
 
 },
 
@@ -3980,9 +3953,9 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 
     var sPropertyName = p_aArgs[0][0],
         oPropertyValue = p_aArgs[0][1],
-        sWidth,
         oSubmenu;
 
+
     switch(sPropertyName) {
 
         case "selected":
@@ -4007,25 +3980,6 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 
         break;
 
-        case "text":
-        case "helptext":
-
-            /*
-                A change to an item's "text" or "helptext"
-                configuration properties requires the width of the parent
-                menu to be recalculated.
-            */
-
-            if (this.element.style.width) {
-    
-                sWidth = this._getOffsetWidth() + "px";
-
-                Dom.setStyle(this.element, "width", sWidth);
-
-            }
-
-        break;
-
     }
 
 },
@@ -4048,69 +4002,56 @@ _onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 enforceConstraints: function (type, args, obj) {
 
     var oParentMenuItem = this.parent,
-        oElement,
-        oConfig,
-        pos,
-        x,
-        y,
-        offsetHeight,
-        offsetWidth,
-        viewPortWidth,
-        viewPortHeight,
-        scrollX,
-        scrollY,
-        nPadding,
+        nViewportOffset = Overlay.VIEWPORT_OFFSET,
+        oElement = this.element,
+        oConfig = this.cfg,
+        pos = args[0],
+        offsetHeight = oElement.offsetHeight,
+        offsetWidth = oElement.offsetWidth,
+        viewPortWidth = Dom.getViewportWidth(),
+        viewPortHeight = Dom.getViewportHeight(),
+        nPadding = (oParentMenuItem && 
+            oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 
+            0 : nViewportOffset,
+        aContext = oConfig.getProperty("context"),
+        oContextElement = aContext ? aContext[0] : null,
         topConstraint,
         leftConstraint,
         bottomConstraint,
         rightConstraint,
-        aContext,
-        oContextElement;
-
+        scrollX,
+        scrollY,
+        x,
+        y;
+    
 
-    if (oParentMenuItem && 
-        !(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)) {
+    if (offsetWidth < viewPortWidth) {
 
-        oElement = this.element;
-    
-        oConfig = this.cfg;
-        pos = args[0];
-        
         x = pos[0];
-        y = pos[1];
-        
-        offsetHeight = oElement.offsetHeight;
-        offsetWidth = oElement.offsetWidth;
-        
-        viewPortWidth = Dom.getViewportWidth();
-        viewPortHeight = Dom.getViewportHeight();
-        
         scrollX = Dom.getDocumentScrollLeft();
-        scrollY = Dom.getDocumentScrollTop();
-        
-        nPadding = 
-            (oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 0 : 10;
-        
-        topConstraint = scrollY + nPadding;
         leftConstraint = scrollX + nPadding;
-        
-        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
         rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding;
-        
-        aContext = oConfig.getProperty("context");
-        oContextElement = aContext ? aContext[0] : null;
-    
-    
-        if (x < 10) {
+
+        if (x < nViewportOffset) {
     
             x = leftConstraint;
     
         } else if ((x + offsetWidth) > viewPortWidth) {
     
-            if (oContextElement &&
+            if(oContextElement &&
                 ((x - oContextElement.offsetWidth) > offsetWidth)) {
     
-                x = (x - (oContextElement.offsetWidth + offsetWidth));
+                if (oParentMenuItem && 
+                    oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) {
+    
+                    x = (x - (offsetWidth - oContextElement.offsetWidth));
+    
+                }
+                else {
+    
+                    x = (x - (oContextElement.offsetWidth + offsetWidth));
+    
+                }
     
             }
             else {
@@ -4121,7 +4062,19 @@ enforceConstraints: function (type, args, obj) {
     
         }
     
-        if (y < 10) {
+    }
+
+
+    if (offsetHeight < viewPortHeight) {
+
+        y = pos[1];
+        scrollY = Dom.getDocumentScrollTop();
+        topConstraint = scrollY + nPadding;
+        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
+
+
+
+        if (y < nViewportOffset) {
     
             y = topConstraint;
     
@@ -4135,23 +4088,20 @@ enforceConstraints: function (type, args, obj) {
             else {
     
                 y = bottomConstraint;
+                
+
     
             }
     
         }
-    
-        oConfig.setProperty("x", x, true);
-        oConfig.setProperty("y", y, true);
-        oConfig.setProperty("xy", [x,y], true);
-    
-    }
-    else if (this == this.getRoot() && 
-        this.cfg.getProperty("position") == "dynamic") {
-    
-        Menu.superclass.enforceConstraints.call(this, type, args, obj);
-    
+
     }
 
+
+    oConfig.setProperty("x", x, true);
+    oConfig.setProperty("y", y, true);
+    oConfig.setProperty("xy", [x,y], true);
+
 },
 
 
@@ -4180,6 +4130,8 @@ configVisible: function (p_sType, p_aArgs, p_oMenu) {
         bVisible = p_aArgs[0];
         sDisplay = Dom.getStyle(this.element, "display");
 
+        Dom.setStyle(this.element, "visibility", "visible");
+
         if (bVisible) {
 
             if (sDisplay != "block") {
@@ -4218,39 +4170,24 @@ configPosition: function (p_sType, p_aArgs, p_oMenu) {
 
     var oElement = this.element,
         sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
-        sCurrentPosition = Dom.getStyle(oElement, "position"),
         oCfg = this.cfg,
         nZIndex;
 
 
-    Dom.setStyle(this.element, "position", sCSSPosition);
+    Dom.setStyle(oElement, "position", sCSSPosition);
 
 
     if (sCSSPosition == "static") {
 
-        /*
-            Remove the iframe for statically positioned menus since it will 
-            intercept mouse events.
-        */
-
-        oCfg.setProperty("iframe", false);
-
-
         // Statically positioned menus are visible by default
         
-        Dom.setStyle(this.element, "display", "block");
+        Dom.setStyle(oElement, "display", "block");
 
         oCfg.setProperty("visible", true);
 
     }
     else {
 
-        if (sCurrentPosition != "absolute") {
-
-            oCfg.setProperty("iframe", (YAHOO.env.ua.ie == 6 ? true : false));
-
-        }
-
         /*
             Even though the "visible" property is queued to 
             "false" by default, we need to set the "visibility" property to 
@@ -4259,7 +4196,7 @@ configPosition: function (p_sType, p_aArgs, p_oMenu) {
             or not to show an Overlay instance.
         */
 
-        Dom.setStyle(this.element, "visibility", "hidden");
+        Dom.setStyle(oElement, "visibility", "hidden");
     
     }
 
@@ -4354,7 +4291,7 @@ configHideDelay: function (p_sType, p_aArgs, p_oMenu) {
 /**
 * @method configContainer
 * @description Event handler for when the "container" configuration property 
-of the menu changes.
+of the menu changes.
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
@@ -4408,12 +4345,23 @@ _setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) {
 configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
 
     var nMaxHeight = p_aArgs[0],
+        oElement = this.element,
         oBody = this.body,
         oHeader = this.header,
         oFooter = this.footer,
         fnMouseOver = this._onScrollTargetMouseOver,
         fnMouseOut = this._onScrollTargetMouseOut,
-        nHeight;
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        nHeight,
+        nOffsetWidth,
+        sWidth;
+
+
+    if (nMaxHeight !== 0 && nMaxHeight < nMinScrollHeight) {
+    
+        nMaxHeight = nMinScrollHeight;
+    
+    }
 
 
     if (this.lazyLoad && !oBody) {
@@ -4430,59 +4378,106 @@ configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
     
     }
 
-    Dom.setStyle(oBody, "height", "auto");
-    Dom.setStyle(oBody, "overflow", "visible");    
 
+    Dom.setStyle(oBody, "height", "");
+    Dom.removeClass(oBody, "yui-menu-body-scrolled");
 
-    if ((nMaxHeight > 0) && (oBody.offsetHeight > nMaxHeight)) {
 
-        if (!this.cfg.getProperty("width")) {
+    /*
+        There is a bug in gecko-based browsers where an element whose 
+        "position" property is set to "absolute" and "overflow" property is set 
+        to "hidden" will not render at the correct width when its 
+        offsetParent's "position" property is also set to "absolute."  It is 
+        possible to work around this bug by specifying a value for the width 
+        property in addition to overflow.
+
+               In IE it is also necessary to give the Menu a width when the scrollbars are 
+               rendered to prevent the Menu from rendering with a width that is 100% of
+               the browser viewport.
+    */
 
-            this._setWidth();
+       var bSetWidth = ((UA.gecko && this.parent && this.parent.parent && 
+        this.parent.parent.cfg.getProperty("position") == "dynamic") || UA.ie);
 
-        }
 
-        if (!oHeader && !oFooter) {
+    if (bSetWidth) {
 
-            this.setHeader("&#32;");
-            this.setFooter("&#32;");
+               if (!this.cfg.getProperty("width")) {
 
-            oHeader = this.header;
-            oFooter = this.footer;
+                       nOffsetWidth = oElement.offsetWidth;
+       
+                       /*
+                               Measuring the difference of the offsetWidth before and after
+                               setting the "width" style attribute allows us to compute the 
+                               about of padding and borders applied to the element, which in 
+                               turn allows us to set the "width" property correctly.
+                       */
+                       
+                       oElement.style.width = nOffsetWidth + "px";
+       
+                       sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px";
+       
+                       this.cfg.setProperty("width", sWidth);
+               
+               }
 
-            Dom.addClass(oHeader, "topscrollbar");
-            Dom.addClass(oFooter, "bottomscrollbar");
-            
-            this.element.insertBefore(oHeader, oBody);
-            this.element.appendChild(oFooter);
+    }
 
-            Event.on(oHeader, "mouseover", fnMouseOver, this, true);
-            Event.on(oHeader, "mouseout", fnMouseOut, this, true);
-            Event.on(oFooter, "mouseover", fnMouseOver, this, true);
-            Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+
+    if (!oHeader && !oFooter) {
+
+        this.setHeader("&#32;");
+        this.setFooter("&#32;");
+
+        oHeader = this.header;
+        oFooter = this.footer;
+
+        Dom.addClass(oHeader, "topscrollbar");
+        Dom.addClass(oFooter, "bottomscrollbar");
         
-        }
+        oElement.insertBefore(oHeader, oBody);
+        oElement.appendChild(oFooter);
+    
+    }
+
 
-        nHeight = (nMaxHeight - (this.footer.offsetHeight + 
-                    this.header.offsetHeight));
+    nHeight = (nMaxHeight - (oHeader.offsetHeight + oHeader.offsetHeight));
 
+
+    if (nHeight > 0 && (oBody.offsetHeight > nMaxHeight)) {
+
+        Dom.addClass(oBody, "yui-menu-body-scrolled");
         Dom.setStyle(oBody, "height", (nHeight + "px"));
-        Dom.setStyle(oBody, "overflow", "hidden");
+
+        Event.on(oHeader, "mouseover", fnMouseOver, this, true);
+        Event.on(oHeader, "mouseout", fnMouseOut, this, true);
+        Event.on(oFooter, "mouseover", fnMouseOver, this, true);
+        Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+
+        this._disableScrollHeader();
+        this._enableScrollFooter();
 
     }
     else if (oHeader && oFooter) {
 
-        Dom.setStyle(oBody, "height", "auto");
-        Dom.setStyle(oBody, "overflow", "visible");
+               if (bSetWidth) {
+
+                       this.cfg.setProperty("width", "");
+               
+               }
+
+
+        this._enableScrollHeader();
+        this._enableScrollFooter();
 
         Event.removeListener(oHeader, "mouseover", fnMouseOver);
         Event.removeListener(oHeader, "mouseout", fnMouseOut);
         Event.removeListener(oFooter, "mouseover", fnMouseOver);
         Event.removeListener(oFooter, "mouseout", fnMouseOut);
 
-        this.element.removeChild(oHeader);
-        this.element.removeChild(oFooter);
-    
+        oElement.removeChild(oHeader);
+        oElement.removeChild(oFooter);
+
         this.header = null;
         this.footer = null;
     
@@ -4549,15 +4544,14 @@ _onItemAdded: function (p_sType, p_aArgs) {
 configDisabled: function (p_sType, p_aArgs, p_oMenu) {
 
     var bDisabled = p_aArgs[0],
-        aItems,
+        aItems = this.getItems(),
         nItems,
         i;
 
-    if (this._bDisabled != bDisabled) {
+    if (Lang.isArray(aItems)) {
 
-        aItems = this.getItems();
         nItems = aItems.length;
-
+    
         if (nItems > 0) {
         
             i = nItems - 1;
@@ -4570,14 +4564,25 @@ configDisabled: function (p_sType, p_aArgs, p_oMenu) {
             while (i--);
         
         }
-    
-        Dom[(bDisabled ? "addClass" : "removeClass")](this.element, "disabled");    
 
-        this.itemAddedEvent[(bDisabled ? "subscribe" : "unsubscribe")](
-            this._onItemAdded);
-    
-        this._bDisabled = bDisabled;
-    
+
+        if (bDisabled) {
+
+            this.clearActiveItem(true);
+
+            Dom.addClass(this.element, "disabled");
+
+            this.itemAddedEvent.subscribe(this._onItemAdded);
+
+        }
+        else {
+
+            Dom.removeClass(this.element, "disabled");
+
+            this.itemAddedEvent.unsubscribe(this._onItemAdded);
+
+        }
+        
     }
 
 },
@@ -4597,7 +4602,7 @@ onRender: function (p_sType, p_aArgs) {
         var oElement = this.element,
             oShadow = this._shadow;
     
-        if (oShadow) {
+        if (oShadow && oElement) {
 
             oShadow.style.width = (oElement.offsetWidth + 6) + "px";
             oShadow.style.height = (oElement.offsetHeight + 1) + "px";
@@ -4607,6 +4612,13 @@ onRender: function (p_sType, p_aArgs) {
     }
 
 
+    function replaceShadow() {
+
+        this.element.appendChild(this._shadow);
+
+    }
+
+
     function addShadowVisibleClass() {
     
         Dom.addClass(this._shadow, "yui-menu-shadow-visible");
@@ -4635,7 +4647,8 @@ onRender: function (p_sType, p_aArgs) {
             if (!m_oShadowTemplate) {
 
                 m_oShadowTemplate = document.createElement("div");
-                m_oShadowTemplate.className = "yui-menu-shadow";
+                m_oShadowTemplate.className = 
+                    "yui-menu-shadow yui-menu-shadow-visible";
             
             }
 
@@ -4645,12 +4658,10 @@ onRender: function (p_sType, p_aArgs) {
             
             this._shadow = oShadow;
 
-            addShadowVisibleClass.call(this);
-
             this.beforeShowEvent.subscribe(addShadowVisibleClass);
             this.beforeHideEvent.subscribe(removeShadowVisibleClass);
 
-            if (YAHOO.env.ua.ie) {
+            if (UA.ie) {
         
                 /*
                      Need to call sizeShadow & syncIframe via setTimeout for 
@@ -4668,6 +4679,7 @@ onRender: function (p_sType, p_aArgs) {
 
                 this.cfg.subscribeToConfigEvent("width", sizeShadow);
                 this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                this.cfg.subscribeToConfigEvent("maxheight", sizeShadow);
                 this.changeContentEvent.subscribe(sizeShadow);
 
                 Module.textResizeEvent.subscribe(sizeShadow, me, true);
@@ -4679,7 +4691,9 @@ onRender: function (p_sType, p_aArgs) {
                 });
         
             }
-        
+
+            this.cfg.subscribeToConfigEvent("maxheight", replaceShadow);
+
         }
 
     }
@@ -4767,8 +4781,30 @@ initEvents: function () {
 
 
 /**
-* @method getRoot
-* @description Finds the menu's root menu.
+* @method positionOffScreen
+* @description Positions the menu outside of the boundaries of the browser's 
+* viewport.  Called automatically when a menu is hidden to ensure that 
+* it doesn't force the browser to render uncessary scrollbars.
+*/
+positionOffScreen: function () {
+
+    var oIFrame = this.iframe,
+        aPos = this.OFF_SCREEN_POSITION;
+
+    Dom.setXY(this.element, aPos);
+    
+    if (oIFrame) {
+
+        Dom.setXY(oIFrame, aPos);
+    
+    }
+
+},
+
+
+/**
+* @method getRoot
+* @description Finds the menu's root menu.
 */
 getRoot: function () {
 
@@ -5036,10 +5072,17 @@ removeItem: function (p_oObject, p_nGroupIndex) {
 getItems: function () {
 
     var aGroups = this._aItemGroups,
+        nGroups,
+        aItems = [];
+
+    if (Lang.isArray(aGroups)) {
+
         nGroups = aGroups.length;
 
-    return ((nGroups == 1) ? aGroups[0] : 
-                (Array.prototype.concat.apply([], aGroups)));
+        return ((nGroups == 1) ? aGroups[0] : 
+                    (Array.prototype.concat.apply(aItems, aGroups)));
+
+    }
 
 },
 
@@ -5129,6 +5172,7 @@ getSubmenus: function () {
 
 },
 
+
 /**
 * @method clearContent
 * @description Removes all of the content from the menu, including the menu 
@@ -5202,11 +5246,12 @@ clearContent: function () {
 
     }
 
+    this.activeItem = null;
 
     this._aItemGroups = [];
     this._aListElements = [];
     this._aGroupTitleElements = [];
-    
+
     this.cfg.setProperty("width", null);
 
 },
@@ -5219,9 +5264,6 @@ clearContent: function () {
 */
 destroy: function () {
 
-    Module.textResizeEvent.unsubscribe(this._onTextResize, this);
-
-
     // Remove all items
 
     this.clearContent();
@@ -5397,34 +5439,60 @@ subscribe: function () {
     }
 
 
+    function onSubmenuAdded(p_sType, p_aArgs, p_oObject) { 
+    
+        var oSubmenu = this.cfg.getProperty("submenu");
+        
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+        
+        }
+    
+    }
+
+
     Menu.superclass.subscribe.apply(this, arguments);
     Menu.superclass.subscribe.call(this, "itemAdded", onItemAdded, arguments);
 
 
-    var aSubmenus = this.getSubmenus(),
-        nSubmenus,
+    var aItems = this.getItems(),
+        nItems,
+        oItem,
         oSubmenu,
         i;
+        
 
-    if (aSubmenus) {
-
-        nSubmenus = aSubmenus.length;
+    if (aItems) {
 
-        if (nSubmenus > 0) {
+        nItems = aItems.length;
         
-            i = nSubmenus - 1;
+        if (nItems > 0) {
+        
+            i = nItems - 1;
             
             do {
-    
-                oSubmenu = aSubmenus[i];
+
+                oItem = aItems[i];
                 
-                oSubmenu.subscribe.apply(oSubmenu, arguments);
-    
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+                
+                    oSubmenu.subscribe.apply(oSubmenu, arguments);
+                
+                }
+                else {
+                
+                    oItem.cfg.subscribeToConfigEvent("submenu", onSubmenuAdded, arguments);
+                
+                }
+
             }
-            while(i--);
+            while (i--);
         
         }
-    
+
     }
 
 },
@@ -5441,6 +5509,98 @@ initDefaultConfig: function () {
 
     var oConfig = this.cfg;
 
+
+    // Module documentation overrides
+
+    /**
+    * @config effect
+    * @description Object or array of objects representing the ContainerEffect 
+    * classes that are active for animating the container.  When set this 
+    * property is automatically applied to all submenus.
+    * @type Object
+    * @default null
+    */
+
+    // Overlay documentation overrides
+
+
+    /**
+    * @config x
+    * @description Number representing the absolute x-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+
+    /**
+    * @config y
+    * @description Number representing the absolute y-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+
+
+    /**
+    * @description Array of the absolute x and y positions of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @config xy
+    * @type Number[]
+    * @default null
+    */
+    
+
+    /**
+    * @config context
+    * @description Array of context arguments for context-sensitive positioning.  
+    * The format is: [id or element, element corner, context corner]. 
+    * For example, setting this property to ["img1", "tl", "bl"] would 
+    * align the Mnu's top left corner to the context element's 
+    * bottom left corner.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Array
+    * @default null
+    */
+    
+    
+    /**
+    * @config fixedcenter
+    * @description Boolean indicating if the Menu should be anchored to the 
+    * center of the viewport.  This property is only applied when the 
+    * "position" configuration property is set to dynamic.
+    * @type Boolean
+    * @default false
+    */
+
+    
+    /**
+    * @config zindex
+    * @description Number representing the CSS z-index of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+    
+    /**
+    * @config iframe
+    * @description Boolean indicating whether or not the Menu should 
+    * have an IFRAME shim; used to prevent SELECT elements from 
+    * poking through an Overlay instance in IE6.  When set to "true", 
+    * the iframe shim is created when the Menu instance is intially
+    * made visible.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
+    * @type Boolean
+    * @default true for IE6 and below, false for all other browsers.
+    */
+
+
        // Add configuration attributes
 
     /*
@@ -5479,7 +5639,9 @@ initDefaultConfig: function () {
     /**
     * @config constraintoviewport
     * @description Boolean indicating if the menu will try to remain inside 
-    * the boundaries of the size of viewport.
+    * the boundaries of the size of viewport.  This property is only applied 
+    * when the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5528,7 +5690,8 @@ initDefaultConfig: function () {
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         { 
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value 
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -5544,7 +5707,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
           { 
               value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+              suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -5553,7 +5717,9 @@ initDefaultConfig: function () {
     * @config showdelay
     * @description Number indicating the time (in milliseconds) that should 
     * expire before a submenu is made visible when the user mouses over 
-    * the menu's items.
+    * the menu's items.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
     * @default 250
     * @type Number
     */
@@ -5561,7 +5727,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.SHOW_DELAY.key, 
           { 
               value: DEFAULT_CONFIG.SHOW_DELAY.value, 
-              validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+              validator: DEFAULT_CONFIG.SHOW_DELAY.validator,
+              suppressEvent: DEFAULT_CONFIG.SHOW_DELAY.suppressEvent
        } 
     );
 
@@ -5569,7 +5736,9 @@ initDefaultConfig: function () {
     /**
     * @config hidedelay
     * @description Number indicating the time (in milliseconds) that should 
-    * expire before the menu is hidden.
+    * expire before the menu is hidden.  This property is only applied when 
+    * the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default 0
     * @type Number
     */
@@ -5590,6 +5759,8 @@ initDefaultConfig: function () {
     * expire before a submenu is hidden when the user mouses out of a menu item 
     * heading in the direction of a submenu.  The value must be greater than or 
     * equal to the value specified for the "showdelay" configuration property.
+    * This property is only applied when the "position" configuration property 
+    * is set to dynamic and is automatically applied to all submenus.
     * @default 250
     * @type Number
     */
@@ -5597,7 +5768,8 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key, 
           { 
               value: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value, 
-              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator
+              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator,
+              suppressEvent: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.suppressEvent
        } 
     );
 
@@ -5605,7 +5777,9 @@ initDefaultConfig: function () {
     /**
     * @config clicktohide
     * @description Boolean indicating if the menu will automatically be 
-    * hidden if the user clicks outside of it.
+    * hidden if the user clicks outside of it.  This property is only 
+    * applied when the "position" configuration property is set to dynamic 
+    * and is automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5613,7 +5787,8 @@ initDefaultConfig: function () {
         DEFAULT_CONFIG.CLICK_TO_HIDE.key,
         {
             value: DEFAULT_CONFIG.CLICK_TO_HIDE.value,
-            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator
+            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator,
+            suppressEvent: DEFAULT_CONFIG.CLICK_TO_HIDE.suppressEvent
         }
     );
 
@@ -5631,15 +5806,58 @@ initDefaultConfig: function () {
           DEFAULT_CONFIG.CONTAINER.key, 
           { 
               handler: this.configContainer,
-              value: document.body
+              value: document.body,
+           suppressEvent: DEFAULT_CONFIG.CONTAINER.suppressEvent
        } 
    );
 
 
+    /**
+    * @config scrollincrement
+    * @description Number used to control the scroll speed of a menu.  Used to 
+    * increment the "scrollTop" property of the menu's body by when a menu's 
+    * content is scrolling.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 1
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SCROLL_INCREMENT.key, 
+        { 
+            value: DEFAULT_CONFIG.SCROLL_INCREMENT.value, 
+            validator: DEFAULT_CONFIG.SCROLL_INCREMENT.validator,
+            supercedes: DEFAULT_CONFIG.SCROLL_INCREMENT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.SCROLL_INCREMENT.suppressEvent
+        }
+    );
+
+
+    /**
+    * @config minscrollheight
+    * @description Number defining the minimum threshold for the "maxheight" 
+    * configuration property.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 90
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.key, 
+        { 
+            value: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.value, 
+            validator: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.validator,
+            supercedes: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.suppressEvent
+        }
+    );
+
+
     /**
     * @config maxheight
-    * @description Defines the maximum height (in pixels) for a menu before the
-    * contents of the body are scrolled.
+    * @description Number defining the maximum height (in pixels) for a menu's 
+    * body element (<code>&#60;div class="bd"&#60;</code>).  Once a menu's body 
+    * exceeds this height, the contents of the body are scrolled to maintain 
+    * this value.  This value cannot be set lower than the value of the 
+    * "minscrollheight" configuration property.
     * @default 0
     * @type Number
     */
@@ -5648,17 +5866,20 @@ initDefaultConfig: function () {
        {
             handler: this.configMaxHeight,
             value: DEFAULT_CONFIG.MAX_HEIGHT.value,
-            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator
+            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator,
+            suppressEvent: DEFAULT_CONFIG.MAX_HEIGHT.suppressEvent,
+            supercedes: DEFAULT_CONFIG.MAX_HEIGHT.supercedes            
        } 
     );
 
 
     /**
     * @config classname
-    * @description CSS class to be applied to the menu's root 
-    * <code>&#60;div&#62;</code> element.  The specified class(es) are 
-    * appended in addition to the default class as specified by the menu's
-    * CSS_CLASS_NAME constant.
+    * @description String representing the CSS class to be applied to the 
+    * menu's root <code>&#60;div&#62;</code> element.  The specified class(es)  
+    * are appended in addition to the default class as specified by the menu's
+    * CSS_CLASS_NAME constant. When set this property is automatically 
+    * applied to all submenus.
     * @default null
     * @type String
     */
@@ -5667,7 +5888,8 @@ initDefaultConfig: function () {
         { 
             handler: this.configClassName,
             value: DEFAULT_CONFIG.CLASS_NAME.value, 
-            validator: DEFAULT_CONFIG.CLASS_NAME.validator
+            validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+            supercedes: DEFAULT_CONFIG.CLASS_NAME.supercedes      
         }
     );
 
@@ -5687,7 +5909,8 @@ initDefaultConfig: function () {
         { 
             handler: this.configDisabled,
             value: DEFAULT_CONFIG.DISABLED.value, 
-            validator: DEFAULT_CONFIG.DISABLED.validator
+            validator: DEFAULT_CONFIG.DISABLED.validator,
+            suppressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
         }
     );
 
@@ -5699,7 +5922,7 @@ initDefaultConfig: function () {
 
 
 
-(function() {
+(function () {
 
 
 /**
@@ -5721,11 +5944,11 @@ initDefaultConfig: function () {
 * @class MenuItem
 * @constructor
 */
-YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
+YAHOO.widget.MenuItem = function (p_oObject, p_oConfig) {
 
-    if(p_oObject) {
+    if (p_oObject) {
 
-        if(p_oConfig) {
+        if (p_oConfig) {
     
             this.parent = p_oConfig.parent;
             this.value = p_oConfig.value;
@@ -5739,6 +5962,7 @@ YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
 
 };
 
+
 var Dom = YAHOO.util.Dom,
     Module = YAHOO.widget.Module,
     Menu = YAHOO.widget.Menu,
@@ -5791,7 +6015,8 @@ var Dom = YAHOO.util.Dom,
     
         "HELP_TEXT": { 
             key: "helptext",
-            supercedes: ["text"]
+            supercedes: ["text"], 
+            suppressEvent: true 
         },
     
         "URL": { 
@@ -5826,15 +6051,21 @@ var Dom = YAHOO.util.Dom,
             value: false, 
             validator: Lang.isBoolean, 
             suppressEvent: true, 
-            supercedes: ["text"]
+            supercedes: ["disabled", "selected"]
         }, 
+
+        "SUBMENU": { 
+            key: "submenu",
+            suppressEvent: true,
+            supercedes: ["disabled", "selected"]
+        },
     
         "DISABLED": { 
             key: "disabled", 
             value: false, 
             validator: Lang.isBoolean, 
             suppressEvent: true,
-            supercedes: ["text"]
+            supercedes: ["text", "selected"]
         },
     
         "SELECTED": { 
@@ -5844,19 +6075,16 @@ var Dom = YAHOO.util.Dom,
             suppressEvent: true
         },
     
-        "SUBMENU": { 
-            key: "submenu",
-            supercedes: ["text"]
-        },
-    
         "ONCLICK": { 
-            key: "onclick"
+            key: "onclick",
+            suppressEvent: true
         },
     
         "CLASS_NAME": { 
             key: "classname", 
             value: null, 
-            validator: Lang.isString
+            validator: Lang.isString,
+            suppressEvent: true
         }
     
     };
@@ -5864,66 +6092,6 @@ var Dom = YAHOO.util.Dom,
 
 MenuItem.prototype = {
 
-    // Constants
-
-    /**
-    * @property COLLAPSED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the <code>&#60;em&#62;</code>
-    * element used for the submenu arrow indicator.
-    * @default "Submenu collapsed.  Click to expand submenu."
-    * @final
-    * @type String
-    */
-    COLLAPSED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu collapsed.  Click to expand submenu.",
-
-
-    /**
-    * @property EXPANDED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the submenu is visible.
-    * @default "Submenu expanded.  Click to collapse submenu."
-    * @final
-    * @type String
-    */
-    EXPANDED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu expanded.  Click to collapse submenu.",
-
-
-    /**
-    * @property DISABLED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the menu item is disabled.
-    * @default "Submenu collapsed.  (Item disabled.)."
-    * @final
-    * @type String
-    */
-    DISABLED_SUBMENU_INDICATOR_TEXT: "Submenu collapsed.  (Item disabled.)",
-
-
-    /**
-    * @property CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>).
-    * @default "Checked."
-    * @final
-    * @type String
-    */
-    CHECKED_TEXT: "Menu item checked.",
-    
-    
-    /**
-    * @property DISABLED_CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>) when the menu item 
-    * is disabled.
-    * @default "Checked. (Item disabled.)"
-    * @final
-    * @type String
-    */
-    DISABLED_CHECKED_TEXT: "Checked. (Item disabled.)",
-
-
     /**
     * @property CSS_CLASS_NAME
     * @description String representing the CSS class(es) to be applied to the 
@@ -5992,18 +6160,6 @@ MenuItem.prototype = {
     * @type YAHOO.widget.Menu
     */
     _oSubmenu: null,
-    
-
-    /**
-    * @property _oCheckedIndicator
-    * @description Object reference to the menu item's checkmark image.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @private
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    _oCheckedIndicator: null,
 
 
     /** 
@@ -6109,18 +6265,6 @@ MenuItem.prototype = {
     value: null,
 
 
-    /**
-    * @property submenuIndicator
-    * @description Object reference to the <code>&#60;em&#62;</code> element 
-    * used to create the submenu indicator for the menu item.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    submenuIndicator: null,
-
-
        /**
     * @property browser
     * @deprecated Use YAHOO.env.ua
@@ -6263,10 +6407,10 @@ MenuItem.prototype = {
     * configuration for the menu item. See configuration class documentation 
     * for more details.
     */
-    init: function(p_oObject, p_oConfig) {
+    init: function (p_oObject, p_oConfig) {
 
 
-        if(!this.SUBMENU_TYPE) {
+        if (!this.SUBMENU_TYPE) {
     
             this.SUBMENU_TYPE = Menu;
     
@@ -6288,14 +6432,14 @@ MenuItem.prototype = {
             sId;
 
 
-        if(Lang.isString(p_oObject)) {
+        if (Lang.isString(p_oObject)) {
 
             this._createRootNodeStructure();
 
             oConfig.queueProperty("text", p_oObject);
 
         }
-        else if(p_oObject && p_oObject.tagName) {
+        else if (p_oObject && p_oObject.tagName) {
 
             switch(p_oObject.tagName.toUpperCase()) {
 
@@ -6304,6 +6448,9 @@ MenuItem.prototype = {
                     this._createRootNodeStructure();
 
                     oConfig.queueProperty("text", p_oObject.text);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
+
+                    this.value = p_oObject.value;
 
                     this.srcElement = p_oObject;
 
@@ -6314,6 +6461,7 @@ MenuItem.prototype = {
                     this._createRootNodeStructure();
 
                     oConfig.queueProperty("text", p_oObject.label);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
 
                     this.srcElement = p_oObject;
 
@@ -6330,10 +6478,11 @@ MenuItem.prototype = {
 
                     // Capture the "text" and/or the "URL"
 
-                    if(oAnchor) {
+                    if (oAnchor) {
 
                         sURL = oAnchor.getAttribute("href");
                         sTarget = oAnchor.getAttribute("target");
+
                         sText = oAnchor.innerHTML;
 
                     }
@@ -6361,11 +6510,11 @@ MenuItem.prototype = {
         }
 
 
-        if(this.element) {
+        if (this.element) {
 
-            sId = this.element.id;
+            sId = (this.srcElement || this.element).id;
 
-            if(!sId) {
+            if (!sId) {
 
                 sId = this.id || Dom.generateId();
 
@@ -6415,7 +6564,7 @@ MenuItem.prototype = {
             this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY);
             this.destroyEvent.signature = SIGNATURE;
 
-            if(p_oConfig) {
+            if (p_oConfig) {
     
                 oConfig.applyConfig(p_oConfig);
     
@@ -6442,7 +6591,7 @@ MenuItem.prototype = {
         var oElement,
             oAnchor;
 
-        if(!m_oMenuItemTemplate) {
+        if (!m_oMenuItemTemplate) {
 
             m_oMenuItemTemplate = document.createElement("li");
             m_oMenuItemTemplate.innerHTML = "<a href=\"#\"></a>";
@@ -6467,7 +6616,7 @@ MenuItem.prototype = {
     * the child nodes to instantiate other menus.
     * @private
     */
-    _initSubTree: function() {
+    _initSubTree: function () {
 
         var oSrcEl = this.srcElement,
             oConfig = this.cfg,
@@ -6478,9 +6627,9 @@ MenuItem.prototype = {
             n;
 
 
-        if(oSrcEl.childNodes.length > 0) {
+        if (oSrcEl.childNodes.length > 0) {
 
-            if(this.parent.lazyLoad && this.parent.srcElement && 
+            if (this.parent.lazyLoad && this.parent.srcElement && 
                 this.parent.srcElement.tagName.toUpperCase() == "SELECT") {
 
                 oConfig.setProperty(
@@ -6496,7 +6645,7 @@ MenuItem.prototype = {
     
                 do {
     
-                    if(oNode && oNode.tagName) {
+                    if (oNode && oNode.tagName) {
     
                         switch(oNode.tagName.toUpperCase()) {
                 
@@ -6522,7 +6671,7 @@ MenuItem.prototype = {
     
                 nOptions = aOptions.length;
     
-                if(nOptions > 0) {
+                if (nOptions > 0) {
     
                     oMenu = new this.SUBMENU_TYPE(Dom.generateId());
                     
@@ -6557,16 +6706,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configText: function(p_sType, p_aArgs, p_oItem) {
+    configText: function (p_sType, p_aArgs, p_oItem) {
 
         var sText = p_aArgs[0],
             oConfig = this.cfg,
             oAnchor = this._oAnchor,
             sHelpText = oConfig.getProperty("helptext"),
             sHelpTextHTML = "",
-            sCheckHTML = "",
-            oSubmenu = oConfig.getProperty("submenu"),
-            sSubmenuIndicatorHTML = "",
             sEmphasisStartTag = "",
             sEmphasisEndTag = "";
 
@@ -6581,25 +6727,6 @@ MenuItem.prototype = {
             }
 
 
-            if (oConfig.getProperty("checked")) {
-
-                sCheckHTML = "<em class=\"checkedindicator\">" + 
-                    this.CHECKED_TEXT + "</em>";
-            
-            }
-            
-            
-            if (oSubmenu) {
-
-                sSubmenuIndicatorHTML =  "<em class=\"submenuindicator\">" + 
-                    ((oSubmenu instanceof Menu && 
-                    oSubmenu.cfg.getProperty("visible")) ? 
-                    this.EXPANDED_SUBMENU_INDICATOR_TEXT : 
-                    this.COLLAPSED_SUBMENU_INDICATOR_TEXT) + "</em>";
-            
-            }
-            
-
             if (oConfig.getProperty("emphasis")) {
 
                 sEmphasisStartTag = "<em>";
@@ -6617,15 +6744,7 @@ MenuItem.prototype = {
 
 
             oAnchor.innerHTML = (sEmphasisStartTag + sText + 
-                sEmphasisEndTag + sHelpTextHTML + 
-                sCheckHTML + sSubmenuIndicatorHTML);
-
-
-            if (oSubmenu) {
-
-                this.submenuIndicator = oAnchor.lastChild;
-            
-            }
+                sEmphasisEndTag + sHelpTextHTML);
 
         }
 
@@ -6642,21 +6761,7 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configHelpText: function(p_sType, p_aArgs, p_oItem) {
-
-        var sHelpText = p_aArgs[0],
-            oAnchor = this._oAnchor;
-
-        if (sHelpText) {
-
-            Dom.addClass(oAnchor, "hashelptext");
-
-        }
-        else {
-
-            Dom.removeClass(oAnchor, "hashelptext");
-        
-        }
+    configHelpText: function (p_sType, p_aArgs, p_oItem) {
 
         this.cfg.refireEvent("text");
 
@@ -6673,17 +6778,25 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configURL: function(p_sType, p_aArgs, p_oItem) {
+    configURL: function (p_sType, p_aArgs, p_oItem) {
 
         var sURL = p_aArgs[0];
 
-        if(!sURL) {
+        if (!sURL) {
 
             sURL = "#";
 
         }
 
-        this._oAnchor.setAttribute("href", sURL);
+        var oAnchor = this._oAnchor;
+
+        if (YAHOO.env.ua.opera) {
+
+            oAnchor.removeAttribute("href");
+        
+        }
+
+        oAnchor.setAttribute("href", sURL);
 
     },
 
@@ -6698,12 +6811,12 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configTarget: function(p_sType, p_aArgs, p_oItem) {
+    configTarget: function (p_sType, p_aArgs, p_oItem) {
 
         var sTarget = p_aArgs[0],
             oAnchor = this._oAnchor;
 
-        if(sTarget && sTarget.length > 0) {
+        if (sTarget && sTarget.length > 0) {
 
             oAnchor.setAttribute("target", sTarget);
 
@@ -6727,13 +6840,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
         var bEmphasis = p_aArgs[0],
             oConfig = this.cfg;
 
 
-        if(bEmphasis && oConfig.getProperty("strongemphasis")) {
+        if (bEmphasis && oConfig.getProperty("strongemphasis")) {
 
             oConfig.setProperty("strongemphasis", false);
 
@@ -6755,13 +6868,13 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configStrongEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
         var bStrongEmphasis = p_aArgs[0],
             oConfig = this.cfg;
 
 
-        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {
+        if (bStrongEmphasis && oConfig.getProperty("emphasis")) {
 
             oConfig.setProperty("emphasis", false);
 
@@ -6773,8 +6886,146 @@ MenuItem.prototype = {
 
 
     /**
-    * @method configChecked
-    * @description Event handler for when the "checked" configuration property 
+    * @method configChecked
+    * @description Event handler for when the "checked" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configChecked: function (p_sType, p_aArgs, p_oItem) {
+
+        var bChecked = p_aArgs[0],
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            oConfig = this.cfg,
+            sState = "-checked",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState;
+
+
+        if (bChecked) {
+
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+        
+        }
+
+
+        oConfig.refireEvent("text");
+
+
+        if (oConfig.getProperty("disabled")) {
+
+            oConfig.refireEvent("disabled");
+
+        }
+
+
+        if (oConfig.getProperty("selected")) {
+
+            oConfig.refireEvent("selected");
+
+        }
+
+    },
+
+
+
+    /**
+    * @method configDisabled
+    * @description Event handler for when the "disabled" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configDisabled: function (p_sType, p_aArgs, p_oItem) {
+
+        var bDisabled = p_aArgs[0],
+            oConfig = this.cfg,
+            oSubmenu = oConfig.getProperty("submenu"),
+            bChecked = oConfig.getProperty("checked"),
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            sState = "-disabled",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
+
+
+        if (bDisabled) {
+
+            if (oConfig.getProperty("selected")) {
+
+                oConfig.setProperty("selected", false);
+
+            }
+
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
+
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
+            
+
+            if (bChecked) {
+
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
+
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
+
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
+            
+
+            if (bChecked) {
+
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
+
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configSelected
+    * @description Event handler for when the "selected" configuration property 
     * of the menu item changes. 
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
@@ -6782,103 +7033,116 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configChecked: function(p_sType, p_aArgs, p_oItem) {
-
-        var bChecked = p_aArgs[0],
-            oAnchor = this._oAnchor;
+    configSelected: function (p_sType, p_aArgs, p_oItem) {
 
-        if (bChecked) {
+        var oConfig = this.cfg,
+            bSelected = p_aArgs[0],
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            bChecked = oConfig.getProperty("checked"),
+            oSubmenu = oConfig.getProperty("submenu"),
+            sState = "-selected",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
 
-            Dom.addClass(oAnchor, "checked");
 
-        }
-        else {
+        if (YAHOO.env.ua.opera) {
 
-            Dom.removeClass(oAnchor, "checked");
+            oAnchor.blur();
         
         }
 
-        this.cfg.refireEvent("text");
 
-    },
+        if (bSelected && !oConfig.getProperty("disabled")) {
 
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
 
 
-    /**
-    * @method configDisabled
-    * @description Event handler for when the "disabled" configuration property 
-    * of the menu item changes. 
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configDisabled: function(p_sType, p_aArgs, p_oItem) {
+            if (oSubmenu) {
 
-        var bDisabled = p_aArgs[0],
-            oConfig = this.cfg,
-            oAnchor = this._oAnchor;
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
 
 
-        if(bDisabled) {
+            if (bChecked) {
 
-            if(oConfig.getProperty("selected")) {
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
 
-                oConfig.setProperty("selected", false);
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
 
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
             }
 
-            oAnchor.removeAttribute("href");
+        
+            if (bChecked) {
 
-            Dom.addClass(oAnchor, "disabled");
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
 
-        }
-        else {
+            }
 
-            oAnchor.setAttribute("href", oConfig.getProperty("url"));
+        }
 
-            Dom.removeClass(oAnchor, "disabled");
 
+        if (this.hasFocus() && YAHOO.env.ua.opera) {
+        
+            oAnchor.focus();
+        
         }
 
     },
 
 
     /**
-    * @method configSelected
-    * @description Event handler for when the "selected" configuration property 
-    * of the menu item changes. 
+    * @method _onSubmenuBeforeHide
+    * @description "beforehide" Custom Event handler for a submenu.
+    * @private
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
     * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configSelected: function(p_sType, p_aArgs, p_oItem) {
+    */
+    _onSubmenuBeforeHide: function (p_sType, p_aArgs) {
 
-        var bSelected,
-            oAnchor;
+        var oItem = this.parent,
+            oMenu;
 
-        if(!this.cfg.getProperty("disabled")) {
+        function onHide() {
 
-            bSelected = p_aArgs[0];
-            oAnchor = this._oAnchor;
+            oItem._oAnchor.blur();
+            oMenu.beforeHideEvent.unsubscribe(onHide);
+        
+        }
 
 
-            if(bSelected) {
-    
-                Dom.addClass(oAnchor, "selected");
-    
-            }
-            else {
-    
-                Dom.removeClass(oAnchor, "selected");
-    
-            }
+        if (oItem.hasFocus()) {
 
-        }
+            oMenu = oItem.parent;
 
+            oMenu.beforeHideEvent.subscribe(onHide);
+        
+        }
+    
     },
 
 
@@ -6892,28 +7156,31 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configSubmenu: function(p_sType, p_aArgs, p_oItem) {
+    configSubmenu: function (p_sType, p_aArgs, p_oItem) {
 
-        var oAnchor = this._oAnchor,
-            oSubmenu = p_aArgs[0],
-            oSubmenuIndicator = this.submenuIndicator,
+        var oSubmenu = p_aArgs[0],
             oConfig = this.cfg,
+            oElement = this.element,
+            oAnchor = this._oAnchor,
             bLazyLoad = this.parent && this.parent.lazyLoad,
+            sState = "-hassubmenu",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
             oMenu,
             sSubmenuId,
             oSubmenuConfig;
 
 
-        if(oSubmenu) {
+        if (oSubmenu) {
 
-            if(oSubmenu instanceof Menu) {
+            if (oSubmenu instanceof Menu) {
 
                 oMenu = oSubmenu;
                 oMenu.parent = this;
                 oMenu.lazyLoad = bLazyLoad;
 
             }
-            else if(typeof oSubmenu == "object" && oSubmenu.id && 
+            else if (typeof oSubmenu == "object" && oSubmenu.id && 
                 !oSubmenu.nodeType) {
 
                 sSubmenuId = oSubmenu.id;
@@ -6927,7 +7194,7 @@ MenuItem.prototype = {
 
                 // Set the value of the property to the Menu instance
 
-                this.cfg.setProperty("submenu", oMenu, true);
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
             else {
@@ -6938,39 +7205,53 @@ MenuItem.prototype = {
 
                 // Set the value of the property to the Menu instance
                 
-                this.cfg.setProperty("submenu", oMenu, true);
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
 
 
-            if(oMenu) {
+            if (oMenu) {
 
-                Dom.addClass(oAnchor, "hassubmenu");
+                Dom.addClass(oElement, sClassName);
+                Dom.addClass(oAnchor, sLabelClassName);
 
                 this._oSubmenu = oMenu;
+
+                if (YAHOO.env.ua.opera) {
+                
+                    oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);               
+                
+                }
             
             }
 
         }
         else {
 
-            Dom.removeClass(oAnchor, "hassubmenu");
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
 
-            if(oSubmenuIndicator) {
+            if (this._oSubmenu) {
 
-                oAnchor.removeChild(oSubmenuIndicator);
+                this._oSubmenu.destroy();
 
             }
 
-            if(this._oSubmenu) {
+        }
 
-                this._oSubmenu.destroy();
 
-            }
+        if (oConfig.getProperty("disabled")) {
+
+            oConfig.refireEvent("disabled");
+
+        }
+
+
+        if (oConfig.getProperty("selected")) {
+
+            oConfig.refireEvent("selected");
 
         }
-        
-        oConfig.refireEvent("text");
 
     },
 
@@ -6985,7 +7266,7 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configOnClick: function(p_sType, p_aArgs, p_oItem) {
+    configOnClick: function (p_sType, p_aArgs, p_oItem) {
 
         var oObject = p_aArgs[0];
 
@@ -6994,7 +7275,7 @@ MenuItem.prototype = {
             already been specified.
         */
 
-        if(this._oOnclickAttributeValue && 
+        if (this._oOnclickAttributeValue && 
             (this._oOnclickAttributeValue != oObject)) {
 
             this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, 
@@ -7005,7 +7286,7 @@ MenuItem.prototype = {
         }
 
 
-        if(!this._oOnclickAttributeValue && typeof oObject == "object" && 
+        if (!this._oOnclickAttributeValue && typeof oObject == "object" && 
             typeof oObject.fn == "function") {
             
             this.clickEvent.subscribe(oObject.fn, 
@@ -7029,11 +7310,11 @@ MenuItem.prototype = {
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configClassName: function(p_sType, p_aArgs, p_oItem) {
+    configClassName: function (p_sType, p_aArgs, p_oItem) {
     
         var sClassName = p_aArgs[0];
     
-        if(this._sClassName) {
+        if (this._sClassName) {
     
             Dom.removeClass(this.element, this._sClassName);
     
@@ -7053,7 +7334,7 @@ MenuItem.prototype = {
     * @method initDefaultConfig
        * @description Initializes an item's configurable properties.
        */
-       initDefaultConfig : function() {
+       initDefaultConfig : function () {
 
         var oConfig = this.cfg;
 
@@ -7085,7 +7366,7 @@ MenuItem.prototype = {
         * accompany the text for the menu item.
         * @deprecated Use "text" configuration property to add help text markup.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "Copy &#60;em 
-        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#60;");</code>
+        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#62;");</code>
         * @default null
         * @type String|<a href="http://www.w3.org/TR/
         * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
@@ -7093,7 +7374,11 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.HELP_TEXT.key,
-            { handler: this.configHelpText }
+            {
+                handler: this.configHelpText, 
+                supercedes: DEFAULT_CONFIG.HELP_TEXT.supercedes,
+                suppressEvent: DEFAULT_CONFIG.HELP_TEXT.suppressEvent 
+            }
         );
 
 
@@ -7141,7 +7426,7 @@ MenuItem.prototype = {
         * rendered with emphasis.
         * @deprecated Use "text" configuration property to add emphasis.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;em&#62;Some 
-        * Text&#60;/em&#60;");</code>
+        * Text&#60;/em&#62;");</code>
         * @default false
         * @type Boolean
         */
@@ -7151,7 +7436,8 @@ MenuItem.prototype = {
                 handler: this.configEmphasis, 
                 value: DEFAULT_CONFIG.EMPHASIS.value, 
                 validator: DEFAULT_CONFIG.EMPHASIS.validator, 
-                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent 
+                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.EMPHASIS.supercedes
             }
         );
 
@@ -7162,7 +7448,7 @@ MenuItem.prototype = {
         * rendered with strong emphasis.
         * @deprecated Use "text" configuration property to add strong emphasis.  
         * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;strong&#62; 
-        * Some Text&#60;/strong&#60;");</code>
+        * Some Text&#60;/strong&#62;");</code>
         * @default false
         * @type Boolean
         */
@@ -7172,7 +7458,8 @@ MenuItem.prototype = {
                 handler: this.configStrongEmphasis,
                 value: DEFAULT_CONFIG.STRONG_EMPHASIS.value,
                 validator: DEFAULT_CONFIG.STRONG_EMPHASIS.validator,
-                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent
+                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.STRONG_EMPHASIS.supercedes
             }
         );
 
@@ -7251,7 +7538,11 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.SUBMENU.key, 
-            { handler: this.configSubmenu }
+            {
+                handler: this.configSubmenu, 
+                supercedes: DEFAULT_CONFIG.SUBMENU.supercedes,
+                suppressEvent: DEFAULT_CONFIG.SUBMENU.suppressEvent
+            }
         );
 
 
@@ -7269,7 +7560,10 @@ MenuItem.prototype = {
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.ONCLICK.key, 
-            { handler: this.configOnClick }
+            {
+                handler: this.configOnClick, 
+                suppressEvent: DEFAULT_CONFIG.ONCLICK.suppressEvent 
+            }
         );
 
 
@@ -7287,7 +7581,8 @@ MenuItem.prototype = {
             { 
                 handler: this.configClassName,
                 value: DEFAULT_CONFIG.CLASS_NAME.value, 
-                validator: DEFAULT_CONFIG.CLASS_NAME.validator
+                validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+                suppressEvent: DEFAULT_CONFIG.CLASS_NAME.suppressEvent 
             }
         );
 
@@ -7299,7 +7594,7 @@ MenuItem.prototype = {
     * @description Finds the menu item's next enabled sibling.
     * @return YAHOO.widget.MenuItem
     */
-    getNextEnabledSibling: function() {
+    getNextEnabledSibling: function () {
 
         var nGroupIndex,
             aItemGroups,
@@ -7314,13 +7609,13 @@ MenuItem.prototype = {
 
         }
 
-        if(this.parent instanceof Menu) {
+        if (this.parent instanceof Menu) {
 
             nGroupIndex = this.groupIndex;
     
             aItemGroups = this.parent.getItemGroups();
     
-            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {
+            if (this.index < (aItemGroups[nGroupIndex].length - 1)) {
     
                 oNextItem = getNextArrayItem(aItemGroups[nGroupIndex], 
                         (this.index+1));
@@ -7328,7 +7623,7 @@ MenuItem.prototype = {
             }
             else {
     
-                if(nGroupIndex < (aItemGroups.length - 1)) {
+                if (nGroupIndex < (aItemGroups.length - 1)) {
     
                     nNextGroupIndex = nGroupIndex + 1;
     
@@ -7361,7 +7656,7 @@ MenuItem.prototype = {
     * @description Finds the menu item's previous enabled sibling.
     * @return {YAHOO.widget.MenuItem}
     */
-    getPreviousEnabledSibling: function() {
+    getPreviousEnabledSibling: function () {
 
         var nGroupIndex,
             aItemGroups,
@@ -7383,13 +7678,13 @@ MenuItem.prototype = {
 
         }
 
-       if(this.parent instanceof Menu) {
+       if (this.parent instanceof Menu) {
 
             nGroupIndex = this.groupIndex;
             aItemGroups = this.parent.getItemGroups();
 
     
-            if(this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
+            if (this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
     
                 oPreviousItem = getPreviousArrayItem(aItemGroups[nGroupIndex], 
                         (this.index-1));
@@ -7397,7 +7692,7 @@ MenuItem.prototype = {
             }
             else {
     
-                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
+                if (nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
     
                     nPreviousGroupIndex = nGroupIndex - 1;
     
@@ -7430,7 +7725,7 @@ MenuItem.prototype = {
     * @description Causes the menu item to receive the focus and fires the 
     * focus event.
     */
-    focus: function() {
+    focus: function () {
 
         var oParent = this.parent,
             oAnchor = this._oAnchor,
@@ -7448,7 +7743,15 @@ MenuItem.prototype = {
                 
                 }
 
+                if (oActiveItem) {
+    
+                    oActiveItem.blurEvent.fire();
+    
+                }
+
                 oAnchor.focus();
+                
+                me.focusEvent.fire();
 
             }
             catch(e) {
@@ -7458,16 +7761,10 @@ MenuItem.prototype = {
         }
 
 
-        if(!this.cfg.getProperty("disabled") && oParent && 
+        if (!this.cfg.getProperty("disabled") && oParent && 
             oParent.cfg.getProperty("visible") && 
             this.element.style.display != "none") {
 
-            if(oActiveItem) {
-
-                oActiveItem.blur();
-
-            }
-
 
             /*
                 Setting focus via a timer fixes a race condition in Firefox, IE 
@@ -7476,8 +7773,6 @@ MenuItem.prototype = {
             */
 
             window.setTimeout(setFocus, 0);
-            
-            this.focusEvent.fire();
 
         }
 
@@ -7489,16 +7784,29 @@ MenuItem.prototype = {
     * @description Causes the menu item to lose focus and fires the 
     * blur event.
     */    
-    blur: function() {
+    blur: function () {
 
         var oParent = this.parent;
 
-        if(!this.cfg.getProperty("disabled") && oParent && 
+        if (!this.cfg.getProperty("disabled") && oParent && 
             oParent.cfg.getProperty("visible")) {
 
-            this._oAnchor.blur();
 
-            this.blurEvent.fire();
+            var me = this;
+            
+            window.setTimeout(function () {
+
+                try {
+    
+                    me._oAnchor.blur();
+                    me.blurEvent.fire();    
+
+                } 
+                catch (e) {
+                
+                }
+                
+            }, 0);
 
         }
 
@@ -7511,7 +7819,7 @@ MenuItem.prototype = {
     * has focus.
     * @return {Boolean}
     */
-    hasFocus: function() {
+    hasFocus: function () {
     
         return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this);
     
@@ -7523,20 +7831,20 @@ MenuItem.prototype = {
        * @description Removes the menu item's <code>&#60;li&#62;</code> element 
        * from its parent <code>&#60;ul&#62;</code> element.
        */
-    destroy: function() {
+    destroy: function () {
 
         var oEl = this.element,
             oSubmenu,
             oParentNode;
 
-        if(oEl) {
+        if (oEl) {
 
 
             // If the item has a submenu, destroy it first
 
             oSubmenu = this.cfg.getProperty("submenu");
 
-            if(oSubmenu) {
+            if (oSubmenu) {
             
                 oSubmenu.destroy();
             
@@ -7562,7 +7870,7 @@ MenuItem.prototype = {
 
             oParentNode = oEl.parentNode;
 
-            if(oParentNode) {
+            if (oParentNode) {
 
                 oParentNode.removeChild(oEl);
 
@@ -7582,12 +7890,12 @@ MenuItem.prototype = {
     * @description Returns a string representing the menu item.
     * @return {String}
     */
-    toString: function() {
+    toString: function () {
 
         var sReturnVal = "MenuItem",
             sId = this.id;
 
-        if(sId) {
+        if (sId) {
     
             sReturnVal += (" " + sId);
         
@@ -7636,16 +7944,19 @@ YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {
 
 };
 
+
 var Event = YAHOO.util.Event,
     ContextMenu = YAHOO.widget.ContextMenu,
 
-/**
-* Constant representing the name of the ContextMenu's events
-* @property EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
+
+
+    /**
+    * Constant representing the name of the ContextMenu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
     EVENT_TYPES = {
 
         "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
@@ -7665,12 +7976,31 @@ var Event = YAHOO.util.Event,
     DEFAULT_CONFIG = {
     
         "TRIGGER": { 
-            key: "trigger" 
+            key: "trigger",
+            suppressEvent: true
         }
     
     };
 
 
+/**
+* @method position
+* @description "beforeShow" event handler used to position the contextmenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {Array} p_aPos Array representing the xy position for the context menu.
+*/
+function position(p_sType, p_aArgs, p_aPos) {
+
+    this.cfg.setProperty("xy", p_aPos);
+    
+    this.beforeShowEvent.unsubscribe(position, p_aPos);
+
+}
+
+
 YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, {
 
 
@@ -7754,12 +8084,6 @@ triggerContextMenuEvent: null,
 */
 init: function(p_oElement, p_oConfig) {
 
-    if(!this.ITEM_TYPE) {
-
-        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;
-
-    }
-
 
     // Call the init of the superclass (YAHOO.widget.Menu)
 
@@ -7849,6 +8173,7 @@ _removeEventHandlers: function() {
 // Private event handlers
 
 
+
 /**
 * @method _onTriggerClick
 * @description "click" event handler for the HTML element(s) identified as the 
@@ -7882,13 +8207,16 @@ _onTriggerClick: function(p_oEvent, p_oMenu) {
 */
 _onTriggerContextMenu: function(p_oEvent, p_oMenu) {
 
-    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
+    if (p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
 
         return;
 
     }
 
 
+    var aXY;
+
+
     /*
         Prevent the browser's default context menu from appearing and 
         stop the propagation of the "contextmenu" event so that 
@@ -7898,21 +8226,35 @@ _onTriggerContextMenu: function(p_oEvent, p_oMenu) {
     Event.stopEvent(p_oEvent);
 
 
-    // Hide any other ContextMenu instances that might be visible
+    this.contextEventTarget = Event.getTarget(p_oEvent);
 
-    YAHOO.widget.MenuManager.hideVisible();
+    this.triggerContextMenuEvent.fire(p_oEvent);
 
 
-    this.contextEventTarget = Event.getTarget(p_oEvent);
+    // Hide any other Menu instances that might be visible
 
-    this.triggerContextMenuEvent.fire(p_oEvent);
+    YAHOO.widget.MenuManager.hideVisible();
+    
 
 
     if(!this._bCancelled) {
 
         // Position and display the context menu
-    
-        this.cfg.setProperty("xy", Event.getXY(p_oEvent));
+
+        aXY = Event.getXY(p_oEvent);
+
+
+        if (!YAHOO.util.Dom.inDocument(this.element)) {
+
+            this.beforeShowEvent.subscribe(position, aXY);
+
+        }
+        else {
+
+            this.cfg.setProperty("xy", aXY);
+        
+        }
+
 
         this.show();
 
@@ -7968,7 +8310,11 @@ initDefaultConfig: function() {
     * level-one-html.html#ID-58190037">HTMLElement</a>|Array
     */
     this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key, 
-        { handler: this.configTrigger });
+        {
+            handler: this.configTrigger, 
+            suppressEvent: DEFAULT_CONFIG.TRIGGER.suppressEvent 
+        }
+    );
 
 },
 
@@ -7983,7 +8329,7 @@ destroy: function() {
     // Remove the DOM event handlers from the current trigger(s)
 
     this._removeEventHandlers();
-    
+
 
     // Continue with the superclass implementation of this method
 
@@ -8082,93 +8428,10 @@ configTrigger: function(p_sType, p_aArgs, p_oMenu) {
 * @class ContextMenuItem
 * @constructor
 * @extends YAHOO.widget.MenuItem
+* @deprecated As of version 2.4.0 items for YAHOO.widget.ContextMenu instances
+* are of type YAHOO.widget.MenuItem.
 */
-YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {
-
-    YAHOO.widget.ContextMenuItem.superclass.constructor.call(this, 
-        p_oObject, p_oConfig);
-
-};
-
-YAHOO.lang.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {
-
-
-/**
-* @method init
-* @description The ContextMenuItem class's initialization method. This method 
-* is automatically called by the constructor, and sets up all DOM references 
-* for pre-existing markup, and creates required markup if it is not 
-* already present.
-* @param {String} p_oObject String specifying the text of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
-* <code>&#60;li&#62;</code> element of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
-* specifying the <code>&#60;optgroup&#62;</code> element of the context 
-* menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
-* the <code>&#60;option&#62;</code> element of the context menu item.
-* @param {Object} p_oConfig Optional. Object literal specifying the 
-* configuration for the context menu item. See configuration class 
-* documentation for more details.
-*/
-init: function(p_oObject, p_oConfig) {
-    
-    if(!this.SUBMENU_TYPE) {
-
-        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;
-
-    }
-
-
-    /* 
-        Call the init of the superclass (YAHOO.widget.MenuItem)
-        Note: We don't pass the user config in here yet 
-        because we only want it executed once, at the lowest 
-        subclass level.
-    */ 
-
-    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);
-
-    var oConfig = this.cfg;
-
-    if(p_oConfig) {
-
-        oConfig.applyConfig(p_oConfig, true);
-
-    }
-
-    oConfig.fireQueue();
-
-},
-
-
-
-// Public methods
-
-
-/**
-* @method toString
-* @description Returns a string representing the context menu item.
-* @return {String}
-*/
-toString: function() {
-
-    var sReturnVal = "ContextMenuItem";
-
-    if(this.cfg && this.cfg.getProperty("text")) {
-
-        sReturnVal += (": " + this.cfg.getProperty("text"));
-
-    }
-
-    return sReturnVal;
-
-}
-    
-}); // END YAHOO.lang.extend
+YAHOO.widget.ContextMenuItem = YAHOO.widget.MenuItem;
 (function () {
 
 
@@ -8223,7 +8486,6 @@ function checkPosition(p_sPosition) {
 
 
 var Event = YAHOO.util.Event,
-    Dom = YAHOO.util.Dom,
     MenuBar = YAHOO.widget.MenuBar,
 
     /**
@@ -8244,13 +8506,15 @@ var Event = YAHOO.util.Event,
     
         "SUBMENU_ALIGNMENT": { 
             key: "submenualignment", 
-            value: ["tl","bl"] 
+            value: ["tl","bl"],
+            suppressEvent: true 
         },
     
         "AUTO_SUBMENU_DISPLAY": { 
             key: "autosubmenudisplay", 
             value: false, 
-            validator: YAHOO.lang.isBoolean 
+            validator: YAHOO.lang.isBoolean,
+            suppressEvent: true
         }
     
     };
@@ -8505,7 +8769,7 @@ _onClick: function(p_sType, p_aArgs, p_oMenuBar) {
         oSubmenu = oItem.cfg.getProperty("submenu");
 
 
-        if(oSubmenu && oTarget != oItem.submenuIndicator) {
+        if(oSubmenu) {
         
             if(oSubmenu.cfg.getProperty("visible")) {
             
@@ -8607,7 +8871,8 @@ initDefaultConfig: function() {
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         {
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -8628,7 +8893,8 @@ initDefaultConfig: function() {
           DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
           {
               value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+              suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -8772,4 +9038,4 @@ toString: function() {
 }
     
 }); // END YAHOO.lang.extend
-YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.3.0", build: "442"});
+YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/profiler/README b/lib/yui/profiler/README
new file mode 100644 (file)
index 0000000..a8ae6e8
--- /dev/null
@@ -0,0 +1,5 @@
+YUI Library - Profiler - Release Notes
+
+2.4.0
+
+  * Beta release
diff --git a/lib/yui/profiler/profiler-beta-debug.js b/lib/yui/profiler/profiler-beta-debug.js
new file mode 100644 (file)
index 0000000..7951563
--- /dev/null
@@ -0,0 +1,381 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+/**
+ * The YUI JavaScript profiler.
+ * @module profiler
+ * @namespace YAHOO.tool
+ * @requires yahoo
+ */
+
+/**
+ * Profiles functions in JavaScript.
+ * @namespace YAHOO.tool
+ * @class Profiler
+ * @static
+ */
+YAHOO.tool.Profiler = {
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+
+    /**
+     * Container object on which to put the original unprofiled methods.
+     * @type Object
+     * @private
+     * @static
+     * @property _container
+     */
+    _container : new Object(),
+
+    /**
+     * Call information for functions.
+     * @type Object
+     * @private
+     * @static
+     * @property _report
+     */
+    _report : new Object(),
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Called when a method ends execution. Marks the start and end time of the 
+     * method so it can calculate how long the function took to execute. Also 
+     * updates min/max/avg calculations for the function.
+     * @param {String} name The name of the function to mark as stopped.
+     * @param {int} duration The number of milliseconds it took the function to
+     *      execute.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _saveData : function (name /*:String*/, duration /*:int*/){
+        
+        //get the function data
+        var functionData /*:Object*/ = this._report[name];
+    
+        //increment the calls
+        functionData.calls++;
+        functionData.points.push(duration);
+
+        //if it's already been called at least once, do more complex calculations
+        if (functionData.calls > 1) {
+            functionData.avg = ((functionData.avg*(functionData.calls-1))+duration)/functionData.calls;
+            functionData.min = Math.min(functionData.min, duration);
+            functionData.max = Math.max(functionData.max, duration);
+        } else {
+            functionData.avg = duration;
+            functionData.min = duration;
+            functionData.max = duration;
+        }                             
+    
+    },
+
+    //-------------------------------------------------------------------------
+    // Reporting Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Returns the average amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The average time it takes the function to execute.
+     * @static
+     */
+    getAverage : function (name /*:String*/) /*:float*/ {
+        return this._report[name].avg;
+    },
+
+    /**
+     * Returns the number of times that the given function has been called.
+     * @param {String} name The name of the function whose data should be returned.
+     * @return {int} The number of times the function was called.
+     * @static
+     */
+    getCallCount : function (name /*:String*/) /*:int*/ {
+        return this._report[name].calls;    
+    },
+    
+    /**
+     * Returns the maximum amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The maximum time it takes the function to execute.
+     */
+    getMax : function (name /*:String*/) /*:int*/ {
+        return this._report[name].max;
+    },
+    
+    /**
+     * Returns the minimum amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The minimum time it takes the function to execute.
+     */
+    getMin : function (name /*:String*/) /*:int*/ {
+        return this._report[name].min;
+    },
+
+    /**
+     * Returns an object containing profiling data for a single function.
+     * The object has an entry for min, max, avg, calls, and points).
+     * @return {Object} An object containing profile data for a given function.
+     * @static
+     */
+    getFunctionReport : function (name /*:String*/) /*:Object*/ {
+        return this._report[name];
+    },
+
+    /**
+     * Returns an object containing profiling data for all of the functions 
+     * that were profiled. The object has an entry for each function and 
+     * returns all information (min, max, average, calls, etc.) for each
+     * function.
+     * @return {Object} An object containing all profile data.
+     * @static
+     */
+    getFullReport : function (filter /*:Function*/) /*:Object*/ {
+        filter = filter || function(){return true;};
+    
+        if (YAHOO.lang.isFunction(filter)) {
+            var report = {};
+            
+            for (var name in this._report){
+                if (filter(this._report[name])){
+                    report[name] = this._report[name];    
+                }
+            }
+            
+            return report;
+        }
+    },
+
+    //-------------------------------------------------------------------------
+    // Profiling Methods
+    //-------------------------------------------------------------------------   
+    
+    /**
+     * Sets up a constructor for profiling, including all properties and methods on the prototype.
+     * @param {string} name The fully-qualified name of the function including namespace information.
+     * @param {Object} owner (Optional) The object that owns the function (namespace or containing object).
+     * @return {Void}
+     * @static
+     */
+    registerConstructor : function (name /*:String*/, owner /*:Object*/) /*:Void*/ {    
+        this.registerFunction(name, owner, true);
+    },
+
+    /**
+     * Sets up a function for profiling. It essentially overwrites the function with one
+     * that has instrumentation data. This method also creates an entry for the function
+     * in the profile report. The original function is stored on the _container object.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @param {Object} owner (Optional) The object that owns the function. If the function
+     *      isn't global then this argument is required. This could be the namespace that
+     *      the function belongs to, such as YAHOO.util.Dom, or the object on which it's
+     *      a method.
+     * @return {Void}
+     * @method registerFunction
+     */     
+    registerFunction : function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
+    
+        //figure out the function name without namespacing
+        var funcName /*:String*/ = (name.indexOf(".") > -1 ? name.substring(name.lastIndexOf(".")+1) : name);
+        if (!YAHOO.lang.isObject(owner)){
+            owner = eval(name.substring(0, name.lastIndexOf(".")));
+        }
+        
+        //get the method and prototype
+        var method /*:Function*/ = owner[funcName];
+        var prototype /*:Object*/ = method.prototype;
+        
+        //see if the method has already been registered
+        if (YAHOO.lang.isFunction(method) && !method.__yuiProfiled){
+            
+            //create a new slot for the original method
+            this._container[name] = method;
+            
+            //replace the function with the profiling one
+            owner[funcName] = function () {
+
+                var start = new Date();     
+                var retval = method.apply(this, arguments);
+                var stop = new Date();
+                
+                YAHOO.tool.Profiler._saveData(name, stop-start);
+                
+                return retval;                
+            
+            };
+            
+            //copy the function properties over
+            YAHOO.lang.augmentObject(owner[funcName], method);
+            owner[funcName].__yuiProfiled = true;
+            owner[funcName].prototype = prototype;
+            this._container[name].__yuiOwner = owner;
+            this._container[name].__yuiFuncName = funcName;        
+        
+            //register prototype if necessary
+            if (registerPrototype) {            
+                this.registerObject(name + ".prototype", prototype);          
+            }
+            
+            //store function information
+            this._report[name] = {
+                calls: 0,
+                max: 0,
+                min: 0,
+                avg: 0,
+                points: []
+            };        
+        }
+            
+        return method;
+    
+    },
+        
+    
+    /**
+     * Sets up an object for profiling. It takes the object and looks for functions.
+     * When a function is found, registerMethod() is called on it. If set to recrusive
+     * mode, it will also setup objects found inside of this object for profiling, 
+     * using the same methodology.
+     * @param {String} name The name of the object to profile (shows up in report).
+     * @param {Object} owner (Optional) The object represented by the name.
+     * @param {Boolean} recurse (Optional) Determines if subobject methods are also profiled.
+     * @return {Void}
+     * @static
+     */
+    registerObject : function (name /*:String*/, object /*:Object*/, recurse /*:Boolean*/) /*:Void*/{
+    
+        //get the object
+        object = (YAHOO.lang.isObject(object) ? object : eval(name));
+    
+        //save the object
+        this._container[name] = object;
+    
+        for (var prop in object) {
+            if (typeof object[prop] == "function"){
+                if (prop != "constructor" && prop != "superclass"){ //don't do constructor or superclass, it's recursive
+                    this.registerFunction(name + "." + prop, object);
+                }
+            } else if (typeof object[prop] == "object" && recurse){
+                this.registerObject(name + "." + prop, object[prop], recurse);
+            }
+        }
+    
+    },    
+    
+    /**
+     * Removes a constructor function from profiling. Reverses the registerConstructor() method.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @return {Void}
+     * @method unregisterFunction
+     */     
+    unregisterConstructor : function(name /*:String*/) /*:Void*/{
+            
+        //see if the method has been registered
+        if (YAHOO.lang.isFunction(this._container[name])){
+        
+            //get original data
+            //var owner /*:Object*/ = this._container[name].__yuiOwner;
+            //var funcName /*:String*/ = this._container[name].__yuiFuncName;
+            //delete this._container[name].__yuiOwner;
+            //delete this._container[name].__yuiFuncName;
+            
+            //replace instrumented function
+            //owner[funcName] = this._container[name];
+            //delete this._container[name];
+            this.unregisterFunction(name, true);
+       
+        }
+
+    
+    },
+    
+    /**
+     * Removes function from profiling. Reverses the registerFunction() method.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @return {Void}
+     * @method unregisterFunction
+     */     
+    unregisterFunction : function(name /*:String*/, unregisterPrototype /*:Boolean*/) /*:Void*/{
+            
+        //see if the method has been registered
+        if (YAHOO.lang.isFunction(this._container[name])){
+        
+            //check to see if you should unregister the prototype
+            if (unregisterPrototype){
+                this.unregisterObject(name + ".prototype", this._container[name].prototype);
+            }
+                
+            //get original data
+            var owner /*:Object*/ = this._container[name].__yuiOwner;
+            var funcName /*:String*/ = this._container[name].__yuiFuncName;
+            delete this._container[name].__yuiOwner;
+            delete this._container[name].__yuiFuncName;
+            
+            //replace instrumented function
+            owner[funcName] = this._container[name];
+            
+            //delete supporting information
+            delete this._container[name];
+            delete this._report[name];
+       
+        }
+            
+    
+    },
+    
+    /**
+     * Unregisters an object for profiling. It takes the object and looks for functions.
+     * When a function is found, unregisterMethod() is called on it. If set to recrusive
+     * mode, it will also unregister objects found inside of this object, 
+     * using the same methodology.
+     * @param {String} name The name of the object to unregister.
+     * @param {Boolean} recurse (Optional) Determines if subobject methods should also be
+     *      unregistered.
+     * @return {Void}
+     * @static
+     */
+    unregisterObject : function (name /*:String*/, recurse /*:Boolean*/) /*:Void*/{
+    
+        //get the object
+        if (YAHOO.lang.isObject(this._container[name])){            
+            object = this._container[name];    
+        
+            for (var prop in object) {
+                if (typeof object[prop] == "function"){
+                    this.unregisterFunction(name + "." + prop);
+                } else if (typeof object[prop] == "object" && recurse){
+                    this.unregisterObject(name + "." + prop, recurse);
+                }
+            }
+            
+            delete this._container[name];
+        }
+    
+    }
+         
+
+};
+
+YAHOO.register("profiler", YAHOO.tool.Profiler, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/profiler/profiler-beta-min.js b/lib/yui/profiler/profiler-beta-min.js
new file mode 100644 (file)
index 0000000..360b253
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");YAHOO.tool.Profiler={_container:new Object(),_report:new Object(),_saveData:function(B,C){var A=this._report[B];A.calls++;A.points.push(C);if(A.calls>1){A.avg=((A.avg*(A.calls-1))+C)/A.calls;A.min=Math.min(A.min,C);A.max=Math.max(A.max,C);}else{A.avg=C;A.min=C;A.max=C;}},getAverage:function(A){return this._report[A].avg;},getCallCount:function(A){return this._report[A].calls;},getMax:function(A){return this._report[A].max;},getMin:function(A){return this._report[A].min;},getFunctionReport:function(A){return this._report[A];},getFullReport:function(C){C=C||function(){return true;};if(YAHOO.lang.isFunction(C)){var A={};for(var B in this._report){if(C(this._report[B])){A[B]=this._report[B];}}return A;}},registerConstructor:function(B,A){this.registerFunction(B,A,true);},registerFunction:function(name,owner,registerPrototype){var funcName=(name.indexOf(".")>-1?name.substring(name.lastIndexOf(".")+1):name);if(!YAHOO.lang.isObject(owner)){owner=eval(name.substring(0,name.lastIndexOf(".")));}var method=owner[funcName];var prototype=method.prototype;if(YAHOO.lang.isFunction(method)&&!method.__yuiProfiled){this._container[name]=method;owner[funcName]=function(){var start=new Date();var retval=method.apply(this,arguments);var stop=new Date();YAHOO.tool.Profiler._saveData(name,stop-start);return retval;};YAHOO.lang.augmentObject(owner[funcName],method);owner[funcName].__yuiProfiled=true;owner[funcName].prototype=prototype;this._container[name].__yuiOwner=owner;this._container[name].__yuiFuncName=funcName;if(registerPrototype){this.registerObject(name+".prototype",prototype);}this._report[name]={calls:0,max:0,min:0,avg:0,points:[]};}return method;},registerObject:function(name,object,recurse){object=(YAHOO.lang.isObject(object)?object:eval(name));this._container[name]=object;for(var prop in object){if(typeof object[prop]=="function"){if(prop!="constructor"&&prop!="superclass"){this.registerFunction(name+"."+prop,object);}}else{if(typeof object[prop]=="object"&&recurse){this.registerObject(name+"."+prop,object[prop],recurse);}}}},unregisterConstructor:function(A){if(YAHOO.lang.isFunction(this._container[A])){this.unregisterFunction(A,true);}},unregisterFunction:function(B,C){if(YAHOO.lang.isFunction(this._container[B])){if(C){this.unregisterObject(B+".prototype",this._container[B].prototype);}var A=this._container[B].__yuiOwner;var D=this._container[B].__yuiFuncName;delete this._container[B].__yuiOwner;delete this._container[B].__yuiFuncName;A[D]=this._container[B];delete this._container[B];delete this._report[B];}},unregisterObject:function(A,B){if(YAHOO.lang.isObject(this._container[A])){object=this._container[A];for(var C in object){if(typeof object[C]=="function"){this.unregisterFunction(A+"."+C);}else{if(typeof object[C]=="object"&&B){this.unregisterObject(A+"."+C,B);}}}delete this._container[A];}}};YAHOO.register("profiler",YAHOO.tool.Profiler,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/profiler/profiler-beta.js b/lib/yui/profiler/profiler-beta.js
new file mode 100644 (file)
index 0000000..7951563
--- /dev/null
@@ -0,0 +1,381 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+/**
+ * The YUI JavaScript profiler.
+ * @module profiler
+ * @namespace YAHOO.tool
+ * @requires yahoo
+ */
+
+/**
+ * Profiles functions in JavaScript.
+ * @namespace YAHOO.tool
+ * @class Profiler
+ * @static
+ */
+YAHOO.tool.Profiler = {
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+
+    /**
+     * Container object on which to put the original unprofiled methods.
+     * @type Object
+     * @private
+     * @static
+     * @property _container
+     */
+    _container : new Object(),
+
+    /**
+     * Call information for functions.
+     * @type Object
+     * @private
+     * @static
+     * @property _report
+     */
+    _report : new Object(),
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Called when a method ends execution. Marks the start and end time of the 
+     * method so it can calculate how long the function took to execute. Also 
+     * updates min/max/avg calculations for the function.
+     * @param {String} name The name of the function to mark as stopped.
+     * @param {int} duration The number of milliseconds it took the function to
+     *      execute.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _saveData : function (name /*:String*/, duration /*:int*/){
+        
+        //get the function data
+        var functionData /*:Object*/ = this._report[name];
+    
+        //increment the calls
+        functionData.calls++;
+        functionData.points.push(duration);
+
+        //if it's already been called at least once, do more complex calculations
+        if (functionData.calls > 1) {
+            functionData.avg = ((functionData.avg*(functionData.calls-1))+duration)/functionData.calls;
+            functionData.min = Math.min(functionData.min, duration);
+            functionData.max = Math.max(functionData.max, duration);
+        } else {
+            functionData.avg = duration;
+            functionData.min = duration;
+            functionData.max = duration;
+        }                             
+    
+    },
+
+    //-------------------------------------------------------------------------
+    // Reporting Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Returns the average amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The average time it takes the function to execute.
+     * @static
+     */
+    getAverage : function (name /*:String*/) /*:float*/ {
+        return this._report[name].avg;
+    },
+
+    /**
+     * Returns the number of times that the given function has been called.
+     * @param {String} name The name of the function whose data should be returned.
+     * @return {int} The number of times the function was called.
+     * @static
+     */
+    getCallCount : function (name /*:String*/) /*:int*/ {
+        return this._report[name].calls;    
+    },
+    
+    /**
+     * Returns the maximum amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The maximum time it takes the function to execute.
+     */
+    getMax : function (name /*:String*/) /*:int*/ {
+        return this._report[name].max;
+    },
+    
+    /**
+     * Returns the minimum amount of time (in milliseconds) that the function
+     * with the given name takes to execute.
+     * @param {String} name The name of the function whose data should be returned.
+     *      If an object type method, it should be 'constructor.prototype.methodName';
+     *      a normal object method would just be 'object.methodName'.
+     * @return {float} The minimum time it takes the function to execute.
+     */
+    getMin : function (name /*:String*/) /*:int*/ {
+        return this._report[name].min;
+    },
+
+    /**
+     * Returns an object containing profiling data for a single function.
+     * The object has an entry for min, max, avg, calls, and points).
+     * @return {Object} An object containing profile data for a given function.
+     * @static
+     */
+    getFunctionReport : function (name /*:String*/) /*:Object*/ {
+        return this._report[name];
+    },
+
+    /**
+     * Returns an object containing profiling data for all of the functions 
+     * that were profiled. The object has an entry for each function and 
+     * returns all information (min, max, average, calls, etc.) for each
+     * function.
+     * @return {Object} An object containing all profile data.
+     * @static
+     */
+    getFullReport : function (filter /*:Function*/) /*:Object*/ {
+        filter = filter || function(){return true;};
+    
+        if (YAHOO.lang.isFunction(filter)) {
+            var report = {};
+            
+            for (var name in this._report){
+                if (filter(this._report[name])){
+                    report[name] = this._report[name];    
+                }
+            }
+            
+            return report;
+        }
+    },
+
+    //-------------------------------------------------------------------------
+    // Profiling Methods
+    //-------------------------------------------------------------------------   
+    
+    /**
+     * Sets up a constructor for profiling, including all properties and methods on the prototype.
+     * @param {string} name The fully-qualified name of the function including namespace information.
+     * @param {Object} owner (Optional) The object that owns the function (namespace or containing object).
+     * @return {Void}
+     * @static
+     */
+    registerConstructor : function (name /*:String*/, owner /*:Object*/) /*:Void*/ {    
+        this.registerFunction(name, owner, true);
+    },
+
+    /**
+     * Sets up a function for profiling. It essentially overwrites the function with one
+     * that has instrumentation data. This method also creates an entry for the function
+     * in the profile report. The original function is stored on the _container object.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @param {Object} owner (Optional) The object that owns the function. If the function
+     *      isn't global then this argument is required. This could be the namespace that
+     *      the function belongs to, such as YAHOO.util.Dom, or the object on which it's
+     *      a method.
+     * @return {Void}
+     * @method registerFunction
+     */     
+    registerFunction : function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
+    
+        //figure out the function name without namespacing
+        var funcName /*:String*/ = (name.indexOf(".") > -1 ? name.substring(name.lastIndexOf(".")+1) : name);
+        if (!YAHOO.lang.isObject(owner)){
+            owner = eval(name.substring(0, name.lastIndexOf(".")));
+        }
+        
+        //get the method and prototype
+        var method /*:Function*/ = owner[funcName];
+        var prototype /*:Object*/ = method.prototype;
+        
+        //see if the method has already been registered
+        if (YAHOO.lang.isFunction(method) && !method.__yuiProfiled){
+            
+            //create a new slot for the original method
+            this._container[name] = method;
+            
+            //replace the function with the profiling one
+            owner[funcName] = function () {
+
+                var start = new Date();     
+                var retval = method.apply(this, arguments);
+                var stop = new Date();
+                
+                YAHOO.tool.Profiler._saveData(name, stop-start);
+                
+                return retval;                
+            
+            };
+            
+            //copy the function properties over
+            YAHOO.lang.augmentObject(owner[funcName], method);
+            owner[funcName].__yuiProfiled = true;
+            owner[funcName].prototype = prototype;
+            this._container[name].__yuiOwner = owner;
+            this._container[name].__yuiFuncName = funcName;        
+        
+            //register prototype if necessary
+            if (registerPrototype) {            
+                this.registerObject(name + ".prototype", prototype);          
+            }
+            
+            //store function information
+            this._report[name] = {
+                calls: 0,
+                max: 0,
+                min: 0,
+                avg: 0,
+                points: []
+            };        
+        }
+            
+        return method;
+    
+    },
+        
+    
+    /**
+     * Sets up an object for profiling. It takes the object and looks for functions.
+     * When a function is found, registerMethod() is called on it. If set to recrusive
+     * mode, it will also setup objects found inside of this object for profiling, 
+     * using the same methodology.
+     * @param {String} name The name of the object to profile (shows up in report).
+     * @param {Object} owner (Optional) The object represented by the name.
+     * @param {Boolean} recurse (Optional) Determines if subobject methods are also profiled.
+     * @return {Void}
+     * @static
+     */
+    registerObject : function (name /*:String*/, object /*:Object*/, recurse /*:Boolean*/) /*:Void*/{
+    
+        //get the object
+        object = (YAHOO.lang.isObject(object) ? object : eval(name));
+    
+        //save the object
+        this._container[name] = object;
+    
+        for (var prop in object) {
+            if (typeof object[prop] == "function"){
+                if (prop != "constructor" && prop != "superclass"){ //don't do constructor or superclass, it's recursive
+                    this.registerFunction(name + "." + prop, object);
+                }
+            } else if (typeof object[prop] == "object" && recurse){
+                this.registerObject(name + "." + prop, object[prop], recurse);
+            }
+        }
+    
+    },    
+    
+    /**
+     * Removes a constructor function from profiling. Reverses the registerConstructor() method.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @return {Void}
+     * @method unregisterFunction
+     */     
+    unregisterConstructor : function(name /*:String*/) /*:Void*/{
+            
+        //see if the method has been registered
+        if (YAHOO.lang.isFunction(this._container[name])){
+        
+            //get original data
+            //var owner /*:Object*/ = this._container[name].__yuiOwner;
+            //var funcName /*:String*/ = this._container[name].__yuiFuncName;
+            //delete this._container[name].__yuiOwner;
+            //delete this._container[name].__yuiFuncName;
+            
+            //replace instrumented function
+            //owner[funcName] = this._container[name];
+            //delete this._container[name];
+            this.unregisterFunction(name, true);
+       
+        }
+
+    
+    },
+    
+    /**
+     * Removes function from profiling. Reverses the registerFunction() method.
+     * @param {String} name The full name of the function including namespacing. This
+     *      is the name of the function that is stored in the report.
+     * @return {Void}
+     * @method unregisterFunction
+     */     
+    unregisterFunction : function(name /*:String*/, unregisterPrototype /*:Boolean*/) /*:Void*/{
+            
+        //see if the method has been registered
+        if (YAHOO.lang.isFunction(this._container[name])){
+        
+            //check to see if you should unregister the prototype
+            if (unregisterPrototype){
+                this.unregisterObject(name + ".prototype", this._container[name].prototype);
+            }
+                
+            //get original data
+            var owner /*:Object*/ = this._container[name].__yuiOwner;
+            var funcName /*:String*/ = this._container[name].__yuiFuncName;
+            delete this._container[name].__yuiOwner;
+            delete this._container[name].__yuiFuncName;
+            
+            //replace instrumented function
+            owner[funcName] = this._container[name];
+            
+            //delete supporting information
+            delete this._container[name];
+            delete this._report[name];
+       
+        }
+            
+    
+    },
+    
+    /**
+     * Unregisters an object for profiling. It takes the object and looks for functions.
+     * When a function is found, unregisterMethod() is called on it. If set to recrusive
+     * mode, it will also unregister objects found inside of this object, 
+     * using the same methodology.
+     * @param {String} name The name of the object to unregister.
+     * @param {Boolean} recurse (Optional) Determines if subobject methods should also be
+     *      unregistered.
+     * @return {Void}
+     * @static
+     */
+    unregisterObject : function (name /*:String*/, recurse /*:Boolean*/) /*:Void*/{
+    
+        //get the object
+        if (YAHOO.lang.isObject(this._container[name])){            
+            object = this._container[name];    
+        
+            for (var prop in object) {
+                if (typeof object[prop] == "function"){
+                    this.unregisterFunction(name + "." + prop);
+                } else if (typeof object[prop] == "object" && recurse){
+                    this.unregisterObject(name + "." + prop, recurse);
+                }
+            }
+            
+            delete this._container[name];
+        }
+    
+    }
+         
+
+};
+
+YAHOO.register("profiler", YAHOO.tool.Profiler, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/profilerviewer/README b/lib/yui/profilerviewer/README
new file mode 100644 (file)
index 0000000..3fceafb
--- /dev/null
@@ -0,0 +1,5 @@
+ProfilerViewer Control -- Release Notes
+
+2.5.0
+
+  * Beta release
\ No newline at end of file
diff --git a/lib/yui/profilerviewer/assets/skins/sam/asc.gif b/lib/yui/profilerviewer/assets/skins/sam/asc.gif
new file mode 100644 (file)
index 0000000..a1fe738
Binary files /dev/null and b/lib/yui/profilerviewer/assets/skins/sam/asc.gif differ
diff --git a/lib/yui/profilerviewer/assets/skins/sam/desc.gif b/lib/yui/profilerviewer/assets/skins/sam/desc.gif
new file mode 100644 (file)
index 0000000..c114f29
Binary files /dev/null and b/lib/yui/profilerviewer/assets/skins/sam/desc.gif differ
diff --git a/lib/yui/profilerviewer/assets/skins/sam/header_background.png b/lib/yui/profilerviewer/assets/skins/sam/header_background.png
new file mode 100644 (file)
index 0000000..3ef7909
Binary files /dev/null and b/lib/yui/profilerviewer/assets/skins/sam/header_background.png differ
diff --git a/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css b/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css
new file mode 100644 (file)
index 0000000..dce1d57
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-skin-sam .yui-pv{background-color:#4a4a4a;font:arial;position:relative;width:99%;z-index:1000;margin-bottom:1em;overflow:hidden;}.yui-skin-sam .yui-pv .hd{background:url(header_background.png) repeat-x;min-height:30px;overflow:hidden;zoom:1;padding:2px 0;}.yui-skin-sam .yui-pv .hd h4{padding:8px 10px;margin:0;font:bold 14px arial;color:#fff;}.yui-skin-sam .yui-pv .hd a{background:#3f6bc3;font:bold 11px arial;color:#fff;padding:4px;margin:3px 10px 0 0;border:1px solid #3f567d;cursor:pointer;display:block;float:right;}.yui-skin-sam .yui-pv .hd span{display:none;}.yui-skin-sam .yui-pv .hd span.yui-pv-busy{height:18px;width:18px;background:url(wait.gif) no-repeat;overflow:hidden;display:block;float:right;margin:4px 10px 0 0;}.yui-skin-sam .yui-pv .hd:after,.yui-pv .bd:after,.yui-skin-sam .yui-pv-chartlegend dl:after{content:'.';visibility:hidden;clear:left;height:0;display:block;}.yui-skin-sam .yui-pv .bd{position:relative;zoom:1;overflow-x:auto;overflow-y:hidden;}.yui-skin-sam .yui-pv .yui-pv-table{padding:0 10px;margin:5px 0 10px 0;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-bd td{color:#eeee5c;font:12px arial;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd{background:#929292;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even{background:#58637a;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-desc{background:#384970;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-desc{background:#6F6E6E;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th{background-image:none;background:#2E2D2D;}.yui-skin-sam .yui-pv th.yui-dt-asc .yui-dt-liner{background:transparent url(asc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv th.yui-dt-desc .yui-dt-liner{background:transparent url(desc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th a{color:#fff;font:bold 12px arial;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-desc{background:#333;}.yui-skin-sam .yui-pv-chartcontainer{padding:0 10px;}.yui-skin-sam .yui-pv-chart{height:250px;clear:right;margin:5px 0 0 0;color:#fff;}.yui-skin-sam .yui-pv-chartlegend div{float:right;margin:0 0 0 10px;_width:250px;}.yui-skin-sam .yui-pv-chartlegend dl{border:1px solid #999;padding:.2em 0 .2em .5em;zoom:1;margin:5px 0;}.yui-skin-sam .yui-pv-chartlegend dt{float:left;display:block;height:.7em;width:.7em;padding:0;}.yui-skin-sam .yui-pv-chartlegend dd{float:left;display:block;color:#fff;margin:0 1em 0 .5em;padding:0;font:11px arial;}.yui-skin-sam .yui-pv-minimized{height:35px;}.yui-skin-sam .yui-pv-minimized .bd{top:-3000px;}.yui-skin-sam .yui-pv-minimized .hd a.yui-pv-refresh{display:none;}
diff --git a/lib/yui/profilerviewer/assets/skins/sam/wait.gif b/lib/yui/profilerviewer/assets/skins/sam/wait.gif
new file mode 100644 (file)
index 0000000..471c1a4
Binary files /dev/null and b/lib/yui/profilerviewer/assets/skins/sam/wait.gif differ
diff --git a/lib/yui/profilerviewer/profilerviewer-beta-debug.js b/lib/yui/profilerviewer/profilerviewer-beta-debug.js
new file mode 100644 (file)
index 0000000..c34cea0
--- /dev/null
@@ -0,0 +1,1227 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function() {
+
+    /**
+     * The ProfilerViewer module provides a graphical display for viewing
+        * the output of the YUI Profiler <http://developer.yahoo.com/yui/profiler>.
+     * @module profilerviewer
+     * @requires yahoo, dom, event, element, profiler, yuiloader
+     */
+
+    /**
+     * A widget to view YUI Profiler output.
+     * @namespace YAHOO.widget
+     * @class ProfilerViewer
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element into which the ProfileViewer should be rendered. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the ProfilerViewer's 
+     * initial attributes.  Ignored if first arg is an attributes object.
+     */
+    YAHOO.widget.ProfilerViewer = function(el, attr) {
+        attr = attr || {};
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el;
+            el = attr.element || null;
+        }
+        if (!el && !attr.element) {
+            el = this._createProfilerViewerElement();
+        }
+
+       YAHOO.widget.ProfilerViewer.superclass.constructor.call(this, el, attr); 
+               
+               this._init();
+               
+               YAHOO.log("ProfilerViewer instantiated.", "info", "ProfilerViewer");
+    };
+
+    YAHOO.extend(YAHOO.widget.ProfilerViewer, YAHOO.util.Element);
+       
+       // Static members of YAHOO.widget.ProfilerViewer:
+       YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer, {
+               /**
+                * Classname for ProfilerViewer containing element.
+                * @static
+                * @property CLASS
+                * @type string
+                * @public
+                * @default "yui-pv"
+                */
+               CLASS: 'yui-pv',
+       
+               /**
+                * Classname for ProfilerViewer button dashboard. 
+                * @static
+                * @property CLASS_DASHBOARD
+                * @type string
+                * @public
+                * @default "yui-pv-dashboard"
+                */
+               CLASS_DASHBOARD: 'yui-pv-dashboard',
+
+               /**
+                * Classname for the "refresh data" button. 
+                * @static
+                * @property CLASS_REFRESH
+                * @type string
+                * @public
+                * @default "yui-pv-refresh"
+                */
+               CLASS_REFRESH: 'yui-pv-refresh',
+
+               /**
+                * Classname for busy indicator in the dashboard. 
+                * @static
+                * @property CLASS_BUSY
+                * @type string
+                * @public
+                * @default "yui-pv-busy"
+                */
+               CLASS_BUSY: 'yui-pv-busy',
+       
+               /**
+                * Classname for element containing the chart and chart
+                * legend elements.
+                * @static
+                * @property CLASS_CHART_CONTAINER
+                * @type string
+                * @public
+                * @default "yui-pv-chartcontainer"
+                */
+               CLASS_CHART_CONTAINER: 'yui-pv-chartcontainer',
+       
+               /**
+                * Classname for element containing the chart.
+                * @static
+                * @property CLASS_CHART
+                * @type string
+                * @public
+                * @default "yui-pv-chart"
+                */
+               CLASS_CHART: 'yui-pv-chart',
+               
+               /**
+                * Classname for element containing the chart's legend. 
+                * @static
+                * @property CLASS_CHART_LEGEND
+                * @type string
+                * @public
+                * @default "yui-pv-chartlegend"
+                */
+               CLASS_CHART_LEGEND: 'yui-pv-chartlegend',
+               
+               /**
+                * Classname for element containing the datatable. 
+                * @static
+                * @property CLASS_TABLE
+                * @type string
+                * @public
+                * @default "yui-pv-table"
+                */
+               CLASS_TABLE: 'yui-pv-table',
+               
+               /**
+                * Strings used in the UI.
+                * @static
+                * @property STRINGS
+                * @object
+                * @public
+                * @default English language strings for UI.
+                */
+               STRINGS: {
+                       title: "YUI Profiler (beta)",
+                       buttons: {
+                               viewprofiler: "View Profiler Data",
+                               hideprofiler: "Hide Profiler Report",
+                               showchart: "Show Chart",
+                               hidechart: "Hide Chart",
+                               refreshdata: "Refresh Data"
+                       },
+                       colHeads: {
+                               //key: [column head label, width in pixels]
+                               fn: ["Function/Method", null], //must auto-size
+                               calls: ["Calls", 40],
+                               avg: ["Average", 80],
+                               min: ["Shortest", 70],
+                               max: ["Longest", 70],
+                               total: ["Total Time", 70],
+                               pct: ["Percent", 70]
+                       },
+                       millisecondsAbbrev: "ms",
+                       initMessage: "initialiazing chart...",
+                       installFlashMessage: "Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href='http://www.adobe.com/go/getflashplayer'>Adobe Flash Player Download Center</a>."
+               },
+
+               /**
+                * Function used to format numbers in milliseconds
+                * for chart; must be publicly accessible, per Charts spec.
+                * @static
+                * @property timeAxisLabelFunction
+                * @type function
+                * @private
+                */
+               timeAxisLabelFunction: function(n) {
+                       var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000;
+                       return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);
+               },
+
+               /**
+                * Function used to format percent numbers for chart; must
+                * be publicly accessible, per Charts spec.
+                * @static
+                * @property percentAxisLabelFunction
+                * @type function
+                * @private
+                */
+               percentAxisLabelFunction: function(n) {
+                       var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100;
+                       return (a + "%");
+               }
+               
+       
+       },true);
+       
+
+       //
+       // STANDARD SHORTCUTS
+       //
+    var Dom = YAHOO.util.Dom;
+    var Event = YAHOO.util.Event;
+       var Profiler = YAHOO.tool.Profiler;
+       var PV = YAHOO.widget.ProfilerViewer;
+       var proto = PV.prototype;
+
+
+       //
+       // PUBLIC METHODS
+       //
+       
+        /**
+     * Refreshes the data displayed in the ProfilerViewer. When called,
+        * this will invoke a refresh of the DataTable and (if displayed)
+        * the Chart.
+     * @method refreshData
+     * @return void
+        * @public
+     */        
+       proto.refreshData = function() {
+               YAHOO.log("Data refresh requested via refreshData method.", "info", "ProfilerViewer");
+               this.fireEvent("dataRefreshEvent");
+       };
+
+        /**
+     * Returns the element containing the console's header.
+     * @method getHeadEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getHeadEl = function() {
+               YAHOO.log("Head element requested via getHeadEl.", "info", "ProfilerViewer");
+               return (this._headEl) ? Dom.get(this._headEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's body, including
+        * the chart and the datatable..
+     * @method getBodyEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getBodyEl = function() {
+               YAHOO.log("Body element requested via getBodyEl.", "info", "ProfilerViewer");
+               return (this._bodyEl) ? Dom.get(this._bodyEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's chart.
+     * @method getChartEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getChartEl = function() {
+               YAHOO.log("Chart element requested via getChartEl.", "info", "ProfilerViewer");
+               return (this._chartEl) ? Dom.get(this._chartEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's dataTable.
+     * @method getTableEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getTableEl = function() {
+               YAHOO.log("DataTable element requested via getTableEl.", "info", "ProfilerViewer");
+               return (this._tableEl) ? Dom.get(this._tableEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's DataTable
+        * instance.
+     * @method getDataTable
+     * @return YAHOO.widget.DataTable
+        * @public
+     */        
+       proto.getDataTable = function() {
+               YAHOO.log("DataTable instance requested via getDataTable.", "info", "ProfilerViewer");
+               return this._dataTable;
+       };
+
+        /**
+     * Returns the element containing the console's Chart instance.
+     * @method getChart
+     * @return YAHOO.widget.BarChart
+        * @public
+     */        
+       proto.getChart = function() {
+               YAHOO.log("Chart instance requested via getChart.", "info", "ProfilerViewer");
+               return this._chart;
+       };
+
+
+    //
+    // PRIVATE PROPERTIES
+    //
+    proto._rendered = false;
+       proto._headEl = null;
+       proto._bodyEl = null;
+       proto._toggleVisibleEl = null;
+       proto._busyEl = null;
+       proto._busy = false;
+       
+       proto._tableEl = null;
+       proto._dataTable = null;
+
+       proto._chartEl = null;
+       proto._chartLegendEl = null;
+       proto._chartElHeight = 250;
+       proto._chart = null;
+       proto._chartInitialized = false;
+
+    //
+    // PRIVATE METHODS
+    //
+
+       proto._init = function() {
+               /**
+                * CUSTOM EVENTS
+                **/
+               
+               /**
+                * Fired when a data refresh is requested. No arguments are passed
+                * with this event.
+                *
+                * @event refreshDataEvent
+                */
+               this.createEvent("dataRefreshEvent");
+               
+               /**
+                * Fired when the viewer canvas first renders. No arguments are passed
+                * with this event.
+                *
+                * @event renderEvent
+                */
+               this.createEvent("renderEvent");
+
+               this.on("dataRefreshEvent", this._refreshDataTable, this, true);
+               
+               this._initLauncherDOM();
+               
+               if(this.get("showChart")) {
+                       this.on("sortedByChange", this._refreshChart);
+               }
+
+               YAHOO.log("ProfilerViewer instance initialization complete.", "info", "ProfilerViewer");
+       };
+
+       /**
+        * If no element is passed in, create it as the first element
+        * in the document.
+        * @method _createProfilerViewerElement
+        * @return HTMLElement
+        * @private
+        */
+       proto._createProfilerViewerElement = function() {
+               YAHOO.log("Creating root element...", "info", "ProfilerViewer");
+
+               var el = document.createElement("div");
+               document.body.insertBefore(el, document.body.firstChild);
+               Dom.addClass(el, this.SKIN_CLASS);
+               Dom.addClass(el, PV.CLASS);
+               YAHOO.log(el);
+               return el;
+       };
+                       
+    /**
+     * Provides a readable name for the ProfilerViewer instance.
+     * @method toString
+     * @return String
+        * @private
+        */
+    proto.toString = function() {
+        return "ProfilerViewer " + (this.get('id') || this.get('tagName'));
+    };
+
+    /**
+     * Toggles visibility of the viewer canvas.
+     * @method _toggleVisible
+     * @return void
+        * @private
+     */        
+       proto._toggleVisible = function() {
+               YAHOO.log("Toggling visibility to " + !this.get("visible") + ".", "info", "ProfilerViewer");
+               
+               var newVis = (this.get("visible")) ? false : true;
+               this.set("visible", newVis);
+    };
+
+    /**
+     * Shows the viewer canvas.
+     * @method show
+     * @return void
+        * @private
+     */        
+        proto._show = function() {
+               if(!this._busy) {
+                       this._setBusyState(true);
+                       if(!this._rendered) {
+                               var loader = new YAHOO.util.YUILoader();
+                               if (this.get("base")) {
+                                       loader.base = this.get("base");
+                               }
+                               
+                               var modules = ["datatable"];
+                               if(this.get("showChart")) {
+                                       modules.push("charts");
+                               }
+                               
+                               loader.insert({ require: modules,
+                                                               onSuccess: function() {
+                                                                       this._render();
+                                                               },
+                                                               scope: this});
+                       } else {
+                               var el = this.get("element");
+                               Dom.removeClass(el, "yui-pv-minimized");
+                               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler;
+                               
+                               //The Flash Charts component can't be set to display:none,
+                               //and even after positioning it offscreen the screen
+                               //may fail to repaint in some browsers.  Adding an empty
+                               //style rule to the console body can help force a repaint:
+                               Dom.addClass(el, "yui-pv-null");
+                               Dom.removeClass(el, "yui-pv-null");
+                               
+                               //Always refresh data when changing to visible:
+                               this.refreshData();
+                       }
+               }
+    };
+
+    /**
+     * Hides the viewer canvas.
+     * @method hide
+     * @return void
+        * @private
+     */        
+       proto._hide = function() {
+               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.viewprofiler;
+               Dom.addClass(this.get("element"), "yui-pv-minimized");
+    };
+       
+       /**
+        * Render the viewer canvas
+        * @method _render
+        * @return void
+        * @private
+        */
+       proto._render = function() {
+               YAHOO.log("Beginning to render ProfilerViewer canvas...", "info", "ProfilerViewer");
+               
+               Dom.removeClass(this.get("element"), "yui-pv-minimized");
+               
+               this._initViewerDOM();
+               this._initDataTable();
+               if(this.get("showChart")) {
+                       this._initChartDOM();
+                       this._initChart();
+               }
+               this._rendered = true;
+               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler;
+               
+               this.fireEvent("renderEvent");
+
+               YAHOO.log("ProfilerViewer rendering complete...", "info", "ProfilerViewer");
+       };
+       
+       /**
+        * Set up the DOM structure for the ProfilerViewer launcher.
+        * @method _initLauncherDOM
+        * @private
+        */
+       proto._initLauncherDOM = function() {
+               YAHOO.log("Creating the launcher...", "info", "ProfilerViewer");
+               
+               var el = this.get("element");
+               Dom.addClass(el, PV.CLASS);
+               Dom.addClass(el, "yui-pv-minimized");
+
+               this._headEl = document.createElement("div");
+               Dom.addClass(this._headEl, "hd");
+               
+               var s = PV.STRINGS.buttons;
+               var b = (this.get("visible")) ? s.hideprofiler : s.viewprofiler;
+               
+               this._toggleVisibleEl = this._createButton(b, this._headEl);
+               
+               this._refreshEl = this._createButton(s.refreshdata, this._headEl);
+               Dom.addClass(this._refreshEl, PV.CLASS_REFRESH);
+               
+               this._busyEl = document.createElement("span");
+               this._headEl.appendChild(this._busyEl);
+
+               var title = document.createElement("h4");
+               title.innerHTML = PV.STRINGS.title;
+               this._headEl.appendChild(title);
+               
+               el.appendChild(this._headEl);
+               
+               Event.on(this._toggleVisibleEl, "click", this._toggleVisible, this, true);
+               Event.on(this._refreshEl, "click", function() {
+                       if(!this._busy) {
+                               this._setBusyState(true);
+                               this.fireEvent("dataRefreshEvent");
+                       }
+               }, this, true);
+       };
+
+       /**
+        * Set up the DOM structure for the ProfilerViewer canvas,
+        * including the holder for the DataTable.
+        * @method _initViewerDOM
+        * @private
+        */
+       proto._initViewerDOM = function() {
+               YAHOO.log("Creating DOM structure for viewer...", "info", "ProfilerViewer");
+               
+               var el = this.get("element");
+               this._bodyEl = document.createElement("div");
+               Dom.addClass(this._bodyEl, "bd");
+               this._tableEl = document.createElement("div");
+               Dom.addClass(this._tableEl, PV.CLASS_TABLE);
+               this._bodyEl.appendChild(this._tableEl);
+               el.appendChild(this._bodyEl);
+       };
+
+       /**
+        * Set up the DOM structure for the ProfilerViewer canvas.
+        * @method _initChartDOM
+        * @private
+        */
+       proto._initChartDOM = function() {
+               YAHOO.log("Adding DOM structure for chart...", "info", "ProfilerViewer");
+               
+               this._chartContainer = document.createElement("div");
+               Dom.addClass(this._chartContainer, PV.CLASS_CHART_CONTAINER);
+               
+               var chl = document.createElement("div");
+               Dom.addClass(chl, PV.CLASS_CHART_LEGEND);
+               
+               var chw = document.createElement("div");
+
+               this._chartLegendEl = document.createElement("dl");
+               this._chartLegendEl.innerHTML = "<dd>" + PV.STRINGS.initMessage + "</dd>";
+               
+               this._chartEl = document.createElement("div");
+               Dom.addClass(this._chartEl, PV.CLASS_CHART);
+               
+               var msg = document.createElement("p");
+               msg.innerHTML = PV.STRINGS.installFlashMessage;
+               this._chartEl.appendChild(msg);
+               
+               this._chartContainer.appendChild(chl);
+               chl.appendChild(chw);
+               chw.appendChild(this._chartLegendEl);
+               this._chartContainer.appendChild(this._chartEl);
+               this._bodyEl.insertBefore(this._chartContainer,this._tableEl);
+       };
+
+
+       /**
+        * Create anchor elements for use as buttons. Args: label
+        * is text to appear on the face of the button, parentEl
+        * is the el to which the anchor will be attached, position
+        * is true for inserting as the first node and false for
+        * inserting as the last node of the parentEl.
+        * @method _createButton
+        * @private
+        */     
+       proto._createButton = function(label, parentEl, position) {
+               var b = document.createElement("a");
+               b.innerHTML = b.title = label;
+               if(parentEl) {
+                       if(!position) {
+                               parentEl.appendChild(b);
+                       } else {
+                               parentEl.insertBefore(b, parentEl.firstChild);  
+                       }
+               }
+               return b;
+       };
+       
+       /**
+        * Set's console busy state.
+        * @method _setBusyState
+        * @private
+        **/
+       proto._setBusyState = function(b) {
+               if(b) {
+                       Dom.addClass(this._busyEl, PV.CLASS_BUSY);
+                       this._busy = true;
+               } else {
+                       Dom.removeClass(this._busyEl, PV.CLASS_BUSY);
+                       this._busy = false;
+               }
+       };
+
+       /**
+        * Generages a sorting function based on current sortedBy
+        * values.
+        * @method _createProfilerViewerElement
+        * @private
+        **/
+       proto._genSortFunction = function(key, dir) {
+               var by = key;
+               var direction = dir;
+               return function(a, b) {
+                       if (direction == YAHOO.widget.DataTable.CLASS_ASC) {
+                               return a[by] - b[by];   
+                       } else {
+                               return ((a[by] - b[by]) * -1);
+                       }
+               };
+       };
+
+       /**
+        * Utility function for array sums.
+        * @method _arraySum
+        * @private
+        **/    
+        var _arraySum = function(arr){
+               var ct = 0;
+               for(var i = 0; i < arr.length; ct+=arr[i++]){}
+               return ct;
+       };
+       
+       /**
+        * Retrieves data from Profiler, filtering and sorting as needed
+        * based on current widget state.  Adds calculated percentage
+        * column and function name to data returned by Profiler.
+        * @method _getProfilerData
+        * @private
+        **/
+       proto._getProfilerData = function() {
+               YAHOO.log("Profiler data requested from function DataSource.", "info", "ProfilerViewer");
+               
+               var obj = Profiler.getFullReport();
+               var arr = [];
+               var totalTime = 0;
+               for (name in obj) {
+               if (YAHOO.lang.hasOwnProperty(obj, name)) {
+                               var r = obj[name];
+                               var o = {};
+                               o.fn = name; //add function name to record
+                               o.points = r.points.slice(); //copy live array
+                               o.calls = r.calls;
+                               o.min = r.min;
+                               o.max = r.max;
+                               o.avg = r.avg;
+                               o.total = _arraySum(o.points);
+                               o.points = r.points;
+                               var f = this.get("filter");
+                               if((!f) || (f(o))) {
+                                       arr.push(o);
+                                       totalTime += o.total;
+                               }
+                       }
+               }
+               
+               //add calculated percentage column
+               for (var i = 0, j = arr.length; i < j; i++) {
+                       arr[i].pct = (totalTime) ? (arr[i].total * 100) / totalTime : 0;        
+               }
+
+               var sortedBy = this.get("sortedBy");
+               var key = sortedBy.key;
+               var dir = sortedBy.dir;         
+
+               arr.sort(this._genSortFunction(key, dir));
+               
+               YAHOO.log("Returning data from DataSource: " + YAHOO.lang.dump(arr), "info", "ProfilerViewer");
+               
+               return arr;
+       };
+       
+       /**
+        * Set up the DataTable.
+        * @method _initDataTable
+        * @private
+        */
+       proto._initDataTable = function() {
+               YAHOO.log("Creating DataTable instance...", "info", "ProfilerViewer");
+               
+               var self = this;
+               
+               //Set up the JS Function DataSource, pulling data from
+               //the Profiler.
+               this._dataSource = new YAHOO.util.DataSource(
+                       function() {
+                               return self._getProfilerData.call(self);        
+                       },
+                       {
+                               responseType: YAHOO.util.DataSource.TYPE_JSARRAY,
+                               maxCacheEntries: 0
+                       }
+               );
+               var ds = this._dataSource;
+
+               ds.responseSchema =
+               {
+                       fields: [ "fn", "avg", "calls", "max", "min", "total", "pct", "points"]
+               };
+               
+               //Set up the DataTable.
+               var formatTimeValue = function(elCell, oRecord, oColumn, oData) {
+                       var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000;
+                       elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev;
+               };
+
+               var formatPercent = function(elCell, oRecord, oColumn, oData) {
+                       var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*100))/100;
+                       elCell.innerHTML = a + "%";
+               };
+               
+               var a = YAHOO.widget.DataTable.CLASS_ASC;
+               var d = YAHOO.widget.DataTable.CLASS_DESC;
+               var c = PV.STRINGS.colHeads;
+               var f = formatTimeValue;
+               
+               var cols = [
+                       {key:"fn", sortable:true, label: c.fn[0],
+                               sortOptions: {defaultDir:a}, 
+                               resizeable: (YAHOO.util.DragDrop) ? true : false,
+                               minWidth:c.fn[1]},
+                       {key:"calls", sortable:true, label: c.calls[0],
+                               sortOptions: {defaultDir:d},
+                               width:c.calls[1]},
+                       {key:"avg", sortable:true, label: c.avg[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.avg[1]},
+                       {key:"min", sortable:true, label: c.min[0],
+                               sortOptions: {defaultDir:a},
+                               formatter:f,
+                               width:c.min[1]}, 
+                       {key:"max", sortable:true, label: c.max[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.max[1]},
+                       {key:"total", sortable:true, label: c.total[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.total[1]},
+                       {key:"pct", sortable:true, label: c.pct[0],
+                               sortOptions: {defaultDir:d}, 
+                               formatter:formatPercent,
+                               width:c.pct[1]}
+               ];
+
+               this._dataTable = new YAHOO.widget.DataTable(this._tableEl, cols, ds, {
+                       scrollable:true,
+                       height:this.get("tableHeight"),
+                       initialRequest:null,
+                       sortedBy: {
+                               key: "total",
+                               dir: YAHOO.widget.DataTable.CLASS_DESC
+                       }
+               });
+               var dt = this._dataTable;
+
+               //Wire up DataTable events to drive the rest of the UI.
+               dt.subscribe("sortedByChange", this._sortedByChange, this, true);
+               dt.subscribe("renderEvent", this._dataTableRenderHandler, this, true);
+               dt.subscribe("initEvent", this._dataTableRenderHandler, this, true);
+               Event.on(this._tableEl.getElementsByTagName("th"), "click", this._thClickHandler, this, true);
+               YAHOO.log("DataTable initialized.", "info", "ProfilerViewer");
+       };
+               
+       /**
+        * Proxy the sort event in DataTable into the ProfilerViewer
+        * attribute.
+        * @method _sortedByChange
+        * @private
+        **/
+       proto._sortedByChange = function(o) {
+               YAHOO.log("Relaying DataTable sortedBy value change; new key: " + o.newValue.key + "; new direction: " + o.newValue.dir + ".", "info", "ProfilerViewer");
+               this.set("sortedBy", {key: o.newValue.key, dir:o.newValue.dir});
+       };
+
+       /**
+        * Proxy the render event in DataTable into the ProfilerViewer
+        * attribute.
+        * @method _dataTableRenderHandler
+        * @private
+        **/
+       proto._dataTableRenderHandler = function(o) {
+               YAHOO.log("DataTable's render event has fired.", "info", "ProfilerViewer");
+               this._setBusyState(false);
+       };
+       
+       /**
+        * Event handler for clicks on the DataTable's sortable column
+        * heads.
+        * @method _thClickHandler
+        * @private
+        **/
+       proto._thClickHandler = function(o) {
+               YAHOO.log("DataTable's header row was clicked for sorting.", "info", "ProfilerViewer");
+               this._setBusyState(true);
+       };
+
+       /**
+        * Refresh DataTable, getting new data from Profiler.
+        * @method _refreshDataTable
+        * @private
+        **/
+       proto._refreshDataTable = function(args) {
+               YAHOO.log("Beginning to refresh DataTable contents...", "info", "ProfilerViewer");
+               var dt = this._dataTable;
+               dt.getDataSource().sendRequest("", dt.onDataReturnInitializeTable, dt);
+               YAHOO.log("DataTable refresh complete.", "info", "ProfilerViewer");
+       };
+
+       /**
+        * Refresh chart, getting new data from table.
+        * @method _refreshChart
+        * @private
+        **/
+       proto._refreshChart = function() {
+               YAHOO.log("Beginning to refresh Chart contents...", "info", "ProfilerViewer");
+               
+               switch (this.get("sortedBy").key) {
+                       case "fn":
+                               /*Keep the same data on the chart, but force update to 
+                                 reflect new sort order on function/method name: */
+                               this._chart.set("dataSource", this._chart.get("dataSource"));
+                               
+                               /*no further action necessary; chart redraws*/
+                               return;
+                       case "calls":
+                               /*Null out the xAxis formatting before redrawing chart.*/
+                               this._chart.set("xAxis", this._chartAxisDefinitionPlain);
+                               break;
+                       case "pct":
+                               this._chart.set("xAxis", this._chartAxisDefinitionPercent);
+                               break;
+                       default:
+                               /*Set the default xAxis; redraw legend; set the new series definition.*/
+                               this._chart.set("xAxis", this._chartAxisDefinitionTime);
+                               break;
+               }
+               
+               this._drawChartLegend();
+               this._chart.set("series", this._getSeriesDef(this.get("sortedBy").key));
+
+               YAHOO.log("Chart refresh complete.", "info", "ProfilerViewer");
+       };
+       
+       /**
+        * Get data for the Chart from DataTable recordset
+        * @method _getChartData
+        * @private
+        */
+       proto._getChartData = function() {
+               YAHOO.log("Getting data for chart from function DataSource.", "info", "ProfilerViewer");
+               var records = this._dataTable.getRecordSet().getRecords(0, this.get("maxChartFunctions"));
+               var arr = [];
+               for (var i = records.length - 1; i>-1; i--) {
+                       arr.push(records[i].getData()); 
+               }
+               YAHOO.log("Returning data to Chart: " + YAHOO.lang.dump(arr), "info", "ProfilerViewer");
+               return arr;
+       };
+       
+       /**
+        * Build series definition based on current configuration attributes.
+        * @method _getSeriesDef
+        * @private
+        */
+       proto._getSeriesDef = function(field) {
+               var sd = this.get("chartSeriesDefinitions")[field];
+               var arr = [];
+               for(var i = 0, j = sd.group.length; i<j; i++) {
+                       var c = this.get("chartSeriesDefinitions")[sd.group[i]];
+                       arr.push(
+                               {displayName:c.displayName,
+                                xField:c.xField,
+                                style: {color:c.style.color, size:c.style.size}
+                               }
+                       );
+               }
+               
+               YAHOO.log("Returning new series definition to chart: " + YAHOO.lang.dump(arr), "info", "ProfilerViewer");
+               return arr;
+       };
+       
+       /**
+        * Set up the Chart.
+        * @method _initChart
+        * @private
+        */
+       proto._initChart = function() {
+               YAHOO.log("Initializing chart...", "info", "ProfilerViewer");
+               
+               this._sizeChartCanvas();
+               
+               YAHOO.widget.Chart.SWFURL = this.get("swfUrl");
+
+               var self = this;
+
+               //Create DataSource based on records currently displayed
+               //at the top of the sort list in the DataTable.
+               var ds = new YAHOO.util.DataSource(
+                       //force the jsfunction DataSource to run in the scope of
+                       //the ProfilerViewer, not in the YAHOO.util.DataSource scope:
+                       function() {
+                               return self._getChartData.call(self);
+                       }, 
+                       {
+                               responseType: YAHOO.util.DataSource.TYPE_JSARRAY,
+                               maxCacheEntries: 0
+                       }
+               );
+
+               ds.responseSchema =
+               {
+                       fields: [ "fn", "avg", "calls", "max", "min", "total", "pct" ]
+               };
+               
+               ds.subscribe('responseEvent', this._sizeChartCanvas, this, true);
+               
+               //Set up the chart itself.
+               this._chartAxisDefinitionTime = new YAHOO.widget.NumericAxis();
+               this._chartAxisDefinitionTime.labelFunction = "YAHOO.widget.ProfilerViewer.timeAxisLabelFunction";
+               
+               this._chartAxisDefinitionPercent = new YAHOO.widget.NumericAxis();
+               this._chartAxisDefinitionPercent.labelFunction = "YAHOO.widget.ProfilerViewer.percentAxisLabelFunction";
+
+               this._chartAxisDefinitionPlain = new YAHOO.widget.NumericAxis();
+               
+               this._chart = new YAHOO.widget.BarChart( this._chartEl, ds,
+               {
+                       yField: "fn",
+                       series: this._getSeriesDef(this.get("sortedBy").key),
+                       style: this.get("chartStyle"),
+                       xAxis: this._chartAxisDefinitionTime
+               } );
+               
+               this._drawChartLegend();
+               this._chartInitialized = true;
+               this._dataTable.unsubscribe("initEvent", this._initChart, this);
+               this._dataTable.subscribe("initEvent", this._refreshChart, this, true);
+               
+               YAHOO.log("Chart initialization complete.", "info", "ProfilerViewer");
+       };
+       
+       /**
+        * Set up the Chart's legend
+        * @method _drawChartLegend
+        * @private
+        **/
+       proto._drawChartLegend = function() {
+               YAHOO.log("Drawing chart legend...", "info", "ProfilerViewer");
+               var seriesDefs = this.get("chartSeriesDefinitions");
+               var currentDef = seriesDefs[this.get("sortedBy").key];
+               var l = this._chartLegendEl;
+               l.innerHTML = "";
+               for(var i = 0, j = currentDef.group.length; i<j; i++) {
+                       var c = seriesDefs[currentDef.group[i]];
+                       var dt = document.createElement("dt");
+                       Dom.setStyle(dt, "backgroundColor", "#" + c.style.color);
+                       var dd = document.createElement("dd");
+                       dd.innerHTML = c.displayName;
+                       l.appendChild(dt);
+                       l.appendChild(dd);
+               }
+       };
+       
+       /**
+        * Resize the chart's canvas if based on number of records
+        * returned from the chart's datasource.
+        * @method _sizeChartCanvas
+        * @private
+        **/
+       proto._sizeChartCanvas = function(o) {
+               YAHOO.log("Resizing chart canvas...", "info", "ProfilerViewer");
+               var bars = (o) ? o.response.length : this.get("maxChartFunctions");
+               var s = (bars * 36) + 34;
+               if (s != parseInt(this._chartElHeight, 10)) {
+                       this._chartElHeight = s;
+                       Dom.setStyle(this._chartEl, "height", s + "px");
+               }
+       };
+
+    /**
+     * setAttributeConfigs TabView specific properties.
+     * @method initAttributes
+     * @param {Object} attr Hash of initial attributes
+        * @method initAttributes
+        * @private
+     */
+    proto.initAttributes = function(attr) {
+               YAHOO.log("Initializing attributes...", "info", "ProfilerViewer");
+        YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr);
+        /**
+         * The YUI Loader base path from which to pull YUI files needed
+                * in the rendering of the ProfilerViewer canvas.  Passed directly
+                * to YUI Loader.  Leave blank to draw files from
+                * yui.yahooapis.com.
+         * @attribute base
+         * @type string
+                * @default ""
+         */
+        this.setAttributeConfig('base', {
+            value: attr.base
+        });
+
+        /**
+         * The height of the DataTable.  The table will scroll
+                * vertically if the content overflows the specified
+                * height.
+         * @attribute tableHeight
+         * @type string
+                * @default "15em"
+         */
+        this.setAttributeConfig('tableHeight', {
+            value: attr.tableHeight || "15em",
+                       method: function(s) {
+                               if(this._dataTable) {
+                                       this._dataTable.set("height", s);
+                               }
+                       }
+        });
+               
+        /**
+         * The default column key to sort by.  Valid keys are: fn, calls,
+                * avg, min, max, total.  Valid dir values are: 
+                * YAHOO.widget.DataTable.CLASS_ASC and
+                * YAHOO.widget.DataTable.CLASS_DESC (or their
+                * string equivalents).
+         * @attribute sortedBy
+         * @type string
+                * @default {key:"total", dir:"yui-dt-desc"}
+         */
+        this.setAttributeConfig('sortedBy', {
+            value: attr.sortedBy || {key:"total", dir:"yui-dt-desc"}
+        });
+
+        /**
+         * A filter function to use in selecting functions that will
+                * appear in the ProfilerViewer report.  The function is passed
+                * a function report object and should return a boolean indicating
+                * whether that function should be included in the ProfilerViewer
+                * display.  The argument is structured as follows:
+                *
+                * {
+                *              fn: <str function name>,
+                *              calls : <n number of calls>,
+                *              avg : <n average call duration>,
+                *              max: <n duration of longest call>,
+                *              min: <n duration of shortest call>,
+                *              total: <n total time of all calls>
+                *              points : <array time in ms of each call>
+                *      }
+                *
+                * For example, you would use the follwing filter function to 
+                * return only functions that have been called at least once:
+                * 
+                *      function(o) {
+                *              return (o.calls > 0);
+                *      }
+                *
+         * @attribute filter
+         * @type function
+                * @default null
+         */
+        this.setAttributeConfig('filter', {
+            value: attr.filter || null,
+                       validator: YAHOO.lang.isFunction
+        });
+
+               /**
+                * The path to the YUI Charts swf file; must be a full URI
+                * or a path relative to the page being profiled. Changes at runtime
+                * not supported; pass this value in at instantiation.
+                * @attribute swfUrl
+                * @type string
+                * @default "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf"
+                */
+               this.setAttributeConfig('swfUrl', {
+                       value: attr.swfUrl || "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf"
+               });
+
+        /**
+         * The maximum number of functions to profile in the chart. The
+                * greater the number of functions, the greater the height of the
+                * chart canvas.
+                * height.
+         * @attribute maxChartFunctions
+         * @type int
+                * @default 6
+         */
+        this.setAttributeConfig('maxChartFunctions', {
+            value: attr.maxChartFunctions || 6,
+                       method: function(s) {
+                               if(this._rendered) {
+                                       this._sizeChartCanvas();
+                               }
+                       },
+                       validator: YAHOO.lang.isNumber
+        });
+               
+        /**
+         * The style object that defines the chart's visual presentation.
+                * Conforms to the style attribute passed to the Charts Control
+                * constructor.  See Charts Control User's Guide for more information
+                * on how to format this object.
+         * @attribute chartStyle
+         * @type obj
+                * @default See JS source for default definitions.
+         */
+        this.setAttributeConfig('chartStyle', {
+            value:     attr.chartStyle || {
+                               font:
+                                       {
+                                               name: "Arial",
+                                               color: 0xeeee5c,
+                                               size: 12
+                                       },
+                                       background:
+                                       {
+                                               color: "6e6e63"
+                                       }
+                               },
+                       method: function() {
+                                       if(this._rendered && this.get("showChart")) {
+                                               this._refreshChart();
+                                       }
+                               }
+        });
+               
+        /**
+         * The series definition information to use when charting
+                * specific fields on the chart.  displayName, xField,
+                * and style members are used to construct the series
+                * definition; the "group" member is the array of fields
+                * that should be charted when the table is sorted by a
+                * given field.
+         * @attribute chartSeriesDefinitions
+         * @type obj
+                * @default See JS source for full default definitions.
+         */
+        this.setAttributeConfig('chartSeriesDefinitions', {
+            value:     attr.chartSeriesDefinitions ||  {
+                                               total: {
+                                                       displayName: PV.STRINGS.colHeads.total[0],
+                                                       xField: "total",
+                                                       style: {color:"4d95dd", size:20},
+                                                       group: ["total"]
+                                               },
+                                               calls: {                
+                                                       displayName: PV.STRINGS.colHeads.calls[0],
+                                                       xField: "calls",
+                                                       style: {color:"edff9f", size:20},
+                                                       group: ["calls"]
+                                               },
+                                               avg: {
+                                                       displayName: PV.STRINGS.colHeads.avg[0],
+                                                       xField: "avg",
+                                                       style: {color:"209daf", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               min: {
+                                                       displayName: PV.STRINGS.colHeads.min[0],
+                                                       xField: "min",
+                                                       style: {color:"b6ecf4", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               max: {
+                                                       displayName: PV.STRINGS.colHeads.max[0],
+                                                       xField: "max",
+                                                       style: {color:"29c7de", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               pct: {
+                                                       displayName: PV.STRINGS.colHeads.pct[0],
+                                                       xField: "pct",
+                                                       style: {color:"C96EDB", size:20},
+                                                       group: ["pct"]
+                                               }
+                               },
+                       method: function() {
+                                       if(this._rendered && this.get("showChart")) {
+                                               this._refreshChart();
+                                       }
+                               }
+        });
+               
+        /**
+         * The default visibility setting for the viewer canvas. If true,
+                * the viewer will load all necessary files and render itself
+                * immediately upon instantiation; otherwise, the viewer will
+                * load only minimal resources until the user toggles visibility
+                * via the UI.
+         * @attribute visible
+         * @type boolean
+                * @default false
+         */
+        this.setAttributeConfig('visible', {
+            value: attr.visible || false,
+                       validator: YAHOO.lang.isBoolean,
+                       method: function(b) {
+                               if(b) {
+                                       this._show();
+                               } else {
+                                       if (this._rendered) {
+                                               this._hide();
+                                       }
+                               }
+                       }
+        });
+
+        /**
+         * The default visibility setting for the chart.
+         * @attribute showChart
+         * @type boolean
+                * @default true
+         */
+        this.setAttributeConfig('showChart', {
+            value: attr.showChart || true,
+                       validator: YAHOO.lang.isBoolean,
+                       writeOnce: true
+                       
+        });
+               
+               YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr);
+               
+               YAHOO.log("Attributes initialized.", "info", "ProfilerViewer");
+    };
+       
+})();
+YAHOO.register("profilerviewer", YAHOO.widget.ProfilerViewer, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/profilerviewer/profilerviewer-beta-min.js b/lib/yui/profilerviewer/profilerviewer-beta-min.js
new file mode 100644 (file)
index 0000000..101d91e
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){YAHOO.widget.ProfilerViewer=function(H,G){G=G||{};if(arguments.length==1&&!YAHOO.lang.isString(H)&&!H.nodeName){G=H;H=G.element||null;}if(!H&&!G.element){H=this._createProfilerViewerElement();}YAHOO.widget.ProfilerViewer.superclass.constructor.call(this,H,G);this._init();};YAHOO.extend(YAHOO.widget.ProfilerViewer,YAHOO.util.Element);YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer,{CLASS:"yui-pv",CLASS_DASHBOARD:"yui-pv-dashboard",CLASS_REFRESH:"yui-pv-refresh",CLASS_BUSY:"yui-pv-busy",CLASS_CHART_CONTAINER:"yui-pv-chartcontainer",CLASS_CHART:"yui-pv-chart",CLASS_CHART_LEGEND:"yui-pv-chartlegend",CLASS_TABLE:"yui-pv-table",STRINGS:{title:"YUI Profiler (beta)",buttons:{viewprofiler:"View Profiler Data",hideprofiler:"Hide Profiler Report",showchart:"Show Chart",hidechart:"Hide Chart",refreshdata:"Refresh Data"},colHeads:{fn:["Function/Method",null],calls:["Calls",40],avg:["Average",80],min:["Shortest",70],max:["Longest",70],total:["Total Time",70],pct:["Percent",70]},millisecondsAbbrev:"ms",initMessage:"initialiazing chart...",installFlashMessage:"Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href='http://www.adobe.com/go/getflashplayer'>Adobe Flash Player Download Center</a>."},timeAxisLabelFunction:function(H){var G=(H===Math.floor(H))?H:(Math.round(H*1000))/1000;return(G+" "+YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);},percentAxisLabelFunction:function(H){var G=(H===Math.floor(H))?H:(Math.round(H*100))/100;return(G+"%");}},true);var C=YAHOO.util.Dom;var A=YAHOO.util.Event;var B=YAHOO.tool.Profiler;var E=YAHOO.widget.ProfilerViewer;var D=E.prototype;D.refreshData=function(){this.fireEvent("dataRefreshEvent");};D.getHeadEl=function(){return(this._headEl)?C.get(this._headEl):false;};D.getBodyEl=function(){return(this._bodyEl)?C.get(this._bodyEl):false;};D.getChartEl=function(){return(this._chartEl)?C.get(this._chartEl):false;};D.getTableEl=function(){return(this._tableEl)?C.get(this._tableEl):false;};D.getDataTable=function(){return this._dataTable;};D.getChart=function(){return this._chart;};D._rendered=false;D._headEl=null;D._bodyEl=null;D._toggleVisibleEl=null;D._busyEl=null;D._busy=false;D._tableEl=null;D._dataTable=null;D._chartEl=null;D._chartLegendEl=null;D._chartElHeight=250;D._chart=null;D._chartInitialized=false;D._init=function(){this.createEvent("dataRefreshEvent");this.createEvent("renderEvent");this.on("dataRefreshEvent",this._refreshDataTable,this,true);this._initLauncherDOM();if(this.get("showChart")){this.on("sortedByChange",this._refreshChart);}};D._createProfilerViewerElement=function(){var G=document.createElement("div");document.body.insertBefore(G,document.body.firstChild);C.addClass(G,this.SKIN_CLASS);C.addClass(G,E.CLASS);return G;};D.toString=function(){return"ProfilerViewer "+(this.get("id")||this.get("tagName"));};D._toggleVisible=function(){var G=(this.get("visible"))?false:true;this.set("visible",G);};D._show=function(){if(!this._busy){this._setBusyState(true);if(!this._rendered){var G=new YAHOO.util.YUILoader();if(this.get("base")){G.base=this.get("base");}var H=["datatable"];if(this.get("showChart")){H.push("charts");}G.insert({require:H,onSuccess:function(){this._render();},scope:this});}else{var I=this.get("element");C.removeClass(I,"yui-pv-minimized");this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.hideprofiler;C.addClass(I,"yui-pv-null");C.removeClass(I,"yui-pv-null");this.refreshData();}}};D._hide=function(){this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.viewprofiler;C.addClass(this.get("element"),"yui-pv-minimized");};D._render=function(){C.removeClass(this.get("element"),"yui-pv-minimized");this._initViewerDOM();this._initDataTable();if(this.get("showChart")){this._initChartDOM();this._initChart();}this._rendered=true;this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.hideprofiler;this.fireEvent("renderEvent");};D._initLauncherDOM=function(){var I=this.get("element");C.addClass(I,E.CLASS);C.addClass(I,"yui-pv-minimized");this._headEl=document.createElement("div");C.addClass(this._headEl,"hd");var H=E.STRINGS.buttons;var G=(this.get("visible"))?H.hideprofiler:H.viewprofiler;this._toggleVisibleEl=this._createButton(G,this._headEl);this._refreshEl=this._createButton(H.refreshdata,this._headEl);C.addClass(this._refreshEl,E.CLASS_REFRESH);this._busyEl=document.createElement("span");this._headEl.appendChild(this._busyEl);var J=document.createElement("h4");J.innerHTML=E.STRINGS.title;this._headEl.appendChild(J);I.appendChild(this._headEl);A.on(this._toggleVisibleEl,"click",this._toggleVisible,this,true);A.on(this._refreshEl,"click",function(){if(!this._busy){this._setBusyState(true);this.fireEvent("dataRefreshEvent");}},this,true);};D._initViewerDOM=function(){var G=this.get("element");this._bodyEl=document.createElement("div");C.addClass(this._bodyEl,"bd");this._tableEl=document.createElement("div");C.addClass(this._tableEl,E.CLASS_TABLE);this._bodyEl.appendChild(this._tableEl);G.appendChild(this._bodyEl);};D._initChartDOM=function(){this._chartContainer=document.createElement("div");C.addClass(this._chartContainer,E.CLASS_CHART_CONTAINER);var H=document.createElement("div");C.addClass(H,E.CLASS_CHART_LEGEND);var G=document.createElement("div");this._chartLegendEl=document.createElement("dl");this._chartLegendEl.innerHTML="<dd>"+E.STRINGS.initMessage+"</dd>";this._chartEl=document.createElement("div");C.addClass(this._chartEl,E.CLASS_CHART);var I=document.createElement("p");I.innerHTML=E.STRINGS.installFlashMessage;this._chartEl.appendChild(I);this._chartContainer.appendChild(H);H.appendChild(G);G.appendChild(this._chartLegendEl);this._chartContainer.appendChild(this._chartEl);this._bodyEl.insertBefore(this._chartContainer,this._tableEl);};D._createButton=function(I,J,H){var G=document.createElement("a");G.innerHTML=G.title=I;if(J){if(!H){J.appendChild(G);}else{J.insertBefore(G,J.firstChild);}}return G;};D._setBusyState=function(G){if(G){C.addClass(this._busyEl,E.CLASS_BUSY);
+this._busy=true;}else{C.removeClass(this._busyEl,E.CLASS_BUSY);this._busy=false;}};D._genSortFunction=function(H,G){var J=H;var I=G;return function(L,K){if(I==YAHOO.widget.DataTable.CLASS_ASC){return L[J]-K[J];}else{return((L[J]-K[J])*-1);}};};var F=function(G){var I=0;for(var H=0;H<G.length;I+=G[H++]){}return I;};D._getProfilerData=function(){var L=B.getFullReport();var N=[];var H=0;for(name in L){if(YAHOO.lang.hasOwnProperty(L,name)){var G=L[name];var I={};I.fn=name;I.points=G.points.slice();I.calls=G.calls;I.min=G.min;I.max=G.max;I.avg=G.avg;I.total=F(I.points);I.points=G.points;var P=this.get("filter");if((!P)||(P(I))){N.push(I);H+=I.total;}}}for(var M=0,K=N.length;M<K;M++){N[M].pct=(H)?(N[M].total*100)/H:0;}var O=this.get("sortedBy");var Q=O.key;var J=O.dir;N.sort(this._genSortFunction(Q,J));return N;};D._initDataTable=function(){var P=this;this._dataSource=new YAHOO.util.DataSource(function(){return P._getProfilerData.call(P);},{responseType:YAHOO.util.DataSource.TYPE_JSARRAY,maxCacheEntries:0});var H=this._dataSource;H.responseSchema={fields:["fn","avg","calls","max","min","total","pct","points"]};var O=function(S,R,T,U){var Q=(U===Math.floor(U))?U:(Math.round(U*1000))/1000;S.innerHTML=Q+" "+E.STRINGS.millisecondsAbbrev;};var N=function(S,R,T,U){var Q=(U===Math.floor(U))?U:(Math.round(U*100))/100;S.innerHTML=Q+"%";};var M=YAHOO.widget.DataTable.CLASS_ASC;var J=YAHOO.widget.DataTable.CLASS_DESC;var K=E.STRINGS.colHeads;var I=O;var L=[{key:"fn",sortable:true,label:K.fn[0],sortOptions:{defaultDir:M},resizeable:(YAHOO.util.DragDrop)?true:false,minWidth:K.fn[1]},{key:"calls",sortable:true,label:K.calls[0],sortOptions:{defaultDir:J},width:K.calls[1]},{key:"avg",sortable:true,label:K.avg[0],sortOptions:{defaultDir:J},formatter:I,width:K.avg[1]},{key:"min",sortable:true,label:K.min[0],sortOptions:{defaultDir:M},formatter:I,width:K.min[1]},{key:"max",sortable:true,label:K.max[0],sortOptions:{defaultDir:J},formatter:I,width:K.max[1]},{key:"total",sortable:true,label:K.total[0],sortOptions:{defaultDir:J},formatter:I,width:K.total[1]},{key:"pct",sortable:true,label:K.pct[0],sortOptions:{defaultDir:J},formatter:N,width:K.pct[1]}];this._dataTable=new YAHOO.widget.DataTable(this._tableEl,L,H,{scrollable:true,height:this.get("tableHeight"),initialRequest:null,sortedBy:{key:"total",dir:YAHOO.widget.DataTable.CLASS_DESC}});var G=this._dataTable;G.subscribe("sortedByChange",this._sortedByChange,this,true);G.subscribe("renderEvent",this._dataTableRenderHandler,this,true);G.subscribe("initEvent",this._dataTableRenderHandler,this,true);A.on(this._tableEl.getElementsByTagName("th"),"click",this._thClickHandler,this,true);};D._sortedByChange=function(G){this.set("sortedBy",{key:G.newValue.key,dir:G.newValue.dir});};D._dataTableRenderHandler=function(G){this._setBusyState(false);};D._thClickHandler=function(G){this._setBusyState(true);};D._refreshDataTable=function(G){var H=this._dataTable;H.getDataSource().sendRequest("",H.onDataReturnInitializeTable,H);};D._refreshChart=function(){switch(this.get("sortedBy").key){case"fn":this._chart.set("dataSource",this._chart.get("dataSource"));return ;case"calls":this._chart.set("xAxis",this._chartAxisDefinitionPlain);break;case"pct":this._chart.set("xAxis",this._chartAxisDefinitionPercent);break;default:this._chart.set("xAxis",this._chartAxisDefinitionTime);break;}this._drawChartLegend();this._chart.set("series",this._getSeriesDef(this.get("sortedBy").key));};D._getChartData=function(){var H=this._dataTable.getRecordSet().getRecords(0,this.get("maxChartFunctions"));var G=[];for(var I=H.length-1;I>-1;I--){G.push(H[I].getData());}return G;};D._getSeriesDef=function(K){var J=this.get("chartSeriesDefinitions")[K];var G=[];for(var I=0,H=J.group.length;I<H;I++){var L=this.get("chartSeriesDefinitions")[J.group[I]];G.push({displayName:L.displayName,xField:L.xField,style:{color:L.style.color,size:L.style.size}});}return G;};D._initChart=function(){this._sizeChartCanvas();YAHOO.widget.Chart.SWFURL=this.get("swfUrl");var G=this;var H=new YAHOO.util.DataSource(function(){return G._getChartData.call(G);},{responseType:YAHOO.util.DataSource.TYPE_JSARRAY,maxCacheEntries:0});H.responseSchema={fields:["fn","avg","calls","max","min","total","pct"]};H.subscribe("responseEvent",this._sizeChartCanvas,this,true);this._chartAxisDefinitionTime=new YAHOO.widget.NumericAxis();this._chartAxisDefinitionTime.labelFunction="YAHOO.widget.ProfilerViewer.timeAxisLabelFunction";this._chartAxisDefinitionPercent=new YAHOO.widget.NumericAxis();this._chartAxisDefinitionPercent.labelFunction="YAHOO.widget.ProfilerViewer.percentAxisLabelFunction";this._chartAxisDefinitionPlain=new YAHOO.widget.NumericAxis();this._chart=new YAHOO.widget.BarChart(this._chartEl,H,{yField:"fn",series:this._getSeriesDef(this.get("sortedBy").key),style:this.get("chartStyle"),xAxis:this._chartAxisDefinitionTime});this._drawChartLegend();this._chartInitialized=true;this._dataTable.unsubscribe("initEvent",this._initChart,this);this._dataTable.subscribe("initEvent",this._refreshChart,this,true);};D._drawChartLegend=function(){var M=this.get("chartSeriesDefinitions");var I=M[this.get("sortedBy").key];var H=this._chartLegendEl;H.innerHTML="";for(var K=0,J=I.group.length;K<J;K++){var N=M[I.group[K]];var L=document.createElement("dt");C.setStyle(L,"backgroundColor","#"+N.style.color);var G=document.createElement("dd");G.innerHTML=N.displayName;H.appendChild(L);H.appendChild(G);}};D._sizeChartCanvas=function(I){var G=(I)?I.response.length:this.get("maxChartFunctions");var H=(G*36)+34;if(H!=parseInt(this._chartElHeight,10)){this._chartElHeight=H;C.setStyle(this._chartEl,"height",H+"px");}};D.initAttributes=function(G){YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this,G);this.setAttributeConfig("base",{value:G.base});this.setAttributeConfig("tableHeight",{value:G.tableHeight||"15em",method:function(H){if(this._dataTable){this._dataTable.set("height",H);}}});this.setAttributeConfig("sortedBy",{value:G.sortedBy||{key:"total",dir:"yui-dt-desc"}});
+this.setAttributeConfig("filter",{value:G.filter||null,validator:YAHOO.lang.isFunction});this.setAttributeConfig("swfUrl",{value:G.swfUrl||"http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf"});this.setAttributeConfig("maxChartFunctions",{value:G.maxChartFunctions||6,method:function(H){if(this._rendered){this._sizeChartCanvas();}},validator:YAHOO.lang.isNumber});this.setAttributeConfig("chartStyle",{value:G.chartStyle||{font:{name:"Arial",color:15658588,size:12},background:{color:"6e6e63"}},method:function(){if(this._rendered&&this.get("showChart")){this._refreshChart();}}});this.setAttributeConfig("chartSeriesDefinitions",{value:G.chartSeriesDefinitions||{total:{displayName:E.STRINGS.colHeads.total[0],xField:"total",style:{color:"4d95dd",size:20},group:["total"]},calls:{displayName:E.STRINGS.colHeads.calls[0],xField:"calls",style:{color:"edff9f",size:20},group:["calls"]},avg:{displayName:E.STRINGS.colHeads.avg[0],xField:"avg",style:{color:"209daf",size:9},group:["avg","min","max"]},min:{displayName:E.STRINGS.colHeads.min[0],xField:"min",style:{color:"b6ecf4",size:9},group:["avg","min","max"]},max:{displayName:E.STRINGS.colHeads.max[0],xField:"max",style:{color:"29c7de",size:9},group:["avg","min","max"]},pct:{displayName:E.STRINGS.colHeads.pct[0],xField:"pct",style:{color:"C96EDB",size:20},group:["pct"]}},method:function(){if(this._rendered&&this.get("showChart")){this._refreshChart();}}});this.setAttributeConfig("visible",{value:G.visible||false,validator:YAHOO.lang.isBoolean,method:function(H){if(H){this._show();}else{if(this._rendered){this._hide();}}}});this.setAttributeConfig("showChart",{value:G.showChart||true,validator:YAHOO.lang.isBoolean,writeOnce:true});YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this,G);};})();YAHOO.register("profilerviewer",YAHOO.widget.ProfilerViewer,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/profilerviewer/profilerviewer-beta.js b/lib/yui/profilerviewer/profilerviewer-beta.js
new file mode 100644 (file)
index 0000000..6d67e6b
--- /dev/null
@@ -0,0 +1,1190 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function() {
+
+    /**
+     * The ProfilerViewer module provides a graphical display for viewing
+        * the output of the YUI Profiler <http://developer.yahoo.com/yui/profiler>.
+     * @module profilerviewer
+     * @requires yahoo, dom, event, element, profiler, yuiloader
+     */
+
+    /**
+     * A widget to view YUI Profiler output.
+     * @namespace YAHOO.widget
+     * @class ProfilerViewer
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element into which the ProfileViewer should be rendered. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the ProfilerViewer's 
+     * initial attributes.  Ignored if first arg is an attributes object.
+     */
+    YAHOO.widget.ProfilerViewer = function(el, attr) {
+        attr = attr || {};
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el;
+            el = attr.element || null;
+        }
+        if (!el && !attr.element) {
+            el = this._createProfilerViewerElement();
+        }
+
+       YAHOO.widget.ProfilerViewer.superclass.constructor.call(this, el, attr); 
+               
+               this._init();
+               
+    };
+
+    YAHOO.extend(YAHOO.widget.ProfilerViewer, YAHOO.util.Element);
+       
+       // Static members of YAHOO.widget.ProfilerViewer:
+       YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer, {
+               /**
+                * Classname for ProfilerViewer containing element.
+                * @static
+                * @property CLASS
+                * @type string
+                * @public
+                * @default "yui-pv"
+                */
+               CLASS: 'yui-pv',
+       
+               /**
+                * Classname for ProfilerViewer button dashboard. 
+                * @static
+                * @property CLASS_DASHBOARD
+                * @type string
+                * @public
+                * @default "yui-pv-dashboard"
+                */
+               CLASS_DASHBOARD: 'yui-pv-dashboard',
+
+               /**
+                * Classname for the "refresh data" button. 
+                * @static
+                * @property CLASS_REFRESH
+                * @type string
+                * @public
+                * @default "yui-pv-refresh"
+                */
+               CLASS_REFRESH: 'yui-pv-refresh',
+
+               /**
+                * Classname for busy indicator in the dashboard. 
+                * @static
+                * @property CLASS_BUSY
+                * @type string
+                * @public
+                * @default "yui-pv-busy"
+                */
+               CLASS_BUSY: 'yui-pv-busy',
+       
+               /**
+                * Classname for element containing the chart and chart
+                * legend elements.
+                * @static
+                * @property CLASS_CHART_CONTAINER
+                * @type string
+                * @public
+                * @default "yui-pv-chartcontainer"
+                */
+               CLASS_CHART_CONTAINER: 'yui-pv-chartcontainer',
+       
+               /**
+                * Classname for element containing the chart.
+                * @static
+                * @property CLASS_CHART
+                * @type string
+                * @public
+                * @default "yui-pv-chart"
+                */
+               CLASS_CHART: 'yui-pv-chart',
+               
+               /**
+                * Classname for element containing the chart's legend. 
+                * @static
+                * @property CLASS_CHART_LEGEND
+                * @type string
+                * @public
+                * @default "yui-pv-chartlegend"
+                */
+               CLASS_CHART_LEGEND: 'yui-pv-chartlegend',
+               
+               /**
+                * Classname for element containing the datatable. 
+                * @static
+                * @property CLASS_TABLE
+                * @type string
+                * @public
+                * @default "yui-pv-table"
+                */
+               CLASS_TABLE: 'yui-pv-table',
+               
+               /**
+                * Strings used in the UI.
+                * @static
+                * @property STRINGS
+                * @object
+                * @public
+                * @default English language strings for UI.
+                */
+               STRINGS: {
+                       title: "YUI Profiler (beta)",
+                       buttons: {
+                               viewprofiler: "View Profiler Data",
+                               hideprofiler: "Hide Profiler Report",
+                               showchart: "Show Chart",
+                               hidechart: "Hide Chart",
+                               refreshdata: "Refresh Data"
+                       },
+                       colHeads: {
+                               //key: [column head label, width in pixels]
+                               fn: ["Function/Method", null], //must auto-size
+                               calls: ["Calls", 40],
+                               avg: ["Average", 80],
+                               min: ["Shortest", 70],
+                               max: ["Longest", 70],
+                               total: ["Total Time", 70],
+                               pct: ["Percent", 70]
+                       },
+                       millisecondsAbbrev: "ms",
+                       initMessage: "initialiazing chart...",
+                       installFlashMessage: "Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href='http://www.adobe.com/go/getflashplayer'>Adobe Flash Player Download Center</a>."
+               },
+
+               /**
+                * Function used to format numbers in milliseconds
+                * for chart; must be publicly accessible, per Charts spec.
+                * @static
+                * @property timeAxisLabelFunction
+                * @type function
+                * @private
+                */
+               timeAxisLabelFunction: function(n) {
+                       var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000;
+                       return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);
+               },
+
+               /**
+                * Function used to format percent numbers for chart; must
+                * be publicly accessible, per Charts spec.
+                * @static
+                * @property percentAxisLabelFunction
+                * @type function
+                * @private
+                */
+               percentAxisLabelFunction: function(n) {
+                       var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100;
+                       return (a + "%");
+               }
+               
+       
+       },true);
+       
+
+       //
+       // STANDARD SHORTCUTS
+       //
+    var Dom = YAHOO.util.Dom;
+    var Event = YAHOO.util.Event;
+       var Profiler = YAHOO.tool.Profiler;
+       var PV = YAHOO.widget.ProfilerViewer;
+       var proto = PV.prototype;
+
+
+       //
+       // PUBLIC METHODS
+       //
+       
+        /**
+     * Refreshes the data displayed in the ProfilerViewer. When called,
+        * this will invoke a refresh of the DataTable and (if displayed)
+        * the Chart.
+     * @method refreshData
+     * @return void
+        * @public
+     */        
+       proto.refreshData = function() {
+               this.fireEvent("dataRefreshEvent");
+       };
+
+        /**
+     * Returns the element containing the console's header.
+     * @method getHeadEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getHeadEl = function() {
+               return (this._headEl) ? Dom.get(this._headEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's body, including
+        * the chart and the datatable..
+     * @method getBodyEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getBodyEl = function() {
+               return (this._bodyEl) ? Dom.get(this._bodyEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's chart.
+     * @method getChartEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getChartEl = function() {
+               return (this._chartEl) ? Dom.get(this._chartEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's dataTable.
+     * @method getTableEl
+     * @return HTMLElement
+        * @public
+     */        
+       proto.getTableEl = function() {
+               return (this._tableEl) ? Dom.get(this._tableEl) : false;
+       };
+
+        /**
+     * Returns the element containing the console's DataTable
+        * instance.
+     * @method getDataTable
+     * @return YAHOO.widget.DataTable
+        * @public
+     */        
+       proto.getDataTable = function() {
+               return this._dataTable;
+       };
+
+        /**
+     * Returns the element containing the console's Chart instance.
+     * @method getChart
+     * @return YAHOO.widget.BarChart
+        * @public
+     */        
+       proto.getChart = function() {
+               return this._chart;
+       };
+
+
+    //
+    // PRIVATE PROPERTIES
+    //
+    proto._rendered = false;
+       proto._headEl = null;
+       proto._bodyEl = null;
+       proto._toggleVisibleEl = null;
+       proto._busyEl = null;
+       proto._busy = false;
+       
+       proto._tableEl = null;
+       proto._dataTable = null;
+
+       proto._chartEl = null;
+       proto._chartLegendEl = null;
+       proto._chartElHeight = 250;
+       proto._chart = null;
+       proto._chartInitialized = false;
+
+    //
+    // PRIVATE METHODS
+    //
+
+       proto._init = function() {
+               /**
+                * CUSTOM EVENTS
+                **/
+               
+               /**
+                * Fired when a data refresh is requested. No arguments are passed
+                * with this event.
+                *
+                * @event refreshDataEvent
+                */
+               this.createEvent("dataRefreshEvent");
+               
+               /**
+                * Fired when the viewer canvas first renders. No arguments are passed
+                * with this event.
+                *
+                * @event renderEvent
+                */
+               this.createEvent("renderEvent");
+
+               this.on("dataRefreshEvent", this._refreshDataTable, this, true);
+               
+               this._initLauncherDOM();
+               
+               if(this.get("showChart")) {
+                       this.on("sortedByChange", this._refreshChart);
+               }
+
+       };
+
+       /**
+        * If no element is passed in, create it as the first element
+        * in the document.
+        * @method _createProfilerViewerElement
+        * @return HTMLElement
+        * @private
+        */
+       proto._createProfilerViewerElement = function() {
+
+               var el = document.createElement("div");
+               document.body.insertBefore(el, document.body.firstChild);
+               Dom.addClass(el, this.SKIN_CLASS);
+               Dom.addClass(el, PV.CLASS);
+               return el;
+       };
+                       
+    /**
+     * Provides a readable name for the ProfilerViewer instance.
+     * @method toString
+     * @return String
+        * @private
+        */
+    proto.toString = function() {
+        return "ProfilerViewer " + (this.get('id') || this.get('tagName'));
+    };
+
+    /**
+     * Toggles visibility of the viewer canvas.
+     * @method _toggleVisible
+     * @return void
+        * @private
+     */        
+       proto._toggleVisible = function() {
+               
+               var newVis = (this.get("visible")) ? false : true;
+               this.set("visible", newVis);
+    };
+
+    /**
+     * Shows the viewer canvas.
+     * @method show
+     * @return void
+        * @private
+     */        
+        proto._show = function() {
+               if(!this._busy) {
+                       this._setBusyState(true);
+                       if(!this._rendered) {
+                               var loader = new YAHOO.util.YUILoader();
+                               if (this.get("base")) {
+                                       loader.base = this.get("base");
+                               }
+                               
+                               var modules = ["datatable"];
+                               if(this.get("showChart")) {
+                                       modules.push("charts");
+                               }
+                               
+                               loader.insert({ require: modules,
+                                                               onSuccess: function() {
+                                                                       this._render();
+                                                               },
+                                                               scope: this});
+                       } else {
+                               var el = this.get("element");
+                               Dom.removeClass(el, "yui-pv-minimized");
+                               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler;
+                               
+                               //The Flash Charts component can't be set to display:none,
+                               //and even after positioning it offscreen the screen
+                               //may fail to repaint in some browsers.  Adding an empty
+                               //style rule to the console body can help force a repaint:
+                               Dom.addClass(el, "yui-pv-null");
+                               Dom.removeClass(el, "yui-pv-null");
+                               
+                               //Always refresh data when changing to visible:
+                               this.refreshData();
+                       }
+               }
+    };
+
+    /**
+     * Hides the viewer canvas.
+     * @method hide
+     * @return void
+        * @private
+     */        
+       proto._hide = function() {
+               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.viewprofiler;
+               Dom.addClass(this.get("element"), "yui-pv-minimized");
+    };
+       
+       /**
+        * Render the viewer canvas
+        * @method _render
+        * @return void
+        * @private
+        */
+       proto._render = function() {
+               
+               Dom.removeClass(this.get("element"), "yui-pv-minimized");
+               
+               this._initViewerDOM();
+               this._initDataTable();
+               if(this.get("showChart")) {
+                       this._initChartDOM();
+                       this._initChart();
+               }
+               this._rendered = true;
+               this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler;
+               
+               this.fireEvent("renderEvent");
+
+       };
+       
+       /**
+        * Set up the DOM structure for the ProfilerViewer launcher.
+        * @method _initLauncherDOM
+        * @private
+        */
+       proto._initLauncherDOM = function() {
+               
+               var el = this.get("element");
+               Dom.addClass(el, PV.CLASS);
+               Dom.addClass(el, "yui-pv-minimized");
+
+               this._headEl = document.createElement("div");
+               Dom.addClass(this._headEl, "hd");
+               
+               var s = PV.STRINGS.buttons;
+               var b = (this.get("visible")) ? s.hideprofiler : s.viewprofiler;
+               
+               this._toggleVisibleEl = this._createButton(b, this._headEl);
+               
+               this._refreshEl = this._createButton(s.refreshdata, this._headEl);
+               Dom.addClass(this._refreshEl, PV.CLASS_REFRESH);
+               
+               this._busyEl = document.createElement("span");
+               this._headEl.appendChild(this._busyEl);
+
+               var title = document.createElement("h4");
+               title.innerHTML = PV.STRINGS.title;
+               this._headEl.appendChild(title);
+               
+               el.appendChild(this._headEl);
+               
+               Event.on(this._toggleVisibleEl, "click", this._toggleVisible, this, true);
+               Event.on(this._refreshEl, "click", function() {
+                       if(!this._busy) {
+                               this._setBusyState(true);
+                               this.fireEvent("dataRefreshEvent");
+                       }
+               }, this, true);
+       };
+
+       /**
+        * Set up the DOM structure for the ProfilerViewer canvas,
+        * including the holder for the DataTable.
+        * @method _initViewerDOM
+        * @private
+        */
+       proto._initViewerDOM = function() {
+               
+               var el = this.get("element");
+               this._bodyEl = document.createElement("div");
+               Dom.addClass(this._bodyEl, "bd");
+               this._tableEl = document.createElement("div");
+               Dom.addClass(this._tableEl, PV.CLASS_TABLE);
+               this._bodyEl.appendChild(this._tableEl);
+               el.appendChild(this._bodyEl);
+       };
+
+       /**
+        * Set up the DOM structure for the ProfilerViewer canvas.
+        * @method _initChartDOM
+        * @private
+        */
+       proto._initChartDOM = function() {
+               
+               this._chartContainer = document.createElement("div");
+               Dom.addClass(this._chartContainer, PV.CLASS_CHART_CONTAINER);
+               
+               var chl = document.createElement("div");
+               Dom.addClass(chl, PV.CLASS_CHART_LEGEND);
+               
+               var chw = document.createElement("div");
+
+               this._chartLegendEl = document.createElement("dl");
+               this._chartLegendEl.innerHTML = "<dd>" + PV.STRINGS.initMessage + "</dd>";
+               
+               this._chartEl = document.createElement("div");
+               Dom.addClass(this._chartEl, PV.CLASS_CHART);
+               
+               var msg = document.createElement("p");
+               msg.innerHTML = PV.STRINGS.installFlashMessage;
+               this._chartEl.appendChild(msg);
+               
+               this._chartContainer.appendChild(chl);
+               chl.appendChild(chw);
+               chw.appendChild(this._chartLegendEl);
+               this._chartContainer.appendChild(this._chartEl);
+               this._bodyEl.insertBefore(this._chartContainer,this._tableEl);
+       };
+
+
+       /**
+        * Create anchor elements for use as buttons. Args: label
+        * is text to appear on the face of the button, parentEl
+        * is the el to which the anchor will be attached, position
+        * is true for inserting as the first node and false for
+        * inserting as the last node of the parentEl.
+        * @method _createButton
+        * @private
+        */     
+       proto._createButton = function(label, parentEl, position) {
+               var b = document.createElement("a");
+               b.innerHTML = b.title = label;
+               if(parentEl) {
+                       if(!position) {
+                               parentEl.appendChild(b);
+                       } else {
+                               parentEl.insertBefore(b, parentEl.firstChild);  
+                       }
+               }
+               return b;
+       };
+       
+       /**
+        * Set's console busy state.
+        * @method _setBusyState
+        * @private
+        **/
+       proto._setBusyState = function(b) {
+               if(b) {
+                       Dom.addClass(this._busyEl, PV.CLASS_BUSY);
+                       this._busy = true;
+               } else {
+                       Dom.removeClass(this._busyEl, PV.CLASS_BUSY);
+                       this._busy = false;
+               }
+       };
+
+       /**
+        * Generages a sorting function based on current sortedBy
+        * values.
+        * @method _createProfilerViewerElement
+        * @private
+        **/
+       proto._genSortFunction = function(key, dir) {
+               var by = key;
+               var direction = dir;
+               return function(a, b) {
+                       if (direction == YAHOO.widget.DataTable.CLASS_ASC) {
+                               return a[by] - b[by];   
+                       } else {
+                               return ((a[by] - b[by]) * -1);
+                       }
+               };
+       };
+
+       /**
+        * Utility function for array sums.
+        * @method _arraySum
+        * @private
+        **/    
+        var _arraySum = function(arr){
+               var ct = 0;
+               for(var i = 0; i < arr.length; ct+=arr[i++]){}
+               return ct;
+       };
+       
+       /**
+        * Retrieves data from Profiler, filtering and sorting as needed
+        * based on current widget state.  Adds calculated percentage
+        * column and function name to data returned by Profiler.
+        * @method _getProfilerData
+        * @private
+        **/
+       proto._getProfilerData = function() {
+               
+               var obj = Profiler.getFullReport();
+               var arr = [];
+               var totalTime = 0;
+               for (name in obj) {
+               if (YAHOO.lang.hasOwnProperty(obj, name)) {
+                               var r = obj[name];
+                               var o = {};
+                               o.fn = name; //add function name to record
+                               o.points = r.points.slice(); //copy live array
+                               o.calls = r.calls;
+                               o.min = r.min;
+                               o.max = r.max;
+                               o.avg = r.avg;
+                               o.total = _arraySum(o.points);
+                               o.points = r.points;
+                               var f = this.get("filter");
+                               if((!f) || (f(o))) {
+                                       arr.push(o);
+                                       totalTime += o.total;
+                               }
+                       }
+               }
+               
+               //add calculated percentage column
+               for (var i = 0, j = arr.length; i < j; i++) {
+                       arr[i].pct = (totalTime) ? (arr[i].total * 100) / totalTime : 0;        
+               }
+
+               var sortedBy = this.get("sortedBy");
+               var key = sortedBy.key;
+               var dir = sortedBy.dir;         
+
+               arr.sort(this._genSortFunction(key, dir));
+               
+               
+               return arr;
+       };
+       
+       /**
+        * Set up the DataTable.
+        * @method _initDataTable
+        * @private
+        */
+       proto._initDataTable = function() {
+               
+               var self = this;
+               
+               //Set up the JS Function DataSource, pulling data from
+               //the Profiler.
+               this._dataSource = new YAHOO.util.DataSource(
+                       function() {
+                               return self._getProfilerData.call(self);        
+                       },
+                       {
+                               responseType: YAHOO.util.DataSource.TYPE_JSARRAY,
+                               maxCacheEntries: 0
+                       }
+               );
+               var ds = this._dataSource;
+
+               ds.responseSchema =
+               {
+                       fields: [ "fn", "avg", "calls", "max", "min", "total", "pct", "points"]
+               };
+               
+               //Set up the DataTable.
+               var formatTimeValue = function(elCell, oRecord, oColumn, oData) {
+                       var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000;
+                       elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev;
+               };
+
+               var formatPercent = function(elCell, oRecord, oColumn, oData) {
+                       var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*100))/100;
+                       elCell.innerHTML = a + "%";
+               };
+               
+               var a = YAHOO.widget.DataTable.CLASS_ASC;
+               var d = YAHOO.widget.DataTable.CLASS_DESC;
+               var c = PV.STRINGS.colHeads;
+               var f = formatTimeValue;
+               
+               var cols = [
+                       {key:"fn", sortable:true, label: c.fn[0],
+                               sortOptions: {defaultDir:a}, 
+                               resizeable: (YAHOO.util.DragDrop) ? true : false,
+                               minWidth:c.fn[1]},
+                       {key:"calls", sortable:true, label: c.calls[0],
+                               sortOptions: {defaultDir:d},
+                               width:c.calls[1]},
+                       {key:"avg", sortable:true, label: c.avg[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.avg[1]},
+                       {key:"min", sortable:true, label: c.min[0],
+                               sortOptions: {defaultDir:a},
+                               formatter:f,
+                               width:c.min[1]}, 
+                       {key:"max", sortable:true, label: c.max[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.max[1]},
+                       {key:"total", sortable:true, label: c.total[0],
+                               sortOptions: {defaultDir:d},
+                               formatter:f,
+                               width:c.total[1]},
+                       {key:"pct", sortable:true, label: c.pct[0],
+                               sortOptions: {defaultDir:d}, 
+                               formatter:formatPercent,
+                               width:c.pct[1]}
+               ];
+
+               this._dataTable = new YAHOO.widget.DataTable(this._tableEl, cols, ds, {
+                       scrollable:true,
+                       height:this.get("tableHeight"),
+                       initialRequest:null,
+                       sortedBy: {
+                               key: "total",
+                               dir: YAHOO.widget.DataTable.CLASS_DESC
+                       }
+               });
+               var dt = this._dataTable;
+
+               //Wire up DataTable events to drive the rest of the UI.
+               dt.subscribe("sortedByChange", this._sortedByChange, this, true);
+               dt.subscribe("renderEvent", this._dataTableRenderHandler, this, true);
+               dt.subscribe("initEvent", this._dataTableRenderHandler, this, true);
+               Event.on(this._tableEl.getElementsByTagName("th"), "click", this._thClickHandler, this, true);
+       };
+               
+       /**
+        * Proxy the sort event in DataTable into the ProfilerViewer
+        * attribute.
+        * @method _sortedByChange
+        * @private
+        **/
+       proto._sortedByChange = function(o) {
+               this.set("sortedBy", {key: o.newValue.key, dir:o.newValue.dir});
+       };
+
+       /**
+        * Proxy the render event in DataTable into the ProfilerViewer
+        * attribute.
+        * @method _dataTableRenderHandler
+        * @private
+        **/
+       proto._dataTableRenderHandler = function(o) {
+               this._setBusyState(false);
+       };
+       
+       /**
+        * Event handler for clicks on the DataTable's sortable column
+        * heads.
+        * @method _thClickHandler
+        * @private
+        **/
+       proto._thClickHandler = function(o) {
+               this._setBusyState(true);
+       };
+
+       /**
+        * Refresh DataTable, getting new data from Profiler.
+        * @method _refreshDataTable
+        * @private
+        **/
+       proto._refreshDataTable = function(args) {
+               var dt = this._dataTable;
+               dt.getDataSource().sendRequest("", dt.onDataReturnInitializeTable, dt);
+       };
+
+       /**
+        * Refresh chart, getting new data from table.
+        * @method _refreshChart
+        * @private
+        **/
+       proto._refreshChart = function() {
+               
+               switch (this.get("sortedBy").key) {
+                       case "fn":
+                               /*Keep the same data on the chart, but force update to 
+                                 reflect new sort order on function/method name: */
+                               this._chart.set("dataSource", this._chart.get("dataSource"));
+                               
+                               /*no further action necessary; chart redraws*/
+                               return;
+                       case "calls":
+                               /*Null out the xAxis formatting before redrawing chart.*/
+                               this._chart.set("xAxis", this._chartAxisDefinitionPlain);
+                               break;
+                       case "pct":
+                               this._chart.set("xAxis", this._chartAxisDefinitionPercent);
+                               break;
+                       default:
+                               /*Set the default xAxis; redraw legend; set the new series definition.*/
+                               this._chart.set("xAxis", this._chartAxisDefinitionTime);
+                               break;
+               }
+               
+               this._drawChartLegend();
+               this._chart.set("series", this._getSeriesDef(this.get("sortedBy").key));
+
+       };
+       
+       /**
+        * Get data for the Chart from DataTable recordset
+        * @method _getChartData
+        * @private
+        */
+       proto._getChartData = function() {
+               var records = this._dataTable.getRecordSet().getRecords(0, this.get("maxChartFunctions"));
+               var arr = [];
+               for (var i = records.length - 1; i>-1; i--) {
+                       arr.push(records[i].getData()); 
+               }
+               return arr;
+       };
+       
+       /**
+        * Build series definition based on current configuration attributes.
+        * @method _getSeriesDef
+        * @private
+        */
+       proto._getSeriesDef = function(field) {
+               var sd = this.get("chartSeriesDefinitions")[field];
+               var arr = [];
+               for(var i = 0, j = sd.group.length; i<j; i++) {
+                       var c = this.get("chartSeriesDefinitions")[sd.group[i]];
+                       arr.push(
+                               {displayName:c.displayName,
+                                xField:c.xField,
+                                style: {color:c.style.color, size:c.style.size}
+                               }
+                       );
+               }
+               
+               return arr;
+       };
+       
+       /**
+        * Set up the Chart.
+        * @method _initChart
+        * @private
+        */
+       proto._initChart = function() {
+               
+               this._sizeChartCanvas();
+               
+               YAHOO.widget.Chart.SWFURL = this.get("swfUrl");
+
+               var self = this;
+
+               //Create DataSource based on records currently displayed
+               //at the top of the sort list in the DataTable.
+               var ds = new YAHOO.util.DataSource(
+                       //force the jsfunction DataSource to run in the scope of
+                       //the ProfilerViewer, not in the YAHOO.util.DataSource scope:
+                       function() {
+                               return self._getChartData.call(self);
+                       }, 
+                       {
+                               responseType: YAHOO.util.DataSource.TYPE_JSARRAY,
+                               maxCacheEntries: 0
+                       }
+               );
+
+               ds.responseSchema =
+               {
+                       fields: [ "fn", "avg", "calls", "max", "min", "total", "pct" ]
+               };
+               
+               ds.subscribe('responseEvent', this._sizeChartCanvas, this, true);
+               
+               //Set up the chart itself.
+               this._chartAxisDefinitionTime = new YAHOO.widget.NumericAxis();
+               this._chartAxisDefinitionTime.labelFunction = "YAHOO.widget.ProfilerViewer.timeAxisLabelFunction";
+               
+               this._chartAxisDefinitionPercent = new YAHOO.widget.NumericAxis();
+               this._chartAxisDefinitionPercent.labelFunction = "YAHOO.widget.ProfilerViewer.percentAxisLabelFunction";
+
+               this._chartAxisDefinitionPlain = new YAHOO.widget.NumericAxis();
+               
+               this._chart = new YAHOO.widget.BarChart( this._chartEl, ds,
+               {
+                       yField: "fn",
+                       series: this._getSeriesDef(this.get("sortedBy").key),
+                       style: this.get("chartStyle"),
+                       xAxis: this._chartAxisDefinitionTime
+               } );
+               
+               this._drawChartLegend();
+               this._chartInitialized = true;
+               this._dataTable.unsubscribe("initEvent", this._initChart, this);
+               this._dataTable.subscribe("initEvent", this._refreshChart, this, true);
+               
+       };
+       
+       /**
+        * Set up the Chart's legend
+        * @method _drawChartLegend
+        * @private
+        **/
+       proto._drawChartLegend = function() {
+               var seriesDefs = this.get("chartSeriesDefinitions");
+               var currentDef = seriesDefs[this.get("sortedBy").key];
+               var l = this._chartLegendEl;
+               l.innerHTML = "";
+               for(var i = 0, j = currentDef.group.length; i<j; i++) {
+                       var c = seriesDefs[currentDef.group[i]];
+                       var dt = document.createElement("dt");
+                       Dom.setStyle(dt, "backgroundColor", "#" + c.style.color);
+                       var dd = document.createElement("dd");
+                       dd.innerHTML = c.displayName;
+                       l.appendChild(dt);
+                       l.appendChild(dd);
+               }
+       };
+       
+       /**
+        * Resize the chart's canvas if based on number of records
+        * returned from the chart's datasource.
+        * @method _sizeChartCanvas
+        * @private
+        **/
+       proto._sizeChartCanvas = function(o) {
+               var bars = (o) ? o.response.length : this.get("maxChartFunctions");
+               var s = (bars * 36) + 34;
+               if (s != parseInt(this._chartElHeight, 10)) {
+                       this._chartElHeight = s;
+                       Dom.setStyle(this._chartEl, "height", s + "px");
+               }
+       };
+
+    /**
+     * setAttributeConfigs TabView specific properties.
+     * @method initAttributes
+     * @param {Object} attr Hash of initial attributes
+        * @method initAttributes
+        * @private
+     */
+    proto.initAttributes = function(attr) {
+        YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr);
+        /**
+         * The YUI Loader base path from which to pull YUI files needed
+                * in the rendering of the ProfilerViewer canvas.  Passed directly
+                * to YUI Loader.  Leave blank to draw files from
+                * yui.yahooapis.com.
+         * @attribute base
+         * @type string
+                * @default ""
+         */
+        this.setAttributeConfig('base', {
+            value: attr.base
+        });
+
+        /**
+         * The height of the DataTable.  The table will scroll
+                * vertically if the content overflows the specified
+                * height.
+         * @attribute tableHeight
+         * @type string
+                * @default "15em"
+         */
+        this.setAttributeConfig('tableHeight', {
+            value: attr.tableHeight || "15em",
+                       method: function(s) {
+                               if(this._dataTable) {
+                                       this._dataTable.set("height", s);
+                               }
+                       }
+        });
+               
+        /**
+         * The default column key to sort by.  Valid keys are: fn, calls,
+                * avg, min, max, total.  Valid dir values are: 
+                * YAHOO.widget.DataTable.CLASS_ASC and
+                * YAHOO.widget.DataTable.CLASS_DESC (or their
+                * string equivalents).
+         * @attribute sortedBy
+         * @type string
+                * @default {key:"total", dir:"yui-dt-desc"}
+         */
+        this.setAttributeConfig('sortedBy', {
+            value: attr.sortedBy || {key:"total", dir:"yui-dt-desc"}
+        });
+
+        /**
+         * A filter function to use in selecting functions that will
+                * appear in the ProfilerViewer report.  The function is passed
+                * a function report object and should return a boolean indicating
+                * whether that function should be included in the ProfilerViewer
+                * display.  The argument is structured as follows:
+                *
+                * {
+                *              fn: <str function name>,
+                *              calls : <n number of calls>,
+                *              avg : <n average call duration>,
+                *              max: <n duration of longest call>,
+                *              min: <n duration of shortest call>,
+                *              total: <n total time of all calls>
+                *              points : <array time in ms of each call>
+                *      }
+                *
+                * For example, you would use the follwing filter function to 
+                * return only functions that have been called at least once:
+                * 
+                *      function(o) {
+                *              return (o.calls > 0);
+                *      }
+                *
+         * @attribute filter
+         * @type function
+                * @default null
+         */
+        this.setAttributeConfig('filter', {
+            value: attr.filter || null,
+                       validator: YAHOO.lang.isFunction
+        });
+
+               /**
+                * The path to the YUI Charts swf file; must be a full URI
+                * or a path relative to the page being profiled. Changes at runtime
+                * not supported; pass this value in at instantiation.
+                * @attribute swfUrl
+                * @type string
+                * @default "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf"
+                */
+               this.setAttributeConfig('swfUrl', {
+                       value: attr.swfUrl || "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf"
+               });
+
+        /**
+         * The maximum number of functions to profile in the chart. The
+                * greater the number of functions, the greater the height of the
+                * chart canvas.
+                * height.
+         * @attribute maxChartFunctions
+         * @type int
+                * @default 6
+         */
+        this.setAttributeConfig('maxChartFunctions', {
+            value: attr.maxChartFunctions || 6,
+                       method: function(s) {
+                               if(this._rendered) {
+                                       this._sizeChartCanvas();
+                               }
+                       },
+                       validator: YAHOO.lang.isNumber
+        });
+               
+        /**
+         * The style object that defines the chart's visual presentation.
+                * Conforms to the style attribute passed to the Charts Control
+                * constructor.  See Charts Control User's Guide for more information
+                * on how to format this object.
+         * @attribute chartStyle
+         * @type obj
+                * @default See JS source for default definitions.
+         */
+        this.setAttributeConfig('chartStyle', {
+            value:     attr.chartStyle || {
+                               font:
+                                       {
+                                               name: "Arial",
+                                               color: 0xeeee5c,
+                                               size: 12
+                                       },
+                                       background:
+                                       {
+                                               color: "6e6e63"
+                                       }
+                               },
+                       method: function() {
+                                       if(this._rendered && this.get("showChart")) {
+                                               this._refreshChart();
+                                       }
+                               }
+        });
+               
+        /**
+         * The series definition information to use when charting
+                * specific fields on the chart.  displayName, xField,
+                * and style members are used to construct the series
+                * definition; the "group" member is the array of fields
+                * that should be charted when the table is sorted by a
+                * given field.
+         * @attribute chartSeriesDefinitions
+         * @type obj
+                * @default See JS source for full default definitions.
+         */
+        this.setAttributeConfig('chartSeriesDefinitions', {
+            value:     attr.chartSeriesDefinitions ||  {
+                                               total: {
+                                                       displayName: PV.STRINGS.colHeads.total[0],
+                                                       xField: "total",
+                                                       style: {color:"4d95dd", size:20},
+                                                       group: ["total"]
+                                               },
+                                               calls: {                
+                                                       displayName: PV.STRINGS.colHeads.calls[0],
+                                                       xField: "calls",
+                                                       style: {color:"edff9f", size:20},
+                                                       group: ["calls"]
+                                               },
+                                               avg: {
+                                                       displayName: PV.STRINGS.colHeads.avg[0],
+                                                       xField: "avg",
+                                                       style: {color:"209daf", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               min: {
+                                                       displayName: PV.STRINGS.colHeads.min[0],
+                                                       xField: "min",
+                                                       style: {color:"b6ecf4", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               max: {
+                                                       displayName: PV.STRINGS.colHeads.max[0],
+                                                       xField: "max",
+                                                       style: {color:"29c7de", size:9},
+                                                       group: ["avg", "min", "max"]
+                                               },
+                                               pct: {
+                                                       displayName: PV.STRINGS.colHeads.pct[0],
+                                                       xField: "pct",
+                                                       style: {color:"C96EDB", size:20},
+                                                       group: ["pct"]
+                                               }
+                               },
+                       method: function() {
+                                       if(this._rendered && this.get("showChart")) {
+                                               this._refreshChart();
+                                       }
+                               }
+        });
+               
+        /**
+         * The default visibility setting for the viewer canvas. If true,
+                * the viewer will load all necessary files and render itself
+                * immediately upon instantiation; otherwise, the viewer will
+                * load only minimal resources until the user toggles visibility
+                * via the UI.
+         * @attribute visible
+         * @type boolean
+                * @default false
+         */
+        this.setAttributeConfig('visible', {
+            value: attr.visible || false,
+                       validator: YAHOO.lang.isBoolean,
+                       method: function(b) {
+                               if(b) {
+                                       this._show();
+                               } else {
+                                       if (this._rendered) {
+                                               this._hide();
+                                       }
+                               }
+                       }
+        });
+
+        /**
+         * The default visibility setting for the chart.
+         * @attribute showChart
+         * @type boolean
+                * @default true
+         */
+        this.setAttributeConfig('showChart', {
+            value: attr.showChart || true,
+                       validator: YAHOO.lang.isBoolean,
+                       writeOnce: true
+                       
+        });
+               
+               YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr);
+               
+    };
+       
+})();
+YAHOO.register("profilerviewer", YAHOO.widget.ProfilerViewer, {version: "2.5.0", build: "895"});
index 4deb804abe3915b4e79667826d934d09a7be0f36..58fbb286a8ae1427a085f6859601b602cc409612 100755 (executable)
@@ -12,6 +12,10 @@ grids/README
 
 ************
 
+Version 2.3.1
+
+  * Fixed bug in Grids. See Grids 2.3.1 README for info.
+
 Version 2.3.0
 
   * Changes to all three components.
index a21e2c4458654f1126e068957975f4f692e2b606..0cabfc050fa5f83d06a02797bfbbee154236c5e3 100755 (executable)
@@ -1,9 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-/*reset.css*/body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
-/*fonts.css*/body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:99%;}
-/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.117em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{_margin-left:1.2%;*margin-left:1.7%;}.yui-g .yui-gb .yui-u{_margin-left:.8%;}.yui-gb .yui-u{margin-left:2%;width:32%;float:right;*width:31.8%;}.yui-gb div.first{margin-left:0;*margin-right:1px;float:left;}.yui-gb .yui-gb div.first{*margin-right:0;width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first{float:left;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-gb .yui-gc .yui-u,.yui-g .yui-gc .yui-u{_float:right;width:32%;_width:29.9%;}.yui-gb .yui-gc div.first{width:66%;*width:64.5%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:1px;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{_width:48.1%;*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u{width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first{width:24%;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b {margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.50em;}.yui-t3 #yui-main .yui-b {margin-left:24.0759em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b {margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b {margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b {float:none;width:auto;}.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gb .yui-u,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:1.99%;width:32%;}#doc3 .yui-gb .yui-u{*width:31.9%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;color:red;}.yui-gb div.first{margin-left:0;float:left;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u {width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first {width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u {margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf {width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first {margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u {width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first {width:32%;}.yui-g .yui-gd div.first {_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first {width:24%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u {float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first {float:left;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first {*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
diff --git a/lib/yui/reset-fonts/README b/lib/yui/reset-fonts/README
new file mode 100644 (file)
index 0000000..fa43e8a
--- /dev/null
@@ -0,0 +1,19 @@
+YUI Library - Reset+Fonts (RF) - Release Notes
+
+*** NOTE ***
+
+This document is not updated with each release.  Changes to
+the reset-fonts.css source are noted in the README
+file for each component that comprises this aggregate:
+
+reset/README
+fonts/README
+
+************
+
+Version 2.4.0
+
+  * Initial release.
+
+  * This file is a convenience file containing an in-order 
+    concatonation of Reset and Fonts.
diff --git a/lib/yui/reset-fonts/reset-fonts.css b/lib/yui/reset-fonts/reset-fonts.css
new file mode 100644 (file)
index 0000000..d6e7771
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
index d84ebcca57bafc32f46c669cb1571da4736caeca..ba10a1a3b420a8041cb892357561e2902daf6497 100755 (executable)
@@ -1,5 +1,16 @@
 YUI Library - Reset - Release Notes
 
+Version 2.5.0
+
+  * Added input,textarea,select{*font-size:100%;} to enable resizing on IE
+
+Version 2.4.0
+
+  * Moved background and default font color to HTML from BODY
+  * Removed invalid sub/sup negative line-height values because they
+    were invalid and because they weren't have a big impact.
+  * Added legent element color to accomodate IE6 issues.
+
 Version 2.3.0
 
   * Removed: ul,ol {list-style:none;}
index 49362c9d9cfd959613153764c2bfea1752070532..e243f4885262ab08be1e452a7843d57190fb13ac 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
\ No newline at end of file
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
\ No newline at end of file
index 33735c64b86a9d4d3061813cc2b31ed246b2500b..7c34f663601292380b9a45190cf3f18109bdf617 100755 (executable)
@@ -1,19 +1,24 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-body {color:#000;background:#FFF;}
+html{color:#000;background:#FFF;}
 body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
 table{border-collapse:collapse;border-spacing:0;}
 fieldset,img{border:0;}
 address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
-li {list-style:none;}
-caption,th {text-align:left;}
+li{list-style:none;}
+caption,th{text-align:left;}
 h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
 q:before,q:after{content:'';}
 abbr,acronym {border:0;font-variant:normal;}
-sup,sub {line-height:-1px;vertical-align: text-top;}
+/* to preserve line-height and selector appearance */
+sup {vertical-align:text-top;}
 sub {vertical-align:text-bottom;}
-input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
\ No newline at end of file
+input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}
+/*to enable resizing for IE*/
+input,textarea,select{*font-size:100%;}
+/*because legend doesn't inherit in IE */
+legend{color:#000;}
\ No newline at end of file
diff --git a/lib/yui/resize/README b/lib/yui/resize/README
new file mode 100644 (file)
index 0000000..84e27d4
--- /dev/null
@@ -0,0 +1,3 @@
+**** version 2.5.0 ***
+
+Initial Release
diff --git a/lib/yui/resize/assets/resize-core.css b/lib/yui/resize/assets/resize-core.css
new file mode 100644 (file)
index 0000000..16f8d39
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-resize {
+    position: relative;
+    zoom: 1;
+    z-index: 0;
+}
+.yui-resize-wrap {
+    zoom: 1;
+}
+
+.yui-draggable {
+    cursor: move;
+}
+
+.yui-resize .yui-resize-handle {
+    position: absolute;
+    z-index: 1;
+    font-size: 0;
+    margin: 0;
+    padding: 0;
+    zoom: 1;
+    height: 1px;
+    width: 1px;
+}
+.yui-resize .yui-resize-handle-br {
+    height: 5px;
+    width: 5px;
+    bottom: 0;
+    right: 0;
+    cursor: se-resize;
+    z-index: 2;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-bl {
+    height: 5px;
+    width: 5px;
+    bottom: 0;
+    left: 0;
+    cursor: sw-resize;
+    z-index: 2;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-tl {
+    height: 5px;
+    width: 5px;
+    top: 0;
+    left: 0;
+    cursor: nw-resize;
+    z-index: 2;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-tr {
+    height: 5px;
+    width: 5px;
+    top: 0;
+    right: 0;
+    cursor: ne-resize;
+    z-index: 2;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-r {
+    width: 5px;
+    height: 100%;
+    top: 0;
+    right: 0;
+    cursor: e-resize;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-l {
+    height: 100%;
+    width: 5px;
+    top: 0;
+    left: 0;
+    cursor: w-resize;
+    zoom: 1;
+}
+
+.yui-resize .yui-resize-handle-b {
+    width: 100%;
+    height: 5px;
+    bottom: 0;
+    right: 0;
+    cursor: s-resize;
+    zoom: 1;
+}
+.yui-resize .yui-resize-handle-t {
+    width: 100%;
+    height: 5px;
+    top: 0;
+    right: 0;
+    cursor: n-resize;
+    zoom: 1;
+}
+.yui-resize-proxy {
+    position: absolute;
+    border: 1px dashed #000;
+    visibility: hidden;
+    z-index: 1000;
+}
+
+.yui-resize-hover .yui-resize-handle,
+.yui-resize-hidden .yui-resize-handle {
+    opacity: 0;
+    filter: alpha(opacity=0);
+}
+.yui-resize-ghost {
+    opacity: .5;
+    filter: alpha(opacity=50);
+}
+
+.yui-resize-knob .yui-resize-handle {
+    height: 6px;
+    width: 6px;
+}
+.yui-resize-knob .yui-resize-handle-tr {
+    right: -3px;
+    top: -3px;
+}
+.yui-resize-knob .yui-resize-handle-tl {
+    left: -3px;
+    top: -3px;
+}
+.yui-resize-knob .yui-resize-handle-bl {
+    left: -3px;
+    bottom: -3px;
+}
+.yui-resize-knob .yui-resize-handle-br {
+    right: -3px;
+    bottom: -3px;
+}
+.yui-resize-knob .yui-resize-handle-t {
+    left: 45%;
+    top: -3px;
+}
+.yui-resize-knob .yui-resize-handle-r {
+    right: -3px;
+    top: 45%;
+}
+.yui-resize-knob .yui-resize-handle-l {
+    left: -3px;
+    top: 45%;
+}
+.yui-resize-knob .yui-resize-handle-b {
+    left: 45%;
+    bottom: -3px;
+}
+
+.yui-resize-status {
+    position: absolute;
+    top: -999px;
+    left: -999px;
+    padding: 2px;
+    font-size: 80%;
+    display: none;
+    zoom: 1; /* IE hasLayout */
+    z-index: 9999;
+}
+.yui-resize-status strong, .yui-resize-status em {
+    font-weight: normal;
+    font-style: normal;
+    padding: 1px;
+    zoom: 1;
+}
diff --git a/lib/yui/resize/assets/skins/sam/layout_sprite.png b/lib/yui/resize/assets/skins/sam/layout_sprite.png
new file mode 100644 (file)
index 0000000..d6fce3c
Binary files /dev/null and b/lib/yui/resize/assets/skins/sam/layout_sprite.png differ
diff --git a/lib/yui/resize/assets/skins/sam/resize-skin.css b/lib/yui/resize/assets/skins/sam/resize-skin.css
new file mode 100644 (file)
index 0000000..2b2333c
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/* Give the handle a background color */
+.yui-skin-sam .yui-resize .yui-resize-handle {
+    background-color: #F2F2F2;
+}
+/* Give the active handle a different color */
+.yui-skin-sam .yui-resize .yui-resize-handle-active {
+    background-color: #7D98B8;
+    zoom: 1;
+}
+/* Give a border to the 8-way knob style handles */
+.yui-skin-sam .yui-resize-knob .yui-resize-handle {
+    border: 1px solid #808080;
+}
+/* Show the active handle when hovered */
+.yui-skin-sam .yui-resize-hover .yui-resize-handle-active {
+    opacity: 1;
+    filter: alpha(opacity=100);
+}
+
+/* Style the resize proxy */
+.yui-skin-sam .yui-resize-proxy {
+    border: 1px dashed #426FD9;
+}
+
+/* Style the status box similar to a tooltip */
+.yui-skin-sam .yui-resize-status {
+    border: 1px solid #A6982B;
+    border-top: 1px solid #D4C237;
+    background-color: #FFEE69
+}
+
+
+/* Style the content of the status box */
+.yui-skin-sam .yui-resize-status strong, .yui-skin-sam .yui-resize-status em {
+    float: left;
+    display: block;
+    clear: both;
+    padding: 1px;
+    text-align: center;
+}
+
+/* Setup the gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-inner-r,
+.yui-skin-sam .yui-resize .yui-resize-handle-inner-l {
+    background: transparent url( layout_sprite.png) no-repeat 0 -5px;
+    height: 16px;
+    width: 5px;
+    position: absolute;
+    top: 45%;
+}
+
+/* Setup the gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-inner-t,
+.yui-skin-sam .yui-resize .yui-resize-handle-inner-b {
+    background: transparent url(layout_sprite.png) no-repeat -20px 0;
+    height: 5px;
+    width: 16px;
+    position: absolute;
+    left: 50%;
+}
+
+/* Bottom Right Gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-br {
+    background-image: url( layout_sprite.png );
+    background-repeat: no-repeat;
+    background-position: -22px -62px;
+}
+
+/* Top Right Gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-tr {
+    background-image: url( layout_sprite.png );
+    background-repeat: no-repeat;
+    background-position: -22px -42px;
+}
+
+/* Top Left Gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-tl {
+    background-image: url( layout_sprite.png );
+    background-repeat: no-repeat;
+    background-position: -22px -82px;
+}
+
+/* Bottom Left Gripper */
+.yui-skin-sam .yui-resize .yui-resize-handle-bl {
+    background-image: url( layout_sprite.png );
+    background-repeat: no-repeat;
+    background-position: -22px -23px;
+}
+
+/* Remove the background image from the 8-way knobs */
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-t,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-b,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-br,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl,
+.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br {
+    background-image: none;
+}
diff --git a/lib/yui/resize/assets/skins/sam/resize.css b/lib/yui/resize/assets/skins/sam/resize.css
new file mode 100644 (file)
index 0000000..45a907d
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+.yui-resize{position:relative;zoom:1;z-index:0;}.yui-resize-wrap{zoom:1;}.yui-draggable{cursor:move;}.yui-resize .yui-resize-handle{position:absolute;z-index:1;font-size:0;margin:0;padding:0;zoom:1;height:1px;width:1px;}.yui-resize .yui-resize-handle-br{height:5px;width:5px;bottom:0;right:0;cursor:se-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-bl{height:5px;width:5px;bottom:0;left:0;cursor:sw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tl{height:5px;width:5px;top:0;left:0;cursor:nw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tr{height:5px;width:5px;top:0;right:0;cursor:ne-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-r{width:5px;height:100%;top:0;right:0;cursor:e-resize;zoom:1;}.yui-resize .yui-resize-handle-l{height:100%;width:5px;top:0;left:0;cursor:w-resize;zoom:1;}.yui-resize .yui-resize-handle-b{width:100%;height:5px;bottom:0;right:0;cursor:s-resize;zoom:1;}.yui-resize .yui-resize-handle-t{width:100%;height:5px;top:0;right:0;cursor:n-resize;zoom:1;}.yui-resize-proxy{position:absolute;border:1px dashed #000;visibility:hidden;z-index:1000;}.yui-resize-hover .yui-resize-handle,.yui-resize-hidden .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-resize-ghost{opacity:.5;filter:alpha(opacity=50);}.yui-resize-knob .yui-resize-handle{height:6px;width:6px;}.yui-resize-knob .yui-resize-handle-tr{right:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-tl{left:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-bl{left:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-br{right:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-t{left:45%;top:-3px;}.yui-resize-knob .yui-resize-handle-r{right:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-l{left:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-b{left:45%;bottom:-3px;}.yui-resize-status{position:absolute;top:-999px;left:-999px;padding:2px;font-size:80%;display:none;zoom:1;z-index:9999;}.yui-resize-status strong,.yui-resize-status em{font-weight:normal;font-style:normal;padding:1px;zoom:1;}.yui-skin-sam .yui-resize .yui-resize-handle{background-color:#F2F2F2;}.yui-skin-sam .yui-resize .yui-resize-handle-active{background-color:#7D98B8;zoom:1;}.yui-skin-sam .yui-resize-knob .yui-resize-handle{border:1px solid #808080;}.yui-skin-sam .yui-resize-hover .yui-resize-handle-active{opacity:1;filter:alpha(opacity=100);}.yui-skin-sam .yui-resize-proxy{border:1px dashed #426FD9;}.yui-skin-sam .yui-resize-status{border:1px solid #A6982B;border-top:1px solid #D4C237;background-color:#FFEE69}.yui-skin-sam .yui-resize-status strong,.yui-skin-sam .yui-resize-status em{float:left;display:block;clear:both;padding:1px;text-align:center;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize .yui-resize-handle-inner-l{background:transparent url( layout_sprite.png) no-repeat 0 -5px;height:16px;width:5px;position:absolute;top:45%;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize .yui-resize-handle-inner-b{background:transparent url(layout_sprite.png) no-repeat -20px 0;height:5px;width:16px;position:absolute;left:50%;}.yui-skin-sam .yui-resize .yui-resize-handle-br{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -62px;}.yui-skin-sam .yui-resize .yui-resize-handle-tr{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -42px;}.yui-skin-sam .yui-resize .yui-resize-handle-tl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -82px;}.yui-skin-sam .yui-resize .yui-resize-handle-bl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -23px;}.yui-skin-sam .yui-resize-knob .yui-resize-handle-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-br,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br{background-image:none;}
diff --git a/lib/yui/resize/resize-beta-debug.js b/lib/yui/resize/resize-beta-debug.js
new file mode 100644 (file)
index 0000000..b1d2583
--- /dev/null
@@ -0,0 +1,1640 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Makes an element resizable</p>
+ * @namespace YAHOO.util
+ * @requires yahoo, dom, dragdrop, element, event
+ * @optional animation
+ * @module resize
+ * @beta
+ */
+(function() {
+var D = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class Resize
+     * @extends YAHOO.util.Element
+     * @description <p>Makes an element resizable</p>
+     * @param {String/HTMLElement} el The element to make resizable.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var Resize = function(el, config) {
+        YAHOO.log('Creating Resize Object', 'info', 'Resize');
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Resize.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all resize instances
+    * @type Object
+    */ 
+    Resize._instances = {};
+    /**
+    * @static
+    * @method getResizeById 
+    * @description Get's a resize object by the HTML id of the element associated with the Resize object.
+    * @return {Object} The Resize Object
+    */ 
+    Resize.getResizeById = function(id) {
+        if (Resize._instances[id]) {
+            return Resize._instances[id];
+        }
+        YAHOO.log('No Instance Found', 'error', 'Resize');
+        return false;
+    };
+
+    YAHOO.extend(Resize, YAHOO.util.Element, {
+        /**
+        * @private
+        * @property CSS_RESIZE
+        * @description Base CSS class name
+        * @type String
+        */ 
+        CSS_RESIZE: 'yui-resize',
+        /**
+        * @private
+        * @property CSS_DRAG
+        * @description Class name added when dragging is enabled
+        * @type String
+        */ 
+        CSS_DRAG: 'yui-draggable',
+        /**
+        * @private
+        * @property CSS_HOVER
+        * @description Class name used for hover only handles
+        * @type String
+        */ 
+        CSS_HOVER: 'yui-resize-hover',
+        /**
+        * @private
+        * @property CSS_PROXY
+        * @description Class name given to the proxy element
+        * @type String
+        */ 
+        CSS_PROXY: 'yui-resize-proxy',
+        /**
+        * @private
+        * @property CSS_WRAP
+        * @description Class name given to the wrap element
+        * @type String
+        */ 
+        CSS_WRAP: 'yui-resize-wrap',
+        /**
+        * @private
+        * @property CSS_KNOB
+        * @description Class name used to make the knob style handles
+        * @type String
+        */ 
+        CSS_KNOB: 'yui-resize-knob',
+        /**
+        * @private
+        * @property CSS_HIDDEN
+        * @description Class name given to the wrap element to make all handles hidden
+        * @type String
+        */ 
+        CSS_HIDDEN: 'yui-resize-hidden',
+        /**
+        * @private
+        * @property CSS_HANDLE
+        * @description Class name given to all handles, used as a base for single handle names as well.. Handle "t" will get this.CSS_HANDLE + '-t' as well as this.CSS_HANDLE
+        * @type String
+        */ 
+        CSS_HANDLE: 'yui-resize-handle',
+        /**
+        * @private
+        * @property CSS_STATUS
+        * @description Class name given to the status element
+        * @type String
+        */ 
+        CSS_STATUS: 'yui-resize-status',
+        /**
+        * @private
+        * @property CSS_GHOST
+        * @description Class name given to the wrap element when the ghost property is active
+        * @type String
+        */ 
+        CSS_GHOST: 'yui-resize-ghost',
+        /**
+        * @private
+        * @property CSS_RESIZING
+        * @description Class name given to the wrap element when a resize action is taking place.
+        * @type String
+        */ 
+        CSS_RESIZING: 'yui-resize-resizing',
+        /**
+        * @private
+        * @property _resizeEvent
+        * @description The mouse event used to resize with
+        * @type Event
+        */ 
+        _resizeEvent: null,
+        /**
+        * @private
+        * @property dd
+        * @description The <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instance used if draggable is true
+        * @type Object
+        */ 
+        dd: null,
+        /** 
+        * @private
+        * @property browser
+        * @description A copy of the YAHOO.env.ua property
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /** 
+        * @private
+        * @property _positioned
+        * @description A flag to show if the element is absolutely positioned
+        * @type Boolean
+        */
+        _positioned: null,
+        /** 
+        * @private
+        * @property _dds
+        * @description An Object containing references to all of the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instances used for the resize handles
+        * @type Object
+        */
+        _dds: null,
+        /** 
+        * @private
+        * @property _wrap
+        * @description The HTML reference of the element wrapper
+        * @type HTMLElement
+        */
+        _wrap: null,
+        /** 
+        * @private
+        * @property _proxy
+        * @description The HTML reference of the element proxy
+        * @type HTMLElement
+        */
+        _proxy: null,
+        /** 
+        * @private
+        * @property _handles
+        * @description An object containing references to all of the resize handles.
+        * @type Object
+        */
+        _handles: null,
+        /** 
+        * @private
+        * @property _currentHandle
+        * @description The string identifier of the currently active handle. e.g. 'r', 'br', 'tl'
+        * @type String
+        */
+        _currentHandle: null,
+        /** 
+        * @private
+        * @property _currentDD
+        * @description A link to the currently active DD object
+        * @type Object
+        */
+        _currentDD: null,
+        /** 
+        * @private
+        * @property _cache
+        * @description An lookup table containing key information for the element being resized. e.g. height, width, x position, y position, etc..
+        * @type Object
+        */
+        _cache: null,
+        /** 
+        * @private
+        * @property _active
+        * @description Flag to show if the resize is active. Used for events.
+        * @type Boolean
+        */
+        _active: null,
+        /** 
+        * @private
+        * @method _createProxy
+        * @description Creates the proxy element if the proxy config is true
+        */
+        _createProxy: function() {
+            if (this.get('proxy')) {
+                YAHOO.log('Creating the Proxy Element', 'info', 'Resize');
+                this._proxy = document.createElement('div');
+                this._proxy.className = this.CSS_PROXY;
+                this._proxy.style.height = this.get('element').clientHeight + 'px';
+                this._proxy.style.width = this.get('element').clientWidth + 'px';
+                this._wrap.parentNode.appendChild(this._proxy);
+            } else {
+                YAHOO.log('No proxy element, turn off animate config option', 'info', 'Resize');
+                this.set('animate', false);
+            }
+        },
+        /** 
+        * @private
+        * @method _createWrap
+        * @description Creates the wrap element if the wrap config is true. It will auto wrap the following element types: img, textarea, input, iframe, select
+        */
+        _createWrap: function() {
+            YAHOO.log('Create the wrap element', 'info', 'Resize');
+            this._positioned = false;
+            //Force wrap for elements that can't have children 
+            switch (this.get('element').tagName.toLowerCase()) {
+                case 'img':
+                case 'textarea':
+                case 'input':
+                case 'iframe':
+                case 'select':
+                    this.set('wrap', true);
+                    YAHOO.log('Auto-wrapping the element (' + this.get('element').tagName.toLowerCase() + ')', 'warn', 'Resize');
+                    break;
+            }
+            if (this.get('wrap')) {
+                YAHOO.log('Creating the wrap element', 'info', 'Resize');
+                this._wrap = document.createElement('div');
+                this._wrap.id = this.get('element').id + '_wrap';
+                this._wrap.className = this.CSS_WRAP;
+                D.setStyle(this._wrap, 'width', this.get('width'));
+                D.setStyle(this._wrap, 'height', this.get('height'));
+                D.setStyle(this._wrap, 'z-index', this.getStyle('z-index'));
+                this.setStyle('z-index', 0);
+                var pos = D.getStyle(this.get('element'), 'position');
+                D.setStyle(this._wrap, 'position', ((pos == 'static') ? 'relative' : pos));
+                D.setStyle(this._wrap, 'top', D.getStyle(this.get('element'), 'top'));
+                D.setStyle(this._wrap, 'left', D.getStyle(this.get('element'), 'left'));
+                if (D.getStyle(this.get('element'), 'position') == 'absolute') {
+                    this._positioned = true;
+                    YAHOO.log('The element is positioned absolute', 'info', 'Resize');
+                    D.setStyle(this.get('element'), 'position', 'relative');
+                    D.setStyle(this.get('element'), 'top', '0');
+                    D.setStyle(this.get('element'), 'left', '0');
+                }
+                var par = this.get('element').parentNode;
+                par.replaceChild(this._wrap, this.get('element'));
+                this._wrap.appendChild(this.get('element'));
+            } else {
+                this._wrap = this.get('element');
+                if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                    this._positioned = true;
+                }
+            }
+            if (this.get('draggable')) {
+                this._setupDragDrop();
+            }
+            if (this.get('hover')) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            if (this.get('knobHandles')) {
+                D.addClass(this._wrap, this.CSS_KNOB);
+            }
+            if (this.get('hiddenHandles')) {
+                D.addClass(this._wrap, this.CSS_HIDDEN);
+            }
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _setupDragDrop
+        * @description Setup the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instance on the element
+        */
+        _setupDragDrop: function() {
+            YAHOO.log('Setting up the dragdrop instance on the element', 'info', 'Resize');
+            D.addClass(this._wrap, this.CSS_DRAG);
+            this.dd = new YAHOO.util.DD(this._wrap, this.get('id') + '-resize', { dragOnly: true });
+            this.dd.on('dragEvent', function() {
+                this.fireEvent('dragEvent', arguments);
+            }, this, true);
+        },
+        /** 
+        * @private
+        * @method _createHandles
+        * @description Creates the handles as specified in the config
+        */
+        _createHandles: function() {
+            YAHOO.log('Creating the handles', 'info', 'Resize');
+            this._handles = {};
+            this._dds = {};
+            var h = this.get('handles');
+            for (var i = 0; i < h.length; i++) {
+                YAHOO.log('Creating handle position: ' + h[i], 'info', 'Resize');
+                this._handles[h[i]] = document.createElement('div');
+                this._handles[h[i]].id = D.generateId(this._handles[h[i]]);
+                this._handles[h[i]].className = this.CSS_HANDLE + ' ' + this.CSS_HANDLE + '-' + h[i];
+                var k = document.createElement('div');
+                k.className = this.CSS_HANDLE + '-inner-' + h[i];
+                this._handles[h[i]].appendChild(k);
+                this._wrap.appendChild(this._handles[h[i]]);
+                Event.on(this._handles[h[i]], 'mouseover', this._handleMouseOver, this, true);
+                Event.on(this._handles[h[i]], 'mouseout', this._handleMouseOut, this, true);
+                this._dds[h[i]] = new YAHOO.util.DragDrop(this._handles[h[i]], this.get('id') + '-handle-' + h);
+                this._dds[h[i]].setPadding(15, 15, 15, 15);
+                this._dds[h[i]].on('startDragEvent', this._handleStartDrag, this._dds[h[i]], this);
+                this._dds[h[i]].on('mouseDownEvent', this._handleMouseDown, this._dds[h[i]], this);
+            }
+            YAHOO.log('Creating the Status box', 'info', 'Resize');
+            this._status = document.createElement('span');
+            this._status.className = this.CSS_STATUS;
+            document.body.insertBefore(this._status, document.body.firstChild);
+        },
+        /** 
+        * @private
+        * @method _ieSelectFix
+        * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer
+        */
+        _ieSelectFix: function() {
+            return false;
+        },
+        /** 
+        * @private
+        * @property _ieSelectBack
+        * @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it.
+        */
+        _ieSelectBack: null,
+        /** 
+        * @private
+        * @method _setAutoRatio
+        * @param {Event} ev A mouse event.
+        * @description This method checks to see if the "autoRatio" config is set. If it is, we will check to see if the "Shift Key" is pressed. If so, we will set the config ratio to true.
+        */
+        _setAutoRatio: function(ev) {
+            if (this.get('autoRatio')) {
+                YAHOO.log('Setting up AutoRatio', 'info', 'Resize');
+                if (ev && ev.shiftKey) {
+                    //Shift Pressed
+                    YAHOO.log('Shift key presses, turning on ratio', 'info', 'Resize');
+                    this.set('ratio', true);
+                } else {
+                    YAHOO.log('Resetting ratio back to default', 'info', 'Resize');
+                    this.set('ratio', this._configs.ratio._initialConfig.value);
+                }
+            }
+        },
+        /** 
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev A mouse event.
+        * @description This method preps the autoRatio on MouseDown.
+        */
+        _handleMouseDown: function(ev) {
+            if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                this._positioned = true;
+            }
+            if (ev) {
+                this._setAutoRatio(ev);
+            }
+            if (this.browser.ie) {
+                this._ieSelectBack = document.body.onselectstart;
+                document.body.onselectstart = this._ieSelectFix;
+            }
+        },
+        /** 
+        * @private
+        * @method _handleMouseOver
+        * @param {Event} ev A mouse event.
+        * @description Adds CSS class names to the handles
+        */
+        _handleMouseOver: function(ev) {
+            //Internet Explorer needs this
+            D.removeClass(this._wrap, this.CSS_RESIZE);
+            if (this.get('hover')) {
+                D.removeClass(this._wrap, this.CSS_HOVER);
+            }
+            var tar = Event.getTarget(ev);
+            if (!D.hasClass(tar, this.CSS_HANDLE)) {
+                tar = tar.parentNode;
+            }
+            if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) {
+                D.addClass(tar, this.CSS_HANDLE + '-active');
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            break;
+                        }
+                    }
+                }
+            }
+
+            //Internet Explorer needs this
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _handleMouseOut
+        * @param {Event} ev A mouse event.
+        * @description Removes CSS class names to the handles
+        */
+        _handleMouseOut: function(ev) {
+            //Internet Explorer needs this
+            D.removeClass(this._wrap, this.CSS_RESIZE);
+            if (this.get('hover') && !this._active) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            var tar = Event.getTarget(ev);
+            if (!D.hasClass(tar, this.CSS_HANDLE)) {
+                tar = tar.parentNode;
+            }
+            if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) {
+                D.removeClass(tar, this.CSS_HANDLE + '-active');
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            D.removeClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            break;
+                        }
+                    }
+                }
+            }
+            //Internet Explorer needs this
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _handleStartDrag
+        * @param {Object} args The args passed from the CustomEvent.
+        * @param {Object} dd The <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> object we are working with.
+        * @description Resizes the proxy, sets up the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> handlers, updates the status div and preps the cache
+        */
+        _handleStartDrag: function(args, dd) {
+            YAHOO.log('startDrag', 'info', 'Resize');
+            var tar = dd.getDragEl();
+            if (D.hasClass(tar, this.CSS_HANDLE)) {
+                if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                    this._positioned = true;
+                }
+                this._active = true;
+                this._currentDD = dd;
+                if (this._proxy) {
+                    YAHOO.log('Activate proxy element', 'info', 'Resize');
+                    this._proxy.style.visibility = 'visible';
+                    this._proxy.style.zIndex = '1000';
+                    this._proxy.style.height = this.get('element').clientHeight + 'px';
+                    this._proxy.style.width = this.get('element').clientWidth + 'px';
+                }
+
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            this._currentHandle = i;
+                            var handle = '_handle_for_' + i;
+                            D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            dd.on('dragEvent', this[handle], this, true);
+                            dd.on('mouseUpEvent', this._handleMouseUp, this, true);
+                            YAHOO.log('Adding DragEvents to: ' + i, 'info', 'Resize');
+                            break;
+                        }
+                    }
+                }
+
+
+                D.addClass(tar, this.CSS_HANDLE + '-active');
+
+                if (this.get('proxy')) {
+                    YAHOO.log('Posiiton Proxy Element', 'info', 'Resize');
+                    var xy = D.getXY(this.get('element'));
+                    D.setXY(this._proxy, xy);
+                    if (this.get('ghost')) {
+                        YAHOO.log('Add Ghost Class', 'info', 'Resize');
+                        this.addClass(this.CSS_GHOST);
+                    }
+                }
+                D.addClass(this._wrap, this.CSS_RESIZING);
+                this._setCache();
+                this._updateStatus(this._cache.height, this._cache.width, this._cache.top, this._cache.left);
+                YAHOO.log('Firing startResize Event', 'info', 'Resize');
+                this.fireEvent('startResize', { type: 'startresize', target: this});
+            }
+        },
+        /** 
+        * @private
+        * @method _setCache
+        * @description Sets up the this._cache hash table.
+        */
+        _setCache: function() {
+            YAHOO.log('Setting up property cache', 'info', 'Resize');
+            this._cache.xy = D.getXY(this._wrap);
+            D.setXY(this._wrap, this._cache.xy);
+            this._cache.height = this.get('clientHeight');
+            this._cache.width = this.get('clientWidth');
+            this._cache.start.height = this._cache.height;
+            this._cache.start.width = this._cache.width;
+            this._cache.start.top = this._cache.xy[1];
+            this._cache.start.left = this._cache.xy[0];
+            this._cache.top = this._cache.xy[1];
+            this._cache.left = this._cache.xy[0];
+        },
+        /** 
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev A mouse event.
+        * @description Cleans up listeners, hides proxy element and removes class names.
+        */
+        _handleMouseUp: function(ev) {
+            this._active = false;
+
+            var handle = '_handle_for_' + this._currentHandle;
+            this._currentDD.unsubscribe('dragEvent', this[handle], this, true);
+            this._currentDD.unsubscribe('mouseUpEvent', this._handleMouseUp, this, true);
+
+            D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-' + this._currentHandle + '-active');
+            D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-active');
+
+            this._currentHandle = null;
+            if (!this.get('animate')) {
+                if (this.get('setSize')) {
+                    YAHOO.log('Setting Height and Width', 'info', 'Resize');
+                    this.set('height', this._cache.height);
+                    this.set('width', this._cache.width);
+                } else {
+                    YAHOO.log('Setting Height and Width silently', 'info', 'Resize');
+                    this.set('height', this._cache.height, true);
+                    this.set('width', this._cache.width, true);
+                }
+            }
+
+            if (this._proxy) {
+                YAHOO.log('Hide Proxy Element', 'info', 'Resize');
+                this._proxy.style.visibility = 'hidden';
+                this._proxy.style.zIndex = '-1';
+                if (this.get('setSize')) {
+                    YAHOO.log('Setting Size', 'info', 'Resize');
+                    this.resize(ev, this._cache.height, this._cache.width, this._cache.top, this._cache.left, true);
+                } else {
+                    YAHOO.log('Firing Resize Event', 'info', 'Resize');
+                    this.fireEvent('resize', { ev: 'resize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left });
+                }
+
+                if (this.get('ghost')) {
+                    YAHOO.log('Removing Ghost Class', 'info', 'Resize');
+                    this.removeClass(this.CSS_GHOST);
+                }
+            }
+
+            D.removeClass(this._wrap, this.CSS_RESIZING);
+            if (this.get('hover')) {
+                YAHOO.log('Adding hover class', 'info', 'Resize');
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            if (this._status) {
+                YAHOO.log('Hiding Status Box', 'info', 'Resize');
+                D.setStyle(this._status, 'display', 'none');
+            }
+            if (this.browser.ie) {
+                YAHOO.log('Resetting IE onselectstart function', 'info', 'Resize');
+                document.body.onselectstart = this._ieSelectBack;
+            }
+            for (var i in this._handles) {
+                if (Lang.hasOwnProperty(this._handles, i)) {
+                    YAHOO.log('Removing active class', 'info', 'Resize');
+                    D.removeClass(this._handles[i], this.CSS_HANDLE + '-active');
+                }
+            }
+            if (this.get('hover') && !this._active) {
+                YAHOO.log('Adding Hover Class', 'info', 'Resize');
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            this._resizeEvent = null;
+        },
+        /** 
+        * @private
+        * @method _setRatio
+        * @param {Number} h The height offset.
+        * @param {Number} w The with offset.
+        * @param {Number} t The top offset.
+        * @param {Number} l The left offset.
+        * @description Using the Height, Width, Top & Left, it recalcuates them based on the original element size.
+        * @return {Array} The new Height, Width, Top & Left settings
+        */
+        _setRatio: function(h, w, t, l) {
+            YAHOO.log('Setting Ratio', 'info', 'Resize');
+            var oh = h, ow = w;
+            if (this.get('ratio')) {
+                var orgH = this._cache.height,
+                    orgW = this._cache.width,
+                    nh = parseInt(this.get('height'), 10),
+                    nw = parseInt(this.get('width'), 10),
+                    maxH = this.get('maxHeight'),
+                    minH = this.get('minHeight'),
+                    maxW = this.get('maxWidth'),
+                    minW = this.get('minWidth');
+
+                switch (this._currentHandle) {
+                    case 'l':
+                        h = nh * (w / nw);
+                        h = Math.min(Math.max(minH, h), maxH);                        
+                        w = nw * (h / nh);
+                        t = (this._cache.start.top - (-((nh - h) / 2)));
+                        l = (this._cache.start.left - (-((nw - w))));
+                        break;
+                    case 'r':
+                        h = nh * (w / nw);
+                        h = Math.min(Math.max(minH, h), maxH);                        
+                        w = nw * (h / nh);
+                        t = (this._cache.start.top - (-((nh - h) / 2)));
+                        break;
+                    case 't':
+                        w = nw * (h / nh);
+                        h = nh * (w / nw);
+                        l = (this._cache.start.left - (-((nw - w) / 2)));
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                    case 'b':
+                        w = nw * (h / nh);
+                        h = nh * (w / nw);
+                        l = (this._cache.start.left - (-((nw - w) / 2)));
+                        break;
+                    case 'bl':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left - (-((nw - w))));
+                        break;
+                    case 'br':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        break;
+                    case 'tl':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left - (-((nw - w))));
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                    case 'tr':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left);
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                }
+                oh = this._checkHeight(h);
+                ow = this._checkWidth(w);
+                if ((oh != h) || (ow != w)) {
+                    t = 0;
+                    l = 0;
+                }
+            }
+            return [oh, ow, t, l];
+        },
+        /** 
+        * @private
+        * @method _updateStatus
+        * @param {Number} h The new height setting.
+        * @param {Number} w The new width setting.
+        * @param {Number} t The new top setting.
+        * @param {Number} l The new left setting.
+        * @description Using the Height, Width, Top & Left, it updates the status element with the elements sizes.
+        */
+        _updateStatus: function(h, w, t, l) {
+            if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) {
+                YAHOO.log('Updating Status Box', 'info', 'Resize');
+                if (this.get('status')) {
+                    YAHOO.log('Showing Status Box', 'info', 'Resize');
+                    D.setStyle(this._status, 'display', 'inline');
+                }
+                h = ((h === 0) ? this._cache.start.height : h);
+                w = ((w === 0) ? this._cache.start.width : w);
+                var h1 = parseInt(this.get('height'), 10),
+                    w1 = parseInt(this.get('width'), 10);
+                
+                if (isNaN(h1)) {
+                    h1 = parseInt(h, 10);
+                }
+                if (isNaN(w1)) {
+                    w1 = parseInt(w, 10);
+                }
+                var diffH = (parseInt(h, 10) - h1);
+                var diffW = (parseInt(w, 10) - w1);
+                this._cache.offsetHeight = diffH;
+                this._cache.offsetWidth = diffW;
+                this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
+                D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
+            }
+        },
+        /** 
+        * @method reset
+        * @description Resets the element to is start state.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */
+        reset: function() {
+            YAHOO.log('Resetting to cached sizes and position', 'info', 'Resize');
+            this.resize(null, this._cache.start.height, this._cache.start.width, this._cache.start.top, this._cache.start.left, true);
+            return this;
+        },
+        /** 
+        * @method resize
+        * @param {Event} ev The mouse event.
+        * @param {Number} h The new height setting.
+        * @param {Number} w The new width setting.
+        * @param {Number} t The new top setting.
+        * @param {Number} l The new left setting.
+        * @param {Boolean} force Resize the element (used for proxy resize).
+        * @description Resizes the element, wrapper or proxy based on the data from the handlers.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */
+        resize: function(ev, h, w, t, l, force) {
+            YAHOO.log('Resize: ' + h + ',' + w, 'info', 'Resize');
+            this._resizeEvent = ev;
+            var el = this._wrap, anim = this.get('animate'), set = true;
+            if (this._proxy && !force) {
+                el = this._proxy;
+                anim = false;
+            }
+            this._setAutoRatio(ev);
+            if (this._positioned) {
+                if (this._proxy) {
+                    t = this._cache.top - t;
+                    l = this._cache.left - l;
+                }
+            }
+
+            var ratio = this._setRatio(h, w, t, l);
+            h = parseInt(ratio[0], 10);
+            w = parseInt(ratio[1], 10);
+            t = parseInt(ratio[2], 10);
+            l = parseInt(ratio[3], 10);
+
+            if (t == 0) {
+                //No Offset, get from cache
+                t = D.getY(el);
+            }
+            if (l == 0) {
+                //No Offset, get from cache
+                l = D.getX(el);
+            }
+
+            this._updateStatus(h, w, t, l);
+            
+
+            if (this._positioned) {
+                if (this._proxy && force) {
+                    if (!anim) {
+                        el.style.top = this._proxy.style.top;
+                        el.style.left = this._proxy.style.left;
+                    } else {
+                        t = this._proxy.style.top;
+                        l = this._proxy.style.left;
+                    }
+                } else {
+                    if (!this.get('ratio') && !this._proxy) {
+                        t = this._cache.top + -(t);
+                        l = this._cache.left + -(l);
+                    }
+                    if (t) {
+                        if (this.get('minY')) {
+                            if (t < this.get('minY')) {
+                                t = this.get('minY');
+                            }
+                        }
+                        if (this.get('maxY')) {
+                            if ((t + h) > this.get('maxY')) {
+                                t = (this.get('maxY') - h);
+                            }
+                        }
+                    }
+                    if (l) {
+                        if (this.get('minX')) {
+                            if (l < this.get('minX')) {
+                                l = this.get('minX');
+                            }
+                        }
+                        if (this.get('maxX')) {
+                            if ((l + w) > this.get('maxX')) {
+                                l = (this.get('maxX') - w);
+                            }
+                        }
+                    }
+                }
+            }
+            YAHOO.log('beforeResize', 'info', 'Resize');
+            var beforeReturn = this.fireEvent('beforeResize', { ev: 'beforeResize', target: this, height: h, width: w, top: t, left: l });
+            if (beforeReturn === false) {
+                YAHOO.log('Resized cancelled because befireResize returned false', 'info', 'Resize');
+                return false;
+            }
+            if (this._positioned) {
+                if (this._proxy && force) {
+                    //Do nothing
+                } else {
+                    if (t) {
+                        D.setY(el, t);
+                        this._cache.top = t;
+                    }
+                    if (l) {
+                        D.setX(el, l);
+                        this._cache.left = l;
+                    }
+                }
+            }
+            if (h) {
+                if (!anim) {
+                    set = true;
+                    if (this._proxy && force) {
+                        if (!this.get('setSize')) {
+                            set = false;
+                        }
+                    }
+                    if (set) {
+                        if (this.browser.ie > 6) {
+                            if (h === this._cache.height) {
+                                h = h + 1;
+                            }
+                        }
+                        el.style.height = h + 'px';
+                    }
+                    if ((this._proxy && force) || !this._proxy) {
+                        if (this._wrap != this.get('element')) {
+                            this.get('element').style.height = h + 'px';
+                        }
+                    }
+                }
+                this._cache.height = h;
+            }
+            if (w) {
+                this._cache.width = w;
+                if (!anim) {
+                    set = true;
+                    if (this._proxy && force) {
+                        if (!this.get('setSize')) {
+                            set = false;
+                        }
+                    }
+                    if (set) {
+                        el.style.width = w + 'px';
+                    }
+                    if ((this._proxy && force) || !this._proxy) {
+                        if (this._wrap != this.get('element')) {
+                            this.get('element').style.width = w + 'px';
+                        }
+                    }
+                }
+            }
+            if (anim) {
+                if (YAHOO.util.Anim) {
+                    var _anim = new YAHOO.util.Anim(el, {
+                        height: {
+                            to: this._cache.height
+                        },
+                        width: {
+                            to: this._cache.width
+                        }
+                    }, this.get('animateDuration'), this.get('animateEasing'));
+                    if (this._positioned) {
+                        if (t) {
+                            _anim.attributes.top = {
+                                to: parseInt(t, 10)
+                            };
+                        }
+                        if (l) {
+                            _anim.attributes.left = {
+                                to: parseInt(l, 10)
+                            };
+                        }
+                    }
+
+                    if (this._wrap != this.get('element')) {
+                        _anim.onTween.subscribe(function() {
+                            this.get('element').style.height = el.style.height;
+                            this.get('element').style.width = el.style.width;
+                        }, this, true);
+                    }
+
+                    _anim.onComplete.subscribe(function() {
+                        YAHOO.log('Animation onComplete fired', 'info', 'Resize');
+                        this.set('height', h);
+                        this.set('width', w);
+                        this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l });
+                    }, this, true);
+                    _anim.animate();
+
+                }
+            } else {
+                if (this._proxy && !force) {
+                    YAHOO.log('proxyResize', 'info', 'Resize');
+                    this.fireEvent('proxyResize', { ev: 'proxyresize', target: this, height: h, width: w, top: t, left: l });
+                } else {
+                    YAHOO.log('resize', 'info', 'Resize');
+                    this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l });
+                }
+            }
+            return this;
+        },
+        /** 
+        * @private
+        * @method _handle_for_br
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom Right handle.
+        */
+        _handle_for_br: function(args) {
+            YAHOO.log('Handle BR', 'info', 'Resize');
+            var newW = this._setWidth(args.e);
+            var newH = this._setHeight(args.e);
+            this.resize(args.e, (newH + 1), newW, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_bl
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom Left handle.
+        */
+        _handle_for_bl: function(args) {
+            YAHOO.log('Handle BL', 'info', 'Resize');
+            var newW = this._setWidth(args.e, true);
+            var newH = this._setHeight(args.e);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, newH, newW, 0, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_tl
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top Left handle.
+        */
+        _handle_for_tl: function(args) {
+            YAHOO.log('Handle TL', 'info', 'Resize');
+            var newW = this._setWidth(args.e, true);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, newH, newW, t, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_tr
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top Right handle.
+        */
+        _handle_for_tr: function(args) {
+            YAHOO.log('Handle TR', 'info', 'Resize');
+            var newW = this._setWidth(args.e);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            this.resize(args.e, newH, newW, t, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_r
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Right handle.
+        */
+        _handle_for_r: function(args) {
+            YAHOO.log('Handle R', 'info', 'Resize');
+            this._dds.r.setYConstraint(0,0);
+            var newW = this._setWidth(args.e);
+            this.resize(args.e, 0, newW, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_l
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Left handle.
+        */
+        _handle_for_l: function(args) {
+            YAHOO.log('Handle L', 'info', 'Resize');
+            this._dds.l.setYConstraint(0,0);
+            var newW = this._setWidth(args.e, true);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, 0, newW, 0, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_b
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom handle.
+        */
+        _handle_for_b: function(args) {
+            YAHOO.log('Handle B', 'info', 'Resize');
+            this._dds.b.setXConstraint(0,0);
+            var newH = this._setHeight(args.e);
+            this.resize(args.e, newH, 0, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_t
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top handle.
+        */
+        _handle_for_t: function(args) {
+            YAHOO.log('Handle T', 'info', 'Resize');
+            this._dds.t.setXConstraint(0,0);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            this.resize(args.e, newH, 0, t, 0);
+        },
+        /** 
+        * @private
+        * @method _setWidth
+        * @param {Event} ev The mouse event.
+        * @param {Boolean} flip Argument to determine the direction of the movement.
+        * @description Calculates the width based on the mouse event.
+        * @return {Number} The new value
+        */
+        _setWidth: function(ev, flip) {
+            YAHOO.log('Set width based on Event', 'info', 'Resize');
+            var xy = this._cache.xy[0],
+                w = this._cache.width,
+                x = Event.getPageX(ev),
+                nw = (x - xy);
+
+                if (flip) {
+                    nw = (xy - x) + parseInt(this.get('width'), 10);
+                }
+                
+                nw = this._snapTick(nw, this.get('yTicks'));
+                nw = this._checkWidth(nw);
+            return nw;
+        },
+        /** 
+        * @private
+        * @method _checkWidth
+        * @param {Number} w The width to check.
+        * @description Checks the value passed against the maxWidth and minWidth.
+        * @return {Number} the new value
+        */
+        _checkWidth: function(w) {
+            YAHOO.log('Checking the min/max width', 'info', 'Resize');
+            if (this.get('minWidth')) {
+                if (w <= this.get('minWidth')) {
+                    YAHOO.log('Using minWidth', 'info', 'Resize');
+                    w = this.get('minWidth');
+                }
+            }
+            if (this.get('maxWidth')) {
+                if (w >= this.get('maxWidth')) {
+                    YAHOO.log('Using Max Width', 'info', 'Resize');
+                    w = this.get('maxWidth');
+                }
+            }
+            return w;
+        },
+        /** 
+        * @private
+        * @method _checkHeight
+        * @param {Number} h The height to check.
+        * @description Checks the value passed against the maxHeight and minHeight.
+        * @return {Number} The new value
+        */
+        _checkHeight: function(h) {
+            YAHOO.log('Checking the min/max height', 'info', 'Resize');
+            if (this.get('minHeight')) {
+                if (h <= this.get('minHeight')) {
+                    YAHOO.log('Using minHeight', 'info', 'Resize');
+                    h = this.get('minHeight');
+                }
+            }
+            if (this.get('maxHeight')) {
+                if (h >= this.get('maxHeight')) {
+                    YAHOO.log('using maxHeight', 'info', 'Resize');
+                    h = this.get('maxHeight');
+                }
+            }
+            return h;
+        },
+        /** 
+        * @private
+        * @method _setHeight
+        * @param {Event} ev The mouse event.
+        * @param {Boolean} flip Argument to determine the direction of the movement.
+        * @description Calculated the height based on the mouse event.
+        * @return {Number} The new value
+        */
+        _setHeight: function(ev, flip) {
+            YAHOO.log('Setting the height based on the Event', 'info', 'Resize');
+            var xy = this._cache.xy[1],
+                h = this._cache.height,
+                y = Event.getPageY(ev),
+                nh = (y - xy);
+
+                if (flip) {
+                    nh = (xy - y) + parseInt(this.get('height'), 10);
+                }
+                nh = this._snapTick(nh, this.get('xTicks'));
+                nh = this._checkHeight(nh);
+                
+            return nh;
+        },
+        /** 
+        * @private
+        * @method _snapTick
+        * @param {Number} size The size to tick against.
+        * @param {Number} pix The tick pixels.
+        * @description Adjusts the number based on the ticks used.
+        * @return {Number} the new snapped position
+        */
+        _snapTick: function(size, pix) {
+            YAHOO.log('Snapping to ticks', 'info', 'Resize');
+            if (!size || !pix) {
+                return size;
+            }
+            var _s = size;
+            var _x = size % pix;
+            if (_x > 0) {
+                if (_x > (pix / 2)) {
+                    _s = size + (pix - _x);
+                } else {
+                    _s = size - _x;
+                }
+            }
+            return _s;
+        },
+        /** 
+        * @private
+        * @method init
+        * @description The Resize class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.log('init', 'info', 'Resize');
+            this._cache = {
+                xy: [],
+                height: 0,
+                width: 0,
+                top: 0,
+                left: 0,
+                offsetHeight: 0,
+                offsetWidth: 0,
+                start: {
+                    height: 0,
+                    width: 0,
+                    top: 0,
+                    left: 0
+                }
+            };
+
+            Resize.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.set('setSize', this.get('setSize'));
+
+            if (p_oAttributes.height) {
+                this.set('height', parseInt(p_oAttributes.height, 10));
+            }
+            if (p_oAttributes.width) {
+                this.set('width', parseInt(p_oAttributes.width, 10));
+            }
+            
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = D.generateId(id);
+            }
+            Resize._instances[id] = this;
+
+            this._active = false;
+            
+            this._createWrap();
+            this._createProxy();
+            this._createHandles();
+
+        },
+        /**
+        * @method getProxyEl
+        * @description Get the HTML reference for the proxy, returns null if no proxy.
+        * @return {HTMLElement} The proxy element
+        */      
+        getProxyEl: function() {
+            return this._proxy;
+        },
+        /**
+        * @method getWrapEl
+        * @description Get the HTML reference for the wrap element, returns the current element if not wrapped.
+        * @return {HTMLElement} The wrap element
+        */      
+        getWrapEl: function() {
+            return this._wrap;
+        },
+        /**
+        * @method getStatusEl
+        * @description Get the HTML reference for the status element.
+        * @return {HTMLElement} The status element
+        */      
+        getStatusEl: function() {
+            return this._status;
+        },
+        /**
+        * @method getActiveHandleEl
+        * @description Get the HTML reference for the currently active resize handle.
+        * @return {HTMLElement} The handle element that is active
+        */      
+        getActiveHandleEl: function() {
+            return this._handles[this._currentHandle];
+        },
+        /**
+        * @method isActive
+        * @description Returns true or false if a resize operation is currently active on the element.
+        * @return {Boolean}
+        */      
+        isActive: function() {
+            return ((this._active) ? true : false);
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create a resizable element.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the utility.
+        */      
+        initAttributes: function(attr) {
+            Resize.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute setSize
+            * @description Set the size of the resized element, if set to false the element will not be auto resized,
+            * the resize event will contain the dimensions so the end user can resize it on their own.
+            * This setting will only work with proxy set to true and animate set to false.
+            * @type Boolean
+            */
+            this.setAttributeConfig('setSize', {
+                value: ((attr.setSize === false) ? false : true),
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute wrap
+            * @description Should we wrap the element
+            * @type Boolean
+            */
+            this.setAttributeConfig('wrap', {
+                writeOnce: true,
+                validator: YAHOO.lang.isBoolean,
+                value: attr.wrap || false
+            });
+
+            /**
+            * @attribute handles
+            * @description The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. Defaults to: ['r', 'b', 'br'].
+            * Can use a shortcut of All. Note: 8 way resizing should be done on an element that is absolutely positioned.
+            * @type Array
+            */
+            this.setAttributeConfig('handles', {
+                writeOnce: true,
+                value: attr.handles || ['r', 'b', 'br'],
+                validator: function(handles) {
+                    if (Lang.isString(handles) && handles.toLowerCase() == 'all') {
+                        handles = ['t', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'];
+                    }
+                    if (!Lang.isArray(handles)) {
+                        handles = handles.replace(/, /g, ',');
+                        handles = handles.split(',');
+                    }
+                    this._configs.handles.value = handles;
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width || parseInt(this.getStyle('width'), 10),
+                validator: YAHOO.lang.isNumber,
+                method: function(width) {
+                    width = parseInt(width, 10);
+                    if (width > 0) {
+                        if (this.get('setSize')) {
+                            this.setStyle('width', width + 'px');
+                        }
+                        this._cache.width = width;
+                        this._configs.width.value = width;
+                    }
+                }
+            });
+
+            /**
+            * @attribute height
+            * @description The height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || parseInt(this.getStyle('height'), 10),
+                validator: YAHOO.lang.isNumber,
+                method: function(height) {
+                    height = parseInt(height, 10);
+                    if (height > 0) {
+                        if (this.get('setSize')) {
+                            this.setStyle('height', height + 'px');
+                        }
+                        this._cache.height = height;
+                        this._configs.height.value = height;
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minimum width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || 15,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minimum height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || 15,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxWidth
+            * @description The maximum width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxWidth', {
+                value: attr.maxWidth || 10000,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxHeight
+            * @description The maximum height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxHeight', {
+                value: attr.maxHeight || 10000,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minY
+            * @description The minimum y coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minY', {
+                value: attr.minY || false
+            });
+
+            /**
+            * @attribute minX
+            * @description The minimum x coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minX', {
+                value: attr.minX || false
+            });
+            /**
+            * @attribute maxY
+            * @description The max y coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxY', {
+                value: attr.maxY || false
+            });
+
+            /**
+            * @attribute maxX
+            * @description The max x coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxX', {
+                value: attr.maxX || false
+            });
+
+            /**
+            * @attribute animate
+            * @description Should be use animation to resize the element (can only be used if we use proxy).
+            * @type Boolean
+            */
+            this.setAttributeConfig('animate', {
+                value: attr.animate || false,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+
+            /**
+            * @attribute animateEasing
+            * @description The Easing to apply to the animation.
+            * @type Object
+            */
+            this.setAttributeConfig('animateEasing', {
+                value: attr.animateEasing || function() {
+                    var easing = false;
+                    try {
+                        easing = YAHOO.util.Easing.easeOut;
+                    } catch (e) {}
+                    return easing;
+                }()
+            });
+
+            /**
+            * @attribute animateDuration
+            * @description The Duration to apply to the animation.
+            * @type Number
+            */
+            this.setAttributeConfig('animateDuration', {
+                value: attr.animateDuration || 0.5
+            });
+
+            /**
+            * @attribute proxy
+            * @description Resize a proxy element instead of the real element.
+            * @type Boolean
+            */
+            this.setAttributeConfig('proxy', {
+                value: attr.proxy || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute ratio
+            * @description Maintain the element's ratio when resizing.
+            * @type Boolean
+            */
+            this.setAttributeConfig('ratio', {
+                value: attr.ratio || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute ghost
+            * @description Apply an opacity filter to the element being resized (only works with proxy).
+            * @type Boolean
+            */
+            this.setAttributeConfig('ghost', {
+                value: attr.ghost || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute draggable
+            * @description A convienence method to make the element draggable
+            * @type Boolean
+            */
+            this.setAttributeConfig('draggable', {
+                value: attr.draggable || false,
+                validator: YAHOO.lang.isBoolean,
+                method: function(dd) {
+                    if (dd && this._wrap) {
+                        this._setupDragDrop();
+                    } else {
+                        if (this.dd) {
+                            D.removeClass(this._wrap, this.CSS_DRAG);
+                            this.dd.unreg();
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute hover
+            * @description Only show the handles when they are being moused over.
+            * @type Boolean
+            */
+            this.setAttributeConfig('hover', {
+                value: attr.hover || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute hiddenHandles
+            * @description Don't show the handles, just use the cursor to the user.
+            * @type Boolean
+            */
+            this.setAttributeConfig('hiddenHandles', {
+                value: attr.hiddenHandles || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute knobHandles
+            * @description Use the smaller handles, instead if the full size handles.
+            * @type Boolean
+            */
+            this.setAttributeConfig('knobHandles', {
+                value: attr.knobHandles || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute xTicks
+            * @description The number of x ticks to span the resize to.
+            * @type Number or False
+            */
+            this.setAttributeConfig('xTicks', {
+                value: attr.xTicks || false
+            });
+
+            /**
+            * @attribute yTicks
+            * @description The number of y ticks to span the resize to.
+            * @type Number or False
+            */
+            this.setAttributeConfig('yTicks', {
+                value: attr.yTicks || false
+            });
+
+            /**
+            * @attribute status
+            * @description Show the status (new size) of the resize.
+            * @type Boolean
+            */
+            this.setAttributeConfig('status', {
+                value: attr.status || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute autoRatio
+            * @description Using the shift key during a resize will toggle the ratio config.
+            * @type Boolean
+            */
+            this.setAttributeConfig('autoRatio', {
+                value: attr.autoRatio || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the resize object and all of it's elements & listeners.
+        */        
+        destroy: function() {
+            YAHOO.log('Destroying Resize', 'info', 'Resize');
+            for (var h in this._handles) {
+                if (Lang.hasOwnProperty(this._handles, h)) {
+                    Event.purgeElement(this._handles[h]);
+                    this._handles[h].parentNode.removeChild(this._handles[h]);
+                }
+            }
+            if (this._proxy) {
+                this._proxy.parentNode.removeChild(this._proxy);
+            }
+            if (this.dd) {
+                this.dd.unreg();
+                D.removeClass(this._wrap, this.CSS_DRAG);
+            }
+            if (this._wrap != this.get('element')) {
+                this.setStyle('position', '');
+                this.setStyle('top', '');
+                this.setStyle('left', '');
+                this._wrap.parentNode.replaceChild(this.get('element'), this._wrap);
+            }
+            this.removeClass(this.CSS_RESIZE);
+
+            delete YAHOO.util.Resize._instances[this.get('id')];
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                    delete this[i];
+                }
+            }
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the Resize Object.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'Resize (#' + this.get('id') + ')';
+            }
+            return 'Resize Utility';
+        }
+    });
+
+    YAHOO.util.Resize = Resize;
+/**
+* @event dragEvent
+* @description Fires when the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> dragEvent is fired for the config option draggable.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event startResize
+* @description Fires when when a resize action is started.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event resize
+* @description Fires on every element resize (only fires once when used with proxy config setting).
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeResize
+* @description Fires before every element resize after the size calculations, returning false will stop the resize.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event proxyResize
+* @description Fires on every proxy resize (only fires when used with proxy config setting).
+* @type YAHOO.util.CustomEvent
+*/
+
+})();
+
+YAHOO.register("resize", YAHOO.util.Resize, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/resize/resize-beta-min.js b/lib/yui/resize/resize-beta-min.js
new file mode 100644 (file)
index 0000000..e1052ee
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var E=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;var B=function(F,D){var G={element:F,attributes:D||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getResizeById=function(D){if(B._instances[D]){return B._instances[D];}return false;};YAHOO.extend(B,YAHOO.util.Element,{CSS_RESIZE:"yui-resize",CSS_DRAG:"yui-draggable",CSS_HOVER:"yui-resize-hover",CSS_PROXY:"yui-resize-proxy",CSS_WRAP:"yui-resize-wrap",CSS_KNOB:"yui-resize-knob",CSS_HIDDEN:"yui-resize-hidden",CSS_HANDLE:"yui-resize-handle",CSS_STATUS:"yui-resize-status",CSS_GHOST:"yui-resize-ghost",CSS_RESIZING:"yui-resize-resizing",_resizeEvent:null,dd:null,browser:YAHOO.env.ua,_positioned:null,_dds:null,_wrap:null,_proxy:null,_handles:null,_currentHandle:null,_currentDD:null,_cache:null,_active:null,_createProxy:function(){if(this.get("proxy")){this._proxy=document.createElement("div");this._proxy.className=this.CSS_PROXY;this._proxy.style.height=this.get("element").clientHeight+"px";this._proxy.style.width=this.get("element").clientWidth+"px";this._wrap.parentNode.appendChild(this._proxy);}else{this.set("animate",false);}},_createWrap:function(){this._positioned=false;switch(this.get("element").tagName.toLowerCase()){case"img":case"textarea":case"input":case"iframe":case"select":this.set("wrap",true);break;}if(this.get("wrap")){this._wrap=document.createElement("div");this._wrap.id=this.get("element").id+"_wrap";this._wrap.className=this.CSS_WRAP;E.setStyle(this._wrap,"width",this.get("width"));E.setStyle(this._wrap,"height",this.get("height"));E.setStyle(this._wrap,"z-index",this.getStyle("z-index"));this.setStyle("z-index",0);var F=E.getStyle(this.get("element"),"position");E.setStyle(this._wrap,"position",((F=="static")?"relative":F));E.setStyle(this._wrap,"top",E.getStyle(this.get("element"),"top"));E.setStyle(this._wrap,"left",E.getStyle(this.get("element"),"left"));if(E.getStyle(this.get("element"),"position")=="absolute"){this._positioned=true;E.setStyle(this.get("element"),"position","relative");E.setStyle(this.get("element"),"top","0");E.setStyle(this.get("element"),"left","0");}var D=this.get("element").parentNode;D.replaceChild(this._wrap,this.get("element"));this._wrap.appendChild(this.get("element"));}else{this._wrap=this.get("element");if(E.getStyle(this._wrap,"position")=="absolute"){this._positioned=true;}}if(this.get("draggable")){this._setupDragDrop();}if(this.get("hover")){E.addClass(this._wrap,this.CSS_HOVER);}if(this.get("knobHandles")){E.addClass(this._wrap,this.CSS_KNOB);}if(this.get("hiddenHandles")){E.addClass(this._wrap,this.CSS_HIDDEN);}E.addClass(this._wrap,this.CSS_RESIZE);},_setupDragDrop:function(){E.addClass(this._wrap,this.CSS_DRAG);this.dd=new YAHOO.util.DD(this._wrap,this.get("id")+"-resize",{dragOnly:true});this.dd.on("dragEvent",function(){this.fireEvent("dragEvent",arguments);},this,true);},_createHandles:function(){this._handles={};this._dds={};var G=this.get("handles");for(var F=0;F<G.length;F++){this._handles[G[F]]=document.createElement("div");this._handles[G[F]].id=E.generateId(this._handles[G[F]]);this._handles[G[F]].className=this.CSS_HANDLE+" "+this.CSS_HANDLE+"-"+G[F];var D=document.createElement("div");D.className=this.CSS_HANDLE+"-inner-"+G[F];this._handles[G[F]].appendChild(D);this._wrap.appendChild(this._handles[G[F]]);A.on(this._handles[G[F]],"mouseover",this._handleMouseOver,this,true);A.on(this._handles[G[F]],"mouseout",this._handleMouseOut,this,true);this._dds[G[F]]=new YAHOO.util.DragDrop(this._handles[G[F]],this.get("id")+"-handle-"+G);this._dds[G[F]].setPadding(15,15,15,15);this._dds[G[F]].on("startDragEvent",this._handleStartDrag,this._dds[G[F]],this);this._dds[G[F]].on("mouseDownEvent",this._handleMouseDown,this._dds[G[F]],this);}this._status=document.createElement("span");this._status.className=this.CSS_STATUS;document.body.insertBefore(this._status,document.body.firstChild);},_ieSelectFix:function(){return false;},_ieSelectBack:null,_setAutoRatio:function(D){if(this.get("autoRatio")){if(D&&D.shiftKey){this.set("ratio",true);}else{this.set("ratio",this._configs.ratio._initialConfig.value);}}},_handleMouseDown:function(D){if(E.getStyle(this._wrap,"position")=="absolute"){this._positioned=true;}if(D){this._setAutoRatio(D);}if(this.browser.ie){this._ieSelectBack=document.body.onselectstart;document.body.onselectstart=this._ieSelectFix;}},_handleMouseOver:function(G){E.removeClass(this._wrap,this.CSS_RESIZE);if(this.get("hover")){E.removeClass(this._wrap,this.CSS_HOVER);}var D=A.getTarget(G);if(!E.hasClass(D,this.CSS_HANDLE)){D=D.parentNode;}if(E.hasClass(D,this.CSS_HANDLE)&&!this._active){E.addClass(D,this.CSS_HANDLE+"-active");for(var F in this._handles){if(C.hasOwnProperty(this._handles,F)){if(this._handles[F]==D){E.addClass(D,this.CSS_HANDLE+"-"+F+"-active");break;}}}}E.addClass(this._wrap,this.CSS_RESIZE);},_handleMouseOut:function(G){E.removeClass(this._wrap,this.CSS_RESIZE);if(this.get("hover")&&!this._active){E.addClass(this._wrap,this.CSS_HOVER);}var D=A.getTarget(G);if(!E.hasClass(D,this.CSS_HANDLE)){D=D.parentNode;}if(E.hasClass(D,this.CSS_HANDLE)&&!this._active){E.removeClass(D,this.CSS_HANDLE+"-active");for(var F in this._handles){if(C.hasOwnProperty(this._handles,F)){if(this._handles[F]==D){E.removeClass(D,this.CSS_HANDLE+"-"+F+"-active");break;}}}}E.addClass(this._wrap,this.CSS_RESIZE);},_handleStartDrag:function(G,F){var D=F.getDragEl();if(E.hasClass(D,this.CSS_HANDLE)){if(E.getStyle(this._wrap,"position")=="absolute"){this._positioned=true;}this._active=true;this._currentDD=F;if(this._proxy){this._proxy.style.visibility="visible";this._proxy.style.zIndex="1000";this._proxy.style.height=this.get("element").clientHeight+"px";this._proxy.style.width=this.get("element").clientWidth+"px";}for(var H in this._handles){if(C.hasOwnProperty(this._handles,H)){if(this._handles[H]==D){this._currentHandle=H;var I="_handle_for_"+H;E.addClass(D,this.CSS_HANDLE+"-"+H+"-active");F.on("dragEvent",this[I],this,true);F.on("mouseUpEvent",this._handleMouseUp,this,true);
+break;}}}E.addClass(D,this.CSS_HANDLE+"-active");if(this.get("proxy")){var J=E.getXY(this.get("element"));E.setXY(this._proxy,J);if(this.get("ghost")){this.addClass(this.CSS_GHOST);}}E.addClass(this._wrap,this.CSS_RESIZING);this._setCache();this._updateStatus(this._cache.height,this._cache.width,this._cache.top,this._cache.left);this.fireEvent("startResize",{type:"startresize",target:this});}},_setCache:function(){this._cache.xy=E.getXY(this._wrap);E.setXY(this._wrap,this._cache.xy);this._cache.height=this.get("clientHeight");this._cache.width=this.get("clientWidth");this._cache.start.height=this._cache.height;this._cache.start.width=this._cache.width;this._cache.start.top=this._cache.xy[1];this._cache.start.left=this._cache.xy[0];this._cache.top=this._cache.xy[1];this._cache.left=this._cache.xy[0];},_handleMouseUp:function(F){this._active=false;var G="_handle_for_"+this._currentHandle;this._currentDD.unsubscribe("dragEvent",this[G],this,true);this._currentDD.unsubscribe("mouseUpEvent",this._handleMouseUp,this,true);E.removeClass(this._handles[this._currentHandle],this.CSS_HANDLE+"-"+this._currentHandle+"-active");E.removeClass(this._handles[this._currentHandle],this.CSS_HANDLE+"-active");this._currentHandle=null;if(!this.get("animate")){if(this.get("setSize")){this.set("height",this._cache.height);this.set("width",this._cache.width);}else{this.set("height",this._cache.height,true);this.set("width",this._cache.width,true);}}if(this._proxy){this._proxy.style.visibility="hidden";this._proxy.style.zIndex="-1";if(this.get("setSize")){this.resize(F,this._cache.height,this._cache.width,this._cache.top,this._cache.left,true);}else{this.fireEvent("resize",{ev:"resize",target:this,height:this._cache.height,width:this._cache.width,top:this._cache.top,left:this._cache.left});}if(this.get("ghost")){this.removeClass(this.CSS_GHOST);}}E.removeClass(this._wrap,this.CSS_RESIZING);if(this.get("hover")){E.addClass(this._wrap,this.CSS_HOVER);}if(this._status){E.setStyle(this._status,"display","none");}if(this.browser.ie){document.body.onselectstart=this._ieSelectBack;}for(var D in this._handles){if(C.hasOwnProperty(this._handles,D)){E.removeClass(this._handles[D],this.CSS_HANDLE+"-active");}}if(this.get("hover")&&!this._active){E.addClass(this._wrap,this.CSS_HOVER);}this._resizeEvent=null;},_setRatio:function(K,N,Q,I){var O=K,G=N;if(this.get("ratio")){var P=this._cache.height,H=this._cache.width,F=parseInt(this.get("height"),10),L=parseInt(this.get("width"),10),M=this.get("maxHeight"),R=this.get("minHeight"),D=this.get("maxWidth"),J=this.get("minWidth");switch(this._currentHandle){case"l":K=F*(N/L);K=Math.min(Math.max(R,K),M);N=L*(K/F);Q=(this._cache.start.top-(-((F-K)/2)));I=(this._cache.start.left-(-((L-N))));break;case"r":K=F*(N/L);K=Math.min(Math.max(R,K),M);N=L*(K/F);Q=(this._cache.start.top-(-((F-K)/2)));break;case"t":N=L*(K/F);K=F*(N/L);I=(this._cache.start.left-(-((L-N)/2)));Q=(this._cache.start.top-(-((F-K))));break;case"b":N=L*(K/F);K=F*(N/L);I=(this._cache.start.left-(-((L-N)/2)));break;case"bl":K=F*(N/L);N=L*(K/F);I=(this._cache.start.left-(-((L-N))));break;case"br":K=F*(N/L);N=L*(K/F);break;case"tl":K=F*(N/L);N=L*(K/F);I=(this._cache.start.left-(-((L-N))));Q=(this._cache.start.top-(-((F-K))));break;case"tr":K=F*(N/L);N=L*(K/F);I=(this._cache.start.left);Q=(this._cache.start.top-(-((F-K))));break;}O=this._checkHeight(K);G=this._checkWidth(N);if((O!=K)||(G!=N)){Q=0;I=0;}}return[O,G,Q,I];},_updateStatus:function(K,G,J,F){if(this._resizeEvent&&(!C.isString(this._resizeEvent))){if(this.get("status")){E.setStyle(this._status,"display","inline");}K=((K===0)?this._cache.start.height:K);G=((G===0)?this._cache.start.width:G);var I=parseInt(this.get("height"),10),D=parseInt(this.get("width"),10);if(isNaN(I)){I=parseInt(K,10);}if(isNaN(D)){D=parseInt(G,10);}var L=(parseInt(K,10)-I);var H=(parseInt(G,10)-D);this._cache.offsetHeight=L;this._cache.offsetWidth=H;this._status.innerHTML="<strong>"+parseInt(K,10)+" x "+parseInt(G,10)+"</strong><em>"+((L>0)?"+":"")+L+" x "+((H>0)?"+":"")+H+"</em>";E.setXY(this._status,[A.getPageX(this._resizeEvent)+12,A.getPageY(this._resizeEvent)+12]);}},reset:function(){this.resize(null,this._cache.start.height,this._cache.start.width,this._cache.start.top,this._cache.start.left,true);return this;},resize:function(L,J,O,P,H,F){this._resizeEvent=L;var G=this._wrap,I=this.get("animate"),N=true;if(this._proxy&&!F){G=this._proxy;I=false;}this._setAutoRatio(L);if(this._positioned){if(this._proxy){P=this._cache.top-P;H=this._cache.left-H;}}var K=this._setRatio(J,O,P,H);J=parseInt(K[0],10);O=parseInt(K[1],10);P=parseInt(K[2],10);H=parseInt(K[3],10);if(P==0){P=E.getY(G);}if(H==0){H=E.getX(G);}this._updateStatus(J,O,P,H);if(this._positioned){if(this._proxy&&F){if(!I){G.style.top=this._proxy.style.top;G.style.left=this._proxy.style.left;}else{P=this._proxy.style.top;H=this._proxy.style.left;}}else{if(!this.get("ratio")&&!this._proxy){P=this._cache.top+-(P);H=this._cache.left+-(H);}if(P){if(this.get("minY")){if(P<this.get("minY")){P=this.get("minY");}}if(this.get("maxY")){if((P+J)>this.get("maxY")){P=(this.get("maxY")-J);}}}if(H){if(this.get("minX")){if(H<this.get("minX")){H=this.get("minX");}}if(this.get("maxX")){if((H+O)>this.get("maxX")){H=(this.get("maxX")-O);}}}}}var M=this.fireEvent("beforeResize",{ev:"beforeResize",target:this,height:J,width:O,top:P,left:H});if(M===false){return false;}if(this._positioned){if(this._proxy&&F){}else{if(P){E.setY(G,P);this._cache.top=P;}if(H){E.setX(G,H);this._cache.left=H;}}}if(J){if(!I){N=true;if(this._proxy&&F){if(!this.get("setSize")){N=false;}}if(N){if(this.browser.ie>6){if(J===this._cache.height){J=J+1;}}G.style.height=J+"px";}if((this._proxy&&F)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.height=J+"px";}}}this._cache.height=J;}if(O){this._cache.width=O;if(!I){N=true;if(this._proxy&&F){if(!this.get("setSize")){N=false;}}if(N){G.style.width=O+"px";}if((this._proxy&&F)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.width=O+"px";
+}}}}if(I){if(YAHOO.util.Anim){var D=new YAHOO.util.Anim(G,{height:{to:this._cache.height},width:{to:this._cache.width}},this.get("animateDuration"),this.get("animateEasing"));if(this._positioned){if(P){D.attributes.top={to:parseInt(P,10)};}if(H){D.attributes.left={to:parseInt(H,10)};}}if(this._wrap!=this.get("element")){D.onTween.subscribe(function(){this.get("element").style.height=G.style.height;this.get("element").style.width=G.style.width;},this,true);}D.onComplete.subscribe(function(){this.set("height",J);this.set("width",O);this.fireEvent("resize",{ev:"resize",target:this,height:J,width:O,top:P,left:H});},this,true);D.animate();}}else{if(this._proxy&&!F){this.fireEvent("proxyResize",{ev:"proxyresize",target:this,height:J,width:O,top:P,left:H});}else{this.fireEvent("resize",{ev:"resize",target:this,height:J,width:O,top:P,left:H});}}return this;},_handle_for_br:function(F){var G=this._setWidth(F.e);var D=this._setHeight(F.e);this.resize(F.e,(D+1),G,0,0);},_handle_for_bl:function(G){var H=this._setWidth(G.e,true);var F=this._setHeight(G.e);var D=(H-this._cache.width);this.resize(G.e,F,H,0,D);},_handle_for_tl:function(G){var I=this._setWidth(G.e,true);var F=this._setHeight(G.e,true);var H=(F-this._cache.height);var D=(I-this._cache.width);this.resize(G.e,F,I,H,D);},_handle_for_tr:function(F){var H=this._setWidth(F.e);var D=this._setHeight(F.e,true);var G=(D-this._cache.height);this.resize(F.e,D,H,G,0);},_handle_for_r:function(D){this._dds.r.setYConstraint(0,0);var F=this._setWidth(D.e);this.resize(D.e,0,F,0,0);},_handle_for_l:function(F){this._dds.l.setYConstraint(0,0);var G=this._setWidth(F.e,true);var D=(G-this._cache.width);this.resize(F.e,0,G,0,D);},_handle_for_b:function(F){this._dds.b.setXConstraint(0,0);var D=this._setHeight(F.e);this.resize(F.e,D,0,0,0);},_handle_for_t:function(F){this._dds.t.setXConstraint(0,0);var D=this._setHeight(F.e,true);var G=(D-this._cache.height);this.resize(F.e,D,0,G,0);},_setWidth:function(H,J){var I=this._cache.xy[0],G=this._cache.width,D=A.getPageX(H),F=(D-I);if(J){F=(I-D)+parseInt(this.get("width"),10);}F=this._snapTick(F,this.get("yTicks"));F=this._checkWidth(F);return F;},_checkWidth:function(D){if(this.get("minWidth")){if(D<=this.get("minWidth")){D=this.get("minWidth");}}if(this.get("maxWidth")){if(D>=this.get("maxWidth")){D=this.get("maxWidth");}}return D;},_checkHeight:function(D){if(this.get("minHeight")){if(D<=this.get("minHeight")){D=this.get("minHeight");}}if(this.get("maxHeight")){if(D>=this.get("maxHeight")){D=this.get("maxHeight");}}return D;},_setHeight:function(G,I){var H=this._cache.xy[1],F=this._cache.height,J=A.getPageY(G),D=(J-H);if(I){D=(H-J)+parseInt(this.get("height"),10);}D=this._snapTick(D,this.get("xTicks"));D=this._checkHeight(D);return D;},_snapTick:function(G,F){if(!G||!F){return G;}var H=G;var D=G%F;if(D>0){if(D>(F/2)){H=G+(F-D);}else{H=G-D;}}return H;},init:function(F,D){this._cache={xy:[],height:0,width:0,top:0,left:0,offsetHeight:0,offsetWidth:0,start:{height:0,width:0,top:0,left:0}};B.superclass.init.call(this,F,D);this.set("setSize",this.get("setSize"));if(D.height){this.set("height",parseInt(D.height,10));}if(D.width){this.set("width",parseInt(D.width,10));}var G=F;if(!C.isString(G)){G=E.generateId(G);}B._instances[G]=this;this._active=false;this._createWrap();this._createProxy();this._createHandles();},getProxyEl:function(){return this._proxy;},getWrapEl:function(){return this._wrap;},getStatusEl:function(){return this._status;},getActiveHandleEl:function(){return this._handles[this._currentHandle];},isActive:function(){return((this._active)?true:false);},initAttributes:function(D){B.superclass.initAttributes.call(this,D);this.setAttributeConfig("setSize",{value:((D.setSize===false)?false:true),validator:YAHOO.lang.isBoolean});this.setAttributeConfig("wrap",{writeOnce:true,validator:YAHOO.lang.isBoolean,value:D.wrap||false});this.setAttributeConfig("handles",{writeOnce:true,value:D.handles||["r","b","br"],validator:function(F){if(C.isString(F)&&F.toLowerCase()=="all"){F=["t","b","r","l","bl","br","tl","tr"];}if(!C.isArray(F)){F=F.replace(/, /g,",");F=F.split(",");}this._configs.handles.value=F;}});this.setAttributeConfig("width",{value:D.width||parseInt(this.getStyle("width"),10),validator:YAHOO.lang.isNumber,method:function(F){F=parseInt(F,10);if(F>0){if(this.get("setSize")){this.setStyle("width",F+"px");}this._cache.width=F;this._configs.width.value=F;}}});this.setAttributeConfig("height",{value:D.height||parseInt(this.getStyle("height"),10),validator:YAHOO.lang.isNumber,method:function(F){F=parseInt(F,10);if(F>0){if(this.get("setSize")){this.setStyle("height",F+"px");}this._cache.height=F;this._configs.height.value=F;}}});this.setAttributeConfig("minWidth",{value:D.minWidth||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:D.minHeight||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:D.maxWidth||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:D.maxHeight||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minY",{value:D.minY||false});this.setAttributeConfig("minX",{value:D.minX||false});this.setAttributeConfig("maxY",{value:D.maxY||false});this.setAttributeConfig("maxX",{value:D.maxX||false});this.setAttributeConfig("animate",{value:D.animate||false,validator:function(G){var F=true;if(!YAHOO.util.Anim){F=false;}return F;}});this.setAttributeConfig("animateEasing",{value:D.animateEasing||function(){var G=false;try{G=YAHOO.util.Easing.easeOut;}catch(F){}return G;}()});this.setAttributeConfig("animateDuration",{value:D.animateDuration||0.5});this.setAttributeConfig("proxy",{value:D.proxy||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ratio",{value:D.ratio||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ghost",{value:D.ghost||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("draggable",{value:D.draggable||false,validator:YAHOO.lang.isBoolean,method:function(F){if(F&&this._wrap){this._setupDragDrop();
+}else{if(this.dd){E.removeClass(this._wrap,this.CSS_DRAG);this.dd.unreg();}}}});this.setAttributeConfig("hover",{value:D.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("hiddenHandles",{value:D.hiddenHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("knobHandles",{value:D.knobHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("xTicks",{value:D.xTicks||false});this.setAttributeConfig("yTicks",{value:D.yTicks||false});this.setAttributeConfig("status",{value:D.status||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("autoRatio",{value:D.autoRatio||false,validator:YAHOO.lang.isBoolean});},destroy:function(){for(var F in this._handles){if(C.hasOwnProperty(this._handles,F)){A.purgeElement(this._handles[F]);this._handles[F].parentNode.removeChild(this._handles[F]);}}if(this._proxy){this._proxy.parentNode.removeChild(this._proxy);}if(this.dd){this.dd.unreg();E.removeClass(this._wrap,this.CSS_DRAG);}if(this._wrap!=this.get("element")){this.setStyle("position","");this.setStyle("top","");this.setStyle("left","");this._wrap.parentNode.replaceChild(this.get("element"),this._wrap);}this.removeClass(this.CSS_RESIZE);delete YAHOO.util.Resize._instances[this.get("id")];for(var D in this){if(C.hasOwnProperty(this,D)){this[D]=null;delete this[D];}}},toString:function(){if(this.get){return"Resize (#"+this.get("id")+")";}return"Resize Utility";}});YAHOO.util.Resize=B;})();YAHOO.register("resize",YAHOO.util.Resize,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/resize/resize-beta.js b/lib/yui/resize/resize-beta.js
new file mode 100644 (file)
index 0000000..ac6f879
--- /dev/null
@@ -0,0 +1,1578 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * @description <p>Makes an element resizable</p>
+ * @namespace YAHOO.util
+ * @requires yahoo, dom, dragdrop, element, event
+ * @optional animation
+ * @module resize
+ * @beta
+ */
+(function() {
+var D = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * @constructor
+     * @class Resize
+     * @extends YAHOO.util.Element
+     * @description <p>Makes an element resizable</p>
+     * @param {String/HTMLElement} el The element to make resizable.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+
+    var Resize = function(el, config) {
+        var oConfig = {
+            element: el,
+            attributes: config || {}
+        };
+
+        Resize.superclass.constructor.call(this, oConfig.element, oConfig.attributes);    
+    };
+
+    /**
+    * @private
+    * @static
+    * @property _instances
+    * @description Internal hash table for all resize instances
+    * @type Object
+    */ 
+    Resize._instances = {};
+    /**
+    * @static
+    * @method getResizeById 
+    * @description Get's a resize object by the HTML id of the element associated with the Resize object.
+    * @return {Object} The Resize Object
+    */ 
+    Resize.getResizeById = function(id) {
+        if (Resize._instances[id]) {
+            return Resize._instances[id];
+        }
+        return false;
+    };
+
+    YAHOO.extend(Resize, YAHOO.util.Element, {
+        /**
+        * @private
+        * @property CSS_RESIZE
+        * @description Base CSS class name
+        * @type String
+        */ 
+        CSS_RESIZE: 'yui-resize',
+        /**
+        * @private
+        * @property CSS_DRAG
+        * @description Class name added when dragging is enabled
+        * @type String
+        */ 
+        CSS_DRAG: 'yui-draggable',
+        /**
+        * @private
+        * @property CSS_HOVER
+        * @description Class name used for hover only handles
+        * @type String
+        */ 
+        CSS_HOVER: 'yui-resize-hover',
+        /**
+        * @private
+        * @property CSS_PROXY
+        * @description Class name given to the proxy element
+        * @type String
+        */ 
+        CSS_PROXY: 'yui-resize-proxy',
+        /**
+        * @private
+        * @property CSS_WRAP
+        * @description Class name given to the wrap element
+        * @type String
+        */ 
+        CSS_WRAP: 'yui-resize-wrap',
+        /**
+        * @private
+        * @property CSS_KNOB
+        * @description Class name used to make the knob style handles
+        * @type String
+        */ 
+        CSS_KNOB: 'yui-resize-knob',
+        /**
+        * @private
+        * @property CSS_HIDDEN
+        * @description Class name given to the wrap element to make all handles hidden
+        * @type String
+        */ 
+        CSS_HIDDEN: 'yui-resize-hidden',
+        /**
+        * @private
+        * @property CSS_HANDLE
+        * @description Class name given to all handles, used as a base for single handle names as well.. Handle "t" will get this.CSS_HANDLE + '-t' as well as this.CSS_HANDLE
+        * @type String
+        */ 
+        CSS_HANDLE: 'yui-resize-handle',
+        /**
+        * @private
+        * @property CSS_STATUS
+        * @description Class name given to the status element
+        * @type String
+        */ 
+        CSS_STATUS: 'yui-resize-status',
+        /**
+        * @private
+        * @property CSS_GHOST
+        * @description Class name given to the wrap element when the ghost property is active
+        * @type String
+        */ 
+        CSS_GHOST: 'yui-resize-ghost',
+        /**
+        * @private
+        * @property CSS_RESIZING
+        * @description Class name given to the wrap element when a resize action is taking place.
+        * @type String
+        */ 
+        CSS_RESIZING: 'yui-resize-resizing',
+        /**
+        * @private
+        * @property _resizeEvent
+        * @description The mouse event used to resize with
+        * @type Event
+        */ 
+        _resizeEvent: null,
+        /**
+        * @private
+        * @property dd
+        * @description The <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instance used if draggable is true
+        * @type Object
+        */ 
+        dd: null,
+        /** 
+        * @private
+        * @property browser
+        * @description A copy of the YAHOO.env.ua property
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /** 
+        * @private
+        * @property _positioned
+        * @description A flag to show if the element is absolutely positioned
+        * @type Boolean
+        */
+        _positioned: null,
+        /** 
+        * @private
+        * @property _dds
+        * @description An Object containing references to all of the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instances used for the resize handles
+        * @type Object
+        */
+        _dds: null,
+        /** 
+        * @private
+        * @property _wrap
+        * @description The HTML reference of the element wrapper
+        * @type HTMLElement
+        */
+        _wrap: null,
+        /** 
+        * @private
+        * @property _proxy
+        * @description The HTML reference of the element proxy
+        * @type HTMLElement
+        */
+        _proxy: null,
+        /** 
+        * @private
+        * @property _handles
+        * @description An object containing references to all of the resize handles.
+        * @type Object
+        */
+        _handles: null,
+        /** 
+        * @private
+        * @property _currentHandle
+        * @description The string identifier of the currently active handle. e.g. 'r', 'br', 'tl'
+        * @type String
+        */
+        _currentHandle: null,
+        /** 
+        * @private
+        * @property _currentDD
+        * @description A link to the currently active DD object
+        * @type Object
+        */
+        _currentDD: null,
+        /** 
+        * @private
+        * @property _cache
+        * @description An lookup table containing key information for the element being resized. e.g. height, width, x position, y position, etc..
+        * @type Object
+        */
+        _cache: null,
+        /** 
+        * @private
+        * @property _active
+        * @description Flag to show if the resize is active. Used for events.
+        * @type Boolean
+        */
+        _active: null,
+        /** 
+        * @private
+        * @method _createProxy
+        * @description Creates the proxy element if the proxy config is true
+        */
+        _createProxy: function() {
+            if (this.get('proxy')) {
+                this._proxy = document.createElement('div');
+                this._proxy.className = this.CSS_PROXY;
+                this._proxy.style.height = this.get('element').clientHeight + 'px';
+                this._proxy.style.width = this.get('element').clientWidth + 'px';
+                this._wrap.parentNode.appendChild(this._proxy);
+            } else {
+                this.set('animate', false);
+            }
+        },
+        /** 
+        * @private
+        * @method _createWrap
+        * @description Creates the wrap element if the wrap config is true. It will auto wrap the following element types: img, textarea, input, iframe, select
+        */
+        _createWrap: function() {
+            this._positioned = false;
+            //Force wrap for elements that can't have children 
+            switch (this.get('element').tagName.toLowerCase()) {
+                case 'img':
+                case 'textarea':
+                case 'input':
+                case 'iframe':
+                case 'select':
+                    this.set('wrap', true);
+                    break;
+            }
+            if (this.get('wrap')) {
+                this._wrap = document.createElement('div');
+                this._wrap.id = this.get('element').id + '_wrap';
+                this._wrap.className = this.CSS_WRAP;
+                D.setStyle(this._wrap, 'width', this.get('width'));
+                D.setStyle(this._wrap, 'height', this.get('height'));
+                D.setStyle(this._wrap, 'z-index', this.getStyle('z-index'));
+                this.setStyle('z-index', 0);
+                var pos = D.getStyle(this.get('element'), 'position');
+                D.setStyle(this._wrap, 'position', ((pos == 'static') ? 'relative' : pos));
+                D.setStyle(this._wrap, 'top', D.getStyle(this.get('element'), 'top'));
+                D.setStyle(this._wrap, 'left', D.getStyle(this.get('element'), 'left'));
+                if (D.getStyle(this.get('element'), 'position') == 'absolute') {
+                    this._positioned = true;
+                    D.setStyle(this.get('element'), 'position', 'relative');
+                    D.setStyle(this.get('element'), 'top', '0');
+                    D.setStyle(this.get('element'), 'left', '0');
+                }
+                var par = this.get('element').parentNode;
+                par.replaceChild(this._wrap, this.get('element'));
+                this._wrap.appendChild(this.get('element'));
+            } else {
+                this._wrap = this.get('element');
+                if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                    this._positioned = true;
+                }
+            }
+            if (this.get('draggable')) {
+                this._setupDragDrop();
+            }
+            if (this.get('hover')) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            if (this.get('knobHandles')) {
+                D.addClass(this._wrap, this.CSS_KNOB);
+            }
+            if (this.get('hiddenHandles')) {
+                D.addClass(this._wrap, this.CSS_HIDDEN);
+            }
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _setupDragDrop
+        * @description Setup the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> instance on the element
+        */
+        _setupDragDrop: function() {
+            D.addClass(this._wrap, this.CSS_DRAG);
+            this.dd = new YAHOO.util.DD(this._wrap, this.get('id') + '-resize', { dragOnly: true });
+            this.dd.on('dragEvent', function() {
+                this.fireEvent('dragEvent', arguments);
+            }, this, true);
+        },
+        /** 
+        * @private
+        * @method _createHandles
+        * @description Creates the handles as specified in the config
+        */
+        _createHandles: function() {
+            this._handles = {};
+            this._dds = {};
+            var h = this.get('handles');
+            for (var i = 0; i < h.length; i++) {
+                this._handles[h[i]] = document.createElement('div');
+                this._handles[h[i]].id = D.generateId(this._handles[h[i]]);
+                this._handles[h[i]].className = this.CSS_HANDLE + ' ' + this.CSS_HANDLE + '-' + h[i];
+                var k = document.createElement('div');
+                k.className = this.CSS_HANDLE + '-inner-' + h[i];
+                this._handles[h[i]].appendChild(k);
+                this._wrap.appendChild(this._handles[h[i]]);
+                Event.on(this._handles[h[i]], 'mouseover', this._handleMouseOver, this, true);
+                Event.on(this._handles[h[i]], 'mouseout', this._handleMouseOut, this, true);
+                this._dds[h[i]] = new YAHOO.util.DragDrop(this._handles[h[i]], this.get('id') + '-handle-' + h);
+                this._dds[h[i]].setPadding(15, 15, 15, 15);
+                this._dds[h[i]].on('startDragEvent', this._handleStartDrag, this._dds[h[i]], this);
+                this._dds[h[i]].on('mouseDownEvent', this._handleMouseDown, this._dds[h[i]], this);
+            }
+            this._status = document.createElement('span');
+            this._status.className = this.CSS_STATUS;
+            document.body.insertBefore(this._status, document.body.firstChild);
+        },
+        /** 
+        * @private
+        * @method _ieSelectFix
+        * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer
+        */
+        _ieSelectFix: function() {
+            return false;
+        },
+        /** 
+        * @private
+        * @property _ieSelectBack
+        * @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it.
+        */
+        _ieSelectBack: null,
+        /** 
+        * @private
+        * @method _setAutoRatio
+        * @param {Event} ev A mouse event.
+        * @description This method checks to see if the "autoRatio" config is set. If it is, we will check to see if the "Shift Key" is pressed. If so, we will set the config ratio to true.
+        */
+        _setAutoRatio: function(ev) {
+            if (this.get('autoRatio')) {
+                if (ev && ev.shiftKey) {
+                    //Shift Pressed
+                    this.set('ratio', true);
+                } else {
+                    this.set('ratio', this._configs.ratio._initialConfig.value);
+                }
+            }
+        },
+        /** 
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev A mouse event.
+        * @description This method preps the autoRatio on MouseDown.
+        */
+        _handleMouseDown: function(ev) {
+            if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                this._positioned = true;
+            }
+            if (ev) {
+                this._setAutoRatio(ev);
+            }
+            if (this.browser.ie) {
+                this._ieSelectBack = document.body.onselectstart;
+                document.body.onselectstart = this._ieSelectFix;
+            }
+        },
+        /** 
+        * @private
+        * @method _handleMouseOver
+        * @param {Event} ev A mouse event.
+        * @description Adds CSS class names to the handles
+        */
+        _handleMouseOver: function(ev) {
+            //Internet Explorer needs this
+            D.removeClass(this._wrap, this.CSS_RESIZE);
+            if (this.get('hover')) {
+                D.removeClass(this._wrap, this.CSS_HOVER);
+            }
+            var tar = Event.getTarget(ev);
+            if (!D.hasClass(tar, this.CSS_HANDLE)) {
+                tar = tar.parentNode;
+            }
+            if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) {
+                D.addClass(tar, this.CSS_HANDLE + '-active');
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            break;
+                        }
+                    }
+                }
+            }
+
+            //Internet Explorer needs this
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _handleMouseOut
+        * @param {Event} ev A mouse event.
+        * @description Removes CSS class names to the handles
+        */
+        _handleMouseOut: function(ev) {
+            //Internet Explorer needs this
+            D.removeClass(this._wrap, this.CSS_RESIZE);
+            if (this.get('hover') && !this._active) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            var tar = Event.getTarget(ev);
+            if (!D.hasClass(tar, this.CSS_HANDLE)) {
+                tar = tar.parentNode;
+            }
+            if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) {
+                D.removeClass(tar, this.CSS_HANDLE + '-active');
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            D.removeClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            break;
+                        }
+                    }
+                }
+            }
+            //Internet Explorer needs this
+            D.addClass(this._wrap, this.CSS_RESIZE);
+        },
+        /** 
+        * @private
+        * @method _handleStartDrag
+        * @param {Object} args The args passed from the CustomEvent.
+        * @param {Object} dd The <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> object we are working with.
+        * @description Resizes the proxy, sets up the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> handlers, updates the status div and preps the cache
+        */
+        _handleStartDrag: function(args, dd) {
+            var tar = dd.getDragEl();
+            if (D.hasClass(tar, this.CSS_HANDLE)) {
+                if (D.getStyle(this._wrap, 'position') == 'absolute') {
+                    this._positioned = true;
+                }
+                this._active = true;
+                this._currentDD = dd;
+                if (this._proxy) {
+                    this._proxy.style.visibility = 'visible';
+                    this._proxy.style.zIndex = '1000';
+                    this._proxy.style.height = this.get('element').clientHeight + 'px';
+                    this._proxy.style.width = this.get('element').clientWidth + 'px';
+                }
+
+                for (var i in this._handles) {
+                    if (Lang.hasOwnProperty(this._handles, i)) {
+                        if (this._handles[i] == tar) {
+                            this._currentHandle = i;
+                            var handle = '_handle_for_' + i;
+                            D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active');
+                            dd.on('dragEvent', this[handle], this, true);
+                            dd.on('mouseUpEvent', this._handleMouseUp, this, true);
+                            break;
+                        }
+                    }
+                }
+
+
+                D.addClass(tar, this.CSS_HANDLE + '-active');
+
+                if (this.get('proxy')) {
+                    var xy = D.getXY(this.get('element'));
+                    D.setXY(this._proxy, xy);
+                    if (this.get('ghost')) {
+                        this.addClass(this.CSS_GHOST);
+                    }
+                }
+                D.addClass(this._wrap, this.CSS_RESIZING);
+                this._setCache();
+                this._updateStatus(this._cache.height, this._cache.width, this._cache.top, this._cache.left);
+                this.fireEvent('startResize', { type: 'startresize', target: this});
+            }
+        },
+        /** 
+        * @private
+        * @method _setCache
+        * @description Sets up the this._cache hash table.
+        */
+        _setCache: function() {
+            this._cache.xy = D.getXY(this._wrap);
+            D.setXY(this._wrap, this._cache.xy);
+            this._cache.height = this.get('clientHeight');
+            this._cache.width = this.get('clientWidth');
+            this._cache.start.height = this._cache.height;
+            this._cache.start.width = this._cache.width;
+            this._cache.start.top = this._cache.xy[1];
+            this._cache.start.left = this._cache.xy[0];
+            this._cache.top = this._cache.xy[1];
+            this._cache.left = this._cache.xy[0];
+        },
+        /** 
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev A mouse event.
+        * @description Cleans up listeners, hides proxy element and removes class names.
+        */
+        _handleMouseUp: function(ev) {
+            this._active = false;
+
+            var handle = '_handle_for_' + this._currentHandle;
+            this._currentDD.unsubscribe('dragEvent', this[handle], this, true);
+            this._currentDD.unsubscribe('mouseUpEvent', this._handleMouseUp, this, true);
+
+            D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-' + this._currentHandle + '-active');
+            D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-active');
+
+            this._currentHandle = null;
+            if (!this.get('animate')) {
+                if (this.get('setSize')) {
+                    this.set('height', this._cache.height);
+                    this.set('width', this._cache.width);
+                } else {
+                    this.set('height', this._cache.height, true);
+                    this.set('width', this._cache.width, true);
+                }
+            }
+
+            if (this._proxy) {
+                this._proxy.style.visibility = 'hidden';
+                this._proxy.style.zIndex = '-1';
+                if (this.get('setSize')) {
+                    this.resize(ev, this._cache.height, this._cache.width, this._cache.top, this._cache.left, true);
+                } else {
+                    this.fireEvent('resize', { ev: 'resize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left });
+                }
+
+                if (this.get('ghost')) {
+                    this.removeClass(this.CSS_GHOST);
+                }
+            }
+
+            D.removeClass(this._wrap, this.CSS_RESIZING);
+            if (this.get('hover')) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            if (this._status) {
+                D.setStyle(this._status, 'display', 'none');
+            }
+            if (this.browser.ie) {
+                document.body.onselectstart = this._ieSelectBack;
+            }
+            for (var i in this._handles) {
+                if (Lang.hasOwnProperty(this._handles, i)) {
+                    D.removeClass(this._handles[i], this.CSS_HANDLE + '-active');
+                }
+            }
+            if (this.get('hover') && !this._active) {
+                D.addClass(this._wrap, this.CSS_HOVER);
+            }
+            this._resizeEvent = null;
+        },
+        /** 
+        * @private
+        * @method _setRatio
+        * @param {Number} h The height offset.
+        * @param {Number} w The with offset.
+        * @param {Number} t The top offset.
+        * @param {Number} l The left offset.
+        * @description Using the Height, Width, Top & Left, it recalcuates them based on the original element size.
+        * @return {Array} The new Height, Width, Top & Left settings
+        */
+        _setRatio: function(h, w, t, l) {
+            var oh = h, ow = w;
+            if (this.get('ratio')) {
+                var orgH = this._cache.height,
+                    orgW = this._cache.width,
+                    nh = parseInt(this.get('height'), 10),
+                    nw = parseInt(this.get('width'), 10),
+                    maxH = this.get('maxHeight'),
+                    minH = this.get('minHeight'),
+                    maxW = this.get('maxWidth'),
+                    minW = this.get('minWidth');
+
+                switch (this._currentHandle) {
+                    case 'l':
+                        h = nh * (w / nw);
+                        h = Math.min(Math.max(minH, h), maxH);                        
+                        w = nw * (h / nh);
+                        t = (this._cache.start.top - (-((nh - h) / 2)));
+                        l = (this._cache.start.left - (-((nw - w))));
+                        break;
+                    case 'r':
+                        h = nh * (w / nw);
+                        h = Math.min(Math.max(minH, h), maxH);                        
+                        w = nw * (h / nh);
+                        t = (this._cache.start.top - (-((nh - h) / 2)));
+                        break;
+                    case 't':
+                        w = nw * (h / nh);
+                        h = nh * (w / nw);
+                        l = (this._cache.start.left - (-((nw - w) / 2)));
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                    case 'b':
+                        w = nw * (h / nh);
+                        h = nh * (w / nw);
+                        l = (this._cache.start.left - (-((nw - w) / 2)));
+                        break;
+                    case 'bl':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left - (-((nw - w))));
+                        break;
+                    case 'br':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        break;
+                    case 'tl':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left - (-((nw - w))));
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                    case 'tr':
+                        h = nh * (w / nw);
+                        w = nw * (h / nh);
+                        l = (this._cache.start.left);
+                        t = (this._cache.start.top - (-((nh - h))));
+                        break;
+                }
+                oh = this._checkHeight(h);
+                ow = this._checkWidth(w);
+                if ((oh != h) || (ow != w)) {
+                    t = 0;
+                    l = 0;
+                }
+            }
+            return [oh, ow, t, l];
+        },
+        /** 
+        * @private
+        * @method _updateStatus
+        * @param {Number} h The new height setting.
+        * @param {Number} w The new width setting.
+        * @param {Number} t The new top setting.
+        * @param {Number} l The new left setting.
+        * @description Using the Height, Width, Top & Left, it updates the status element with the elements sizes.
+        */
+        _updateStatus: function(h, w, t, l) {
+            if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) {
+                if (this.get('status')) {
+                    D.setStyle(this._status, 'display', 'inline');
+                }
+                h = ((h === 0) ? this._cache.start.height : h);
+                w = ((w === 0) ? this._cache.start.width : w);
+                var h1 = parseInt(this.get('height'), 10),
+                    w1 = parseInt(this.get('width'), 10);
+                
+                if (isNaN(h1)) {
+                    h1 = parseInt(h, 10);
+                }
+                if (isNaN(w1)) {
+                    w1 = parseInt(w, 10);
+                }
+                var diffH = (parseInt(h, 10) - h1);
+                var diffW = (parseInt(w, 10) - w1);
+                this._cache.offsetHeight = diffH;
+                this._cache.offsetWidth = diffW;
+                this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
+                D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
+            }
+        },
+        /** 
+        * @method reset
+        * @description Resets the element to is start state.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */
+        reset: function() {
+            this.resize(null, this._cache.start.height, this._cache.start.width, this._cache.start.top, this._cache.start.left, true);
+            return this;
+        },
+        /** 
+        * @method resize
+        * @param {Event} ev The mouse event.
+        * @param {Number} h The new height setting.
+        * @param {Number} w The new width setting.
+        * @param {Number} t The new top setting.
+        * @param {Number} l The new left setting.
+        * @param {Boolean} force Resize the element (used for proxy resize).
+        * @description Resizes the element, wrapper or proxy based on the data from the handlers.
+        * @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
+        */
+        resize: function(ev, h, w, t, l, force) {
+            this._resizeEvent = ev;
+            var el = this._wrap, anim = this.get('animate'), set = true;
+            if (this._proxy && !force) {
+                el = this._proxy;
+                anim = false;
+            }
+            this._setAutoRatio(ev);
+            if (this._positioned) {
+                if (this._proxy) {
+                    t = this._cache.top - t;
+                    l = this._cache.left - l;
+                }
+            }
+
+            var ratio = this._setRatio(h, w, t, l);
+            h = parseInt(ratio[0], 10);
+            w = parseInt(ratio[1], 10);
+            t = parseInt(ratio[2], 10);
+            l = parseInt(ratio[3], 10);
+
+            if (t == 0) {
+                //No Offset, get from cache
+                t = D.getY(el);
+            }
+            if (l == 0) {
+                //No Offset, get from cache
+                l = D.getX(el);
+            }
+
+            this._updateStatus(h, w, t, l);
+            
+
+            if (this._positioned) {
+                if (this._proxy && force) {
+                    if (!anim) {
+                        el.style.top = this._proxy.style.top;
+                        el.style.left = this._proxy.style.left;
+                    } else {
+                        t = this._proxy.style.top;
+                        l = this._proxy.style.left;
+                    }
+                } else {
+                    if (!this.get('ratio') && !this._proxy) {
+                        t = this._cache.top + -(t);
+                        l = this._cache.left + -(l);
+                    }
+                    if (t) {
+                        if (this.get('minY')) {
+                            if (t < this.get('minY')) {
+                                t = this.get('minY');
+                            }
+                        }
+                        if (this.get('maxY')) {
+                            if ((t + h) > this.get('maxY')) {
+                                t = (this.get('maxY') - h);
+                            }
+                        }
+                    }
+                    if (l) {
+                        if (this.get('minX')) {
+                            if (l < this.get('minX')) {
+                                l = this.get('minX');
+                            }
+                        }
+                        if (this.get('maxX')) {
+                            if ((l + w) > this.get('maxX')) {
+                                l = (this.get('maxX') - w);
+                            }
+                        }
+                    }
+                }
+            }
+            var beforeReturn = this.fireEvent('beforeResize', { ev: 'beforeResize', target: this, height: h, width: w, top: t, left: l });
+            if (beforeReturn === false) {
+                return false;
+            }
+            if (this._positioned) {
+                if (this._proxy && force) {
+                    //Do nothing
+                } else {
+                    if (t) {
+                        D.setY(el, t);
+                        this._cache.top = t;
+                    }
+                    if (l) {
+                        D.setX(el, l);
+                        this._cache.left = l;
+                    }
+                }
+            }
+            if (h) {
+                if (!anim) {
+                    set = true;
+                    if (this._proxy && force) {
+                        if (!this.get('setSize')) {
+                            set = false;
+                        }
+                    }
+                    if (set) {
+                        if (this.browser.ie > 6) {
+                            if (h === this._cache.height) {
+                                h = h + 1;
+                            }
+                        }
+                        el.style.height = h + 'px';
+                    }
+                    if ((this._proxy && force) || !this._proxy) {
+                        if (this._wrap != this.get('element')) {
+                            this.get('element').style.height = h + 'px';
+                        }
+                    }
+                }
+                this._cache.height = h;
+            }
+            if (w) {
+                this._cache.width = w;
+                if (!anim) {
+                    set = true;
+                    if (this._proxy && force) {
+                        if (!this.get('setSize')) {
+                            set = false;
+                        }
+                    }
+                    if (set) {
+                        el.style.width = w + 'px';
+                    }
+                    if ((this._proxy && force) || !this._proxy) {
+                        if (this._wrap != this.get('element')) {
+                            this.get('element').style.width = w + 'px';
+                        }
+                    }
+                }
+            }
+            if (anim) {
+                if (YAHOO.util.Anim) {
+                    var _anim = new YAHOO.util.Anim(el, {
+                        height: {
+                            to: this._cache.height
+                        },
+                        width: {
+                            to: this._cache.width
+                        }
+                    }, this.get('animateDuration'), this.get('animateEasing'));
+                    if (this._positioned) {
+                        if (t) {
+                            _anim.attributes.top = {
+                                to: parseInt(t, 10)
+                            };
+                        }
+                        if (l) {
+                            _anim.attributes.left = {
+                                to: parseInt(l, 10)
+                            };
+                        }
+                    }
+
+                    if (this._wrap != this.get('element')) {
+                        _anim.onTween.subscribe(function() {
+                            this.get('element').style.height = el.style.height;
+                            this.get('element').style.width = el.style.width;
+                        }, this, true);
+                    }
+
+                    _anim.onComplete.subscribe(function() {
+                        this.set('height', h);
+                        this.set('width', w);
+                        this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l });
+                    }, this, true);
+                    _anim.animate();
+
+                }
+            } else {
+                if (this._proxy && !force) {
+                    this.fireEvent('proxyResize', { ev: 'proxyresize', target: this, height: h, width: w, top: t, left: l });
+                } else {
+                    this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l });
+                }
+            }
+            return this;
+        },
+        /** 
+        * @private
+        * @method _handle_for_br
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom Right handle.
+        */
+        _handle_for_br: function(args) {
+            var newW = this._setWidth(args.e);
+            var newH = this._setHeight(args.e);
+            this.resize(args.e, (newH + 1), newW, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_bl
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom Left handle.
+        */
+        _handle_for_bl: function(args) {
+            var newW = this._setWidth(args.e, true);
+            var newH = this._setHeight(args.e);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, newH, newW, 0, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_tl
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top Left handle.
+        */
+        _handle_for_tl: function(args) {
+            var newW = this._setWidth(args.e, true);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, newH, newW, t, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_tr
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top Right handle.
+        */
+        _handle_for_tr: function(args) {
+            var newW = this._setWidth(args.e);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            this.resize(args.e, newH, newW, t, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_r
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Right handle.
+        */
+        _handle_for_r: function(args) {
+            this._dds.r.setYConstraint(0,0);
+            var newW = this._setWidth(args.e);
+            this.resize(args.e, 0, newW, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_l
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Left handle.
+        */
+        _handle_for_l: function(args) {
+            this._dds.l.setYConstraint(0,0);
+            var newW = this._setWidth(args.e, true);
+            var l = (newW - this._cache.width);
+            this.resize(args.e, 0, newW, 0, l);
+        },
+        /** 
+        * @private
+        * @method _handle_for_b
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Bottom handle.
+        */
+        _handle_for_b: function(args) {
+            this._dds.b.setXConstraint(0,0);
+            var newH = this._setHeight(args.e);
+            this.resize(args.e, newH, 0, 0, 0);
+        },
+        /** 
+        * @private
+        * @method _handle_for_t
+        * @param {Object} args The arguments from the CustomEvent.
+        * @description Handles the sizes for the Top handle.
+        */
+        _handle_for_t: function(args) {
+            this._dds.t.setXConstraint(0,0);
+            var newH = this._setHeight(args.e, true);
+            var t = (newH - this._cache.height);
+            this.resize(args.e, newH, 0, t, 0);
+        },
+        /** 
+        * @private
+        * @method _setWidth
+        * @param {Event} ev The mouse event.
+        * @param {Boolean} flip Argument to determine the direction of the movement.
+        * @description Calculates the width based on the mouse event.
+        * @return {Number} The new value
+        */
+        _setWidth: function(ev, flip) {
+            var xy = this._cache.xy[0],
+                w = this._cache.width,
+                x = Event.getPageX(ev),
+                nw = (x - xy);
+
+                if (flip) {
+                    nw = (xy - x) + parseInt(this.get('width'), 10);
+                }
+                
+                nw = this._snapTick(nw, this.get('yTicks'));
+                nw = this._checkWidth(nw);
+            return nw;
+        },
+        /** 
+        * @private
+        * @method _checkWidth
+        * @param {Number} w The width to check.
+        * @description Checks the value passed against the maxWidth and minWidth.
+        * @return {Number} the new value
+        */
+        _checkWidth: function(w) {
+            if (this.get('minWidth')) {
+                if (w <= this.get('minWidth')) {
+                    w = this.get('minWidth');
+                }
+            }
+            if (this.get('maxWidth')) {
+                if (w >= this.get('maxWidth')) {
+                    w = this.get('maxWidth');
+                }
+            }
+            return w;
+        },
+        /** 
+        * @private
+        * @method _checkHeight
+        * @param {Number} h The height to check.
+        * @description Checks the value passed against the maxHeight and minHeight.
+        * @return {Number} The new value
+        */
+        _checkHeight: function(h) {
+            if (this.get('minHeight')) {
+                if (h <= this.get('minHeight')) {
+                    h = this.get('minHeight');
+                }
+            }
+            if (this.get('maxHeight')) {
+                if (h >= this.get('maxHeight')) {
+                    h = this.get('maxHeight');
+                }
+            }
+            return h;
+        },
+        /** 
+        * @private
+        * @method _setHeight
+        * @param {Event} ev The mouse event.
+        * @param {Boolean} flip Argument to determine the direction of the movement.
+        * @description Calculated the height based on the mouse event.
+        * @return {Number} The new value
+        */
+        _setHeight: function(ev, flip) {
+            var xy = this._cache.xy[1],
+                h = this._cache.height,
+                y = Event.getPageY(ev),
+                nh = (y - xy);
+
+                if (flip) {
+                    nh = (xy - y) + parseInt(this.get('height'), 10);
+                }
+                nh = this._snapTick(nh, this.get('xTicks'));
+                nh = this._checkHeight(nh);
+                
+            return nh;
+        },
+        /** 
+        * @private
+        * @method _snapTick
+        * @param {Number} size The size to tick against.
+        * @param {Number} pix The tick pixels.
+        * @description Adjusts the number based on the ticks used.
+        * @return {Number} the new snapped position
+        */
+        _snapTick: function(size, pix) {
+            if (!size || !pix) {
+                return size;
+            }
+            var _s = size;
+            var _x = size % pix;
+            if (_x > 0) {
+                if (_x > (pix / 2)) {
+                    _s = size + (pix - _x);
+                } else {
+                    _s = size - _x;
+                }
+            }
+            return _s;
+        },
+        /** 
+        * @private
+        * @method init
+        * @description The Resize class's initialization method
+        */        
+        init: function(p_oElement, p_oAttributes) {
+            this._cache = {
+                xy: [],
+                height: 0,
+                width: 0,
+                top: 0,
+                left: 0,
+                offsetHeight: 0,
+                offsetWidth: 0,
+                start: {
+                    height: 0,
+                    width: 0,
+                    top: 0,
+                    left: 0
+                }
+            };
+
+            Resize.superclass.init.call(this, p_oElement, p_oAttributes);
+
+            this.set('setSize', this.get('setSize'));
+
+            if (p_oAttributes.height) {
+                this.set('height', parseInt(p_oAttributes.height, 10));
+            }
+            if (p_oAttributes.width) {
+                this.set('width', parseInt(p_oAttributes.width, 10));
+            }
+            
+            var id = p_oElement;
+            if (!Lang.isString(id)) {
+                id = D.generateId(id);
+            }
+            Resize._instances[id] = this;
+
+            this._active = false;
+            
+            this._createWrap();
+            this._createProxy();
+            this._createHandles();
+
+        },
+        /**
+        * @method getProxyEl
+        * @description Get the HTML reference for the proxy, returns null if no proxy.
+        * @return {HTMLElement} The proxy element
+        */      
+        getProxyEl: function() {
+            return this._proxy;
+        },
+        /**
+        * @method getWrapEl
+        * @description Get the HTML reference for the wrap element, returns the current element if not wrapped.
+        * @return {HTMLElement} The wrap element
+        */      
+        getWrapEl: function() {
+            return this._wrap;
+        },
+        /**
+        * @method getStatusEl
+        * @description Get the HTML reference for the status element.
+        * @return {HTMLElement} The status element
+        */      
+        getStatusEl: function() {
+            return this._status;
+        },
+        /**
+        * @method getActiveHandleEl
+        * @description Get the HTML reference for the currently active resize handle.
+        * @return {HTMLElement} The handle element that is active
+        */      
+        getActiveHandleEl: function() {
+            return this._handles[this._currentHandle];
+        },
+        /**
+        * @method isActive
+        * @description Returns true or false if a resize operation is currently active on the element.
+        * @return {Boolean}
+        */      
+        isActive: function() {
+            return ((this._active) ? true : false);
+        },
+        /**
+        * @private
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create a resizable element.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the utility.
+        */      
+        initAttributes: function(attr) {
+            Resize.superclass.initAttributes.call(this, attr);
+
+            /**
+            * @attribute setSize
+            * @description Set the size of the resized element, if set to false the element will not be auto resized,
+            * the resize event will contain the dimensions so the end user can resize it on their own.
+            * This setting will only work with proxy set to true and animate set to false.
+            * @type Boolean
+            */
+            this.setAttributeConfig('setSize', {
+                value: ((attr.setSize === false) ? false : true),
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute wrap
+            * @description Should we wrap the element
+            * @type Boolean
+            */
+            this.setAttributeConfig('wrap', {
+                writeOnce: true,
+                validator: YAHOO.lang.isBoolean,
+                value: attr.wrap || false
+            });
+
+            /**
+            * @attribute handles
+            * @description The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. Defaults to: ['r', 'b', 'br'].
+            * Can use a shortcut of All. Note: 8 way resizing should be done on an element that is absolutely positioned.
+            * @type Array
+            */
+            this.setAttributeConfig('handles', {
+                writeOnce: true,
+                value: attr.handles || ['r', 'b', 'br'],
+                validator: function(handles) {
+                    if (Lang.isString(handles) && handles.toLowerCase() == 'all') {
+                        handles = ['t', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'];
+                    }
+                    if (!Lang.isArray(handles)) {
+                        handles = handles.replace(/, /g, ',');
+                        handles = handles.split(',');
+                    }
+                    this._configs.handles.value = handles;
+                }
+            });
+
+            /**
+            * @attribute width
+            * @description The width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('width', {
+                value: attr.width || parseInt(this.getStyle('width'), 10),
+                validator: YAHOO.lang.isNumber,
+                method: function(width) {
+                    width = parseInt(width, 10);
+                    if (width > 0) {
+                        if (this.get('setSize')) {
+                            this.setStyle('width', width + 'px');
+                        }
+                        this._cache.width = width;
+                        this._configs.width.value = width;
+                    }
+                }
+            });
+
+            /**
+            * @attribute height
+            * @description The height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || parseInt(this.getStyle('height'), 10),
+                validator: YAHOO.lang.isNumber,
+                method: function(height) {
+                    height = parseInt(height, 10);
+                    if (height > 0) {
+                        if (this.get('setSize')) {
+                            this.setStyle('height', height + 'px');
+                        }
+                        this._cache.height = height;
+                        this._configs.height.value = height;
+                    }
+                }
+            });
+
+            /**
+            * @attribute minWidth
+            * @description The minimum width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minWidth', {
+                value: attr.minWidth || 15,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minHeight
+            * @description The minimum height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minHeight', {
+                value: attr.minHeight || 15,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxWidth
+            * @description The maximum width of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxWidth', {
+                value: attr.maxWidth || 10000,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute maxHeight
+            * @description The maximum height of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxHeight', {
+                value: attr.maxHeight || 10000,
+                validator: YAHOO.lang.isNumber
+            });
+
+            /**
+            * @attribute minY
+            * @description The minimum y coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minY', {
+                value: attr.minY || false
+            });
+
+            /**
+            * @attribute minX
+            * @description The minimum x coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('minX', {
+                value: attr.minX || false
+            });
+            /**
+            * @attribute maxY
+            * @description The max y coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxY', {
+                value: attr.maxY || false
+            });
+
+            /**
+            * @attribute maxX
+            * @description The max x coord of the element
+            * @type Number
+            */
+            this.setAttributeConfig('maxX', {
+                value: attr.maxX || false
+            });
+
+            /**
+            * @attribute animate
+            * @description Should be use animation to resize the element (can only be used if we use proxy).
+            * @type Boolean
+            */
+            this.setAttributeConfig('animate', {
+                value: attr.animate || false,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+
+            /**
+            * @attribute animateEasing
+            * @description The Easing to apply to the animation.
+            * @type Object
+            */
+            this.setAttributeConfig('animateEasing', {
+                value: attr.animateEasing || function() {
+                    var easing = false;
+                    try {
+                        easing = YAHOO.util.Easing.easeOut;
+                    } catch (e) {}
+                    return easing;
+                }()
+            });
+
+            /**
+            * @attribute animateDuration
+            * @description The Duration to apply to the animation.
+            * @type Number
+            */
+            this.setAttributeConfig('animateDuration', {
+                value: attr.animateDuration || 0.5
+            });
+
+            /**
+            * @attribute proxy
+            * @description Resize a proxy element instead of the real element.
+            * @type Boolean
+            */
+            this.setAttributeConfig('proxy', {
+                value: attr.proxy || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute ratio
+            * @description Maintain the element's ratio when resizing.
+            * @type Boolean
+            */
+            this.setAttributeConfig('ratio', {
+                value: attr.ratio || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute ghost
+            * @description Apply an opacity filter to the element being resized (only works with proxy).
+            * @type Boolean
+            */
+            this.setAttributeConfig('ghost', {
+                value: attr.ghost || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute draggable
+            * @description A convienence method to make the element draggable
+            * @type Boolean
+            */
+            this.setAttributeConfig('draggable', {
+                value: attr.draggable || false,
+                validator: YAHOO.lang.isBoolean,
+                method: function(dd) {
+                    if (dd && this._wrap) {
+                        this._setupDragDrop();
+                    } else {
+                        if (this.dd) {
+                            D.removeClass(this._wrap, this.CSS_DRAG);
+                            this.dd.unreg();
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @attribute hover
+            * @description Only show the handles when they are being moused over.
+            * @type Boolean
+            */
+            this.setAttributeConfig('hover', {
+                value: attr.hover || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute hiddenHandles
+            * @description Don't show the handles, just use the cursor to the user.
+            * @type Boolean
+            */
+            this.setAttributeConfig('hiddenHandles', {
+                value: attr.hiddenHandles || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute knobHandles
+            * @description Use the smaller handles, instead if the full size handles.
+            * @type Boolean
+            */
+            this.setAttributeConfig('knobHandles', {
+                value: attr.knobHandles || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute xTicks
+            * @description The number of x ticks to span the resize to.
+            * @type Number or False
+            */
+            this.setAttributeConfig('xTicks', {
+                value: attr.xTicks || false
+            });
+
+            /**
+            * @attribute yTicks
+            * @description The number of y ticks to span the resize to.
+            * @type Number or False
+            */
+            this.setAttributeConfig('yTicks', {
+                value: attr.yTicks || false
+            });
+
+            /**
+            * @attribute status
+            * @description Show the status (new size) of the resize.
+            * @type Boolean
+            */
+            this.setAttributeConfig('status', {
+                value: attr.status || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+            /**
+            * @attribute autoRatio
+            * @description Using the shift key during a resize will toggle the ratio config.
+            * @type Boolean
+            */
+            this.setAttributeConfig('autoRatio', {
+                value: attr.autoRatio || false,
+                validator: YAHOO.lang.isBoolean
+            });
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the resize object and all of it's elements & listeners.
+        */        
+        destroy: function() {
+            for (var h in this._handles) {
+                if (Lang.hasOwnProperty(this._handles, h)) {
+                    Event.purgeElement(this._handles[h]);
+                    this._handles[h].parentNode.removeChild(this._handles[h]);
+                }
+            }
+            if (this._proxy) {
+                this._proxy.parentNode.removeChild(this._proxy);
+            }
+            if (this.dd) {
+                this.dd.unreg();
+                D.removeClass(this._wrap, this.CSS_DRAG);
+            }
+            if (this._wrap != this.get('element')) {
+                this.setStyle('position', '');
+                this.setStyle('top', '');
+                this.setStyle('left', '');
+                this._wrap.parentNode.replaceChild(this.get('element'), this._wrap);
+            }
+            this.removeClass(this.CSS_RESIZE);
+
+            delete YAHOO.util.Resize._instances[this.get('id')];
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                    delete this[i];
+                }
+            }
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the Resize Object.
+        * @return {String}
+        */        
+        toString: function() {
+            if (this.get) {
+                return 'Resize (#' + this.get('id') + ')';
+            }
+            return 'Resize Utility';
+        }
+    });
+
+    YAHOO.util.Resize = Resize;
+/**
+* @event dragEvent
+* @description Fires when the <a href="YAHOO.util.DragDrop.html">YAHOO.util.DragDrop</a> dragEvent is fired for the config option draggable.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event startResize
+* @description Fires when when a resize action is started.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event resize
+* @description Fires on every element resize (only fires once when used with proxy config setting).
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeResize
+* @description Fires before every element resize after the size calculations, returning false will stop the resize.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event proxyResize
+* @description Fires on every proxy resize (only fires when used with proxy config setting).
+* @type YAHOO.util.CustomEvent
+*/
+
+})();
+
+YAHOO.register("resize", YAHOO.util.Resize, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/selector/README b/lib/yui/selector/README
new file mode 100644 (file)
index 0000000..3603e21
--- /dev/null
@@ -0,0 +1,11 @@
+YUI Library - Selector - Release Notes
+
+2.5.0
+
+  * query() now returns single node (not array) when firstOnly is true
+  * filter() now works with ID input
+  * pseudos and attributes correctly handle spaces
+
+2.4.0
+
+  * Beta release
diff --git a/lib/yui/selector/selector-beta-debug.js b/lib/yui/selector/selector-beta-debug.js
new file mode 100644 (file)
index 0000000..32b86c4
--- /dev/null
@@ -0,0 +1,668 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The selector module provides helper methods allowing CSS3 Selectors to be used with DOM elements.
+ * @module selector
+ * @title Selector Utility
+ * @namespace YAHOO.util
+ * @requires yahoo, dom
+ */
+
+(function() {
+/**
+ * Provides helper methods for collecting and filtering DOM elements.
+ * @namespace YAHOO.util
+ * @class Selector
+ * @static
+ */
+var Selector = function() {};
+
+var Y = YAHOO.util;
+
+var X = {
+    BEGIN: '^',
+    END: '$',
+    OR: '|',
+    SP: '\\s+'
+};
+
+X.BEGIN_SPACE = '(?:' + X.BEGIN + X.OR + X.SP +')';
+X.END_SPACE = '(?:' + X.SP + X.OR + X.END + ')';
+X.NTH_CHILD = '^(?:([-]?\\d*)(n){1}|(odd|even)$)*([-+]?\\d*)$';
+
+Selector.prototype = {
+    /**
+     * Default document for use queries 
+     * @property document
+     * @type object
+     * @default window.document
+     */
+    document: window.document,
+    /**
+     * Mapping of attributes to aliases, normally to work around HTMLAttributes
+     * that conflict with JS reserved words.
+     * @property attrAliases
+     * @type object
+     */
+    attrAliases: {
+        'for': 'htmlFor'
+    },
+
+    /**
+     * Mapping of shorthand tokens to corresponding attribute selector 
+     * @property shorthand
+     * @type object
+     */
+    shorthand: {
+        //'(?:(?:[^\\)\\]\\s*>+~,]+)(?:-?[_a-z]+[-\\w]))+#(-?[_a-z]+[-\\w]*)': '[id=$1]',
+        '\\#(-?[_a-z]+[-\\w]*)': '[id=$1]',
+        '\\.(-?[_a-z]+[-\\w]*)': '[class~=$1]'
+    },
+
+    /**
+     * List of operators and corresponding boolean functions. 
+     * These functions are passed the attribute and the current node's value of the attribute.
+     * @property operators
+     * @type object
+     */
+    operators: {
+        '=': function(attr, val) { return attr === val; }, // Equality
+        '!=': function(attr, val) { return attr !== val; }, // Inequality
+        '~=': function(attr, val) { // Match one of space seperated words 
+            var s = ' ';
+            return (s + attr + s).indexOf((s + val + s)) > -1;
+        },
+        '|=': function(attr, val) { return getRegExp(X.BEGIN + val + '[-]?').test(attr); }, // Match start with value followed by optional hyphen
+        '^=': function(attr, val) { return attr.indexOf(val) === 0; }, // Match starts with value
+        '$=': function(attr, val) { return attr.lastIndexOf(val) === attr.length - val.length; }, // Match ends with value
+        '*=': function(attr, val) { return attr.indexOf(val) > -1; }, // Match contains value as substring 
+        '': function(attr, val) { return attr; } // Just test for existence of attribute
+    },
+
+    /**
+     * List of pseudo-classes and corresponding boolean functions. 
+     * These functions are called with the current node, and any value that was parsed with the pseudo regex.
+     * @property pseudos
+     * @type object
+     */
+    pseudos: {
+        'root': function(node) {
+            return node === node.ownerDocument.documentElement;
+        },
+
+        'nth-child': function(node, val) {
+            return getNth(node, val);
+        },
+
+        'nth-last-child': function(node, val) {
+            return getNth(node, val, null, true);
+        },
+
+        'nth-of-type': function(node, val) {
+            return getNth(node, val, node.tagName);
+        },
+         
+        'nth-last-of-type': function(node, val) {
+            return getNth(node, val, node.tagName, true);
+        },
+         
+        'first-child': function(node) {
+            return getChildren(node.parentNode)[0] === node;
+        },
+
+        'last-child': function(node) {
+            var children = getChildren(node.parentNode);
+            return children[children.length - 1] === node;
+        },
+
+        'first-of-type': function(node, val) {
+            return getChildren(node.parentNode, node.tagName.toLowerCase())[0];
+        },
+         
+        'last-of-type': function(node, val) {
+            var children = getChildren(node.parentNode, node.tagName.toLowerCase());
+            return children[children.length - 1];
+        },
+         
+        'only-child': function(node) {
+            var children = getChildren(node.parentNode);
+            return children.length === 1 && children[0] === node;
+        },
+
+        'only-of-type': function(node) {
+            return getChildren(node.parentNode, node.tagName.toLowerCase()).length === 1;
+        },
+
+        'empty': function(node) {
+            return node.childNodes.length === 0;
+        },
+
+        'not': function(node, simple) {
+            return !Selector.test(node, simple);
+        },
+
+        'contains': function(node, str) {
+            var text = node.innerText || node.textContent || '';
+            return text.indexOf(str) > -1;
+        },
+        'checked': function(node) {
+            return node.checked === true;
+        }
+    },
+
+    /**
+     * Test if the supplied node matches the supplied selector.
+     * @method test
+     *
+     * @param {HTMLElement | String} node An id or node reference to the HTMLElement being tested.
+     * @param {string} selector The CSS Selector to test the node against.
+     * @return{boolean} Whether or not the node matches the selector.
+     * @static
+    
+     */
+    test: function(node, selector) {
+        node = Selector.document.getElementById(node) || node;
+        var groups = selector ? selector.split(',') : [];
+        if (groups.length) {
+            for (var i = 0, len = groups.length; i < len; ++i) {
+                if ( rTestNode(node, groups[i]) ) { // passes if ANY group matches
+                    return true;
+                }
+            }
+            return false;
+        }
+        return rTestNode(node, selector);
+    },
+
+    /**
+     * Filters a set of nodes based on a given CSS selector. 
+     * @method filter
+     *
+     * @param {array}  A set of nodes/ids to filter. 
+     * @param {string} selector The selector used to test each node.
+     * @return{array} An array of nodes from the supplied array that match the given selector.
+     * @static
+     */
+    filter: function(arr, selector) {
+        if (!arr || !selector) {
+            YAHOO.log('filter: invalid input, returning array as is', 'warn', 'Selector');
+        }
+        var node,
+            nodes = arr,
+            result = [],
+            tokens = tokenize(selector);
+
+        if (!nodes.item) { // if not HTMLCollection, handle arrays of ids and/or nodes
+            YAHOO.log('filter: scanning input for HTMLElements/IDs', 'info', 'Selector');
+            for (var i = 0, len = arr.length; i < len; ++i) {
+                if (!arr[i].tagName) { // tagName limits to HTMLElements 
+                    node = Selector.document.getElementById(arr[i]);
+                    if (node) { // skip IDs that return null 
+                        nodes[nodes.length] = node;
+                    } else {
+                        YAHOO.log('filter: skipping invalid node', 'warn', 'Selector');
+                    }
+                }
+            }
+        }
+        result = rFilter(nodes, tokenize(selector)[0]);
+        clearParentCache();
+        YAHOO.log('filter: returning:' + result.length, 'info', 'Selector');
+        return result;
+    },
+
+    /**
+     * Retrieves a set of nodes based on a given CSS selector. 
+     * @method query
+     *
+     * @param {string} selector The CSS Selector to test the node against.
+     * @param {HTMLElement | String} root optional An id or HTMLElement to start the query from. Defaults to Selector.document.
+     * @param {Boolean} firstOnly optional Whether or not to return only the first match.
+     * @return {Array} An array of nodes that match the given selector.
+     * @static
+     */
+    query: function(selector, root, firstOnly) {
+        var result = query(selector, root, firstOnly);
+        YAHOO.log('query: returning ' + result.length + ' nodes', 'info', 'Selector');
+        return result;
+    }
+};
+
+var query = function(selector, root, firstOnly, deDupe) {
+    if (!selector) {
+        return []; // no nodes for you
+    }
+    var result = [];
+    var groups = selector.split(',');
+
+    if (groups.length > 1) {
+        for (var i = 0, len = groups.length; i < len; ++i) {
+            result = result.concat( arguments.callee(groups[i], root, firstOnly, true) ); 
+        }
+        clearFoundCache();
+        return result;
+    }
+
+    if (root && !root.tagName) {
+        root = Selector.document.getElementById(root);
+        if (!root) {
+            YAHOO.log('invalid root node provided', 'warn', 'Selector');
+            return [];
+        }
+    }
+
+    root = root || Selector.document;
+    var tokens = tokenize(selector);
+    var idToken = tokens[getIdTokenIndex(tokens)],
+        nodes = [],
+        node,
+        id,
+        token = tokens.pop() || {};
+        
+    if (idToken) {
+        id = getId(idToken.attributes);
+    }
+
+    // if no root alternate root is specified use id shortcut
+    if (id) {
+        if (id === token.id) { // only one target
+            nodes = [Selector.document.getElementById(id)] || root;
+        } else { // reset root to id node if passes
+            node = Selector.document.getElementById(id);
+            if (root === Selector.document || contains(node, root)) {
+                if ( node && rTestNode(node, null, idToken) ) {
+                    root = node; // start from here
+                }
+            } else {
+                return [];
+            }
+        }
+    }
+
+    if (root && !nodes.length) {
+        nodes = root.getElementsByTagName(token.tag);
+    }
+
+    if (nodes.length) {
+        result = rFilter(nodes, token, firstOnly, deDupe); 
+    }
+    clearParentCache();
+    return result;
+};
+
+var contains = function() {
+    if (document.documentElement.contains && !YAHOO.env.ua.webkit < 422)  { // IE & Opera, Safari < 3 contains is broken
+        return function(needle, haystack) {
+            return haystack.contains(needle);
+        };
+    } else if ( document.documentElement.compareDocumentPosition ) { // gecko
+        return function(needle, haystack) {
+            return !!(haystack.compareDocumentPosition(needle) & 16);
+        };
+    } else  { // Safari < 3
+        return function(needle, haystack) {
+            var parent = needle.parentNode;
+            while (parent) {
+                if (needle === parent) {
+                    return true;
+                }
+                parent = parent.parentNode;
+            } 
+            return false;
+        }; 
+    }
+}();
+
+var rFilter = function(nodes, token, firstOnly, deDupe) {
+    var result = [];
+
+    for (var i = 0, len = nodes.length; i < len; ++i) {
+        if (!rTestNode(nodes[i], 0, token) || (deDupe && nodes[i]._found) ) {
+            continue;
+        }
+
+        if (firstOnly) {
+            return nodes[i];
+        }
+        if (deDupe) {
+            nodes[i]._found = true;
+            foundCache[foundCache.length] = nodes[i];
+        }
+
+        result[result.length] = nodes[i];
+    }
+
+    return result;
+};
+
+var rTestNode = function(node, selector, token) {
+    token = token || tokenize(selector).pop() || {};
+
+    if (!node || node._found || (token.tag != '*' && node.tagName.toLowerCase() != token.tag)) {
+        return false; // tag match failed
+    } 
+
+    var ops = Selector.operators,
+        ps = Selector.pseudos,
+        attr = token.attributes,
+        pseudos = token.pseudos,
+        prev = token.previous;
+
+    if (attr.length) {
+        for (var i = 0, len = attr.length; i < len; ++i) {
+            if (ops[attr[i][1]] &&
+                    !ops[attr[i][1]](node.getAttribute(attr[i][0], 2),
+                            attr[i][2])) {
+                return false;
+            }
+        }
+    }
+
+    if (pseudos.length) {
+        for (i = 0, len = pseudos.length; i < len; ++i) {
+            if (ps[pseudos[i][0]] &&
+                    !ps[pseudos[i][0]](node, pseudos[i][1])) {
+                return false;
+            }
+        }
+    }
+    if (prev) {
+        if (prev.combinator !== ',') {
+            return combinators[prev.combinator](node, token);
+        }
+    }
+    return true;
+
+};
+
+var foundCache = [];
+var parentCache = [];
+var regexCache = {};
+
+var clearFoundCache = function() {
+    YAHOO.log('getBySelector: clearing found cache of ' + foundCache.length + ' elements');
+    for (var i = 0, len = foundCache.length; i < len; ++i) {
+        try { // IE no like delete
+            delete foundCache[i]._found;
+        } catch(e) {
+            foundCache[i].removeAttribute('_found');
+        }
+    }
+    foundCache = [];
+    YAHOO.log('getBySelector: done clearing foundCache');
+};
+
+var clearParentCache = function() {
+    if (!document.documentElement.children) { // caching children lookups for gecko
+        return function() {
+            for (var i = 0, len = parentCache.length; i < len; ++i) {
+                delete parentCache[i]._children;
+            }
+            parentCache = [];
+        };
+    } else return function() {}; // do nothing
+}();
+
+var getRegExp = function(str, flags) {
+    flags = flags || '';
+    if (!regexCache[str + flags]) {
+        regexCache[str + flags] = new RegExp(str, flags);
+    }
+    return regexCache[str + flags];
+};
+
+var combinators = {
+    ' ': function(node, token) {
+        node = node.parentNode;
+        while (node && node.tagName) {
+            if (rTestNode(node, null, token.previous)) {
+                return true;
+            }
+            node = node.parentNode;
+        }  
+        return false;
+    },
+
+    '>': function(node, token) {
+        return rTestNode(node.parentNode, null, token.previous);
+    },
+    '+': function(node, token) {
+        var sib = node.previousSibling;
+        while (sib && sib.nodeType !== 1) {
+            sib = sib.previousSibling;
+        }
+
+        if (sib && rTestNode(sib, null, token.previous)) {
+            return true; 
+        }
+        return false;
+    },
+
+    '~': function(node, token) {
+        var sib = node.previousSibling;
+        while (sib) {
+            if (sib.nodeType === 1 && rTestNode(sib, null, token.previous)) {
+                return true;
+            }
+            sib = sib.previousSibling;
+        }
+
+        return false;
+    }
+};
+
+var getChildren = function() {
+    if (document.documentElement.children) { // document for capability test
+        return function(node, tag) {
+            return (tag) ? node.children.tags(tag) : node.children || [];
+        };
+    } else {
+        return function(node, tag) {
+            if (node._children) {
+                return node._children;
+            }
+            var children = [],
+                childNodes = node.childNodes;
+
+            for (var i = 0, len = childNodes.length; i < len; ++i) {
+                if (childNodes[i].tagName) {
+                    if (!tag || childNodes[i].tagName.toLowerCase() === tag) {
+                        children[children.length] = childNodes[i];
+                    }
+                }
+            }
+            node._children = children;
+            parentCache[parentCache.length] = node;
+            return children;
+        };
+    }
+}();
+
+/*
+    an+b = get every _a_th node starting at the _b_th
+    0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element
+    1n+b =  get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n")
+    an+0 = get every _a_th element, "0" may be omitted 
+*/
+var getNth = function(node, expr, tag, reverse) {
+    if (tag) tag = tag.toLowerCase();
+    var re = regexCache[X.NTH_CHILD] = regexCache[X.NTH_CHILD] || new RegExp(X.NTH_CHILD);
+    re.test(expr);
+    var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_)
+        n = RegExp.$2, // "n"
+        oddeven = RegExp.$3, // "odd" or "even"
+        b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_
+        result = [];
+
+    var siblings = getChildren(node.parentNode, tag);
+
+    if (oddeven) {
+        a = 2; // always every other
+        op = '+';
+        n = 'n';
+        b = (oddeven === 'odd') ? 1 : 0;
+    } else if ( isNaN(a) ) {
+        a = (n) ? 1 : 0; // start from the first or no repeat
+    }
+
+    if (a === 0) { // just the first
+        if (reverse) {
+            b = siblings.length - b + 1; 
+        }
+
+        if (siblings[b - 1] === node) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (a < 0) {
+        reverse = !!reverse;
+        a = Math.abs(a);
+    }
+
+    if (!reverse) {
+        for (var i = b - 1, len = siblings.length; i < len; i += a) {
+            if ( i >= 0 && siblings[i] === node ) {
+                return true;
+            }
+        }
+    } else {
+        for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) {
+            if ( i < len && siblings[i] === node ) {
+                return true;
+            }
+        }
+    }
+    return false;
+};
+
+var getId = function(attr) {
+    for (var i = 0, len = attr.length; i < len; ++i) {
+        if (attr[i][0] == 'id' && attr[i][1] === '=') {
+            return attr[i][2];
+        }
+    }
+};
+
+var getIdTokenIndex = function(tokens) {
+    for (var i = 0, len = tokens.length; i < len; ++i) {
+        if (getId(tokens[i].attributes)) {
+            return i;
+        }
+    }
+    return -1;
+};
+
+var patterns = {
+    tag: /^((?:-?[_a-z]+[\w-]*)|\*)/i,
+    attributes: /^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*)['"]?\]*/i,
+    pseudos: /^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,
+    combinator: /^\s*([>+~]|\s)\s*/
+};
+
+/**
+    Break selector into token units per simple selector.
+    Combinator is attached to left-hand selector.
+ */
+var tokenize = function(selector) {
+    var token = {},     // one token per simple selector (left selector holds combinator)
+        tokens = [],    // array of tokens
+        id,             // unique id for the simple selector (if found)
+        found = false,  // whether or not any matches were found this pass
+        match;          // the regex match
+
+    selector = replaceShorthand(selector); // convert ID and CLASS shortcuts to attributes
+
+    /*
+        Search for selector patterns, store, and strip them from the selector string
+        until no patterns match (invalid selector) or we run out of chars.
+
+        Multiple attributes and pseudos are allowed, in any order.
+        for example:
+            'form:first-child[type=button]:not(button)[lang|=en]'
+    */
+    do {
+        found = false; // reset after full pass
+        for (var re in patterns) {
+                if (re != 'tag' && re != 'combinator') { // only one allowed
+                    token[re] = token[re] || [];
+                }
+            if (match = patterns[re].exec(selector)) { // note assignment
+                found = true;
+                if (re != 'tag' && re != 'combinator') { // only one allowed
+                    //token[re] = token[re] || [];
+
+                    // capture ID for fast path to element
+                    if (re === 'attributes' && match[1] === 'id') {
+                        token.id = match[3];
+                    }
+
+                    token[re].push(match.slice(1));
+                } else { // single selector (tag, combinator)
+                    token[re] = match[1];
+                }
+                selector = selector.replace(match[0], ''); // strip current match from selector
+                if (re === 'combinator' || !selector.length) { // next token or done
+                    token.attributes = fixAttributes(token.attributes);
+                    token.pseudos = token.pseudos || [];
+                    token.tag = token.tag || '*';
+                    tokens.push(token);
+
+                    token = { // prep next token
+                        previous: token
+                    };
+                }
+            }
+        }
+    } while (found);
+
+    return tokens;
+};
+
+var fixAttributes = function(attr) {
+    var aliases = Selector.attrAliases;
+    attr = attr || [];
+    for (var i = 0, len = attr.length; i < len; ++i) {
+        if (aliases[attr[i][0]]) { // convert reserved words, etc
+            attr[i][0] = aliases[attr[i][0]];
+        }
+        if (!attr[i][1]) { // use exists operator
+            attr[i][1] = '';
+        }
+    }
+    return attr;
+};
+
+var replaceShorthand = function(selector) {
+    var shorthand = Selector.shorthand;
+    var attrs = selector.match(patterns.attributes); // pull attributes to avoid false pos on "." and "#"
+    if (attrs) {
+        selector = selector.replace(patterns.attributes, 'REPLACED_ATTRIBUTE');
+    }
+    for (var re in shorthand) {
+        selector = selector.replace(getRegExp(re, 'gi'), shorthand[re]);
+    }
+
+    if (attrs) {
+        for (var i = 0, len = attrs.length; i < len; ++i) {
+            selector = selector.replace('REPLACED_ATTRIBUTE', attrs[i]);
+        }
+    }
+    return selector;
+};
+
+if (YAHOO.env.ua.ie) { // rewrite class for IE (others use getAttribute('class')
+    Selector.prototype.attrAliases['class'] = 'className';
+}
+
+Selector = new Selector();
+Selector.TOKENS = X;
+Selector.patterns = patterns;
+Y.Selector = Selector;
+})();
+YAHOO.register("selector", YAHOO.util.Selector, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/selector/selector-beta-min.js b/lib/yui/selector/selector-beta-min.js
new file mode 100644 (file)
index 0000000..1fbd7de
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+(function(){var U=function(){};var E=YAHOO.util;var F={BEGIN:"^",END:"$",OR:"|",SP:"\\s+"};F.BEGIN_SPACE="(?:"+F.BEGIN+F.OR+F.SP+")";F.END_SPACE="(?:"+F.SP+F.OR+F.END+")";F.NTH_CHILD="^(?:([-]?\\d*)(n){1}|(odd|even)$)*([-+]?\\d*)$";U.prototype={document:window.document,attrAliases:{"for":"htmlFor"},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(W,X){return W===X;},"!=":function(W,X){return W!==X;},"~=":function(W,Y){var X=" ";return(X+W+X).indexOf((X+Y+X))>-1;},"|=":function(W,X){return H(F.BEGIN+X+"[-]?").test(W);},"^=":function(W,X){return W.indexOf(X)===0;},"$=":function(W,X){return W.lastIndexOf(X)===W.length-X.length;},"*=":function(W,X){return W.indexOf(X)>-1;},"":function(W,X){return W;}},pseudos:{"root":function(W){return W===W.ownerDocument.documentElement;},"nth-child":function(W,X){return S(W,X);},"nth-last-child":function(W,X){return S(W,X,null,true);},"nth-of-type":function(W,X){return S(W,X,W.tagName);},"nth-last-of-type":function(W,X){return S(W,X,W.tagName,true);},"first-child":function(W){return G(W.parentNode)[0]===W;},"last-child":function(X){var W=G(X.parentNode);return W[W.length-1]===X;},"first-of-type":function(W,X){return G(W.parentNode,W.tagName.toLowerCase())[0];},"last-of-type":function(X,Y){var W=G(X.parentNode,X.tagName.toLowerCase());return W[W.length-1];},"only-child":function(X){var W=G(X.parentNode);return W.length===1&&W[0]===X;},"only-of-type":function(W){return G(W.parentNode,W.tagName.toLowerCase()).length===1;},"empty":function(W){return W.childNodes.length===0;},"not":function(W,X){return !U.test(W,X);},"contains":function(W,Y){var X=W.innerText||W.textContent||"";return X.indexOf(Y)>-1;},"checked":function(W){return W.checked===true;}},test:function(a,Y){a=U.document.getElementById(a)||a;var X=Y?Y.split(","):[];if(X.length){for(var Z=0,W=X.length;Z<W;++Z){if(V(a,X[Z])){return true;}}return false;}return V(a,Y);},filter:function(Z,Y){if(!Z||!Y){}var c,a=Z,X=[],d=C(Y);if(!a.item){for(var b=0,W=Z.length;b<W;++b){if(!Z[b].tagName){c=U.document.getElementById(Z[b]);if(c){a[a.length]=c;}else{}}}}X=R(a,C(Y)[0]);B();return X;},query:function(X,Y,Z){var W=I(X,Y,Z);return W;}};var I=function(c,h,j,a){if(!c){return[];}var k=[];var Y=c.split(",");if(Y.length>1){for(var d=0,e=Y.length;d<e;++d){k=k.concat(arguments.callee(Y[d],h,j,true));}J();return k;}if(h&&!h.tagName){h=U.document.getElementById(h);if(!h){return[];}}h=h||U.document;var g=C(c);var f=g[O(g)],W=[],Z,X,b=g.pop()||{};if(f){X=Q(f.attributes);}if(X){if(X===b.id){W=[U.document.getElementById(X)]||h;}else{Z=U.document.getElementById(X);if(h===U.document||M(Z,h)){if(Z&&V(Z,null,f)){h=Z;}}else{return[];}}}if(h&&!W.length){W=h.getElementsByTagName(b.tag);}if(W.length){k=R(W,b,j,a);}B();return k;};var M=function(){if(document.documentElement.contains&&!YAHOO.env.ua.webkit<422){return function(X,W){return W.contains(X);};}else{if(document.documentElement.compareDocumentPosition){return function(X,W){return !!(W.compareDocumentPosition(X)&16);};}else{return function(Y,X){var W=Y.parentNode;while(W){if(Y===W){return true;}W=W.parentNode;}return false;};}}}();var R=function(Z,b,c,Y){var X=[];for(var a=0,W=Z.length;a<W;++a){if(!V(Z[a],0,b)||(Y&&Z[a]._found)){continue;}if(c){return Z[a];}if(Y){Z[a]._found=true;N[N.length]=Z[a];}X[X.length]=Z[a];}return X;};var V=function(Y,b,a){a=a||C(b).pop()||{};if(!Y||Y._found||(a.tag!="*"&&Y.tagName.toLowerCase()!=a.tag)){return false;}var X=U.operators,W=U.pseudos,e=a.attributes,f=a.pseudos,Z=a.previous;if(e.length){for(var c=0,d=e.length;c<d;++c){if(X[e[c][1]]&&!X[e[c][1]](Y.getAttribute(e[c][0],2),e[c][2])){return false;}}}if(f.length){for(c=0,d=f.length;c<d;++c){if(W[f[c][0]]&&!W[f[c][0]](Y,f[c][1])){return false;}}}if(Z){if(Z.combinator!==","){return P[Z.combinator](Y,a);}}return true;};var N=[];var L=[];var T={};var J=function(){for(var X=0,W=N.length;X<W;++X){try{delete N[X]._found;}catch(Y){N[X].removeAttribute("_found");}}N=[];};var B=function(){if(!document.documentElement.children){return function(){for(var X=0,W=L.length;X<W;++X){delete L[X]._children;}L=[];};}else{return function(){};}}();var H=function(X,W){W=W||"";if(!T[X+W]){T[X+W]=new RegExp(X,W);}return T[X+W];};var P={" ":function(X,W){X=X.parentNode;while(X&&X.tagName){if(V(X,null,W.previous)){return true;}X=X.parentNode;}return false;},">":function(X,W){return V(X.parentNode,null,W.previous);},"+":function(Y,X){var W=Y.previousSibling;while(W&&W.nodeType!==1){W=W.previousSibling;}if(W&&V(W,null,X.previous)){return true;}return false;},"~":function(Y,X){var W=Y.previousSibling;while(W){if(W.nodeType===1&&V(W,null,X.previous)){return true;}W=W.previousSibling;}return false;}};var G=function(){if(document.documentElement.children){return function(X,W){return(W)?X.children.tags(W):X.children||[];};}else{return function(a,X){if(a._children){return a._children;}var Z=[],b=a.childNodes;for(var Y=0,W=b.length;Y<W;++Y){if(b[Y].tagName){if(!X||b[Y].tagName.toLowerCase()===X){Z[Z.length]=b[Y];}}}a._children=Z;L[L.length]=a;return Z;};}}();var S=function(X,h,l,c){if(l){l=l.toLowerCase();}var j=T[F.NTH_CHILD]=T[F.NTH_CHILD]||new RegExp(F.NTH_CHILD);j.test(h);var g=parseInt(RegExp.$1,10),W=RegExp.$2,d=RegExp.$3,e=parseInt(RegExp.$4,10)||0,k=[];var f=G(X.parentNode,l);if(d){g=2;op="+";W="n";e=(d==="odd")?1:0;}else{if(isNaN(g)){g=(W)?1:0;}}if(g===0){if(c){e=f.length-e+1;}if(f[e-1]===X){return true;}else{return false;}}else{if(g<0){c=!!c;g=Math.abs(g);}}if(!c){for(var Y=e-1,Z=f.length;Y<Z;Y+=g){if(Y>=0&&f[Y]===X){return true;}}}else{for(var Y=f.length-e,Z=f.length;Y>=0;Y-=g){if(Y<Z&&f[Y]===X){return true;}}}return false;};var Q=function(X){for(var Y=0,W=X.length;Y<W;++Y){if(X[Y][0]=="id"&&X[Y][1]==="="){return X[Y][2];}}};var O=function(Y){for(var X=0,W=Y.length;X<W;++X){if(Q(Y[X].attributes)){return X;}}return -1;};var D={tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*)['"]?\]*/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/};
+var C=function(W){var Y={},b=[],c,a=false,X;W=A(W);do{a=false;for(var Z in D){if(Z!="tag"&&Z!="combinator"){Y[Z]=Y[Z]||[];}if(X=D[Z].exec(W)){a=true;if(Z!="tag"&&Z!="combinator"){if(Z==="attributes"&&X[1]==="id"){Y.id=X[3];}Y[Z].push(X.slice(1));}else{Y[Z]=X[1];}W=W.replace(X[0],"");if(Z==="combinator"||!W.length){Y.attributes=K(Y.attributes);Y.pseudos=Y.pseudos||[];Y.tag=Y.tag||"*";b.push(Y);Y={previous:Y};}}}}while(a);return b;};var K=function(X){var Y=U.attrAliases;X=X||[];for(var Z=0,W=X.length;Z<W;++Z){if(Y[X[Z][0]]){X[Z][0]=Y[X[Z][0]];}if(!X[Z][1]){X[Z][1]="";}}return X;};var A=function(X){var Y=U.shorthand;var Z=X.match(D.attributes);if(Z){X=X.replace(D.attributes,"REPLACED_ATTRIBUTE");}for(var b in Y){X=X.replace(H(b,"gi"),Y[b]);}if(Z){for(var a=0,W=Z.length;a<W;++a){X=X.replace("REPLACED_ATTRIBUTE",Z[a]);}}return X;};if(YAHOO.env.ua.ie){U.prototype.attrAliases["class"]="className";}U=new U();U.TOKENS=F;U.patterns=D;E.Selector=U;})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/selector/selector-beta.js b/lib/yui/selector/selector-beta.js
new file mode 100644 (file)
index 0000000..82d0988
--- /dev/null
@@ -0,0 +1,660 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The selector module provides helper methods allowing CSS3 Selectors to be used with DOM elements.
+ * @module selector
+ * @title Selector Utility
+ * @namespace YAHOO.util
+ * @requires yahoo, dom
+ */
+
+(function() {
+/**
+ * Provides helper methods for collecting and filtering DOM elements.
+ * @namespace YAHOO.util
+ * @class Selector
+ * @static
+ */
+var Selector = function() {};
+
+var Y = YAHOO.util;
+
+var X = {
+    BEGIN: '^',
+    END: '$',
+    OR: '|',
+    SP: '\\s+'
+};
+
+X.BEGIN_SPACE = '(?:' + X.BEGIN + X.OR + X.SP +')';
+X.END_SPACE = '(?:' + X.SP + X.OR + X.END + ')';
+X.NTH_CHILD = '^(?:([-]?\\d*)(n){1}|(odd|even)$)*([-+]?\\d*)$';
+
+Selector.prototype = {
+    /**
+     * Default document for use queries 
+     * @property document
+     * @type object
+     * @default window.document
+     */
+    document: window.document,
+    /**
+     * Mapping of attributes to aliases, normally to work around HTMLAttributes
+     * that conflict with JS reserved words.
+     * @property attrAliases
+     * @type object
+     */
+    attrAliases: {
+        'for': 'htmlFor'
+    },
+
+    /**
+     * Mapping of shorthand tokens to corresponding attribute selector 
+     * @property shorthand
+     * @type object
+     */
+    shorthand: {
+        //'(?:(?:[^\\)\\]\\s*>+~,]+)(?:-?[_a-z]+[-\\w]))+#(-?[_a-z]+[-\\w]*)': '[id=$1]',
+        '\\#(-?[_a-z]+[-\\w]*)': '[id=$1]',
+        '\\.(-?[_a-z]+[-\\w]*)': '[class~=$1]'
+    },
+
+    /**
+     * List of operators and corresponding boolean functions. 
+     * These functions are passed the attribute and the current node's value of the attribute.
+     * @property operators
+     * @type object
+     */
+    operators: {
+        '=': function(attr, val) { return attr === val; }, // Equality
+        '!=': function(attr, val) { return attr !== val; }, // Inequality
+        '~=': function(attr, val) { // Match one of space seperated words 
+            var s = ' ';
+            return (s + attr + s).indexOf((s + val + s)) > -1;
+        },
+        '|=': function(attr, val) { return getRegExp(X.BEGIN + val + '[-]?').test(attr); }, // Match start with value followed by optional hyphen
+        '^=': function(attr, val) { return attr.indexOf(val) === 0; }, // Match starts with value
+        '$=': function(attr, val) { return attr.lastIndexOf(val) === attr.length - val.length; }, // Match ends with value
+        '*=': function(attr, val) { return attr.indexOf(val) > -1; }, // Match contains value as substring 
+        '': function(attr, val) { return attr; } // Just test for existence of attribute
+    },
+
+    /**
+     * List of pseudo-classes and corresponding boolean functions. 
+     * These functions are called with the current node, and any value that was parsed with the pseudo regex.
+     * @property pseudos
+     * @type object
+     */
+    pseudos: {
+        'root': function(node) {
+            return node === node.ownerDocument.documentElement;
+        },
+
+        'nth-child': function(node, val) {
+            return getNth(node, val);
+        },
+
+        'nth-last-child': function(node, val) {
+            return getNth(node, val, null, true);
+        },
+
+        'nth-of-type': function(node, val) {
+            return getNth(node, val, node.tagName);
+        },
+         
+        'nth-last-of-type': function(node, val) {
+            return getNth(node, val, node.tagName, true);
+        },
+         
+        'first-child': function(node) {
+            return getChildren(node.parentNode)[0] === node;
+        },
+
+        'last-child': function(node) {
+            var children = getChildren(node.parentNode);
+            return children[children.length - 1] === node;
+        },
+
+        'first-of-type': function(node, val) {
+            return getChildren(node.parentNode, node.tagName.toLowerCase())[0];
+        },
+         
+        'last-of-type': function(node, val) {
+            var children = getChildren(node.parentNode, node.tagName.toLowerCase());
+            return children[children.length - 1];
+        },
+         
+        'only-child': function(node) {
+            var children = getChildren(node.parentNode);
+            return children.length === 1 && children[0] === node;
+        },
+
+        'only-of-type': function(node) {
+            return getChildren(node.parentNode, node.tagName.toLowerCase()).length === 1;
+        },
+
+        'empty': function(node) {
+            return node.childNodes.length === 0;
+        },
+
+        'not': function(node, simple) {
+            return !Selector.test(node, simple);
+        },
+
+        'contains': function(node, str) {
+            var text = node.innerText || node.textContent || '';
+            return text.indexOf(str) > -1;
+        },
+        'checked': function(node) {
+            return node.checked === true;
+        }
+    },
+
+    /**
+     * Test if the supplied node matches the supplied selector.
+     * @method test
+     *
+     * @param {HTMLElement | String} node An id or node reference to the HTMLElement being tested.
+     * @param {string} selector The CSS Selector to test the node against.
+     * @return{boolean} Whether or not the node matches the selector.
+     * @static
+    
+     */
+    test: function(node, selector) {
+        node = Selector.document.getElementById(node) || node;
+        var groups = selector ? selector.split(',') : [];
+        if (groups.length) {
+            for (var i = 0, len = groups.length; i < len; ++i) {
+                if ( rTestNode(node, groups[i]) ) { // passes if ANY group matches
+                    return true;
+                }
+            }
+            return false;
+        }
+        return rTestNode(node, selector);
+    },
+
+    /**
+     * Filters a set of nodes based on a given CSS selector. 
+     * @method filter
+     *
+     * @param {array}  A set of nodes/ids to filter. 
+     * @param {string} selector The selector used to test each node.
+     * @return{array} An array of nodes from the supplied array that match the given selector.
+     * @static
+     */
+    filter: function(arr, selector) {
+        if (!arr || !selector) {
+        }
+        var node,
+            nodes = arr,
+            result = [],
+            tokens = tokenize(selector);
+
+        if (!nodes.item) { // if not HTMLCollection, handle arrays of ids and/or nodes
+            for (var i = 0, len = arr.length; i < len; ++i) {
+                if (!arr[i].tagName) { // tagName limits to HTMLElements 
+                    node = Selector.document.getElementById(arr[i]);
+                    if (node) { // skip IDs that return null 
+                        nodes[nodes.length] = node;
+                    } else {
+                    }
+                }
+            }
+        }
+        result = rFilter(nodes, tokenize(selector)[0]);
+        clearParentCache();
+        return result;
+    },
+
+    /**
+     * Retrieves a set of nodes based on a given CSS selector. 
+     * @method query
+     *
+     * @param {string} selector The CSS Selector to test the node against.
+     * @param {HTMLElement | String} root optional An id or HTMLElement to start the query from. Defaults to Selector.document.
+     * @param {Boolean} firstOnly optional Whether or not to return only the first match.
+     * @return {Array} An array of nodes that match the given selector.
+     * @static
+     */
+    query: function(selector, root, firstOnly) {
+        var result = query(selector, root, firstOnly);
+        return result;
+    }
+};
+
+var query = function(selector, root, firstOnly, deDupe) {
+    if (!selector) {
+        return []; // no nodes for you
+    }
+    var result = [];
+    var groups = selector.split(',');
+
+    if (groups.length > 1) {
+        for (var i = 0, len = groups.length; i < len; ++i) {
+            result = result.concat( arguments.callee(groups[i], root, firstOnly, true) ); 
+        }
+        clearFoundCache();
+        return result;
+    }
+
+    if (root && !root.tagName) {
+        root = Selector.document.getElementById(root);
+        if (!root) {
+            return [];
+        }
+    }
+
+    root = root || Selector.document;
+    var tokens = tokenize(selector);
+    var idToken = tokens[getIdTokenIndex(tokens)],
+        nodes = [],
+        node,
+        id,
+        token = tokens.pop() || {};
+        
+    if (idToken) {
+        id = getId(idToken.attributes);
+    }
+
+    // if no root alternate root is specified use id shortcut
+    if (id) {
+        if (id === token.id) { // only one target
+            nodes = [Selector.document.getElementById(id)] || root;
+        } else { // reset root to id node if passes
+            node = Selector.document.getElementById(id);
+            if (root === Selector.document || contains(node, root)) {
+                if ( node && rTestNode(node, null, idToken) ) {
+                    root = node; // start from here
+                }
+            } else {
+                return [];
+            }
+        }
+    }
+
+    if (root && !nodes.length) {
+        nodes = root.getElementsByTagName(token.tag);
+    }
+
+    if (nodes.length) {
+        result = rFilter(nodes, token, firstOnly, deDupe); 
+    }
+    clearParentCache();
+    return result;
+};
+
+var contains = function() {
+    if (document.documentElement.contains && !YAHOO.env.ua.webkit < 422)  { // IE & Opera, Safari < 3 contains is broken
+        return function(needle, haystack) {
+            return haystack.contains(needle);
+        };
+    } else if ( document.documentElement.compareDocumentPosition ) { // gecko
+        return function(needle, haystack) {
+            return !!(haystack.compareDocumentPosition(needle) & 16);
+        };
+    } else  { // Safari < 3
+        return function(needle, haystack) {
+            var parent = needle.parentNode;
+            while (parent) {
+                if (needle === parent) {
+                    return true;
+                }
+                parent = parent.parentNode;
+            } 
+            return false;
+        }; 
+    }
+}();
+
+var rFilter = function(nodes, token, firstOnly, deDupe) {
+    var result = [];
+
+    for (var i = 0, len = nodes.length; i < len; ++i) {
+        if (!rTestNode(nodes[i], 0, token) || (deDupe && nodes[i]._found) ) {
+            continue;
+        }
+
+        if (firstOnly) {
+            return nodes[i];
+        }
+        if (deDupe) {
+            nodes[i]._found = true;
+            foundCache[foundCache.length] = nodes[i];
+        }
+
+        result[result.length] = nodes[i];
+    }
+
+    return result;
+};
+
+var rTestNode = function(node, selector, token) {
+    token = token || tokenize(selector).pop() || {};
+
+    if (!node || node._found || (token.tag != '*' && node.tagName.toLowerCase() != token.tag)) {
+        return false; // tag match failed
+    } 
+
+    var ops = Selector.operators,
+        ps = Selector.pseudos,
+        attr = token.attributes,
+        pseudos = token.pseudos,
+        prev = token.previous;
+
+    if (attr.length) {
+        for (var i = 0, len = attr.length; i < len; ++i) {
+            if (ops[attr[i][1]] &&
+                    !ops[attr[i][1]](node.getAttribute(attr[i][0], 2),
+                            attr[i][2])) {
+                return false;
+            }
+        }
+    }
+
+    if (pseudos.length) {
+        for (i = 0, len = pseudos.length; i < len; ++i) {
+            if (ps[pseudos[i][0]] &&
+                    !ps[pseudos[i][0]](node, pseudos[i][1])) {
+                return false;
+            }
+        }
+    }
+    if (prev) {
+        if (prev.combinator !== ',') {
+            return combinators[prev.combinator](node, token);
+        }
+    }
+    return true;
+
+};
+
+var foundCache = [];
+var parentCache = [];
+var regexCache = {};
+
+var clearFoundCache = function() {
+    for (var i = 0, len = foundCache.length; i < len; ++i) {
+        try { // IE no like delete
+            delete foundCache[i]._found;
+        } catch(e) {
+            foundCache[i].removeAttribute('_found');
+        }
+    }
+    foundCache = [];
+};
+
+var clearParentCache = function() {
+    if (!document.documentElement.children) { // caching children lookups for gecko
+        return function() {
+            for (var i = 0, len = parentCache.length; i < len; ++i) {
+                delete parentCache[i]._children;
+            }
+            parentCache = [];
+        };
+    } else return function() {}; // do nothing
+}();
+
+var getRegExp = function(str, flags) {
+    flags = flags || '';
+    if (!regexCache[str + flags]) {
+        regexCache[str + flags] = new RegExp(str, flags);
+    }
+    return regexCache[str + flags];
+};
+
+var combinators = {
+    ' ': function(node, token) {
+        node = node.parentNode;
+        while (node && node.tagName) {
+            if (rTestNode(node, null, token.previous)) {
+                return true;
+            }
+            node = node.parentNode;
+        }  
+        return false;
+    },
+
+    '>': function(node, token) {
+        return rTestNode(node.parentNode, null, token.previous);
+    },
+    '+': function(node, token) {
+        var sib = node.previousSibling;
+        while (sib && sib.nodeType !== 1) {
+            sib = sib.previousSibling;
+        }
+
+        if (sib && rTestNode(sib, null, token.previous)) {
+            return true; 
+        }
+        return false;
+    },
+
+    '~': function(node, token) {
+        var sib = node.previousSibling;
+        while (sib) {
+            if (sib.nodeType === 1 && rTestNode(sib, null, token.previous)) {
+                return true;
+            }
+            sib = sib.previousSibling;
+        }
+
+        return false;
+    }
+};
+
+var getChildren = function() {
+    if (document.documentElement.children) { // document for capability test
+        return function(node, tag) {
+            return (tag) ? node.children.tags(tag) : node.children || [];
+        };
+    } else {
+        return function(node, tag) {
+            if (node._children) {
+                return node._children;
+            }
+            var children = [],
+                childNodes = node.childNodes;
+
+            for (var i = 0, len = childNodes.length; i < len; ++i) {
+                if (childNodes[i].tagName) {
+                    if (!tag || childNodes[i].tagName.toLowerCase() === tag) {
+                        children[children.length] = childNodes[i];
+                    }
+                }
+            }
+            node._children = children;
+            parentCache[parentCache.length] = node;
+            return children;
+        };
+    }
+}();
+
+/*
+    an+b = get every _a_th node starting at the _b_th
+    0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element
+    1n+b =  get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n")
+    an+0 = get every _a_th element, "0" may be omitted 
+*/
+var getNth = function(node, expr, tag, reverse) {
+    if (tag) tag = tag.toLowerCase();
+    var re = regexCache[X.NTH_CHILD] = regexCache[X.NTH_CHILD] || new RegExp(X.NTH_CHILD);
+    re.test(expr);
+    var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_)
+        n = RegExp.$2, // "n"
+        oddeven = RegExp.$3, // "odd" or "even"
+        b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_
+        result = [];
+
+    var siblings = getChildren(node.parentNode, tag);
+
+    if (oddeven) {
+        a = 2; // always every other
+        op = '+';
+        n = 'n';
+        b = (oddeven === 'odd') ? 1 : 0;
+    } else if ( isNaN(a) ) {
+        a = (n) ? 1 : 0; // start from the first or no repeat
+    }
+
+    if (a === 0) { // just the first
+        if (reverse) {
+            b = siblings.length - b + 1; 
+        }
+
+        if (siblings[b - 1] === node) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (a < 0) {
+        reverse = !!reverse;
+        a = Math.abs(a);
+    }
+
+    if (!reverse) {
+        for (var i = b - 1, len = siblings.length; i < len; i += a) {
+            if ( i >= 0 && siblings[i] === node ) {
+                return true;
+            }
+        }
+    } else {
+        for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) {
+            if ( i < len && siblings[i] === node ) {
+                return true;
+            }
+        }
+    }
+    return false;
+};
+
+var getId = function(attr) {
+    for (var i = 0, len = attr.length; i < len; ++i) {
+        if (attr[i][0] == 'id' && attr[i][1] === '=') {
+            return attr[i][2];
+        }
+    }
+};
+
+var getIdTokenIndex = function(tokens) {
+    for (var i = 0, len = tokens.length; i < len; ++i) {
+        if (getId(tokens[i].attributes)) {
+            return i;
+        }
+    }
+    return -1;
+};
+
+var patterns = {
+    tag: /^((?:-?[_a-z]+[\w-]*)|\*)/i,
+    attributes: /^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*)['"]?\]*/i,
+    pseudos: /^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,
+    combinator: /^\s*([>+~]|\s)\s*/
+};
+
+/**
+    Break selector into token units per simple selector.
+    Combinator is attached to left-hand selector.
+ */
+var tokenize = function(selector) {
+    var token = {},     // one token per simple selector (left selector holds combinator)
+        tokens = [],    // array of tokens
+        id,             // unique id for the simple selector (if found)
+        found = false,  // whether or not any matches were found this pass
+        match;          // the regex match
+
+    selector = replaceShorthand(selector); // convert ID and CLASS shortcuts to attributes
+
+    /*
+        Search for selector patterns, store, and strip them from the selector string
+        until no patterns match (invalid selector) or we run out of chars.
+
+        Multiple attributes and pseudos are allowed, in any order.
+        for example:
+            'form:first-child[type=button]:not(button)[lang|=en]'
+    */
+    do {
+        found = false; // reset after full pass
+        for (var re in patterns) {
+                if (re != 'tag' && re != 'combinator') { // only one allowed
+                    token[re] = token[re] || [];
+                }
+            if (match = patterns[re].exec(selector)) { // note assignment
+                found = true;
+                if (re != 'tag' && re != 'combinator') { // only one allowed
+                    //token[re] = token[re] || [];
+
+                    // capture ID for fast path to element
+                    if (re === 'attributes' && match[1] === 'id') {
+                        token.id = match[3];
+                    }
+
+                    token[re].push(match.slice(1));
+                } else { // single selector (tag, combinator)
+                    token[re] = match[1];
+                }
+                selector = selector.replace(match[0], ''); // strip current match from selector
+                if (re === 'combinator' || !selector.length) { // next token or done
+                    token.attributes = fixAttributes(token.attributes);
+                    token.pseudos = token.pseudos || [];
+                    token.tag = token.tag || '*';
+                    tokens.push(token);
+
+                    token = { // prep next token
+                        previous: token
+                    };
+                }
+            }
+        }
+    } while (found);
+
+    return tokens;
+};
+
+var fixAttributes = function(attr) {
+    var aliases = Selector.attrAliases;
+    attr = attr || [];
+    for (var i = 0, len = attr.length; i < len; ++i) {
+        if (aliases[attr[i][0]]) { // convert reserved words, etc
+            attr[i][0] = aliases[attr[i][0]];
+        }
+        if (!attr[i][1]) { // use exists operator
+            attr[i][1] = '';
+        }
+    }
+    return attr;
+};
+
+var replaceShorthand = function(selector) {
+    var shorthand = Selector.shorthand;
+    var attrs = selector.match(patterns.attributes); // pull attributes to avoid false pos on "." and "#"
+    if (attrs) {
+        selector = selector.replace(patterns.attributes, 'REPLACED_ATTRIBUTE');
+    }
+    for (var re in shorthand) {
+        selector = selector.replace(getRegExp(re, 'gi'), shorthand[re]);
+    }
+
+    if (attrs) {
+        for (var i = 0, len = attrs.length; i < len; ++i) {
+            selector = selector.replace('REPLACED_ATTRIBUTE', attrs[i]);
+        }
+    }
+    return selector;
+};
+
+if (YAHOO.env.ua.ie) { // rewrite class for IE (others use getAttribute('class')
+    Selector.prototype.attrAliases['class'] = 'className';
+}
+
+Selector = new Selector();
+Selector.TOKENS = X;
+Selector.patterns = patterns;
+Y.Selector = Selector;
+})();
+YAHOO.register("selector", YAHOO.util.Selector, {version: "2.5.0", build: "895"});
index 7d9ce17befd90864d4c7b3ea0cea509b2a9c8b55..3fd03b11531b5d4b529dc62521336e382535ba92 100755 (executable)
@@ -1,5 +1,28 @@
 Slider - Release Notes
 
+2.5.0
+    * Slider onDrag now calls fireEvents, so bg mousedown, drag, mouseup fires change events
+    * Slider uses new dragOnly=true property added in dragdrop
+    * Introduced DualSlider
+
+2.4.0
+    * No change
+
+2.3.1
+
+   * getValue will return the last value or 0 rather than NaN if the control 
+     is display:none.
+
+   * The slider will not fire slideStart/change/slideEnd events during its
+     initial setup unless setValue was called prior to initialization.
+
+   * slideStart/slideEnd now fire consistently among the various methods of
+     changing the slider value (setValue, bg click, thumb drag).  A bg click
+     and drag continuation will result in two start/end events.
+
+   * Added a silent flag to setValue and setRegionValue to silence all of the
+     events during that operation.
+
 2.3.0
    * Added valueChangeSource, which specifies whether the last value change
      was the result of user interaction with the control, or a result of a
index 404be58a33261f319730333b1076383eeb08d5bd..622abbe3e49d1328ea799f1d78116fa0fad0e254 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The Slider component is a UI control that enables the user to adjust 
@@ -36,6 +36,10 @@ version: 2.3.0
  * @param {String}      sType  The type of slider (horiz, vert, region)
  */
 YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {
+
+    YAHOO.widget.Slider.ANIM_AVAIL = 
+        (!YAHOO.lang.isUndefined(YAHOO.util.Anim));
+
     if (sElementId) {
         this.init(sElementId, sGroup, true);
         this.initSlider(sType);
@@ -104,16 +108,23 @@ YAHOO.widget.Slider.getSliderRegion =
 };
 
 /**
- * By default, animation is available if the animation library is detected.
+ * By default, animation is available if the animation utility is detected.
  * @property YAHOO.widget.Slider.ANIM_AVAIL
  * @static
  * @type boolean
  */
-YAHOO.widget.Slider.ANIM_AVAIL = true;
-
+YAHOO.widget.Slider.ANIM_AVAIL = false;
 
 YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
+    /**
+     * Override the default setting of dragOnly to true.
+     * @property dragOnly
+     * @type boolean
+     * @default true
+     */
+    dragOnly : true,
+
     /**
      * Initializes the slider.  Executed in the constructor
      * @method initSlider
@@ -194,7 +205,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
         /**
          * Specifies the number of pixels the arrow keys will move the slider.
-         * Default is 25.
+         * Default is 20.
          * @property keyIncrement
          * @type int
          */
@@ -255,6 +266,23 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * @since 2.3.0
          */
         this.valueChangeSource = 0;
+
+        /**
+         * Indicates whether or not events will be supressed for the current
+         * slide operation
+         * @property _silent
+         * @type boolean
+         * @private
+         */
+        this._silent = false;
+
+        /**
+         * Saved offset used to protect against NaN problems when slider is
+         * set to display:none
+         * @property lastOffset
+         * @type [int, int]
+         */
+        this.lastOffset = [0,0];
     },
 
     /**
@@ -276,9 +304,9 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         t.cacheBetweenDrags = true;
 
         // add handler for the handle onchange event
-        t.onChange = function() { 
-            self.handleThumbChange(); 
-        };
+        //t.onChange = function() { 
+            //self.handleThumbChange(); 
+        //};
 
         if (t._isHoriz && t.xTicks && t.xTicks.length) {
             this.tickPause = Math.round(360 / t.xTicks.length);
@@ -289,10 +317,21 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         this.logger.log("tickPause: " + this.tickPause);
 
         // delegate thumb methods
-        t.onMouseDown = function () { return self.focus(); };
-        t.onMouseUp = function() { self.thumbMouseUp(); };
-        t.onDrag = function() { self.fireEvents(true); };
-        t.onAvailable = function() { return self.setStartSliderState(); };
+        t.onAvailable = function() { 
+                return self.setStartSliderState(); 
+            };
+        t.onMouseDown = function () { 
+                return self.focus(); 
+            };
+        t.startDrag = function() { 
+                self._slideStart(); 
+            };
+        t.onDrag = function() { 
+                self.fireEvents(true); 
+            };
+        t.onMouseUp = function() { 
+                self.thumbMouseUp(); 
+            };
 
     },
 
@@ -412,14 +451,14 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                 this.setRegionValue.apply(this, this.deferredSetRegionValue, true);
                 this.deferredSetRegionValue = null;
             } else {
-                this.setRegionValue(0, 0, true, true);
+                this.setRegionValue(0, 0, true, true, true);
             }
         } else {
             if (this.deferredSetValue) {
                 this.setValue.apply(this, this.deferredSetValue, true);
                 this.deferredSetValue = null;
             } else {
-                this.setValue(0, true, true);
+                this.setValue(0, true, true, true);
             }
         }
     },
@@ -469,18 +508,25 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
     },
 
     /**
-     * Handles mouseup event on the slider background
+     * Handles mouseup event on the thumb
      * @method thumbMouseUp
      * @private
      */
     thumbMouseUp: function() {
-        this.logger.log("bg mouseup");
+        this.logger.log("thumb mouseup");
         if (!this.isLocked() && !this.moveComplete) {
             this.endMove();
         }
 
     },
 
+    onMouseUp: function() {
+        this.logger.log("bg mouseup");
+        if (!this.isLocked() && !this.moveComplete) {
+            this.endMove();
+        }
+    },
+
     /**
      * Returns a reference to this slider's thumb
      * @method getThumb
@@ -519,7 +565,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         if (this.isLocked()) {
             return false;
         } else {
-            this.onSlideStart();
+            this._slideStart();
             return true;
         }
     },
@@ -592,14 +638,21 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @private
      */
     handleThumbChange: function () { 
+        /*
         var t = this.thumb;
         if (t._isRegion) {
-            t.onChange(t.getXValue(), t.getYValue());
-            this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );
+
+            if (!this._silent) {
+                t.onChange(t.getXValue(), t.getYValue());
+                this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );
+            }
         } else {
-            t.onChange(t.getValue());
-            this.fireEvent("change", t.getValue());
+            if (!this._silent) {
+                t.onChange(t.getValue());
+                this.fireEvent("change", t.getValue());
+            }
         }
+        */
 
     },
 
@@ -611,11 +664,13 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {boolean} skipAnim set to true to disable the animation
      * for this move action (but not others).
      * @param {boolean} force ignore the locked setting and set value anyway
+     * @param {boolean} silent when true, do not fire events
      * @return {boolean} true if the move was performed, false if it failed
      */
-    setValue: function(newOffset, skipAnim, force) {
+    setValue: function(newOffset, skipAnim, force, silent) {
         this.logger.log("setValue " + newOffset);
 
+        this._silent = silent;
         this.valueChangeSource = this.SOURCE_SET_VALUE;
 
         if (!this.thumb.available) {
@@ -635,17 +690,18 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         }
 
         var t = this.thumb;
+        t.lastOffset = [newOffset, newOffset];
         var newX, newY;
         this.verifyOffset(true);
         if (t._isRegion) {
             return false;
         } else if (t._isHoriz) {
-            this.onSlideStart();
+            this._slideStart();
             // this.fireEvent("slideStart");
             newX = t.initPageX + newOffset + this.thumbCenterPoint.x;
             this.moveThumb(newX, t.initPageY, skipAnim);
         } else {
-            this.onSlideStart();
+            this._slideStart();
             // this.fireEvent("slideStart");
             newY = t.initPageY + newOffset + this.thumbCenterPoint.y;
             this.moveThumb(t.initPageX, newY, skipAnim);
@@ -664,9 +720,12 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {boolean} skipAnim set to true to disable the animation
      * for this move action (but not others).
      * @param {boolean} force ignore the locked setting and set value anyway
+     * @param {boolean} silent when true, do not fire events
      * @return {boolean} true if the move was performed, false if it failed
      */
-    setRegionValue: function(newOffset, newOffset2, skipAnim, force) {
+    setRegionValue: function(newOffset, newOffset2, skipAnim, force, silent) {
+
+        this._silent = silent;
 
         this.valueChangeSource = this.SOURCE_SET_VALUE;
 
@@ -687,8 +746,10 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         }
 
         var t = this.thumb;
+        t.lastOffset = [newOffset, newOffset2];
+        this.verifyOffset(true);
         if (t._isRegion) {
-            this.onSlideStart();
+            this._slideStart();
             var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;
             var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;
             this.moveThumb(newX, newY, skipAnim);
@@ -711,13 +772,16 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         var newPos = YAHOO.util.Dom.getXY(this.getEl());
         //var newPos = [this.initPageX, this.initPageY];
 
-        this.logger.log("newPos: " + newPos, "warn");
+        if (newPos) {
 
-        if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {
-            this.logger.log("background moved, resetting constraints");
-            this.thumb.resetConstraints();
-            this.baselinePos = newPos;
-            return false;
+            this.logger.log("newPos: " + newPos);
+
+            if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {
+                this.logger.log("background moved, resetting constraints");
+                this.thumb.resetConstraints();
+                this.baselinePos = newPos;
+                return false;
+            }
         }
 
         return true;
@@ -731,9 +795,11 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {int} x the X coordinate of the click
      * @param {int} y the Y coordinate of the click
      * @param {boolean} skipAnim don't animate if the move happend onDrag
+     * @param {boolean} midMove set to true if this is not terminating
+     * the slider movement
      * @private
      */
-    moveThumb: function(x, y, skipAnim) {
+    moveThumb: function(x, y, skipAnim, midMove) {
 
         // this.logger.log("move thumb", "warn");
 
@@ -754,8 +820,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         var _p = t.getTargetCoord(x, y);
         var p = [_p.x, _p.y];
 
-
-        this.fireEvent("slideStart");
+        this._slideStart();
 
         if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {
             this.logger.log("graduated");
@@ -778,12 +843,40 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                     this.animationDuration, 
                     YAHOO.util.Easing.easeOut );
 
-            oAnim.onComplete.subscribe( function() { self.endMove(); } );
+            oAnim.onComplete.subscribe( function() { 
+                    
+                    self.endMove(); 
+                } );
             oAnim.animate();
         } else {
             t.setDragElPos(x, y);
             // this.fireEvents();
-            this.endMove();
+            if (!midMove) {
+                this.endMove();
+            }
+        }
+    },
+
+    _slideStart: function() {
+        if (!this._sliding) {
+            if (!this._silent) {
+                this.onSlideStart();
+                this.fireEvent("slideStart");
+            }
+            this._sliding = true;
+        }
+    },
+
+    _slideEnd: function() {
+
+        if (this._sliding && this.moveComplete) {
+            if (!this._silent) {
+                this.onSlideEnd();
+                this.fireEvent("slideEnd");
+            }
+            this._sliding = false;
+            this._silent = false;
+            this.moveComplete = false;
         }
     },
 
@@ -949,7 +1042,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         if (! this.isLocked()) {
             var x = YAHOO.util.Event.getPageX(e);
             var y = YAHOO.util.Event.getPageY(e);
-            this.moveThumb(x, y, true);
+            this.moveThumb(x, y, true, true);
+            this.fireEvents();
         }
     },
 
@@ -994,8 +1088,10 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
                 if (newX != this.previousX || newY != this.previousY) {
                     // this.logger.log("Firing onchange");
-                    this.onChange(newX, newY);
-                    this.fireEvent("change", { x: newX, y: newY });
+                    if (!this._silent) {
+                        this.onChange(newX, newY);
+                        this.fireEvent("change", { x: newX, y: newY });
+                    }
                 }
 
                 this.previousX = newX;
@@ -1005,17 +1101,15 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                 var newVal = t.getValue();
                 if (newVal != this.previousVal) {
                     this.logger.log("Firing onchange: " + newVal);
-                    this.onChange( newVal );
-                    this.fireEvent("change", newVal);
+                    if (!this._silent) {
+                        this.onChange( newVal );
+                        this.fireEvent("change", newVal);
+                    }
                 }
                 this.previousVal = newVal;
             }
 
-            if (this.moveComplete) {
-                this.onSlideEnd();
-                this.fireEvent("slideEnd");
-                this.moveComplete = false;
-            }
+            this._slideEnd();
 
         }
     },
@@ -1113,6 +1207,14 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      */
     startOffset: null,
 
+    /**
+     * Override the default setting of dragOnly to true.
+     * @property dragOnly
+     * @type boolean
+     * @default true
+     */
+    dragOnly : true,
+
     /**
      * Flag used to figure out if this is a horizontal or vertical slider
      * @property _isHoriz
@@ -1153,14 +1255,14 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
 
     getOffsetFromParent: function(parentPos) {
 
-        var el = this.getEl();
+        var el = this.getEl(), newOffset;
 
         if (!this.deltaOffset) {
 
             var myPos = YAHOO.util.Dom.getXY(el);
             var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);
 
-            var newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
+            newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
 
             var l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
             var t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
@@ -1236,10 +1338,8 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved from the start position.
      */
     getValue: function () {
-        if (!this.available) { return 0; }
-        var val = (this._isHoriz) ? this.getXValue() : this.getYValue();
+        return (this._isHoriz) ? this.getXValue() : this.getYValue();
         //this.logger.log("getVal: " + val);
-        return val;
     },
 
     /**
@@ -1250,9 +1350,18 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved horizontally from the start position.
      */
     getXValue: function () {
-        if (!this.available) { return 0; }
+        if (!this.available) { 
+            return 0; 
+        }
         var newOffset = this.getOffsetFromParent();
-        return (newOffset[0] - this.startOffset[0]);
+        if (YAHOO.lang.isNumber(newOffset[0])) {
+            this.lastOffset = newOffset;
+            return (newOffset[0] - this.startOffset[0]);
+        } else {
+            this.logger.log("can't get offset, using old value: " + 
+                this.lastOffset[0]);
+            return (this.lastOffset[0] - this.startOffset[0]);
+        }
     },
 
     /**
@@ -1263,9 +1372,18 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved vertically from the start position.
      */
     getYValue: function () {
-        if (!this.available) { return 0; }
+        if (!this.available) { 
+            return 0; 
+        }
         var newOffset = this.getOffsetFromParent();
-        return (newOffset[1] - this.startOffset[1]);
+        if (YAHOO.lang.isNumber(newOffset[1])) {
+            this.lastOffset = newOffset;
+            return (newOffset[1] - this.startOffset[1]);
+        } else {
+            this.logger.log("can't get offset, using old value: " + 
+                this.lastOffset[1]);
+            return (this.lastOffset[1] - this.startOffset[1]);
+        }
     },
 
     /**
@@ -1288,8 +1406,535 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
 
 });
 
-if ("undefined" == typeof YAHOO.util.Anim) {
-    YAHOO.widget.Slider.ANIM_AVAIL = false;
-}
+/**
+ * A slider with two thumbs, one that represents the min value and 
+ * the other the max.  Actually a composition of two sliders, both with
+ * the same background.  The constraints for each slider are adjusted
+ * dynamically so that the min value of the max slider is equal or greater
+ * to the current value of the min slider, and the max value of the min
+ * slider is the current value of the max slider.
+ * Constructor assumes both thumbs are positioned absolutely at the 0 mark on
+ * the background.
+ *
+ * @namespace YAHOO.widget
+ * @class DualSlider
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param {Slider} minSlider The Slider instance used for the min value thumb
+ * @param {Slider} maxSlider The Slider instance used for the max value thumb
+ * @param {int}    range The number of pixels the thumbs may move within
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ */
+YAHOO.widget.DualSlider = function(minSlider, maxSlider, range, initVals) {
+
+    var self = this,
+        lang = YAHOO.lang;
+
+    /**
+     * A slider instance that keeps track of the lower value of the range.
+     * <strong>read only</strong>
+     * @property minSlider
+     * @type Slider
+     */
+    this.minSlider = minSlider;
+
+    /**
+     * A slider instance that keeps track of the upper value of the range.
+     * <strong>read only</strong>
+     * @property maxSlider
+     * @type Slider
+     */
+    this.maxSlider = maxSlider;
+
+    /**
+     * The currently active slider (min or max). <strong>read only</strong>
+     * @property activeSlider
+     * @type Slider
+     */
+    this.activeSlider = minSlider;
+
+    /**
+     * Is the DualSlider oriented horizontally or vertically?
+     * <strong>read only</strong>
+     * @property isHoriz
+     * @type boolean
+     */
+    this.isHoriz = minSlider.thumb._isHoriz;
+
+    // Validate initial values
+    initVals = YAHOO.lang.isArray(initVals) ? initVals : [0,range];
+    initVals[0] = Math.min(Math.max(parseInt(initVals[0],10)|0,0),range);
+    initVals[1] = Math.max(Math.min(parseInt(initVals[1],10)|0,range),0);
+    // Swap initVals if min > max
+    if (initVals[0] > initVals[1]) {
+        initVals.splice(0,2,initVals[1],initVals[0]);
+    }
+
+    var ready = { min : false, max : false };
+
+    this.minSlider.thumb.onAvailable = function () {
+        minSlider.setStartSliderState();
+        ready.min = true;
+        if (ready.max) {
+            minSlider.setValue(initVals[0],true,true,true);
+            maxSlider.setValue(initVals[1],true,true,true);
+            self.updateValue(true);
+            self.fireEvent('ready',self);
+        }
+    };
+    this.maxSlider.thumb.onAvailable = function () {
+        maxSlider.setStartSliderState();
+        ready.max = true;
+        if (ready.min) {
+            minSlider.setValue(initVals[0],true,true,true);
+            maxSlider.setValue(initVals[1],true,true,true);
+            self.updateValue(true);
+            self.fireEvent('ready',self);
+        }
+    };
+
+    // dispatch mousedowns to the active slider
+    minSlider.onMouseDown = function(e) {
+        self._handleMouseDown(e);
+    };
+
+    // we can safely ignore a mousedown on one of the sliders since
+    // they share a background
+    maxSlider.onMouseDown = function(e) { 
+        YAHOO.util.Event.stopEvent(e); 
+    };
+
+    // Fix the drag behavior so that only the active slider
+    // follows the drag
+    minSlider.onDrag =
+    maxSlider.onDrag = function(e) {
+        self._handleDrag(e);
+    };
+
+    // The core events for each slider are handled so we can expose a single
+    // event for when the event happens on either slider
+    minSlider.subscribe("change", this._handleMinChange, minSlider, this);
+    minSlider.subscribe("slideStart", this._handleSlideStart, minSlider, this);
+    minSlider.subscribe("slideEnd", this._handleSlideEnd, minSlider, this);
+
+    maxSlider.subscribe("change", this._handleMaxChange, maxSlider, this);
+    maxSlider.subscribe("slideStart", this._handleSlideStart, maxSlider, this);
+    maxSlider.subscribe("slideEnd", this._handleSlideEnd, maxSlider, this);
+
+    /**
+     * Event that fires when the slider is finished setting up
+     * @event ready
+     * @param {DualSlider} dualslider the DualSlider instance
+     */
+    this.createEvent("ready", this);
+
+    /**
+     * Event that fires when either the min or max value changes
+     * @event change
+     * @param {DualSlider} dualslider the DualSlider instance
+     */
+    this.createEvent("change", this);
+
+    /**
+     * Event that fires when one of the thumbs begins to move
+     * @event slideStart
+     * @param {Slider} activeSlider the moving slider
+     */
+    this.createEvent("slideStart", this);
+
+    /**
+     * Event that fires when one of the thumbs finishes moving
+     * @event slideEnd
+     * @param {Slider} activeSlider the moving slider
+     */
+    this.createEvent("slideEnd", this);
+};
+
+YAHOO.widget.DualSlider.prototype = {
+
+    /**
+     * The current value of the min thumb. <strong>read only</strong>.
+     * @property minVal
+     * @type int
+     */
+    minVal : -1,
+
+    /**
+     * The current value of the max thumb. <strong>read only</strong>.
+     * @property maxVal
+     * @type int
+     */
+    maxVal : -1,
+
+    /**
+     * Pixel distance to maintain between thumbs.
+     * @property minRange
+     * @type int
+     * @default 0
+     */
+    minRange : 0,
 
-YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.3.0", build: "442"});
+    /**
+     * Executed when one of the sliders fires the slideStart event
+     * @method _handleSlideStart
+     * @private
+     */
+    _handleSlideStart: function(data, slider) {
+        this.fireEvent("slideStart", slider);
+    },
+
+    /**
+     * Executed when one of the sliders fires the slideEnd event
+     * @method _handleSlideEnd
+     * @private
+     */
+    _handleSlideEnd: function(data, slider) {
+        this.fireEvent("slideEnd", slider);
+    },
+
+    /**
+     * Overrides the onDrag method for both sliders
+     * @method _handleDrag
+     * @private
+     */
+    _handleDrag: function(e) {
+        YAHOO.widget.Slider.prototype.onDrag.call(this.activeSlider, e);
+    },
+
+    /**
+     * Executed when the min slider fires the change event
+     * @method _handleMinChange
+     * @private
+     */
+    _handleMinChange: function() {
+        this.activeSlider = this.minSlider;
+        this.updateValue();
+    },
+
+    /**
+     * Executed when the max slider fires the change event
+     * @method _handleMaxChange
+     * @private
+     */
+    _handleMaxChange: function() {
+        this.activeSlider = this.maxSlider;
+        this.updateValue();
+    },
+
+    /**
+     * Sets the min and max thumbs to new values.
+     * @method setValues
+     * @param min {int} Pixel offset to assign to the min thumb
+     * @param max {int} Pixel offset to assign to the max thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setValues : function (min, max, skipAnim, force, silent) {
+        var mins = this.minSlider,
+            maxs = this.maxSlider,
+            mint = mins.thumb,
+            maxt = maxs.thumb,
+            self = this,
+            done = { min : false, max : false };
+
+        // Clear constraints to prevent animated thumbs from prematurely
+        // stopping when hitting a constraint that's moving with the other
+        // thumb.
+        if (mint._isHoriz) {
+            mint.setXConstraint(mint.leftConstraint,maxt.rightConstraint,mint.tickSize);
+            maxt.setXConstraint(mint.leftConstraint,maxt.rightConstraint,maxt.tickSize);
+        } else {
+            mint.setYConstraint(mint.topConstraint,maxt.bottomConstraint,mint.tickSize);
+            maxt.setYConstraint(mint.topConstraint,maxt.bottomConstraint,maxt.tickSize);
+        }
+
+        // Set up one-time slideEnd callbacks to call updateValue when both
+        // thumbs have been set
+        this._oneTimeCallback(mins,'slideEnd',function () {
+            done.min = true;
+            if (done.max) {
+                self.updateValue(silent);
+                // Clean the slider's slideEnd events on a timeout since this
+                // will be executed from inside the event's fire
+                setTimeout(function () {
+                    self._cleanEvent(mins,'slideEnd');
+                    self._cleanEvent(maxs,'slideEnd');
+                },0);
+            }
+        });
+
+        this._oneTimeCallback(maxs,'slideEnd',function () {
+            done.max = true;
+            if (done.min) {
+                self.updateValue(silent);
+                // Clean both sliders' slideEnd events on a timeout since this
+                // will be executed from inside one of the event's fire
+                setTimeout(function () {
+                    self._cleanEvent(mins,'slideEnd');
+                    self._cleanEvent(maxs,'slideEnd');
+                },0);
+            }
+        });
+
+        mins.setValue(min,skipAnim,force,silent);
+        maxs.setValue(max,skipAnim,force,silent);
+    },
+
+    /**
+     * Set the min thumb position to a new value.
+     * @method setMinValue
+     * @param min {int} Pixel offset for min thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setMinValue : function (min, skipAnim, force, silent) {
+        var mins = this.minSlider;
+
+        this.activeSlider = mins;
+
+        // Use a one-time event callback to delay the updateValue call
+        // until after the slide operation is done
+        var self = this;
+        this._oneTimeCallback(mins,'slideEnd',function () {
+            self.updateValue(silent);
+            // Clean the slideEnd event on a timeout since this
+            // will be executed from inside the event's fire
+            setTimeout(function () { self._cleanEvent(mins,'slideEnd'); }, 0);
+        });
+
+        mins.setValue(min, skipAnim, force, silent);
+    },
+
+    /**
+     * Set the max thumb position to a new value.
+     * @method setMaxValue
+     * @param max {int} Pixel offset for max thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setMaxValue : function (max, skipAnim, force, silent) {
+        var maxs = this.maxSlider;
+
+        this.activeSlider = maxs;
+
+        // Use a one-time event callback to delay the updateValue call
+        // until after the slide operation is done
+        var self = this;
+        this._oneTimeCallback(maxs,'slideEnd',function () {
+            self.updateValue(silent);
+            // Clean the slideEnd event on a timeout since this
+            // will be executed from inside the event's fire
+            setTimeout(function () { self._cleanEvent(maxs,'slideEnd'); }, 0);
+        });
+
+        maxs.setValue(max, skipAnim, force, silent);
+    },
+
+    /**
+     * Executed when one of the sliders is moved
+     * @method updateValue
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     * @private
+     */
+    updateValue: function(silent) {
+        var min     = this.minSlider.getValue(),
+            max     = this.maxSlider.getValue(),
+            changed = false;
+
+        if (min != this.minVal || max != this.maxVal) {
+            changed = true;
+
+            var mint = this.minSlider.thumb;
+            var maxt = this.maxSlider.thumb;
+
+            var thumbInnerWidth = this.minSlider.thumbCenterPoint.x +
+                                  this.maxSlider.thumbCenterPoint.x;
+
+            // Establish barriers within the respective other thumb's edge, less
+            // the minRange.  Limit to the Slider's range in the case of
+            // negative minRanges.
+            var minConstraint = Math.max(max-thumbInnerWidth-this.minRange,0);
+            var maxConstraint = Math.min(-min-thumbInnerWidth-this.minRange,0);
+
+            if (this.isHoriz) {
+                minConstraint = Math.min(minConstraint,maxt.rightConstraint);
+
+                mint.setXConstraint(mint.leftConstraint,minConstraint, mint.tickSize);
+
+                maxt.setXConstraint(maxConstraint,maxt.rightConstraint, maxt.tickSize);
+            } else {
+                minConstraint = Math.min(minConstraint,maxt.bottomConstraint);
+                mint.setYConstraint(mint.leftConstraint,minConstraint, mint.tickSize);
+
+                maxt.setYConstraint(maxConstraint,maxt.bottomConstraint, maxt.tickSize);
+            }
+        }
+
+        this.minVal = min;
+        this.maxVal = max;
+
+        if (changed && !silent) {
+            this.fireEvent("change", this);
+        }
+    },
+
+    /**
+     * A background click will move the slider thumb nearest to the click.
+     * Override if you need different behavior.
+     * @method selectActiveSlider
+     * @param e {Event} the mousedown event
+     * @private
+     */
+    selectActiveSlider: function(e) {
+        var min = this.minSlider.getValue(),
+            max = this.maxSlider.getValue(),
+            d;
+
+        if (this.isHoriz) {
+            d = YAHOO.util.Event.getPageX(e) - this.minSlider.initPageX -
+                this.minSlider.thumbCenterPoint.x;
+        } else {
+            d = YAHOO.util.Event.getPageY(e) - this.minSlider.initPageY -
+                this.minSlider.thumbCenterPoint.y;
+        }
+                
+        // Below the minSlider thumb.  Move the minSlider thumb
+        if (d < min) {
+            this.activeSlider = this.minSlider;
+        // Above the maxSlider thumb.  Move the maxSlider thumb
+        } else if (d > max) {
+            this.activeSlider = this.maxSlider;
+        // Split the difference between thumbs
+        } else {
+            this.activeSlider = d*2 > max+min ? this.maxSlider : this.minSlider;
+        }
+    },
+
+    /**
+     * Overrides the onMouseDown for both slider, only moving the active slider
+     * @method handleMouseDown
+     * @private
+     */
+    _handleMouseDown: function(e) {
+        this.selectActiveSlider(e);
+        YAHOO.widget.Slider.prototype.onMouseDown.call(this.activeSlider, e);
+    },
+
+    /**
+     * Schedule an event callback that will execute once, then unsubscribe
+     * itself.
+     * @method _oneTimeCallback
+     * @param o {EventProvider} Object to attach the event to
+     * @param evt {string} Name of the event
+     * @param fn {Function} function to execute once
+     * @private
+     */
+    _oneTimeCallback : function (o,evt,fn) {
+        o.subscribe(evt,function () {
+            // Unsubscribe myself
+            o.unsubscribe(evt,arguments.callee);
+            // Pass the event handler arguments to the one time callback
+            fn.apply({},[].slice.apply(arguments));
+        });
+    },
+
+    /**
+     * Clean up the slideEnd event subscribers array, since each one-time
+     * callback will be replaced in the event's subscribers property with
+     * null.  This will cause memory bloat and loss of performance.
+     * @method _cleanEvent
+     * @param o {EventProvider} object housing the CustomEvent
+     * @param evt {string} name of the CustomEvent
+     * @private
+     */
+    _cleanEvent : function (o,evt) {
+        if (o.__yui_events && o.events[evt]) {
+            var ce, i, len;
+            for (i = o.__yui_events.length; i >= 0; --i) {
+                if (o.__yui_events[i].type === evt) {
+                    ce = o.__yui_events[i];
+                    break;
+                }
+            }
+            if (ce) {
+                var subs    = ce.subscribers,
+                    newSubs = [],
+                    j = 0;
+                for (i = 0, len = subs.length; i < len; ++i) {
+                    if (subs[i]) {
+                        newSubs[j++] = subs[i];
+                    }
+                }
+                ce.subscribers = newSubs;
+            }
+        }
+    }
+
+};
+
+YAHOO.augment(YAHOO.widget.DualSlider, YAHOO.util.EventProvider);
+
+
+/**
+ * Factory method for creating a horizontal dual-thumb slider
+ * @for YAHOO.widget.Slider
+ * @method YAHOO.widget.Slider.getHorizDualSlider
+ * @static
+ * @param {String} bg the id of the slider's background element
+ * @param {String} minthumb the id of the min thumb
+ * @param {String} maxthumb the id of the thumb thumb
+ * @param {int} range the number of pixels the thumbs can move within
+ * @param {int} iTickSize (optional) the element should move this many pixels
+ * at a time
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ * @return {DualSlider} a horizontal dual-thumb slider control
+ */
+YAHOO.widget.Slider.getHorizDualSlider = 
+    function (bg, minthumb, maxthumb, range, iTickSize, initVals) {
+        var mint, maxt;
+        var YW = YAHOO.widget, Slider = YW.Slider, Thumb = YW.SliderThumb;
+
+        mint = new Thumb(minthumb, bg, 0, range, 0, 0, iTickSize);
+        maxt = new Thumb(maxthumb, bg, 0, range, 0, 0, iTickSize);
+
+        return new YW.DualSlider(new Slider(bg, bg, mint, "horiz"), new Slider(bg, bg, maxt, "horiz"), range, initVals);
+};
+
+/**
+ * Factory method for creating a vertical dual-thumb slider.
+ * @for YAHOO.widget.Slider
+ * @method YAHOO.widget.Slider.getVertDualSlider
+ * @static
+ * @param {String} bg the id of the slider's background element
+ * @param {String} minthumb the id of the min thumb
+ * @param {String} maxthumb the id of the thumb thumb
+ * @param {int} range the number of pixels the thumbs can move within
+ * @param {int} iTickSize (optional) the element should move this many pixels
+ * at a time
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ * @return {DualSlider} a vertical dual-thumb slider control
+ */
+YAHOO.widget.Slider.getVertDualSlider = 
+    function (bg, minthumb, maxthumb, range, iTickSize, initVals) {
+        var mint, maxt;
+        var YW = YAHOO.widget, Slider = YW.Slider, Thumb = YW.SliderThumb;
+
+        mint = new Thumb(minthumb, bg, 0, 0, 0, range, iTickSize);
+        maxt = new Thumb(maxthumb, bg, 0, 0, 0, range, iTickSize);
+
+        return new YW.DualSlider(new Slider(bg, bg, mint, "vert"), new Slider(bg, bg, maxt, "vert"), range, initVals);
+};
+YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.5.0", build: "895"});
index 4028c9e89b9d15e96d3cc8953a4b1058b1cb6c57..5700a2fd887b848c0af07da6c15558cd2ea211ed 100755 (executable)
@@ -1,36 +1,9 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.widget.Slider=function(sElementId,sGroup,oThumb,sType){if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}};YAHOO.widget.Slider.getHorizSlider=function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");};YAHOO.widget.Slider.getVertSlider=function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");};YAHOO.widget.Slider.getSliderRegion=function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;t.onChange=function(){self.handleThumbChange();};if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}
-t.onMouseDown=function(){return self.focus();};t.onMouseUp=function(){self.thumbMouseUp();};t.onDrag=function(){self.fireEvents(true);};t.onAvailable=function(){return self.setStartSliderState();};},onAvailable:function(){var Event=YAHOO.util.Event;Event.on(this.id,"keydown",this.handleKeyDown,this,true);Event.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e);switch(kc){case 0x25:case 0x26:case 0x27:case 0x28:case 0x24:case 0x23:Event.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var horiz=false;var changeValue=true;switch(kc){case 0x25:h-=this.keyIncrement;break;case 0x26:v-=this.keyIncrement;break;case 0x27:h+=this.keyIncrement;break;case 0x28:v+=this.keyIncrement;break;case 0x24:h=t.leftConstraint;v=t.topConstraint;break;case 0x23:h=t.rightConstraint;v=t.bottomConstraint;break;default:changeValue=false;}
-if(changeValue){if(t._isRegion){this.setRegionValue(h,v,true);}else{var newVal=(t._isHoriz)?h:v;this.setValue(newVal,true);}
-Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=this.SOURCE_UI_EVENT;var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}
-this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(newOffset,skipAnim,force){this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetValue=arguments;return false;}
-if(this.isLocked()&&!force){return false;}
-if(isNaN(newOffset)){return false;}
-var t=this.thumb;var newX,newY;this.verifyOffset(true);if(t._isRegion){return false;}else if(t._isHoriz){this.onSlideStart();newX=t.initPageX+newOffset+this.thumbCenterPoint.x;this.moveThumb(newX,t.initPageY,skipAnim);}else{this.onSlideStart();newY=t.initPageY+newOffset+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,skipAnim);}
-return true;},setRegionValue:function(newOffset,newOffset2,skipAnim,force){this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}
-if(this.isLocked()&&!force){return false;}
-if(isNaN(newOffset)){return false;}
-var t=this.thumb;if(t._isRegion){this.onSlideStart();var newX=t.initPageX+newOffset+this.thumbCenterPoint.x;var newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;this.moveThumb(newX,newY,skipAnim);return true;}
-return false;},verifyOffset:function(checkPos){var newPos=YAHOO.util.Dom.getXY(this.getEl());if(newPos[0]!=this.baselinePos[0]||newPos[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=newPos;return false;}
-return true;},moveThumb:function(x,y,skipAnim){var t=this.thumb;var self=this;if(!t.available){return;}
-t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var _p=t.getTargetCoord(x,y);var p=[_p.x,_p.y];this.fireEvent("slideStart");if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!skipAnim){this.lock();this.curCoord=YAHOO.util.Dom.getXY(this.thumb.getEl());setTimeout(function(){self.moveOneTick(p);},this.tickPause);}else if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!skipAnim){this.lock();var oAnim=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);oAnim.onComplete.subscribe(function(){self.endMove();});oAnim.animate();}else{t.setDragElPos(x,y);this.endMove();}},moveOneTick:function(finalCoord){var t=this.thumb,tmp;var nextCoord=null;if(t._isRegion){nextCoord=this._getNextX(this.curCoord,finalCoord);var tmpX=(nextCoord)?nextCoord[0]:this.curCoord[0];nextCoord=this._getNextY([tmpX,this.curCoord[1]],finalCoord);}else if(t._isHoriz){nextCoord=this._getNextX(this.curCoord,finalCoord);}else{nextCoord=this._getNextY(this.curCoord,finalCoord);}
-if(nextCoord){this.curCoord=nextCoord;this.thumb.alignElWithMouse(t.getEl(),nextCoord[0],nextCoord[1]);if(!(nextCoord[0]==finalCoord[0]&&nextCoord[1]==finalCoord[1])){var self=this;setTimeout(function(){self.moveOneTick(finalCoord);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[0]>finalCoord[0]){thresh=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]-thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else if(curCoord[0]<finalCoord[0]){thresh=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]+thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else{}
-return nextCoord;},_getNextY:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[1]>finalCoord[1]){thresh=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]-thresh);nextCoord=[tmp.x,tmp.y];}else if(curCoord[1]<finalCoord[1]){thresh=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]+thresh);nextCoord=[tmp.x,tmp.y];}else{}
-return nextCoord;},b4MouseDown:function(e){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(e){if(!this.isLocked()&&this.backgroundEnabled){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.focus();this.moveThumb(x,y);}},onDrag:function(e){if(!this.isLocked()){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.moveThumb(x,y,true);}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(thumbEvent){var t=this.thumb;if(!thumbEvent){t.cachePosition();}
-if(!this.isLocked()){if(t._isRegion){var newX=t.getXValue();var newY=t.getYValue();if(newX!=this.previousX||newY!=this.previousY){this.onChange(newX,newY);this.fireEvent("change",{x:newX,y:newY});}
-this.previousX=newX;this.previousY=newY;}else{var newVal=t.getValue();if(newVal!=this.previousVal){this.onChange(newVal);this.fireEvent("change",newVal);}
-this.previousVal=newVal;}
-if(this.moveComplete){this.onSlideEnd();this.fireEvent("slideEnd");this.moveComplete=false;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(id,sGroup,iLeft,iRight,iUp,iDown,iTickSize){if(id){YAHOO.widget.SliderThumb.superclass.constructor.call(this,id,sGroup);this.parentElId=sGroup;}
-this.isTarget=false;this.tickSize=iTickSize;this.maintainOffset=true;this.initSlider(iLeft,iRight,iUp,iDown,iTickSize);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(parentPos){var myPos=YAHOO.util.Dom.getXY(this.getEl());var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);return[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];},getOffsetFromParent:function(parentPos){var el=this.getEl();if(!this.deltaOffset){var myPos=YAHOO.util.Dom.getXY(el);var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);var newOffset=[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];var l=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var t=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);var deltaX=l-newOffset[0];var deltaY=t-newOffset[1];if(isNaN(deltaX)||isNaN(deltaY)){}else{this.deltaOffset=[deltaX,deltaY];}}else{var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);newOffset=[newLeft+this.deltaOffset[0],newTop+this.deltaOffset[1]];}
-return newOffset;},initSlider:function(iLeft,iRight,iUp,iDown,iTickSize){this.initLeft=iLeft;this.initRight=iRight;this.initUp=iUp;this.initDown=iDown;this.setXConstraint(iLeft,iRight,iTickSize);this.setYConstraint(iUp,iDown,iTickSize);if(iTickSize&&iTickSize>1){this._graduated=true;}
-this._isHoriz=(iLeft||iRight);this._isVert=(iUp||iDown);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){if(!this.available){return 0;}
-var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;},getXValue:function(){if(!this.available){return 0;}
-var newOffset=this.getOffsetFromParent();return(newOffset[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}
-var newOffset=this.getOffsetFromParent();return(newOffset[1]-this.startOffset[1]);},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
-YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.widget.Slider=function(C,A,B,D){YAHOO.widget.Slider.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(C){this.init(C,A,true);this.initSlider(D);this.initThumb(B);}};YAHOO.widget.Slider.getHorizSlider=function(B,C,E,D,A){return new YAHOO.widget.Slider(B,B,new YAHOO.widget.SliderThumb(C,B,E,D,0,0,A),"horiz");};YAHOO.widget.Slider.getVertSlider=function(C,D,A,E,B){return new YAHOO.widget.Slider(C,C,new YAHOO.widget.SliderThumb(D,C,0,0,A,E,B),"vert");};YAHOO.widget.Slider.getSliderRegion=function(C,D,F,E,A,G,B){return new YAHOO.widget.Slider(C,C,new YAHOO.widget.SliderThumb(D,C,F,E,A,G,B),"region");};YAHOO.widget.Slider.ANIM_AVAIL=false;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{dragOnly:true,initSlider:function(A){this.type=A;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(B){var A=this;this.thumb=B;B.cacheBetweenDrags=true;if(B._isHoriz&&B.xTicks&&B.xTicks.length){this.tickPause=Math.round(360/B.xTicks.length);}else{if(B.yTicks&&B.yTicks.length){this.tickPause=Math.round(360/B.yTicks.length);}}B.onAvailable=function(){return A.setStartSliderState();};B.onMouseDown=function(){return A.focus();};B.startDrag=function(){A._slideStart();};B.onDrag=function(){A.fireEvents(true);};B.onMouseUp=function(){A.thumbMouseUp();};},onAvailable:function(){var A=YAHOO.util.Event;A.on(this.id,"keydown",this.handleKeyDown,this,true);A.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(C){if(this.enableKeys){var A=YAHOO.util.Event;var B=A.getCharCode(C);switch(B){case 37:case 38:case 39:case 40:case 36:case 35:A.preventDefault(C);break;default:}}},handleKeyDown:function(E){if(this.enableKeys){var G=YAHOO.util.Event;var C=G.getCharCode(E),I=this.thumb;var B=this.getXValue(),F=this.getYValue();var H=false;var D=true;switch(C){case 37:B-=this.keyIncrement;break;case 38:F-=this.keyIncrement;break;case 39:B+=this.keyIncrement;break;case 40:F+=this.keyIncrement;break;case 36:B=I.leftConstraint;F=I.topConstraint;break;case 35:B=I.rightConstraint;F=I.bottomConstraint;break;default:D=false;}if(D){if(I._isRegion){this.setRegionValue(B,F,true);}else{var A=(I._isHoriz)?B:F;this.setValue(A,true);}G.stopEvent(E);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var A=this.thumb.getEl();if(A){this.thumbCenterPoint={x:parseInt(A.offsetWidth/2,10),y:parseInt(A.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},onMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=this.SOURCE_UI_EVENT;var A=this.getEl();if(A.focus){try{A.focus();}catch(B){}}this.verifyOffset();if(this.isLocked()){return false;}else{this._slideStart();return true;}},onChange:function(A,B){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){},setValue:function(G,C,D,A){this._silent=A;this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!D){return false;}if(isNaN(G)){return false;}var B=this.thumb;B.lastOffset=[G,G];var F,E;this.verifyOffset(true);if(B._isRegion){return false;}else{if(B._isHoriz){this._slideStart();F=B.initPageX+G+this.thumbCenterPoint.x;this.moveThumb(F,B.initPageY,C);}else{this._slideStart();E=B.initPageY+G+this.thumbCenterPoint.y;this.moveThumb(B.initPageX,E,C);}}return true;},setRegionValue:function(H,A,D,E,B){this._silent=B;this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!E){return false;}if(isNaN(H)){return false;}var C=this.thumb;C.lastOffset=[H,A];this.verifyOffset(true);if(C._isRegion){this._slideStart();var G=C.initPageX+H+this.thumbCenterPoint.x;var F=C.initPageY+A+this.thumbCenterPoint.y;this.moveThumb(G,F,D);return true;}return false;},verifyOffset:function(B){var A=YAHOO.util.Dom.getXY(this.getEl());if(A){if(A[0]!=this.baselinePos[0]||A[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=A;return false;}}return true;},moveThumb:function(G,F,E,D){var H=this.thumb;var I=this;if(!H.available){return ;}H.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var B=H.getTargetCoord(G,F);var C=[B.x,B.y];this._slideStart();if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&H._graduated&&!E){this.lock();this.curCoord=YAHOO.util.Dom.getXY(this.thumb.getEl());setTimeout(function(){I.moveOneTick(C);},this.tickPause);}else{if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!E){this.lock();var A=new YAHOO.util.Motion(H.id,{points:{to:C}},this.animationDuration,YAHOO.util.Easing.easeOut);A.onComplete.subscribe(function(){I.endMove();});A.animate();}else{H.setDragElPos(G,F);if(!D){this.endMove();}}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();
+this.fireEvent("slideStart");}this._sliding=true;}},_slideEnd:function(){if(this._sliding&&this.moveComplete){if(!this._silent){this.onSlideEnd();this.fireEvent("slideEnd");}this._sliding=false;this._silent=false;this.moveComplete=false;}},moveOneTick:function(B){var E=this.thumb,D;var F=null;if(E._isRegion){F=this._getNextX(this.curCoord,B);var A=(F)?F[0]:this.curCoord[0];F=this._getNextY([A,this.curCoord[1]],B);}else{if(E._isHoriz){F=this._getNextX(this.curCoord,B);}else{F=this._getNextY(this.curCoord,B);}}if(F){this.curCoord=F;this.thumb.alignElWithMouse(E.getEl(),F[0],F[1]);if(!(F[0]==B[0]&&F[1]==B[1])){var C=this;setTimeout(function(){C.moveOneTick(B);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(A,B){var D=this.thumb;var F;var C=[];var E=null;if(A[0]>B[0]){F=D.tickSize-this.thumbCenterPoint.x;C=D.getTargetCoord(A[0]-F,A[1]);E=[C.x,C.y];}else{if(A[0]<B[0]){F=D.tickSize+this.thumbCenterPoint.x;C=D.getTargetCoord(A[0]+F,A[1]);E=[C.x,C.y];}else{}}return E;},_getNextY:function(A,B){var D=this.thumb;var F;var C=[];var E=null;if(A[1]>B[1]){F=D.tickSize-this.thumbCenterPoint.y;C=D.getTargetCoord(A[0],A[1]-F);E=[C.x,C.y];}else{if(A[1]<B[1]){F=D.tickSize+this.thumbCenterPoint.y;C=D.getTargetCoord(A[0],A[1]+F);E=[C.x,C.y];}else{}}return E;},b4MouseDown:function(A){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(B){if(!this.isLocked()&&this.backgroundEnabled){var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.focus();this.moveThumb(A,C);}},onDrag:function(B){if(!this.isLocked()){var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.moveThumb(A,C,true,true);this.fireEvents();}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(C){var B=this.thumb;if(!C){B.cachePosition();}if(!this.isLocked()){if(B._isRegion){var E=B.getXValue();var D=B.getYValue();if(E!=this.previousX||D!=this.previousY){if(!this._silent){this.onChange(E,D);this.fireEvent("change",{x:E,y:D});}}this.previousX=E;this.previousY=D;}else{var A=B.getValue();if(A!=this.previousVal){if(!this._silent){this.onChange(A);this.fireEvent("change",A);}}this.previousVal=A;}this._slideEnd();}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(G,B,E,D,A,F,C){if(G){YAHOO.widget.SliderThumb.superclass.constructor.call(this,G,B);this.parentElId=B;}this.isTarget=false;this.tickSize=C;this.maintainOffset=true;this.initSlider(E,D,A,F,C);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,dragOnly:true,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(C){var A=YAHOO.util.Dom.getXY(this.getEl());var B=C||YAHOO.util.Dom.getXY(this.parentElId);return[(A[0]-B[0]),(A[1]-B[1])];},getOffsetFromParent:function(H){var A=this.getEl(),E;if(!this.deltaOffset){var I=YAHOO.util.Dom.getXY(A);var F=H||YAHOO.util.Dom.getXY(this.parentElId);E=[(I[0]-F[0]),(I[1]-F[1])];var B=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);var K=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);var D=B-E[0];var C=K-E[1];if(isNaN(D)||isNaN(C)){}else{this.deltaOffset=[D,C];}}else{var J=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);var G=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);E=[J+this.deltaOffset[0],G+this.deltaOffset[1]];}return E;},initSlider:function(D,C,A,E,B){this.initLeft=D;this.initRight=C;this.initUp=A;this.initDown=E;this.setXConstraint(D,C,B);this.setYConstraint(A,E,B);if(B&&B>1){this._graduated=true;}this._isHoriz=(D||C);this._isVert=(A||E);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[0])){this.lastOffset=A;return(A[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[1])){this.lastOffset=A;return(A[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(A,B){}});YAHOO.widget.DualSlider=function(E,B,D,A){var C=this,G=YAHOO.lang;this.minSlider=E;this.maxSlider=B;this.activeSlider=E;this.isHoriz=E.thumb._isHoriz;A=YAHOO.lang.isArray(A)?A:[0,D];A[0]=Math.min(Math.max(parseInt(A[0],10)|0,0),D);A[1]=Math.max(Math.min(parseInt(A[1],10)|0,D),0);if(A[0]>A[1]){A.splice(0,2,A[1],A[0]);}var F={min:false,max:false};this.minSlider.thumb.onAvailable=function(){E.setStartSliderState();F.min=true;if(F.max){E.setValue(A[0],true,true,true);B.setValue(A[1],true,true,true);C.updateValue(true);C.fireEvent("ready",C);}};this.maxSlider.thumb.onAvailable=function(){B.setStartSliderState();F.max=true;if(F.min){E.setValue(A[0],true,true,true);B.setValue(A[1],true,true,true);C.updateValue(true);C.fireEvent("ready",C);}};E.onMouseDown=function(H){C._handleMouseDown(H);};B.onMouseDown=function(H){YAHOO.util.Event.stopEvent(H);};E.onDrag=B.onDrag=function(H){C._handleDrag(H);};E.subscribe("change",this._handleMinChange,E,this);E.subscribe("slideStart",this._handleSlideStart,E,this);E.subscribe("slideEnd",this._handleSlideEnd,E,this);B.subscribe("change",this._handleMaxChange,B,this);B.subscribe("slideStart",this._handleSlideStart,B,this);B.subscribe("slideEnd",this._handleSlideEnd,B,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);};YAHOO.widget.DualSlider.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(B,A){this.fireEvent("slideStart",A);},_handleSlideEnd:function(B,A){this.fireEvent("slideEnd",A);},_handleDrag:function(A){YAHOO.widget.Slider.prototype.onDrag.call(this.activeSlider,A);
+},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},setValues:function(E,H,F,B,G){var C=this.minSlider,J=this.maxSlider,A=C.thumb,I=J.thumb,K=this,D={min:false,max:false};if(A._isHoriz){A.setXConstraint(A.leftConstraint,I.rightConstraint,A.tickSize);I.setXConstraint(A.leftConstraint,I.rightConstraint,I.tickSize);}else{A.setYConstraint(A.topConstraint,I.bottomConstraint,A.tickSize);I.setYConstraint(A.topConstraint,I.bottomConstraint,I.tickSize);}this._oneTimeCallback(C,"slideEnd",function(){D.min=true;if(D.max){K.updateValue(G);setTimeout(function(){K._cleanEvent(C,"slideEnd");K._cleanEvent(J,"slideEnd");},0);}});this._oneTimeCallback(J,"slideEnd",function(){D.max=true;if(D.min){K.updateValue(G);setTimeout(function(){K._cleanEvent(C,"slideEnd");K._cleanEvent(J,"slideEnd");},0);}});C.setValue(E,F,B,G);J.setValue(H,F,B,G);},setMinValue:function(C,E,F,B){var D=this.minSlider;this.activeSlider=D;var A=this;this._oneTimeCallback(D,"slideEnd",function(){A.updateValue(B);setTimeout(function(){A._cleanEvent(D,"slideEnd");},0);});D.setValue(C,E,F,B);},setMaxValue:function(A,E,F,C){var D=this.maxSlider;this.activeSlider=D;var B=this;this._oneTimeCallback(D,"slideEnd",function(){B.updateValue(C);setTimeout(function(){B._cleanEvent(D,"slideEnd");},0);});D.setValue(A,E,F,C);},updateValue:function(F){var B=this.minSlider.getValue(),G=this.maxSlider.getValue(),C=false;if(B!=this.minVal||G!=this.maxVal){C=true;var A=this.minSlider.thumb;var I=this.maxSlider.thumb;var D=this.minSlider.thumbCenterPoint.x+this.maxSlider.thumbCenterPoint.x;var E=Math.max(G-D-this.minRange,0);var H=Math.min(-B-D-this.minRange,0);if(this.isHoriz){E=Math.min(E,I.rightConstraint);A.setXConstraint(A.leftConstraint,E,A.tickSize);I.setXConstraint(H,I.rightConstraint,I.tickSize);}else{E=Math.min(E,I.bottomConstraint);A.setYConstraint(A.leftConstraint,E,A.tickSize);I.setYConstraint(H,I.bottomConstraint,I.tickSize);}}this.minVal=B;this.maxVal=G;if(C&&!F){this.fireEvent("change",this);}},selectActiveSlider:function(C){var B=this.minSlider.getValue(),A=this.maxSlider.getValue(),D;if(this.isHoriz){D=YAHOO.util.Event.getPageX(C)-this.minSlider.initPageX-this.minSlider.thumbCenterPoint.x;}else{D=YAHOO.util.Event.getPageY(C)-this.minSlider.initPageY-this.minSlider.thumbCenterPoint.y;}if(D<B){this.activeSlider=this.minSlider;}else{if(D>A){this.activeSlider=this.maxSlider;}else{this.activeSlider=D*2>A+B?this.maxSlider:this.minSlider;}}},_handleMouseDown:function(A){this.selectActiveSlider(A);YAHOO.widget.Slider.prototype.onMouseDown.call(this.activeSlider,A);},_oneTimeCallback:function(C,A,B){C.subscribe(A,function(){C.unsubscribe(A,arguments.callee);B.apply({},[].slice.apply(arguments));});},_cleanEvent:function(H,B){if(H.__yui_events&&H.events[B]){var G,F,A;for(F=H.__yui_events.length;F>=0;--F){if(H.__yui_events[F].type===B){G=H.__yui_events[F];break;}}if(G){var E=G.subscribers,C=[],D=0;for(F=0,A=E.length;F<A;++F){if(E[F]){C[D++]=E[F];}}G.subscribers=C;}}}};YAHOO.augment(YAHOO.widget.DualSlider,YAHOO.util.EventProvider);YAHOO.widget.Slider.getHorizDualSlider=function(F,C,K,G,H,B){var A,J;var D=YAHOO.widget,E=D.Slider,I=D.SliderThumb;A=new I(C,F,0,G,0,0,H);J=new I(K,F,0,G,0,0,H);return new D.DualSlider(new E(F,F,A,"horiz"),new E(F,F,J,"horiz"),G,B);};YAHOO.widget.Slider.getVertDualSlider=function(F,C,K,G,H,B){var A,J;var D=YAHOO.widget,E=D.Slider,I=D.SliderThumb;A=new I(C,F,0,0,0,G,H);J=new I(K,F,0,0,0,G,H);return new D.DualSlider(new E(F,F,A,"vert"),new E(F,F,J,"vert"),G,B);};YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 267047504930fd29a9e93660faa7859aab05b970..301d5ae370b93383ec1ce580d69584da8abd1d9c 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The Slider component is a UI control that enables the user to adjust 
@@ -36,6 +36,10 @@ version: 2.3.0
  * @param {String}      sType  The type of slider (horiz, vert, region)
  */
 YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {
+
+    YAHOO.widget.Slider.ANIM_AVAIL = 
+        (!YAHOO.lang.isUndefined(YAHOO.util.Anim));
+
     if (sElementId) {
         this.init(sElementId, sGroup, true);
         this.initSlider(sType);
@@ -104,16 +108,23 @@ YAHOO.widget.Slider.getSliderRegion =
 };
 
 /**
- * By default, animation is available if the animation library is detected.
+ * By default, animation is available if the animation utility is detected.
  * @property YAHOO.widget.Slider.ANIM_AVAIL
  * @static
  * @type boolean
  */
-YAHOO.widget.Slider.ANIM_AVAIL = true;
-
+YAHOO.widget.Slider.ANIM_AVAIL = false;
 
 YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
+    /**
+     * Override the default setting of dragOnly to true.
+     * @property dragOnly
+     * @type boolean
+     * @default true
+     */
+    dragOnly : true,
+
     /**
      * Initializes the slider.  Executed in the constructor
      * @method initSlider
@@ -193,7 +204,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
         /**
          * Specifies the number of pixels the arrow keys will move the slider.
-         * Default is 25.
+         * Default is 20.
          * @property keyIncrement
          * @type int
          */
@@ -254,6 +265,23 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * @since 2.3.0
          */
         this.valueChangeSource = 0;
+
+        /**
+         * Indicates whether or not events will be supressed for the current
+         * slide operation
+         * @property _silent
+         * @type boolean
+         * @private
+         */
+        this._silent = false;
+
+        /**
+         * Saved offset used to protect against NaN problems when slider is
+         * set to display:none
+         * @property lastOffset
+         * @type [int, int]
+         */
+        this.lastOffset = [0,0];
     },
 
     /**
@@ -275,9 +303,9 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         t.cacheBetweenDrags = true;
 
         // add handler for the handle onchange event
-        t.onChange = function() { 
-            self.handleThumbChange(); 
-        };
+        //t.onChange = function() { 
+            //self.handleThumbChange(); 
+        //};
 
         if (t._isHoriz && t.xTicks && t.xTicks.length) {
             this.tickPause = Math.round(360 / t.xTicks.length);
@@ -287,10 +315,21 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
 
         // delegate thumb methods
-        t.onMouseDown = function () { return self.focus(); };
-        t.onMouseUp = function() { self.thumbMouseUp(); };
-        t.onDrag = function() { self.fireEvents(true); };
-        t.onAvailable = function() { return self.setStartSliderState(); };
+        t.onAvailable = function() { 
+                return self.setStartSliderState(); 
+            };
+        t.onMouseDown = function () { 
+                return self.focus(); 
+            };
+        t.startDrag = function() { 
+                self._slideStart(); 
+            };
+        t.onDrag = function() { 
+                self.fireEvents(true); 
+            };
+        t.onMouseUp = function() { 
+                self.thumbMouseUp(); 
+            };
 
     },
 
@@ -409,14 +448,14 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                 this.setRegionValue.apply(this, this.deferredSetRegionValue, true);
                 this.deferredSetRegionValue = null;
             } else {
-                this.setRegionValue(0, 0, true, true);
+                this.setRegionValue(0, 0, true, true, true);
             }
         } else {
             if (this.deferredSetValue) {
                 this.setValue.apply(this, this.deferredSetValue, true);
                 this.deferredSetValue = null;
             } else {
-                this.setValue(0, true, true);
+                this.setValue(0, true, true, true);
             }
         }
     },
@@ -464,7 +503,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
     },
 
     /**
-     * Handles mouseup event on the slider background
+     * Handles mouseup event on the thumb
      * @method thumbMouseUp
      * @private
      */
@@ -475,6 +514,12 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
     },
 
+    onMouseUp: function() {
+        if (!this.isLocked() && !this.moveComplete) {
+            this.endMove();
+        }
+    },
+
     /**
      * Returns a reference to this slider's thumb
      * @method getThumb
@@ -512,7 +557,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         if (this.isLocked()) {
             return false;
         } else {
-            this.onSlideStart();
+            this._slideStart();
             return true;
         }
     },
@@ -582,14 +627,21 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @private
      */
     handleThumbChange: function () { 
+        /*
         var t = this.thumb;
         if (t._isRegion) {
-            t.onChange(t.getXValue(), t.getYValue());
-            this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );
+
+            if (!this._silent) {
+                t.onChange(t.getXValue(), t.getYValue());
+                this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );
+            }
         } else {
-            t.onChange(t.getValue());
-            this.fireEvent("change", t.getValue());
+            if (!this._silent) {
+                t.onChange(t.getValue());
+                this.fireEvent("change", t.getValue());
+            }
         }
+        */
 
     },
 
@@ -601,10 +653,12 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {boolean} skipAnim set to true to disable the animation
      * for this move action (but not others).
      * @param {boolean} force ignore the locked setting and set value anyway
+     * @param {boolean} silent when true, do not fire events
      * @return {boolean} true if the move was performed, false if it failed
      */
-    setValue: function(newOffset, skipAnim, force) {
+    setValue: function(newOffset, skipAnim, force, silent) {
 
+        this._silent = silent;
         this.valueChangeSource = this.SOURCE_SET_VALUE;
 
         if (!this.thumb.available) {
@@ -621,17 +675,18 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         }
 
         var t = this.thumb;
+        t.lastOffset = [newOffset, newOffset];
         var newX, newY;
         this.verifyOffset(true);
         if (t._isRegion) {
             return false;
         } else if (t._isHoriz) {
-            this.onSlideStart();
+            this._slideStart();
             // this.fireEvent("slideStart");
             newX = t.initPageX + newOffset + this.thumbCenterPoint.x;
             this.moveThumb(newX, t.initPageY, skipAnim);
         } else {
-            this.onSlideStart();
+            this._slideStart();
             // this.fireEvent("slideStart");
             newY = t.initPageY + newOffset + this.thumbCenterPoint.y;
             this.moveThumb(t.initPageX, newY, skipAnim);
@@ -650,9 +705,12 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {boolean} skipAnim set to true to disable the animation
      * for this move action (but not others).
      * @param {boolean} force ignore the locked setting and set value anyway
+     * @param {boolean} silent when true, do not fire events
      * @return {boolean} true if the move was performed, false if it failed
      */
-    setRegionValue: function(newOffset, newOffset2, skipAnim, force) {
+    setRegionValue: function(newOffset, newOffset2, skipAnim, force, silent) {
+
+        this._silent = silent;
 
         this.valueChangeSource = this.SOURCE_SET_VALUE;
 
@@ -670,8 +728,10 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         }
 
         var t = this.thumb;
+        t.lastOffset = [newOffset, newOffset2];
+        this.verifyOffset(true);
         if (t._isRegion) {
-            this.onSlideStart();
+            this._slideStart();
             var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;
             var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;
             this.moveThumb(newX, newY, skipAnim);
@@ -694,11 +754,14 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         var newPos = YAHOO.util.Dom.getXY(this.getEl());
         //var newPos = [this.initPageX, this.initPageY];
 
+        if (newPos) {
 
-        if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {
-            this.thumb.resetConstraints();
-            this.baselinePos = newPos;
-            return false;
+
+            if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {
+                this.thumb.resetConstraints();
+                this.baselinePos = newPos;
+                return false;
+            }
         }
 
         return true;
@@ -712,9 +775,11 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @param {int} x the X coordinate of the click
      * @param {int} y the Y coordinate of the click
      * @param {boolean} skipAnim don't animate if the move happend onDrag
+     * @param {boolean} midMove set to true if this is not terminating
+     * the slider movement
      * @private
      */
-    moveThumb: function(x, y, skipAnim) {
+    moveThumb: function(x, y, skipAnim, midMove) {
 
 
         var t = this.thumb;
@@ -732,8 +797,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         var _p = t.getTargetCoord(x, y);
         var p = [_p.x, _p.y];
 
-
-        this.fireEvent("slideStart");
+        this._slideStart();
 
         if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {
             // this.thumb._animating = true;
@@ -754,12 +818,40 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                     this.animationDuration, 
                     YAHOO.util.Easing.easeOut );
 
-            oAnim.onComplete.subscribe( function() { self.endMove(); } );
+            oAnim.onComplete.subscribe( function() { 
+                    
+                    self.endMove(); 
+                } );
             oAnim.animate();
         } else {
             t.setDragElPos(x, y);
             // this.fireEvents();
-            this.endMove();
+            if (!midMove) {
+                this.endMove();
+            }
+        }
+    },
+
+    _slideStart: function() {
+        if (!this._sliding) {
+            if (!this._silent) {
+                this.onSlideStart();
+                this.fireEvent("slideStart");
+            }
+            this._sliding = true;
+        }
+    },
+
+    _slideEnd: function() {
+
+        if (this._sliding && this.moveComplete) {
+            if (!this._silent) {
+                this.onSlideEnd();
+                this.fireEvent("slideEnd");
+            }
+            this._sliding = false;
+            this._silent = false;
+            this.moveComplete = false;
         }
     },
 
@@ -919,7 +1011,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         if (! this.isLocked()) {
             var x = YAHOO.util.Event.getPageX(e);
             var y = YAHOO.util.Event.getPageY(e);
-            this.moveThumb(x, y, true);
+            this.moveThumb(x, y, true, true);
+            this.fireEvents();
         }
     },
 
@@ -961,8 +1054,10 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
                 var newY = t.getYValue();
 
                 if (newX != this.previousX || newY != this.previousY) {
-                    this.onChange(newX, newY);
-                    this.fireEvent("change", { x: newX, y: newY });
+                    if (!this._silent) {
+                        this.onChange(newX, newY);
+                        this.fireEvent("change", { x: newX, y: newY });
+                    }
                 }
 
                 this.previousX = newX;
@@ -971,17 +1066,15 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
             } else {
                 var newVal = t.getValue();
                 if (newVal != this.previousVal) {
-                    this.onChange( newVal );
-                    this.fireEvent("change", newVal);
+                    if (!this._silent) {
+                        this.onChange( newVal );
+                        this.fireEvent("change", newVal);
+                    }
                 }
                 this.previousVal = newVal;
             }
 
-            if (this.moveComplete) {
-                this.onSlideEnd();
-                this.fireEvent("slideEnd");
-                this.moveComplete = false;
-            }
+            this._slideEnd();
 
         }
     },
@@ -1078,6 +1171,14 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      */
     startOffset: null,
 
+    /**
+     * Override the default setting of dragOnly to true.
+     * @property dragOnly
+     * @type boolean
+     * @default true
+     */
+    dragOnly : true,
+
     /**
      * Flag used to figure out if this is a horizontal or vertical slider
      * @property _isHoriz
@@ -1118,14 +1219,14 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
 
     getOffsetFromParent: function(parentPos) {
 
-        var el = this.getEl();
+        var el = this.getEl(), newOffset;
 
         if (!this.deltaOffset) {
 
             var myPos = YAHOO.util.Dom.getXY(el);
             var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);
 
-            var newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
+            newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
 
             var l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
             var t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
@@ -1200,9 +1301,7 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved from the start position.
      */
     getValue: function () {
-        if (!this.available) { return 0; }
-        var val = (this._isHoriz) ? this.getXValue() : this.getYValue();
-        return val;
+        return (this._isHoriz) ? this.getXValue() : this.getYValue();
     },
 
     /**
@@ -1213,9 +1312,16 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved horizontally from the start position.
      */
     getXValue: function () {
-        if (!this.available) { return 0; }
+        if (!this.available) { 
+            return 0; 
+        }
         var newOffset = this.getOffsetFromParent();
-        return (newOffset[0] - this.startOffset[0]);
+        if (YAHOO.lang.isNumber(newOffset[0])) {
+            this.lastOffset = newOffset;
+            return (newOffset[0] - this.startOffset[0]);
+        } else {
+            return (this.lastOffset[0] - this.startOffset[0]);
+        }
     },
 
     /**
@@ -1226,9 +1332,16 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      * slider has moved vertically from the start position.
      */
     getYValue: function () {
-        if (!this.available) { return 0; }
+        if (!this.available) { 
+            return 0; 
+        }
         var newOffset = this.getOffsetFromParent();
-        return (newOffset[1] - this.startOffset[1]);
+        if (YAHOO.lang.isNumber(newOffset[1])) {
+            this.lastOffset = newOffset;
+            return (newOffset[1] - this.startOffset[1]);
+        } else {
+            return (this.lastOffset[1] - this.startOffset[1]);
+        }
     },
 
     /**
@@ -1251,8 +1364,535 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
 
 });
 
-if ("undefined" == typeof YAHOO.util.Anim) {
-    YAHOO.widget.Slider.ANIM_AVAIL = false;
-}
+/**
+ * A slider with two thumbs, one that represents the min value and 
+ * the other the max.  Actually a composition of two sliders, both with
+ * the same background.  The constraints for each slider are adjusted
+ * dynamically so that the min value of the max slider is equal or greater
+ * to the current value of the min slider, and the max value of the min
+ * slider is the current value of the max slider.
+ * Constructor assumes both thumbs are positioned absolutely at the 0 mark on
+ * the background.
+ *
+ * @namespace YAHOO.widget
+ * @class DualSlider
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param {Slider} minSlider The Slider instance used for the min value thumb
+ * @param {Slider} maxSlider The Slider instance used for the max value thumb
+ * @param {int}    range The number of pixels the thumbs may move within
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ */
+YAHOO.widget.DualSlider = function(minSlider, maxSlider, range, initVals) {
+
+    var self = this,
+        lang = YAHOO.lang;
+
+    /**
+     * A slider instance that keeps track of the lower value of the range.
+     * <strong>read only</strong>
+     * @property minSlider
+     * @type Slider
+     */
+    this.minSlider = minSlider;
 
-YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.3.0", build: "442"});
+    /**
+     * A slider instance that keeps track of the upper value of the range.
+     * <strong>read only</strong>
+     * @property maxSlider
+     * @type Slider
+     */
+    this.maxSlider = maxSlider;
+
+    /**
+     * The currently active slider (min or max). <strong>read only</strong>
+     * @property activeSlider
+     * @type Slider
+     */
+    this.activeSlider = minSlider;
+
+    /**
+     * Is the DualSlider oriented horizontally or vertically?
+     * <strong>read only</strong>
+     * @property isHoriz
+     * @type boolean
+     */
+    this.isHoriz = minSlider.thumb._isHoriz;
+
+    // Validate initial values
+    initVals = YAHOO.lang.isArray(initVals) ? initVals : [0,range];
+    initVals[0] = Math.min(Math.max(parseInt(initVals[0],10)|0,0),range);
+    initVals[1] = Math.max(Math.min(parseInt(initVals[1],10)|0,range),0);
+    // Swap initVals if min > max
+    if (initVals[0] > initVals[1]) {
+        initVals.splice(0,2,initVals[1],initVals[0]);
+    }
+
+    var ready = { min : false, max : false };
+
+    this.minSlider.thumb.onAvailable = function () {
+        minSlider.setStartSliderState();
+        ready.min = true;
+        if (ready.max) {
+            minSlider.setValue(initVals[0],true,true,true);
+            maxSlider.setValue(initVals[1],true,true,true);
+            self.updateValue(true);
+            self.fireEvent('ready',self);
+        }
+    };
+    this.maxSlider.thumb.onAvailable = function () {
+        maxSlider.setStartSliderState();
+        ready.max = true;
+        if (ready.min) {
+            minSlider.setValue(initVals[0],true,true,true);
+            maxSlider.setValue(initVals[1],true,true,true);
+            self.updateValue(true);
+            self.fireEvent('ready',self);
+        }
+    };
+
+    // dispatch mousedowns to the active slider
+    minSlider.onMouseDown = function(e) {
+        self._handleMouseDown(e);
+    };
+
+    // we can safely ignore a mousedown on one of the sliders since
+    // they share a background
+    maxSlider.onMouseDown = function(e) { 
+        YAHOO.util.Event.stopEvent(e); 
+    };
+
+    // Fix the drag behavior so that only the active slider
+    // follows the drag
+    minSlider.onDrag =
+    maxSlider.onDrag = function(e) {
+        self._handleDrag(e);
+    };
+
+    // The core events for each slider are handled so we can expose a single
+    // event for when the event happens on either slider
+    minSlider.subscribe("change", this._handleMinChange, minSlider, this);
+    minSlider.subscribe("slideStart", this._handleSlideStart, minSlider, this);
+    minSlider.subscribe("slideEnd", this._handleSlideEnd, minSlider, this);
+
+    maxSlider.subscribe("change", this._handleMaxChange, maxSlider, this);
+    maxSlider.subscribe("slideStart", this._handleSlideStart, maxSlider, this);
+    maxSlider.subscribe("slideEnd", this._handleSlideEnd, maxSlider, this);
+
+    /**
+     * Event that fires when the slider is finished setting up
+     * @event ready
+     * @param {DualSlider} dualslider the DualSlider instance
+     */
+    this.createEvent("ready", this);
+
+    /**
+     * Event that fires when either the min or max value changes
+     * @event change
+     * @param {DualSlider} dualslider the DualSlider instance
+     */
+    this.createEvent("change", this);
+
+    /**
+     * Event that fires when one of the thumbs begins to move
+     * @event slideStart
+     * @param {Slider} activeSlider the moving slider
+     */
+    this.createEvent("slideStart", this);
+
+    /**
+     * Event that fires when one of the thumbs finishes moving
+     * @event slideEnd
+     * @param {Slider} activeSlider the moving slider
+     */
+    this.createEvent("slideEnd", this);
+};
+
+YAHOO.widget.DualSlider.prototype = {
+
+    /**
+     * The current value of the min thumb. <strong>read only</strong>.
+     * @property minVal
+     * @type int
+     */
+    minVal : -1,
+
+    /**
+     * The current value of the max thumb. <strong>read only</strong>.
+     * @property maxVal
+     * @type int
+     */
+    maxVal : -1,
+
+    /**
+     * Pixel distance to maintain between thumbs.
+     * @property minRange
+     * @type int
+     * @default 0
+     */
+    minRange : 0,
+
+    /**
+     * Executed when one of the sliders fires the slideStart event
+     * @method _handleSlideStart
+     * @private
+     */
+    _handleSlideStart: function(data, slider) {
+        this.fireEvent("slideStart", slider);
+    },
+
+    /**
+     * Executed when one of the sliders fires the slideEnd event
+     * @method _handleSlideEnd
+     * @private
+     */
+    _handleSlideEnd: function(data, slider) {
+        this.fireEvent("slideEnd", slider);
+    },
+
+    /**
+     * Overrides the onDrag method for both sliders
+     * @method _handleDrag
+     * @private
+     */
+    _handleDrag: function(e) {
+        YAHOO.widget.Slider.prototype.onDrag.call(this.activeSlider, e);
+    },
+
+    /**
+     * Executed when the min slider fires the change event
+     * @method _handleMinChange
+     * @private
+     */
+    _handleMinChange: function() {
+        this.activeSlider = this.minSlider;
+        this.updateValue();
+    },
+
+    /**
+     * Executed when the max slider fires the change event
+     * @method _handleMaxChange
+     * @private
+     */
+    _handleMaxChange: function() {
+        this.activeSlider = this.maxSlider;
+        this.updateValue();
+    },
+
+    /**
+     * Sets the min and max thumbs to new values.
+     * @method setValues
+     * @param min {int} Pixel offset to assign to the min thumb
+     * @param max {int} Pixel offset to assign to the max thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setValues : function (min, max, skipAnim, force, silent) {
+        var mins = this.minSlider,
+            maxs = this.maxSlider,
+            mint = mins.thumb,
+            maxt = maxs.thumb,
+            self = this,
+            done = { min : false, max : false };
+
+        // Clear constraints to prevent animated thumbs from prematurely
+        // stopping when hitting a constraint that's moving with the other
+        // thumb.
+        if (mint._isHoriz) {
+            mint.setXConstraint(mint.leftConstraint,maxt.rightConstraint,mint.tickSize);
+            maxt.setXConstraint(mint.leftConstraint,maxt.rightConstraint,maxt.tickSize);
+        } else {
+            mint.setYConstraint(mint.topConstraint,maxt.bottomConstraint,mint.tickSize);
+            maxt.setYConstraint(mint.topConstraint,maxt.bottomConstraint,maxt.tickSize);
+        }
+
+        // Set up one-time slideEnd callbacks to call updateValue when both
+        // thumbs have been set
+        this._oneTimeCallback(mins,'slideEnd',function () {
+            done.min = true;
+            if (done.max) {
+                self.updateValue(silent);
+                // Clean the slider's slideEnd events on a timeout since this
+                // will be executed from inside the event's fire
+                setTimeout(function () {
+                    self._cleanEvent(mins,'slideEnd');
+                    self._cleanEvent(maxs,'slideEnd');
+                },0);
+            }
+        });
+
+        this._oneTimeCallback(maxs,'slideEnd',function () {
+            done.max = true;
+            if (done.min) {
+                self.updateValue(silent);
+                // Clean both sliders' slideEnd events on a timeout since this
+                // will be executed from inside one of the event's fire
+                setTimeout(function () {
+                    self._cleanEvent(mins,'slideEnd');
+                    self._cleanEvent(maxs,'slideEnd');
+                },0);
+            }
+        });
+
+        mins.setValue(min,skipAnim,force,silent);
+        maxs.setValue(max,skipAnim,force,silent);
+    },
+
+    /**
+     * Set the min thumb position to a new value.
+     * @method setMinValue
+     * @param min {int} Pixel offset for min thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setMinValue : function (min, skipAnim, force, silent) {
+        var mins = this.minSlider;
+
+        this.activeSlider = mins;
+
+        // Use a one-time event callback to delay the updateValue call
+        // until after the slide operation is done
+        var self = this;
+        this._oneTimeCallback(mins,'slideEnd',function () {
+            self.updateValue(silent);
+            // Clean the slideEnd event on a timeout since this
+            // will be executed from inside the event's fire
+            setTimeout(function () { self._cleanEvent(mins,'slideEnd'); }, 0);
+        });
+
+        mins.setValue(min, skipAnim, force, silent);
+    },
+
+    /**
+     * Set the max thumb position to a new value.
+     * @method setMaxValue
+     * @param max {int} Pixel offset for max thumb
+     * @param skipAnim {boolean} (optional) Set to true to skip thumb animation.
+     * Default false
+     * @param force {boolean} (optional) ignore the locked setting and set
+     * value anyway. Default false
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     */
+    setMaxValue : function (max, skipAnim, force, silent) {
+        var maxs = this.maxSlider;
+
+        this.activeSlider = maxs;
+
+        // Use a one-time event callback to delay the updateValue call
+        // until after the slide operation is done
+        var self = this;
+        this._oneTimeCallback(maxs,'slideEnd',function () {
+            self.updateValue(silent);
+            // Clean the slideEnd event on a timeout since this
+            // will be executed from inside the event's fire
+            setTimeout(function () { self._cleanEvent(maxs,'slideEnd'); }, 0);
+        });
+
+        maxs.setValue(max, skipAnim, force, silent);
+    },
+
+    /**
+     * Executed when one of the sliders is moved
+     * @method updateValue
+     * @param silent {boolean} (optional) Set to true to skip firing change
+     * events.  Default false
+     * @private
+     */
+    updateValue: function(silent) {
+        var min     = this.minSlider.getValue(),
+            max     = this.maxSlider.getValue(),
+            changed = false;
+
+        if (min != this.minVal || max != this.maxVal) {
+            changed = true;
+
+            var mint = this.minSlider.thumb;
+            var maxt = this.maxSlider.thumb;
+
+            var thumbInnerWidth = this.minSlider.thumbCenterPoint.x +
+                                  this.maxSlider.thumbCenterPoint.x;
+
+            // Establish barriers within the respective other thumb's edge, less
+            // the minRange.  Limit to the Slider's range in the case of
+            // negative minRanges.
+            var minConstraint = Math.max(max-thumbInnerWidth-this.minRange,0);
+            var maxConstraint = Math.min(-min-thumbInnerWidth-this.minRange,0);
+
+            if (this.isHoriz) {
+                minConstraint = Math.min(minConstraint,maxt.rightConstraint);
+
+                mint.setXConstraint(mint.leftConstraint,minConstraint, mint.tickSize);
+
+                maxt.setXConstraint(maxConstraint,maxt.rightConstraint, maxt.tickSize);
+            } else {
+                minConstraint = Math.min(minConstraint,maxt.bottomConstraint);
+                mint.setYConstraint(mint.leftConstraint,minConstraint, mint.tickSize);
+
+                maxt.setYConstraint(maxConstraint,maxt.bottomConstraint, maxt.tickSize);
+            }
+        }
+
+        this.minVal = min;
+        this.maxVal = max;
+
+        if (changed && !silent) {
+            this.fireEvent("change", this);
+        }
+    },
+
+    /**
+     * A background click will move the slider thumb nearest to the click.
+     * Override if you need different behavior.
+     * @method selectActiveSlider
+     * @param e {Event} the mousedown event
+     * @private
+     */
+    selectActiveSlider: function(e) {
+        var min = this.minSlider.getValue(),
+            max = this.maxSlider.getValue(),
+            d;
+
+        if (this.isHoriz) {
+            d = YAHOO.util.Event.getPageX(e) - this.minSlider.initPageX -
+                this.minSlider.thumbCenterPoint.x;
+        } else {
+            d = YAHOO.util.Event.getPageY(e) - this.minSlider.initPageY -
+                this.minSlider.thumbCenterPoint.y;
+        }
+                
+        // Below the minSlider thumb.  Move the minSlider thumb
+        if (d < min) {
+            this.activeSlider = this.minSlider;
+        // Above the maxSlider thumb.  Move the maxSlider thumb
+        } else if (d > max) {
+            this.activeSlider = this.maxSlider;
+        // Split the difference between thumbs
+        } else {
+            this.activeSlider = d*2 > max+min ? this.maxSlider : this.minSlider;
+        }
+    },
+
+    /**
+     * Overrides the onMouseDown for both slider, only moving the active slider
+     * @method handleMouseDown
+     * @private
+     */
+    _handleMouseDown: function(e) {
+        this.selectActiveSlider(e);
+        YAHOO.widget.Slider.prototype.onMouseDown.call(this.activeSlider, e);
+    },
+
+    /**
+     * Schedule an event callback that will execute once, then unsubscribe
+     * itself.
+     * @method _oneTimeCallback
+     * @param o {EventProvider} Object to attach the event to
+     * @param evt {string} Name of the event
+     * @param fn {Function} function to execute once
+     * @private
+     */
+    _oneTimeCallback : function (o,evt,fn) {
+        o.subscribe(evt,function () {
+            // Unsubscribe myself
+            o.unsubscribe(evt,arguments.callee);
+            // Pass the event handler arguments to the one time callback
+            fn.apply({},[].slice.apply(arguments));
+        });
+    },
+
+    /**
+     * Clean up the slideEnd event subscribers array, since each one-time
+     * callback will be replaced in the event's subscribers property with
+     * null.  This will cause memory bloat and loss of performance.
+     * @method _cleanEvent
+     * @param o {EventProvider} object housing the CustomEvent
+     * @param evt {string} name of the CustomEvent
+     * @private
+     */
+    _cleanEvent : function (o,evt) {
+        if (o.__yui_events && o.events[evt]) {
+            var ce, i, len;
+            for (i = o.__yui_events.length; i >= 0; --i) {
+                if (o.__yui_events[i].type === evt) {
+                    ce = o.__yui_events[i];
+                    break;
+                }
+            }
+            if (ce) {
+                var subs    = ce.subscribers,
+                    newSubs = [],
+                    j = 0;
+                for (i = 0, len = subs.length; i < len; ++i) {
+                    if (subs[i]) {
+                        newSubs[j++] = subs[i];
+                    }
+                }
+                ce.subscribers = newSubs;
+            }
+        }
+    }
+
+};
+
+YAHOO.augment(YAHOO.widget.DualSlider, YAHOO.util.EventProvider);
+
+
+/**
+ * Factory method for creating a horizontal dual-thumb slider
+ * @for YAHOO.widget.Slider
+ * @method YAHOO.widget.Slider.getHorizDualSlider
+ * @static
+ * @param {String} bg the id of the slider's background element
+ * @param {String} minthumb the id of the min thumb
+ * @param {String} maxthumb the id of the thumb thumb
+ * @param {int} range the number of pixels the thumbs can move within
+ * @param {int} iTickSize (optional) the element should move this many pixels
+ * at a time
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ * @return {DualSlider} a horizontal dual-thumb slider control
+ */
+YAHOO.widget.Slider.getHorizDualSlider = 
+    function (bg, minthumb, maxthumb, range, iTickSize, initVals) {
+        var mint, maxt;
+        var YW = YAHOO.widget, Slider = YW.Slider, Thumb = YW.SliderThumb;
+
+        mint = new Thumb(minthumb, bg, 0, range, 0, 0, iTickSize);
+        maxt = new Thumb(maxthumb, bg, 0, range, 0, 0, iTickSize);
+
+        return new YW.DualSlider(new Slider(bg, bg, mint, "horiz"), new Slider(bg, bg, maxt, "horiz"), range, initVals);
+};
+
+/**
+ * Factory method for creating a vertical dual-thumb slider.
+ * @for YAHOO.widget.Slider
+ * @method YAHOO.widget.Slider.getVertDualSlider
+ * @static
+ * @param {String} bg the id of the slider's background element
+ * @param {String} minthumb the id of the min thumb
+ * @param {String} maxthumb the id of the thumb thumb
+ * @param {int} range the number of pixels the thumbs can move within
+ * @param {int} iTickSize (optional) the element should move this many pixels
+ * at a time
+ * @param {Array}  initVals (optional) [min,max] Initial thumb placement
+ * @return {DualSlider} a vertical dual-thumb slider control
+ */
+YAHOO.widget.Slider.getVertDualSlider = 
+    function (bg, minthumb, maxthumb, range, iTickSize, initVals) {
+        var mint, maxt;
+        var YW = YAHOO.widget, Slider = YW.Slider, Thumb = YW.SliderThumb;
+
+        mint = new Thumb(minthumb, bg, 0, 0, 0, range, iTickSize);
+        maxt = new Thumb(maxthumb, bg, 0, 0, 0, range, iTickSize);
+
+        return new YW.DualSlider(new Slider(bg, bg, mint, "vert"), new Slider(bg, bg, maxt, "vert"), range, initVals);
+};
+YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.5.0", build: "895"});
index 47055d6dbb0dcabd7577fd822846b6973e04f3d0..8feae71c43cd4ff82a9c79205c5d4e2b0d64bd16 100755 (executable)
@@ -1,5 +1,14 @@
 TabView Release Notes
 
+*** version 2.5.0 ***
+* moved Tab default "title" attribute to static Tab.TITLE 
+
+*** version 2.4.0 ***
+* no change
+
+*** version 2.3.1 ***
+* removed Xoutline from tabview-core.css
+
 ** version 2.3.0 ***
 * no longer firing tabChange if already selected
 * multiple clicks no longer trigger extra xhr if in progress
@@ -12,27 +21,21 @@ TabView Release Notes
 
 
 *** version 2.2.1 ***
-
 * no change
 
 *** version 2.2.0 ***
-
 * Element broken out into seperate pkg
   NOTE: new dependency required - element-beta.js
 
 *** version 0.12.2 ***
-
 * var Tab is now private
 * fixed Element.configureAttribute
 
 *** version 0.12.1 ***
-
 * tabs.css renamed to tabview.css
 * calls to "set" now queued so they can be made before "contentReady"
 
 
 *** version 0.12.0 ***
-
 * TabView widget introduced
-
 * Note: border_tabs.css included as basic skin to enable "tabs" look
index 155ba7f1ae9f96658dd383eb30ec7b3ecb3019a5..8285a6cb507914d2c9ddf56969325260ea6abaaa 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-navset .yui-nav li a, .yui-navset .yui-content {
     border:1px solid #000;  /* label and content borders */
index 0f8181131acd39ea747414be1f1dd1023bdd7b85..12ff10266ef8a12c2683c0a19d701571416743d3 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-navset .yui-nav li {
     margin-right:0.16em; /* space between tabs */
index 3aa177af7b19cdb4b2f0e2cc66bde284174e6130..a6691b3f9a5296dad014a1ffc79b5eb2c5abec3b 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* .yui-navset defaults to .yui-navset-top */
 .yui-skin-sam .yui-navset .yui-nav,
index 81f30b0a3369ae37175c5d27017f617f73bae59e..10c06079021d165dfd2b5eced0dc39016915a348 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
index 0d072c1cae492c1e42cf62348cc9b7142864729e..248307acfc483af461968f3667c7b0c46ec1047d 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* default space between tabs */
 .yui-navset .yui-nav li,
@@ -20,6 +20,7 @@ version: 2.3.0
 .yui-navset .yui-navset-right .yui-nav,
 .yui-navset-left .yui-nav,
 .yui-navset-right .yui-nav { width:6em; }
+
 .yui-navset-top .yui-nav,
 .yui-navset-bottom .yui-nav {
     width:auto;
@@ -65,10 +66,6 @@ version: 2.3.0
     display:block;
 }
 
-.yui-navset .yui-nav a {
-    Xoutline:0; /* gecko: keep from shifting */
-}
-
 .yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */
 
 .yui-navset .yui-nav li a,
index f42457e5485b97fca964a33be2e1a1c862114d3c..b213a33b0b8c90a4e665e73deeca20fb1908ebb9 100644 (file)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* default space between tabs */
 .yui-navset .yui-nav li {
index 068d438d6a25678b177f956db003bdc287721c52..aecdc325a5fd9d8e9f03646675a24948bb003a22 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function() {
 
@@ -271,7 +271,7 @@ version: 2.3.0
         
         /**
          * The Tabs belonging to the TabView instance.
-         * @config tabs
+         * @attribute tabs
          * @type Array
          */
         this.setAttributeConfig('tabs', {
@@ -301,7 +301,7 @@ version: 2.3.0
         
         /**
          * How the Tabs should be oriented relative to the TabView.
-         * @config orientation
+         * @attribute orientation
          * @type String
          * @default "top"
          */
@@ -325,7 +325,7 @@ version: 2.3.0
         
         /**
          * The index of the tab currently active.
-         * @config activeIndex
+         * @attribute activeIndex
          * @type Int
          */
         this.setAttributeConfig('activeIndex', {
@@ -340,7 +340,7 @@ version: 2.3.0
         
         /**
          * The tab currently active.
-         * @config activeTab
+         * @attribute activeTab
          * @type YAHOO.widget.Tab
          */
         this.setAttributeConfig('activeTab', {
@@ -368,6 +368,7 @@ version: 2.3.0
             }
         });
 
+        YAHOO.log('attributes initialized', 'info', 'TabView');
         if ( this._tabParent ) {
             _initTabs.call(this);
         }
@@ -424,6 +425,7 @@ version: 2.3.0
             el.className = this.CLASSNAME;
         }
         
+        YAHOO.log('TabView Dom created', 'info', 'TabView');
         return el;
     };
     
@@ -463,70 +465,6 @@ version: 2.3.0
         
         return nodes;
     };
-
-/**
- * Fires before the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the currently active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the tab to be made active</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
- * @event beforeActiveTabChange
- */
-    
-/**
- * Fires after the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> activeTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the formerly active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the new active tab</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('activeTabChange', handler);</code></p>
- * @event activeTabChange
- */
-/**
- * Fires before the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the current orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation to be applied</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeOrientationChange', handler);</code></p>
- * @event beforeOrientationChange
- */
-    
-/**
- * Fires after the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> orientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the former orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('orientationChange', handler);</code></p>
- * @event orientationChange
- */
 })();
 
 (function() {
@@ -559,8 +497,6 @@ version: 2.3.0
                 this.set('content', o.responseText);
             },
             failure: function(o) {
-                YAHOO.log('loading failed: ' + o.statusText,
-                        'error', 'Tab');
             }
         };
         
@@ -584,10 +520,18 @@ version: 2.3.0
      * The class name applied to active tabs.
      * @property ACTIVE_CLASSNAME
      * @type String
-     * @default "on"
+     * @default "selected"
      */
     proto.ACTIVE_CLASSNAME = 'selected';
     
+    /**
+     * The title applied to active tabs.
+     * @property ACTIVE_TITLE
+     * @type String
+     * @default "active"
+     */
+    proto.ACTIVE_TITLE = 'active';
+
     /**
      * The class name applied to disabled tabs.
      * @property DISABLED_CLASSNAME
@@ -645,7 +589,7 @@ version: 2.3.0
         
         /**
          * The event that triggers the tab's activation.
-         * @config activationEvent
+         * @attribute activationEvent
          * @type String
          */
         this.setAttributeConfig('activationEvent', {
@@ -654,7 +598,7 @@ version: 2.3.0
 
         /**
          * The element that contains the tab's label.
-         * @config labelEl
+         * @attribute labelEl
          * @type HTMLElement
          */
         this.setAttributeConfig('labelEl', {
@@ -678,7 +622,7 @@ version: 2.3.0
 
         /**
          * The tab's label text (or innerHTML).
-         * @config label
+         * @attribute label
          * @type String
          */
         this.setAttributeConfig('label', {
@@ -695,7 +639,7 @@ version: 2.3.0
         
         /**
          * The HTMLElement that contains the tab's content.
-         * @config contentEl
+         * @attribute contentEl
          * @type HTMLElement
          */
         this.setAttributeConfig('contentEl', {
@@ -714,7 +658,7 @@ version: 2.3.0
         
         /**
          * The tab's content.
-         * @config content
+         * @attribute content
          * @type String
          */
         this.setAttributeConfig('content', {
@@ -728,7 +672,7 @@ version: 2.3.0
         
         /**
          * The tab's data source, used for loading content dynamically.
-         * @config dataSrc
+         * @attribute dataSrc
          * @type String
          */
         this.setAttributeConfig('dataSrc', {
@@ -737,7 +681,7 @@ version: 2.3.0
         
         /**
          * Whether or not content should be reloaded for every view.
-         * @config cacheData
+         * @attribute cacheData
          * @type Boolean
          * @default false
          */
@@ -748,7 +692,7 @@ version: 2.3.0
         
         /**
          * The method to use for the data request.
-         * @config loadMethod
+         * @attribute loadMethod
          * @type String
          * @default "GET"
          */
@@ -759,7 +703,7 @@ version: 2.3.0
 
         /**
          * Whether or not any data has been loaded from the server.
-         * @config dataLoaded
+         * @attribute dataLoaded
          * @type Boolean
          */        
         this.setAttributeConfig('dataLoaded', {
@@ -770,7 +714,7 @@ version: 2.3.0
         
         /**
          * Number if milliseconds before aborting and calling failure handler.
-         * @config dataTimeout
+         * @attribute dataTimeout
          * @type Number
          * @default null
          */
@@ -783,7 +727,7 @@ version: 2.3.0
          * Whether or not the tab is currently active.
          * If a dataSrc is set for the tab, the content will be loaded from
          * the given source.
-         * @config active
+         * @attribute active
          * @type Boolean
          */
         this.setAttributeConfig('active', {
@@ -791,7 +735,7 @@ version: 2.3.0
             method: function(value) {
                 if (value === true) {
                     this.addClass(this.ACTIVE_CLASSNAME);
-                    this.set('title', 'active');
+                    this.set('title', this.ACTIVE_TITLE);
                 } else {
                     this.removeClass(this.ACTIVE_CLASSNAME);
                     this.set('title', '');
@@ -804,7 +748,7 @@ version: 2.3.0
         
         /**
          * Whether or not the tab is disabled.
-         * @config disabled
+         * @attribute disabled
          * @type Boolean
          */
         this.setAttributeConfig('disabled', {
@@ -821,7 +765,7 @@ version: 2.3.0
         
         /**
          * The href of the tab's anchor element.
-         * @config href
+         * @attribute href
          * @type String
          * @default '#'
          */
@@ -836,7 +780,7 @@ version: 2.3.0
         
         /**
          * The Whether or not the tab's content is visible.
-         * @config contentVisible
+         * @attribute contentVisible
          * @type Boolean
          * @default false
          */
@@ -858,6 +802,7 @@ version: 2.3.0
             },
             validator: YAHOO.lang.isBoolean
         });
+        YAHOO.log('attributes initialized', 'info', 'Tab');
     };
     
     var _createTabElement = function(attr) {
@@ -881,6 +826,7 @@ version: 2.3.0
         
         a.appendChild(labelEl);
         
+        YAHOO.log('creating Tab Dom', 'info', 'Tab');
         return el;
     };
     
@@ -923,6 +869,7 @@ version: 2.3.0
             this.get('dataSrc'), 
             {
                 success: function(o) {
+                    YAHOO.log('content loaded successfully', 'info', 'Tab');
                     this.loadHandler.success.call(this, o);
                     this.set('dataLoaded', true);
                     this.dataConnection = null;
@@ -931,6 +878,7 @@ version: 2.3.0
                     this._loading = false;
                 },
                 failure: function(o) {
+                    YAHOO.log('loading failed: ' + o.statusText, 'error', 'Tab');
                     this.loadHandler.failure.call(this, o);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
@@ -944,102 +892,6 @@ version: 2.3.0
     };
     
     YAHOO.widget.Tab = Tab;
-    
-    /**
-     * Fires before the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeActiveChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeActiveChange', handler);</code></p>
-     * @event beforeActiveChange
-     */
-        
-    /**
-     * Fires after the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> activeChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('activeChange', handler);</code></p>
-     * @event activeChange
-     */
-     
-    /**
-     * Fires before the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeLabelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeLabelChange', handler);</code></p>
-     * @event beforeLabelChange
-     */
-        
-    /**
-     * Fires after the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> labelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('labelChange', handler);</code></p>
-     * @event labelChange
-     */
-     
-    /**
-     * Fires before the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeContentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeContentChange', handler);</code></p>
-     * @event beforeContentChange
-     */
-        
-    /**
-     * Fires after the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> contentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('contentChange', handler);</code></p>
-     * @event contentChange
-     */
 })();
 
-YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.3.0", build: "442"});
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.5.0", build: "895"});
index 56a4b910f1b0b33cef8b7adffbbdd0096c4782fd..37e228b191144f41a8af10bb47b883b69615244a 100755 (executable)
@@ -1,37 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){YAHOO.widget.TabView=function(el,attr){attr=attr||{};if(arguments.length==1&&!YAHOO.lang.isString(el)&&!el.nodeName){attr=el;el=attr.element||null;}
-if(!el&&!attr.element){el=_createTabViewElement.call(this,attr);}
-YAHOO.widget.TabView.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var proto=YAHOO.widget.TabView.prototype;var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var Tab=YAHOO.widget.Tab;proto.CLASSNAME='yui-navset';proto.TAB_PARENT_CLASSNAME='yui-nav';proto.CONTENT_PARENT_CLASSNAME='yui-content';proto._tabParent=null;proto._contentParent=null;proto.addTab=function(tab,index){var tabs=this.get('tabs');if(!tabs){this._queue[this._queue.length]=['addTab',arguments];return false;}
-index=(index===undefined)?tabs.length:index;var before=this.getTab(index);var self=this;var el=this.get('element');var tabParent=this._tabParent;var contentParent=this._contentParent;var tabElement=tab.get('element');var contentEl=tab.get('contentEl');if(before){tabParent.insertBefore(tabElement,before.get('element'));}else{tabParent.appendChild(tabElement);}
-if(contentEl&&!Dom.isAncestor(contentParent,contentEl)){contentParent.appendChild(contentEl);}
-if(!tab.get('active')){tab.set('contentVisible',false,true);}else{this.set('activeTab',tab,true);}
-var activate=function(e){YAHOO.util.Event.preventDefault(e);var silent=false;if(this==self.get('activeTab')){silent=true;}
-self.set('activeTab',this,silent);};tab.addListener(tab.get('activationEvent'),activate);tab.addListener('activationEventChange',function(e){if(e.prevValue!=e.newValue){tab.removeListener(e.prevValue,activate);tab.addListener(e.newValue,activate);}});tabs.splice(index,0,tab);};proto.DOMEventHandler=function(e){var el=this.get('element');var target=YAHOO.util.Event.getTarget(e);var tabParent=this._tabParent;if(Dom.isAncestor(tabParent,target)){var tabEl;var tab=null;var contentEl;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;i++){tabEl=tabs[i].get('element');contentEl=tabs[i].get('contentEl');if(target==tabEl||Dom.isAncestor(tabEl,target)){tab=tabs[i];break;}}
-if(tab){tab.fireEvent(e.type,e);}}};proto.getTab=function(index){return this.get('tabs')[index];};proto.getTabIndex=function(tab){var index=null;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;++i){if(tab==tabs[i]){index=i;break;}}
-return index;};proto.removeTab=function(tab){var tabCount=this.get('tabs').length;var index=this.getTabIndex(tab);var nextIndex=index+1;if(tab==this.get('activeTab')){if(tabCount>1){if(index+1==tabCount){this.set('activeIndex',index-1);}else{this.set('activeIndex',index+1);}}}
-this._tabParent.removeChild(tab.get('element'));this._contentParent.removeChild(tab.get('contentEl'));this._configs.tabs.value.splice(index,1);};proto.toString=function(){var name=this.get('id')||this.get('tagName');return"TabView "+name;};proto.contentTransition=function(newTab,oldTab){newTab.set('contentVisible',true);oldTab.set('contentVisible',false);};proto.initAttributes=function(attr){YAHOO.widget.TabView.superclass.initAttributes.call(this,attr);if(!attr.orientation){attr.orientation='top';}
-var el=this.get('element');if(!YAHOO.util.Dom.hasClass(el,this.CLASSNAME)){YAHOO.util.Dom.addClass(el,this.CLASSNAME);}
-this.setAttributeConfig('tabs',{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,'ul')[0]||_createTabParent.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,'div')[0]||_createContentParent.call(this);this.setAttributeConfig('orientation',{value:attr.orientation,method:function(value){var current=this.get('orientation');this.addClass('yui-navset-'+value);if(current!=value){this.removeClass('yui-navset-'+current);}
-switch(value){case'bottom':this.appendChild(this._tabParent);break;}}});this.setAttributeConfig('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.setAttributeConfig('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);this._configs['activeIndex'].value=this.getTabIndex(tab);}
-if(activeTab&&activeTab!=tab){activeTab.set('active',false);}
-if(activeTab&&tab!=activeTab){this.contentTransition(tab,activeTab);}else if(tab){tab.set('contentVisible',true);}},validator:function(value){return!value.get('disabled');}});if(this._tabParent){_initTabs.call(this);}
-this.DOM_EVENTS.submit=false;this.DOM_EVENTS.focus=false;this.DOM_EVENTS.blur=false;for(var type in this.DOM_EVENTS){if(YAHOO.lang.hasOwnProperty(this.DOM_EVENTS,type)){this.addListener.call(this,type,this.DOMEventHandler);}}};var _initTabs=function(){var tab,attr,contentEl;var el=this.get('element');var tabs=_getChildNodes(this._tabParent);var contentElements=_getChildNodes(this._contentParent);for(var i=0,len=tabs.length;i<len;++i){attr={};if(contentElements[i]){attr.contentEl=contentElements[i];}
-tab=new YAHOO.widget.Tab(tabs[i],attr);this.addTab(tab);if(tab.hasClass(tab.ACTIVE_CLASSNAME)){this._configs.activeTab.value=tab;this._configs.activeIndex.value=this.getTabIndex(tab);}}};var _createTabViewElement=function(attr){var el=document.createElement('div');if(this.CLASSNAME){el.className=this.CLASSNAME;}
-return el;};var _createTabParent=function(attr){var el=document.createElement('ul');if(this.TAB_PARENT_CLASSNAME){el.className=this.TAB_PARENT_CLASSNAME;}
-this.get('element').appendChild(el);return el;};var _createContentParent=function(attr){var el=document.createElement('div');if(this.CONTENT_PARENT_CLASSNAME){el.className=this.CONTENT_PARENT_CLASSNAME;}
-this.get('element').appendChild(el);return el;};var _getChildNodes=function(el){var nodes=[];var childNodes=el.childNodes;for(var i=0,len=childNodes.length;i<len;++i){if(childNodes[i].nodeType==1){nodes[nodes.length]=childNodes[i];}}
-return nodes;};})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;var Tab=function(el,attr){attr=attr||{};if(arguments.length==1&&!YAHOO.lang.isString(el)&&!el.nodeName){attr=el;el=attr.element;}
-if(!el&&!attr.element){el=_createTabElement.call(this,attr);}
-this.loadHandler={success:function(o){this.set('content',o.responseText);},failure:function(o){}};Tab.superclass.constructor.call(this,el,attr);this.DOM_EVENTS={};};YAHOO.extend(Tab,YAHOO.util.Element);var proto=Tab.prototype;proto.LABEL_TAGNAME='em';proto.ACTIVE_CLASSNAME='selected';proto.DISABLED_CLASSNAME='disabled';proto.LOADING_CLASSNAME='loading';proto.dataConnection=null;proto.loadHandler=null;proto._loading=false;proto.toString=function(){var el=this.get('element');var id=el.id||el.tagName;return"Tab "+id;};proto.initAttributes=function(attr){attr=attr||{};Tab.superclass.initAttributes.call(this,attr);var el=this.get('element');this.setAttributeConfig('activationEvent',{value:attr.activationEvent||'click'});this.setAttributeConfig('labelEl',{value:attr.labelEl||_getlabelEl.call(this),method:function(value){var current=this.get('labelEl');if(current){if(current==value){return false;}
-this.replaceChild(value,current);}else if(el.firstChild){this.insertBefore(value,el.firstChild);}else{this.appendChild(value);}}});this.setAttributeConfig('label',{value:attr.label||_getLabel.call(this),method:function(value){var labelEl=this.get('labelEl');if(!labelEl){this.set('labelEl',_createlabelEl.call(this));}
-_setLabel.call(this,value);}});this.setAttributeConfig('contentEl',{value:attr.contentEl||document.createElement('div'),method:function(value){var current=this.get('contentEl');if(current){if(current==value){return false;}
-this.replaceChild(value,current);}}});this.setAttributeConfig('content',{value:attr.content,method:function(value){this.get('contentEl').innerHTML=value;}});var _dataLoaded=false;this.setAttributeConfig('dataSrc',{value:attr.dataSrc});this.setAttributeConfig('cacheData',{value:attr.cacheData||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig('loadMethod',{value:attr.loadMethod||'GET',validator:YAHOO.lang.isString});this.setAttributeConfig('dataLoaded',{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig('dataTimeout',{value:attr.dataTimeout||null,validator:YAHOO.lang.isNumber});this.setAttributeConfig('active',{value:attr.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(value){if(value===true){this.addClass(this.ACTIVE_CLASSNAME);this.set('title','active');}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set('title','');}},validator:function(value){return YAHOO.lang.isBoolean(value)&&!this.get('disabled');}});this.setAttributeConfig('disabled',{value:attr.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(value){if(value===true){Dom.addClass(this.get('element'),this.DISABLED_CLASSNAME);}else{Dom.removeClass(this.get('element'),this.DISABLED_CLASSNAME);}},validator:YAHOO.lang.isBoolean});this.setAttributeConfig('href',{value:attr.href||this.getElementsByTagName('a')[0].getAttribute('href',2)||'#',method:function(value){this.getElementsByTagName('a')[0].href=value;},validator:YAHOO.lang.isString});this.setAttributeConfig('contentVisible',{value:attr.contentVisible,method:function(value){if(value){this.get('contentEl').style.display='block';if(this.get('dataSrc')){if(!this._loading&&!(this.get('dataLoaded')&&this.get('cacheData'))){_dataConnect.call(this);}}}else{this.get('contentEl').style.display='none';}},validator:YAHOO.lang.isBoolean});};var _createTabElement=function(attr){var el=document.createElement('li');var a=document.createElement('a');a.href=attr.href||'#';el.appendChild(a);var label=attr.label||null;var labelEl=attr.labelEl||null;if(labelEl){if(!label){label=_getLabel.call(this,labelEl);}}else{labelEl=_createlabelEl.call(this);}
-a.appendChild(labelEl);return el;};var _getlabelEl=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var _createlabelEl=function(){var el=document.createElement(this.LABEL_TAGNAME);return el;};var _setLabel=function(label){var el=this.get('labelEl');el.innerHTML=label;};var _getLabel=function(){var label,el=this.get('labelEl');if(!el){return undefined;}
-return el.innerHTML;};var _dataConnect=function(){if(!YAHOO.util.Connect){return false;}
-Dom.addClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=true;this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get('loadMethod'),this.get('dataSrc'),{success:function(o){this.loadHandler.success.call(this,o);this.set('dataLoaded',true);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=false;},failure:function(o){this.loadHandler.failure.call(this,o);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=false;},scope:this,timeout:this.get('dataTimeout')});};YAHOO.widget.Tab=Tab;})();YAHOO.register("tabview",YAHOO.widget.TabView,{version:"2.3.0",build:"442"});
\ No newline at end of file
+(function(){YAHOO.widget.TabView=function(K,J){J=J||{};if(arguments.length==1&&!YAHOO.lang.isString(K)&&!K.nodeName){J=K;K=J.element||null;}if(!K&&!J.element){K=I.call(this,J);}YAHOO.widget.TabView.superclass.constructor.call(this,K,J);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var F=YAHOO.widget.TabView.prototype;var E=YAHOO.util.Dom;var H=YAHOO.util.Event;var D=YAHOO.widget.Tab;F.CLASSNAME="yui-navset";F.TAB_PARENT_CLASSNAME="yui-nav";F.CONTENT_PARENT_CLASSNAME="yui-content";F._tabParent=null;F._contentParent=null;F.addTab=function(M,O){var P=this.get("tabs");if(!P){this._queue[this._queue.length]=["addTab",arguments];return false;}O=(O===undefined)?P.length:O;var R=this.getTab(O);var T=this;var L=this.get("element");var S=this._tabParent;var Q=this._contentParent;var J=M.get("element");var K=M.get("contentEl");if(R){S.insertBefore(J,R.get("element"));}else{S.appendChild(J);}if(K&&!E.isAncestor(Q,K)){Q.appendChild(K);}if(!M.get("active")){M.set("contentVisible",false,true);}else{this.set("activeTab",M,true);}var N=function(V){YAHOO.util.Event.preventDefault(V);var U=false;if(this==T.get("activeTab")){U=true;}T.set("activeTab",this,U);};M.addListener(M.get("activationEvent"),N);M.addListener("activationEventChange",function(U){if(U.prevValue!=U.newValue){M.removeListener(U.prevValue,N);M.addListener(U.newValue,N);}});P.splice(O,0,M);};F.DOMEventHandler=function(P){var K=this.get("element");var Q=YAHOO.util.Event.getTarget(P);var S=this._tabParent;if(E.isAncestor(S,Q)){var L;var M=null;var J;var R=this.get("tabs");for(var N=0,O=R.length;N<O;N++){L=R[N].get("element");J=R[N].get("contentEl");if(Q==L||E.isAncestor(L,Q)){M=R[N];break;}}if(M){M.fireEvent(P.type,P);}}};F.getTab=function(J){return this.get("tabs")[J];};F.getTabIndex=function(N){var K=null;var M=this.get("tabs");for(var L=0,J=M.length;L<J;++L){if(N==M[L]){K=L;break;}}return K;};F.removeTab=function(M){var L=this.get("tabs").length;var K=this.getTabIndex(M);var J=K+1;if(M==this.get("activeTab")){if(L>1){if(K+1==L){this.set("activeIndex",K-1);}else{this.set("activeIndex",K+1);}}}this._tabParent.removeChild(M.get("element"));this._contentParent.removeChild(M.get("contentEl"));this._configs.tabs.value.splice(K,1);};F.toString=function(){var J=this.get("id")||this.get("tagName");return"TabView "+J;};F.contentTransition=function(K,J){K.set("contentVisible",true);J.set("contentVisible",false);};F.initAttributes=function(J){YAHOO.widget.TabView.superclass.initAttributes.call(this,J);if(!J.orientation){J.orientation="top";}var L=this.get("element");if(!YAHOO.util.Dom.hasClass(L,this.CLASSNAME)){YAHOO.util.Dom.addClass(L,this.CLASSNAME);}this.setAttributeConfig("tabs",{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,"ul")[0]||G.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,"div")[0]||C.call(this);this.setAttributeConfig("orientation",{value:J.orientation,method:function(M){var N=this.get("orientation");this.addClass("yui-navset-"+M);if(N!=M){this.removeClass("yui-navset-"+N);}switch(M){case"bottom":this.appendChild(this._tabParent);break;}}});this.setAttributeConfig("activeIndex",{value:J.activeIndex,method:function(M){this.set("activeTab",this.getTab(M));},validator:function(M){return !this.getTab(M).get("disabled");}});this.setAttributeConfig("activeTab",{value:J.activeTab,method:function(N){var M=this.get("activeTab");if(N){N.set("active",true);this._configs["activeIndex"].value=this.getTabIndex(N);}if(M&&M!=N){M.set("active",false);}if(M&&N!=M){this.contentTransition(N,M);}else{if(N){N.set("contentVisible",true);}}},validator:function(M){return !M.get("disabled");}});if(this._tabParent){B.call(this);}this.DOM_EVENTS.submit=false;this.DOM_EVENTS.focus=false;this.DOM_EVENTS.blur=false;for(var K in this.DOM_EVENTS){if(YAHOO.lang.hasOwnProperty(this.DOM_EVENTS,K)){this.addListener.call(this,K,this.DOMEventHandler);}}};var B=function(){var Q,L,P;var O=this.get("element");var N=A(this._tabParent);var K=A(this._contentParent);for(var M=0,J=N.length;M<J;++M){L={};if(K[M]){L.contentEl=K[M];}Q=new YAHOO.widget.Tab(N[M],L);this.addTab(Q);if(Q.hasClass(Q.ACTIVE_CLASSNAME)){this._configs.activeTab.value=Q;this._configs.activeIndex.value=this.getTabIndex(Q);}}};var I=function(J){var K=document.createElement("div");if(this.CLASSNAME){K.className=this.CLASSNAME;}return K;};var G=function(J){var K=document.createElement("ul");if(this.TAB_PARENT_CLASSNAME){K.className=this.TAB_PARENT_CLASSNAME;}this.get("element").appendChild(K);return K;};var C=function(J){var K=document.createElement("div");if(this.CONTENT_PARENT_CLASSNAME){K.className=this.CONTENT_PARENT_CLASSNAME;}this.get("element").appendChild(K);return K;};var A=function(M){var K=[];var N=M.childNodes;for(var L=0,J=N.length;L<J;++L){if(N[L].nodeType==1){K[K.length]=N[L];}}return K;};})();(function(){var E=YAHOO.util.Dom,J=YAHOO.util.Event;var B=function(L,K){K=K||{};if(arguments.length==1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element;}if(!L&&!K.element){L=H.call(this,K);}this.loadHandler={success:function(M){this.set("content",M.responseText);},failure:function(M){}};B.superclass.constructor.call(this,L,K);this.DOM_EVENTS={};};YAHOO.extend(B,YAHOO.util.Element);var F=B.prototype;F.LABEL_TAGNAME="em";F.ACTIVE_CLASSNAME="selected";F.ACTIVE_TITLE="active";F.DISABLED_CLASSNAME="disabled";F.LOADING_CLASSNAME="loading";F.dataConnection=null;F.loadHandler=null;F._loading=false;F.toString=function(){var K=this.get("element");var L=K.id||K.tagName;return"Tab "+L;};F.initAttributes=function(K){K=K||{};B.superclass.initAttributes.call(this,K);var M=this.get("element");this.setAttributeConfig("activationEvent",{value:K.activationEvent||"click"});this.setAttributeConfig("labelEl",{value:K.labelEl||G.call(this),method:function(N){var O=this.get("labelEl");if(O){if(O==N){return false;}this.replaceChild(N,O);}else{if(M.firstChild){this.insertBefore(N,M.firstChild);}else{this.appendChild(N);}}}});this.setAttributeConfig("label",{value:K.label||D.call(this),method:function(O){var N=this.get("labelEl");
+if(!N){this.set("labelEl",I.call(this));}C.call(this,O);}});this.setAttributeConfig("contentEl",{value:K.contentEl||document.createElement("div"),method:function(N){var O=this.get("contentEl");if(O){if(O==N){return false;}this.replaceChild(N,O);}}});this.setAttributeConfig("content",{value:K.content,method:function(N){this.get("contentEl").innerHTML=N;}});var L=false;this.setAttributeConfig("dataSrc",{value:K.dataSrc});this.setAttributeConfig("cacheData",{value:K.cacheData||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("loadMethod",{value:K.loadMethod||"GET",validator:YAHOO.lang.isString});this.setAttributeConfig("dataLoaded",{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig("dataTimeout",{value:K.dataTimeout||null,validator:YAHOO.lang.isNumber});this.setAttributeConfig("active",{value:K.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(N){if(N===true){this.addClass(this.ACTIVE_CLASSNAME);this.set("title",this.ACTIVE_TITLE);}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set("title","");}},validator:function(N){return YAHOO.lang.isBoolean(N)&&!this.get("disabled");}});this.setAttributeConfig("disabled",{value:K.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(N){if(N===true){E.addClass(this.get("element"),this.DISABLED_CLASSNAME);}else{E.removeClass(this.get("element"),this.DISABLED_CLASSNAME);}},validator:YAHOO.lang.isBoolean});this.setAttributeConfig("href",{value:K.href||this.getElementsByTagName("a")[0].getAttribute("href",2)||"#",method:function(N){this.getElementsByTagName("a")[0].href=N;},validator:YAHOO.lang.isString});this.setAttributeConfig("contentVisible",{value:K.contentVisible,method:function(N){if(N){this.get("contentEl").style.display="block";if(this.get("dataSrc")){if(!this._loading&&!(this.get("dataLoaded")&&this.get("cacheData"))){A.call(this);}}}else{this.get("contentEl").style.display="none";}},validator:YAHOO.lang.isBoolean});};var H=function(K){var O=document.createElement("li");var L=document.createElement("a");L.href=K.href||"#";O.appendChild(L);var N=K.label||null;var M=K.labelEl||null;if(M){if(!N){N=D.call(this,M);}}else{M=I.call(this);}L.appendChild(M);return O;};var G=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var I=function(){var K=document.createElement(this.LABEL_TAGNAME);return K;};var C=function(K){var L=this.get("labelEl");L.innerHTML=K;};var D=function(){var K,L=this.get("labelEl");if(!L){return undefined;}return L.innerHTML;};var A=function(){if(!YAHOO.util.Connect){return false;}E.addClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=true;this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get("loadMethod"),this.get("dataSrc"),{success:function(K){this.loadHandler.success.call(this,K);this.set("dataLoaded",true);this.dataConnection=null;E.removeClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=false;},failure:function(K){this.loadHandler.failure.call(this,K);this.dataConnection=null;E.removeClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=false;},scope:this,timeout:this.get("dataTimeout")});};YAHOO.widget.Tab=B;})();YAHOO.register("tabview",YAHOO.widget.TabView,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 52d3caa8d9a5f0e0807286aefddf94a5ff0c5b9b..fba43017881a1b83914797a27aa35bc09ea320e6 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 (function() {
 
@@ -271,7 +271,7 @@ version: 2.3.0
         
         /**
          * The Tabs belonging to the TabView instance.
-         * @config tabs
+         * @attribute tabs
          * @type Array
          */
         this.setAttributeConfig('tabs', {
@@ -301,7 +301,7 @@ version: 2.3.0
         
         /**
          * How the Tabs should be oriented relative to the TabView.
-         * @config orientation
+         * @attribute orientation
          * @type String
          * @default "top"
          */
@@ -325,7 +325,7 @@ version: 2.3.0
         
         /**
          * The index of the tab currently active.
-         * @config activeIndex
+         * @attribute activeIndex
          * @type Int
          */
         this.setAttributeConfig('activeIndex', {
@@ -340,7 +340,7 @@ version: 2.3.0
         
         /**
          * The tab currently active.
-         * @config activeTab
+         * @attribute activeTab
          * @type YAHOO.widget.Tab
          */
         this.setAttributeConfig('activeTab', {
@@ -463,70 +463,6 @@ version: 2.3.0
         
         return nodes;
     };
-
-/**
- * Fires before the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the currently active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the tab to be made active</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
- * @event beforeActiveTabChange
- */
-    
-/**
- * Fires after the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> activeTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the formerly active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the new active tab</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('activeTabChange', handler);</code></p>
- * @event activeTabChange
- */
-/**
- * Fires before the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the current orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation to be applied</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeOrientationChange', handler);</code></p>
- * @event beforeOrientationChange
- */
-    
-/**
- * Fires after the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> orientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the former orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('orientationChange', handler);</code></p>
- * @event orientationChange
- */
 })();
 
 (function() {
@@ -582,10 +518,18 @@ version: 2.3.0
      * The class name applied to active tabs.
      * @property ACTIVE_CLASSNAME
      * @type String
-     * @default "on"
+     * @default "selected"
      */
     proto.ACTIVE_CLASSNAME = 'selected';
     
+    /**
+     * The title applied to active tabs.
+     * @property ACTIVE_TITLE
+     * @type String
+     * @default "active"
+     */
+    proto.ACTIVE_TITLE = 'active';
+
     /**
      * The class name applied to disabled tabs.
      * @property DISABLED_CLASSNAME
@@ -643,7 +587,7 @@ version: 2.3.0
         
         /**
          * The event that triggers the tab's activation.
-         * @config activationEvent
+         * @attribute activationEvent
          * @type String
          */
         this.setAttributeConfig('activationEvent', {
@@ -652,7 +596,7 @@ version: 2.3.0
 
         /**
          * The element that contains the tab's label.
-         * @config labelEl
+         * @attribute labelEl
          * @type HTMLElement
          */
         this.setAttributeConfig('labelEl', {
@@ -676,7 +620,7 @@ version: 2.3.0
 
         /**
          * The tab's label text (or innerHTML).
-         * @config label
+         * @attribute label
          * @type String
          */
         this.setAttributeConfig('label', {
@@ -693,7 +637,7 @@ version: 2.3.0
         
         /**
          * The HTMLElement that contains the tab's content.
-         * @config contentEl
+         * @attribute contentEl
          * @type HTMLElement
          */
         this.setAttributeConfig('contentEl', {
@@ -712,7 +656,7 @@ version: 2.3.0
         
         /**
          * The tab's content.
-         * @config content
+         * @attribute content
          * @type String
          */
         this.setAttributeConfig('content', {
@@ -726,7 +670,7 @@ version: 2.3.0
         
         /**
          * The tab's data source, used for loading content dynamically.
-         * @config dataSrc
+         * @attribute dataSrc
          * @type String
          */
         this.setAttributeConfig('dataSrc', {
@@ -735,7 +679,7 @@ version: 2.3.0
         
         /**
          * Whether or not content should be reloaded for every view.
-         * @config cacheData
+         * @attribute cacheData
          * @type Boolean
          * @default false
          */
@@ -746,7 +690,7 @@ version: 2.3.0
         
         /**
          * The method to use for the data request.
-         * @config loadMethod
+         * @attribute loadMethod
          * @type String
          * @default "GET"
          */
@@ -757,7 +701,7 @@ version: 2.3.0
 
         /**
          * Whether or not any data has been loaded from the server.
-         * @config dataLoaded
+         * @attribute dataLoaded
          * @type Boolean
          */        
         this.setAttributeConfig('dataLoaded', {
@@ -768,7 +712,7 @@ version: 2.3.0
         
         /**
          * Number if milliseconds before aborting and calling failure handler.
-         * @config dataTimeout
+         * @attribute dataTimeout
          * @type Number
          * @default null
          */
@@ -781,7 +725,7 @@ version: 2.3.0
          * Whether or not the tab is currently active.
          * If a dataSrc is set for the tab, the content will be loaded from
          * the given source.
-         * @config active
+         * @attribute active
          * @type Boolean
          */
         this.setAttributeConfig('active', {
@@ -789,7 +733,7 @@ version: 2.3.0
             method: function(value) {
                 if (value === true) {
                     this.addClass(this.ACTIVE_CLASSNAME);
-                    this.set('title', 'active');
+                    this.set('title', this.ACTIVE_TITLE);
                 } else {
                     this.removeClass(this.ACTIVE_CLASSNAME);
                     this.set('title', '');
@@ -802,7 +746,7 @@ version: 2.3.0
         
         /**
          * Whether or not the tab is disabled.
-         * @config disabled
+         * @attribute disabled
          * @type Boolean
          */
         this.setAttributeConfig('disabled', {
@@ -819,7 +763,7 @@ version: 2.3.0
         
         /**
          * The href of the tab's anchor element.
-         * @config href
+         * @attribute href
          * @type String
          * @default '#'
          */
@@ -834,7 +778,7 @@ version: 2.3.0
         
         /**
          * The Whether or not the tab's content is visible.
-         * @config contentVisible
+         * @attribute contentVisible
          * @type Boolean
          * @default false
          */
@@ -940,102 +884,6 @@ version: 2.3.0
     };
     
     YAHOO.widget.Tab = Tab;
-    
-    /**
-     * Fires before the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeActiveChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeActiveChange', handler);</code></p>
-     * @event beforeActiveChange
-     */
-        
-    /**
-     * Fires after the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> activeChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('activeChange', handler);</code></p>
-     * @event activeChange
-     */
-     
-    /**
-     * Fires before the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeLabelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeLabelChange', handler);</code></p>
-     * @event beforeLabelChange
-     */
-        
-    /**
-     * Fires after the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> labelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('labelChange', handler);</code></p>
-     * @event labelChange
-     */
-     
-    /**
-     * Fires before the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeContentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeContentChange', handler);</code></p>
-     * @event beforeContentChange
-     */
-        
-    /**
-     * Fires after the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> contentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('contentChange', handler);</code></p>
-     * @event contentChange
-     */
 })();
 
-YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.3.0", build: "442"});
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.5.0", build: "895"});
index 5dcd37ee9ce6c1951d6cb4769c9ea59c1466dc98..8037f9ad9dfb031b8fc31c0f741e31302b16dcc5 100755 (executable)
@@ -1,15 +1,50 @@
 TreeView - Release Notes
 
+2.5.0
+  * Added isLeaf property to Node that allows dynamically loaded trees to
+    have nodes that are not dynamically loaded (without configuring dynamic
+    load for each individual dynamic node, which was the requirement previously).  
+    If set to true, dynamic loading will be disabled for the node and it 
+    will always have the leaf node presentation (rather than the expand icon).
+  * Made CSS adjustments to work with base.css
+  * HTMLNode: removed unused property 'content', and documented the correct
+    property 'html'.
+
+2.4.0
+  * added TreeView getNodeByElement, which will return a YAHOO.widget.Node 
+    reference for any ancestor HTML element of a node in the tree.
+  * Added 'title' property to TextNode
+  * Added treeview/tooltip example
+  * Passing a null or invalid animation type to setExpandAnim/setCollapseAnim
+    will turn off animation for the tree.
+  * Spacer style set to 12px width to fix layout inside overflow containers.
+  * Fixed removeAll() when executed on the root node.
+  * TextNode's href property is now escaped.
+  * The 'expanded' property in a node's constructor now works for dynamically
+    loaded nodes.
+
+2.3.1
+
+  * The "expand" event no longer fires twice for dynamically loaded nodes.
+
+  * Added setHtml() to HTMLNode, which will synchronize the html and data
+    properties, as well as the content of the node if it has been rendered.
+
 2.3.0
+
   * The image preload feature was restored.
+
   * Added the new skin
+
   * Leaf nodes created with expanded=true have the child div hidden initially
     to work around an IE rendering issue.
 
 2.2.2
+
   * No change
 
 2.2.1
+
   * Fixed the default value in the documentation for the nowrap property in Node
     (the default value is false).
 
index 8a2682065c3b2e0fba656cc899443d3041e48fdd..854c39c01c0cb3ccbf5507174a8a332a3158da8f 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* first or middle sibling, no children */
 .ygtvtn {
@@ -101,4 +101,4 @@ version: 2.3.0
     background-color: white;
 }
 
-.ygtvspacer { height: 22px; width: 18px; }
+.ygtvspacer { height: 22px; width: 12px; }
index b82d34e6e8ff9f8b07173a014b2f79b8f126b0f8..447c4a5e881017d12e770e836e267a612d74212a 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:12px;}
diff --git a/lib/yui/treeview/assets/sprite-menu.gif b/lib/yui/treeview/assets/sprite-menu.gif
new file mode 100644 (file)
index 0000000..261ed91
Binary files /dev/null and b/lib/yui/treeview/assets/sprite-menu.gif differ
index 5aa3015efec53e0f6343b326a6d0a85cb47c12f3..a6742cc627c962cfe028f92be8d8c12a65fb174b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
diff --git a/lib/yui/treeview/assets/treeview-menu.css b/lib/yui/treeview/assets/treeview-menu.css
new file mode 100644 (file)
index 0000000..96e597d
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/* first or middle sibling, no children */
+.ygtvtn {
+       width:1em; height:20px; background:none
+}
+
+/* first or middle sibling, collapsable */
+.ygtvtm {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px 2px no-repeat; 
+}
+
+/* first or middle sibling, collapsable, hover */
+.ygtvtmh {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -77px no-repeat; 
+}
+
+/* first or middle sibling, expandable */
+.ygtvtp {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -315px no-repeat; 
+}
+
+/* first or middle sibling, expandable, hover */
+.ygtvtph {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -395px no-repeat; 
+}
+
+/* last sibling, no children */
+.ygtvln {
+       width:1em; height:20px; background:none
+}
+
+/* Last sibling, collapsable */
+.ygtvlm {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px 2px no-repeat; 
+}
+
+/* Last sibling, collapsable, hover */
+.ygtvlmh {
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -77px no-repeat; 
+}
+
+/* Last sibling, expandable */
+.ygtvlp { 
+       width:1em; height:20px; 
+       cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -315px no-repeat; 
+}
+
+/* Last sibling, expandable, hover */
+.ygtvlph { 
+       width:1em; height:20px; cursor:pointer ;
+       background: url(sprite-menu.gif) -8px -395px no-repeat; 
+}
+
+/* Loading icon */
+.ygtvloading { 
+       width:1em; height:20px; 
+       background: url(treeview-loading.gif) 0 0 no-repeat; 
+}
+
+/* the style for the empty cells that are used for rendering the depth 
+ * of the node */
+.ygtvdepthcell { width:1em; height:20px; background:none}
+
+.ygtvblankdepthcell { width:1em; height:20px; }
+
+/* the style of the div around each node */
+.ygtvitem { border: 0px solid grey; }  
+
+/* the style of the div around each node's collection of children */
+.ygtvchildren {  }  
+* html .ygtvchildren { height:2%; }  
+
+.ygtvitem  table{
+    margin-bottom:0;
+}
+.ygtvitem  td {
+    border:none;padding:0;
+} 
+
+/* the style of the text label in ygTextNode */
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { 
+       margin-left:2px;
+       text-decoration: none;
+    background-color: white; /* workaround for IE font smoothing bug */
+}
+
+.ygtvspacer { height: 20px; width: 12px; width: 1em; }
index f4e86e40e6f006c9666826e5cc62cb0012563733..9463550812b92565851b0c1bbef15e03267470ba 100755 (executable)
@@ -1,10 +1,11 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /* first or middle sibling, no children */
+
 .ygtvtn {
        width:18px; height:22px; 
        background: url(sprite-orig.gif) 0 -5600px no-repeat; 
@@ -89,6 +90,14 @@ version: 2.3.0
 /* the style of the div around each node */
 .ygtvitem { }  
 
+
+.ygtvitem  table{
+    margin-bottom:0;
+}
+.ygtvitem  td {
+    border:none;padding:0;
+} 
+
 /* the style of the div around each node's collection of children */
 .ygtvchildren {  }  
 * html .ygtvchildren { height:2%; }  
@@ -100,4 +109,4 @@ version: 2.3.0
     background-color: white; /* workaround for IE font smoothing bug */
 }
 
-.ygtvspacer { height: 22px; width: 18px; }
+.ygtvspacer { height: 22px; width: 12px; }
index 1d6c31a6a6ba116ec92be7cd4943a28e4e1654cb..89d4557b07770d5254d7ee103820e134d5dbe955 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The treeview widget is a generic tree building tool.
@@ -97,9 +97,7 @@ YAHOO.widget.TreeView.prototype = {
      * in YAHOO.widget.TVAnim)
      */
     setExpandAnim: function(type) {
-        if (YAHOO.widget.TVAnim.isValid(type)) {
-            this._expandAnim = type;
-        }
+        this._expandAnim = (YAHOO.widget.TVAnim.isValid(type)) ? type : null;
     },
 
     /**
@@ -109,9 +107,7 @@ YAHOO.widget.TreeView.prototype = {
      * YAHOO.widget.TVAnim)
      */
     setCollapseAnim: function(type) {
-        if (YAHOO.widget.TVAnim.isValid(type)) {
-            this._collapseAnim = type;
-        }
+        this._collapseAnim = (YAHOO.widget.TVAnim.isValid(type)) ? type : null;
     },
 
     /**
@@ -427,6 +423,39 @@ YAHOO.widget.TreeView.prototype = {
         return (values.length) ? values : null;
     },
 
+    /**
+     * Returns the treeview node reference for an anscestor element
+     * of the node, or null if it is not contained within any node
+     * in this tree.
+     * @method getNodeByElement
+     * @param {HTMLElement} the element to test
+     * @return {YAHOO.widget.Node} a node reference or null
+     */
+    getNodeByElement: function(el) {
+
+        var p=el, m, re=/ygtv([^\d]*)(.*)/;
+
+        do {
+
+            if (p && p.id) {
+                m = p.id.match(re);
+                if (m && m[2]) {
+                    return this.getNodeByIndex(m[2]);
+                }
+            }
+
+            p = p.parentNode;
+
+            if (!p || !p.tagName) {
+                break;
+            }
+
+        } 
+        while (p.id !== this.id && p.tagName.toLowerCase() !== "body");
+
+        return null;
+    },
+
     /**
      * Removes the node and its children, and optionally refreshes the 
      * branch of the tree that was affected.
@@ -459,6 +488,18 @@ YAHOO.widget.TreeView.prototype = {
         return true;
     },
 
+    /**
+     * wait until the animation is complete before deleting 
+     * to avoid javascript errors
+     * @method _removeChildren_animComplete
+     * @param o the custom event payload
+     * @private
+     */
+    _removeChildren_animComplete: function(o) {
+        this.unsubscribe(this._removeChildren_animComplete);
+        this.removeChildren(o.node);
+    },
+
     /**
      * Deletes this nodes child collection, recursively.  Also collapses
      * the node, and resets the dynamic load flag.  The primary use for
@@ -468,18 +509,33 @@ YAHOO.widget.TreeView.prototype = {
      * @param {Node} node the node to purge
      */
     removeChildren: function(node) { 
+
+        if (node.expanded) {
+            // wait until the animation is complete before deleting to
+            // avoid javascript errors
+            if (this._collapseAnim) {
+                this.subscribe("animComplete", 
+                        this._removeChildren_animComplete, this, true);
+                YAHOO.widget.Node.prototype.collapse.call(node);
+                return;
+            }
+
+            node.collapse();
+        }
+
         this.logger.log("Removing children for " + node);
         while (node.children.length) {
             this._deleteNode(node.children[0]);
         }
 
+        if (node.isRoot()) {
+            YAHOO.widget.Node.prototype.expand.call(node);
+        }
+
         node.childrenRendered = false;
         node.dynamicLoadComplete = false;
-        if (node.expanded) {
-            node.collapse();
-        } else {
-            node.updateIcon();
-        }
+
+        node.updateIcon();
     },
 
     /**
@@ -721,7 +777,8 @@ YAHOO.widget.TreeView.addHandler(window,
  * @class Node
  * @uses YAHOO.util.EventProvider
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node, and any custom attributes that should be
+ * stored with the node (which is available in noderef.data).
  * @param oParent {Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @constructor
@@ -895,6 +952,17 @@ YAHOO.widget.Node.prototype = {
      */
     nowrap: false,
 
+    /**
+     * If true, the node will alway be rendered as a leaf node.  This can be
+     * used to override the presentation when dynamically loading the entire
+     * tree.  Setting this to true also disables the dynamic load call for the
+     * node.
+     * @property isLeaf
+     * @type boolean
+     * @default false
+     */
+    isLeaf: false,
+
     /**
      * The node type
      * @property _type
@@ -1291,19 +1359,28 @@ YAHOO.widget.Node.prototype = {
      * toggle style, and collapses its siblings if multiExpand is not set.
      * @method expand
      */
-    expand: function() {
+    expand: function(lazySource) {
         // Only expand if currently collapsed.
-        if (this.expanded) { return; }
+        if (this.expanded && !lazySource) { 
+            return; 
+        }
 
-        // fire the expand event handler
-        var ret = this.tree.onExpand(this);
+        var ret = true;
 
-        if (false === ret) {
-            this.logger.log("Expand was stopped by the abstract onExpand");
-            return;
+        // When returning from the lazy load handler, expand is called again
+        // in order to render the new children.  The "expand" event already
+        // fired before fething the new data, so we need to skip it now.
+        if (!lazySource) {
+            // fire the expand event handler
+            ret = this.tree.onExpand(this);
+
+            if (false === ret) {
+                this.logger.log("Expand was stopped by the abstract onExpand");
+                return;
+            }
+            
+            ret = this.tree.fireEvent("expand", this);
         }
-        
-        ret = this.tree.fireEvent("expand", this);
 
         if (false === ret) {
             this.logger.log("Expand was stopped by the custom event handler");
@@ -1315,11 +1392,11 @@ YAHOO.widget.Node.prototype = {
             return;
         }
 
-        if (! this.childrenRendered) {
+        if (!this.childrenRendered) {
             this.logger.log("children not rendered yet");
             this.getChildrenEl().innerHTML = this.renderChildren();
         } else {
-            this.logger.log("CHILDREN RENDERED");
+            this.logger.log("children already rendered");
         }
 
         this.expanded = true;
@@ -1473,14 +1550,19 @@ YAHOO.widget.Node.prototype = {
      * @return {boolean} true if this node's children are to be loaded dynamically
      */
     isDynamic: function() { 
-        var lazy = (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));
-        // this.logger.log("isDynamic: " + lazy);
-        return lazy;
+        if (this.isLeaf) {
+            return false;
+        } else {
+            return (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));
+            // this.logger.log("isDynamic: " + lazy);
+            // return lazy;
+        }
     },
 
     /**
      * Returns the current icon mode.  This refers to the way childless dynamic
-     * load nodes appear.
+     * load nodes appear (this comes into play only after the initial dynamic
+     * load request produced no children).
      * @method getIconMode
      * @return {int} 0 for collapse style, 1 for leaf node style
      */
@@ -1501,8 +1583,12 @@ YAHOO.widget.Node.prototype = {
      * checking for this condition.
      */
     hasChildren: function(checkForLazyLoad) { 
-        return ( this.children.length > 0 || 
-                (checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );
+        if (this.isLeaf) {
+            return false;
+        } else {
+            return ( this.children.length > 0 || 
+(checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );
+        }
     },
 
     /**
@@ -1555,6 +1641,12 @@ YAHOO.widget.Node.prototype = {
         }
         sb[sb.length] = '>';
 
+        // this.logger.log(["index", this.index, 
+                         // "hasChildren", this.hasChildren(true), 
+                         // "expanded", this.expanded, 
+                         // "renderHidden", this.renderHidden, 
+                         // "isDynamic", this.isDynamic()]);
+
         // Don't render the actual child node HTML unless this node is expanded.
         if ( (this.hasChildren(true) && this.expanded) ||
                 (this.renderHidden && !this.isDynamic()) ) {
@@ -1642,11 +1734,11 @@ YAHOO.widget.Node.prototype = {
      * @method loadComplete
      */
     loadComplete: function() {
-        this.logger.log("loadComplete: " + this.index);
+        this.logger.log(this.index + " loadComplete, children: " + this.children.length);
         this.getChildrenEl().innerHTML = this.completeRender();
         this.dynamicLoadComplete = true;
         this.isLoading = false;
-        this.expand();
+        this.expand(true);
         this.tree.locked = false;
     },
 
@@ -1738,7 +1830,26 @@ YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);
  * @extends YAHOO.widget.Node
  * @constructor
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.
+ * Valid properties: 
+ * <dl>
+ *   <dt>label</dt>
+ *   <dd>The text for the node's label</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>href</dt>
+ *   <dd>The href for the node's label.  By default it is set to
+ *   expand/collapse the node.</dd>
+ *   <dt>target</dt>
+ *   <dd>The target attribute for the label anchor</dd>
+ *   <dt>style</dt>
+ *   <dd>A CSS class to apply to the label anchor</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  */
@@ -1815,7 +1926,7 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
         
         // update the link
         if (oData.href) {
-            this.href = oData.href;
+            this.href = encodeURI(oData.href);
         }
 
         // set the target
@@ -1827,6 +1938,10 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
             this.labelStyle = oData.style;
         }
 
+        if (oData.title) {
+            this.title = oData.title;
+        }
+
         this.labelElId = "ygtvlabelel" + this.index;
     },
 
@@ -1891,6 +2006,9 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
         sb[sb.length] = ' >';
         sb[sb.length] = '<a';
         sb[sb.length] = ' id="' + this.labelElId + '"';
+        if (this.title) {
+            sb[sb.length] = ' title="' + this.title + '"';
+        }
         sb[sb.length] = ' class="' + this.labelStyle + '"';
         sb[sb.length] = ' href="' + this.href + '"';
         sb[sb.length] = ' target="' + this.target + '"';
@@ -1984,11 +2102,22 @@ YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
  * @extends YAHOO.widget.Node
  * @constructor
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.  
+ * Valid configuration properties: 
+ * <dl>
+ *   <dt>html</dt>
+ *   <dd>The html content for the node</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @param hasIcon {boolean} specifies whether or not leaf nodes should
- * have an icon
+ * be rendered with or without a horizontal line line icon. If the icon
+ * is not displayed, the content fills the space it would have occupied.
+ * This option operates independently of the leaf node presentation logic
+ * for dynamic nodes.
  */
 YAHOO.widget.HTMLNode = function(oData, oParent, expanded, hasIcon) {
     if (oData) { 
@@ -2016,30 +2145,43 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
 
     /**
      * The HTML content to use for this node's display
-     * @property content
+     * @property html
      * @type string
      */
-    content: null,
+    html: null,
 
     /**
      * Sets up the node label
      * @property initContent
-     * @param {object} An html string or object containing an html property
-     * @param {boolean} hasIcon determines if the node will be rendered with an
+     * @param oData {object} An html string or object containing an html property
+     * @param hasIcon {boolean} determines if the node will be rendered with an
      * icon or not
      */
     initContent: function(oData, hasIcon) { 
-        if (typeof oData == "string") {
-            oData = { html: oData };
-        }
-
-        this.html = oData.html;
+        this.setHtml(oData);
         this.contentElId = "ygtvcontentel" + this.index;
         this.hasIcon = hasIcon;
 
         this.logger = new YAHOO.widget.LogWriter(this.toString());
     },
 
+    /**
+     * Synchronizes the node.data, node.html, and the node's content
+     * @property setHtml
+     * @param o {object} An html string or object containing an html property
+     */
+    setHtml: function(o) {
+
+        this.data = o;
+        this.html = (typeof o === "string") ? o : o.html;
+
+        var el = this.getContentEl();
+        if (el) {
+            el.innerHTML = this.html;
+        }
+
+    },
+
     /**
      * Returns the outer html element for this node's content
      * @method getContentEl
@@ -2104,7 +2246,26 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
  * @class MenuNode
  * @extends YAHOO.widget.TextNode
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.
+ * Valid properties: 
+ * <dl>
+ *   <dt>label</dt>
+ *   <dd>The text for the node's label</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>href</dt>
+ *   <dd>The href for the node's label.  By default it is set to
+ *   expand/collapse the node.</dd>
+ *   <dt>target</dt>
+ *   <dd>The target attribute for the label anchor</dd>
+ *   <dt>style</dt>
+ *   <dd>A CSS class to apply to the label anchor</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @constructor
@@ -2306,4 +2467,4 @@ YAHOO.widget.TVFadeOut.prototype = {
     }
 };
 
-YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.3.0", build: "442"});
+YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.5.0", build: "895"});
index 663cf728b85d1a92805d3b1485a1337deca6bcbd..6245a383dbe4ab02d886c49f3d15f0b5cfb564ac 100755 (executable)
@@ -1,71 +1,10 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._expandAnim=type;}},setCollapseAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._collapseAnim=type;}},animateExpand:function(el,node){if(this._expandAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){tree.expandComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"expand"});a.animate();}
-return true;}
-return false;},animateCollapse:function(el,node){if(this._collapseAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){tree.collapseComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"collapse"});a.animate();}
-return true;}
-return false;},expandComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"expand"});},collapseComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"collapse"});},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}
-this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);var LW=YAHOO.widget.LogWriter;},draw:function(){var html=this.root.getHtml();this.getEl().innerHTML=html;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}
-return this._el;},regNode:function(node){this._nodes[node.index]=node;},getRoot:function(){return this.root;},setDynamicLoad:function(fnDataLoader,iconMode){this.root.setDynamicLoad(fnDataLoader,iconMode);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(nodeIndex){var n=this._nodes[nodeIndex];return(n)?n:null;},getNodeByProperty:function(property,value){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){return n;}}
-return null;},getNodesByProperty:function(property,value){var values=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){values.push(n);}}
-return(values.length)?values:null;},removeNode:function(node,autoRefresh){if(node.isRoot()){return false;}
-var p=node.parent;if(p.parent){p=p.parent;}
-this._deleteNode(node);if(autoRefresh&&p&&p.childrenRendered){p.refresh();}
-return true;},removeChildren:function(node){while(node.children.length){this._deleteNode(node.children[0]);}
-node.childrenRendered=false;node.dynamicLoadComplete=false;if(node.expanded){node.collapse();}else{node.updateIcon();}},_deleteNode:function(node){this.removeChildren(node);this.popNode(node);},popNode:function(node){var p=node.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=node){a[a.length]=p.children[i];}}
-p.children=a;p.childrenRendered=false;if(node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}
-if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;}
-node.parent=null;node.previousSibling=null;node.nextSibling=null;node.tree=null;delete this._nodes[node.index];},toString:function(){return"TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;++YAHOO.widget.TreeView.counter;}
-return id;},onExpand:function(node){},onCollapse:function(node){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(treeId){var t=YAHOO.widget.TreeView.trees[treeId];return(t)?t:null;};YAHOO.widget.TreeView.getNode=function(treeId,nodeIndex){var t=YAHOO.widget.TreeView.getTree(treeId);return(t)?t.getNodeByIndex(nodeIndex):null;};YAHOO.widget.TreeView.addHandler=function(el,sType,fn){if(el.addEventListener){el.addEventListener(sType,fn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.removeHandler=function(el,sType,fn){if(el.removeEventListener){el.removeEventListener(sType,fn,false);}else if(el.detachEvent){el.detachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.preload=function(e,prefix){prefix=prefix||"ygtv";var styles=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=1;i<styles.length;i=i+1){sb[sb.length]='<span class="'+prefix+styles[i]+'">&#160;</span>';}
-var f=document.createElement("div");var s=f.style;s.className=prefix+styles[0];s.position="absolute";s.height="1px";s.width="1px";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);YAHOO.widget.TreeView.removeHandler(window,"load",YAHOO.widget.TreeView.preload);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,_type:"Node",init:function(oData,oParent,expanded){this.data=oData;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=expanded;this.createEvent("parentChange",this);if(oParent){oParent.appendChild(this);}},applyParent:function(parentNode){if(!parentNode){return false;}
-this.tree=parentNode.tree;this.parent=parentNode;this.depth=parentNode.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}
-this.tree.regNode(this);parentNode.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}
-this.fireEvent("parentChange");return true;},appendChild:function(childNode){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=childNode;childNode.previousSibling=sib;}
-this.children[this.children.length]=childNode;childNode.applyParent(this);if(this.childrenRendered&&this.expanded){this.getChildrenEl().style.display="";}
-return childNode;},appendTo:function(parentNode){return parentNode.appendChild(this);},insertBefore:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
-var refIndex=node.isChildOf(p);p.children.splice(refIndex,0,this);if(node.previousSibling){node.previousSibling.nextSibling=this;}
-this.previousSibling=node.previousSibling;this.nextSibling=node;node.previousSibling=this;this.applyParent(p);}
-return this;},insertAfter:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
-var refIndex=node.isChildOf(p);if(!node.nextSibling){this.nextSibling=null;return this.appendTo(p);}
-p.children.splice(refIndex+1,0,this);node.nextSibling.previousSibling=this;this.previousSibling=node;this.nextSibling=node.nextSibling;node.nextSibling=this;this.applyParent(p);}
-return this;},isChildOf:function(parentNode){if(parentNode&&parentNode.children){for(var i=0,len=parentNode.children.length;i<len;++i){if(parentNode.children[i]===this){return i;}}}
-return-1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+
-this.index+").toggle()";},collapse:function(){if(!this.expanded){return;}
-var ret=this.tree.onCollapse(this);if(false===ret){return;}
-ret=this.tree.fireEvent("collapse",this);if(false===ret){return;}
-if(!this.getEl()){this.expanded=false;}else{this.hideChildren();this.expanded=false;this.updateIcon();}
-ret=this.tree.fireEvent("collapseComplete",this);},expand:function(){if(this.expanded){return;}
-var ret=this.tree.onExpand(this);if(false===ret){return;}
-ret=this.tree.fireEvent("expand",this);if(false===ret){return;}
-if(!this.getEl()){this.expanded=true;return;}
-if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}
-this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return;}
-if(!this.multiExpand){var sibs=this.getSiblings();for(var i=0;i<sibs.length;++i){if(sibs[i]!=this&&sibs[i].expanded){sibs[i].collapse();}}}
-this.showChildren();ret=this.tree.fireEvent("expandComplete",this);},updateIcon:function(){if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var type="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){type=(this.expanded)?"m":"p";}
-return"ygtv"+loc+type;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}
-return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(fnDataLoader,iconMode){if(fnDataLoader){this.dataLoader=fnDataLoader;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}
-if(iconMode){this.iconMode=iconMode;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){var lazy=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return lazy;},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(checkForLazyLoad){return(this.children.length>0||(checkForLazyLoad&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var sb=[];sb[sb.length]='<div class="ygtvitem" id="'+this.getElId()+'">';sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]='</div>';return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvchildren"';sb[sb.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded||!this.hasChildren()){sb[sb.length]=' style="display:none;"';}
-sb[sb.length]='>';if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}
-sb[sb.length]='</div>';return sb.join("");},renderChildren:function(){var node=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){node.dataLoader(node,function(){node.loadComplete();});},10);}else if(this.tree.root.dataLoader){setTimeout(function(){node.tree.root.dataLoader(node,function(){node.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}
-return"";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){sb[sb.length]=this.children[i].getHtml();}
-this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(depth){if(depth>=this.depth||depth<0){return null;}
-var p=this.parent;while(p.depth>depth){p=p.parent;}
-return p;},getDepthStyle:function(depth){return(this.getAncestor(depth).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.TextNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(oData){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof oData=="string"){oData={label:oData};}
-this.label=oData.label;this.data.label=oData.label;if(oData.href){this.href=oData.href;}
-if(oData.target){this.target=oData.target;}
-if(oData.style){this.labelStyle=oData.style;}
-this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return document.getElementById(this.labelElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}
-var getNode='YAHOO.widget.TreeView.getNode(\''+
-this.tree.id+'\','+this.index+')';sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]=getNode+'.getStyle()"';}
-sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'">';sb[sb.length]='<div class="ygtvspacer">';sb[sb.length]='</div>';sb[sb.length]='</td>';sb[sb.length]='<td ';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]='<a';sb[sb.length]=' id="'+this.labelElId+'"';sb[sb.length]=' class="'+this.labelStyle+'"';sb[sb.length]=' href="'+this.href+'"';sb[sb.length]=' target="'+this.target+'"';sb[sb.length]=' onclick="return '+getNode+'.onLabelClick('+getNode+')"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getStyle()"';}
-sb[sb.length]=' >';sb[sb.length]=this.label;sb[sb.length]='</a>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},onLabelClick:function(me){return me.tree.fireEvent("labelClick",me);},toString:function(){return"TextNode ("+this.index+") "+this.label;}});YAHOO.widget.RootNode=function(oTree){this.init(null,null,true);this.tree=oTree;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return"";},toString:function(){return"RootNode";},loadComplete:function(){this.tree.draw();},collapse:function(){},expand:function(){}});YAHOO.widget.HTMLNode=function(oData,oParent,expanded,hasIcon){if(oData){this.init(oData,oParent,expanded);this.initContent(oData,hasIcon);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(oData,hasIcon){if(typeof oData=="string"){oData={html:oData};}
-this.html=oData.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=hasIcon;},getContentEl:function(){return document.getElementById(this.contentElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}
-if(this.hasIcon){sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getStyle()"';}
-sb[sb.length]='><div class="ygtvspacer"></div></td>';}
-sb[sb.length]='<td';sb[sb.length]=' id="'+this.contentElId+'"';sb[sb.length]=' class="'+this.contentStyle+'"';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]=this.html;sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},toString:function(){return"HTMLNode ("+this.index+")";}});YAHOO.widget.MenuNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}
-this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return"MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(type,el,callback){if(YAHOO.widget[type]){return new YAHOO.widget[type](el,callback);}else{return null;}},isValid:function(type){return(YAHOO.widget[type]);}};}();YAHOO.widget.TVFadeIn=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var tvanim=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var tvanim=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};YAHOO.register("treeview",YAHOO.widget.TreeView,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.widget.TreeView=function(A){if(A){this.init(A);}};YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(A){this._expandAnim=(YAHOO.widget.TVAnim.isValid(A))?A:null;},setCollapseAnim:function(A){this._collapseAnim=(YAHOO.widget.TVAnim.isValid(A))?A:null;},animateExpand:function(C,D){if(this._expandAnim&&this._animCount<this.maxAnim){var A=this;var B=YAHOO.widget.TVAnim.getAnim(this._expandAnim,C,function(){A.expandComplete(D);});if(B){++this._animCount;this.fireEvent("animStart",{"node":D,"type":"expand"});B.animate();}return true;}return false;},animateCollapse:function(C,D){if(this._collapseAnim&&this._animCount<this.maxAnim){var A=this;var B=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,C,function(){A.collapseComplete(D);});if(B){++this._animCount;this.fireEvent("animStart",{"node":D,"type":"collapse"});B.animate();}return true;}return false;},expandComplete:function(A){--this._animCount;this.fireEvent("animComplete",{"node":A,"type":"expand"});},collapseComplete:function(A){--this._animCount;this.fireEvent("animComplete",{"node":A,"type":"collapse"});},init:function(B){this.id=B;if("string"!==typeof B){this._el=B;this.id=this.generateId(B);}this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);var A=YAHOO.widget.LogWriter;},draw:function(){var A=this.root.getHtml();this.getEl().innerHTML=A;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}return this._el;},regNode:function(A){this._nodes[A.index]=A;},getRoot:function(){return this.root;},setDynamicLoad:function(A,B){this.root.setDynamicLoad(A,B);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(B){var A=this._nodes[B];return(A)?A:null;},getNodeByProperty:function(C,B){for(var A in this._nodes){var D=this._nodes[A];if(D.data&&B==D.data[C]){return D;}}return null;},getNodesByProperty:function(D,C){var A=[];for(var B in this._nodes){var E=this._nodes[B];if(E.data&&C==E.data[D]){A.push(E);}}return(A.length)?A:null;},getNodeByElement:function(C){var D=C,A,B=/ygtv([^\d]*)(.*)/;do{if(D&&D.id){A=D.id.match(B);if(A&&A[2]){return this.getNodeByIndex(A[2]);}}D=D.parentNode;if(!D||!D.tagName){break;}}while(D.id!==this.id&&D.tagName.toLowerCase()!=="body");return null;},removeNode:function(B,A){if(B.isRoot()){return false;}var C=B.parent;if(C.parent){C=C.parent;}this._deleteNode(B);if(A&&C&&C.childrenRendered){C.refresh();}return true;},_removeChildren_animComplete:function(A){this.unsubscribe(this._removeChildren_animComplete);this.removeChildren(A.node);},removeChildren:function(A){if(A.expanded){if(this._collapseAnim){this.subscribe("animComplete",this._removeChildren_animComplete,this,true);YAHOO.widget.Node.prototype.collapse.call(A);return ;}A.collapse();}while(A.children.length){this._deleteNode(A.children[0]);}if(A.isRoot()){YAHOO.widget.Node.prototype.expand.call(A);}A.childrenRendered=false;A.dynamicLoadComplete=false;A.updateIcon();},_deleteNode:function(A){this.removeChildren(A);this.popNode(A);},popNode:function(D){var E=D.parent;var B=[];for(var C=0,A=E.children.length;C<A;++C){if(E.children[C]!=D){B[B.length]=E.children[C];}}E.children=B;E.childrenRendered=false;if(D.previousSibling){D.previousSibling.nextSibling=D.nextSibling;}if(D.nextSibling){D.nextSibling.previousSibling=D.previousSibling;}D.parent=null;D.previousSibling=null;D.nextSibling=null;D.tree=null;delete this._nodes[D.index];},toString:function(){return"TreeView "+this.id;},generateId:function(A){var B=A.id;if(!B){B="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;++YAHOO.widget.TreeView.counter;}return B;},onExpand:function(A){},onCollapse:function(A){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(B){var A=YAHOO.widget.TreeView.trees[B];return(A)?A:null;};YAHOO.widget.TreeView.getNode=function(B,C){var A=YAHOO.widget.TreeView.getTree(B);return(A)?A.getNodeByIndex(C):null;};YAHOO.widget.TreeView.addHandler=function(B,C,A){if(B.addEventListener){B.addEventListener(C,A,false);}else{if(B.attachEvent){B.attachEvent("on"+C,A);}}};YAHOO.widget.TreeView.removeHandler=function(B,C,A){if(B.removeEventListener){B.removeEventListener(C,A,false);}else{if(B.detachEvent){B.detachEvent("on"+C,A);}}};YAHOO.widget.TreeView.preload=function(F,E){E=E||"ygtv";var C=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var G=[];for(var A=1;A<C.length;A=A+1){G[G.length]='<span class="'+E+C[A]+'">&#160;</span>';}var D=document.createElement("div");var B=D.style;B.className=E+C[0];B.position="absolute";B.height="1px";B.width="1px";B.top="-1000px";B.left="-1000px";D.innerHTML=G.join("");document.body.appendChild(D);YAHOO.widget.TreeView.removeHandler(window,"load",YAHOO.widget.TreeView.preload);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(C,B,A){if(C){this.init(C,B,A);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,isLeaf:false,_type:"Node",init:function(C,B,A){this.data=C;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=A;this.createEvent("parentChange",this);if(B){B.appendChild(this);}},applyParent:function(B){if(!B){return false;
+}this.tree=B.tree;this.parent=B;this.depth=B.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}this.tree.regNode(this);B.childrenRendered=false;for(var C=0,A=this.children.length;C<A;++C){this.children[C].applyParent(this);}this.fireEvent("parentChange");return true;},appendChild:function(B){if(this.hasChildren()){var A=this.children[this.children.length-1];A.nextSibling=B;B.previousSibling=A;}this.children[this.children.length]=B;B.applyParent(this);if(this.childrenRendered&&this.expanded){this.getChildrenEl().style.display="";}return B;},appendTo:function(A){return A.appendChild(this);},insertBefore:function(A){var C=A.parent;if(C){if(this.tree){this.tree.popNode(this);}var B=A.isChildOf(C);C.children.splice(B,0,this);if(A.previousSibling){A.previousSibling.nextSibling=this;}this.previousSibling=A.previousSibling;this.nextSibling=A;A.previousSibling=this;this.applyParent(C);}return this;},insertAfter:function(A){var C=A.parent;if(C){if(this.tree){this.tree.popNode(this);}var B=A.isChildOf(C);if(!A.nextSibling){this.nextSibling=null;return this.appendTo(C);}C.children.splice(B+1,0,this);A.nextSibling.previousSibling=this;this.previousSibling=A;this.nextSibling=A.nextSibling;A.nextSibling=this;this.applyParent(C);}return this;},isChildOf:function(B){if(B&&B.children){for(var C=0,A=B.children.length;C<A;++C){if(B.children[C]===this){return C;}}}return -1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return"YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+").toggle()";},collapse:function(){if(!this.expanded){return ;}var A=this.tree.onCollapse(this);if(false===A){return ;}A=this.tree.fireEvent("collapse",this);if(false===A){return ;}if(!this.getEl()){this.expanded=false;}else{this.hideChildren();this.expanded=false;this.updateIcon();}A=this.tree.fireEvent("collapseComplete",this);},expand:function(C){if(this.expanded&&!C){return ;}var A=true;if(!C){A=this.tree.onExpand(this);if(false===A){return ;}A=this.tree.fireEvent("expand",this);}if(false===A){return ;}if(!this.getEl()){this.expanded=true;return ;}if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return ;}if(!this.multiExpand){var D=this.getSiblings();for(var B=0;B<D.length;++B){if(D[B]!=this&&D[B].expanded){D[B].collapse();}}}this.showChildren();A=this.tree.fireEvent("expandComplete",this);},updateIcon:function(){if(this.hasIcon){var A=this.getToggleEl();if(A){A.className=this.getStyle();}}},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var B=(this.nextSibling)?"t":"l";var A="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){A=(this.expanded)?"m":"p";}return"ygtv"+B+A;}},getHoverStyle:function(){var A=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){A+="h";}return A;},expandAll:function(){for(var A=0;A<this.children.length;++A){var B=this.children[A];if(B.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else{if(!B.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{B.expand();B.expandAll();}}}},collapseAll:function(){for(var A=0;A<this.children.length;++A){this.children[A].collapse();this.children[A].collapseAll();}},setDynamicLoad:function(A,B){if(A){this.dataLoader=A;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}if(B){this.iconMode=B;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){if(this.isLeaf){return false;}else{return(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));}},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(A){if(this.isLeaf){return false;}else{return(this.children.length>0||(A&&this.isDynamic()&&!this.dynamicLoadComplete));}},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var A=[];A[A.length]='<div class="ygtvitem" id="'+this.getElId()+'">';A[A.length]=this.getNodeHtml();A[A.length]=this.getChildrenHtml();A[A.length]="</div>";return A.join("");},getChildrenHtml:function(){var A=[];A[A.length]='<div class="ygtvchildren"';A[A.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded||!this.hasChildren()){A[A.length]=' style="display:none;"';}A[A.length]=">";if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){A[A.length]=this.renderChildren();}A[A.length]="</div>";return A.join("");},renderChildren:function(){var A=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){A.dataLoader(A,function(){A.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){A.tree.root.dataLoader(A,function(){A.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}}return"";}else{return this.completeRender();}},completeRender:function(){var B=[];for(var A=0;A<this.children.length;++A){B[B.length]=this.children[A].getHtml();}this.childrenRendered=true;return B.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand(true);this.tree.locked=false;
+},getAncestor:function(B){if(B>=this.depth||B<0){return null;}var A=this.parent;while(A.depth>B){A=A.parent;}return A;},getDepthStyle:function(A){return(this.getAncestor(A).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var A=this.getToggleEl();if(A){A.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.TextNode=function(C,B,A){if(C){this.init(C,B,A);this.setUpLabel(C);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(A){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof A=="string"){A={label:A};}this.label=A.label;this.data.label=A.label;if(A.href){this.href=encodeURI(A.href);}if(A.target){this.target=A.target;}if(A.style){this.labelStyle=A.style;}if(A.title){this.title=A.title;}this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return document.getElementById(this.labelElId);},getNodeHtml:function(){var C=[];C[C.length]='<table border="0" cellpadding="0" cellspacing="0">';C[C.length]="<tr>";for(var A=0;A<this.depth;++A){C[C.length]='<td class="'+this.getDepthStyle(A)+'"><div class="ygtvspacer"></div></td>';}var B="YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+")";C[C.length]="<td";C[C.length]=' id="'+this.getToggleElId()+'"';C[C.length]=' class="'+this.getStyle()+'"';if(this.hasChildren(true)){C[C.length]=' onmouseover="this.className=';C[C.length]=B+'.getHoverStyle()"';C[C.length]=' onmouseout="this.className=';C[C.length]=B+'.getStyle()"';}C[C.length]=' onclick="javascript:'+this.getToggleLink()+'">';C[C.length]='<div class="ygtvspacer">';C[C.length]="</div>";C[C.length]="</td>";C[C.length]="<td ";C[C.length]=(this.nowrap)?' nowrap="nowrap" ':"";C[C.length]=" >";C[C.length]="<a";C[C.length]=' id="'+this.labelElId+'"';if(this.title){C[C.length]=' title="'+this.title+'"';}C[C.length]=' class="'+this.labelStyle+'"';C[C.length]=' href="'+this.href+'"';C[C.length]=' target="'+this.target+'"';C[C.length]=' onclick="return '+B+".onLabelClick("+B+')"';if(this.hasChildren(true)){C[C.length]=" onmouseover=\"document.getElementById('";C[C.length]=this.getToggleElId()+"').className=";C[C.length]=B+'.getHoverStyle()"';C[C.length]=" onmouseout=\"document.getElementById('";C[C.length]=this.getToggleElId()+"').className=";C[C.length]=B+'.getStyle()"';}C[C.length]=" >";C[C.length]=this.label;C[C.length]="</a>";C[C.length]="</td>";C[C.length]="</tr>";C[C.length]="</table>";return C.join("");},onLabelClick:function(A){return A.tree.fireEvent("labelClick",A);},toString:function(){return"TextNode ("+this.index+") "+this.label;}});YAHOO.widget.RootNode=function(A){this.init(null,null,true);this.tree=A;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return"";},toString:function(){return"RootNode";},loadComplete:function(){this.tree.draw();},collapse:function(){},expand:function(){}});YAHOO.widget.HTMLNode=function(D,C,B,A){if(D){this.init(D,C,B);this.initContent(D,A);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,html:null,initContent:function(B,A){this.setHtml(B);this.contentElId="ygtvcontentel"+this.index;this.hasIcon=A;},setHtml:function(B){this.data=B;this.html=(typeof B==="string")?B:B.html;var A=this.getContentEl();if(A){A.innerHTML=this.html;}},getContentEl:function(){return document.getElementById(this.contentElId);},getNodeHtml:function(){var B=[];B[B.length]='<table border="0" cellpadding="0" cellspacing="0">';B[B.length]="<tr>";for(var A=0;A<this.depth;++A){B[B.length]='<td class="'+this.getDepthStyle(A)+'"><div class="ygtvspacer"></div></td>';}if(this.hasIcon){B[B.length]="<td";B[B.length]=' id="'+this.getToggleElId()+'"';B[B.length]=' class="'+this.getStyle()+'"';B[B.length]=' onclick="javascript:'+this.getToggleLink()+'"';if(this.hasChildren(true)){B[B.length]=' onmouseover="this.className=';B[B.length]="YAHOO.widget.TreeView.getNode('";B[B.length]=this.tree.id+"',"+this.index+').getHoverStyle()"';B[B.length]=' onmouseout="this.className=';B[B.length]="YAHOO.widget.TreeView.getNode('";B[B.length]=this.tree.id+"',"+this.index+').getStyle()"';}B[B.length]='><div class="ygtvspacer"></div></td>';}B[B.length]="<td";B[B.length]=' id="'+this.contentElId+'"';B[B.length]=' class="'+this.contentStyle+'"';B[B.length]=(this.nowrap)?' nowrap="nowrap" ':"";B[B.length]=" >";B[B.length]=this.html;B[B.length]="</td>";B[B.length]="</tr>";B[B.length]="</table>";return B.join("");},toString:function(){return"HTMLNode ("+this.index+")";}});YAHOO.widget.MenuNode=function(C,B,A){if(C){this.init(C,B,A);this.setUpLabel(C);}this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return"MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(B,A,C){if(YAHOO.widget[B]){return new YAHOO.widget[B](A,C);}else{return null;}},isValid:function(A){return(YAHOO.widget[A]);}};}();YAHOO.widget.TVFadeIn=function(A,B){this.el=A;this.callback=B;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var D=this;var C=this.el.style;C.opacity=0.1;C.filter="alpha(opacity=10)";C.display="";var B=0.4;var A=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},B);A.onComplete.subscribe(function(){D.onComplete();});A.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(A,B){this.el=A;this.callback=B;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var C=this;var B=0.4;var A=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},B);A.onComplete.subscribe(function(){C.onComplete();
+});A.animate();},onComplete:function(){var A=this.el.style;A.display="none";A.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};YAHOO.register("treeview",YAHOO.widget.TreeView,{version:"2.5.0",build:"895"});
\ No newline at end of file
index d70fc295fc701693a468b719fec9e661d21991d8..82a0b7adb25b51f5e3b0b6f67b5dee0889b844a6 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The treeview widget is a generic tree building tool.
@@ -97,9 +97,7 @@ YAHOO.widget.TreeView.prototype = {
      * in YAHOO.widget.TVAnim)
      */
     setExpandAnim: function(type) {
-        if (YAHOO.widget.TVAnim.isValid(type)) {
-            this._expandAnim = type;
-        }
+        this._expandAnim = (YAHOO.widget.TVAnim.isValid(type)) ? type : null;
     },
 
     /**
@@ -109,9 +107,7 @@ YAHOO.widget.TreeView.prototype = {
      * YAHOO.widget.TVAnim)
      */
     setCollapseAnim: function(type) {
-        if (YAHOO.widget.TVAnim.isValid(type)) {
-            this._collapseAnim = type;
-        }
+        this._collapseAnim = (YAHOO.widget.TVAnim.isValid(type)) ? type : null;
     },
 
     /**
@@ -421,6 +417,39 @@ YAHOO.widget.TreeView.prototype = {
         return (values.length) ? values : null;
     },
 
+    /**
+     * Returns the treeview node reference for an anscestor element
+     * of the node, or null if it is not contained within any node
+     * in this tree.
+     * @method getNodeByElement
+     * @param {HTMLElement} the element to test
+     * @return {YAHOO.widget.Node} a node reference or null
+     */
+    getNodeByElement: function(el) {
+
+        var p=el, m, re=/ygtv([^\d]*)(.*)/;
+
+        do {
+
+            if (p && p.id) {
+                m = p.id.match(re);
+                if (m && m[2]) {
+                    return this.getNodeByIndex(m[2]);
+                }
+            }
+
+            p = p.parentNode;
+
+            if (!p || !p.tagName) {
+                break;
+            }
+
+        } 
+        while (p.id !== this.id && p.tagName.toLowerCase() !== "body");
+
+        return null;
+    },
+
     /**
      * Removes the node and its children, and optionally refreshes the 
      * branch of the tree that was affected.
@@ -453,6 +482,18 @@ YAHOO.widget.TreeView.prototype = {
         return true;
     },
 
+    /**
+     * wait until the animation is complete before deleting 
+     * to avoid javascript errors
+     * @method _removeChildren_animComplete
+     * @param o the custom event payload
+     * @private
+     */
+    _removeChildren_animComplete: function(o) {
+        this.unsubscribe(this._removeChildren_animComplete);
+        this.removeChildren(o.node);
+    },
+
     /**
      * Deletes this nodes child collection, recursively.  Also collapses
      * the node, and resets the dynamic load flag.  The primary use for
@@ -462,17 +503,32 @@ YAHOO.widget.TreeView.prototype = {
      * @param {Node} node the node to purge
      */
     removeChildren: function(node) { 
+
+        if (node.expanded) {
+            // wait until the animation is complete before deleting to
+            // avoid javascript errors
+            if (this._collapseAnim) {
+                this.subscribe("animComplete", 
+                        this._removeChildren_animComplete, this, true);
+                YAHOO.widget.Node.prototype.collapse.call(node);
+                return;
+            }
+
+            node.collapse();
+        }
+
         while (node.children.length) {
             this._deleteNode(node.children[0]);
         }
 
+        if (node.isRoot()) {
+            YAHOO.widget.Node.prototype.expand.call(node);
+        }
+
         node.childrenRendered = false;
         node.dynamicLoadComplete = false;
-        if (node.expanded) {
-            node.collapse();
-        } else {
-            node.updateIcon();
-        }
+
+        node.updateIcon();
     },
 
     /**
@@ -713,7 +769,8 @@ YAHOO.widget.TreeView.addHandler(window,
  * @class Node
  * @uses YAHOO.util.EventProvider
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node, and any custom attributes that should be
+ * stored with the node (which is available in noderef.data).
  * @param oParent {Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @constructor
@@ -887,6 +944,17 @@ YAHOO.widget.Node.prototype = {
      */
     nowrap: false,
 
+    /**
+     * If true, the node will alway be rendered as a leaf node.  This can be
+     * used to override the presentation when dynamically loading the entire
+     * tree.  Setting this to true also disables the dynamic load call for the
+     * node.
+     * @property isLeaf
+     * @type boolean
+     * @default false
+     */
+    isLeaf: false,
+
     /**
      * The node type
      * @property _type
@@ -1275,18 +1343,27 @@ YAHOO.widget.Node.prototype = {
      * toggle style, and collapses its siblings if multiExpand is not set.
      * @method expand
      */
-    expand: function() {
+    expand: function(lazySource) {
         // Only expand if currently collapsed.
-        if (this.expanded) { return; }
+        if (this.expanded && !lazySource) { 
+            return; 
+        }
 
-        // fire the expand event handler
-        var ret = this.tree.onExpand(this);
+        var ret = true;
 
-        if (false === ret) {
-            return;
+        // When returning from the lazy load handler, expand is called again
+        // in order to render the new children.  The "expand" event already
+        // fired before fething the new data, so we need to skip it now.
+        if (!lazySource) {
+            // fire the expand event handler
+            ret = this.tree.onExpand(this);
+
+            if (false === ret) {
+                return;
+            }
+            
+            ret = this.tree.fireEvent("expand", this);
         }
-        
-        ret = this.tree.fireEvent("expand", this);
 
         if (false === ret) {
             return;
@@ -1297,7 +1374,7 @@ YAHOO.widget.Node.prototype = {
             return;
         }
 
-        if (! this.childrenRendered) {
+        if (!this.childrenRendered) {
             this.getChildrenEl().innerHTML = this.renderChildren();
         } else {
         }
@@ -1450,13 +1527,18 @@ YAHOO.widget.Node.prototype = {
      * @return {boolean} true if this node's children are to be loaded dynamically
      */
     isDynamic: function() { 
-        var lazy = (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));
-        return lazy;
+        if (this.isLeaf) {
+            return false;
+        } else {
+            return (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));
+            // return lazy;
+        }
     },
 
     /**
      * Returns the current icon mode.  This refers to the way childless dynamic
-     * load nodes appear.
+     * load nodes appear (this comes into play only after the initial dynamic
+     * load request produced no children).
      * @method getIconMode
      * @return {int} 0 for collapse style, 1 for leaf node style
      */
@@ -1477,8 +1559,12 @@ YAHOO.widget.Node.prototype = {
      * checking for this condition.
      */
     hasChildren: function(checkForLazyLoad) { 
-        return ( this.children.length > 0 || 
-                (checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );
+        if (this.isLeaf) {
+            return false;
+        } else {
+            return ( this.children.length > 0 || 
+(checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );
+        }
     },
 
     /**
@@ -1531,6 +1617,7 @@ YAHOO.widget.Node.prototype = {
         }
         sb[sb.length] = '>';
 
+
         // Don't render the actual child node HTML unless this node is expanded.
         if ( (this.hasChildren(true) && this.expanded) ||
                 (this.renderHidden && !this.isDynamic()) ) {
@@ -1616,7 +1703,7 @@ YAHOO.widget.Node.prototype = {
         this.getChildrenEl().innerHTML = this.completeRender();
         this.dynamicLoadComplete = true;
         this.isLoading = false;
-        this.expand();
+        this.expand(true);
         this.tree.locked = false;
     },
 
@@ -1706,7 +1793,26 @@ YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);
  * @extends YAHOO.widget.Node
  * @constructor
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.
+ * Valid properties: 
+ * <dl>
+ *   <dt>label</dt>
+ *   <dd>The text for the node's label</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>href</dt>
+ *   <dd>The href for the node's label.  By default it is set to
+ *   expand/collapse the node.</dd>
+ *   <dt>target</dt>
+ *   <dd>The target attribute for the label anchor</dd>
+ *   <dt>style</dt>
+ *   <dd>A CSS class to apply to the label anchor</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  */
@@ -1782,7 +1888,7 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
         
         // update the link
         if (oData.href) {
-            this.href = oData.href;
+            this.href = encodeURI(oData.href);
         }
 
         // set the target
@@ -1794,6 +1900,10 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
             this.labelStyle = oData.style;
         }
 
+        if (oData.title) {
+            this.title = oData.title;
+        }
+
         this.labelElId = "ygtvlabelel" + this.index;
     },
 
@@ -1857,6 +1967,9 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
         sb[sb.length] = ' >';
         sb[sb.length] = '<a';
         sb[sb.length] = ' id="' + this.labelElId + '"';
+        if (this.title) {
+            sb[sb.length] = ' title="' + this.title + '"';
+        }
         sb[sb.length] = ' class="' + this.labelStyle + '"';
         sb[sb.length] = ' href="' + this.href + '"';
         sb[sb.length] = ' target="' + this.target + '"';
@@ -1949,11 +2062,22 @@ YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
  * @extends YAHOO.widget.Node
  * @constructor
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.  
+ * Valid configuration properties: 
+ * <dl>
+ *   <dt>html</dt>
+ *   <dd>The html content for the node</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @param hasIcon {boolean} specifies whether or not leaf nodes should
- * have an icon
+ * be rendered with or without a horizontal line line icon. If the icon
+ * is not displayed, the content fills the space it would have occupied.
+ * This option operates independently of the leaf node presentation logic
+ * for dynamic nodes.
  */
 YAHOO.widget.HTMLNode = function(oData, oParent, expanded, hasIcon) {
     if (oData) { 
@@ -1981,29 +2105,42 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
 
     /**
      * The HTML content to use for this node's display
-     * @property content
+     * @property html
      * @type string
      */
-    content: null,
+    html: null,
 
     /**
      * Sets up the node label
      * @property initContent
-     * @param {object} An html string or object containing an html property
-     * @param {boolean} hasIcon determines if the node will be rendered with an
+     * @param oData {object} An html string or object containing an html property
+     * @param hasIcon {boolean} determines if the node will be rendered with an
      * icon or not
      */
     initContent: function(oData, hasIcon) { 
-        if (typeof oData == "string") {
-            oData = { html: oData };
-        }
-
-        this.html = oData.html;
+        this.setHtml(oData);
         this.contentElId = "ygtvcontentel" + this.index;
         this.hasIcon = hasIcon;
 
     },
 
+    /**
+     * Synchronizes the node.data, node.html, and the node's content
+     * @property setHtml
+     * @param o {object} An html string or object containing an html property
+     */
+    setHtml: function(o) {
+
+        this.data = o;
+        this.html = (typeof o === "string") ? o : o.html;
+
+        var el = this.getContentEl();
+        if (el) {
+            el.innerHTML = this.html;
+        }
+
+    },
+
     /**
      * Returns the outer html element for this node's content
      * @method getContentEl
@@ -2067,7 +2204,26 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
  * @class MenuNode
  * @extends YAHOO.widget.TextNode
  * @param oData {object} a string or object containing the data that will
- * be used to render this node
+ * be used to render this node.
+ * Valid properties: 
+ * <dl>
+ *   <dt>label</dt>
+ *   <dd>The text for the node's label</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>title</dt>
+ *   <dd>The title attribute for the label anchor</dd>
+ *   <dt>href</dt>
+ *   <dd>The href for the node's label.  By default it is set to
+ *   expand/collapse the node.</dd>
+ *   <dt>target</dt>
+ *   <dd>The target attribute for the label anchor</dd>
+ *   <dt>style</dt>
+ *   <dd>A CSS class to apply to the label anchor</dd>
+ * </dl>
+ * All other attributes are made available in noderef.data, which
+ * can be used to store custom attributes.  TreeView.getNode(s)ByProperty
+ * can be used to retreive a node by one of the attributes.
  * @param oParent {YAHOO.widget.Node} this node's parent node
  * @param expanded {boolean} the initial expanded/collapsed state
  * @constructor
@@ -2266,4 +2422,4 @@ YAHOO.widget.TVFadeOut.prototype = {
     }
 };
 
-YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.3.0", build: "442"});
+YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/uploader/README b/lib/yui/uploader/README
new file mode 100644 (file)
index 0000000..f87a3b0
--- /dev/null
@@ -0,0 +1,4 @@
+YUI Library - Uploader - Release Notes
+
+2.5.0
+  * Experimental release
\ No newline at end of file
diff --git a/lib/yui/uploader/assets/uploader.swf b/lib/yui/uploader/assets/uploader.swf
new file mode 100644 (file)
index 0000000..ea4f94e
Binary files /dev/null and b/lib/yui/uploader/assets/uploader.swf differ
diff --git a/lib/yui/uploader/uploader-experimental-debug.js b/lib/yui/uploader/uploader-experimental-debug.js
new file mode 100644 (file)
index 0000000..1c2769c
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The YUI Uploader Control
+ * @module uploader
+ * @description <p>YUI Uploader provides file upload functionality that goes beyond the basic browser-based methods. 
+ * Specifically, the YUI Uploader allows for:
+ * <ol>
+ * <li> Multiple file selection in a single "Open File" dialog.</li>
+ * <li> File extension filters to facilitate the user's selection.</li>
+ * <li> Progress tracking for file uploads.</li>
+ * <li> A range of file metadata: filename, size, date created, date modified, and author.</li>
+ * <li> A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, etc.</li>
+ * <li> Inclusion of additional data in the file upload POST request.</li>
+ * <li> Faster file upload on broadband connections due to the modified SEND buffer size.</li>
+ * <li> Same-page server response upon completion of the file upload.</li>
+ * </ol>
+ * </p>
+ * @title Uploader
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ */
+/*!
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+if(typeof deconcept == "undefined") var deconcept = new Object();
+if(typeof deconcept.util == "undefined") deconcept.util = new Object();
+if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
+deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
+       if (!document.getElementById) { return; }
+       this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
+       this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
+       this.params = new Object();
+       this.variables = new Object();
+       this.attributes = new Array();
+       if(swf) { this.setAttribute('swf', swf); }
+       if(id) { this.setAttribute('id', id); }
+       if(w) { this.setAttribute('width', w); }
+       if(h) { this.setAttribute('height', h); }
+       if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
+       this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
+       if (!window.opera && document.all && this.installedVer.major > 7) {
+               // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
+               deconcept.SWFObject.doPrepUnload = true;
+       }
+       if(c) { this.addParam('bgcolor', c); }
+       var q = quality ? quality : 'high';
+       this.addParam('quality', q);
+       this.setAttribute('useExpressInstall', false);
+       this.setAttribute('doExpressInstall', false);
+       var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
+       this.setAttribute('xiRedirectUrl', xir);
+       this.setAttribute('redirectUrl', '');
+       if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
+}
+deconcept.SWFObject.prototype = {
+       useExpressInstall: function(path) {
+               this.xiSWFPath = !path ? "expressinstall.swf" : path;
+               this.setAttribute('useExpressInstall', true);
+       },
+       setAttribute: function(name, value){
+               this.attributes[name] = value;
+       },
+       getAttribute: function(name){
+               return this.attributes[name];
+       },
+       addParam: function(name, value){
+               this.params[name] = value;
+       },
+       getParams: function(){
+               return this.params;
+       },
+       addVariable: function(name, value){
+               this.variables[name] = value;
+       },
+       getVariable: function(name){
+               return this.variables[name];
+       },
+       getVariables: function(){
+               return this.variables;
+       },
+       getVariablePairs: function(){
+               var variablePairs = new Array();
+               var key;
+               var variables = this.getVariables();
+               for(key in variables){
+                       variablePairs[variablePairs.length] = key +"="+ variables[key];
+               }
+               return variablePairs;
+       },
+       getSWFHTML: function() {
+               var swfNode = "";
+               if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "PlugIn");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
+                       swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
+                       var params = this.getParams();
+                        for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
+                       var pairs = this.getVariablePairs().join("&");
+                        if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
+                       swfNode += '/>';
+               } else { // PC IE
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "ActiveX");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
+                       swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
+                       var params = this.getParams();
+                       for(var key in params) {
+                        swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
+                       }
+                       var pairs = this.getVariablePairs().join("&");
+                       if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
+                       swfNode += "</object>";
+               }
+               return swfNode;
+       },
+       write: function(elementId){
+               if(this.getAttribute('useExpressInstall')) {
+                       // check to see if we need to do an express install
+                       var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
+                       if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
+                               this.setAttribute('doExpressInstall', true);
+                               this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
+                               document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+                               this.addVariable("MMdoctitle", document.title);
+                       }
+               }
+               if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
+                       var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
+                       n.innerHTML = this.getSWFHTML();
+                       return true;
+               }else{
+                       if(this.getAttribute('redirectUrl') != "") {
+                               document.location.replace(this.getAttribute('redirectUrl'));
+                       }
+               }
+               return false;
+       }
+}
+
+/* ---- detection functions ---- */
+deconcept.SWFObjectUtil.getPlayerVersion = function(){
+       var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
+       if(navigator.plugins && navigator.mimeTypes.length){
+               var x = navigator.plugins["Shockwave Flash"];
+               if(x && x.description) {
+                       PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
+               }
+       }else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
+               var axo = 1;
+               var counter = 3;
+               while(axo) {
+                       try {
+                               counter++;
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
+//                             document.write("player v: "+ counter);
+                               PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
+                       } catch (e) {
+                               axo = null;
+                       }
+               }
+       } else { // Win IE (non mobile)
+               // do minor version lookup in IE, but avoid fp6 crashing issues
+               // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
+               try{
+                       var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+               }catch(e){
+                       try {
+                               var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                               PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
+                               axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
+                       } catch(e) {
+                               if (PlayerVersion.major == 6) {
+                                       return PlayerVersion;
+                               }
+                       }
+                       try {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+                       } catch(e) {}
+               }
+               if (axo != null) {
+                       PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
+               }
+       }
+       return PlayerVersion;
+}
+deconcept.PlayerVersion = function(arrVersion){
+       this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
+       this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
+       this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
+}
+deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
+       if(this.major < fv.major) return false;
+       if(this.major > fv.major) return true;
+       if(this.minor < fv.minor) return false;
+       if(this.minor > fv.minor) return true;
+       if(this.rev < fv.rev) return false;
+       return true;
+}
+/* ---- get value of query string param ---- */
+deconcept.util = {
+       getRequestParameter: function(param) {
+               var q = document.location.search || document.location.hash;
+               if (param == null) { return q; }
+               if(q) {
+                       var pairs = q.substring(1).split("&");
+                       for (var i=0; i < pairs.length; i++) {
+                               if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+                                       return pairs[i].substring((pairs[i].indexOf("=")+1));
+                               }
+                       }
+               }
+               return "";
+       }
+}
+/* fix for video streaming bug */
+deconcept.SWFObjectUtil.cleanupSWFs = function() {
+       var objects = document.getElementsByTagName("OBJECT");
+       for (var i = objects.length - 1; i >= 0; i--) {
+               objects[i].style.display = 'none';
+               for (var x in objects[i]) {
+                       if (typeof objects[i][x] == 'function') {
+                               objects[i][x] = function(){};
+                       }
+               }
+       }
+}
+// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
+if (deconcept.SWFObject.doPrepUnload) {
+       if (!deconcept.unloadSet) {
+               deconcept.SWFObjectUtil.prepUnload = function() {
+                       __flash_unloadHandler = function(){};
+                       __flash_savedUnloadHandler = function(){};
+                       window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
+               }
+               window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
+               deconcept.unloadSet = true;
+       }
+}
+/* add document.getElementById if needed (mobile IE < 5) */
+if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
+
+/* add some aliases for ease of use/backwards compatibility */
+var getQueryParamValue = deconcept.util.getRequestParameter;
+var FlashObject = deconcept.SWFObject; // for legacy support
+var SWFObject = deconcept.SWFObject;
+
+/**
+ * Wraps Flash embedding functionality and allows communication with SWF through
+ * attributes.
+ *
+ * @namespace YAHOO.widget
+ * @class FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
+ */
+YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
+{
+       // set up the initial events and attributes stuff
+       this._queue = this._queue || [];
+       this._events = this._events || {};
+       this._configs = this._configs || {};
+       attributes = attributes || {};
+       
+       //the Flash Player external interface code from Adobe doesn't play nicely
+       //with the default value, yui-gen, in IE
+       this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
+       attributes.version = attributes.version || "9.0.45";
+       attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
+       
+       //we can't use the initial attributes right away
+       //so save them for once the SWF finishes loading
+       this._attributes = attributes;
+       
+       this._swfURL = swfURL;
+       
+       //embed the SWF file in the page
+       this._embedSWF(this._swfURL, containerID, attributes.id, attributes.version, attributes.backgroundColor, attributes.expressInstall);
+       
+       /**
+        * Fires when the SWF is initialized and communication is possible.
+        * @event contentReady
+        */
+       this.createEvent("contentReady");
+};
+
+YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
+{
+       /**
+        * The URL of the SWF file.
+        * @property _swfURL
+        * @type String
+        * @private
+        */
+       _swfURL: null,
+
+       /**
+        * A reference to the embedded SWF file.
+        * @property _swf
+        * @private
+        */
+       _swf: null,
+
+       /**
+        * The id of this instance.
+        * @property _id
+        * @type String
+        * @private
+        */
+       _id: null,
+       
+       /**
+        * The initializing attributes are stored here until the SWF is ready.
+        * @property _attributes
+        * @type Object
+        * @private
+        */
+       _attributes: null, //the intializing attributes
+
+       /**
+        * Public accessor to the unique name of the FlashAdapter instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the FlashAdapter instance.
+        */
+       toString: function()
+       {
+               return "FlashAdapter " + this._id;
+       },
+
+       /**
+        * Embeds the SWF in the page and associates it with this instance.
+        *
+        * @method _embedSWF
+        * @private
+        */
+       _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall)
+       {
+               //standard SWFObject embed
+               var swfObj = new deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor, expressInstall);
+
+               //make sure we can communicate with ExternalInterface
+               swfObj.addParam("allowScriptAccess", "always");
+               
+               //again, a useful ExternalInterface trick
+               swfObj.addVariable("allowedDomain", document.location.hostname);
+
+               //tell the SWF which HTML element it is in
+               swfObj.addVariable("elementID", swfID);
+
+               // set the name of the function to call when the swf has an event
+               swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
+
+               var container = YAHOO.util.Dom.get(containerID);
+               var result = swfObj.write(container);
+               if(result)
+               {
+                       this._swf = YAHOO.util.Dom.get(swfID);
+                       //if successful, let's add an owner property to the SWF reference
+                       //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
+                       this._swf.owner = this;
+               }
+       },
+
+       /**
+        * Handles or re-dispatches events received from the SWF.
+        *
+        * @method _eventHandler
+        * @private
+        */
+       _eventHandler: function(event)
+       {
+               var type = event.type;
+               switch(type)
+               {
+                       case "swfReady":
+                       {
+                               this._loadHandler();
+                               return;
+                       }
+                       case "log":
+                       {
+                               return;
+                       }
+               }
+               
+               //be sure to return after your case or the event will automatically fire!
+               this.fireEvent(type, event);
+       },
+
+       /**
+        * Called when the SWF has been initialized.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._initAttributes(this._attributes);
+               this.setAttributes(this._attributes, true);
+               this._attributes = null;
+               
+               this.fireEvent("contentReady");
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               //should be overridden if other attributes need to be set up
+               
+               /**
+                * @attribute swfURL
+                * @description Absolute or relative URL to the SWF displayed by the FlashAdapter.
+                * @type String
+                */
+               this.getAttributeConfig("swfURL",
+               {
+                       method: this._getSWFURL
+               });
+       },
+       
+       /**
+        * Getter for swfURL attribute.
+        *
+        * @method _getSWFURL
+        * @private
+        */
+       _getSWFURL: function()
+       {
+               return this._swfURL;
+       }
+});
+
+/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of FlashAdapter.
+ *
+ * @method YAHOO.widget.FlashAdapter.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
+{
+       var loadedSWF = YAHOO.util.Dom.get(elementID);
+       if(!loadedSWF.owner)
+       {
+               //fix for ie: if owner doesn't exist yet, try again in a moment
+               setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
+       }
+       else loadedSWF.owner._eventHandler(event);
+};
+/**
+ * Uploader class for the YUI Uploader component.
+ *
+ * @namespace YAHOO.widget
+ * @class Uploader
+ * @uses YAHOO.widget.FlashAdapter
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ */
+YAHOO.widget.Uploader = function(containerId)
+{
+       YAHOO.widget.Uploader.superclass.constructor.call(this, YAHOO.widget.Uploader.SWFURL, containerId, null);
+       
+       /**
+        * Fires when the user has finished selecting files in the "Open File" dialog.
+        *
+        * @event fileSelect
+        * @param event.type {String} The event type
+        * @param event.fileList {Array} An array of objects with file information
+        * @param event.fileList[].size {Number} File size in bytes for a specific file in fileList
+        * @param event.fileList[].cDate {Date} Creation date for a specific file in fileList
+        * @param event.fileList[].mDate {Date} Modification date for a specific file in fileList
+        * @param event.fileList[].name {String} File name for a specific file in fileList
+        * @param event.fileList[].id {String} Unique file id of a specific file in fileList
+        */
+       this.createEvent("fileSelect");
+
+       /**
+        * Fires when an upload of a specific file has started.
+        *
+        * @event uploadStart
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file that's started to upload
+        */
+       this.createEvent("uploadStart");
+
+       /**
+        * Fires when new information about the upload progress for a specific file is available.
+        *
+        * @event uploadProgress
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file with which the upload progress data is associated
+        * @param bytesLoaded {Number} The number of bytes of the file uploaded so far
+        * @param bytesTotal {Number} The total size of the file
+        */
+       this.createEvent("uploadProgress");
+       
+       /**
+        * Fires when an upload for a specific file is cancelled.
+        *
+        * @event uploadCancel
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file with which the upload has been cancelled.
+        */     
+       this.createEvent("uploadCancel");
+
+       /**
+        * Fires when an upload for a specific file is complete.
+        *
+        * @event uploadComplete
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file for which the upload has been completed.
+        */     
+       this.createEvent("uploadComplete");
+
+       /**
+        * Fires when the server sends data in response to a completed upload.
+        *
+        * @event uploadCompleteData
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file for which the upload has been completed.
+        * @param event.data {String} The raw data returned by the server in response to the upload.
+        */     
+       this.createEvent("uploadCompleteData");
+       
+       /**
+        * Fires when an upload error occurs.
+        *
+        * @event uploadError
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file that was being uploaded when the error has occurred.
+        * @param event.status {String} The status message associated with the error.
+        */     
+       this.createEvent("uploadError");
+}
+
+/**
+ * Location of the Uploader SWF
+ *
+ * @property Chart.SWFURL
+ * @private
+ * @static
+ * @final
+ * @default "assets/Uploader.swf"
+ */
+YAHOO.widget.Uploader.SWFURL = "assets/uploader.swf";
+
+YAHOO.extend(YAHOO.widget.Uploader, YAHOO.widget.FlashAdapter,
+{
+/**
+ * Invokes the "Open File" dialog and allows the user to select the files for upload
+ *
+ * @param allowMultiple {Boolean} If true, allows for multiple file selection; if false, only a single file can be selected. False by default.
+ * @param extensionFilterArray {Array} An array of key-value pairs for permissible file extensions. The array elements should 
+ * be of the form: {description: "Images", extensions: "*.jpg, *.gif, *.png"}.
+ */
+       browse: function(allowMultiple,extensionFilterArray)
+       {
+               this._swf.browse(allowMultiple,extensionFilterArray);
+       },
+       
+/**
+ * Starts the upload of the file specified by fileID to the location specified by uploadScriptPath.
+ *
+ * @param fileID {String} The id of the file to start uploading.
+ * @param uploadScriptPath {String} The URL of the upload location.
+ * @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default.
+ * @param vars {Object} The object containing variables to be sent in the same request as the file upload.
+ * @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default.
+ */
+       upload: function(fileID, uploadScriptPath, method, vars, fieldName)
+       {
+               this._swf.upload(fileID, uploadScriptPath, method, vars, fieldName);
+       },
+       
+/**
+ * Starts uploading all files in the queue. If this function is called, the upload queue is automatically managed.
+ *
+ * @param uploadScriptPath {String} The URL of the upload location.
+ * @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default.
+ * @param vars {Object} The object containing variables to be sent in the same request as the file upload.
+ * @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default.
+ */
+       uploadAll: function(uploadScriptPath, method, vars, fieldName)
+       {
+               this._swf.uploadAll(uploadScriptPath, method, vars, fieldName);
+       },
+
+/**
+ * Cancels the upload of a specified file. If no file id is specified, all ongoing uploads are cancelled.
+ *
+ * @param fileID {String} The ID of the file whose upload should be cancelled.
+ */
+       cancel: function(fileID)
+       {
+               this._swf.cancel(fileID);
+       },
+
+/**
+ * Clears the list of files queued for upload.
+ *
+ */
+       clearFileList: function()
+       {
+               this._swf.clearFileList();
+       },
+       
+/**
+ * Removes the specified file from the upload queue. 
+ *
+ * @param fileID {String} The id of the file to remove from the upload queue. 
+ */
+       removeFile: function (fileID) 
+       {
+               this._swf.removeFile(fileID);
+       }
+});
+YAHOO.register("uploader", YAHOO.widget.Uploader, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/uploader/uploader-experimental-min.js b/lib/yui/uploader/uploader-experimental-min.js
new file mode 100644 (file)
index 0000000..87ab83f
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/*
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return ;}this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(E){this.setAttribute("swf",E);}if(C){this.setAttribute("id",C);}if(K){this.setAttribute("width",K);}if(F){this.setAttribute("height",F);}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(J){this.addParam("bgcolor",J);}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A);}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true);},setAttribute:function(A,B){this.attributes[A]=B;},getAttribute:function(A){return this.attributes[A];},addParam:function(A,B){this.params[A]=B;},getParams:function(){return this.params;},addVariable:function(A,B){this.variables[A]=B;},getVariable:function(A){return this.variables[A];},getVariables:function(){return this.variables;},getVariablePairs:function(){var A=new Array();var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B];}return A;},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var C=this.getParams();for(var A in C){D+=[A]+'="'+C[A]+'" ';}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"';}D+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var A in C){D+='<param name="'+A+'" value="'+C[A]+'" />';}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />';}D+="</object>";}return D;},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var D=1;var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0]);}catch(E){D=null;}}}else{try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(E){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always";}catch(E){if(C.major==6){return C;}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(E){}}if(D!=null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","));}}}return C;};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false;}if(this.major>A.major){return true;}if(this.minor<A.minor){return false;}if(this.minor>A.minor){return true;}if(this.rev<A.rev){return false;}return true;};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C;}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){};
+}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;YAHOO.widget.FlashAdapter=function(C,A,B){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};B=B||{};this._id=B.id=B.id||YAHOO.util.Dom.generateId(null,"yuigen");B.version=B.version||"9.0.45";B.backgroundColor=B.backgroundColor||"#ffffff";this._attributes=B;this._swfURL=C;this._embedSWF(this._swfURL,A,B.id,B.version,B.backgroundColor,B.expressInstall);this.createEvent("contentReady");};YAHOO.extend(YAHOO.widget.FlashAdapter,YAHOO.util.AttributeProvider,{_swfURL:null,_swf:null,_id:null,_attributes:null,toString:function(){return"FlashAdapter "+this._id;},_embedSWF:function(H,G,C,B,E,F){var D=new deconcept.SWFObject(H,C,"100%","100%",B,E,F);D.addParam("allowScriptAccess","always");D.addVariable("allowedDomain",document.location.hostname);D.addVariable("elementID",C);D.addVariable("eventHandler","YAHOO.widget.FlashAdapter.eventHandler");var A=YAHOO.util.Dom.get(G);var I=D.write(A);if(I){this._swf=YAHOO.util.Dom.get(C);this._swf.owner=this;}},_eventHandler:function(B){var A=B.type;switch(A){case"swfReady":this._loadHandler();return ;case"log":return ;}this.fireEvent(A,B);},_loadHandler:function(){this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._attributes=null;this.fireEvent("contentReady");},_initAttributes:function(A){this.getAttributeConfig("swfURL",{method:this._getSWFURL});},_getSWFURL:function(){return this._swfURL;}});YAHOO.widget.FlashAdapter.eventHandler=function(A,C){var B=YAHOO.util.Dom.get(A);if(!B.owner){setTimeout(function(){YAHOO.widget.FlashAdapter.eventHandler(A,C);},0);}else{B.owner._eventHandler(C);}};YAHOO.widget.Uploader=function(A){YAHOO.widget.Uploader.superclass.constructor.call(this,YAHOO.widget.Uploader.SWFURL,A,null);this.createEvent("fileSelect");this.createEvent("uploadStart");this.createEvent("uploadProgress");this.createEvent("uploadCancel");this.createEvent("uploadComplete");this.createEvent("uploadCompleteData");this.createEvent("uploadError");};YAHOO.widget.Uploader.SWFURL="assets/uploader.swf";YAHOO.extend(YAHOO.widget.Uploader,YAHOO.widget.FlashAdapter,{browse:function(B,A){this._swf.browse(B,A);},upload:function(A,B,E,C,D){this._swf.upload(A,B,E,C,D);},uploadAll:function(A,D,B,C){this._swf.uploadAll(A,D,B,C);},cancel:function(A){this._swf.cancel(A);},clearFileList:function(){this._swf.clearFileList();},removeFile:function(A){this._swf.removeFile(A);}});YAHOO.register("uploader",YAHOO.widget.Uploader,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/uploader/uploader-experimental.js b/lib/yui/uploader/uploader-experimental.js
new file mode 100644 (file)
index 0000000..1c2769c
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+/**
+ * The YUI Uploader Control
+ * @module uploader
+ * @description <p>YUI Uploader provides file upload functionality that goes beyond the basic browser-based methods. 
+ * Specifically, the YUI Uploader allows for:
+ * <ol>
+ * <li> Multiple file selection in a single "Open File" dialog.</li>
+ * <li> File extension filters to facilitate the user's selection.</li>
+ * <li> Progress tracking for file uploads.</li>
+ * <li> A range of file metadata: filename, size, date created, date modified, and author.</li>
+ * <li> A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, etc.</li>
+ * <li> Inclusion of additional data in the file upload POST request.</li>
+ * <li> Faster file upload on broadband connections due to the modified SEND buffer size.</li>
+ * <li> Same-page server response upon completion of the file upload.</li>
+ * </ol>
+ * </p>
+ * @title Uploader
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ */
+/*!
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+if(typeof deconcept == "undefined") var deconcept = new Object();
+if(typeof deconcept.util == "undefined") deconcept.util = new Object();
+if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
+deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
+       if (!document.getElementById) { return; }
+       this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
+       this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
+       this.params = new Object();
+       this.variables = new Object();
+       this.attributes = new Array();
+       if(swf) { this.setAttribute('swf', swf); }
+       if(id) { this.setAttribute('id', id); }
+       if(w) { this.setAttribute('width', w); }
+       if(h) { this.setAttribute('height', h); }
+       if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
+       this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
+       if (!window.opera && document.all && this.installedVer.major > 7) {
+               // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
+               deconcept.SWFObject.doPrepUnload = true;
+       }
+       if(c) { this.addParam('bgcolor', c); }
+       var q = quality ? quality : 'high';
+       this.addParam('quality', q);
+       this.setAttribute('useExpressInstall', false);
+       this.setAttribute('doExpressInstall', false);
+       var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
+       this.setAttribute('xiRedirectUrl', xir);
+       this.setAttribute('redirectUrl', '');
+       if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
+}
+deconcept.SWFObject.prototype = {
+       useExpressInstall: function(path) {
+               this.xiSWFPath = !path ? "expressinstall.swf" : path;
+               this.setAttribute('useExpressInstall', true);
+       },
+       setAttribute: function(name, value){
+               this.attributes[name] = value;
+       },
+       getAttribute: function(name){
+               return this.attributes[name];
+       },
+       addParam: function(name, value){
+               this.params[name] = value;
+       },
+       getParams: function(){
+               return this.params;
+       },
+       addVariable: function(name, value){
+               this.variables[name] = value;
+       },
+       getVariable: function(name){
+               return this.variables[name];
+       },
+       getVariables: function(){
+               return this.variables;
+       },
+       getVariablePairs: function(){
+               var variablePairs = new Array();
+               var key;
+               var variables = this.getVariables();
+               for(key in variables){
+                       variablePairs[variablePairs.length] = key +"="+ variables[key];
+               }
+               return variablePairs;
+       },
+       getSWFHTML: function() {
+               var swfNode = "";
+               if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "PlugIn");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
+                       swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
+                       var params = this.getParams();
+                        for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
+                       var pairs = this.getVariablePairs().join("&");
+                        if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
+                       swfNode += '/>';
+               } else { // PC IE
+                       if (this.getAttribute("doExpressInstall")) {
+                               this.addVariable("MMplayerType", "ActiveX");
+                               this.setAttribute('swf', this.xiSWFPath);
+                       }
+                       swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
+                       swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
+                       var params = this.getParams();
+                       for(var key in params) {
+                        swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
+                       }
+                       var pairs = this.getVariablePairs().join("&");
+                       if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
+                       swfNode += "</object>";
+               }
+               return swfNode;
+       },
+       write: function(elementId){
+               if(this.getAttribute('useExpressInstall')) {
+                       // check to see if we need to do an express install
+                       var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
+                       if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
+                               this.setAttribute('doExpressInstall', true);
+                               this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
+                               document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+                               this.addVariable("MMdoctitle", document.title);
+                       }
+               }
+               if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
+                       var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
+                       n.innerHTML = this.getSWFHTML();
+                       return true;
+               }else{
+                       if(this.getAttribute('redirectUrl') != "") {
+                               document.location.replace(this.getAttribute('redirectUrl'));
+                       }
+               }
+               return false;
+       }
+}
+
+/* ---- detection functions ---- */
+deconcept.SWFObjectUtil.getPlayerVersion = function(){
+       var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
+       if(navigator.plugins && navigator.mimeTypes.length){
+               var x = navigator.plugins["Shockwave Flash"];
+               if(x && x.description) {
+                       PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
+               }
+       }else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
+               var axo = 1;
+               var counter = 3;
+               while(axo) {
+                       try {
+                               counter++;
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
+//                             document.write("player v: "+ counter);
+                               PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
+                       } catch (e) {
+                               axo = null;
+                       }
+               }
+       } else { // Win IE (non mobile)
+               // do minor version lookup in IE, but avoid fp6 crashing issues
+               // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
+               try{
+                       var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+               }catch(e){
+                       try {
+                               var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+                               PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
+                               axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
+                       } catch(e) {
+                               if (PlayerVersion.major == 6) {
+                                       return PlayerVersion;
+                               }
+                       }
+                       try {
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+                       } catch(e) {}
+               }
+               if (axo != null) {
+                       PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
+               }
+       }
+       return PlayerVersion;
+}
+deconcept.PlayerVersion = function(arrVersion){
+       this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
+       this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
+       this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
+}
+deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
+       if(this.major < fv.major) return false;
+       if(this.major > fv.major) return true;
+       if(this.minor < fv.minor) return false;
+       if(this.minor > fv.minor) return true;
+       if(this.rev < fv.rev) return false;
+       return true;
+}
+/* ---- get value of query string param ---- */
+deconcept.util = {
+       getRequestParameter: function(param) {
+               var q = document.location.search || document.location.hash;
+               if (param == null) { return q; }
+               if(q) {
+                       var pairs = q.substring(1).split("&");
+                       for (var i=0; i < pairs.length; i++) {
+                               if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+                                       return pairs[i].substring((pairs[i].indexOf("=")+1));
+                               }
+                       }
+               }
+               return "";
+       }
+}
+/* fix for video streaming bug */
+deconcept.SWFObjectUtil.cleanupSWFs = function() {
+       var objects = document.getElementsByTagName("OBJECT");
+       for (var i = objects.length - 1; i >= 0; i--) {
+               objects[i].style.display = 'none';
+               for (var x in objects[i]) {
+                       if (typeof objects[i][x] == 'function') {
+                               objects[i][x] = function(){};
+                       }
+               }
+       }
+}
+// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
+if (deconcept.SWFObject.doPrepUnload) {
+       if (!deconcept.unloadSet) {
+               deconcept.SWFObjectUtil.prepUnload = function() {
+                       __flash_unloadHandler = function(){};
+                       __flash_savedUnloadHandler = function(){};
+                       window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
+               }
+               window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
+               deconcept.unloadSet = true;
+       }
+}
+/* add document.getElementById if needed (mobile IE < 5) */
+if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
+
+/* add some aliases for ease of use/backwards compatibility */
+var getQueryParamValue = deconcept.util.getRequestParameter;
+var FlashObject = deconcept.SWFObject; // for legacy support
+var SWFObject = deconcept.SWFObject;
+
+/**
+ * Wraps Flash embedding functionality and allows communication with SWF through
+ * attributes.
+ *
+ * @namespace YAHOO.widget
+ * @class FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
+ */
+YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
+{
+       // set up the initial events and attributes stuff
+       this._queue = this._queue || [];
+       this._events = this._events || {};
+       this._configs = this._configs || {};
+       attributes = attributes || {};
+       
+       //the Flash Player external interface code from Adobe doesn't play nicely
+       //with the default value, yui-gen, in IE
+       this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
+       attributes.version = attributes.version || "9.0.45";
+       attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
+       
+       //we can't use the initial attributes right away
+       //so save them for once the SWF finishes loading
+       this._attributes = attributes;
+       
+       this._swfURL = swfURL;
+       
+       //embed the SWF file in the page
+       this._embedSWF(this._swfURL, containerID, attributes.id, attributes.version, attributes.backgroundColor, attributes.expressInstall);
+       
+       /**
+        * Fires when the SWF is initialized and communication is possible.
+        * @event contentReady
+        */
+       this.createEvent("contentReady");
+};
+
+YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
+{
+       /**
+        * The URL of the SWF file.
+        * @property _swfURL
+        * @type String
+        * @private
+        */
+       _swfURL: null,
+
+       /**
+        * A reference to the embedded SWF file.
+        * @property _swf
+        * @private
+        */
+       _swf: null,
+
+       /**
+        * The id of this instance.
+        * @property _id
+        * @type String
+        * @private
+        */
+       _id: null,
+       
+       /**
+        * The initializing attributes are stored here until the SWF is ready.
+        * @property _attributes
+        * @type Object
+        * @private
+        */
+       _attributes: null, //the intializing attributes
+
+       /**
+        * Public accessor to the unique name of the FlashAdapter instance.
+        *
+        * @method toString
+        * @return {String} Unique name of the FlashAdapter instance.
+        */
+       toString: function()
+       {
+               return "FlashAdapter " + this._id;
+       },
+
+       /**
+        * Embeds the SWF in the page and associates it with this instance.
+        *
+        * @method _embedSWF
+        * @private
+        */
+       _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall)
+       {
+               //standard SWFObject embed
+               var swfObj = new deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor, expressInstall);
+
+               //make sure we can communicate with ExternalInterface
+               swfObj.addParam("allowScriptAccess", "always");
+               
+               //again, a useful ExternalInterface trick
+               swfObj.addVariable("allowedDomain", document.location.hostname);
+
+               //tell the SWF which HTML element it is in
+               swfObj.addVariable("elementID", swfID);
+
+               // set the name of the function to call when the swf has an event
+               swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
+
+               var container = YAHOO.util.Dom.get(containerID);
+               var result = swfObj.write(container);
+               if(result)
+               {
+                       this._swf = YAHOO.util.Dom.get(swfID);
+                       //if successful, let's add an owner property to the SWF reference
+                       //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
+                       this._swf.owner = this;
+               }
+       },
+
+       /**
+        * Handles or re-dispatches events received from the SWF.
+        *
+        * @method _eventHandler
+        * @private
+        */
+       _eventHandler: function(event)
+       {
+               var type = event.type;
+               switch(type)
+               {
+                       case "swfReady":
+                       {
+                               this._loadHandler();
+                               return;
+                       }
+                       case "log":
+                       {
+                               return;
+                       }
+               }
+               
+               //be sure to return after your case or the event will automatically fire!
+               this.fireEvent(type, event);
+       },
+
+       /**
+        * Called when the SWF has been initialized.
+        *
+        * @method _loadHandler
+        * @private
+        */
+       _loadHandler: function()
+       {
+               this._initAttributes(this._attributes);
+               this.setAttributes(this._attributes, true);
+               this._attributes = null;
+               
+               this.fireEvent("contentReady");
+       },
+       
+       /**
+        * Initializes the attributes.
+        *
+        * @method _initAttributes
+        * @private
+        */
+       _initAttributes: function(attributes)
+       {
+               //should be overridden if other attributes need to be set up
+               
+               /**
+                * @attribute swfURL
+                * @description Absolute or relative URL to the SWF displayed by the FlashAdapter.
+                * @type String
+                */
+               this.getAttributeConfig("swfURL",
+               {
+                       method: this._getSWFURL
+               });
+       },
+       
+       /**
+        * Getter for swfURL attribute.
+        *
+        * @method _getSWFURL
+        * @private
+        */
+       _getSWFURL: function()
+       {
+               return this._swfURL;
+       }
+});
+
+/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of FlashAdapter.
+ *
+ * @method YAHOO.widget.FlashAdapter.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
+{
+       var loadedSWF = YAHOO.util.Dom.get(elementID);
+       if(!loadedSWF.owner)
+       {
+               //fix for ie: if owner doesn't exist yet, try again in a moment
+               setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
+       }
+       else loadedSWF.owner._eventHandler(event);
+};
+/**
+ * Uploader class for the YUI Uploader component.
+ *
+ * @namespace YAHOO.widget
+ * @class Uploader
+ * @uses YAHOO.widget.FlashAdapter
+ * @constructor
+ * @param containerId {HTMLElement} Container element for the Flash Player instance.
+ */
+YAHOO.widget.Uploader = function(containerId)
+{
+       YAHOO.widget.Uploader.superclass.constructor.call(this, YAHOO.widget.Uploader.SWFURL, containerId, null);
+       
+       /**
+        * Fires when the user has finished selecting files in the "Open File" dialog.
+        *
+        * @event fileSelect
+        * @param event.type {String} The event type
+        * @param event.fileList {Array} An array of objects with file information
+        * @param event.fileList[].size {Number} File size in bytes for a specific file in fileList
+        * @param event.fileList[].cDate {Date} Creation date for a specific file in fileList
+        * @param event.fileList[].mDate {Date} Modification date for a specific file in fileList
+        * @param event.fileList[].name {String} File name for a specific file in fileList
+        * @param event.fileList[].id {String} Unique file id of a specific file in fileList
+        */
+       this.createEvent("fileSelect");
+
+       /**
+        * Fires when an upload of a specific file has started.
+        *
+        * @event uploadStart
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file that's started to upload
+        */
+       this.createEvent("uploadStart");
+
+       /**
+        * Fires when new information about the upload progress for a specific file is available.
+        *
+        * @event uploadProgress
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file with which the upload progress data is associated
+        * @param bytesLoaded {Number} The number of bytes of the file uploaded so far
+        * @param bytesTotal {Number} The total size of the file
+        */
+       this.createEvent("uploadProgress");
+       
+       /**
+        * Fires when an upload for a specific file is cancelled.
+        *
+        * @event uploadCancel
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file with which the upload has been cancelled.
+        */     
+       this.createEvent("uploadCancel");
+
+       /**
+        * Fires when an upload for a specific file is complete.
+        *
+        * @event uploadComplete
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file for which the upload has been completed.
+        */     
+       this.createEvent("uploadComplete");
+
+       /**
+        * Fires when the server sends data in response to a completed upload.
+        *
+        * @event uploadCompleteData
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file for which the upload has been completed.
+        * @param event.data {String} The raw data returned by the server in response to the upload.
+        */     
+       this.createEvent("uploadCompleteData");
+       
+       /**
+        * Fires when an upload error occurs.
+        *
+        * @event uploadError
+        * @param event.type {String} The event type
+        * @param event.id {String} The id of the file that was being uploaded when the error has occurred.
+        * @param event.status {String} The status message associated with the error.
+        */     
+       this.createEvent("uploadError");
+}
+
+/**
+ * Location of the Uploader SWF
+ *
+ * @property Chart.SWFURL
+ * @private
+ * @static
+ * @final
+ * @default "assets/Uploader.swf"
+ */
+YAHOO.widget.Uploader.SWFURL = "assets/uploader.swf";
+
+YAHOO.extend(YAHOO.widget.Uploader, YAHOO.widget.FlashAdapter,
+{
+/**
+ * Invokes the "Open File" dialog and allows the user to select the files for upload
+ *
+ * @param allowMultiple {Boolean} If true, allows for multiple file selection; if false, only a single file can be selected. False by default.
+ * @param extensionFilterArray {Array} An array of key-value pairs for permissible file extensions. The array elements should 
+ * be of the form: {description: "Images", extensions: "*.jpg, *.gif, *.png"}.
+ */
+       browse: function(allowMultiple,extensionFilterArray)
+       {
+               this._swf.browse(allowMultiple,extensionFilterArray);
+       },
+       
+/**
+ * Starts the upload of the file specified by fileID to the location specified by uploadScriptPath.
+ *
+ * @param fileID {String} The id of the file to start uploading.
+ * @param uploadScriptPath {String} The URL of the upload location.
+ * @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default.
+ * @param vars {Object} The object containing variables to be sent in the same request as the file upload.
+ * @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default.
+ */
+       upload: function(fileID, uploadScriptPath, method, vars, fieldName)
+       {
+               this._swf.upload(fileID, uploadScriptPath, method, vars, fieldName);
+       },
+       
+/**
+ * Starts uploading all files in the queue. If this function is called, the upload queue is automatically managed.
+ *
+ * @param uploadScriptPath {String} The URL of the upload location.
+ * @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default.
+ * @param vars {Object} The object containing variables to be sent in the same request as the file upload.
+ * @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default.
+ */
+       uploadAll: function(uploadScriptPath, method, vars, fieldName)
+       {
+               this._swf.uploadAll(uploadScriptPath, method, vars, fieldName);
+       },
+
+/**
+ * Cancels the upload of a specified file. If no file id is specified, all ongoing uploads are cancelled.
+ *
+ * @param fileID {String} The ID of the file whose upload should be cancelled.
+ */
+       cancel: function(fileID)
+       {
+               this._swf.cancel(fileID);
+       },
+
+/**
+ * Clears the list of files queued for upload.
+ *
+ */
+       clearFileList: function()
+       {
+               this._swf.clearFileList();
+       },
+       
+/**
+ * Removes the specified file from the upload queue. 
+ *
+ * @param fileID {String} The id of the file to remove from the upload queue. 
+ */
+       removeFile: function (fileID) 
+       {
+               this._swf.removeFile(fileID);
+       }
+});
+YAHOO.register("uploader", YAHOO.widget.Uploader, {version: "2.5.0", build: "895"});
index 77068927b0f34eabd0feb887e9daa4d749d6a05f..0ed906e8f064bc642f499c096d9038120df7564d 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.0",build:"895"});(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=M.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=M.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;
+}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(B.Dom.getStyle(Q,"display").search(/^inline|table-row.*$/i)){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.0",build:"895"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[],F=true,C,I=false;for(C=0;C<arguments.length;++C){H.push(arguments[C]);}if(!this.silent){}for(C=0;C<D;++C){var L=this.subscribers[C];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=L.fn.call(K,A,L.obj);}catch(E){this.lastError=E;}}else{try{F=L.fn.call(K,this.type,H,L.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}if(I){var J=[],B=this.subscribers;for(C=0,D=B.length;C<D;C=C+1){J.push(B[C]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M];for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=0,R=L.length;O<R;++O){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=0,R=J.length;O<R;O++){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J[O]=null;return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M[O]=null;break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I[Q]=null;return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
+},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;++M){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!this.DOMReady){this.startInterval();return false;}}this.locked=true;var P=!H;if(!P){P=(C>0);}var O=[];var Q=function(S,T){var R=S;if(T.override){if(T.override===true){R=T.obj;}else{R=T.override;}}T.fn.call(R,T.obj);};var L,K,N,M;for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&!N.checkReady){M=this.getEl(N.id);if(M){Q(M,N);F[L]=null;}else{O.push(N);}}}for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&N.checkReady){M=this.getEl(N.id);if(M){if(H||M.nextSibling){Q(M,N);F[L]=null;}}else{O.push(N);}}}C=(O.length===0)?0:C-1;if(P){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=0,K=Q.length;N<K;++N){var L=Q[N];this.removeListener(M,L.type,L.fn,L.index);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var Q=YAHOO.util.Event,O,N,L,K,M;for(O=0,K=J.length;O<K;++O){L=J[O];if(L){var P=window;if(L[Q.ADJ_SCOPE]){if(L[Q.ADJ_SCOPE]===true){P=L[Q.UNLOAD_OBJ];}else{P=L[Q.ADJ_SCOPE];}}L[Q.FN].call(P,Q.getEvent(R,L[Q.EL]),L[Q.UNLOAD_OBJ]);J[O]=null;L=null;P=null;}}J=null;if(I&&I.length>0){N=I.length;while(N){M=N-1;L=I[M];if(L){Q.removeListener(L[Q.EL],L[Q.TYPE],L[Q.FN],M);}N--;}L=null;}G=null;Q._simpleRemove(window,"unload",Q._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);EU._dri=setInterval(function(){var n=document.createElement("p");try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){n=null;}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);
+var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.0",build:"895"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;
+}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement("<iframe id=\""+B+"\" name=\""+B+"\" />");if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(this._formNode.encoding){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);}else{M.upload.apply(M.scope,[P]);}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.0",build:"895"});(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);
+if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
+/*
+TERMS OF USE - EASING EQUATIONS
+Open source under the BSD License.
+Copyright 2001 Robert Penner All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
-if(typeof YAHOO=="undefined"){var YAHOO={};}
-YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
-return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
-var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
-if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
-m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
-if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
-return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
-if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
-return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
-return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
-var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
-YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
-var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
-YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
-var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
-YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
-d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}
-if(s.length>1){s.pop();}
-s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}}
-if(s.length>1){s.pop();}
-s.push("}");}
-return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
-j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
-token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
-v=o[key];if(f){v=f(key,v,meta);}
-if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
-if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
-s=s.substring(0,i)+v+s.substring(j+1);}
-for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
-return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
-return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
-(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
-if(propertyCache[property]){return propertyCache[property];}
-var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
-propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
-return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
-var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
-return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
-if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
-break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
-el.style[property]=val;};}
-var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
-if(YAHOO.lang.isString(el)){return document.getElementById(el);}
-if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
-return c;}
-return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
-else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
-parentNode=parentNode.offsetParent;}}
-if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
-parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
-{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
-parentNode=parentNode.parentNode;}
-return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
-var pageXY=this.getXY(el);if(pageXY===false){return false;}
-var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
-if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
-if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
-if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
-return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
-el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
-var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
-var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
-el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
-var id=prefix+id_counter++;if(el){el.id=id;}
-return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
-var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
-else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
-return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
-return false;}
-return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
-return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
-var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
-var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
-return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
-return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
-return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
-return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
-return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
-var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
-return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
-return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
-this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
-YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
-if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
-var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
-return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
-var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
-var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
-ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
-if(false===ret){if(!this.silent){}
-return false;}}}
-if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
-this.subscribers=newlist;}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
-this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
-p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
-if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
-if(!el){return false;}
-if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
-var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
-var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
-return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
-return ok;}
-if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
-return false;}
-var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
-if(index>=0){cacheItem=listeners[index];}
-if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
-return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
-return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
-return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
-c=c.caller;}}
-return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
-return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
-return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
-if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
-this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
-for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
-retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
-for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
-return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
-l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
-unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
-j=j-1;}
-l=null;EU.clearCache();}
-for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
-if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
-el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
-EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
-YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
-return ret;}
-return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
-this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
-var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
-return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
-return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
-if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
-var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
-if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
-function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
-if(!keyData.alt){keyData.alt=false;}
-if(!keyData.ctrl){keyData.ctrl=false;}
-if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
-this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
-this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
-this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
-(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});
-YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
-{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
-return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
-{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
-{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
-{this._use_default_xhr_header=b;},setPollingInterval:function(i)
-{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
-{var obj,http;try
-{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
-catch(e)
-{for(var i=0;i<this._msxml_progid.length;++i){try
-{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
-catch(e){}}}
-finally
-{return obj;}},getConnectionObject:function(isFileUpload)
-{var o;var tId=this._transaction_id;try
-{if(!isFileUpload){o=this.createXhrObject(tId);}
-else{o={};o.tId=tId;o.isUpload=true;}
-if(o){this._transaction_id++;}}
-catch(e){}
-finally
-{return o;}},asyncRequest:function(method,uri,callback,postData)
-{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!o){return null;}
-else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
-if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
-if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
-else{uri+="?"+this._sFormData;}}
-else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
-o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
-if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
-if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
-this.handleReadyState(o,callback);o.conn.send(postData||null);this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
-return o;}},initCustomEvents:function(o,callback)
-{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
-{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
-oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
-oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
-{if(!callback){this.releaseObject(o);return;}
-var httpStatus,responseObject;try
-{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
-else{httpStatus=13030;}}
-catch(e){httpStatus=13030;}
-if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
-else{callback.success.apply(callback.scope,[responseObject]);}}
-this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
-else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}
-break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}}
-this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
-this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
-{var obj={};var headerObj={};try
-{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
-catch(e){}
-obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
-return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
-{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
-else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
-if(callbackArg){obj.argument=callbackArg;}
-return obj;},initHeader:function(label,value,isDefault)
-{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
-else{headerObj[label]=value+","+headerObj[label];}
-if(isDefault){this._has_default_headers=true;}
-else{this._has_http_headers=true;}},setHeader:function(o)
-{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
-if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
-delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
-{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
-else if(typeof formId=='object'){oForm=formId;}
-else{return;}
-if(isUpload){var io=this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
-var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
-{switch(oElement.type)
-{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
-else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
-break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
-else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-hasSubmit=true;}
-break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
-this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
-else if(typeof secureURI=='string'){io.src=secureUri;}}
-else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
-io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
-{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
-return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);var oConn=this;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(this._formNode.encoding){this._formNode.setAttribute('encoding',uploadEncoding);}
-else{this._formNode.setAttribute('enctype',uploadEncoding);}
-if(postData){var oElements=this.appendPostData(postData);}
-this._formNode.submit();this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
-if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
-for(var prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
-else{this._formNode.removeAttribute(prop);}}}
-this.resetFormState();var uploadCallback=function()
-{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
-oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
-var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
-{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
-catch(e){}
-if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
-else{callback.upload.apply(callback.scope,[obj]);}}
-oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
-if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
-else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
-else{io.removeEventListener('load',uploadCallback,false);}
-setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
-else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
-else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
-{var abortStatus;if(o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
-abortStatus=true;}}
-else if(o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
-abortStatus=true;}}
-else{abortStatus=false;}
-if(abortStatus===true){this.abortEvent.fire(o);if(o.abortEvent){o.abortEvent.fire(o);}
-this.handleTransactionResponse(o,callback,true);}
-else{}
-return abortStatus;},isCallInProgress:function(o)
-{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
-else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
-else{return false;}},releaseObject:function(o)
-{if(o.conn){o.conn=null;}
-o=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.0",build:"442"});
-YAHOO.util.Anim=function(el,attributes,duration,method){if(!el){}
-this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
-YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
-var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
-return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
-return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
-start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
-this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
-this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
-YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
-YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
-isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
-actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
-queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
-return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
-queue=[];thread=null;tweenCount=0;}
-else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
-if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
-{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
-tween._onTween.fire();}
-else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
-return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
-if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
-tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
-for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
-return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
-var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
-c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
-c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
-return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
-val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
-else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
-this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
-return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
-return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d)==1){return b+c;}
-if(!p){p=d*.3;}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d)==1){return b+c;}
-if(!p){p=d*.3;}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
-if((t/=d/2)==2){return b+c;}
-if(!p){p=d*(.3*1.5);}
-if(!a||a<Math.abs(c)){a=c;var s=p/4;}
-else{var s=p/(2*Math.PI)*Math.asin(c/a);}
-if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
-return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
-if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
-return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
-return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
-return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
-control=tmp;}
-if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}
-if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
-else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
-start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
-this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
-this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
-else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
-return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
-return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});
-if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
-oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
-if(!this.ids[sGroup]){this.ids[sGroup]={};}
-this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
-var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}
-delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}
-this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}
-if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
-return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
-return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
-return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc){dc.b4StartDrag(x,y);}
-if(dc){dc.startDrag(x,y);}
-this.dragThreshMet=true;},handleMouseUp:function(e){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
-this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
-if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent){if(this.dragCurrent&&!silent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
-this.dragCurrent.onMouseUp(e);}
-this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){var dc=this.dragCurrent;if(dc){if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
-if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
-if(this.dragThreshMet){dc.b4Drag(e);if(dc){dc.onDrag(e);}
-if(dc){this.fireEvents(e,false);}}
-this.stopEvent(e);}},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
-var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
-if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);}
-oldOvers[i]=true;delete this.dragOvers[i];}
-for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
-for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
-if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
-this.dragOvers[oDD.id]=oDD;}}}}}
-this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);}
-if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);if(dc){dc.onDragOut(e,outEvts);}}
-if(enterEvts.length){if(dc){dc.onDragEnter(e,enterEvts);}}
-if(overEvts.length){if(dc){dc.b4DragOver(e,overEvts);}
-if(dc){dc.onDragOver(e,overEvts);}}
-if(dropEvts.length){if(dc){dc.b4DragDrop(e,dropEvts);}
-if(dc){dc.onDragDrop(e,dropEvts);}}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){if(dc){dc.b4DragOut(e,outEvts[i].id);}
-if(dc){dc.onDragOut(e,outEvts[i].id);}}
-for(i=0,len=enterEvts.length;i<len;++i){if(dc){dc.onDragEnter(e,enterEvts[i].id);}}
-for(i=0,len=overEvts.length;i<len;++i){if(dc){dc.b4DragOver(e,overEvts[i].id);}
-if(dc){dc.onDragOver(e,overEvts[i].id);}}
-for(i=0,len=dropEvts.length;i<len;++i){if(dc){dc.b4DragDrop(e,dropEvts[i].id);}
-if(dc){dc.onDragDrop(e,dropEvts[i].id);}}}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
-return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
-for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
-return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
-var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
-if(!pos){return null;}
-x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
-if(!loc){return false;}
-oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
-oTarget.overlap=null;if(!curRegion){var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
-var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
-this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
-this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
-return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
-return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
-return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
-(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
-return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
-this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
-var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
-this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
-if(this.isLocked()){return;}
-this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
-if(x>this.maxX){x=this.maxX;}}
-if(this.constrainY){if(y<this.minY){y=this.minY;}
-if(y>this.maxY){y=this.maxY;}}
-x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
-delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
-valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
-return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
-this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
-this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
-if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
-if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
-return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
-this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
-if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
-if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
-if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
-var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');Dom.setStyle(_data,'height','100%');Dom.setStyle(_data,'width','100%');Dom.setStyle(_data,'background-color','#ccc');Dom.setStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
-this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
-if(isNaN(br)){br=0;}
-if(isNaN(bb)){bb=0;}
-if(isNaN(bl)){bl=0;}
-var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.3.0",build:"442"});
-YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}
-if(this.validator&&!this.validator.call(owner,value)){return false;}
-if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}
-if(this.method){this.method.call(owner,value);}
-this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}
-return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&YAHOO.lang.hasOwnProperty(map,key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;}
-return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}
-return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(Lang.hasOwnProperty(configs,key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}
-return keys;},setAttributes:function(map,silent){for(var key in map){if(Lang.hasOwnProperty(map,key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}
-return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this.setAttributeConfig(key,map);},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(Lang.hasOwnProperty(config,key)){map[key]=config[key];}}
-return map;},setAttributeConfig:function(key,map,init){var configs=this._configs||{};map=map||{};if(!configs[key]){map.name=key;configs[key]=new YAHOO.util.Attribute(map,this);}else{configs[key].configure(map,init);}},configureAttribute:function(key,map,init){this.setAttributeConfig(key,map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){},addListener:function(type,fn,obj,scope){var el=this.get('element');scope=scope||this;el=this.get('id')||el;var self=this;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}
-self.fireEvent(type,e);},obj,scope);}
-this.createEvent(type,this);}
-YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){var el=this.get('element');if(!el){return this._queue[this._queue.length]=['setStyle',arguments];}
-return Dom.setStyle(el,property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);this.fireEvent('beforeAppendTo',{type:'beforeAppendTo',target:parent});before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');if(!element){return false;}
-if(!parent){return false;}
-if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}
-this.fireEvent('appendTo',{type:'appendTo',target:parent});},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!YAHOO.lang.isUndefined(el.value[key])){return el.value[key];}
-return AttributeProvider.prototype.get.call(this,key);},setAttributes:function(map,silent){var el=this.get('element');for(var key in map){if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){this.setAttributeConfig(key);}}
-for(var i=0,len=this._configOrder.length;i<len;++i){if(map[this._configOrder[i]]){this.set(this._configOrder[i],map[this._configOrder[i]],silent);}}},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[this._queue.length]=['set',arguments];if(this._configs[key]){this._configs[key].value=value;}
-return;}
-if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key);}
-return AttributeProvider.prototype.set.apply(this,arguments);},setAttributeConfig:function(key,map,init){var el=this.get('element');if(el&&!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key,map);}else{AttributeProvider.prototype.setAttributeConfig.apply(this,arguments);}
-this._configOrder.push(key);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}
-return keys;},createEvent:function(type,scope){this._events[type]=true;AttributeProvider.prototype.createEvent.apply(this,arguments);},init:function(el,attr){_initElement.apply(this,arguments);}};var _initElement=function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'dblclick':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true,'focus':true,'blur':true,'submit':true};var isReady=false;if(YAHOO.lang.isString(el)){_registerHTMLAttr.call(this,'id',{value:attr.element});}
-if(Dom.get(el)){isReady=true;_initHTMLElement.call(this,attr);_initContent.call(this,attr);}
-YAHOO.util.Event.onAvailable(attr.element,function(){if(!isReady){_initHTMLElement.call(this,attr);}
-this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(attr.element,function(){if(!isReady){_initContent.call(this,attr);}
-this.fireEvent('contentReady',{type:'contentReady',target:attr.element});},this,true);};var _initHTMLElement=function(attr){this.setAttributeConfig('element',{value:Dom.get(attr.element),readOnly:true});};var _initContent=function(attr){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();};var _registerHTMLAttr=function(key,map){var el=this.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.3.0",build:"442"});YAHOO.register("utilities", YAHOO, {version: "2.3.0", build: "442"});
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);
+var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.0",build:"895"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});}}}}}},getBestMatch:function(D){var F=null;
+var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;
+this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");
+YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","about:blank");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.0",build:"895"});YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(this._configs[E[D]]&&!A.isUndefined(this._configs[E[D]].value)&&!A.isNull(this._configs[E[D]].value)){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var D=YAHOO.util.Dom,F=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(G,H){if(arguments.length){this.init(G,H);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(G){G=G.get?G.get("element"):G;this.get("element").appendChild(G);},getElementsByTagName:function(G){return this.get("element").getElementsByTagName(G);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(G,H){G=G.get?G.get("element"):G;H=(H&&H.get)?H.get("element"):H;this.get("element").insertBefore(G,H);},removeChild:function(G){G=G.get?G.get("element"):G;this.get("element").removeChild(G);return true;},replaceChild:function(G,H){G=G.get?G.get("element"):G;H=H.get?H.get("element"):H;return this.get("element").replaceChild(G,H);},initAttributes:function(G){},addListener:function(K,J,L,I){var H=this.get("element");I=I||this;H=this.get("id")||H;var G=this;if(!this._events[K]){if(this.DOM_EVENTS[K]){YAHOO.util.Event.addListener(H,K,function(M){if(M.srcElement&&!M.target){M.target=M.srcElement;}G.fireEvent(K,M);},L,I);}this.createEvent(K,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(H,G){this.unsubscribe.apply(this,arguments);},addClass:function(G){D.addClass(this.get("element"),G);},getElementsByClassName:function(H,G){return D.getElementsByClassName(H,G,this.get("element"));},hasClass:function(G){return D.hasClass(this.get("element"),G);},removeClass:function(G){return D.removeClass(this.get("element"),G);},replaceClass:function(H,G){return D.replaceClass(this.get("element"),H,G);},setStyle:function(I,H){var G=this.get("element");if(!G){return this._queue[this._queue.length]=["setStyle",arguments];}return D.setStyle(G,I,H);},getStyle:function(G){return D.getStyle(this.get("element"),G);},fireQueue:function(){var H=this._queue;for(var I=0,G=H.length;I<G;++I){this[H[I][0]].apply(this,H[I][1]);}},appendTo:function(H,I){H=(H.get)?H.get("element"):D.get(H);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:H});I=(I&&I.get)?I.get("element"):D.get(I);var G=this.get("element");if(!G){return false;}if(!H){return false;}if(G.parent!=H){if(I){H.insertBefore(G,I);}else{H.appendChild(G);}}this.fireEvent("appendTo",{type:"appendTo",target:H});},get:function(G){var I=this._configs||{};var H=I.element;if(H&&!I[G]&&!YAHOO.lang.isUndefined(H.value[G])){return H.value[G];}return F.prototype.get.call(this,G);},setAttributes:function(L,H){var K=this.get("element");
+for(var J in L){if(!this._configs[J]&&!YAHOO.lang.isUndefined(K[J])){this.setAttributeConfig(J);}}for(var I=0,G=this._configOrder.length;I<G;++I){if(L[this._configOrder[I]]!==undefined){this.set(this._configOrder[I],L[this._configOrder[I]],H);}}},set:function(H,J,G){var I=this.get("element");if(!I){this._queue[this._queue.length]=["set",arguments];if(this._configs[H]){this._configs[H].value=J;}return ;}if(!this._configs[H]&&!YAHOO.lang.isUndefined(I[H])){C.call(this,H);}return F.prototype.set.apply(this,arguments);},setAttributeConfig:function(G,I,J){var H=this.get("element");if(H&&!this._configs[G]&&!YAHOO.lang.isUndefined(H[G])){C.call(this,G,I);}else{F.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(G);},getAttributeKeys:function(){var H=this.get("element");var I=F.prototype.getAttributeKeys.call(this);for(var G in H){if(!this._configs[G]){I[G]=I[G]||H[G];}}return I;},createEvent:function(H,G){this._events[H]=true;F.prototype.createEvent.apply(this,arguments);},init:function(H,G){A.apply(this,arguments);}};var A=function(H,G){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];G=G||{};G.element=G.element||H||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var I=false;if(YAHOO.lang.isString(H)){C.call(this,"id",{value:G.element});}if(D.get(H)){I=true;E.call(this,G);B.call(this,G);}YAHOO.util.Event.onAvailable(G.element,function(){if(!I){E.call(this,G);}this.fireEvent("available",{type:"available",target:G.element});},this,true);YAHOO.util.Event.onContentReady(G.element,function(){if(!I){B.call(this,G);}this.fireEvent("contentReady",{type:"contentReady",target:G.element});},this,true);};var E=function(G){this.setAttributeConfig("element",{value:D.get(G.element),readOnly:true});};var B=function(G){this.initAttributes(G);this.setAttributes(G,true);this.fireQueue();};var C=function(G,I){var H=this.get("element");I=I||{};I.name=G;I.method=I.method||function(J){H[G]=J;};I.value=I.value||H[G];this._configs[G]=new YAHOO.util.Attribute(I,this);};YAHOO.augment(YAHOO.util.Element,F);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.0",build:"895"});YAHOO.register("utilities", YAHOO, {version: "2.5.0", build: "895"});
index 1ee394d85036150b1705e914d53c3635c17ef9b2..ae7b52946d0c6f0b906193890d65dad49a1e87e6 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-if(typeof YAHOO=="undefined"){var YAHOO={};}
-YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
-return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
-var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
-if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
-m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
-if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
-return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
-if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
-return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
-return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
-var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
-YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
-var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
-YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
-var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
-YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
-d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}
-if(s.length>1){s.pop();}
-s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}}
-if(s.length>1){s.pop();}
-s.push("}");}
-return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
-j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
-token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
-v=o[key];if(f){v=f(key,v,meta);}
-if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
-if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
-s=s.substring(0,i)+v+s.substring(j+1);}
-for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
-return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
-return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
-(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
-if(propertyCache[property]){return propertyCache[property];}
-var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
-propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
-return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
-var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
-return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
-if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
-break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
-el.style[property]=val;};}
-var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
-if(YAHOO.lang.isString(el)){return document.getElementById(el);}
-if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
-return c;}
-return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
-else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
-parentNode=parentNode.offsetParent;}}
-if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
-parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
-{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
-parentNode=parentNode.parentNode;}
-return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
-var pageXY=this.getXY(el);if(pageXY===false){return false;}
-var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
-if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
-if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
-if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
-var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
-return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
-el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
-var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
-var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
-el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
-el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
-var id=prefix+id_counter++;if(el){el.id=id;}
-return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
-var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
-else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
-return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
-return false;}
-return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
-var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
-return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
-var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
-var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
-return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
-return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
-return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
-var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
-return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
-return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
-return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
-var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
-return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
-return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
-if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
-this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
-YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
-if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
-var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
-return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
-var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
-var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
-ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
-if(false===ret){if(!this.silent){}
-return false;}}}
-if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
-this.subscribers=newlist;}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
-this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
-p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
-if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
-if(!el){return false;}
-if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
-var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
-var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
-return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
-return ok;}
-if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
-return false;}
-var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
-if(index>=0){cacheItem=listeners[index];}
-if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
-return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
-return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
-return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
-c=c.caller;}}
-return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
-return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
-return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
-if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
-this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
-for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
-retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
-for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
-return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
-l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
-unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
-j=j-1;}
-l=null;EU.clearCache();}
-for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
-if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
-el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
-EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
-YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
-return ret;}
-return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
-this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
-var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
-return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
-return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
-if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
-var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
-if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
-function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
-if(!keyData.alt){keyData.alt=false;}
-if(!keyData.ctrl){keyData.ctrl=false;}
-if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
-this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
-this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
-this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
-(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.3.0", build: "442"});
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.0",build:"895"});(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=M.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=M.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;
+}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(B.Dom.getStyle(Q,"display").search(/^inline|table-row.*$/i)){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.0",build:"895"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[],F=true,C,I=false;for(C=0;C<arguments.length;++C){H.push(arguments[C]);}if(!this.silent){}for(C=0;C<D;++C){var L=this.subscribers[C];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=L.fn.call(K,A,L.obj);}catch(E){this.lastError=E;}}else{try{F=L.fn.call(K,this.type,H,L.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}if(I){var J=[],B=this.subscribers;for(C=0,D=B.length;C<D;C=C+1){J.push(B[C]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M];for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=0,R=L.length;O<R;++O){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=0,R=J.length;O<R;O++){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J[O]=null;return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M[O]=null;break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I[Q]=null;return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
+},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;++M){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!this.DOMReady){this.startInterval();return false;}}this.locked=true;var P=!H;if(!P){P=(C>0);}var O=[];var Q=function(S,T){var R=S;if(T.override){if(T.override===true){R=T.obj;}else{R=T.override;}}T.fn.call(R,T.obj);};var L,K,N,M;for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&!N.checkReady){M=this.getEl(N.id);if(M){Q(M,N);F[L]=null;}else{O.push(N);}}}for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&N.checkReady){M=this.getEl(N.id);if(M){if(H||M.nextSibling){Q(M,N);F[L]=null;}}else{O.push(N);}}}C=(O.length===0)?0:C-1;if(P){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=0,K=Q.length;N<K;++N){var L=Q[N];this.removeListener(M,L.type,L.fn,L.index);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var Q=YAHOO.util.Event,O,N,L,K,M;for(O=0,K=J.length;O<K;++O){L=J[O];if(L){var P=window;if(L[Q.ADJ_SCOPE]){if(L[Q.ADJ_SCOPE]===true){P=L[Q.UNLOAD_OBJ];}else{P=L[Q.ADJ_SCOPE];}}L[Q.FN].call(P,Q.getEvent(R,L[Q.EL]),L[Q.UNLOAD_OBJ]);J[O]=null;L=null;P=null;}}J=null;if(I&&I.length>0){N=I.length;while(N){M=N-1;L=I[M];if(L){Q.removeListener(L[Q.EL],L[Q.TYPE],L[Q.FN],M);}N--;}L=null;}G=null;Q._simpleRemove(window,"unload",Q._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);EU._dri=setInterval(function(){var n=document.createElement("p");try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){n=null;}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);
+var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.0",build:"895"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.5.0", build: "895"});
index 23046a0f95f3f076bdff57aebcb0c289e6923fd9..ef6ea463f85c87aeb3ecaa8cd39ec6b6f3d57f77 100755 (executable)
@@ -1,5 +1,17 @@
 YAHOO Global - Release Notes
 
+2.5.0
+  * API doc updates
+
+2.4.0
+  * Added YAHOO.env.ua.mobile
+  * Removed the hasOwnProperty check in isArray to make it perform a bit better.
+  * YAHOO will be created/overwritten if YAHOO is undefined or the defined YAHOO is falsy
+  * YAHOO.lang is now preserved when YAHOO is included a second time.
+
+2.3.1
+  * YAHOO.lang.dump casts primitives to strings
+
 2.3.0
   * Added YAHOO.env.ua - browser detection
   * Added YAHOO.lang.merge - object merge
index a984e8ad35c0d88c053b329f6c89cb77884116b6..d435860a3b976221c2d4babdce34bc857db0a895 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -53,7 +53,15 @@ version: 2.3.0
  * @see yuiloader
  */
 
-if (typeof YAHOO == "undefined") {
+/**
+ * Forces the use of the supplied locale where applicable in the library
+ * @property locale
+ * @type string
+ * @static
+ * @default undefined
+ */
+
+if (typeof YAHOO == "undefined" || !YAHOO) {
     /**
      * The YAHOO global namespace object.  If YAHOO is already defined, the
      * existing YAHOO object will not be overwritten so that defined
@@ -264,16 +272,31 @@ YAHOO.env.ua = function() {
          * Safari 2.0.4:         418     <-- preventDefault fixed
          * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
          *                                   different versions of webkit
-         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
-         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
-         *                                   be higher than this
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event
          *                                   
          * </pre>
          * http://developer.apple.com/internet/safari/uamatrix.html
          * @property webkit
          * @type float
          */
-        webkit:0
+        webkit:0,
+
+        /**
+         * The mobile property will be set to a string containing any relevant
+         * user agent information when a modern mobile browser is detected.
+         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
+         * devices with the WebKit-based browser, and Opera Mini.  
+         * @property mobile 
+         * @type string
+         */
+        mobile: null 
     };
 
     var ua=navigator.userAgent, m;
@@ -286,6 +309,17 @@ YAHOO.env.ua = function() {
     m=ua.match(/AppleWebKit\/([^\s]*)/);
     if (m&&m[1]) {
         o.webkit=parseFloat(m[1]);
+
+        // Mobile browser check
+        if (/ Mobile\//.test(ua)) {
+            o.mobile = "Apple"; // iPhone or iPod Touch
+        } else {
+            m=ua.match(/NokiaN[^\/]*/);
+            if (m) {
+                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+            }
+        }
+
     }
 
     if (!o.webkit) { // not webkit
@@ -293,6 +327,10 @@ YAHOO.env.ua = function() {
         m=ua.match(/Opera[\s\/]([^\s]*)/);
         if (m&&m[1]) {
             o.opera=parseFloat(m[1]);
+            m=ua.match(/Opera Mini[^;]*/);
+            if (m) {
+                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+            }
         } else { // not opera or webkit
             m=ua.match(/MSIE\s([^;]*)/);
             if (m&&m[1]) {
@@ -323,7 +361,7 @@ YAHOO.env.ua = function() {
  */
 (function() {
     YAHOO.namespace("util", "widget", "example");
-    if (typeof YAHOO_config != "undefined") {
+    if ("undefined" !== typeof YAHOO_config) {
         var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
         if (l) {
             // if YAHOO is loaded multiple times we need to check to see if
@@ -345,7 +383,7 @@ YAHOO.env.ua = function() {
  * Provides the language utilites and extensions used by the library
  * @class YAHOO.lang
  */
-YAHOO.lang = {
+YAHOO.lang = YAHOO.lang || {
     /**
      * Determines whether or not the provided object is an array.
      * Testing typeof/instanceof/constructor of arrays across frame 
@@ -355,14 +393,13 @@ YAHOO.lang = {
      * properties.
      * @method isArray
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isArray: function(o) { 
 
         if (o) {
            var l = YAHOO.lang;
-           return l.isNumber(o.length) && l.isFunction(o.splice) && 
-                  !l.hasOwnProperty(o.length);
+           return l.isNumber(o.length) && l.isFunction(o.splice);
         }
         return false;
     },
@@ -371,7 +408,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a boolean
      * @method isBoolean
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isBoolean: function(o) {
         return typeof o === 'boolean';
@@ -381,7 +418,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a function
      * @method isFunction
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isFunction: function(o) {
         return typeof o === 'function';
@@ -391,7 +428,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is null
      * @method isNull
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNull: function(o) {
         return o === null;
@@ -401,7 +438,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a legal number
      * @method isNumber
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNumber: function(o) {
         return typeof o === 'number' && isFinite(o);
@@ -412,7 +449,7 @@ YAHOO.lang = {
      * or function
      * @method isObject
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */  
     isObject: function(o) {
 return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
@@ -422,7 +459,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * Determines whether or not the provided object is a string
      * @method isString
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isString: function(o) {
         return typeof o === 'string';
@@ -432,7 +469,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * Determines whether or not the provided object is undefined
      * @method isUndefined
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isUndefined: function(o) {
         return typeof o === 'undefined';
@@ -456,7 +493,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * </pre>
      * @method hasOwnProperty
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     hasOwnProperty: function(o, prop) {
         if (Object.prototype.hasOwnProperty) {
@@ -479,7 +516,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      */
     _IEEnumFix: function(r, s) {
         if (YAHOO.env.ua.ie) {
-            var add=["toString", "valueOf"];
+            var add=["toString", "valueOf"], i;
             for (i=0;i<add.length;i=i+1) {
                 var fname=add[i],f=s[fname];
                 if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
@@ -610,12 +647,13 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
         var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
             COMMA=', ', ARROW=' => ';
 
-        // Skip non-objects
+        // Cast non-objects to string
         // Skip dates because the std toString is what we want
         // Skip HTMLElement-like objects because trying to dump 
         // an element will cause an unhandled exception in FF 2.x
-        if (!l.isObject(o) || o instanceof Date || 
-            ("nodeType" in o && "tagName" in o)) {
+        if (!l.isObject(o)) {
+            return o + "";
+        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
             return o;
         } else if  (l.isFunction(o)) {
             return FUN;
@@ -786,18 +824,69 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * @return the new merged object
      */
     merge: function() {
-        var o={}, a=arguments, i;
-        for (i=0; i<a.length; i=i+1) {
+        var o={}, a=arguments;
+        for (var i=0, l=a.length; i<l; i=i+1) {
             YAHOO.lang.augmentObject(o, a[i], true);
-            /*
-            for (var j in a[i]) {
-                o[j] = a[i][j];
-            }
-            */
         }
         return o;
     },
 
+    /**
+     * Executes the supplied function in the context of the supplied 
+     * object 'when' milliseconds later.  Executes the function a 
+     * single time unless periodic is set to true.
+     * @method later
+     * @since 2.4.0
+     * @param when {int} the number of milliseconds to wait until the fn 
+     * is executed
+     * @param o the context object
+     * @param fn {Function|String} the function to execute or the name of 
+     * the method in the 'o' object to execute
+     * @param data [Array] data that is provided to the function.  This accepts
+     * either a single item or an array.  If an array is provided, the
+     * function is executed with one parameter for each array item.  If
+     * you need to pass a single array parameter, it needs to be wrapped in
+     * an array [myarray]
+     * @param periodic {boolean} if true, executes continuously at supplied 
+     * interval until canceled
+     * @return a timer object. Call the cancel() method on this object to 
+     * stop the timer.
+     */
+    later: function(when, o, fn, data, periodic) {
+        when = when || 0; 
+        o = o || {};
+        var m=fn, d=data, f, r;
+
+        if (YAHOO.lang.isString(fn)) {
+            m = o[fn];
+        }
+
+        if (!m) {
+            throw new TypeError("method undefined");
+        }
+
+        if (!YAHOO.lang.isArray(d)) {
+            d = [data];
+        }
+
+        f = function() {
+            m.apply(o, d);
+        };
+
+        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
+
+        return {
+            interval: periodic,
+            cancel: function() {
+                if (this.interval) {
+                    clearInterval(r);
+                } else {
+                    clearTimeout(r);
+                }
+            }
+        };
+    },
+    
     /**
      * A convenience method for detecting a legitimate non-null value.
      * Returns false for null/undefined/NaN, true for other values, 
@@ -865,4 +954,4 @@ YAHOO.augment = YAHOO.lang.augmentProto;
  */
 YAHOO.extend = YAHOO.lang.extend;
 
-YAHOO.register("yahoo", YAHOO, {version: "2.3.0", build: "442"});
+YAHOO.register("yahoo", YAHOO, {version: "2.5.0", build: "895"});
index cd51ef0ff3c5e96c0cb9e752bb62e15e842f8d52..ebc73023280f36d3e6549025469fbbc645dd2884 100755 (executable)
@@ -1,42 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-if(typeof YAHOO=="undefined"){var YAHOO={};}
-YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
-return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
-var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
-if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
-m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
-if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
-return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
-if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
-return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
-return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
-var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
-YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
-var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
-YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
-var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
-YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
-d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}
-if(s.length>1){s.pop();}
-s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
-s.push(COMMA);}}
-if(s.length>1){s.pop();}
-s.push("}");}
-return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
-j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
-token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
-v=o[key];if(f){v=f(key,v,meta);}
-if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
-if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
-s=s.substring(0,i)+v+s.substring(j+1);}
-for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
-return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
-return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
\ No newline at end of file
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.0",build:"895"});
\ No newline at end of file
index a984e8ad35c0d88c053b329f6c89cb77884116b6..d435860a3b976221c2d4babdce34bc857db0a895 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -53,7 +53,15 @@ version: 2.3.0
  * @see yuiloader
  */
 
-if (typeof YAHOO == "undefined") {
+/**
+ * Forces the use of the supplied locale where applicable in the library
+ * @property locale
+ * @type string
+ * @static
+ * @default undefined
+ */
+
+if (typeof YAHOO == "undefined" || !YAHOO) {
     /**
      * The YAHOO global namespace object.  If YAHOO is already defined, the
      * existing YAHOO object will not be overwritten so that defined
@@ -264,16 +272,31 @@ YAHOO.env.ua = function() {
          * Safari 2.0.4:         418     <-- preventDefault fixed
          * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
          *                                   different versions of webkit
-         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
-         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
-         *                                   be higher than this
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event
          *                                   
          * </pre>
          * http://developer.apple.com/internet/safari/uamatrix.html
          * @property webkit
          * @type float
          */
-        webkit:0
+        webkit:0,
+
+        /**
+         * The mobile property will be set to a string containing any relevant
+         * user agent information when a modern mobile browser is detected.
+         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
+         * devices with the WebKit-based browser, and Opera Mini.  
+         * @property mobile 
+         * @type string
+         */
+        mobile: null 
     };
 
     var ua=navigator.userAgent, m;
@@ -286,6 +309,17 @@ YAHOO.env.ua = function() {
     m=ua.match(/AppleWebKit\/([^\s]*)/);
     if (m&&m[1]) {
         o.webkit=parseFloat(m[1]);
+
+        // Mobile browser check
+        if (/ Mobile\//.test(ua)) {
+            o.mobile = "Apple"; // iPhone or iPod Touch
+        } else {
+            m=ua.match(/NokiaN[^\/]*/);
+            if (m) {
+                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+            }
+        }
+
     }
 
     if (!o.webkit) { // not webkit
@@ -293,6 +327,10 @@ YAHOO.env.ua = function() {
         m=ua.match(/Opera[\s\/]([^\s]*)/);
         if (m&&m[1]) {
             o.opera=parseFloat(m[1]);
+            m=ua.match(/Opera Mini[^;]*/);
+            if (m) {
+                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+            }
         } else { // not opera or webkit
             m=ua.match(/MSIE\s([^;]*)/);
             if (m&&m[1]) {
@@ -323,7 +361,7 @@ YAHOO.env.ua = function() {
  */
 (function() {
     YAHOO.namespace("util", "widget", "example");
-    if (typeof YAHOO_config != "undefined") {
+    if ("undefined" !== typeof YAHOO_config) {
         var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
         if (l) {
             // if YAHOO is loaded multiple times we need to check to see if
@@ -345,7 +383,7 @@ YAHOO.env.ua = function() {
  * Provides the language utilites and extensions used by the library
  * @class YAHOO.lang
  */
-YAHOO.lang = {
+YAHOO.lang = YAHOO.lang || {
     /**
      * Determines whether or not the provided object is an array.
      * Testing typeof/instanceof/constructor of arrays across frame 
@@ -355,14 +393,13 @@ YAHOO.lang = {
      * properties.
      * @method isArray
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isArray: function(o) { 
 
         if (o) {
            var l = YAHOO.lang;
-           return l.isNumber(o.length) && l.isFunction(o.splice) && 
-                  !l.hasOwnProperty(o.length);
+           return l.isNumber(o.length) && l.isFunction(o.splice);
         }
         return false;
     },
@@ -371,7 +408,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a boolean
      * @method isBoolean
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isBoolean: function(o) {
         return typeof o === 'boolean';
@@ -381,7 +418,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a function
      * @method isFunction
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isFunction: function(o) {
         return typeof o === 'function';
@@ -391,7 +428,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is null
      * @method isNull
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNull: function(o) {
         return o === null;
@@ -401,7 +438,7 @@ YAHOO.lang = {
      * Determines whether or not the provided object is a legal number
      * @method isNumber
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNumber: function(o) {
         return typeof o === 'number' && isFinite(o);
@@ -412,7 +449,7 @@ YAHOO.lang = {
      * or function
      * @method isObject
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */  
     isObject: function(o) {
 return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
@@ -422,7 +459,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * Determines whether or not the provided object is a string
      * @method isString
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isString: function(o) {
         return typeof o === 'string';
@@ -432,7 +469,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * Determines whether or not the provided object is undefined
      * @method isUndefined
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isUndefined: function(o) {
         return typeof o === 'undefined';
@@ -456,7 +493,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * </pre>
      * @method hasOwnProperty
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     hasOwnProperty: function(o, prop) {
         if (Object.prototype.hasOwnProperty) {
@@ -479,7 +516,7 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      */
     _IEEnumFix: function(r, s) {
         if (YAHOO.env.ua.ie) {
-            var add=["toString", "valueOf"];
+            var add=["toString", "valueOf"], i;
             for (i=0;i<add.length;i=i+1) {
                 var fname=add[i],f=s[fname];
                 if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
@@ -610,12 +647,13 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
         var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
             COMMA=', ', ARROW=' => ';
 
-        // Skip non-objects
+        // Cast non-objects to string
         // Skip dates because the std toString is what we want
         // Skip HTMLElement-like objects because trying to dump 
         // an element will cause an unhandled exception in FF 2.x
-        if (!l.isObject(o) || o instanceof Date || 
-            ("nodeType" in o && "tagName" in o)) {
+        if (!l.isObject(o)) {
+            return o + "";
+        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
             return o;
         } else if  (l.isFunction(o)) {
             return FUN;
@@ -786,18 +824,69 @@ return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
      * @return the new merged object
      */
     merge: function() {
-        var o={}, a=arguments, i;
-        for (i=0; i<a.length; i=i+1) {
+        var o={}, a=arguments;
+        for (var i=0, l=a.length; i<l; i=i+1) {
             YAHOO.lang.augmentObject(o, a[i], true);
-            /*
-            for (var j in a[i]) {
-                o[j] = a[i][j];
-            }
-            */
         }
         return o;
     },
 
+    /**
+     * Executes the supplied function in the context of the supplied 
+     * object 'when' milliseconds later.  Executes the function a 
+     * single time unless periodic is set to true.
+     * @method later
+     * @since 2.4.0
+     * @param when {int} the number of milliseconds to wait until the fn 
+     * is executed
+     * @param o the context object
+     * @param fn {Function|String} the function to execute or the name of 
+     * the method in the 'o' object to execute
+     * @param data [Array] data that is provided to the function.  This accepts
+     * either a single item or an array.  If an array is provided, the
+     * function is executed with one parameter for each array item.  If
+     * you need to pass a single array parameter, it needs to be wrapped in
+     * an array [myarray]
+     * @param periodic {boolean} if true, executes continuously at supplied 
+     * interval until canceled
+     * @return a timer object. Call the cancel() method on this object to 
+     * stop the timer.
+     */
+    later: function(when, o, fn, data, periodic) {
+        when = when || 0; 
+        o = o || {};
+        var m=fn, d=data, f, r;
+
+        if (YAHOO.lang.isString(fn)) {
+            m = o[fn];
+        }
+
+        if (!m) {
+            throw new TypeError("method undefined");
+        }
+
+        if (!YAHOO.lang.isArray(d)) {
+            d = [data];
+        }
+
+        f = function() {
+            m.apply(o, d);
+        };
+
+        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
+
+        return {
+            interval: periodic,
+            cancel: function() {
+                if (this.interval) {
+                    clearInterval(r);
+                } else {
+                    clearTimeout(r);
+                }
+            }
+        };
+    },
+    
     /**
      * A convenience method for detecting a legitimate non-null value.
      * Returns false for null/undefined/NaN, true for other values, 
@@ -865,4 +954,4 @@ YAHOO.augment = YAHOO.lang.augmentProto;
  */
 YAHOO.extend = YAHOO.lang.extend;
 
-YAHOO.register("yahoo", YAHOO, {version: "2.3.0", build: "442"});
+YAHOO.register("yahoo", YAHOO, {version: "2.5.0", build: "895"});
index ffc051f2f5b7e379f984e17ca5cdb5dbd0817c32..68d6d7d33e6e94cdcd98d485331bce45a0c7d085 100755 (executable)
@@ -1,4 +1,32 @@
-YUILoader Utility - Release Notes
+yuiloader - Release Notes
+
+2.5.0
+   * Updated metadata for 2.5.0
+   * (from the get utility) fixed autopurge.
+
+2.4.1
+   * Updated metadata for 2.4.1
+
+2.4.0
+   * NOTE: the API in this release has changed significantly.  Existing implementations
+     will need to be modified in order to use the new version.
+   * yuiloader now includes the yahoo and get components.  This removes the timing
+     problems in the previous versions that forced one to use YAHOO_config or include
+     yahoo.js on the page before yuiloader.
+   * No longer uses YAHOO_config for loading, you must use YAHOO.util.YUILoader
+   * Interacting with YAHOO.register or supplying a verifier function is no longer
+     required to load non-YUI resources.
+   * Supports script sandboxing.  Does not support x-domain sandboxing at this time
+   * removed verifier property, added varName property which is only needed when
+     using external scripts and the application needs to support Safari 2.x.
+   * YUI metadata updates:
+       * Added 'base', 'reset-fonts', 'get', 'json', 'simpleeditor', 'charts, and 'selector'
+       * button and history are no longer beta components.
+       * imageloader promoted from experimental to beta.
+
+2.3.1
+   * The "skin.overrides" property is now applied correctly.  Previously
+     it was looking for "skin.override".
 
 2.3.0
    * Initial release
index 3ebf3fbb7dc875642d0b4e55ee03dbf3f2499240..3af9de3f664bda4afdedfdf893ab56d7b2a67251 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+/**
+ * The YAHOO object is the single global object used by YUI Library.  It
+ * contains utility function for setting up namespaces, inheritance, and
+ * logging.  YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
+ * created automatically for and used by the library.
+ * @module yahoo
+ * @title  YAHOO Global
+ */
+
+/**
+ * YAHOO_config is not included as part of the library.  Instead it is an 
+ * object that can be defined by the implementer immediately before 
+ * including the YUI library.  The properties included in this object
+ * will be used to configure global properties needed as soon as the 
+ * library begins to load.
+ * @class YAHOO_config
+ * @static
+ */
+
+/**
+ * A reference to a function that will be executed every time a YAHOO module
+ * is loaded.  As parameter, this function will receive the version
+ * information for the module. See <a href="YAHOO.env.html#getVersion">
+ * YAHOO.env.getVersion</a> for the description of the version data structure.
+ * @property listener
+ * @type Function
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Set to true if the library will be dynamically loaded after window.onload.
+ * Defaults to false 
+ * @property injecting
+ * @type boolean
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Instructs the yuiloader component to dynamically load yui components and
+ * their dependencies.  See the yuiloader documentation for more information
+ * about dynamic loading
+ * @property load
+ * @static
+ * @default undefined
+ * @see yuiloader
+ */
+
+/**
+ * Forces the use of the supplied locale where applicable in the library
+ * @property locale
+ * @type string
+ * @static
+ * @default undefined
+ */
+
+if (typeof YAHOO == "undefined" || !YAHOO) {
+    /**
+     * The YAHOO global namespace object.  If YAHOO is already defined, the
+     * existing YAHOO object will not be overwritten so that defined
+     * namespaces are preserved.
+     * @class YAHOO
+     * @static
+     */
+    var YAHOO = {};
+}
+
+/**
+ * Returns the namespace specified and creates it if it doesn't exist
+ * <pre>
+ * YAHOO.namespace("property.package");
+ * YAHOO.namespace("YAHOO.property.package");
+ * </pre>
+ * Either of the above would create YAHOO.property, then
+ * YAHOO.property.package
+ *
+ * Be careful when naming packages. Reserved words may work in some browsers
+ * and not others. For instance, the following will fail in Safari:
+ * <pre>
+ * YAHOO.namespace("really.long.nested.namespace");
+ * </pre>
+ * This fails because "long" is a future reserved word in ECMAScript
+ *
+ * @method namespace
+ * @static
+ * @param  {String*} arguments 1-n namespaces to create 
+ * @return {Object}  A reference to the last namespace object created
+ */
+YAHOO.namespace = function() {
+    var a=arguments, o=null, i, j, d;
+    for (i=0; i<a.length; i=i+1) {
+        d=a[i].split(".");
+        o=YAHOO;
+
+        // YAHOO is implied, so it is ignored if it is included
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
+            o[d[j]]=o[d[j]] || {};
+            o=o[d[j]];
+        }
+    }
+
+    return o;
+};
+
+/**
+ * Uses YAHOO.widget.Logger to output a log message, if the widget is
+ * available.
+ *
+ * @method log
+ * @static
+ * @param  {String}  msg  The message to log.
+ * @param  {String}  cat  The log category for the message.  Default
+ *                        categories are "info", "warn", "error", time".
+ *                        Custom categories can be used as well. (opt)
+ * @param  {String}  src  The source of the the message (opt)
+ * @return {Boolean}      True if the log operation was successful.
+ */
+YAHOO.log = function(msg, cat, src) {
+    var l=YAHOO.widget.Logger;
+    if(l && l.log) {
+        return l.log(msg, cat, src);
+    } else {
+        return false;
+    }
+};
+
+/**
+ * Registers a module with the YAHOO object
+ * @method register
+ * @static
+ * @param {String}   name    the name of the module (event, slider, etc)
+ * @param {Function} mainClass a reference to class in the module.  This
+ *                             class will be tagged with the version info
+ *                             so that it will be possible to identify the
+ *                             version that is in use when multiple versions
+ *                             have loaded
+ * @param {Object}   data      metadata object for the module.  Currently it
+ *                             is expected to contain a "version" property
+ *                             and a "build" property at minimum.
+ */
+YAHOO.register = function(name, mainClass, data) {
+    var mods = YAHOO.env.modules;
+    if (!mods[name]) {
+        mods[name] = { versions:[], builds:[] };
+    }
+    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+    m.name = name;
+    m.version = v;
+    m.build = b;
+    m.versions.push(v);
+    m.builds.push(b);
+    m.mainClass = mainClass;
+    // fire the module load listeners
+    for (var i=0;i<ls.length;i=i+1) {
+        ls[i](m);
+    }
+    // label the main class
+    if (mainClass) {
+        mainClass.VERSION = v;
+        mainClass.BUILD = b;
+    } else {
+        YAHOO.log("mainClass is undefined for module " + name, "warn");
+    }
+};
+
+/**
+ * YAHOO.env is used to keep track of what is known about the YUI library and
+ * the browsing environment
+ * @class YAHOO.env
+ * @static
+ */
+YAHOO.env = YAHOO.env || {
+
+    /**
+     * Keeps the version info for all YUI modules that have reported themselves
+     * @property modules
+     * @type Object[]
+     */
+    modules: [],
+    
+    /**
+     * List of functions that should be executed every time a YUI module
+     * reports itself.
+     * @property listeners
+     * @type Function[]
+     */
+    listeners: []
+};
+
+/**
+ * Returns the version data for the specified module:
+ *      <dl>
+ *      <dt>name:</dt>      <dd>The name of the module</dd>
+ *      <dt>version:</dt>   <dd>The version in use</dd>
+ *      <dt>build:</dt>     <dd>The build number in use</dd>
+ *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
+ *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
+ *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
+ *                 current version and build. If 
+ *                 mainClass.VERSION != version or mainClass.BUILD != build,
+ *                 multiple versions of pieces of the library have been
+ *                 loaded, potentially causing issues.</dd>
+ *       </dl>
+ *
+ * @method getVersion
+ * @static
+ * @param {String}  name the name of the module (event, slider, etc)
+ * @return {Object} The version info
+ */
+YAHOO.env.getVersion = function(name) {
+    return YAHOO.env.modules[name] || null;
+};
+
+/**
+ * Do not fork for a browser if it can be avoided.  Use feature detection when
+ * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
+ * number for the browser engine, 0 otherwise.  This value may or may not map
+ * to the version number of the browser using the engine.  The value is 
+ * presented as a float so that it can easily be used for boolean evaluation 
+ * as well as for looking for a particular range of versions.  Because of this, 
+ * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 
+ * reports 1.8).
+ * @class YAHOO.env.ua
+ * @static
+ */
+YAHOO.env.ua = function() {
+    var o={
+
+        /**
+         * Internet Explorer version number or 0.  Example: 6
+         * @property ie
+         * @type float
+         */
+        ie:0,
+
+        /**
+         * Opera version number or 0.  Example: 9.2
+         * @property opera
+         * @type float
+         */
+        opera:0,
+
+        /**
+         * Gecko engine revision number.  Will evaluate to 1 if Gecko 
+         * is detected but the revision could not be found. Other browsers
+         * will be 0.  Example: 1.8
+         * <pre>
+         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
+         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
+         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
+         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
+         * </pre>
+         * @property gecko
+         * @type float
+         */
+        gecko:0,
+
+        /**
+         * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
+         * will evaluate to 1, other browsers 0.  Example: 418.9.1
+         * <pre>
+         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
+         *                                   latest available for Mac OSX 10.3.
+         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
+         * Safari 2.0.4:         418     <-- preventDefault fixed
+         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
+         *                                   different versions of webkit
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event
+         *                                   
+         * </pre>
+         * http://developer.apple.com/internet/safari/uamatrix.html
+         * @property webkit
+         * @type float
+         */
+        webkit:0,
+
+        /**
+         * The mobile property will be set to a string containing any relevant
+         * user agent information when a modern mobile browser is detected.
+         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
+         * devices with the WebKit-based browser, and Opera Mini.  
+         * @property mobile 
+         * @type string
+         */
+        mobile: null 
+    };
+
+    var ua=navigator.userAgent, m;
+
+    // Modern KHTML browsers should qualify as Safari X-Grade
+    if ((/KHTML/).test(ua)) {
+        o.webkit=1;
+    }
+    // Modern WebKit browsers are at least X-Grade
+    m=ua.match(/AppleWebKit\/([^\s]*)/);
+    if (m&&m[1]) {
+        o.webkit=parseFloat(m[1]);
+
+        // Mobile browser check
+        if (/ Mobile\//.test(ua)) {
+            o.mobile = "Apple"; // iPhone or iPod Touch
+        } else {
+            m=ua.match(/NokiaN[^\/]*/);
+            if (m) {
+                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+            }
+        }
+
+    }
+
+    if (!o.webkit) { // not webkit
+        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+        m=ua.match(/Opera[\s\/]([^\s]*)/);
+        if (m&&m[1]) {
+            o.opera=parseFloat(m[1]);
+            m=ua.match(/Opera Mini[^;]*/);
+            if (m) {
+                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+            }
+        } else { // not opera or webkit
+            m=ua.match(/MSIE\s([^;]*)/);
+            if (m&&m[1]) {
+                o.ie=parseFloat(m[1]);
+            } else { // not opera, webkit, or ie
+                m=ua.match(/Gecko\/([^\s]*)/);
+                if (m) {
+                    o.gecko=1; // Gecko detected, look for revision
+                    m=ua.match(/rv:([^\s\)]*)/);
+                    if (m&&m[1]) {
+                        o.gecko=parseFloat(m[1]);
+                    }
+                }
+            }
+        }
+    }
+    
+    return o;
+}();
+
+/*
+ * Initializes the global by creating the default namespaces and applying
+ * any new configuration information that is detected.  This is the setup
+ * for env.
+ * @method init
+ * @static
+ * @private
+ */
+(function() {
+    YAHOO.namespace("util", "widget", "example");
+    if ("undefined" !== typeof YAHOO_config) {
+        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        if (l) {
+            // if YAHOO is loaded multiple times we need to check to see if
+            // this is a new config object.  If it is, add the new component
+            // load listener to the stack
+            for (i=0;i<ls.length;i=i+1) {
+                if (ls[i]==l) {
+                    unique=false;
+                    break;
+                }
+            }
+            if (unique) {
+                ls.push(l);
+            }
+        }
+    }
+})();
+/**
+ * Provides the language utilites and extensions used by the library
+ * @class YAHOO.lang
+ */
+YAHOO.lang = YAHOO.lang || {
+    /**
+     * Determines whether or not the provided object is an array.
+     * Testing typeof/instanceof/constructor of arrays across frame 
+     * boundaries isn't possible in Safari unless you have a reference
+     * to the other frame to test against its Array prototype.  To
+     * handle this case, we test well-known array properties instead.
+     * properties.
+     * @method isArray
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isArray: function(o) { 
+
+        if (o) {
+           var l = YAHOO.lang;
+           return l.isNumber(o.length) && l.isFunction(o.splice);
+        }
+        return false;
+    },
+
+    /**
+     * Determines whether or not the provided object is a boolean
+     * @method isBoolean
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isBoolean: function(o) {
+        return typeof o === 'boolean';
+    },
+    
+    /**
+     * Determines whether or not the provided object is a function
+     * @method isFunction
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isFunction: function(o) {
+        return typeof o === 'function';
+    },
+        
+    /**
+     * Determines whether or not the provided object is null
+     * @method isNull
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isNull: function(o) {
+        return o === null;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a legal number
+     * @method isNumber
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isNumber: function(o) {
+        return typeof o === 'number' && isFinite(o);
+    },
+      
+    /**
+     * Determines whether or not the provided object is of type object
+     * or function
+     * @method isObject
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */  
+    isObject: function(o) {
+return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a string
+     * @method isString
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isString: function(o) {
+        return typeof o === 'string';
+    },
+        
+    /**
+     * Determines whether or not the provided object is undefined
+     * @method isUndefined
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isUndefined: function(o) {
+        return typeof o === 'undefined';
+    },
+    
+    /**
+     * Determines whether or not the property was added
+     * to the object instance.  Returns false if the property is not present
+     * in the object, or was inherited from the prototype.
+     * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
+     * There is a discrepancy between YAHOO.lang.hasOwnProperty and
+     * Object.prototype.hasOwnProperty when the property is a primitive added to
+     * both the instance AND prototype with the same value:
+     * <pre>
+     * var A = function() {};
+     * A.prototype.foo = 'foo';
+     * var a = new A();
+     * a.foo = 'foo';
+     * alert(a.hasOwnProperty('foo')); // true
+     * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
+     * </pre>
+     * @method hasOwnProperty
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    hasOwnProperty: function(o, prop) {
+        if (Object.prototype.hasOwnProperty) {
+            return o.hasOwnProperty(prop);
+        }
+        
+        return !YAHOO.lang.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    },
+    /**
+     * IE will not enumerate native functions in a derived object even if the
+     * function was overridden.  This is a workaround for specific functions 
+     * we care about on the Object prototype. 
+     * @property _IEEnumFix
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @static
+     * @private
+     */
+    _IEEnumFix: function(r, s) {
+        if (YAHOO.env.ua.ie) {
+            var add=["toString", "valueOf"], i;
+            for (i=0;i<add.length;i=i+1) {
+                var fname=add[i],f=s[fname];
+                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+                    r[fname]=f;
+                }
+            }
+        }
+    },
+       
+    /**
+     * Utility to set up the prototype, constructor and superclass properties to
+     * support an inheritance strategy that can chain constructors and methods.
+     * Static members will not be inherited.
+     *
+     * @method extend
+     * @static
+     * @param {Function} subc   the object to modify
+     * @param {Function} superc the object to inherit
+     * @param {Object} overrides  additional properties/methods to add to the
+     *                              subclass prototype.  These will override the
+     *                              matching items obtained from the superclass 
+     *                              if present.
+     */
+    extend: function(subc, superc, overrides) {
+        if (!superc||!subc) {
+            throw new Error("YAHOO.lang.extend failed, please check that " +
+                            "all dependencies are included.");
+        }
+        var F = function() {};
+        F.prototype=superc.prototype;
+        subc.prototype=new F();
+        subc.prototype.constructor=subc;
+        subc.superclass=superc.prototype;
+        if (superc.prototype.constructor == Object.prototype.constructor) {
+            superc.prototype.constructor=superc;
+        }
+    
+        if (overrides) {
+            for (var i in overrides) {
+                subc.prototype[i]=overrides[i];
+            }
+
+            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+        }
+    },
+   
+    /**
+     * Applies all properties in the supplier to the receiver if the
+     * receiver does not have these properties yet.  Optionally, one or 
+     * more methods/properties can be specified (as additional 
+     * parameters).  This option will overwrite the property if receiver 
+     * has it already.  If true is passed as the third parameter, all 
+     * properties will be applied and _will_ overwrite properties in 
+     * the receiver.
+     *
+     * @method augmentObject
+     * @static
+     * @since 2.3.0
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything
+     *        in the supplier will be used unless it would
+     *        overwrite an existing property in the receiver. If true
+     *        is specified as the third parameter, all properties will
+     *        be applied and will overwrite an existing property in
+     *        the receiver
+     */
+    augmentObject: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Absorb failed, verify dependencies.");
+        }
+        var a=arguments, i, p, override=a[2];
+        if (override && override!==true) { // only absorb the specified properties
+            for (i=2; i<a.length; i=i+1) {
+                r[a[i]] = s[a[i]];
+            }
+        } else { // take everything, overwriting only if the third parameter is true
+            for (p in s) { 
+                if (override || !r[p]) {
+                    r[p] = s[p];
+                }
+            }
+            
+            YAHOO.lang._IEEnumFix(r, s);
+        }
+    },
+    /**
+     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
+     * @see YAHOO.lang.augmentObject
+     * @method augmentProto
+     * @static
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything 
+     *        in the supplier will be used unless it would overwrite an existing 
+     *        property in the receiver.  if true is specified as the third 
+     *        parameter, all properties will be applied and will overwrite an 
+     *        existing property in the receiver
+     */
+    augmentProto: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Augment failed, verify dependencies.");
+        }
+        //var a=[].concat(arguments);
+        var a=[r.prototype,s.prototype];
+        for (var i=2;i<arguments.length;i=i+1) {
+            a.push(arguments[i]);
+        }
+        YAHOO.lang.augmentObject.apply(this, a);
+    },
+
+      
+    /**
+     * Returns a simple string representation of the object or array.
+     * Other types of objects will be returned unprocessed.  Arrays
+     * are expected to be indexed.  Use object notation for
+     * associative arrays.
+     * @method dump
+     * @since 2.3.0
+     * @param o {Object} The object to dump
+     * @param d {int} How deep to recurse child objects, default 3
+     * @return {String} the dump result
+     */
+    dump: function(o, d) {
+        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+            COMMA=', ', ARROW=' => ';
+
+        // Cast non-objects to string
+        // Skip dates because the std toString is what we want
+        // Skip HTMLElement-like objects because trying to dump 
+        // an element will cause an unhandled exception in FF 2.x
+        if (!l.isObject(o)) {
+            return o + "";
+        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
+            return o;
+        } else if  (l.isFunction(o)) {
+            return FUN;
+        }
+
+        // dig into child objects the depth specifed. Default 3
+        d = (l.isNumber(d)) ? d : 3;
+
+        // arrays [1, 2, 3]
+        if (l.isArray(o)) {
+            s.push("[");
+            for (i=0,len=o.length;i<len;i=i+1) {
+                if (l.isObject(o[i])) {
+                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                } else {
+                    s.push(o[i]);
+                }
+                s.push(COMMA);
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("]");
+        // objects {k1 => v1, k2 => v2}
+        } else {
+            s.push("{");
+            for (i in o) {
+                if (l.hasOwnProperty(o, i)) {
+                    s.push(i + ARROW);
+                    if (l.isObject(o[i])) {
+                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    } else {
+                        s.push(o[i]);
+                    }
+                    s.push(COMMA);
+                }
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("}");
+        }
+
+        return s.join("");
+    },
+
+    /**
+     * Does variable substitution on a string. It scans through the string 
+     * looking for expressions enclosed in { } braces. If an expression 
+     * is found, it is used a key on the object.  If there is a space in
+     * the key, the first word is used for the key and the rest is provided
+     * to an optional function to be used to programatically determine the
+     * value (the extra information might be used for this decision). If 
+     * the value for the key in the object, or what is returned from the
+     * function has a string value, number value, or object value, it is 
+     * substituted for the bracket expression and it repeats.  If this
+     * value is an object, it uses the Object's toString() if this has
+     * been overridden, otherwise it does a shallow dump of the key/value
+     * pairs.
+     * @method substitute
+     * @since 2.3.0
+     * @param s {String} The string that will be modified.
+     * @param o {Object} An object containing the replacement values
+     * @param f {Function} An optional function that can be used to
+     *                     process each match.  It receives the key,
+     *                     value, and any extra metadata included with
+     *                     the key inside of the braces.
+     * @return {String} the substituted string
+     */
+    substitute: function (s, o, f) {
+        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+
+
+        for (;;) {
+            i = s.lastIndexOf(LBRACE);
+            if (i < 0) {
+                break;
+            }
+            j = s.indexOf(RBRACE, i);
+            if (i + 1 >= j) {
+                break;
+            }
+
+            //Extract key and meta info 
+            token = s.substring(i + 1, j);
+            key = token;
+            meta = null;
+            k = key.indexOf(SPACE);
+            if (k > -1) {
+                meta = key.substring(k + 1);
+                key = key.substring(0, k);
+            }
+
+            // lookup the value
+            v = o[key];
+
+            // if a substitution function was provided, execute it
+            if (f) {
+                v = f(key, v, meta);
+            }
+
+            if (l.isObject(v)) {
+                if (l.isArray(v)) {
+                    v = l.dump(v, parseInt(meta, 10));
+                } else {
+                    meta = meta || "";
+
+                    // look for the keyword 'dump', if found force obj dump
+                    var dump = meta.indexOf(DUMP);
+                    if (dump > -1) {
+                        meta = meta.substring(4);
+                    }
+
+                    // use the toString if it is not the Object toString 
+                    // and the 'dump' meta info was not found
+                    if (v.toString===Object.prototype.toString||dump>-1) {
+                        v = l.dump(v, parseInt(meta, 10));
+                    } else {
+                        v = v.toString();
+                    }
+                }
+            } else if (!l.isString(v) && !l.isNumber(v)) {
+                // This {block} has no replace string. Save it for later.
+                v = "~-" + saved.length + "-~";
+                saved[saved.length] = token;
+
+                // break;
+            }
+
+            s = s.substring(0, i) + v + s.substring(j + 1);
+
+
+        }
+
+        // restore saved {block}s
+        for (i=saved.length-1; i>=0; i=i-1) {
+            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
+        }
+
+        return s;
+    },
+
+
+    /**
+     * Returns a string without any leading or trailing whitespace.  If 
+     * the input is not a string, the input will be returned untouched.
+     * @method trim
+     * @since 2.3.0
+     * @param s {string} the string to trim
+     * @return {string} the trimmed string
+     */
+    trim: function(s){
+        try {
+            return s.replace(/^\s+|\s+$/g, "");
+        } catch(e) {
+            return s;
+        }
+    },
+
+    /**
+     * Returns a new object containing all of the properties of
+     * all the supplied objects.  The properties from later objects
+     * will overwrite those in earlier objects.
+     * @method merge
+     * @since 2.3.0
+     * @param arguments {Object*} the objects to merge
+     * @return the new merged object
+     */
+    merge: function() {
+        var o={}, a=arguments;
+        for (var i=0, l=a.length; i<l; i=i+1) {
+            YAHOO.lang.augmentObject(o, a[i], true);
+        }
+        return o;
+    },
+
+    /**
+     * Executes the supplied function in the context of the supplied 
+     * object 'when' milliseconds later.  Executes the function a 
+     * single time unless periodic is set to true.
+     * @method later
+     * @since 2.4.0
+     * @param when {int} the number of milliseconds to wait until the fn 
+     * is executed
+     * @param o the context object
+     * @param fn {Function|String} the function to execute or the name of 
+     * the method in the 'o' object to execute
+     * @param data [Array] data that is provided to the function.  This accepts
+     * either a single item or an array.  If an array is provided, the
+     * function is executed with one parameter for each array item.  If
+     * you need to pass a single array parameter, it needs to be wrapped in
+     * an array [myarray]
+     * @param periodic {boolean} if true, executes continuously at supplied 
+     * interval until canceled
+     * @return a timer object. Call the cancel() method on this object to 
+     * stop the timer.
+     */
+    later: function(when, o, fn, data, periodic) {
+        when = when || 0; 
+        o = o || {};
+        var m=fn, d=data, f, r;
+
+        if (YAHOO.lang.isString(fn)) {
+            m = o[fn];
+        }
+
+        if (!m) {
+            throw new TypeError("method undefined");
+        }
+
+        if (!YAHOO.lang.isArray(d)) {
+            d = [data];
+        }
+
+        f = function() {
+            m.apply(o, d);
+        };
+
+        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
+
+        return {
+            interval: periodic,
+            cancel: function() {
+                if (this.interval) {
+                    clearInterval(r);
+                } else {
+                    clearTimeout(r);
+                }
+            }
+        };
+    },
+    
+    /**
+     * A convenience method for detecting a legitimate non-null value.
+     * Returns false for null/undefined/NaN, true for other values, 
+     * including 0/false/''
+     * @method isValue
+     * @since 2.3.0
+     * @param o {any} the item to test
+     * @return {boolean} true if it is not null/undefined/NaN || false
+     */
+    isValue: function(o) {
+        // return (o || o === false || o === 0 || o === ''); // Infinity fails
+        var l = YAHOO.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+    }
+
+};
+
+/*
+ * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
+ * @class YAHOO.util.Lang
+ */
+YAHOO.util.Lang = YAHOO.lang;
+/**
+ * Same as YAHOO.lang.augmentObject, except it only applies prototype 
+ * properties.  This is an alias for augmentProto.
+ * @see YAHOO.lang.augmentObject
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*|boolean}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver.  if true
+ *        is specified as the third parameter, all properties will
+ *        be applied and will overwrite an existing property in
+ *        the receiver
+ */
+YAHOO.lang.augment = YAHOO.lang.augmentProto;
+
+/**
+ * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
+ * @for YAHOO
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver
+ */
+YAHOO.augment = YAHOO.lang.augmentProto;
+       
+/**
+ * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
+ * @method extend
+ * @static
+ * @param {Function} subc   the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides  additional properties/methods to add to the
+ *        subclass prototype.  These will override the
+ *        matching items obtained from the superclass if present.
+ */
+YAHOO.extend = YAHOO.lang.extend;
+
+YAHOO.register("yahoo", YAHOO, {version: "2.5.0", build: "895"});
+/**
+ * Provides a mechanism to fetch remote resources and
+ * insert them into a document
+ * @module get
+ * @requires yahoo
+ */
+
+/**
+ * Fetches and inserts one or more script or link nodes into the document 
+ * @namespace YAHOO.util
+ * @class YAHOO.util.Get
+ */
+YAHOO.util.Get = function() {
+
+    /**
+     * hash of queues to manage multiple requests
+     * @property queues
+     * @private
+     */
+    var queues={}, 
+        
+    /**
+     * queue index used to generate transaction ids
+     * @property qidx
+     * @type int
+     * @private
+     */
+        qidx=0, 
+        
+    /**
+     * node index used to generate unique node ids
+     * @property nidx
+     * @type int
+     * @private
+     */
+        nidx=0, 
+
+        // ridx=0,
+
+        // sandboxFrame=null,
+
+    /**
+     * interal property used to prevent multiple simultaneous purge 
+     * processes
+     * @property purging
+     * @type boolean
+     * @private
+     */
+        purging=false,
+
+        ua=YAHOO.env.ua, 
+        
+        lang=YAHOO.lang;
+    
+    /** 
+     * Generates an HTML element, this is not appended to a document
+     * @method _node
+     * @param type {string} the type of element
+     * @param attr {string} the attributes
+     * @param win {Window} optional window to create the element in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _node = function(type, attr, win) {
+        var w = win || window, d=w.document, n=d.createElement(type);
+
+        for (var i in attr) {
+            if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
+                n.setAttribute(i, attr[i]);
+            }
+        }
+
+        return n;
+    };
+
+    /**
+     * Generates a link node
+     * @method _linkNode
+     * @param url {string} the url for the css file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _linkNode = function(url, win) {
+        return _node("link", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/css",
+                "rel": "stylesheet",
+                "href": url
+            }, win);
+    };
+
+    /**
+     * Generates a script node
+     * @method _scriptNode
+     * @param url {string} the url for the script file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _scriptNode = function(url, win) {
+        return _node("script", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/javascript",
+                "src": url
+            }, win);
+    };
+
+    /**
+     * Returns the data payload for callback functions
+     * @method _returnData
+     * @private
+     */
+    var _returnData = function(q) {
+        return {
+                tId: q.tId,
+                win: q.win,
+                data: q.data,
+                nodes: q.nodes,
+                purge: function() {
+                    _purge(this.tId);
+                }
+            };
+    };
+
+    /*
+     * The request failed, execute fail handler with whatever
+     * was accomplished.  There isn't a failure case at the
+     * moment unless you count aborted transactions
+     * @method _fail
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _fail = function(id) {
+        var q = queues[id];
+        // execute failure callback
+        if (q.onFailure) {
+            var sc=q.scope || q.win;
+            q.onFailure.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * The request is complete, so executing the requester's callback
+     * @method _finish
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _finish = function(id) {
+        var q = queues[id];
+        q.finished = true;
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        // execute success callback
+        if (q.onSuccess) {
+            var sc=q.scope || q.win;
+            q.onSuccess.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * Loads the next item for a given request
+     * @method _next
+     * @param id {string} the id of the request
+     * @param loaded {string} the url that was just loaded, if any
+     * @private
+     */
+    var _next = function(id, loaded) {
+        var q = queues[id];
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        if (loaded) {
+            q.url.shift(); 
+            if (q.varName) {
+                q.varName.shift(); 
+            }
+        } else {
+            // This is the first pass: make sure the url is an array
+            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
+            if (q.varName) {
+                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
+            }
+        }
+
+        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
+
+        if (q.url.length === 0) {
+            // Safari 2.x workaround - There is no way to know when 
+            // a script is ready in versions of Safari prior to 3.x.
+            // Adding an extra node reduces the problem, but doesn't
+            // eliminate it completely because the browser executes
+            // them asynchronously. 
+            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
+                    !q.finalpass && !q.varName) {
+                // Add another script node.  This does not guarantee that the
+                // scripts will execute in order, but it does appear to fix the
+                // problem on fast connections more effectively than using an
+                // arbitrary timeout.  It is possible that the browser does
+                // block subsequent script execution in this case for a limited
+                // time.
+                var extra = _scriptNode(null, q.win);
+                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
+                q.nodes.push(extra); h.appendChild(extra);
+
+            } else {
+                _finish(id);
+            }
+
+            return;
+        } 
+
+
+        var url = q.url[0];
+
+        if (q.type === "script") {
+            n = _scriptNode(url, w);
+        } else {
+            n = _linkNode(url, w);
+        }
+
+        // track this node's load progress
+        _track(q.type, n, id, url, w, q.url.length);
+
+        // add the node to the queue so we can return it to the user supplied callback
+        q.nodes.push(n);
+
+        // add it to the head
+        h.appendChild(n);
+        
+
+        // FireFox does not support the onload event for link nodes, so there is
+        // no way to make the css requests synchronous. This means that the css 
+        // rules in multiple files could be applied out of order in this browser
+        // if a later request returns before an earlier one.  Safari too.
+        if ((ua.webkit || ua.gecko) && q.type === "css") {
+            _next(id, url);
+        }
+    };
+
+    /**
+     * Removes processed queues and corresponding nodes
+     * @method _autoPurge
+     * @private
+     */
+    var _autoPurge = function() {
+
+        if (purging) {
+            return;
+        }
+
+        purging = true;
+        for (var i in queues) {
+            var q = queues[i];
+            if (q.autopurge && q.finished) {
+                _purge(q.tId);
+                delete queues[i];
+            }
+        }
+
+        purging = false;
+    };
+
+    /**
+     * Removes the nodes for the specified queue
+     * @method _purge
+     * @private
+     */
+    var _purge = function(tId) {
+        var q=queues[tId];
+        if (q) {
+            var n=q.nodes, l=n.length, d=q.win.document, 
+                h=d.getElementsByTagName("head")[0];
+            for (var i=0; i<l; i=i+1) {
+                h.removeChild(n[i]);
+            }
+        }
+        q.nodes = [];
+    };
+
+    /**
+     * Saves the state for the request and begins loading
+     * the requested urls
+     * @method queue
+     * @param type {string} the type of node to insert
+     * @param url {string} the url to load
+     * @param opts the hash of options for this request
+     * @private
+     */
+    var _queue = function(type, url, opts) {
+
+        var id = "q" + (qidx++);
+        opts = opts || {};
+
+        if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
+            _autoPurge();
+        }
+
+        queues[id] = lang.merge(opts, {
+            tId: id,
+            type: type,
+            url: url,
+            finished: false,
+            nodes: []
+        });
+
+        var q = queues[id];
+        q.win = q.win || window;
+        q.scope = q.scope || q.win;
+        q.autopurge = ("autopurge" in q) ? q.autopurge : 
+                      (type === "script") ? true : false;
+
+        lang.later(0, q, _next, id);
+
+        return {
+            tId: id
+        };
+    };
+
+    /**
+     * Detects when a node has been loaded.  In the case of
+     * script nodes, this does not guarantee that contained
+     * script is ready to use.
+     * @method _track
+     * @param type {string} the type of node to track
+     * @param n {HTMLElement} the node to track
+     * @param id {string} the id of the request
+     * @param url {string} the url that is being loaded
+     * @param win {Window} the targeted window
+     * @param qlength the number of remaining items in the queue,
+     * including this one
+     * @param trackfn {Function} function to execute when finished
+     * the default is _next
+     * @private
+     */
+    var _track = function(type, n, id, url, win, qlength, trackfn) {
+        var f = trackfn || _next;
+
+        // IE supports the readystatechange event for script and css nodes
+        if (ua.ie) {
+            n.onreadystatechange = function() {
+                var rs = this.readyState;
+                if ("loaded" === rs || "complete" === rs) {
+                    f(id, url);
+                }
+            };
+
+        // webkit prior to 3.x is problemmatic
+        } else if (ua.webkit) {
+
+            if (type === "script") {
+
+                // Safari 3.x supports the load event for script nodes (DOM2)
+                if (ua.webkit > 419) {
+
+                    n.addEventListener("load", function() {
+                        f(id, url);
+                    });
+
+                // Nothing can be done with Safari < 3.x except to pause and hope
+                // for the best, particularly after last script is inserted. The
+                // scripts will always execute in the order they arrive, not
+                // necessarily the order in which they were inserted.  To support
+                // script nodes with complete reliability in these browsers, script
+                // nodes either need to invoke a function in the window once they
+                // are loaded or the implementer needs to provide a well-known
+                // property that the utility can poll for.
+                } else {
+                    // Poll for the existence of the named variable, if it
+                    // was supplied.
+                    var q = queues[id];
+                    if (q.varName) {
+                        var freq=YAHOO.util.Get.POLL_FREQ;
+                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
+                        q.attempts = 0;
+                        q._cache = q.varName[0].split(".");
+                        q.timer = lang.later(freq, q, function(o) {
+                            var a=this._cache, l=a.length, w=this.win, i;
+                            for (i=0; i<l; i=i+1) {
+                                w = w[a[i]];
+                                if (!w) {
+                                    // if we have exausted our attempts, give up
+                                    this.attempts++;
+                                    if (this.attempts++ > this.maxattempts) {
+                                        q.timer.cancel();
+                                        _fail(id);
+                                    } else {
+                                    }
+                                    return;
+                                }
+                            }
+                            
+
+                            q.timer.cancel();
+                            f(id, url);
+
+                        }, null, true);
+                    } else {
+                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
+                    }
+                }
+            } 
+
+        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
+        // script nodes.  Opera, but not FF, supports the onload event for link
+        // nodes.
+        } else { 
+            n.onload = function() {
+                f(id, url);
+            };
+        }
+    };
+
+    return {
+
+        /**
+         * The default poll freqency in ms, when needed
+         * @property POLL_FREQ
+         * @static
+         * @type int
+         * @default 10
+         */
+        POLL_FREQ: 10,
+
+        /**
+         * The number of request required before an automatic purge.
+         * property PURGE_THRESH
+         * @static
+         * @type int
+         * @default 20
+         */
+        PURGE_THRESH: 20,
+
+        /**
+         * The length time to poll for varName when loading a script in
+         * Safari 2.x before the transaction fails.
+         * property TIMEOUT
+         * @static
+         * @type int
+         * @default 2000
+         */
+        TIMEOUT: 2000,
+        
+        /**
+         * Called by the the helper for detecting script load in Safari
+         * @method _finalize
+         * @param id {string} the transaction id
+         * @private
+         */
+        _finalize: function(id) {
+            lang.later(0, null, _finish, id);
+        },
+
+        /**
+         * Abort a transaction
+         * @method abort
+         * @param {string|object} either the tId or the object returned from
+         * script() or css()
+         */
+        abort: function(o) {
+            var id = (lang.isString(o)) ? o : o.tId;
+            var q = queues[id];
+            if (q) {
+                q.aborted = true;
+            }
+        }, 
+
+        /**
+         * Fetches and inserts one or more script nodes into the head
+         * of the current document or the document in a specified window.
+         *
+         * @method script
+         * @static
+         * @param url {string|string[]} the url or urls to the script(s)
+         * @param opts {object} Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the script(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>onFailure</dt>
+         * <dd>
+         * callback to execute when the script load operation fails
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted successfully</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove any nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>autopurge</dt>
+         * <dd>
+         * setting to true will let the utilities cleanup routine purge 
+         * the script once loaded
+         * </dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callback when the script(s) are
+         * loaded.
+         * </dd>
+         * <dt>varName</dt>
+         * <dd>
+         * variable that should be available when a script is finished
+         * loading.  Used to help Safari 2.x and below with script load 
+         * detection.  The type of this property should match what was
+         * passed into the url parameter: if loading a single url, a
+         * string can be supplied.  If loading multiple scripts, you
+         * must supply an array that contains the variable name for
+         * each script.
+         * </dd>
+         * </dl>
+         * <pre>
+         * // assumes yahoo, dom, and event are already on the page
+         * &nbsp;&nbsp;YAHOO.util.Get.script(
+         * &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
+         * &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log("won't cause error because YAHOO is the scope");
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log(o.nodes.length === 2) // true
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// o.purge(); // optionally remove the script nodes immediately
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;onFailure: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;data: "foo",
+         * &nbsp;&nbsp;&nbsp;&nbsp;scope: YAHOO,
+         * &nbsp;&nbsp;&nbsp;&nbsp;// win: otherframe // target another window/frame
+         * &nbsp;&nbsp;&nbsp;&nbsp;autopurge: true // allow the utility to choose when to remove the nodes
+         * &nbsp;&nbsp;&#125;);
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        script: function(url, opts) { return _queue("script", url, opts); },
+
+        /**
+         * Fetches and inserts one or more css link nodes into the 
+         * head of the current document or the document in a specified
+         * window.
+         * @method css
+         * @static
+         * @param url {string} the url or urls to the css file(s)
+         * @param opts Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the css file(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>win</dl>
+         * <dd>the window the link nodes(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callbacks when the nodes(s) are
+         * loaded.
+         * </dd>
+         * </dl>
+         * <pre>
+         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
+         * </pre>
+         * <pre>
+         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        css: function(url, opts) {
+            return _queue("css", url, opts); 
+        }
+    };
+}();
+
+YAHOO.register("get", YAHOO.util.Get, {version: "2.5.0", build: "895"});
 /**
  * Provides dynamic loading for the YUI library.  It includes the dependency
  * info for the library, and will automatically pull in dependencies for
@@ -23,17 +1595,13 @@ version: 2.3.0
  *      version management, automatic sandboxing
  */
 (function() {
-    // Define YAHOO_config if it doesn't exist.  Only relevant if YAHOO is not
-    // already on the page
-    if (typeof YAHOO_config === "undefined") {
-        YAHOO_config = {};
-    }
 
-    // YUI is locally scoped, only pieces of it will be referenced in YAHOO
-    // after YAHOO has been loaded.
+    var Y=YAHOO, util=Y.util, lang=Y.lang, env=Y.env;
     var YUI = {
 
+        dupsAllowed: {'yahoo': true, 'get': true},
+
         /*
          * The library metadata for the current release  The is the default
          * value for YAHOO.util.YUILoader.moduleInfo
@@ -42,7 +1610,7 @@ version: 2.3.0
          */
         info: {
 
-    'base': 'http://yui.yahooapis.com/2.3.0/build/',
+    'base': 'http://yui.yahooapis.com/2.5.0/build/',
 
     'skin': {
         'defaultSkin': 'sam',
@@ -67,9 +1635,14 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'base': {
+            'type': 'css',
+            'path': 'base/base-min.css'
+        },
+
         'button': {
             'type': 'js',
-            'path': 'button/button-beta-min.js',
+            'path': 'button/button-min.js',
             'requires': ['element'],
             'optional': ['menu'],
             'skinnable': true
@@ -82,9 +1655,15 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'charts': {
+            'type': 'js',
+            'path': 'charts/charts-experimental-min.js',
+            'requires': ['element', 'json', 'datasource']
+        },
+
         'colorpicker': {
             'type': 'js',
-            'path': 'colorpicker/colorpicker-beta-min.js',
+            'path': 'colorpicker/colorpicker-min.js',
             'requires': ['slider', 'element'],
             'optional': ['animation'],
             'skinnable': true
@@ -101,8 +1680,8 @@ version: 2.3.0
             'path': 'container/container-min.js',
             'requires': ['dom', 'event'],
             // button is optional, but creates a circular dep
-            //'optional': ['dragdrop', 'animation', 'button'],
-            'optional': ['dragdrop', 'animation'],
+            //'optional': ['dragdrop', 'animation', 'connection', 'connection', 'button'],
+            'optional': ['dragdrop', 'animation', 'connection'],
             'supersedes': ['containercore'],
             'skinnable': true
         },
@@ -110,7 +1689,14 @@ version: 2.3.0
         'containercore': {
             'type': 'js',
             'path': 'container/container_core-min.js',
-            'requires': ['dom', 'event']
+            'requires': ['dom', 'event'],
+            'pkg': 'container'
+        },
+
+        'cookie': {
+            'type': 'js',
+            'path': 'cookie/cookie-beta-min.js',
+            'requires': ['yahoo']
         },
 
         'datasource': {
@@ -143,7 +1729,7 @@ version: 2.3.0
         'editor': {
             'type': 'js',
             'path': 'editor/editor-beta-min.js',
-            'requires': ['menu', 'container', 'element', 'button'],
+            'requires': ['menu', 'element', 'button'],
             'optional': ['animation', 'dragdrop'],
             'skinnable': true
         },
@@ -165,6 +1751,12 @@ version: 2.3.0
             'path': 'fonts/fonts-min.css'
         },
 
+        'get': {
+            'type': 'js',
+            'path': 'get/get-min.js',
+            'requires': ['yahoo']
+        },
+
         'grids': {
             'type': 'css',
             'path': 'grids/grids-min.css',
@@ -174,15 +1766,36 @@ version: 2.3.0
 
         'history': {
             'type': 'js',
-            'path': 'history/history-beta-min.js',
+            'path': 'history/history-min.js',
             'requires': ['event']
         },
 
-        'imageloader': {
+         'imagecropper': {
+             'type': 'js',
+             'path': 'imagecropper/imagecropper-beta-min.js',
+             'requires': ['dom', 'event', 'dragdrop', 'element', 'resize'],
+             'skinnable': true
+         },
+
+         'imageloader': {
             'type': 'js',
-            'path': 'imageloader/imageloader-experimental-min.js',
+            'path': 'imageloader/imageloader-min.js',
             'requires': ['event', 'dom']
-        },
+         },
+
+         'json': {
+            'type': 'js',
+            'path': 'json/json-min.js',
+            'requires': ['yahoo']
+         },
+
+         'layout': {
+             'type': 'js',
+             'path': 'layout/layout-beta-min.js',
+             'requires': ['dom', 'event', 'element'],
+             'optional': ['animation', 'dragdrop', 'resize', 'selector'],
+             'skinnable': true
+         }, 
 
         'logger': {
             'type': 'js',
@@ -199,6 +1812,20 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'profiler': {
+            'type': 'js',
+            'path': 'profiler/profiler-beta-min.js',
+            'requires': ['yahoo']
+        },
+
+
+        'profilerviewer': {
+            'type': 'js',
+            'path': 'profilerviewer/profilerviewer-beta-min.js',
+            'requires': ['yuiloader', 'element'],
+            'skinnable': true
+        },
+
         'reset': {
             'type': 'css',
             'path': 'reset/reset-min.css'
@@ -207,7 +1834,38 @@ version: 2.3.0
         'reset-fonts-grids': {
             'type': 'css',
             'path': 'reset-fonts-grids/reset-fonts-grids.css',
-            'supersedes': ['reset', 'fonts', 'grids']
+            'supersedes': ['reset', 'fonts', 'grids', 'reset-fonts'],
+            'rollup': 3
+        },
+
+        'reset-fonts': {
+            'type': 'css',
+            'path': 'reset-fonts/reset-fonts.css',
+            'supersedes': ['reset', 'fonts'],
+            'rollup': 2
+        },
+
+         'resize': {
+             'type': 'js',
+             'path': 'resize/resize-beta-min.js',
+             'requires': ['dom', 'event', 'dragdrop', 'element'],
+             'optional': ['animation'],
+             'skinnable': true
+         },
+
+        'selector': {
+            'type': 'js',
+            'path': 'selector/selector-beta-min.js',
+            'requires': ['yahoo', 'dom']
+        },
+
+        'simpleeditor': {
+            'type': 'js',
+            'path': 'editor/simpleeditor-beta-min.js',
+            'requires': ['element'],
+            'optional': ['containercore', 'menu', 'button', 'animation', 'dragdrop'],
+            'skinnable': true,
+            'pkg': 'editor'
         },
 
         'slider': {
@@ -232,6 +1890,12 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'uploader': {
+            'type': 'js',
+            'path': 'uploader/uploader-experimental.js',
+            'requires': ['yahoo']
+        },
+
         'utilities': {
             'type': 'js',
             'path': 'utilities/utilities.js',
@@ -258,7 +1922,7 @@ version: 2.3.0
 
         'yuitest': {
             'type': 'js',
-            'path': 'yuitest/yuitest-beta-min.js',
+            'path': 'yuitest/yuitest-min.js',
             'requires': ['logger'],
             'skinnable': true
         }
@@ -266,39 +1930,21 @@ version: 2.3.0
 }
  , 
 
-        // Simple utils since we can't count on YAHOO.lang being available.
         ObjectUtil: {
-            appendArray: function(o, a) {
-                if (a) {
-                    for (var i=0; i<a.length; i=i+1) {
-                        o[a[i]] = true;
-                    }
-                }
-            },
-
-            clone: function(o) {
-                var c = {};
-                for (var i in o) {
-                    c[i] = o[i];
-                }
-                return c;
-            },
-
-            merge: function() {
-                var o={}, a=arguments, i, j;
-                for (i=0; i<a.length; i=i+1) {
-                    
-                    for (j in a[i]) {
-                        o[j] = a[i][j];
+            appendArray: function(o, a) {
+                if (a) {
+                    for (var i=0; i<a.length; i=i+1) {
+                        o[a[i]] = true;
                     }
                 }
-                return o;
             },
 
             keys: function(o, ordered) {
                 var a=[], i;
                 for (i in o) {
-                    a.push(i);
+                    if (lang.hasOwnProperty(o, i)) {
+                        a.push(i);
+                    }
                 }
 
                 return a;
@@ -343,115 +1989,10 @@ version: 2.3.0
             uniq: function(a) {
                 return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));
             }
-        },
-
-
-        // loader instances
-        loaders: [],
-
-        finishInit: function(yahooref) {
-
-            // YAHOO has been loaded either in this window or passed 
-            // from the sandbox routine.  Set up local references 
-            // to the loader and module metadata in the YAHOO object
-            // in question so additional modules can be loaded. 
-
-            yahooref = yahooref || YAHOO;
-
-            yahooref.env.YUIInfo=YUI.info;
-            yahooref.util.YUILoader=YUI.YUILoader;
-
-        },
-
-        /*
-         * Global handler for the module loaded event exposed by
-         * YAHOO
-         */
-        onModuleLoaded: function(minfo) {
-
-            var mname = minfo.name, m;
-
-            for (var i=0; i<YUI.loaders.length; i=i+1) {
-                YUI.loaders[i].loadNext(mname);
-            }
-
-            //console.log(YAHOO.lang.dump(minfo));
-
-        },
-
-        /*
-         * Sets up the module metadata
-         */
-        init: function() {
-
-            var c = YAHOO_config, o = c.load, 
-                y_loaded = (typeof YAHOO !== "undefined" && YAHOO.env);
-
-
-            // add our listener to the existing YAHOO.env.listeners stack
-            if (y_loaded) {
-
-                YAHOO.env.listeners.push(YUI.onModuleLoaded);
-
-            // define a listener in YAHOO_config that YAHOO will pick up
-            // when it is loaded.
-            } else {
-
-                if (c.listener) {
-                    YUI.cachedCallback = c.listener;
-                }
-
-                c.listener = function(minfo) {
-                    YUI.onModuleLoaded(minfo);
-                    if (YUI.cachedCallback) {
-                        YUI.cachedCallback(minfo);
-                    }
-                };
-            }
-
-            // Fetch the required modules immediately if specified
-            // in YAHOO_config.  Otherwise detect YAHOO and fetch
-            // it if it doesn't exist so we have a place to put
-            // the loader.  The problem with this is that it will
-            // prevent rollups from working
-            if (o || !y_loaded) {
-
-                o = o || {};
-
-                var loader = new YUI.YUILoader(o);
-                loader.onLoadComplete = function() {
-
-                        YUI.finishInit();
-
-                        if (o.onLoadComplete) {
-
-                            loader._pushEvents();
-                            o.onLoadComplete(loader);
-                        }
-
-                        
-                    };
-
-                // If no load was requested, we must load YAHOO
-                // so we have a place to put the loader
-                if (!y_loaded) {
-                    loader.require("yahoo");
-                }
-
-                loader.insert(null, o);
-            } else {
-                YUI.finishInit();
-            }
         }
-
     };
 
-    YUI.YUILoader = function(o) {
-
-        // Inform the library that it is being injected
-        YAHOO_config.injecting = true;
-
-        o = o || {};
+    YAHOO.util.YUILoader = function(o) {
 
         /**
          * Internal callback to handle multiple internal insert() calls
@@ -461,21 +2002,83 @@ version: 2.3.0
          */
         this._internalCallback = null;
 
+        /**
+         * Use the YAHOO environment listener to detect script load.  This
+         * is only switched on for Safari 2.x and below.
+         * @property _useYahooListener
+         * @private
+         */
+        this._useYahooListener = false;
+
         /**
          * Callback that will be executed when the loader is finished
          * with an insert
-         * @method onLoadComplete
+         * @method onSuccess
+         * @type function
+         */
+        this.onSuccess = null;
+
+        /**
+         * Callback that will be executed if there is a failure
+         * @method onFailure
+         * @type function
+         */
+        this.onFailure = Y.log;
+
+        /**
+         * Callback that will be executed each time a new module is loaded
+         * @method onProgress
          * @type function
          */
-        this.onLoadComplete = null;
+        this.onProgress = null;
+
+        /**
+         * The execution scope for all callbacks
+         * @property scope
+         * @default this
+         */
+        this.scope = this;
+
+        /**
+         * Data that is passed to all callbacks
+         * @property data
+         */
+        this.data = null;
+
+        /**
+         * The name of the variable in a sandbox or script node 
+         * (for external script support in Safari 2.x and earlier)
+         * to reference when the load is complete.  If this variable 
+         * is not available in the specified scripts, the operation will 
+         * fail.  
+         * @property varName
+         * @type string
+         */
+        this.varName = null;
 
         /**
          * The base directory.
          * @property base
          * @type string
-         * @default build
+         * @default http://yui.yahooapis.com/[YUI VERSION]/build/
+         */
+        this.base = YUI.info.base;
+
+        /**
+         * A list of modules that should not be loaded, even if
+         * they turn up in the dependency tree
+         * @property ignore
+         * @type string[]
+         */
+        this.ignore = null;
+
+        /**
+         * A list of modules that should always be loaded, even
+         * if they have already been inserted into the page.
+         * @property force
+         * @type string
          */
-        this.base = ("base" in o) ? o.base : YUI.info.base;
+        this.force = null;
 
         /**
          * Should we allow rollups
@@ -483,23 +2086,33 @@ version: 2.3.0
          * @type boolean
          * @default true
          */
-        this.allowRollup = ("allowRollup" in o) ? o.allowRollup : true;
+        this.allowRollup = true;
 
         /**
-         * Filter to apply to result url
+         * A filter to apply to result urls.  This filter will modify the default
+         * path for all modules.  The default path for the YUI library is the
+         * minified version of the files (e.g., event-min.js).  The filter property
+         * can be a predefined filter or a custom filter.  The valid predefined 
+         * filters are:
+         * <dl>
+         *  <dt>DEBUG</dt>
+         *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
+         *      This option will automatically include the logger widget</dd>
+         *  <dt>RAW</dt>
+         *  <dd>Selects the non-minified version of the library (e.g., event.js).
+         * </dl>
+         * You can also define a custom filter, which must be an object literal 
+         * containing a search expression and a replace string:
+         * <pre>
+         *  myFilter: &#123; 
+         *      'searchExp': "-min\\.js", 
+         *      'replaceStr': "-debug.js"
+         *  &#125;
+         * </pre>
          * @property filter
-         * @type string|object
-         */
-        this.filter = o.filter;
-
-        /**
-         * Create a sandbox rather than inserting into lib into.
-         * the current context.  Not currently supported
-         * property sandbox
-         * @type boolean
-         * @default false
+         * @type string|{searchExp: string, replaceStr: string}
          */
-        this.sandbox = o.sandbox;
+        this.filter = null;
 
         /**
          * The list of requested modules
@@ -512,7 +2125,7 @@ version: 2.3.0
          * The library metadata
          * @property moduleInfo
          */
-        this.moduleInfo = o.moduleInfo || YUI.info.moduleInfo;
+        this.moduleInfo = lang.merge(YUI.info.moduleInfo);
 
         /**
          * List of rollup files found in the library metadata
@@ -527,7 +2140,7 @@ version: 2.3.0
          * @type boolean
          * @default false
          */
-        this.loadOptional = o.loadOptional || false;
+        this.loadOptional = false;
 
         /**
          * All of the derived dependencies in sorted order, which
@@ -563,7 +2176,6 @@ version: 2.3.0
          */
         this.inserted = {};
 
-
         /**
          * Provides the information used to skin the skinnable components.
          * The following skin definition would result in 'skin1' and 'skin2'
@@ -602,17 +2214,23 @@ version: 2.3.0
          *   </code>
          *   @property skin
          */
-        this.skin = o.skin || YUI.ObjectUtil.clone(YUI.info.skin); 
 
+        var self = this;
 
-        if (o.require) {
-            this.require(o.require);
-        }
+        env.listeners.push(function(m) {
+            if (self._useYahooListener) {
+                //Y.log("YAHOO listener: " + m.name);
+                self.loadNext(m.name);
+            }
+        });
+
+        this.skin = lang.merge(YUI.info.skin); 
+
+        this._config(o);
 
-        YUI.loaders.push(this);
     };
 
-    YUI.YUILoader.prototype = {
+    Y.util.YUILoader.prototype = {
 
         FILTERS: {
             RAW: { 
@@ -627,10 +2245,49 @@ version: 2.3.0
 
         SKIN_PREFIX: "skin-",
 
-        /** Add a new module to the component metadata.  The javascript 
-         * component must also use YAHOO.register to notify the loader 
-         * when it has been loaded, or a verifier function must be
-         * provided
+        _config: function(o) {
+
+            if (!o) {
+                return;
+            }
+
+            // lang.augmentObject(this, o);
+
+            // apply config values
+            for (var i in o) {
+                if (lang.hasOwnProperty(o, i)) {
+                    switch (i) {
+                        case "require":
+                            this.require(o[i]);
+                            break;
+
+                        case "filter":
+                            var f = o[i];
+
+                            if (typeof f === "string") {
+                                f = f.toUpperCase();
+
+                                // the logger must be available in order to use the debug
+                                // versions of the library
+                                if (f === "DEBUG") {
+                                    this.require("logger");
+                                }
+
+                                this.filter = this.FILTERS[f];
+                            } else {
+                                this.filter = f;
+                            }
+
+                            break;
+
+                        default:
+                            this[i] = o[i];
+                    }
+                }
+            }
+        },
+
+        /** Add a new module to the component metadata.         
          * <dl>
          *     <dt>name:</dt>       <dd>required, the component name</dd>
          *     <dt>type:</dt>       <dd>required, the component type (js or css)</dd>
@@ -639,7 +2296,6 @@ version: 2.3.0
          *     <dt>optional:</dt>   <dd>the optional modules for this component</dd>
          *     <dt>supersedes:</dt> <dd>the modules this component replaces</dd>
          *     <dt>rollup:</dt>     <dd>the number of superseded modules required for automatic rollup</dd>
-         *     <dt>verifier:</dt>   <dd>a function that is executed to determine when the module is fully loaded</dd>
          *     <dt>fullpath:</dt>   <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
          *     <dt>skinnable:</dt>  <dd>flag to determine if skin assets should automatically be pulled in</dd>
          * </dl>
@@ -704,11 +2360,14 @@ version: 2.3.0
             if (mod) {
                 name = this.formatSkin(skin, mod);
                 if (!this.moduleInfo[name]) {
+                    var mdef = this.moduleInfo[mod];
+                    var pkg = mdef.pkg || mod;
                     this.addModule({
                         'name': name,
                         'type': 'css',
                         //'path': this.skin.base + skin + "/" + mod + ".css"
-                        'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                        // 'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                        'path': pkg + '/' + this.skin.base + skin + "/" + mod + ".css"
                     });
                 }
             }
@@ -721,15 +2380,35 @@ version: 2.3.0
          * @param mod The module definition from moduleInfo
          */
         getRequires: function(mod) {
+            if (!mod) {
+                return [];
+            }
+
             if (!this.dirty && mod.expanded) {
                 return mod.expanded;
             }
 
             mod.requires=mod.requires || [];
-            var i, d=[], r=mod.requires, o=mod.optional, s=mod.supersedes, info=this.moduleInfo;
+            var i, d=[], r=mod.requires, o=mod.optional, info=this.moduleInfo, m;
             for (i=0; i<r.length; i=i+1) {
                 d.push(r[i]);
-                YUI.ArrayUtil.appendArray(d, this.getRequires(info[r[i]]));
+                m = info[r[i]];
+                YUI.ArrayUtil.appendArray(d, this.getRequires(m));
+
+                // add existing skins for skinnable modules as well.  The only
+                // way to do this is go through the list of required items (this
+                // assumes that _skin is called before getRequires is called on
+                // the module.
+                if (m.skinnable) {
+                    var req=this.required, l=req.length;
+                    for (var j=0; j<l; j=j+1) {
+                        // YAHOO.log('checking ' + r[j]);
+                        if (req[j].indexOf(r[j]) > -1) {
+                            // YAHOO.log('adding ' + r[j]);
+                            d.push(req[j]);
+                        }
+                    }
+                }
             }
 
             if (o && this.loadOptional) {
@@ -755,11 +2434,12 @@ version: 2.3.0
 
             var o = {};
             o[name] = true;
-            s = mod && mod.supersedes;
+
+            var s = mod && mod.supersedes;
 
             YUI.ObjectUtil.appendArray(o, s);
 
-            // console.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
+            // YAHOO.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
 
             return o;
         },
@@ -772,8 +2452,8 @@ version: 2.3.0
          */
         calculate: function(o) {
             if (this.dirty) {
-
-                this._setup(o);
+                this._config(o);
+                this._setup();
                 this._explode();
                 this._skin();
                 if (this.allowRollup) {
@@ -782,6 +2462,8 @@ version: 2.3.0
                 this._reduce();
                 this._sort();
 
+                // Y.log("after calculate: " + lang.dump(this.required));
+
                 this.dirty = false;
             }
         },
@@ -791,28 +2473,28 @@ version: 2.3.0
          * modules already detected will not be loaded again unless a force
          * option is encountered.  Called by calculate()
          * @method _setup
-         * @param o optional options object
          * @private
          */
-        _setup: function(o) {
+        _setup: function() {
 
-            o = o || {};
-            this.loaded = YUI.ObjectUtil.clone(this.inserted); 
+            this.loaded = lang.merge(this.inserted); // shallow clone
             
-            if (!this.sandbox && typeof YAHOO !== "undefined" && YAHOO.env) {
-                this.loaded = YUI.ObjectUtil.merge(this.loaded, YAHOO.env.modules);
+            if (!this._sandbox) {
+                this.loaded = lang.merge(this.loaded, env.modules);
             }
 
+            // Y.log("already loaded stuff: " + lang.dump(this.loaded, 0));
+
             // add the ignore list to the list of loaded packages
-            if (o.ignore) {
-                YUI.ObjectUtil.appendArray(this.loaded, o.ignore);
+            if (this.ignore) {
+                YUI.ObjectUtil.appendArray(this.loaded, this.ignore);
             }
 
             // remove modules on the force list from the loaded list
-            if (o.force) {
-                for (var i=0; i<o.force.length; i=i+1) {
-                    if (o.force[i] in this.loaded) {
-                        delete this.loaded[o.force[i]];
+            if (this.force) {
+                for (var i=0; i<this.force.length; i=i+1) {
+                    if (this.force[i] in this.loaded) {
+                        delete this.loaded[this.force[i]];
                     }
                 }
             }
@@ -856,7 +2538,7 @@ version: 2.3.0
             for (i in r) {
                 mod = this.moduleInfo[i];
                 if (mod && mod.skinnable) {
-                    var o=this.skin.override, j;
+                    var o=this.skin.overrides, j;
                     if (o && o[i]) {
                         for (j=0; j<o[i].length; j=j+1) {
                             this.require(this.formatSkin(o[i][j], i));
@@ -938,13 +2620,12 @@ version: 2.3.0
 
                     // there can be only one
                     if (!r[i] && !this.loaded[i]) {
-                        m =this.moduleInfo[i]; s = m.supersedes; roll=true;
+                        m =this.moduleInfo[i]; s = m.supersedes; roll=false;
 
                         if (!m.rollup) {
                             continue;
                         }
 
-
                         var skin = this.parseSkin(i), c = 0;
                         if (skin) {
 
@@ -953,20 +2634,19 @@ version: 2.3.0
                                     c++;
                                     roll = (c >= m.rollup);
                                     if (roll) {
+                                        // Y.log("skin rollup " + lang.dump(r));
                                         break;
                                     }
                                 }
                             }
 
-
                         } else {
 
-                            // require all modules to trigger a rollup (using the 
-                            // threshold value has not proved worthwhile)
+                            // check the threshold
                             for (j=0;j<s.length;j=j+1) {
 
                                 // if the superseded module is loaded, we can't load the rollup
-                                if (this.loaded[s[j]]) {
+                                if (this.loaded[s[j]] && (!YUI.dupsAllowed[s[j]])) {
                                     roll = false;
                                     break;
                                 // increment the counter if this module is required.  if we are
@@ -975,6 +2655,7 @@ version: 2.3.0
                                     c++;
                                     roll = (c >= m.rollup);
                                     if (roll) {
+                                        // Y.log("over thresh " + c + ", " + lang.dump(r));
                                         break;
                                     }
                                 }
@@ -982,6 +2663,7 @@ version: 2.3.0
                         }
 
                         if (roll) {
+                            // Y.log("rollup: " +  i + ", " + lang.dump(this, 1));
                             // add the rollup
                             r[i] = true;
                             rolled = true;
@@ -1020,14 +2702,14 @@ version: 2.3.0
                     var skinDef = this.parseSkin(i);
 
                     if (skinDef) {
-                        //console.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
+                        //YAHOO.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
                         // the skin rollup will not have a module name
                         if (!skinDef.module) {
                             var skin_pre = this.SKIN_PREFIX + skinDef.skin;
-                            //console.log("skin_pre: " + skin_pre);
+                            //YAHOO.log("skin_pre: " + skin_pre);
                             for (j in r) {
                                 if (j !== i && j.indexOf(skin_pre) > -1) {
-                                    //console.log ("removing component skin: " + j);
+                                    //YAHOO.log ("removing component skin: " + j);
                                     delete r[j];
                                 }
                             }
@@ -1072,7 +2754,7 @@ version: 2.3.0
 
                 var ss=info[bb] && info[bb].supersedes;
                 if (ss) {
-                    for (ii=0; ii<ss.length; ii=i+1) {
+                    for (ii=0; ii<ss.length; ii=ii+1) {
                         if (requires(aa, ss[ii])) {
                             return true;
                         }
@@ -1140,67 +2822,214 @@ version: 2.3.0
             this.sorted = s;
         },
 
+        toString: function() {
+            var o = {
+                type: "YUILoader",
+                base: this.base,
+                filter: this.filter,
+                required: this.required,
+                loaded: this.loaded,
+                inserted: this.inserted
+            };
+
+            lang.dump(o, 1);
+        },
+
         /**
          * inserts the requested modules and their dependencies.  
          * <code>type</code> can be "js" or "css".  Both script and 
          * css are inserted if type is not provided.
          * @method insert
-         * @param callback {Function} a function to execute when the load
-         * is complete.
          * @param o optional options object
          * @param type {string} the type of dependency to insert
          */
-        insert: function(callback, o, type) {
+        insert: function(o, type) {
+            // if (o) {
+            //     Y.log("insert: " + lang.dump(o, 1) + ", " + type);
+            // } else {
+            //     Y.log("insert: " + this.toString() + ", " + type);
+            // }
 
-            //if (!this.onLoadComplete) {
-                //this.onLoadComplete = callback;
-            //}
+            // build the dependency list
+            this.calculate(o);
 
             if (!type) {
+                // Y.log("trying to load css first");
                 var self = this;
                 this._internalCallback = function() {
                             self._internalCallback = null;
-                            self.insert(callback, o, "js");
+                            self.insert(null, "js");
                         };
-                this.insert(null, o, "css");
+                this.insert(null, "css");
                 return;
             }
 
-            o = o || {};
+            // set a flag to indicate the load has started
+            this._loading = true;
 
-            // store the callback for when we are done
-            this.onLoadComplete = callback || this.onLoadComplete;
+            // keep the loadType (js, css or undefined) cached
+            this.loadType = type;
 
-            // store the optional filter
-            var f = o && o.filter || null;
+            // start the load
+            this.loadNext();
 
-            if (typeof f === "string") {
-                f = f.toUpperCase();
+        },
 
-                // the logger must be available in order to use the debug
-                // versions of the library
-                if (f === "DEBUG") {
-                    this.require("logger");
-                }
+        /*
+         * Interns the script for the requested modules.  The callback is
+         * provided a reference to the sandboxed YAHOO object.  This only
+         * applies to the script: css can not be sandboxed; css will be
+         * loaded into the page normally if specified.
+         * @method sandbox
+         * @param callback {Function} the callback to exectued when the load is
+         *        complete.
+         */
+        sandbox: function(o, type) {
+            if (o) {
+                // YAHOO.log("sandbox: " + lang.dump(o, 1) + ", " + type);
+            } else {
+                // YAHOO.log("sandbox: " + this.toString() + ", " + type);
             }
 
-            this.filter = this.FILTERS[f] || f || this.FILTERS[this.filter] || this.filter;
+            this._config(o);
 
-            // store the options... not currently in use
-            this.insertOptions = o;
+            if (!this.onSuccess) {
+throw new Error("You must supply an onSuccess handler for your sandbox");
+            }
 
-            // build the dependency list
-            this.calculate(o);
+            this._sandbox = true;
 
-            // set a flag to indicate the load has started
-            this.loading = true;
+            var self = this;
 
-            // keep the loadType (js, css or undefined) cached
-            this.loadType = type;
+            // take care of any css first (this can't be sandboxed)
+            if (!type || type !== "js") {
+                this._internalCallback = function() {
+                            self._internalCallback = null;
+                            self.sandbox(null, "js");
+                        };
+                this.insert(null, "css");
+                return;
+            }
 
-            // start the load
-            this.loadNext();
+            // get the connection manager if not on the page
+            if (!util.Connect) {
+                // get a new loader instance to load connection.
+                var ld = new YAHOO.util.YUILoader();
+                ld.insert({
+                    base: this.base,
+                    filter: this.filter,
+                    require: "connection",
+                    onSuccess: function() {
+                        this.sandbox(null, "js");
+                    },
+                    scope: this
+                }, "js");
+                return;
+            }
+
+            this._scriptText = [];
+            this._loadCount = 0;
+            this._stopCount = this.sorted.length;
+            this._xhr = [];
+
+            this.calculate();
+
+            var s=this.sorted, l=s.length, i, m, url;
+
+            for (i=0; i<l; i=i+1) {
+                m = this.moduleInfo[s[i]];
+
+                // undefined modules cause a failure
+                if (!m) {
+                    this.onFailure.call(this.scope, {
+                            msg: "undefined module " + m,
+                            data: this.data
+                        });
+                    for (var j=0;j<this._xhr.length;j=j+1) {
+                        this._xhr[j].abort();
+                    }
+                    return;
+                }
+
+                // css files should be done
+                if (m.type !== "js") {
+                    this._loadCount++;
+                    continue;
+                }
+
+                url = m.fullpath || this._url(m.path);
+
+                // YAHOO.log("xhr request: " + url + ", " + i);
+
+                var xhrData = {
+
+                    success: function(o) {
+                        
+                        var idx=o.argument[0], name=o.argument[2];
+
+                        // store the response in the position it was requested
+                        this._scriptText[idx] = o.responseText; 
+                        
+                        // YAHOO.log("received: " + o.responseText.substr(0, 100) + ", " + idx);
+                    
+                        if (this.onProgress) {
+                            this.onProgress.call(this.scope, {
+                                        name: name,
+                                        scriptText: o.responseText,
+                                        xhrResponse: o,
+                                        data: this.data
+                                    });
+                        }
+
+                        // only generate the sandbox once everything is loaded
+                        this._loadCount++;
+
+                        if (this._loadCount >= this._stopCount) {
+
+                            // the variable to find
+                            var v = this.varName || "YAHOO";
+
+                            // wrap the contents of the requested modules in an anonymous function
+                            var t = "(function() {\n";
+                        
+                            // return the locally scoped reference.
+                            var b = "\nreturn " + v + ";\n})();";
+
+                            var ref = eval(t + this._scriptText.join("\n") + b);
+
+                            this._pushEvents(ref);
+
+                            if (ref) {
+                                this.onSuccess.call(this.scope, {
+                                        reference: ref,
+                                        data: this.data
+                                    });
+                            } else {
+                                this.onFailure.call(this.scope, {
+                                        msg: this.varName + " reference failure",
+                                        data: this.data
+                                    });
+                            }
+                        }
+                    },
+
+                    failure: function(o) {
+                        this.onFailure.call(this.scope, {
+                                msg: "XHR failure",
+                                xhrResponse: o,
+                                data: this.data
+                            });
+                    },
+
+                    scope: this,
+
+                    // module index, module name, sandbox name
+                    argument: [i, url, s[i]]
+
+                };
 
+                this._xhr.push(util.Connect.asyncRequest('GET', url, xhrData));
+            }
         },
 
         /**
@@ -1215,37 +3044,45 @@ version: 2.3.0
          */
         loadNext: function(mname) {
 
-            // console.log("loadNext executing, just loaded " + mname);
-
-            // The global handler that is called when each module is loaded
-            // will pass that module name to this function.  Storing this
-            // data to avoid loading the same module multiple times
-            if (mname) {
-                this.inserted[mname] = true;
-                //var o = this.getProvides(mname);
-                //this.inserted = YUI.ObjectUtil.merge(this.inserted, o);
-            }
-
             // It is possible that this function is executed due to something
             // else one the page loading a YUI module.  Only react when we
             // are actively loading something
-            if (!this.loading) {
+            if (!this._loading) {
                 return;
             }
 
-            // if the module that was just loaded isn't what we were expecting,
-            // continue to wait
-            if (mname && mname !== this.loading) {
-                return;
+            if (mname) {
+
+                // if the module that was just loaded isn't what we were expecting,
+                // continue to wait
+                if (mname !== this._loading) {
+                    return;
+                }
+
+                // YAHOO.log("loadNext executing, just loaded " + mname);
+
+                // The global handler that is called when each module is loaded
+                // will pass that module name to this function.  Storing this
+                // data to avoid loading the same module multiple times
+                this.inserted[mname] = true;
+
+                if (this.onProgress) {
+                    this.onProgress.call(this.scope, {
+                            name: mname,
+                            data: this.data
+                        });
+                }
+                //var o = this.getProvides(mname);
+                //this.inserted = lang.merge(this.inserted, o);
             }
-            
-            var s=this.sorted, len=s.length, i, m, url;
+
+            var s=this.sorted, len=s.length, i, m;
 
             for (i=0; i<len; i=i+1) {
 
                 // This.inserted keeps track of what the loader has loaded
                 if (s[i] in this.inserted) {
-                    // console.log(s[i] + " alread loaded ");
+                    // YAHOO.log(s[i] + " alread loaded ");
                     continue;
                 }
 
@@ -1253,67 +3090,67 @@ version: 2.3.0
                 // from YAHOO, loadNext may be called multiple times for
                 // the same module when loading a rollup.  We can safely
                 // skip the subsequent requests
-                if (s[i] === this.loading) {
-                    // console.log("still loading " + s[i] + ", waiting");
+                if (s[i] === this._loading) {
+                    // YAHOO.log("still loading " + s[i] + ", waiting");
                     return;
                 }
 
                 // log("inserting " + s[i]);
-
                 m = this.moduleInfo[s[i]];
 
+                if (!m) {
+                    this.onFailure.call(this.scope, {
+                            msg: "undefined module " + m,
+                            data: this.data
+                        });
+                    return;
+                }
+
                 // The load type is stored to offer the possibility to load
                 // the css separately from the script.
                 if (!this.loadType || this.loadType === m.type) {
-                    this.loading = s[i];
+                    this._loading = s[i];
+                    //YAHOO.log("attempting to load " + s[i] + ", " + this.base);
 
-                    // Insert the css node and continue.  It is possible
-                    // that the css file will load out of order ... this
-                    // may be a problem that needs to be addressed, but
-                    // unlike the script files, there is no notification
-                    // mechanism in place for the css files.
-                    if (m.type === "css") {
-
-                        url = m.fullpath || this._url(m.path);
-                        
-                        this.insertCss(url);
-                        this.inserted[s[i]] = true;
+                    var fn=(m.type === "css") ? util.Get.css : util.Get.script,
+                        url=m.fullpath || this._url(m.path), self=this, 
+                        c=function(o) {
+                            self.loadNext(o.data);
+                        };
 
-                    // Scripts must be loaded in order, so we wait for the
-                    // notification from YAHOO or a verifier function to 
-                    // process the next script
-                    } else {
+                    // safari 2.x or lower, script, and part of YUI
+                    if (env.ua.webkit && env.ua.webkit < 420 && m.type === "js" && 
+                          !m.varName) {
+                          //YUI.info.moduleInfo[s[i]]) {
+                          //YAHOO.log("using YAHOO env " + s[i] + ", " + m.varName);
+                        c = null;
+                        this._useYahooListener = true;
+                    }
 
-                        url = m.fullpath || this._url(m.path);
-                        this.insertScript(url);
-
-                        // if a verifier was included for this module, execute
-                        // it, passing the name of the module, and a callback
-                        // that must be exectued when the verifier is done.
-                        if (m.verifier) {
-                            var self = this, name=s[i];
-                            m.verifier(name, function() {
-                                    self.loadNext(name);
-                                });
-                        }
+                    fn(url, {
+                        data: s[i],
+                        onSuccess: c,
+                        varName: m.varName,
+                        scope: self 
+                    });
 
-                        return;
-                    }
+                    return;
                 }
             }
 
             // we are finished
-            this.loading = null;
-
+            this._loading = null;
 
             // internal callback for loading css first
             if (this._internalCallback) {
                 var f = this._internalCallback;
                 this._internalCallback = null;
-                f(this);
-            } else if (this.onLoadComplete) {
+                f.call(this);
+            } else if (this.onSuccess) {
                 this._pushEvents();
-                this.onLoadComplete(this);
+                this.onSuccess.call(this.scope, {
+                        data: this.data
+                    });
             }
 
         },
@@ -1322,11 +3159,13 @@ version: 2.3.0
          * In IE, the onAvailable/onDOMReady events need help when Event is
          * loaded dynamically
          * @method _pushEvents
+         * @param {Function} optional function reference
          * @private
          */
-        _pushEvents: function() {
-            if (typeof YAHOO !== "undefined" && YAHOO.util && YAHOO.util.Event) {
-                YAHOO.util.Event._load();
+        _pushEvents: function(ref) {
+            var r = ref || YAHOO;
+            if (r.util && r.util.Event) {
+                r.util.Event._load();
             }
         },
 
@@ -1343,66 +3182,16 @@ version: 2.3.0
             u = u + path;
 
             if (f) {
-                // console.log("filter: " + f + ", " + f.searchExp + 
+                // YAHOO.log("filter: " + f + ", " + f.searchExp + 
                 // ", " + f.replaceStr);
                 u = u.replace(new RegExp(f.searchExp), f.replaceStr);
             }
 
-            // console.log(u);
+            // YAHOO.log(u);
 
             return u;
-        },
-
-        /**
-         * Inserts a script node
-         * @method insertScript
-         * @param url {string} the full url for the script
-         * @param win {Window} optional window to target
-         */
-        insertScript: function(url, win) {
-
-            //console.log("inserting script " + url);
-            var w = win || window, d=w.document, n=d.createElement("script"),
-                h = d.getElementsByTagName("head")[0];
-
-            n.src = url;
-            n.type = "text/javascript";
-            h.appendChild(n);
-        },
-
-        /**
-         * Inserts a css link node
-         * @method insertCss
-         * @param url {string} the full url for the script
-         * @param win {Window} optional window to target
-         */
-        insertCss: function(url, win) {
-            // console.log("inserting css " + url);
-            var w = win || window, d=w.document, n=d.createElement("link"),
-                h = d.getElementsByTagName("head")[0];
-
-            n.href = url;
-            n.type = "text/css";
-            n.rel = "stylesheet";
-            h.appendChild(n);
-        },
-       
-        /*
-         * Interns the script for the requested modules.  The callback is
-         * provided a reference to the sandboxed YAHOO object.  This only
-         * applies to the script: css can not be sandboxed.  Not implemented.
-         * @method sandbox
-         * @param callback {Function} the callback to exectued when the load is
-         *        complete.
-         * @notimplemented
-         */
-        sandbox: function(callback) {
-            // this.calculate({
-                         //sandbox: true
-                     //});
         }
-    };
 
-    YUI.init();
+    };
 
 })();
index 869658394eb8885c6591162c1ea7b6d0df7c6ae5..3a8d0f63e76408e0f259d069aff77e4e4b660a8b 100755 (executable)
@@ -1,51 +1,10 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-(function(){if(typeof YAHOO_config==="undefined"){YAHOO_config={};}
-var YUI={info:{'base':'http://yui.yahooapis.com/2.3.0/build/','skin':{'defaultSkin':'sam','base':'assets/skins/','path':'skin.css','rollup':3},'moduleInfo':{'animation':{'type':'js','path':'animation/animation-min.js','requires':['dom','event']},'autocomplete':{'type':'js','path':'autocomplete/autocomplete-min.js','requires':['dom','event'],'optional':['connection','animation'],'skinnable':true},'button':{'type':'js','path':'button/button-beta-min.js','requires':['element'],'optional':['menu'],'skinnable':true},'calendar':{'type':'js','path':'calendar/calendar-min.js','requires':['event','dom'],'skinnable':true},'colorpicker':{'type':'js','path':'colorpicker/colorpicker-beta-min.js','requires':['slider','element'],'optional':['animation'],'skinnable':true},'connection':{'type':'js','path':'connection/connection-min.js','requires':['event']},'container':{'type':'js','path':'container/container-min.js','requires':['dom','event'],'optional':['dragdrop','animation'],'supersedes':['containercore'],'skinnable':true},'containercore':{'type':'js','path':'container/container_core-min.js','requires':['dom','event']},'datasource':{'type':'js','path':'datasource/datasource-beta-min.js','requires':['event'],'optional':['connection']},'datatable':{'type':'js','path':'datatable/datatable-beta-min.js','requires':['element','datasource'],'optional':['calendar','dragdrop'],'skinnable':true},'dom':{'type':'js','path':'dom/dom-min.js','requires':['yahoo']},'dragdrop':{'type':'js','path':'dragdrop/dragdrop-min.js','requires':['dom','event']},'editor':{'type':'js','path':'editor/editor-beta-min.js','requires':['menu','container','element','button'],'optional':['animation','dragdrop'],'skinnable':true},'element':{'type':'js','path':'element/element-beta-min.js','requires':['dom','event']},'event':{'type':'js','path':'event/event-min.js','requires':['yahoo']},'fonts':{'type':'css','path':'fonts/fonts-min.css'},'grids':{'type':'css','path':'grids/grids-min.css','requires':['fonts'],'optional':['reset']},'history':{'type':'js','path':'history/history-beta-min.js','requires':['event']},'imageloader':{'type':'js','path':'imageloader/imageloader-experimental-min.js','requires':['event','dom']},'logger':{'type':'js','path':'logger/logger-min.js','requires':['event','dom'],'optional':['dragdrop'],'skinnable':true},'menu':{'type':'js','path':'menu/menu-min.js','requires':['containercore'],'skinnable':true},'reset':{'type':'css','path':'reset/reset-min.css'},'reset-fonts-grids':{'type':'css','path':'reset-fonts-grids/reset-fonts-grids.css','supersedes':['reset','fonts','grids']},'slider':{'type':'js','path':'slider/slider-min.js','requires':['dragdrop'],'optional':['animation']},'tabview':{'type':'js','path':'tabview/tabview-min.js','requires':['element'],'optional':['connection'],'skinnable':true},'treeview':{'type':'js','path':'treeview/treeview-min.js','requires':['event'],'skinnable':true},'utilities':{'type':'js','path':'utilities/utilities.js','supersedes':['yahoo','event','dragdrop','animation','dom','connection','element','yahoo-dom-event'],'rollup':6},'yahoo':{'type':'js','path':'yahoo/yahoo-min.js'},'yahoo-dom-event':{'type':'js','path':'yahoo-dom-event/yahoo-dom-event.js','supersedes':['yahoo','event','dom'],'rollup':3},'yuiloader':{'type':'js','path':'yuiloader/yuiloader-beta-min.js'},'yuitest':{'type':'js','path':'yuitest/yuitest-beta-min.js','requires':['logger'],'skinnable':true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}}},clone:function(o){var c={};for(var i in o){c[i]=o[i];}
-return c;},merge:function(){var o={},a=arguments,i,j;for(i=0;i<a.length;i=i+1){for(j in a[i]){o[j]=a[i][j];}}
-return o;},keys:function(o,ordered){var a=[],i;for(i in o){a.push(i);}
-return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}
-return-1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}
-return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}},loaders:[],finishInit:function(yahooref){yahooref=yahooref||YAHOO;yahooref.env.YUIInfo=YUI.info;yahooref.util.YUILoader=YUI.YUILoader;},onModuleLoaded:function(minfo){var mname=minfo.name,m;for(var i=0;i<YUI.loaders.length;i=i+1){YUI.loaders[i].loadNext(mname);}},init:function(){var c=YAHOO_config,o=c.load,y_loaded=(typeof YAHOO!=="undefined"&&YAHOO.env);if(y_loaded){YAHOO.env.listeners.push(YUI.onModuleLoaded);}else{if(c.listener){YUI.cachedCallback=c.listener;}
-c.listener=function(minfo){YUI.onModuleLoaded(minfo);if(YUI.cachedCallback){YUI.cachedCallback(minfo);}};}
-if(o||!y_loaded){o=o||{};var loader=new YUI.YUILoader(o);loader.onLoadComplete=function(){YUI.finishInit();if(o.onLoadComplete){loader._pushEvents();o.onLoadComplete(loader);}};if(!y_loaded){loader.require("yahoo");}
-loader.insert(null,o);}else{YUI.finishInit();}}};YUI.YUILoader=function(o){YAHOO_config.injecting=true;o=o||{};this._internalCallback=null;this.onLoadComplete=null;this.base=("base"in o)?o.base:YUI.info.base;this.allowRollup=("allowRollup"in o)?o.allowRollup:true;this.filter=o.filter;this.sandbox=o.sandbox;this.required={};this.moduleInfo=o.moduleInfo||YUI.info.moduleInfo;this.rollups=null;this.loadOptional=o.loadOptional||false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};this.skin=o.skin||YUI.ObjectUtil.clone(YUI.info.skin);if(o.require){this.require(o.require);}
-YUI.loaders.push(this);};YUI.YUILoader.prototype={FILTERS:{RAW:{'searchExp':"-min\\.js",'replaceStr':".js"},DEBUG:{'searchExp':"-min\\.js",'replaceStr':"-debug.js"}},SKIN_PREFIX:"skin-",addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}
-this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;for(var i=0;i<a.length;i=i+1){this.required[a[i]]=true;var s=this.parseSkin(a[i]);if(s){this._addSkin(s.skin,s.module);}}
-YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin);if(!this.moduleInfo[name]){this.addModule({'name':name,'type':'css','path':this.skin.base+skin+"/"+this.skin.path,'rollup':this.skin.rollup});}
-if(mod){name=this.formatSkin(skin,mod);if(!this.moduleInfo[name]){this.addModule({'name':name,'type':'css','path':mod+'/'+this.skin.base+skin+"/"+mod+".css"});}}},getRequires:function(mod){if(!this.dirty&&mod.expanded){return mod.expanded;}
-mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,s=mod.supersedes,info=this.moduleInfo;for(i=0;i<r.length;i=i+1){d.push(r[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[r[i]]));}
-if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}
-mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name){var mod=this.moduleInfo[name];var o={};o[name]=true;s=mod&&mod.supersedes;YUI.ObjectUtil.appendArray(o,s);return o;},calculate:function(o){if(this.dirty){this._setup(o);this._explode();this._skin();if(this.allowRollup){this._rollup();}
-this._reduce();this._sort();this.dirty=false;}},_setup:function(o){o=o||{};this.loaded=YUI.ObjectUtil.clone(this.inserted);if(!this.sandbox&&typeof YAHOO!=="undefined"&&YAHOO.env){this.loaded=YUI.ObjectUtil.merge(this.loaded,YAHOO.env.modules);}
-if(o.ignore){YUI.ObjectUtil.appendArray(this.loaded,o.ignore);}
-if(o.force){for(var i=0;i<o.force.length;i=i+1){if(o.force[i]in this.loaded){delete this.loaded[o.force[i]];}}}},_explode:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}},_skin:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod&&mod.skinnable){var o=this.skin.override,j;if(o&&o[i]){for(j=0;j<o[i].length;j=j+1){this.require(this.formatSkin(o[i][j],i));}}else{this.require(this.formatSkin(this.skin.defaultSkin,i));}}}},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}
-return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}
-return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[i];if(m&&m.rollup){rollups[i]=m;}}
-this.rollups=rollups;}
-for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=this.moduleInfo[i];s=m.supersedes;roll=true;if(!m.rollup){continue;}
-var skin=this.parseSkin(i),c=0;if(skin){for(j in r){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]){roll=false;break;}else if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}
-if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}
-if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j]in r){delete r[s[j]];}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded;var requires=function(aa,bb){if(loaded[bb]){return false;}
-var ii,mm=info[aa],rr=mm&&mm.expanded;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}
-var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=i+1){if(requires(aa,ss[ii])){return true;}}}
-return false;};for(var i in this.required){s.push(i);}
-var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}
-if(moved){break;}else{p=p+1;}}
-if(!moved){break;}}
-this.sorted=s;},insert:function(callback,o,type){if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(callback,o,"js");};this.insert(null,o,"css");return;}
-o=o||{};this.onLoadComplete=callback||this.onLoadComplete;var f=o&&o.filter||null;if(typeof f==="string"){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}}
-this.filter=this.FILTERS[f]||f||this.FILTERS[this.filter]||this.filter;this.insertOptions=o;this.calculate(o);this.loading=true;this.loadType=type;this.loadNext();},loadNext:function(mname){if(mname){this.inserted[mname]=true;}
-if(!this.loading){return;}
-if(mname&&mname!==this.loading){return;}
-var s=this.sorted,len=s.length,i,m,url;for(i=0;i<len;i=i+1){if(s[i]in this.inserted){continue;}
-if(s[i]===this.loading){return;}
-m=this.moduleInfo[s[i]];if(!this.loadType||this.loadType===m.type){this.loading=s[i];if(m.type==="css"){url=m.fullpath||this._url(m.path);this.insertCss(url);this.inserted[s[i]]=true;}else{url=m.fullpath||this._url(m.path);this.insertScript(url);if(m.verifier){var self=this,name=s[i];m.verifier(name,function(){self.loadNext(name);});}
-return;}}}
-this.loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f(this);}else if(this.onLoadComplete){this._pushEvents();this.onLoadComplete(this);}},_pushEvents:function(){if(typeof YAHOO!=="undefined"&&YAHOO.util&&YAHOO.util.Event){YAHOO.util.Event._load();}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr);}
-return u;},insertScript:function(url,win){var w=win||window,d=w.document,n=d.createElement("script"),h=d.getElementsByTagName("head")[0];n.src=url;n.type="text/javascript";h.appendChild(n);},insertCss:function(url,win){var w=win||window,d=w.document,n=d.createElement("link"),h=d.getElementsByTagName("head")[0];n.href=url;n.type="text/css";n.rel="stylesheet";h.appendChild(n);},sandbox:function(callback){}};YUI.init();})();
\ No newline at end of file
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.0",build:"895"});YAHOO.util.Get=function(){var I={},H=0,B=0,O=false,A=YAHOO.env.ua,D=YAHOO.lang;var Q=function(U,R,V){var S=V||window,W=S.document,X=W.createElement(U);for(var T in R){if(R[T]&&YAHOO.lang.hasOwnProperty(R,T)){X.setAttribute(T,R[T]);}}return X;};var N=function(R,S){return Q("link",{"id":"yui__dyn_"+(B++),"type":"text/css","rel":"stylesheet","href":R},S);
+};var M=function(R,S){return Q("script",{"id":"yui__dyn_"+(B++),"type":"text/javascript","src":R},S);};var K=function(R){return{tId:R.tId,win:R.win,data:R.data,nodes:R.nodes,purge:function(){J(this.tId);}};};var P=function(T){var R=I[T];if(R.onFailure){var S=R.scope||R.win;R.onFailure.call(S,K(R));}};var F=function(T){var R=I[T];R.finished=true;if(R.aborted){P(T);return ;}if(R.onSuccess){var S=R.scope||R.win;R.onSuccess.call(S,K(R));}};var E=function(T,W){var S=I[T];if(S.aborted){P(T);return ;}if(W){S.url.shift();if(S.varName){S.varName.shift();}}else{S.url=(D.isString(S.url))?[S.url]:S.url;if(S.varName){S.varName=(D.isString(S.varName))?[S.varName]:S.varName;}}var Z=S.win,Y=Z.document,X=Y.getElementsByTagName("head")[0],U;if(S.url.length===0){if(S.type==="script"&&A.webkit&&A.webkit<420&&!S.finalpass&&!S.varName){var V=M(null,S.win);V.innerHTML='YAHOO.util.Get._finalize("'+T+'");';S.nodes.push(V);X.appendChild(V);}else{F(T);}return ;}var R=S.url[0];if(S.type==="script"){U=M(R,Z);}else{U=N(R,Z);}G(S.type,U,T,R,Z,S.url.length);S.nodes.push(U);X.appendChild(U);if((A.webkit||A.gecko)&&S.type==="css"){E(T,R);}};var C=function(){if(O){return ;}O=true;for(var R in I){var S=I[R];if(S.autopurge&&S.finished){J(S.tId);delete I[R];}}O=false;};var J=function(X){var U=I[X];if(U){var W=U.nodes,R=W.length,V=U.win.document,T=V.getElementsByTagName("head")[0];for(var S=0;S<R;S=S+1){T.removeChild(W[S]);}}U.nodes=[];};var L=function(S,R,T){var V="q"+(H++);T=T||{};if(H%YAHOO.util.Get.PURGE_THRESH===0){C();}I[V]=D.merge(T,{tId:V,type:S,url:R,finished:false,nodes:[]});var U=I[V];U.win=U.win||window;U.scope=U.scope||U.win;U.autopurge=("autopurge" in U)?U.autopurge:(S==="script")?true:false;D.later(0,U,E,V);return{tId:V};};var G=function(a,V,U,S,W,X,Z){var Y=Z||E;if(A.ie){V.onreadystatechange=function(){var b=this.readyState;if("loaded"===b||"complete"===b){Y(U,S);}};}else{if(A.webkit){if(a==="script"){if(A.webkit>419){V.addEventListener("load",function(){Y(U,S);});}else{var R=I[U];if(R.varName){var T=YAHOO.util.Get.POLL_FREQ;R.maxattempts=YAHOO.util.Get.TIMEOUT/T;R.attempts=0;R._cache=R.varName[0].split(".");R.timer=D.later(T,R,function(f){var d=this._cache,c=d.length,b=this.win,e;for(e=0;e<c;e=e+1){b=b[d[e]];if(!b){this.attempts++;if(this.attempts++>this.maxattempts){R.timer.cancel();P(U);}else{}return ;}}R.timer.cancel();Y(U,S);},null,true);}else{D.later(YAHOO.util.Get.POLL_FREQ,null,Y,[U,S]);}}}}else{V.onload=function(){Y(U,S);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(R){D.later(0,null,F,R);},abort:function(S){var T=(D.isString(S))?S:S.tId;var R=I[T];if(R){R.aborted=true;}},script:function(R,S){return L("script",R,S);},css:function(R,S){return L("css",R,S);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.5.0",build:"895"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env;var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"base":"http://yui.yahooapis.com/2.5.0/build/","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","rollup":3},"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css"},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-experimental-min.js","requires":["element","json","datasource"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"]},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-beta-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-beta-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-beta-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop"],"skinnable":true},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-beta-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"skinnable":true},"element":{"type":"js","path":"element/element-beta-min.js","requires":["dom","event"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-beta-min.js","requires":["dom","event","dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-beta-min.js","requires":["dom","event","element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-beta-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-beta-min.js","requires":["yuiloader","element"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":3},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-beta-min.js","requires":["dom","event","dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-beta-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-beta-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-experimental.js","requires":["yahoo"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event"],"rollup":6},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-beta-min.js"},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;
+i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.scope=this;this.data=null;this.varName=null;this.base=YUI.info.base;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(!o){return ;}for(var i in o){if(lang.hasOwnProperty(o,i)){switch(i){case"require":this.require(o[i]);break;case"filter":var f=o[i];if(typeof f==="string"){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}this.filter=this.FILTERS[f];}else{this.filter=f;}break;default:this[i]=o[i];}}}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;for(var i=0;i<a.length;i=i+1){this.required[a[i]]=true;var s=this.parseSkin(a[i]);if(s){this._addSkin(s.skin,s.module);}}YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin);if(!this.moduleInfo[name]){this.addModule({"name":name,"type":"css","path":this.skin.base+skin+"/"+this.skin.path,"rollup":this.skin.rollup});}if(mod){name=this.formatSkin(skin,mod);if(!this.moduleInfo[name]){var mdef=this.moduleInfo[mod];var pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","path":pkg+"/"+this.skin.base+skin+"/"+mod+".css"});}}},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));if(m.skinnable){var req=this.required,l=req.length;for(var j=0;j<l;j=j+1){if(req[j].indexOf(r[j])>-1){d.push(req[j]);}}}}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name){var mod=this.moduleInfo[name];var o={};o[name]=true;var s=mod&&mod.supersedes;YUI.ObjectUtil.appendArray(o,s);return o;},calculate:function(o){if(this.dirty){this._config(o);this._setup();this._explode();this._skin();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){this.loaded=lang.merge(this.inserted);if(!this._sandbox){this.loaded=lang.merge(this.loaded,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(this.loaded,this.ignore);}if(this.force){for(var i=0;i<this.force.length;i=i+1){if(this.force[i] in this.loaded){delete this.loaded[this.force[i]];}}}},_explode:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}},_skin:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod&&mod.skinnable){var o=this.skin.overrides,j;if(o&&o[i]){for(j=0;j<o[i].length;j=j+1){this.require(this.formatSkin(o[i][j],i));}}else{this.require(this.formatSkin(this.skin.defaultSkin,i));}}}},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[i];if(m&&m.rollup){rollups[i]=m;}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=this.moduleInfo[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=this.parseSkin(i),c=0;if(skin){for(j in r){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded;var requires=function(aa,bb){if(loaded[bb]){return false;}var ii,mm=info[aa],rr=mm&&mm.expanded;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}return false;};for(var i in this.required){s.push(i);}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};
+lang.dump(o,1);},insert:function(o,type){this.calculate(o);if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return ;}this._loading=true;this.loadType=type;this.loadNext();},sandbox:function(o,type){if(o){}else{}this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return ;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return ;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort();}return ;}if(m.type!=="js"){this._loadCount++;continue;}url=m.fullpath||this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data});}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this.onFailure.call(this.scope,{msg:this.varName+" reference failure",data:this.data});}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return ;}if(mname){if(mname!==this._loading){return ;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return ;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return ;}if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath||this._url(m.path),self=this,c=function(o){self.loadNext(o.data);};if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:c,varName:m.varName,scope:self});return ;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr);}return u;}};})();
\ No newline at end of file
index 3ebf3fbb7dc875642d0b4e55ee03dbf3f2499240..3af9de3f664bda4afdedfdf893ab56d7b2a67251 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
+/**
+ * The YAHOO object is the single global object used by YUI Library.  It
+ * contains utility function for setting up namespaces, inheritance, and
+ * logging.  YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
+ * created automatically for and used by the library.
+ * @module yahoo
+ * @title  YAHOO Global
+ */
+
+/**
+ * YAHOO_config is not included as part of the library.  Instead it is an 
+ * object that can be defined by the implementer immediately before 
+ * including the YUI library.  The properties included in this object
+ * will be used to configure global properties needed as soon as the 
+ * library begins to load.
+ * @class YAHOO_config
+ * @static
+ */
+
+/**
+ * A reference to a function that will be executed every time a YAHOO module
+ * is loaded.  As parameter, this function will receive the version
+ * information for the module. See <a href="YAHOO.env.html#getVersion">
+ * YAHOO.env.getVersion</a> for the description of the version data structure.
+ * @property listener
+ * @type Function
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Set to true if the library will be dynamically loaded after window.onload.
+ * Defaults to false 
+ * @property injecting
+ * @type boolean
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Instructs the yuiloader component to dynamically load yui components and
+ * their dependencies.  See the yuiloader documentation for more information
+ * about dynamic loading
+ * @property load
+ * @static
+ * @default undefined
+ * @see yuiloader
+ */
+
+/**
+ * Forces the use of the supplied locale where applicable in the library
+ * @property locale
+ * @type string
+ * @static
+ * @default undefined
+ */
+
+if (typeof YAHOO == "undefined" || !YAHOO) {
+    /**
+     * The YAHOO global namespace object.  If YAHOO is already defined, the
+     * existing YAHOO object will not be overwritten so that defined
+     * namespaces are preserved.
+     * @class YAHOO
+     * @static
+     */
+    var YAHOO = {};
+}
+
+/**
+ * Returns the namespace specified and creates it if it doesn't exist
+ * <pre>
+ * YAHOO.namespace("property.package");
+ * YAHOO.namespace("YAHOO.property.package");
+ * </pre>
+ * Either of the above would create YAHOO.property, then
+ * YAHOO.property.package
+ *
+ * Be careful when naming packages. Reserved words may work in some browsers
+ * and not others. For instance, the following will fail in Safari:
+ * <pre>
+ * YAHOO.namespace("really.long.nested.namespace");
+ * </pre>
+ * This fails because "long" is a future reserved word in ECMAScript
+ *
+ * @method namespace
+ * @static
+ * @param  {String*} arguments 1-n namespaces to create 
+ * @return {Object}  A reference to the last namespace object created
+ */
+YAHOO.namespace = function() {
+    var a=arguments, o=null, i, j, d;
+    for (i=0; i<a.length; i=i+1) {
+        d=a[i].split(".");
+        o=YAHOO;
+
+        // YAHOO is implied, so it is ignored if it is included
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
+            o[d[j]]=o[d[j]] || {};
+            o=o[d[j]];
+        }
+    }
+
+    return o;
+};
+
+/**
+ * Uses YAHOO.widget.Logger to output a log message, if the widget is
+ * available.
+ *
+ * @method log
+ * @static
+ * @param  {String}  msg  The message to log.
+ * @param  {String}  cat  The log category for the message.  Default
+ *                        categories are "info", "warn", "error", time".
+ *                        Custom categories can be used as well. (opt)
+ * @param  {String}  src  The source of the the message (opt)
+ * @return {Boolean}      True if the log operation was successful.
+ */
+YAHOO.log = function(msg, cat, src) {
+    var l=YAHOO.widget.Logger;
+    if(l && l.log) {
+        return l.log(msg, cat, src);
+    } else {
+        return false;
+    }
+};
+
+/**
+ * Registers a module with the YAHOO object
+ * @method register
+ * @static
+ * @param {String}   name    the name of the module (event, slider, etc)
+ * @param {Function} mainClass a reference to class in the module.  This
+ *                             class will be tagged with the version info
+ *                             so that it will be possible to identify the
+ *                             version that is in use when multiple versions
+ *                             have loaded
+ * @param {Object}   data      metadata object for the module.  Currently it
+ *                             is expected to contain a "version" property
+ *                             and a "build" property at minimum.
+ */
+YAHOO.register = function(name, mainClass, data) {
+    var mods = YAHOO.env.modules;
+    if (!mods[name]) {
+        mods[name] = { versions:[], builds:[] };
+    }
+    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+    m.name = name;
+    m.version = v;
+    m.build = b;
+    m.versions.push(v);
+    m.builds.push(b);
+    m.mainClass = mainClass;
+    // fire the module load listeners
+    for (var i=0;i<ls.length;i=i+1) {
+        ls[i](m);
+    }
+    // label the main class
+    if (mainClass) {
+        mainClass.VERSION = v;
+        mainClass.BUILD = b;
+    } else {
+        YAHOO.log("mainClass is undefined for module " + name, "warn");
+    }
+};
+
+/**
+ * YAHOO.env is used to keep track of what is known about the YUI library and
+ * the browsing environment
+ * @class YAHOO.env
+ * @static
+ */
+YAHOO.env = YAHOO.env || {
+
+    /**
+     * Keeps the version info for all YUI modules that have reported themselves
+     * @property modules
+     * @type Object[]
+     */
+    modules: [],
+    
+    /**
+     * List of functions that should be executed every time a YUI module
+     * reports itself.
+     * @property listeners
+     * @type Function[]
+     */
+    listeners: []
+};
+
+/**
+ * Returns the version data for the specified module:
+ *      <dl>
+ *      <dt>name:</dt>      <dd>The name of the module</dd>
+ *      <dt>version:</dt>   <dd>The version in use</dd>
+ *      <dt>build:</dt>     <dd>The build number in use</dd>
+ *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
+ *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
+ *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
+ *                 current version and build. If 
+ *                 mainClass.VERSION != version or mainClass.BUILD != build,
+ *                 multiple versions of pieces of the library have been
+ *                 loaded, potentially causing issues.</dd>
+ *       </dl>
+ *
+ * @method getVersion
+ * @static
+ * @param {String}  name the name of the module (event, slider, etc)
+ * @return {Object} The version info
+ */
+YAHOO.env.getVersion = function(name) {
+    return YAHOO.env.modules[name] || null;
+};
+
+/**
+ * Do not fork for a browser if it can be avoided.  Use feature detection when
+ * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
+ * number for the browser engine, 0 otherwise.  This value may or may not map
+ * to the version number of the browser using the engine.  The value is 
+ * presented as a float so that it can easily be used for boolean evaluation 
+ * as well as for looking for a particular range of versions.  Because of this, 
+ * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 
+ * reports 1.8).
+ * @class YAHOO.env.ua
+ * @static
+ */
+YAHOO.env.ua = function() {
+    var o={
+
+        /**
+         * Internet Explorer version number or 0.  Example: 6
+         * @property ie
+         * @type float
+         */
+        ie:0,
+
+        /**
+         * Opera version number or 0.  Example: 9.2
+         * @property opera
+         * @type float
+         */
+        opera:0,
+
+        /**
+         * Gecko engine revision number.  Will evaluate to 1 if Gecko 
+         * is detected but the revision could not be found. Other browsers
+         * will be 0.  Example: 1.8
+         * <pre>
+         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
+         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
+         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
+         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
+         * </pre>
+         * @property gecko
+         * @type float
+         */
+        gecko:0,
+
+        /**
+         * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
+         * will evaluate to 1, other browsers 0.  Example: 418.9.1
+         * <pre>
+         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
+         *                                   latest available for Mac OSX 10.3.
+         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
+         * Safari 2.0.4:         418     <-- preventDefault fixed
+         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
+         *                                   different versions of webkit
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event
+         *                                   
+         * </pre>
+         * http://developer.apple.com/internet/safari/uamatrix.html
+         * @property webkit
+         * @type float
+         */
+        webkit:0,
+
+        /**
+         * The mobile property will be set to a string containing any relevant
+         * user agent information when a modern mobile browser is detected.
+         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
+         * devices with the WebKit-based browser, and Opera Mini.  
+         * @property mobile 
+         * @type string
+         */
+        mobile: null 
+    };
+
+    var ua=navigator.userAgent, m;
+
+    // Modern KHTML browsers should qualify as Safari X-Grade
+    if ((/KHTML/).test(ua)) {
+        o.webkit=1;
+    }
+    // Modern WebKit browsers are at least X-Grade
+    m=ua.match(/AppleWebKit\/([^\s]*)/);
+    if (m&&m[1]) {
+        o.webkit=parseFloat(m[1]);
+
+        // Mobile browser check
+        if (/ Mobile\//.test(ua)) {
+            o.mobile = "Apple"; // iPhone or iPod Touch
+        } else {
+            m=ua.match(/NokiaN[^\/]*/);
+            if (m) {
+                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+            }
+        }
+
+    }
+
+    if (!o.webkit) { // not webkit
+        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+        m=ua.match(/Opera[\s\/]([^\s]*)/);
+        if (m&&m[1]) {
+            o.opera=parseFloat(m[1]);
+            m=ua.match(/Opera Mini[^;]*/);
+            if (m) {
+                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+            }
+        } else { // not opera or webkit
+            m=ua.match(/MSIE\s([^;]*)/);
+            if (m&&m[1]) {
+                o.ie=parseFloat(m[1]);
+            } else { // not opera, webkit, or ie
+                m=ua.match(/Gecko\/([^\s]*)/);
+                if (m) {
+                    o.gecko=1; // Gecko detected, look for revision
+                    m=ua.match(/rv:([^\s\)]*)/);
+                    if (m&&m[1]) {
+                        o.gecko=parseFloat(m[1]);
+                    }
+                }
+            }
+        }
+    }
+    
+    return o;
+}();
+
+/*
+ * Initializes the global by creating the default namespaces and applying
+ * any new configuration information that is detected.  This is the setup
+ * for env.
+ * @method init
+ * @static
+ * @private
+ */
+(function() {
+    YAHOO.namespace("util", "widget", "example");
+    if ("undefined" !== typeof YAHOO_config) {
+        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        if (l) {
+            // if YAHOO is loaded multiple times we need to check to see if
+            // this is a new config object.  If it is, add the new component
+            // load listener to the stack
+            for (i=0;i<ls.length;i=i+1) {
+                if (ls[i]==l) {
+                    unique=false;
+                    break;
+                }
+            }
+            if (unique) {
+                ls.push(l);
+            }
+        }
+    }
+})();
+/**
+ * Provides the language utilites and extensions used by the library
+ * @class YAHOO.lang
+ */
+YAHOO.lang = YAHOO.lang || {
+    /**
+     * Determines whether or not the provided object is an array.
+     * Testing typeof/instanceof/constructor of arrays across frame 
+     * boundaries isn't possible in Safari unless you have a reference
+     * to the other frame to test against its Array prototype.  To
+     * handle this case, we test well-known array properties instead.
+     * properties.
+     * @method isArray
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isArray: function(o) { 
+
+        if (o) {
+           var l = YAHOO.lang;
+           return l.isNumber(o.length) && l.isFunction(o.splice);
+        }
+        return false;
+    },
+
+    /**
+     * Determines whether or not the provided object is a boolean
+     * @method isBoolean
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isBoolean: function(o) {
+        return typeof o === 'boolean';
+    },
+    
+    /**
+     * Determines whether or not the provided object is a function
+     * @method isFunction
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isFunction: function(o) {
+        return typeof o === 'function';
+    },
+        
+    /**
+     * Determines whether or not the provided object is null
+     * @method isNull
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isNull: function(o) {
+        return o === null;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a legal number
+     * @method isNumber
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isNumber: function(o) {
+        return typeof o === 'number' && isFinite(o);
+    },
+      
+    /**
+     * Determines whether or not the provided object is of type object
+     * or function
+     * @method isObject
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */  
+    isObject: function(o) {
+return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a string
+     * @method isString
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isString: function(o) {
+        return typeof o === 'string';
+    },
+        
+    /**
+     * Determines whether or not the provided object is undefined
+     * @method isUndefined
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    isUndefined: function(o) {
+        return typeof o === 'undefined';
+    },
+    
+    /**
+     * Determines whether or not the property was added
+     * to the object instance.  Returns false if the property is not present
+     * in the object, or was inherited from the prototype.
+     * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
+     * There is a discrepancy between YAHOO.lang.hasOwnProperty and
+     * Object.prototype.hasOwnProperty when the property is a primitive added to
+     * both the instance AND prototype with the same value:
+     * <pre>
+     * var A = function() {};
+     * A.prototype.foo = 'foo';
+     * var a = new A();
+     * a.foo = 'foo';
+     * alert(a.hasOwnProperty('foo')); // true
+     * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
+     * </pre>
+     * @method hasOwnProperty
+     * @param {any} o The object being testing
+     * @return {boolean} the result
+     */
+    hasOwnProperty: function(o, prop) {
+        if (Object.prototype.hasOwnProperty) {
+            return o.hasOwnProperty(prop);
+        }
+        
+        return !YAHOO.lang.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    },
+    /**
+     * IE will not enumerate native functions in a derived object even if the
+     * function was overridden.  This is a workaround for specific functions 
+     * we care about on the Object prototype. 
+     * @property _IEEnumFix
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @static
+     * @private
+     */
+    _IEEnumFix: function(r, s) {
+        if (YAHOO.env.ua.ie) {
+            var add=["toString", "valueOf"], i;
+            for (i=0;i<add.length;i=i+1) {
+                var fname=add[i],f=s[fname];
+                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+                    r[fname]=f;
+                }
+            }
+        }
+    },
+       
+    /**
+     * Utility to set up the prototype, constructor and superclass properties to
+     * support an inheritance strategy that can chain constructors and methods.
+     * Static members will not be inherited.
+     *
+     * @method extend
+     * @static
+     * @param {Function} subc   the object to modify
+     * @param {Function} superc the object to inherit
+     * @param {Object} overrides  additional properties/methods to add to the
+     *                              subclass prototype.  These will override the
+     *                              matching items obtained from the superclass 
+     *                              if present.
+     */
+    extend: function(subc, superc, overrides) {
+        if (!superc||!subc) {
+            throw new Error("YAHOO.lang.extend failed, please check that " +
+                            "all dependencies are included.");
+        }
+        var F = function() {};
+        F.prototype=superc.prototype;
+        subc.prototype=new F();
+        subc.prototype.constructor=subc;
+        subc.superclass=superc.prototype;
+        if (superc.prototype.constructor == Object.prototype.constructor) {
+            superc.prototype.constructor=superc;
+        }
+    
+        if (overrides) {
+            for (var i in overrides) {
+                subc.prototype[i]=overrides[i];
+            }
+
+            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+        }
+    },
+   
+    /**
+     * Applies all properties in the supplier to the receiver if the
+     * receiver does not have these properties yet.  Optionally, one or 
+     * more methods/properties can be specified (as additional 
+     * parameters).  This option will overwrite the property if receiver 
+     * has it already.  If true is passed as the third parameter, all 
+     * properties will be applied and _will_ overwrite properties in 
+     * the receiver.
+     *
+     * @method augmentObject
+     * @static
+     * @since 2.3.0
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything
+     *        in the supplier will be used unless it would
+     *        overwrite an existing property in the receiver. If true
+     *        is specified as the third parameter, all properties will
+     *        be applied and will overwrite an existing property in
+     *        the receiver
+     */
+    augmentObject: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Absorb failed, verify dependencies.");
+        }
+        var a=arguments, i, p, override=a[2];
+        if (override && override!==true) { // only absorb the specified properties
+            for (i=2; i<a.length; i=i+1) {
+                r[a[i]] = s[a[i]];
+            }
+        } else { // take everything, overwriting only if the third parameter is true
+            for (p in s) { 
+                if (override || !r[p]) {
+                    r[p] = s[p];
+                }
+            }
+            
+            YAHOO.lang._IEEnumFix(r, s);
+        }
+    },
+    /**
+     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
+     * @see YAHOO.lang.augmentObject
+     * @method augmentProto
+     * @static
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything 
+     *        in the supplier will be used unless it would overwrite an existing 
+     *        property in the receiver.  if true is specified as the third 
+     *        parameter, all properties will be applied and will overwrite an 
+     *        existing property in the receiver
+     */
+    augmentProto: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Augment failed, verify dependencies.");
+        }
+        //var a=[].concat(arguments);
+        var a=[r.prototype,s.prototype];
+        for (var i=2;i<arguments.length;i=i+1) {
+            a.push(arguments[i]);
+        }
+        YAHOO.lang.augmentObject.apply(this, a);
+    },
+
+      
+    /**
+     * Returns a simple string representation of the object or array.
+     * Other types of objects will be returned unprocessed.  Arrays
+     * are expected to be indexed.  Use object notation for
+     * associative arrays.
+     * @method dump
+     * @since 2.3.0
+     * @param o {Object} The object to dump
+     * @param d {int} How deep to recurse child objects, default 3
+     * @return {String} the dump result
+     */
+    dump: function(o, d) {
+        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+            COMMA=', ', ARROW=' => ';
+
+        // Cast non-objects to string
+        // Skip dates because the std toString is what we want
+        // Skip HTMLElement-like objects because trying to dump 
+        // an element will cause an unhandled exception in FF 2.x
+        if (!l.isObject(o)) {
+            return o + "";
+        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
+            return o;
+        } else if  (l.isFunction(o)) {
+            return FUN;
+        }
+
+        // dig into child objects the depth specifed. Default 3
+        d = (l.isNumber(d)) ? d : 3;
+
+        // arrays [1, 2, 3]
+        if (l.isArray(o)) {
+            s.push("[");
+            for (i=0,len=o.length;i<len;i=i+1) {
+                if (l.isObject(o[i])) {
+                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                } else {
+                    s.push(o[i]);
+                }
+                s.push(COMMA);
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("]");
+        // objects {k1 => v1, k2 => v2}
+        } else {
+            s.push("{");
+            for (i in o) {
+                if (l.hasOwnProperty(o, i)) {
+                    s.push(i + ARROW);
+                    if (l.isObject(o[i])) {
+                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    } else {
+                        s.push(o[i]);
+                    }
+                    s.push(COMMA);
+                }
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("}");
+        }
+
+        return s.join("");
+    },
+
+    /**
+     * Does variable substitution on a string. It scans through the string 
+     * looking for expressions enclosed in { } braces. If an expression 
+     * is found, it is used a key on the object.  If there is a space in
+     * the key, the first word is used for the key and the rest is provided
+     * to an optional function to be used to programatically determine the
+     * value (the extra information might be used for this decision). If 
+     * the value for the key in the object, or what is returned from the
+     * function has a string value, number value, or object value, it is 
+     * substituted for the bracket expression and it repeats.  If this
+     * value is an object, it uses the Object's toString() if this has
+     * been overridden, otherwise it does a shallow dump of the key/value
+     * pairs.
+     * @method substitute
+     * @since 2.3.0
+     * @param s {String} The string that will be modified.
+     * @param o {Object} An object containing the replacement values
+     * @param f {Function} An optional function that can be used to
+     *                     process each match.  It receives the key,
+     *                     value, and any extra metadata included with
+     *                     the key inside of the braces.
+     * @return {String} the substituted string
+     */
+    substitute: function (s, o, f) {
+        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+
+
+        for (;;) {
+            i = s.lastIndexOf(LBRACE);
+            if (i < 0) {
+                break;
+            }
+            j = s.indexOf(RBRACE, i);
+            if (i + 1 >= j) {
+                break;
+            }
+
+            //Extract key and meta info 
+            token = s.substring(i + 1, j);
+            key = token;
+            meta = null;
+            k = key.indexOf(SPACE);
+            if (k > -1) {
+                meta = key.substring(k + 1);
+                key = key.substring(0, k);
+            }
+
+            // lookup the value
+            v = o[key];
+
+            // if a substitution function was provided, execute it
+            if (f) {
+                v = f(key, v, meta);
+            }
+
+            if (l.isObject(v)) {
+                if (l.isArray(v)) {
+                    v = l.dump(v, parseInt(meta, 10));
+                } else {
+                    meta = meta || "";
+
+                    // look for the keyword 'dump', if found force obj dump
+                    var dump = meta.indexOf(DUMP);
+                    if (dump > -1) {
+                        meta = meta.substring(4);
+                    }
+
+                    // use the toString if it is not the Object toString 
+                    // and the 'dump' meta info was not found
+                    if (v.toString===Object.prototype.toString||dump>-1) {
+                        v = l.dump(v, parseInt(meta, 10));
+                    } else {
+                        v = v.toString();
+                    }
+                }
+            } else if (!l.isString(v) && !l.isNumber(v)) {
+                // This {block} has no replace string. Save it for later.
+                v = "~-" + saved.length + "-~";
+                saved[saved.length] = token;
+
+                // break;
+            }
+
+            s = s.substring(0, i) + v + s.substring(j + 1);
+
+
+        }
+
+        // restore saved {block}s
+        for (i=saved.length-1; i>=0; i=i-1) {
+            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
+        }
+
+        return s;
+    },
+
+
+    /**
+     * Returns a string without any leading or trailing whitespace.  If 
+     * the input is not a string, the input will be returned untouched.
+     * @method trim
+     * @since 2.3.0
+     * @param s {string} the string to trim
+     * @return {string} the trimmed string
+     */
+    trim: function(s){
+        try {
+            return s.replace(/^\s+|\s+$/g, "");
+        } catch(e) {
+            return s;
+        }
+    },
+
+    /**
+     * Returns a new object containing all of the properties of
+     * all the supplied objects.  The properties from later objects
+     * will overwrite those in earlier objects.
+     * @method merge
+     * @since 2.3.0
+     * @param arguments {Object*} the objects to merge
+     * @return the new merged object
+     */
+    merge: function() {
+        var o={}, a=arguments;
+        for (var i=0, l=a.length; i<l; i=i+1) {
+            YAHOO.lang.augmentObject(o, a[i], true);
+        }
+        return o;
+    },
+
+    /**
+     * Executes the supplied function in the context of the supplied 
+     * object 'when' milliseconds later.  Executes the function a 
+     * single time unless periodic is set to true.
+     * @method later
+     * @since 2.4.0
+     * @param when {int} the number of milliseconds to wait until the fn 
+     * is executed
+     * @param o the context object
+     * @param fn {Function|String} the function to execute or the name of 
+     * the method in the 'o' object to execute
+     * @param data [Array] data that is provided to the function.  This accepts
+     * either a single item or an array.  If an array is provided, the
+     * function is executed with one parameter for each array item.  If
+     * you need to pass a single array parameter, it needs to be wrapped in
+     * an array [myarray]
+     * @param periodic {boolean} if true, executes continuously at supplied 
+     * interval until canceled
+     * @return a timer object. Call the cancel() method on this object to 
+     * stop the timer.
+     */
+    later: function(when, o, fn, data, periodic) {
+        when = when || 0; 
+        o = o || {};
+        var m=fn, d=data, f, r;
+
+        if (YAHOO.lang.isString(fn)) {
+            m = o[fn];
+        }
+
+        if (!m) {
+            throw new TypeError("method undefined");
+        }
+
+        if (!YAHOO.lang.isArray(d)) {
+            d = [data];
+        }
+
+        f = function() {
+            m.apply(o, d);
+        };
+
+        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
+
+        return {
+            interval: periodic,
+            cancel: function() {
+                if (this.interval) {
+                    clearInterval(r);
+                } else {
+                    clearTimeout(r);
+                }
+            }
+        };
+    },
+    
+    /**
+     * A convenience method for detecting a legitimate non-null value.
+     * Returns false for null/undefined/NaN, true for other values, 
+     * including 0/false/''
+     * @method isValue
+     * @since 2.3.0
+     * @param o {any} the item to test
+     * @return {boolean} true if it is not null/undefined/NaN || false
+     */
+    isValue: function(o) {
+        // return (o || o === false || o === 0 || o === ''); // Infinity fails
+        var l = YAHOO.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+    }
+
+};
+
+/*
+ * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
+ * @class YAHOO.util.Lang
+ */
+YAHOO.util.Lang = YAHOO.lang;
+/**
+ * Same as YAHOO.lang.augmentObject, except it only applies prototype 
+ * properties.  This is an alias for augmentProto.
+ * @see YAHOO.lang.augmentObject
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*|boolean}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver.  if true
+ *        is specified as the third parameter, all properties will
+ *        be applied and will overwrite an existing property in
+ *        the receiver
+ */
+YAHOO.lang.augment = YAHOO.lang.augmentProto;
+
+/**
+ * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
+ * @for YAHOO
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver
+ */
+YAHOO.augment = YAHOO.lang.augmentProto;
+       
+/**
+ * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
+ * @method extend
+ * @static
+ * @param {Function} subc   the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides  additional properties/methods to add to the
+ *        subclass prototype.  These will override the
+ *        matching items obtained from the superclass if present.
+ */
+YAHOO.extend = YAHOO.lang.extend;
+
+YAHOO.register("yahoo", YAHOO, {version: "2.5.0", build: "895"});
+/**
+ * Provides a mechanism to fetch remote resources and
+ * insert them into a document
+ * @module get
+ * @requires yahoo
+ */
+
+/**
+ * Fetches and inserts one or more script or link nodes into the document 
+ * @namespace YAHOO.util
+ * @class YAHOO.util.Get
+ */
+YAHOO.util.Get = function() {
+
+    /**
+     * hash of queues to manage multiple requests
+     * @property queues
+     * @private
+     */
+    var queues={}, 
+        
+    /**
+     * queue index used to generate transaction ids
+     * @property qidx
+     * @type int
+     * @private
+     */
+        qidx=0, 
+        
+    /**
+     * node index used to generate unique node ids
+     * @property nidx
+     * @type int
+     * @private
+     */
+        nidx=0, 
+
+        // ridx=0,
+
+        // sandboxFrame=null,
+
+    /**
+     * interal property used to prevent multiple simultaneous purge 
+     * processes
+     * @property purging
+     * @type boolean
+     * @private
+     */
+        purging=false,
+
+        ua=YAHOO.env.ua, 
+        
+        lang=YAHOO.lang;
+    
+    /** 
+     * Generates an HTML element, this is not appended to a document
+     * @method _node
+     * @param type {string} the type of element
+     * @param attr {string} the attributes
+     * @param win {Window} optional window to create the element in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _node = function(type, attr, win) {
+        var w = win || window, d=w.document, n=d.createElement(type);
+
+        for (var i in attr) {
+            if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
+                n.setAttribute(i, attr[i]);
+            }
+        }
+
+        return n;
+    };
+
+    /**
+     * Generates a link node
+     * @method _linkNode
+     * @param url {string} the url for the css file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _linkNode = function(url, win) {
+        return _node("link", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/css",
+                "rel": "stylesheet",
+                "href": url
+            }, win);
+    };
+
+    /**
+     * Generates a script node
+     * @method _scriptNode
+     * @param url {string} the url for the script file
+     * @param win {Window} optional window to create the node in
+     * @return {HTMLElement} the generated node
+     * @private
+     */
+    var _scriptNode = function(url, win) {
+        return _node("script", {
+                "id": "yui__dyn_" + (nidx++),
+                "type": "text/javascript",
+                "src": url
+            }, win);
+    };
+
+    /**
+     * Returns the data payload for callback functions
+     * @method _returnData
+     * @private
+     */
+    var _returnData = function(q) {
+        return {
+                tId: q.tId,
+                win: q.win,
+                data: q.data,
+                nodes: q.nodes,
+                purge: function() {
+                    _purge(this.tId);
+                }
+            };
+    };
+
+    /*
+     * The request failed, execute fail handler with whatever
+     * was accomplished.  There isn't a failure case at the
+     * moment unless you count aborted transactions
+     * @method _fail
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _fail = function(id) {
+        var q = queues[id];
+        // execute failure callback
+        if (q.onFailure) {
+            var sc=q.scope || q.win;
+            q.onFailure.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * The request is complete, so executing the requester's callback
+     * @method _finish
+     * @param id {string} the id of the request
+     * @private
+     */
+    var _finish = function(id) {
+        var q = queues[id];
+        q.finished = true;
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        // execute success callback
+        if (q.onSuccess) {
+            var sc=q.scope || q.win;
+            q.onSuccess.call(sc, _returnData(q));
+        }
+    };
+
+    /**
+     * Loads the next item for a given request
+     * @method _next
+     * @param id {string} the id of the request
+     * @param loaded {string} the url that was just loaded, if any
+     * @private
+     */
+    var _next = function(id, loaded) {
+        var q = queues[id];
+
+        if (q.aborted) {
+            _fail(id);
+            return;
+        }
+
+        if (loaded) {
+            q.url.shift(); 
+            if (q.varName) {
+                q.varName.shift(); 
+            }
+        } else {
+            // This is the first pass: make sure the url is an array
+            q.url = (lang.isString(q.url)) ? [q.url] : q.url;
+            if (q.varName) {
+                q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
+            }
+        }
+
+        var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
+
+        if (q.url.length === 0) {
+            // Safari 2.x workaround - There is no way to know when 
+            // a script is ready in versions of Safari prior to 3.x.
+            // Adding an extra node reduces the problem, but doesn't
+            // eliminate it completely because the browser executes
+            // them asynchronously. 
+            if (q.type === "script" && ua.webkit && ua.webkit < 420 && 
+                    !q.finalpass && !q.varName) {
+                // Add another script node.  This does not guarantee that the
+                // scripts will execute in order, but it does appear to fix the
+                // problem on fast connections more effectively than using an
+                // arbitrary timeout.  It is possible that the browser does
+                // block subsequent script execution in this case for a limited
+                // time.
+                var extra = _scriptNode(null, q.win);
+                extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
+                q.nodes.push(extra); h.appendChild(extra);
+
+            } else {
+                _finish(id);
+            }
+
+            return;
+        } 
+
+
+        var url = q.url[0];
+
+        if (q.type === "script") {
+            n = _scriptNode(url, w);
+        } else {
+            n = _linkNode(url, w);
+        }
+
+        // track this node's load progress
+        _track(q.type, n, id, url, w, q.url.length);
+
+        // add the node to the queue so we can return it to the user supplied callback
+        q.nodes.push(n);
+
+        // add it to the head
+        h.appendChild(n);
+        
+
+        // FireFox does not support the onload event for link nodes, so there is
+        // no way to make the css requests synchronous. This means that the css 
+        // rules in multiple files could be applied out of order in this browser
+        // if a later request returns before an earlier one.  Safari too.
+        if ((ua.webkit || ua.gecko) && q.type === "css") {
+            _next(id, url);
+        }
+    };
+
+    /**
+     * Removes processed queues and corresponding nodes
+     * @method _autoPurge
+     * @private
+     */
+    var _autoPurge = function() {
+
+        if (purging) {
+            return;
+        }
+
+        purging = true;
+        for (var i in queues) {
+            var q = queues[i];
+            if (q.autopurge && q.finished) {
+                _purge(q.tId);
+                delete queues[i];
+            }
+        }
+
+        purging = false;
+    };
+
+    /**
+     * Removes the nodes for the specified queue
+     * @method _purge
+     * @private
+     */
+    var _purge = function(tId) {
+        var q=queues[tId];
+        if (q) {
+            var n=q.nodes, l=n.length, d=q.win.document, 
+                h=d.getElementsByTagName("head")[0];
+            for (var i=0; i<l; i=i+1) {
+                h.removeChild(n[i]);
+            }
+        }
+        q.nodes = [];
+    };
+
+    /**
+     * Saves the state for the request and begins loading
+     * the requested urls
+     * @method queue
+     * @param type {string} the type of node to insert
+     * @param url {string} the url to load
+     * @param opts the hash of options for this request
+     * @private
+     */
+    var _queue = function(type, url, opts) {
+
+        var id = "q" + (qidx++);
+        opts = opts || {};
+
+        if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
+            _autoPurge();
+        }
+
+        queues[id] = lang.merge(opts, {
+            tId: id,
+            type: type,
+            url: url,
+            finished: false,
+            nodes: []
+        });
+
+        var q = queues[id];
+        q.win = q.win || window;
+        q.scope = q.scope || q.win;
+        q.autopurge = ("autopurge" in q) ? q.autopurge : 
+                      (type === "script") ? true : false;
+
+        lang.later(0, q, _next, id);
+
+        return {
+            tId: id
+        };
+    };
+
+    /**
+     * Detects when a node has been loaded.  In the case of
+     * script nodes, this does not guarantee that contained
+     * script is ready to use.
+     * @method _track
+     * @param type {string} the type of node to track
+     * @param n {HTMLElement} the node to track
+     * @param id {string} the id of the request
+     * @param url {string} the url that is being loaded
+     * @param win {Window} the targeted window
+     * @param qlength the number of remaining items in the queue,
+     * including this one
+     * @param trackfn {Function} function to execute when finished
+     * the default is _next
+     * @private
+     */
+    var _track = function(type, n, id, url, win, qlength, trackfn) {
+        var f = trackfn || _next;
+
+        // IE supports the readystatechange event for script and css nodes
+        if (ua.ie) {
+            n.onreadystatechange = function() {
+                var rs = this.readyState;
+                if ("loaded" === rs || "complete" === rs) {
+                    f(id, url);
+                }
+            };
+
+        // webkit prior to 3.x is problemmatic
+        } else if (ua.webkit) {
+
+            if (type === "script") {
+
+                // Safari 3.x supports the load event for script nodes (DOM2)
+                if (ua.webkit > 419) {
+
+                    n.addEventListener("load", function() {
+                        f(id, url);
+                    });
+
+                // Nothing can be done with Safari < 3.x except to pause and hope
+                // for the best, particularly after last script is inserted. The
+                // scripts will always execute in the order they arrive, not
+                // necessarily the order in which they were inserted.  To support
+                // script nodes with complete reliability in these browsers, script
+                // nodes either need to invoke a function in the window once they
+                // are loaded or the implementer needs to provide a well-known
+                // property that the utility can poll for.
+                } else {
+                    // Poll for the existence of the named variable, if it
+                    // was supplied.
+                    var q = queues[id];
+                    if (q.varName) {
+                        var freq=YAHOO.util.Get.POLL_FREQ;
+                        q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
+                        q.attempts = 0;
+                        q._cache = q.varName[0].split(".");
+                        q.timer = lang.later(freq, q, function(o) {
+                            var a=this._cache, l=a.length, w=this.win, i;
+                            for (i=0; i<l; i=i+1) {
+                                w = w[a[i]];
+                                if (!w) {
+                                    // if we have exausted our attempts, give up
+                                    this.attempts++;
+                                    if (this.attempts++ > this.maxattempts) {
+                                        q.timer.cancel();
+                                        _fail(id);
+                                    } else {
+                                    }
+                                    return;
+                                }
+                            }
+                            
+
+                            q.timer.cancel();
+                            f(id, url);
+
+                        }, null, true);
+                    } else {
+                        lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
+                    }
+                }
+            } 
+
+        // FireFox and Opera support onload (but not DOM2 in FF) handlers for
+        // script nodes.  Opera, but not FF, supports the onload event for link
+        // nodes.
+        } else { 
+            n.onload = function() {
+                f(id, url);
+            };
+        }
+    };
+
+    return {
+
+        /**
+         * The default poll freqency in ms, when needed
+         * @property POLL_FREQ
+         * @static
+         * @type int
+         * @default 10
+         */
+        POLL_FREQ: 10,
+
+        /**
+         * The number of request required before an automatic purge.
+         * property PURGE_THRESH
+         * @static
+         * @type int
+         * @default 20
+         */
+        PURGE_THRESH: 20,
+
+        /**
+         * The length time to poll for varName when loading a script in
+         * Safari 2.x before the transaction fails.
+         * property TIMEOUT
+         * @static
+         * @type int
+         * @default 2000
+         */
+        TIMEOUT: 2000,
+        
+        /**
+         * Called by the the helper for detecting script load in Safari
+         * @method _finalize
+         * @param id {string} the transaction id
+         * @private
+         */
+        _finalize: function(id) {
+            lang.later(0, null, _finish, id);
+        },
+
+        /**
+         * Abort a transaction
+         * @method abort
+         * @param {string|object} either the tId or the object returned from
+         * script() or css()
+         */
+        abort: function(o) {
+            var id = (lang.isString(o)) ? o : o.tId;
+            var q = queues[id];
+            if (q) {
+                q.aborted = true;
+            }
+        }, 
+
+        /**
+         * Fetches and inserts one or more script nodes into the head
+         * of the current document or the document in a specified window.
+         *
+         * @method script
+         * @static
+         * @param url {string|string[]} the url or urls to the script(s)
+         * @param opts {object} Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the script(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>onFailure</dt>
+         * <dd>
+         * callback to execute when the script load operation fails
+         * The callback receives an object back with the following
+         * data:
+         * <dl>
+         * <dt>win</dt>
+         * <dd>the window the script(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted successfully</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove any nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>autopurge</dt>
+         * <dd>
+         * setting to true will let the utilities cleanup routine purge 
+         * the script once loaded
+         * </dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callback when the script(s) are
+         * loaded.
+         * </dd>
+         * <dt>varName</dt>
+         * <dd>
+         * variable that should be available when a script is finished
+         * loading.  Used to help Safari 2.x and below with script load 
+         * detection.  The type of this property should match what was
+         * passed into the url parameter: if loading a single url, a
+         * string can be supplied.  If loading multiple scripts, you
+         * must supply an array that contains the variable name for
+         * each script.
+         * </dd>
+         * </dl>
+         * <pre>
+         * // assumes yahoo, dom, and event are already on the page
+         * &nbsp;&nbsp;YAHOO.util.Get.script(
+         * &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
+         * &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log("won't cause error because YAHOO is the scope");
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log(o.nodes.length === 2) // true
+         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// o.purge(); // optionally remove the script nodes immediately
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;onFailure: function(o) &#123;
+         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
+         * &nbsp;&nbsp;&nbsp;&nbsp;data: "foo",
+         * &nbsp;&nbsp;&nbsp;&nbsp;scope: YAHOO,
+         * &nbsp;&nbsp;&nbsp;&nbsp;// win: otherframe // target another window/frame
+         * &nbsp;&nbsp;&nbsp;&nbsp;autopurge: true // allow the utility to choose when to remove the nodes
+         * &nbsp;&nbsp;&#125;);
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        script: function(url, opts) { return _queue("script", url, opts); },
+
+        /**
+         * Fetches and inserts one or more css link nodes into the 
+         * head of the current document or the document in a specified
+         * window.
+         * @method css
+         * @static
+         * @param url {string} the url or urls to the css file(s)
+         * @param opts Options: 
+         * <dl>
+         * <dt>onSuccess</dt>
+         * <dd>
+         * callback to execute when the css file(s) are finished loading
+         * The callback receives an object back with the following
+         * data:
+         * <dl>win</dl>
+         * <dd>the window the link nodes(s) were inserted into</dd>
+         * <dt>data</dt>
+         * <dd>the data object passed in when the request was made</dd>
+         * <dt>nodes</dt>
+         * <dd>An array containing references to the nodes that were
+         * inserted</dd>
+         * <dt>purge</dt>
+         * <dd>A function that, when executed, will remove the nodes
+         * that were inserted</dd>
+         * <dt>
+         * </dl>
+         * </dd>
+         * <dt>scope</dt>
+         * <dd>the execution context for the callbacks</dd>
+         * <dt>win</dt>
+         * <dd>a window other than the one the utility occupies</dd>
+         * <dt>data</dt>
+         * <dd>
+         * data that is supplied to the callbacks when the nodes(s) are
+         * loaded.
+         * </dd>
+         * </dl>
+         * <pre>
+         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
+         * </pre>
+         * <pre>
+         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
+         * </pre>
+         * @return {tId: string} an object containing info about the transaction
+         */
+        css: function(url, opts) {
+            return _queue("css", url, opts); 
+        }
+    };
+}();
+
+YAHOO.register("get", YAHOO.util.Get, {version: "2.5.0", build: "895"});
 /**
  * Provides dynamic loading for the YUI library.  It includes the dependency
  * info for the library, and will automatically pull in dependencies for
@@ -23,17 +1595,13 @@ version: 2.3.0
  *      version management, automatic sandboxing
  */
 (function() {
-    // Define YAHOO_config if it doesn't exist.  Only relevant if YAHOO is not
-    // already on the page
-    if (typeof YAHOO_config === "undefined") {
-        YAHOO_config = {};
-    }
 
-    // YUI is locally scoped, only pieces of it will be referenced in YAHOO
-    // after YAHOO has been loaded.
+    var Y=YAHOO, util=Y.util, lang=Y.lang, env=Y.env;
     var YUI = {
 
+        dupsAllowed: {'yahoo': true, 'get': true},
+
         /*
          * The library metadata for the current release  The is the default
          * value for YAHOO.util.YUILoader.moduleInfo
@@ -42,7 +1610,7 @@ version: 2.3.0
          */
         info: {
 
-    'base': 'http://yui.yahooapis.com/2.3.0/build/',
+    'base': 'http://yui.yahooapis.com/2.5.0/build/',
 
     'skin': {
         'defaultSkin': 'sam',
@@ -67,9 +1635,14 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'base': {
+            'type': 'css',
+            'path': 'base/base-min.css'
+        },
+
         'button': {
             'type': 'js',
-            'path': 'button/button-beta-min.js',
+            'path': 'button/button-min.js',
             'requires': ['element'],
             'optional': ['menu'],
             'skinnable': true
@@ -82,9 +1655,15 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'charts': {
+            'type': 'js',
+            'path': 'charts/charts-experimental-min.js',
+            'requires': ['element', 'json', 'datasource']
+        },
+
         'colorpicker': {
             'type': 'js',
-            'path': 'colorpicker/colorpicker-beta-min.js',
+            'path': 'colorpicker/colorpicker-min.js',
             'requires': ['slider', 'element'],
             'optional': ['animation'],
             'skinnable': true
@@ -101,8 +1680,8 @@ version: 2.3.0
             'path': 'container/container-min.js',
             'requires': ['dom', 'event'],
             // button is optional, but creates a circular dep
-            //'optional': ['dragdrop', 'animation', 'button'],
-            'optional': ['dragdrop', 'animation'],
+            //'optional': ['dragdrop', 'animation', 'connection', 'connection', 'button'],
+            'optional': ['dragdrop', 'animation', 'connection'],
             'supersedes': ['containercore'],
             'skinnable': true
         },
@@ -110,7 +1689,14 @@ version: 2.3.0
         'containercore': {
             'type': 'js',
             'path': 'container/container_core-min.js',
-            'requires': ['dom', 'event']
+            'requires': ['dom', 'event'],
+            'pkg': 'container'
+        },
+
+        'cookie': {
+            'type': 'js',
+            'path': 'cookie/cookie-beta-min.js',
+            'requires': ['yahoo']
         },
 
         'datasource': {
@@ -143,7 +1729,7 @@ version: 2.3.0
         'editor': {
             'type': 'js',
             'path': 'editor/editor-beta-min.js',
-            'requires': ['menu', 'container', 'element', 'button'],
+            'requires': ['menu', 'element', 'button'],
             'optional': ['animation', 'dragdrop'],
             'skinnable': true
         },
@@ -165,6 +1751,12 @@ version: 2.3.0
             'path': 'fonts/fonts-min.css'
         },
 
+        'get': {
+            'type': 'js',
+            'path': 'get/get-min.js',
+            'requires': ['yahoo']
+        },
+
         'grids': {
             'type': 'css',
             'path': 'grids/grids-min.css',
@@ -174,15 +1766,36 @@ version: 2.3.0
 
         'history': {
             'type': 'js',
-            'path': 'history/history-beta-min.js',
+            'path': 'history/history-min.js',
             'requires': ['event']
         },
 
-        'imageloader': {
+         'imagecropper': {
+             'type': 'js',
+             'path': 'imagecropper/imagecropper-beta-min.js',
+             'requires': ['dom', 'event', 'dragdrop', 'element', 'resize'],
+             'skinnable': true
+         },
+
+         'imageloader': {
             'type': 'js',
-            'path': 'imageloader/imageloader-experimental-min.js',
+            'path': 'imageloader/imageloader-min.js',
             'requires': ['event', 'dom']
-        },
+         },
+
+         'json': {
+            'type': 'js',
+            'path': 'json/json-min.js',
+            'requires': ['yahoo']
+         },
+
+         'layout': {
+             'type': 'js',
+             'path': 'layout/layout-beta-min.js',
+             'requires': ['dom', 'event', 'element'],
+             'optional': ['animation', 'dragdrop', 'resize', 'selector'],
+             'skinnable': true
+         }, 
 
         'logger': {
             'type': 'js',
@@ -199,6 +1812,20 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'profiler': {
+            'type': 'js',
+            'path': 'profiler/profiler-beta-min.js',
+            'requires': ['yahoo']
+        },
+
+
+        'profilerviewer': {
+            'type': 'js',
+            'path': 'profilerviewer/profilerviewer-beta-min.js',
+            'requires': ['yuiloader', 'element'],
+            'skinnable': true
+        },
+
         'reset': {
             'type': 'css',
             'path': 'reset/reset-min.css'
@@ -207,7 +1834,38 @@ version: 2.3.0
         'reset-fonts-grids': {
             'type': 'css',
             'path': 'reset-fonts-grids/reset-fonts-grids.css',
-            'supersedes': ['reset', 'fonts', 'grids']
+            'supersedes': ['reset', 'fonts', 'grids', 'reset-fonts'],
+            'rollup': 3
+        },
+
+        'reset-fonts': {
+            'type': 'css',
+            'path': 'reset-fonts/reset-fonts.css',
+            'supersedes': ['reset', 'fonts'],
+            'rollup': 2
+        },
+
+         'resize': {
+             'type': 'js',
+             'path': 'resize/resize-beta-min.js',
+             'requires': ['dom', 'event', 'dragdrop', 'element'],
+             'optional': ['animation'],
+             'skinnable': true
+         },
+
+        'selector': {
+            'type': 'js',
+            'path': 'selector/selector-beta-min.js',
+            'requires': ['yahoo', 'dom']
+        },
+
+        'simpleeditor': {
+            'type': 'js',
+            'path': 'editor/simpleeditor-beta-min.js',
+            'requires': ['element'],
+            'optional': ['containercore', 'menu', 'button', 'animation', 'dragdrop'],
+            'skinnable': true,
+            'pkg': 'editor'
         },
 
         'slider': {
@@ -232,6 +1890,12 @@ version: 2.3.0
             'skinnable': true
         },
 
+        'uploader': {
+            'type': 'js',
+            'path': 'uploader/uploader-experimental.js',
+            'requires': ['yahoo']
+        },
+
         'utilities': {
             'type': 'js',
             'path': 'utilities/utilities.js',
@@ -258,7 +1922,7 @@ version: 2.3.0
 
         'yuitest': {
             'type': 'js',
-            'path': 'yuitest/yuitest-beta-min.js',
+            'path': 'yuitest/yuitest-min.js',
             'requires': ['logger'],
             'skinnable': true
         }
@@ -266,39 +1930,21 @@ version: 2.3.0
 }
  , 
 
-        // Simple utils since we can't count on YAHOO.lang being available.
         ObjectUtil: {
-            appendArray: function(o, a) {
-                if (a) {
-                    for (var i=0; i<a.length; i=i+1) {
-                        o[a[i]] = true;
-                    }
-                }
-            },
-
-            clone: function(o) {
-                var c = {};
-                for (var i in o) {
-                    c[i] = o[i];
-                }
-                return c;
-            },
-
-            merge: function() {
-                var o={}, a=arguments, i, j;
-                for (i=0; i<a.length; i=i+1) {
-                    
-                    for (j in a[i]) {
-                        o[j] = a[i][j];
+            appendArray: function(o, a) {
+                if (a) {
+                    for (var i=0; i<a.length; i=i+1) {
+                        o[a[i]] = true;
                     }
                 }
-                return o;
             },
 
             keys: function(o, ordered) {
                 var a=[], i;
                 for (i in o) {
-                    a.push(i);
+                    if (lang.hasOwnProperty(o, i)) {
+                        a.push(i);
+                    }
                 }
 
                 return a;
@@ -343,115 +1989,10 @@ version: 2.3.0
             uniq: function(a) {
                 return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));
             }
-        },
-
-
-        // loader instances
-        loaders: [],
-
-        finishInit: function(yahooref) {
-
-            // YAHOO has been loaded either in this window or passed 
-            // from the sandbox routine.  Set up local references 
-            // to the loader and module metadata in the YAHOO object
-            // in question so additional modules can be loaded. 
-
-            yahooref = yahooref || YAHOO;
-
-            yahooref.env.YUIInfo=YUI.info;
-            yahooref.util.YUILoader=YUI.YUILoader;
-
-        },
-
-        /*
-         * Global handler for the module loaded event exposed by
-         * YAHOO
-         */
-        onModuleLoaded: function(minfo) {
-
-            var mname = minfo.name, m;
-
-            for (var i=0; i<YUI.loaders.length; i=i+1) {
-                YUI.loaders[i].loadNext(mname);
-            }
-
-            //console.log(YAHOO.lang.dump(minfo));
-
-        },
-
-        /*
-         * Sets up the module metadata
-         */
-        init: function() {
-
-            var c = YAHOO_config, o = c.load, 
-                y_loaded = (typeof YAHOO !== "undefined" && YAHOO.env);
-
-
-            // add our listener to the existing YAHOO.env.listeners stack
-            if (y_loaded) {
-
-                YAHOO.env.listeners.push(YUI.onModuleLoaded);
-
-            // define a listener in YAHOO_config that YAHOO will pick up
-            // when it is loaded.
-            } else {
-
-                if (c.listener) {
-                    YUI.cachedCallback = c.listener;
-                }
-
-                c.listener = function(minfo) {
-                    YUI.onModuleLoaded(minfo);
-                    if (YUI.cachedCallback) {
-                        YUI.cachedCallback(minfo);
-                    }
-                };
-            }
-
-            // Fetch the required modules immediately if specified
-            // in YAHOO_config.  Otherwise detect YAHOO and fetch
-            // it if it doesn't exist so we have a place to put
-            // the loader.  The problem with this is that it will
-            // prevent rollups from working
-            if (o || !y_loaded) {
-
-                o = o || {};
-
-                var loader = new YUI.YUILoader(o);
-                loader.onLoadComplete = function() {
-
-                        YUI.finishInit();
-
-                        if (o.onLoadComplete) {
-
-                            loader._pushEvents();
-                            o.onLoadComplete(loader);
-                        }
-
-                        
-                    };
-
-                // If no load was requested, we must load YAHOO
-                // so we have a place to put the loader
-                if (!y_loaded) {
-                    loader.require("yahoo");
-                }
-
-                loader.insert(null, o);
-            } else {
-                YUI.finishInit();
-            }
         }
-
     };
 
-    YUI.YUILoader = function(o) {
-
-        // Inform the library that it is being injected
-        YAHOO_config.injecting = true;
-
-        o = o || {};
+    YAHOO.util.YUILoader = function(o) {
 
         /**
          * Internal callback to handle multiple internal insert() calls
@@ -461,21 +2002,83 @@ version: 2.3.0
          */
         this._internalCallback = null;
 
+        /**
+         * Use the YAHOO environment listener to detect script load.  This
+         * is only switched on for Safari 2.x and below.
+         * @property _useYahooListener
+         * @private
+         */
+        this._useYahooListener = false;
+
         /**
          * Callback that will be executed when the loader is finished
          * with an insert
-         * @method onLoadComplete
+         * @method onSuccess
+         * @type function
+         */
+        this.onSuccess = null;
+
+        /**
+         * Callback that will be executed if there is a failure
+         * @method onFailure
+         * @type function
+         */
+        this.onFailure = Y.log;
+
+        /**
+         * Callback that will be executed each time a new module is loaded
+         * @method onProgress
          * @type function
          */
-        this.onLoadComplete = null;
+        this.onProgress = null;
+
+        /**
+         * The execution scope for all callbacks
+         * @property scope
+         * @default this
+         */
+        this.scope = this;
+
+        /**
+         * Data that is passed to all callbacks
+         * @property data
+         */
+        this.data = null;
+
+        /**
+         * The name of the variable in a sandbox or script node 
+         * (for external script support in Safari 2.x and earlier)
+         * to reference when the load is complete.  If this variable 
+         * is not available in the specified scripts, the operation will 
+         * fail.  
+         * @property varName
+         * @type string
+         */
+        this.varName = null;
 
         /**
          * The base directory.
          * @property base
          * @type string
-         * @default build
+         * @default http://yui.yahooapis.com/[YUI VERSION]/build/
+         */
+        this.base = YUI.info.base;
+
+        /**
+         * A list of modules that should not be loaded, even if
+         * they turn up in the dependency tree
+         * @property ignore
+         * @type string[]
+         */
+        this.ignore = null;
+
+        /**
+         * A list of modules that should always be loaded, even
+         * if they have already been inserted into the page.
+         * @property force
+         * @type string
          */
-        this.base = ("base" in o) ? o.base : YUI.info.base;
+        this.force = null;
 
         /**
          * Should we allow rollups
@@ -483,23 +2086,33 @@ version: 2.3.0
          * @type boolean
          * @default true
          */
-        this.allowRollup = ("allowRollup" in o) ? o.allowRollup : true;
+        this.allowRollup = true;
 
         /**
-         * Filter to apply to result url
+         * A filter to apply to result urls.  This filter will modify the default
+         * path for all modules.  The default path for the YUI library is the
+         * minified version of the files (e.g., event-min.js).  The filter property
+         * can be a predefined filter or a custom filter.  The valid predefined 
+         * filters are:
+         * <dl>
+         *  <dt>DEBUG</dt>
+         *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
+         *      This option will automatically include the logger widget</dd>
+         *  <dt>RAW</dt>
+         *  <dd>Selects the non-minified version of the library (e.g., event.js).
+         * </dl>
+         * You can also define a custom filter, which must be an object literal 
+         * containing a search expression and a replace string:
+         * <pre>
+         *  myFilter: &#123; 
+         *      'searchExp': "-min\\.js", 
+         *      'replaceStr': "-debug.js"
+         *  &#125;
+         * </pre>
          * @property filter
-         * @type string|object
-         */
-        this.filter = o.filter;
-
-        /**
-         * Create a sandbox rather than inserting into lib into.
-         * the current context.  Not currently supported
-         * property sandbox
-         * @type boolean
-         * @default false
+         * @type string|{searchExp: string, replaceStr: string}
          */
-        this.sandbox = o.sandbox;
+        this.filter = null;
 
         /**
          * The list of requested modules
@@ -512,7 +2125,7 @@ version: 2.3.0
          * The library metadata
          * @property moduleInfo
          */
-        this.moduleInfo = o.moduleInfo || YUI.info.moduleInfo;
+        this.moduleInfo = lang.merge(YUI.info.moduleInfo);
 
         /**
          * List of rollup files found in the library metadata
@@ -527,7 +2140,7 @@ version: 2.3.0
          * @type boolean
          * @default false
          */
-        this.loadOptional = o.loadOptional || false;
+        this.loadOptional = false;
 
         /**
          * All of the derived dependencies in sorted order, which
@@ -563,7 +2176,6 @@ version: 2.3.0
          */
         this.inserted = {};
 
-
         /**
          * Provides the information used to skin the skinnable components.
          * The following skin definition would result in 'skin1' and 'skin2'
@@ -602,17 +2214,23 @@ version: 2.3.0
          *   </code>
          *   @property skin
          */
-        this.skin = o.skin || YUI.ObjectUtil.clone(YUI.info.skin); 
 
+        var self = this;
 
-        if (o.require) {
-            this.require(o.require);
-        }
+        env.listeners.push(function(m) {
+            if (self._useYahooListener) {
+                //Y.log("YAHOO listener: " + m.name);
+                self.loadNext(m.name);
+            }
+        });
+
+        this.skin = lang.merge(YUI.info.skin); 
+
+        this._config(o);
 
-        YUI.loaders.push(this);
     };
 
-    YUI.YUILoader.prototype = {
+    Y.util.YUILoader.prototype = {
 
         FILTERS: {
             RAW: { 
@@ -627,10 +2245,49 @@ version: 2.3.0
 
         SKIN_PREFIX: "skin-",
 
-        /** Add a new module to the component metadata.  The javascript 
-         * component must also use YAHOO.register to notify the loader 
-         * when it has been loaded, or a verifier function must be
-         * provided
+        _config: function(o) {
+
+            if (!o) {
+                return;
+            }
+
+            // lang.augmentObject(this, o);
+
+            // apply config values
+            for (var i in o) {
+                if (lang.hasOwnProperty(o, i)) {
+                    switch (i) {
+                        case "require":
+                            this.require(o[i]);
+                            break;
+
+                        case "filter":
+                            var f = o[i];
+
+                            if (typeof f === "string") {
+                                f = f.toUpperCase();
+
+                                // the logger must be available in order to use the debug
+                                // versions of the library
+                                if (f === "DEBUG") {
+                                    this.require("logger");
+                                }
+
+                                this.filter = this.FILTERS[f];
+                            } else {
+                                this.filter = f;
+                            }
+
+                            break;
+
+                        default:
+                            this[i] = o[i];
+                    }
+                }
+            }
+        },
+
+        /** Add a new module to the component metadata.         
          * <dl>
          *     <dt>name:</dt>       <dd>required, the component name</dd>
          *     <dt>type:</dt>       <dd>required, the component type (js or css)</dd>
@@ -639,7 +2296,6 @@ version: 2.3.0
          *     <dt>optional:</dt>   <dd>the optional modules for this component</dd>
          *     <dt>supersedes:</dt> <dd>the modules this component replaces</dd>
          *     <dt>rollup:</dt>     <dd>the number of superseded modules required for automatic rollup</dd>
-         *     <dt>verifier:</dt>   <dd>a function that is executed to determine when the module is fully loaded</dd>
          *     <dt>fullpath:</dt>   <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
          *     <dt>skinnable:</dt>  <dd>flag to determine if skin assets should automatically be pulled in</dd>
          * </dl>
@@ -704,11 +2360,14 @@ version: 2.3.0
             if (mod) {
                 name = this.formatSkin(skin, mod);
                 if (!this.moduleInfo[name]) {
+                    var mdef = this.moduleInfo[mod];
+                    var pkg = mdef.pkg || mod;
                     this.addModule({
                         'name': name,
                         'type': 'css',
                         //'path': this.skin.base + skin + "/" + mod + ".css"
-                        'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                        // 'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                        'path': pkg + '/' + this.skin.base + skin + "/" + mod + ".css"
                     });
                 }
             }
@@ -721,15 +2380,35 @@ version: 2.3.0
          * @param mod The module definition from moduleInfo
          */
         getRequires: function(mod) {
+            if (!mod) {
+                return [];
+            }
+
             if (!this.dirty && mod.expanded) {
                 return mod.expanded;
             }
 
             mod.requires=mod.requires || [];
-            var i, d=[], r=mod.requires, o=mod.optional, s=mod.supersedes, info=this.moduleInfo;
+            var i, d=[], r=mod.requires, o=mod.optional, info=this.moduleInfo, m;
             for (i=0; i<r.length; i=i+1) {
                 d.push(r[i]);
-                YUI.ArrayUtil.appendArray(d, this.getRequires(info[r[i]]));
+                m = info[r[i]];
+                YUI.ArrayUtil.appendArray(d, this.getRequires(m));
+
+                // add existing skins for skinnable modules as well.  The only
+                // way to do this is go through the list of required items (this
+                // assumes that _skin is called before getRequires is called on
+                // the module.
+                if (m.skinnable) {
+                    var req=this.required, l=req.length;
+                    for (var j=0; j<l; j=j+1) {
+                        // YAHOO.log('checking ' + r[j]);
+                        if (req[j].indexOf(r[j]) > -1) {
+                            // YAHOO.log('adding ' + r[j]);
+                            d.push(req[j]);
+                        }
+                    }
+                }
             }
 
             if (o && this.loadOptional) {
@@ -755,11 +2434,12 @@ version: 2.3.0
 
             var o = {};
             o[name] = true;
-            s = mod && mod.supersedes;
+
+            var s = mod && mod.supersedes;
 
             YUI.ObjectUtil.appendArray(o, s);
 
-            // console.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
+            // YAHOO.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
 
             return o;
         },
@@ -772,8 +2452,8 @@ version: 2.3.0
          */
         calculate: function(o) {
             if (this.dirty) {
-
-                this._setup(o);
+                this._config(o);
+                this._setup();
                 this._explode();
                 this._skin();
                 if (this.allowRollup) {
@@ -782,6 +2462,8 @@ version: 2.3.0
                 this._reduce();
                 this._sort();
 
+                // Y.log("after calculate: " + lang.dump(this.required));
+
                 this.dirty = false;
             }
         },
@@ -791,28 +2473,28 @@ version: 2.3.0
          * modules already detected will not be loaded again unless a force
          * option is encountered.  Called by calculate()
          * @method _setup
-         * @param o optional options object
          * @private
          */
-        _setup: function(o) {
+        _setup: function() {
 
-            o = o || {};
-            this.loaded = YUI.ObjectUtil.clone(this.inserted); 
+            this.loaded = lang.merge(this.inserted); // shallow clone
             
-            if (!this.sandbox && typeof YAHOO !== "undefined" && YAHOO.env) {
-                this.loaded = YUI.ObjectUtil.merge(this.loaded, YAHOO.env.modules);
+            if (!this._sandbox) {
+                this.loaded = lang.merge(this.loaded, env.modules);
             }
 
+            // Y.log("already loaded stuff: " + lang.dump(this.loaded, 0));
+
             // add the ignore list to the list of loaded packages
-            if (o.ignore) {
-                YUI.ObjectUtil.appendArray(this.loaded, o.ignore);
+            if (this.ignore) {
+                YUI.ObjectUtil.appendArray(this.loaded, this.ignore);
             }
 
             // remove modules on the force list from the loaded list
-            if (o.force) {
-                for (var i=0; i<o.force.length; i=i+1) {
-                    if (o.force[i] in this.loaded) {
-                        delete this.loaded[o.force[i]];
+            if (this.force) {
+                for (var i=0; i<this.force.length; i=i+1) {
+                    if (this.force[i] in this.loaded) {
+                        delete this.loaded[this.force[i]];
                     }
                 }
             }
@@ -856,7 +2538,7 @@ version: 2.3.0
             for (i in r) {
                 mod = this.moduleInfo[i];
                 if (mod && mod.skinnable) {
-                    var o=this.skin.override, j;
+                    var o=this.skin.overrides, j;
                     if (o && o[i]) {
                         for (j=0; j<o[i].length; j=j+1) {
                             this.require(this.formatSkin(o[i][j], i));
@@ -938,13 +2620,12 @@ version: 2.3.0
 
                     // there can be only one
                     if (!r[i] && !this.loaded[i]) {
-                        m =this.moduleInfo[i]; s = m.supersedes; roll=true;
+                        m =this.moduleInfo[i]; s = m.supersedes; roll=false;
 
                         if (!m.rollup) {
                             continue;
                         }
 
-
                         var skin = this.parseSkin(i), c = 0;
                         if (skin) {
 
@@ -953,20 +2634,19 @@ version: 2.3.0
                                     c++;
                                     roll = (c >= m.rollup);
                                     if (roll) {
+                                        // Y.log("skin rollup " + lang.dump(r));
                                         break;
                                     }
                                 }
                             }
 
-
                         } else {
 
-                            // require all modules to trigger a rollup (using the 
-                            // threshold value has not proved worthwhile)
+                            // check the threshold
                             for (j=0;j<s.length;j=j+1) {
 
                                 // if the superseded module is loaded, we can't load the rollup
-                                if (this.loaded[s[j]]) {
+                                if (this.loaded[s[j]] && (!YUI.dupsAllowed[s[j]])) {
                                     roll = false;
                                     break;
                                 // increment the counter if this module is required.  if we are
@@ -975,6 +2655,7 @@ version: 2.3.0
                                     c++;
                                     roll = (c >= m.rollup);
                                     if (roll) {
+                                        // Y.log("over thresh " + c + ", " + lang.dump(r));
                                         break;
                                     }
                                 }
@@ -982,6 +2663,7 @@ version: 2.3.0
                         }
 
                         if (roll) {
+                            // Y.log("rollup: " +  i + ", " + lang.dump(this, 1));
                             // add the rollup
                             r[i] = true;
                             rolled = true;
@@ -1020,14 +2702,14 @@ version: 2.3.0
                     var skinDef = this.parseSkin(i);
 
                     if (skinDef) {
-                        //console.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
+                        //YAHOO.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
                         // the skin rollup will not have a module name
                         if (!skinDef.module) {
                             var skin_pre = this.SKIN_PREFIX + skinDef.skin;
-                            //console.log("skin_pre: " + skin_pre);
+                            //YAHOO.log("skin_pre: " + skin_pre);
                             for (j in r) {
                                 if (j !== i && j.indexOf(skin_pre) > -1) {
-                                    //console.log ("removing component skin: " + j);
+                                    //YAHOO.log ("removing component skin: " + j);
                                     delete r[j];
                                 }
                             }
@@ -1072,7 +2754,7 @@ version: 2.3.0
 
                 var ss=info[bb] && info[bb].supersedes;
                 if (ss) {
-                    for (ii=0; ii<ss.length; ii=i+1) {
+                    for (ii=0; ii<ss.length; ii=ii+1) {
                         if (requires(aa, ss[ii])) {
                             return true;
                         }
@@ -1140,67 +2822,214 @@ version: 2.3.0
             this.sorted = s;
         },
 
+        toString: function() {
+            var o = {
+                type: "YUILoader",
+                base: this.base,
+                filter: this.filter,
+                required: this.required,
+                loaded: this.loaded,
+                inserted: this.inserted
+            };
+
+            lang.dump(o, 1);
+        },
+
         /**
          * inserts the requested modules and their dependencies.  
          * <code>type</code> can be "js" or "css".  Both script and 
          * css are inserted if type is not provided.
          * @method insert
-         * @param callback {Function} a function to execute when the load
-         * is complete.
          * @param o optional options object
          * @param type {string} the type of dependency to insert
          */
-        insert: function(callback, o, type) {
+        insert: function(o, type) {
+            // if (o) {
+            //     Y.log("insert: " + lang.dump(o, 1) + ", " + type);
+            // } else {
+            //     Y.log("insert: " + this.toString() + ", " + type);
+            // }
 
-            //if (!this.onLoadComplete) {
-                //this.onLoadComplete = callback;
-            //}
+            // build the dependency list
+            this.calculate(o);
 
             if (!type) {
+                // Y.log("trying to load css first");
                 var self = this;
                 this._internalCallback = function() {
                             self._internalCallback = null;
-                            self.insert(callback, o, "js");
+                            self.insert(null, "js");
                         };
-                this.insert(null, o, "css");
+                this.insert(null, "css");
                 return;
             }
 
-            o = o || {};
+            // set a flag to indicate the load has started
+            this._loading = true;
 
-            // store the callback for when we are done
-            this.onLoadComplete = callback || this.onLoadComplete;
+            // keep the loadType (js, css or undefined) cached
+            this.loadType = type;
 
-            // store the optional filter
-            var f = o && o.filter || null;
+            // start the load
+            this.loadNext();
 
-            if (typeof f === "string") {
-                f = f.toUpperCase();
+        },
 
-                // the logger must be available in order to use the debug
-                // versions of the library
-                if (f === "DEBUG") {
-                    this.require("logger");
-                }
+        /*
+         * Interns the script for the requested modules.  The callback is
+         * provided a reference to the sandboxed YAHOO object.  This only
+         * applies to the script: css can not be sandboxed; css will be
+         * loaded into the page normally if specified.
+         * @method sandbox
+         * @param callback {Function} the callback to exectued when the load is
+         *        complete.
+         */
+        sandbox: function(o, type) {
+            if (o) {
+                // YAHOO.log("sandbox: " + lang.dump(o, 1) + ", " + type);
+            } else {
+                // YAHOO.log("sandbox: " + this.toString() + ", " + type);
             }
 
-            this.filter = this.FILTERS[f] || f || this.FILTERS[this.filter] || this.filter;
+            this._config(o);
 
-            // store the options... not currently in use
-            this.insertOptions = o;
+            if (!this.onSuccess) {
+throw new Error("You must supply an onSuccess handler for your sandbox");
+            }
 
-            // build the dependency list
-            this.calculate(o);
+            this._sandbox = true;
 
-            // set a flag to indicate the load has started
-            this.loading = true;
+            var self = this;
 
-            // keep the loadType (js, css or undefined) cached
-            this.loadType = type;
+            // take care of any css first (this can't be sandboxed)
+            if (!type || type !== "js") {
+                this._internalCallback = function() {
+                            self._internalCallback = null;
+                            self.sandbox(null, "js");
+                        };
+                this.insert(null, "css");
+                return;
+            }
 
-            // start the load
-            this.loadNext();
+            // get the connection manager if not on the page
+            if (!util.Connect) {
+                // get a new loader instance to load connection.
+                var ld = new YAHOO.util.YUILoader();
+                ld.insert({
+                    base: this.base,
+                    filter: this.filter,
+                    require: "connection",
+                    onSuccess: function() {
+                        this.sandbox(null, "js");
+                    },
+                    scope: this
+                }, "js");
+                return;
+            }
+
+            this._scriptText = [];
+            this._loadCount = 0;
+            this._stopCount = this.sorted.length;
+            this._xhr = [];
+
+            this.calculate();
+
+            var s=this.sorted, l=s.length, i, m, url;
+
+            for (i=0; i<l; i=i+1) {
+                m = this.moduleInfo[s[i]];
+
+                // undefined modules cause a failure
+                if (!m) {
+                    this.onFailure.call(this.scope, {
+                            msg: "undefined module " + m,
+                            data: this.data
+                        });
+                    for (var j=0;j<this._xhr.length;j=j+1) {
+                        this._xhr[j].abort();
+                    }
+                    return;
+                }
+
+                // css files should be done
+                if (m.type !== "js") {
+                    this._loadCount++;
+                    continue;
+                }
+
+                url = m.fullpath || this._url(m.path);
+
+                // YAHOO.log("xhr request: " + url + ", " + i);
+
+                var xhrData = {
+
+                    success: function(o) {
+                        
+                        var idx=o.argument[0], name=o.argument[2];
+
+                        // store the response in the position it was requested
+                        this._scriptText[idx] = o.responseText; 
+                        
+                        // YAHOO.log("received: " + o.responseText.substr(0, 100) + ", " + idx);
+                    
+                        if (this.onProgress) {
+                            this.onProgress.call(this.scope, {
+                                        name: name,
+                                        scriptText: o.responseText,
+                                        xhrResponse: o,
+                                        data: this.data
+                                    });
+                        }
+
+                        // only generate the sandbox once everything is loaded
+                        this._loadCount++;
+
+                        if (this._loadCount >= this._stopCount) {
+
+                            // the variable to find
+                            var v = this.varName || "YAHOO";
+
+                            // wrap the contents of the requested modules in an anonymous function
+                            var t = "(function() {\n";
+                        
+                            // return the locally scoped reference.
+                            var b = "\nreturn " + v + ";\n})();";
+
+                            var ref = eval(t + this._scriptText.join("\n") + b);
+
+                            this._pushEvents(ref);
+
+                            if (ref) {
+                                this.onSuccess.call(this.scope, {
+                                        reference: ref,
+                                        data: this.data
+                                    });
+                            } else {
+                                this.onFailure.call(this.scope, {
+                                        msg: this.varName + " reference failure",
+                                        data: this.data
+                                    });
+                            }
+                        }
+                    },
+
+                    failure: function(o) {
+                        this.onFailure.call(this.scope, {
+                                msg: "XHR failure",
+                                xhrResponse: o,
+                                data: this.data
+                            });
+                    },
+
+                    scope: this,
+
+                    // module index, module name, sandbox name
+                    argument: [i, url, s[i]]
+
+                };
 
+                this._xhr.push(util.Connect.asyncRequest('GET', url, xhrData));
+            }
         },
 
         /**
@@ -1215,37 +3044,45 @@ version: 2.3.0
          */
         loadNext: function(mname) {
 
-            // console.log("loadNext executing, just loaded " + mname);
-
-            // The global handler that is called when each module is loaded
-            // will pass that module name to this function.  Storing this
-            // data to avoid loading the same module multiple times
-            if (mname) {
-                this.inserted[mname] = true;
-                //var o = this.getProvides(mname);
-                //this.inserted = YUI.ObjectUtil.merge(this.inserted, o);
-            }
-
             // It is possible that this function is executed due to something
             // else one the page loading a YUI module.  Only react when we
             // are actively loading something
-            if (!this.loading) {
+            if (!this._loading) {
                 return;
             }
 
-            // if the module that was just loaded isn't what we were expecting,
-            // continue to wait
-            if (mname && mname !== this.loading) {
-                return;
+            if (mname) {
+
+                // if the module that was just loaded isn't what we were expecting,
+                // continue to wait
+                if (mname !== this._loading) {
+                    return;
+                }
+
+                // YAHOO.log("loadNext executing, just loaded " + mname);
+
+                // The global handler that is called when each module is loaded
+                // will pass that module name to this function.  Storing this
+                // data to avoid loading the same module multiple times
+                this.inserted[mname] = true;
+
+                if (this.onProgress) {
+                    this.onProgress.call(this.scope, {
+                            name: mname,
+                            data: this.data
+                        });
+                }
+                //var o = this.getProvides(mname);
+                //this.inserted = lang.merge(this.inserted, o);
             }
-            
-            var s=this.sorted, len=s.length, i, m, url;
+
+            var s=this.sorted, len=s.length, i, m;
 
             for (i=0; i<len; i=i+1) {
 
                 // This.inserted keeps track of what the loader has loaded
                 if (s[i] in this.inserted) {
-                    // console.log(s[i] + " alread loaded ");
+                    // YAHOO.log(s[i] + " alread loaded ");
                     continue;
                 }
 
@@ -1253,67 +3090,67 @@ version: 2.3.0
                 // from YAHOO, loadNext may be called multiple times for
                 // the same module when loading a rollup.  We can safely
                 // skip the subsequent requests
-                if (s[i] === this.loading) {
-                    // console.log("still loading " + s[i] + ", waiting");
+                if (s[i] === this._loading) {
+                    // YAHOO.log("still loading " + s[i] + ", waiting");
                     return;
                 }
 
                 // log("inserting " + s[i]);
-
                 m = this.moduleInfo[s[i]];
 
+                if (!m) {
+                    this.onFailure.call(this.scope, {
+                            msg: "undefined module " + m,
+                            data: this.data
+                        });
+                    return;
+                }
+
                 // The load type is stored to offer the possibility to load
                 // the css separately from the script.
                 if (!this.loadType || this.loadType === m.type) {
-                    this.loading = s[i];
+                    this._loading = s[i];
+                    //YAHOO.log("attempting to load " + s[i] + ", " + this.base);
 
-                    // Insert the css node and continue.  It is possible
-                    // that the css file will load out of order ... this
-                    // may be a problem that needs to be addressed, but
-                    // unlike the script files, there is no notification
-                    // mechanism in place for the css files.
-                    if (m.type === "css") {
-
-                        url = m.fullpath || this._url(m.path);
-                        
-                        this.insertCss(url);
-                        this.inserted[s[i]] = true;
+                    var fn=(m.type === "css") ? util.Get.css : util.Get.script,
+                        url=m.fullpath || this._url(m.path), self=this, 
+                        c=function(o) {
+                            self.loadNext(o.data);
+                        };
 
-                    // Scripts must be loaded in order, so we wait for the
-                    // notification from YAHOO or a verifier function to 
-                    // process the next script
-                    } else {
+                    // safari 2.x or lower, script, and part of YUI
+                    if (env.ua.webkit && env.ua.webkit < 420 && m.type === "js" && 
+                          !m.varName) {
+                          //YUI.info.moduleInfo[s[i]]) {
+                          //YAHOO.log("using YAHOO env " + s[i] + ", " + m.varName);
+                        c = null;
+                        this._useYahooListener = true;
+                    }
 
-                        url = m.fullpath || this._url(m.path);
-                        this.insertScript(url);
-
-                        // if a verifier was included for this module, execute
-                        // it, passing the name of the module, and a callback
-                        // that must be exectued when the verifier is done.
-                        if (m.verifier) {
-                            var self = this, name=s[i];
-                            m.verifier(name, function() {
-                                    self.loadNext(name);
-                                });
-                        }
+                    fn(url, {
+                        data: s[i],
+                        onSuccess: c,
+                        varName: m.varName,
+                        scope: self 
+                    });
 
-                        return;
-                    }
+                    return;
                 }
             }
 
             // we are finished
-            this.loading = null;
-
+            this._loading = null;
 
             // internal callback for loading css first
             if (this._internalCallback) {
                 var f = this._internalCallback;
                 this._internalCallback = null;
-                f(this);
-            } else if (this.onLoadComplete) {
+                f.call(this);
+            } else if (this.onSuccess) {
                 this._pushEvents();
-                this.onLoadComplete(this);
+                this.onSuccess.call(this.scope, {
+                        data: this.data
+                    });
             }
 
         },
@@ -1322,11 +3159,13 @@ version: 2.3.0
          * In IE, the onAvailable/onDOMReady events need help when Event is
          * loaded dynamically
          * @method _pushEvents
+         * @param {Function} optional function reference
          * @private
          */
-        _pushEvents: function() {
-            if (typeof YAHOO !== "undefined" && YAHOO.util && YAHOO.util.Event) {
-                YAHOO.util.Event._load();
+        _pushEvents: function(ref) {
+            var r = ref || YAHOO;
+            if (r.util && r.util.Event) {
+                r.util.Event._load();
             }
         },
 
@@ -1343,66 +3182,16 @@ version: 2.3.0
             u = u + path;
 
             if (f) {
-                // console.log("filter: " + f + ", " + f.searchExp + 
+                // YAHOO.log("filter: " + f + ", " + f.searchExp + 
                 // ", " + f.replaceStr);
                 u = u.replace(new RegExp(f.searchExp), f.replaceStr);
             }
 
-            // console.log(u);
+            // YAHOO.log(u);
 
             return u;
-        },
-
-        /**
-         * Inserts a script node
-         * @method insertScript
-         * @param url {string} the full url for the script
-         * @param win {Window} optional window to target
-         */
-        insertScript: function(url, win) {
-
-            //console.log("inserting script " + url);
-            var w = win || window, d=w.document, n=d.createElement("script"),
-                h = d.getElementsByTagName("head")[0];
-
-            n.src = url;
-            n.type = "text/javascript";
-            h.appendChild(n);
-        },
-
-        /**
-         * Inserts a css link node
-         * @method insertCss
-         * @param url {string} the full url for the script
-         * @param win {Window} optional window to target
-         */
-        insertCss: function(url, win) {
-            // console.log("inserting css " + url);
-            var w = win || window, d=w.document, n=d.createElement("link"),
-                h = d.getElementsByTagName("head")[0];
-
-            n.href = url;
-            n.type = "text/css";
-            n.rel = "stylesheet";
-            h.appendChild(n);
-        },
-       
-        /*
-         * Interns the script for the requested modules.  The callback is
-         * provided a reference to the sandboxed YAHOO object.  This only
-         * applies to the script: css can not be sandboxed.  Not implemented.
-         * @method sandbox
-         * @param callback {Function} the callback to exectued when the load is
-         *        complete.
-         * @notimplemented
-         */
-        sandbox: function(callback) {
-            // this.calculate({
-                         //sandbox: true
-                     //});
         }
-    };
 
-    YUI.init();
+    };
 
 })();
index 1b174fdaa08c4720efaac1c961d7d825726e5577..19e8d09b160c57753fe7ac818723f6f759ff8493 100755 (executable)
@@ -1,4 +1,21 @@
-YUI Test Utility - Release Notes
+YUI Library - YUITest - Release Notes
 
 2.3.0
-   * Initial release
+
+  * Beta release
+
+2.3.1
+
+  * No changes
+
+2.4.0
+
+  * Changed test running from synchronous to asynchronous.
+  * Added wait() and resume() methods to TestRunner to allow testing of asynchronous features.
+  
+2.50
+  * Updated test results format to include ignored tests, result types, and names.
+  * Introduced test result formats in JSON and XML.
+  * Introduced TestReporter object.
+  * Removed beta tag.
\ No newline at end of file
index 8b4d7cdee740befffa02866743cde5dda3987895..4bee47ea74a6f6569ac01feefc6d80a8fe86e03b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
index 8b4d7cdee740befffa02866743cde5dda3987895..4bee47ea74a6f6569ac01feefc6d80a8fe86e03b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
index 4158a41ad880c966e2a5e0ffc27a89bfe655729b..657274544004b3433784e0e91d427c0141d3162f 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 .yui-log {padding-top:3em;}
 /*
index 8b4d7cdee740befffa02866743cde5dda3987895..4bee47ea74a6f6569ac01feefc6d80a8fe86e03b 100755 (executable)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 
index 0efbbf536f6f28faeec4be0d89004d3dbe0771c2..ad114842e9e9432e17955b609ee25b6bbbb51943 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 YAHOO.namespace("tool");
 
 //-----------------------------------------------------------------------------
-// TestLogger object
+// TestCase object
 //-----------------------------------------------------------------------------
 
 /**
- * Displays test execution progress and results, providing filters based on
- * different key events.
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
  * @namespace YAHOO.tool
- * @class TestLogger
  * @constructor
- * @param {HTMLElement} element (Optional) The element to create the logger in.
- * @param {Object} config (Optional) Configuration options for the logger.
  */
-YAHOO.tool.TestLogger = function (element, config) {
-    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
-    this.init();
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
 };
 
-YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
 
-    footerEnabled : true,
-    newestOnTop : false,
+YAHOO.tool.TestCase.prototype = {  
 
     /**
-     * Formats message string to HTML for output to console.
-     * @private
-     * @method formatMsg
-     * @param oLogMsg {Object} Log message object.
-     * @return {String} HTML-formatted message for output to console.
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
      */
-    formatMsg : function(message /*:Object*/) {
-    
-        var category /*:String*/ = message.category;        
-        var text /*:String*/ = this.html2Text(message.msg);
-        
-        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
-    
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
     },
-    
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
     //-------------------------------------------------------------------------
-    // Private Methods
+    // Stub Methods
     //-------------------------------------------------------------------------
-    
-    /*
-     * Initializes the logger.
-     * @private
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
      */
-    init : function () {
-    
-        //attach to any available TestRunner
-        if (YAHOO.tool.TestRunner){
-            this.setTestRunner(YAHOO.tool.TestRunner);
-        }
-        
-        //hide useless sources
-        this.hideSource("global");
-        this.hideSource("LogReader");
-        
-        //hide useless message categories
-        this.hideCategory("warn");
-        this.hideCategory("window");
-        this.hideCategory("time");
-        
-        //reset the logger
-        this.clearConsole();
+    setUp : function () /*:Void*/ {
     },
     
     /**
-     * Clears the reference to the TestRunner from previous operations. This 
-     * unsubscribes all events and removes the object reference.
+     * Function to run after each test is executed.
      * @return {Void}
-     * @static
+     * @method tearDown
      */
-    clearTestRunner : function () /*:Void*/ {
-        if (this._runner){
-            this._runner.unsubscribeAll();
-            this._runner = null;
-        }
-    },
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
     
     /**
-     * Sets the source test runner that the logger should monitor.
-     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
-     * @return {Void}
-     * @static
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
      */
-    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
     
-        if (this._runner){
-            this.clearTestRunner();
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
         }
-        
-        this._runner = testRunner;
-        
-        //setup event _handlers
-        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
     },
     
     //-------------------------------------------------------------------------
-    // Event Handlers
+    // Stub Methods
     //-------------------------------------------------------------------------
-    
+
     /**
-     * Handles all TestRunner events, outputting appropriate data into the console.
-     * @param {Object} data The event data object.
+     * Function to run before each test is executed.
      * @return {Void}
-     * @private
+     * @method setUp
      */
-    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
-    
-        //shortcut variables
-        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
-    
-        //data variables
-        var message /*:String*/ = "";
-        var messageType /*:String*/ = "";
-        
-        switch(data.type){
-            case TestRunner.BEGIN_EVENT:
-                message = "Testing began at " + (new Date()).toString() + ".";
-                messageType = "info";
-                break;
-                
-            case TestRunner.COMPLETE_EVENT:
-                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_FAIL_EVENT:
-                message = data.testName + ": " + data.error.getMessage();
-                messageType = "fail";
-                break;
-                
-            case TestRunner.TEST_IGNORE_EVENT:
-                message = data.testName + ": ignored.";
-                messageType = "ignore";
-                break;
-                
-            case TestRunner.TEST_PASS_EVENT:
-                message = data.testName + ": passed.";
-                messageType = "pass";
-                break;
-                
-            case TestRunner.TEST_SUITE_BEGIN_EVENT:
-                message = "Test suite \"" + data.testSuite.name + "\" started.";
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
-                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_CASE_BEGIN_EVENT:
-                message = "Test case \"" + data.testCase.name + "\" started.";
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_CASE_COMPLETE_EVENT:
-                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-            default:
-                message = "Unexpected event " + data.type;
-                message = "info";
-        }
+    setUp : function () /*:Void*/ {
+    },
     
-        YAHOO.log(message, messageType, "TestRunner");    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
     }
     
-});
+};
+
 YAHOO.namespace("tool");
 
 /**
@@ -211,20 +222,126 @@ YAHOO.namespace("tool");
  */
 YAHOO.tool.TestRunner = (function(){
 
-    function TestRunner(){
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
     
-        //inherit from EventProvider
-        TestRunner.superclass.constructor.apply(this,arguments);
-        
         /**
-         * The test objects to run.
-         * @type Array
-         * @private
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
          */
-        this.items /*:Array*/ = [];
+        this.testObject = testObject;
         
-        //create events
-        var events /*:Array*/ = [
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
             this.TEST_CASE_BEGIN_EVENT,
             this.TEST_CASE_COMPLETE_EVENT,
             this.TEST_SUITE_BEGIN_EVENT,
@@ -237,8 +354,7 @@ YAHOO.tool.TestRunner = (function(){
         ];
         for (var i=0; i < events.length; i++){
             this.createEvent(events[i], { scope: this });
-        }
-       
+        }       
    
     }
     
@@ -304,212 +420,373 @@ YAHOO.tool.TestRunner = (function(){
          * @event begin
          */        
         BEGIN_EVENT /*:String*/ : "begin",    
-    
+        
         //-------------------------------------------------------------------------
-        // Private Methods
+        // Test Tree-Related Methods
         //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
          
+        },
+        
         /**
-         * Runs a given test case.
-         * @param {YAHOO.tool.TestCase} testCase The test case to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @method _runTestCase
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
          * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
          * @static
+         * @private
+         * @method _buildTestTree
          */
-        _runTestCase : function (testCase /*YAHOO.tool.TestCase*/) /*:Void*/{
+        _buildTestTree : function () /*:Void*/ {
         
-            //object to store results
-            var results /*:Object*/ = {};
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
         
-            //test case begins
-            this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testCase });
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
         
-            //gather the test functions
-            var tests /*:Array*/ = [];
-            for (var prop in testCase){
-                if (prop.indexOf("test") === 0 && typeof testCase[prop] == "function") {
-                    tests.push(prop);
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
                 }
             }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
             
-            //get the "should" test cases
-            var shouldFail /*:Object*/ = testCase._should.fail || {};
-            var shouldError /*:Object*/ = testCase._should.error || {};
-            var shouldIgnore /*:Object*/ = testCase._should.ignore || {};
-            
-            //test counts
-            var failCount /*:int*/ = 0;
-            var passCount /*:int*/ = 0;
-            var runCount /*:int*/ = 0;
-            
-            //run each test
-            for (var i=0; i < tests.length; i++){
+            //get the next test node
+            var node = this._next();
             
-                //figure out if the test should be ignored or not
-                if (shouldIgnore[tests[i]]){
-                    this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: tests[i] });
-                    continue;
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
                 }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
             
-                //variable to hold whether or not the test failed
-                var failed /*:Boolean*/ = false;
-                var error /*:Error*/ = null;
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
             
-                //run the setup
-                testCase.setUp();
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
                 
-                //try the test
-                try {
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
                 
-                    //run the test
-                    testCase[tests[i]]();
-                    
-                    //if it should fail, and it got here, then it's a fail because it didn't
-                    if (shouldFail[tests[i]]){
-                        error = new YAHOO.util.ShouldFail();
-                        failed = true;
-                    } else if (shouldError[tests[i]]){
-                        error = new YAHOO.util.ShouldError();
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
                         failed = true;
                     }
-                               
-                } catch (thrown /*:Error*/){
-                    if (thrown instanceof YAHOO.util.AssertionError) {
-                        if (!shouldFail[tests[i]]){
-                            error = thrown;
-                            failed = true;
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
                         }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
                     } else {
-                        //first check to see if it should error
-                        if (!shouldError[tests[i]]) {                        
-                            error = new YAHOO.util.UnexpectedError(thrown);
-                            failed = true;
-                        } else {
-                            //check to see what type of data we have
-                            if (YAHOO.lang.isString(shouldError[tests[i]])){
-                                
-                                //if it's a string, check the error message
-                                if (thrown.message != shouldError[tests[i]]){
-                                    error = new YAHOO.util.UnexpectedError(thrown);
-                                    failed = true;                                    
-                                }
-                            } else if (YAHOO.lang.isObject(shouldError[tests[i]])){
-                            
-                                //if it's an object, check the instance and message
-                                if (!(thrown instanceof shouldError[tests[i]].constructor) || 
-                                        thrown.message != shouldError[tests[i]].message){
-                                    error = new YAHOO.util.UnexpectedError(thrown);
-                                    failed = true;                                    
-                                }
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
                             
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
                             }
                         
                         }
-                    }
                     
-                } finally {
-                
-                    //fireEvent appropriate event
-                    if (failed) {
-                        this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: tests[i], error: error });
-                    } else {
-                        this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: tests[i] });
-                    }            
+                    }
                 }
                 
-                //run the tear down
-                testCase.tearDown();
-                
-                //update results
-                results[tests[i]] = { 
-                    result: failed ? "fail" : "pass",
-                    message : error ? error.getMessage() : "Test passed"
-                };
-                
-                //update counts
-                runCount++;
-                failCount += (failed ? 1 : 0);
-                passCount += (failed ? 0 : 1);
             }
             
-            //add test counts to results
-            results.total = runCount;
-            results.failed = failCount;
-            results.passed = passCount;
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
             
-            //test case is done
-            this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: testCase, results: results });
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
             
-            //return results
-            return results;
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
         
         },
-        
+                
         /**
-         * Runs all the tests in a test suite.
-         * @param {YAHOO.tool.TestSuite} testSuite The test suite to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @method _runTestSuite
-         * @private
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
          * @static
+         * @private
+         * @name _runTest
          */
-        _runTestSuite : function (testSuite /*:YAHOO.tool.TestSuite*/) {
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
         
-            //object to store results
-            var results /*:Object*/ = {
-                passed: 0,
-                failed: 0,
-                total: 0
-            };
-        
-            //fireEvent event for beginning of test suite run
-            this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testSuite });
-        
-            //iterate over the test suite items
-            for (var i=0; i < testSuite.items.length; i++){
-                var result = null;
-                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
-                    result = this._runTestSuite(testSuite.items[i]);
-                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
-                    result = this._runTestCase(testSuite.items[i]);
-                }
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
                 
-                if (result !== null){
-                    results.total += result.total;
-                    results.passed += result.passed;
-                    results.failed += result.failed;
-                    results[testSuite.items[i].name] = result;
-                }
-            }
-    
-            //fireEvent event for completion of test suite run
-            this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: testSuite, results: results });
+                node.parent.results.ignored++;
+                node.parent.results.total++;
             
-            //return the results
-            return results;
-        
-        },
-        
-        /**
-         * Runs a test case or test suite, returning the results.
-         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @private
-         * @method _run
-         * @static
-         */
-        _run : function (testObject /*:YAHOO.tool.TestCase|YAHOO.tool.TestSuite*/) /*:Void*/ {
-            if (YAHOO.lang.isObject(testObject)){
-                if (testObject instanceof YAHOO.tool.TestSuite) {
-                    return this._runTestSuite(testObject);
-                } else if (testObject instanceof YAHOO.tool.TestCase) {
-                    return this._runTestCase(testObject);
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
                 } else {
-                    throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");
-                }    
-            }        
-        },
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
         
         //-------------------------------------------------------------------------
         // Protected Methods
@@ -538,171 +815,82 @@ YAHOO.tool.TestRunner = (function(){
         /**
          * Adds a test suite or test case to the list of test objects to run.
          * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
          */
         add : function (testObject /*:Object*/) /*:Void*/ {
-            this.items.push(testObject);
+            this.masterSuite.add(testObject);
         },
         
         /**
          * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
          */
         clear : function () /*:Void*/ {
-            while(this.items.length){
-                this.items.pop();
-            }
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
         },
     
         /**
          * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
          */
-        run : function (testObject /*:Object*/) /*:Void*/ { 
-            var results = null;
+        run : function (testObject /*:Object*/) /*:Void*/ {
             
-            this.fireEvent(this.BEGIN_EVENT);
-       
-            //an object passed in overrides everything else
-            if (YAHOO.lang.isObject(testObject)){
-                results = this._run(testObject);  
-            } else {
-                results = {
-                    passed: 0,
-                    failed: 0,
-                    total: 0
-                };
-                for (var i=0; i < this.items.length; i++){
-                    var result = this._run(this.items[i]);
-                    results.passed += result.passed;
-                    results.failed += result.failed;
-                    results.total += result.total;
-                    results[this.items[i].name] = result;
-                }            
-            }
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
             
-            this.fireEvent(this.COMPLETE_EVENT, { results: results });
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
         }    
     });
     
     return new TestRunner();
     
 })();
-YAHOO.namespace("tool");
 
+YAHOO.namespace("util");
 
 //-----------------------------------------------------------------------------
-// TestSuite object
+// Assert object
 //-----------------------------------------------------------------------------
 
 /**
- * A test suite that can contain a collection of TestCase and TestSuite objects.
- * @param {String} name The name of the test fixture.
- * @namespace YAHOO.tool
- * @class TestSuite
- * @constructor
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
  */
-YAHOO.tool.TestSuite = function (name /*:String*/) {
-
-    /**
-     * The name of the test suite.
-     */
-    this.name /*:String*/ = name || YAHOO.util.Dom.generateId(null, "testSuite");
-
-    /**
-     * Array of test suites and
-     * @private
-     */
-    this.items /*:Array*/ = [];
-
-};
+YAHOO.util.Assert = {
 
-YAHOO.tool.TestSuite.prototype = {
-    
-    /**
-     * Adds a test suite or test case to the test suite.
-     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
-     */
-    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
-        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
-            this.items.push(testObject);
-        }
-    }
-    
-};
-YAHOO.namespace("tool");
-
-//-----------------------------------------------------------------------------
-// TestCase object
-//-----------------------------------------------------------------------------
-
-/**
- * Test case containing various tests to run.
- * @param template An object containing any number of test methods, other methods,
- *                 an optional name, and anything else the test case needs.
- * @class TestCase
- * @namespace YAHOO.tool
- * @constructor
- */
-YAHOO.tool.TestCase = function (template /*:Object*/) {
-    
-    /**
-     * Special rules for the test case. Possible subobjects
-     * are fail, for tests that should fail, and error, for
-     * tests that should throw an error.
-     */
-    this._should /*:Object*/ = {};
-    
-    //copy over all properties from the template to this object
-    for (var prop in template) {
-        this[prop] = template[prop];
-    }    
-    
-    //check for a valid name
-    if (!YAHOO.lang.isString(this.name)){
-        /**
-         * Name for the test case.
-         */
-        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
-    }
-
-};
-
-YAHOO.tool.TestCase.prototype = {  
-
-    //-------------------------------------------------------------------------
-    // Test Methods
-    //-------------------------------------------------------------------------
-
-    /**
-     * Function to run before each test is executed.
-     */
-    setUp : function () /*:Void*/ {
-    },
-    
-    /**
-     * Function to run after each test is executed.
-     */
-    tearDown: function () /*:Void*/ {    
-    }
-};
-YAHOO.namespace("util");
-
-//-----------------------------------------------------------------------------
-// Assert object
-//-----------------------------------------------------------------------------
-
-/**
- * The Assert object provides functions to test JavaScript values against
- * known and expected results. Whenever a comparison (assertion) fails,
- * an error is thrown.
- *
- * @namespace YAHOO.util
- * @class Assert
- * @static
- */
-YAHOO.util.Assert = {
-
-    //-------------------------------------------------------------------------
-    // Generic Assertion Methods
-    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
     
     /** 
      * Forces an assertion error to occur.
@@ -1275,6 +1463,7 @@ YAHOO.util.UnexpectedError = function (cause /*:Object*/){
 
 //inherit methods
 YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
 //-----------------------------------------------------------------------------
 // ArrayAssert object
 //-----------------------------------------------------------------------------
@@ -1603,6 +1792,7 @@ YAHOO.util.ArrayAssert = {
     }
     
 };
+
 YAHOO.namespace("util");
 
 
@@ -1675,6 +1865,7 @@ YAHOO.util.ObjectAssert = {
         }     
     }
 };
+
 //-----------------------------------------------------------------------------
 // DateAssert object
 //-----------------------------------------------------------------------------
@@ -1727,6 +1918,7 @@ YAHOO.util.DateAssert = {
     }
     
 };
+
 YAHOO.namespace("util");
 
 /**
@@ -1839,17 +2031,17 @@ YAHOO.util.UserAction = {
         if (!YAHOO.lang.isNumber(charCode)){
             charCode = 0; 
         }
-        
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
         //check for DOM-compliant browsers first
         if (YAHOO.lang.isFunction(document.createEvent)){
         
-            //try to create a mouse event
-            var event /*:MouseEvent*/ = null;
-            
             try {
                 
                 //try to create key event
-                event = document.createEvent("KeyEvents");
+                customEvent = document.createEvent("KeyEvents");
                 
                 /*
                  * Interesting problem: Firefox implemented a non-standard
@@ -1860,7 +2052,7 @@ YAHOO.util.UserAction = {
                  * now, assume it's Firefox if the above line doesn't error.
                  */
                 //TODO: Decipher between Firefox's implementation and a correct one.
-                event.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
                     altKey, shiftKey, metaKey, keyCode, charCode);       
                 
             } catch (ex /*:Error*/){
@@ -1877,56 +2069,56 @@ YAHOO.util.UserAction = {
                 try {
 
                     //try to create generic event - will fail in Safari 2.x
-                    event = document.createEvent("Events");
+                    customEvent = document.createEvent("Events");
 
                 } catch (uierror /*:Error*/){
 
                     //the above failed, so create a UIEvent for Safari 2.x
-                    event = document.createEvent("UIEvents");
+                    customEvent = document.createEvent("UIEvents");
 
                 } finally {
 
-                    event.initEvent(type, bubbles, cancelable);
+                    customEvent.initEvent(type, bubbles, cancelable);
     
                     //initialize
-                    event.view = view;
-                    event.altKey = altKey;
-                    event.ctrlKey = ctrlKey;
-                    event.shiftKey = shiftKey;
-                    event.metaKey = metaKey;
-                    event.keyCode = keyCode;
-                    event.charCode = charCode;
+                    customEvent.view = view;
+                    customEvent.altKey = altKey;
+                    customEvent.ctrlKey = ctrlKey;
+                    customEvent.shiftKey = shiftKey;
+                    customEvent.metaKey = metaKey;
+                    customEvent.keyCode = keyCode;
+                    customEvent.charCode = charCode;
           
                 }          
              
             }
             
             //fire the event
-            target.dispatchEvent(event);
+            target.dispatchEvent(customEvent);
 
         } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
         
             //create an IE event object
-            event = document.createEventObject();
+            customEvent = document.createEventObject();
             
             //assign available properties
-            event.bubbles = bubbles;
-            event.cancelable = cancelable;
-            event.view = view;
-            event.ctrlKey = ctrlKey;
-            event.altKey = altKey;
-            event.shiftKey = shiftKey;
-            event.metaKey = metaKey;
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.shiftKey = shiftKey;
+            customEvent.metaKey = metaKey;
             
             /*
              * IE doesn't support charCode explicitly. CharCode should
              * take precedence over any keyCode value for accurate
              * representation.
              */
-            event.keyCode = (charCode > 0) ? charCode : keyCode;
+            customEvent.keyCode = (charCode > 0) ? charCode : keyCode;
             
             //fire the event
-            target.fireEvent("on" + type, event);  
+            target.fireEvent("on" + type, customEvent);  
                     
         } else {
             throw new Error("simulateKeyEvent(): No event simulation framework present.");
@@ -2058,36 +2250,38 @@ YAHOO.util.UserAction = {
         if (!YAHOO.lang.isNumber(button)){
             button = 0; 
         }
-        
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
         //check for DOM-compliant browsers first
         if (YAHOO.lang.isFunction(document.createEvent)){
         
-            //try to create a mouse event
-            var event /*:MouseEvent*/ = document.createEvent("MouseEvents");
-            
+            customEvent = document.createEvent("MouseEvents");
+        
             //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
-            if (event.initMouseEvent){
-                event.initMouseEvent(type, bubbles, cancelable, view, detail,
+            if (customEvent.initMouseEvent){
+                customEvent.initMouseEvent(type, bubbles, cancelable, view, detail,
                                      screenX, screenY, clientX, clientY, 
                                      ctrlKey, altKey, shiftKey, metaKey, 
                                      button, relatedTarget);
             } else { //Safari
             
                 //the closest thing available in Safari 2.x is UIEvents
-                event = document.createEvent("UIEvents");
-                event.initEvent(type, bubbles, cancelable);
-                event.view = view;
-                event.detail = detail;
-                event.screenX = screenX;
-                event.screenY = screenY;
-                event.clientX = clientX;
-                event.clientY = clientY;
-                event.ctrlKey = ctrlKey;
-                event.altKey = altKey;
-                event.metaKey = metaKey;
-                event.shiftKey = shiftKey;
-                event.button = button;
-                event.relatedTarget = relatedTarget;
+                customEvent = document.createEvent("UIEvents");
+                customEvent.initEvent(type, bubbles, cancelable);
+                customEvent.view = view;
+                customEvent.detail = detail;
+                customEvent.screenX = screenX;
+                customEvent.screenY = screenY;
+                customEvent.clientX = clientX;
+                customEvent.clientY = clientY;
+                customEvent.ctrlKey = ctrlKey;
+                customEvent.altKey = altKey;
+                customEvent.metaKey = metaKey;
+                customEvent.shiftKey = shiftKey;
+                customEvent.button = button;
+                customEvent.relatedTarget = relatedTarget;
             }
             
             /*
@@ -2099,60 +2293,60 @@ YAHOO.util.UserAction = {
              * for mouseout event and fromElement property for mouseover
              * event.
              */
-            if (relatedTarget && !event.relatedTarget){
+            if (relatedTarget && !customEvent.relatedTarget){
                 if (type == "mouseout"){
-                    event.toElement = relatedTarget;
+                    customEvent.toElement = relatedTarget;
                 } else if (type == "mouseover"){
-                    event.fromElement = relatedTarget;
+                    customEvent.fromElement = relatedTarget;
                 }
             }
             
             //fire the event
-            target.dispatchEvent(event);
+            target.dispatchEvent(customEvent);
 
         } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
         
             //create an IE event object
-            event = document.createEventObject();
+            customEvent = document.createEventObject();
             
             //assign available properties
-            event.bubbles = bubbles;
-            event.cancelable = cancelable;
-            event.view = view;
-            event.detail = detail;
-            event.screenX = screenX;
-            event.screenY = screenY;
-            event.clientX = clientX;
-            event.clientY = clientY;
-            event.ctrlKey = ctrlKey;
-            event.altKey = altKey;
-            event.metaKey = metaKey;
-            event.shiftKey = shiftKey;
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.detail = detail;
+            customEvent.screenX = screenX;
+            customEvent.screenY = screenY;
+            customEvent.clientX = clientX;
+            customEvent.clientY = clientY;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.metaKey = metaKey;
+            customEvent.shiftKey = shiftKey;
 
             //fix button property for IE's wacky implementation
             switch(button){
                 case 0:
-                    event.button = 1;
+                    customEvent.button = 1;
                     break;
                 case 1:
-                    event.button = 4;
+                    customEvent.button = 4;
                     break;
                 case 2:
                     //leave as is
                     break;
                 default:
-                    event.button = 0;                    
+                    customEvent.button = 0;                    
             }    
 
             /*
              * Have to use relatedTarget because IE won't allow assignment
              * to toElement or fromElement on generic events. This keeps
-             * YAHOO.util.Event.getRelatedTarget() functional.
+             * YAHOO.util.customEvent.getRelatedTarget() functional.
              */
-            event.relatedTarget = relatedTarget;
+            customEvent.relatedTarget = relatedTarget;
             
             //fire the event
-            target.fireEvent("on" + type, event);
+            target.fireEvent("on" + type, customEvent);
                     
         } else {
             throw new Error("simulateMouseEvent(): No event simulation framework present.");
@@ -2334,6 +2528,7 @@ YAHOO.util.UserAction = {
     
 
 };
+
 YAHOO.namespace("tool");
 
 //-----------------------------------------------------------------------------
@@ -2475,6 +2670,8 @@ YAHOO.tool.TestManager = {
             this._timeoutId = setTimeout(function(){
                 YAHOO.tool.TestManager._run();
             }, 1000);
+        } else {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
         }
     },
     
@@ -2488,26 +2685,22 @@ YAHOO.tool.TestManager = {
     _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
 
         var r = this._results;
-
-        r.page_results[page] = results;
-
-        if (results.passed) {
-            r.pages_passed++;
-            r.tests_passed += results.passed;
-        }
-
-        if (results.failed) {
-            r.pages_failed++;
-            r.tests_failed += results.failed;
-            r.failed.push(page);
+        
+        r.passed += results.passed;
+        r.failed += results.failed;
+        r.ignored += results.ignored;
+        r.total += results.total;
+        
+        if (results.failed){
+            r.failedPages.push(page);
         } else {
-            r.passed.push(page);
+            r.passedPages.push(page);
         }
-
-        if (!this._pages.length) {
-            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
-        }
-
+        
+        results.name = page;
+        results.type = "page";
+        
+        r[page] = results;
     },
     
     /**
@@ -2632,6 +2825,16 @@ YAHOO.tool.TestManager = {
 
         // reset the results cache
         this._results = {
+        
+            passed: 0,
+            failed: 0,
+            ignored: 0,
+            total: 0,
+            type: "report",
+            name: "YUI Test Results",
+            failedPages:[],
+            passedPages:[]
+            /*
             // number of pages that pass
             pages_passed: 0,
             // number of pages that fail
@@ -2645,7 +2848,7 @@ YAHOO.tool.TestManager = {
             // array of pages that failed
             failed: [],
             // map of full results for each page
-            page_results: {}
+            page_results: {}*/
         };
 
         this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
@@ -2666,4 +2869,400 @@ YAHOO.tool.TestManager = {
 
 YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
 
-YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.3.0", build: "442"});
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+
+YAHOO.namespace("tool.TestFormat");
+
+/**
+ * Returns test results formatted as a JSON string. Requires JSON utility.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method JSON
+ * @static
+ */
+YAHOO.tool.TestFormat.JSON = function(results /*:Object*/) /*:String*/ {
+    return YAHOO.lang.JSON.stringify(results);
+};
+
+/**
+ * Returns test results formatted as an XML string.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method XML
+ * @static
+ */
+YAHOO.tool.TestFormat.XML = function(results /*:Object*/) /*:String*/ {
+
+    var l = YAHOO.lang;
+    var xml /*:String*/ = "<" + results.type + " name=\"" + results.name.replace(/"/g, "&quot;").replace(/'/g, "&apos;") + "\"";
+    
+    if (results.type == "test"){
+        xml += " result=\"" + results.result + "\" message=\"" + results.message + "\">";
+    } else {
+        xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";
+        for (var prop in results) {
+            if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){
+                xml += arguments.callee(results[prop]);
+            }
+        }        
+    }
+
+    xml += "</" + results.type + ">";
+    
+    return xml;
+
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * An object capable of sending test results to a server.
+ * @param {String} url The URL to submit the results to.
+ * @param {Function} format (Optiona) A function that outputs the results in a specific format.
+ *      Default is YAHOO.tool.TestFormat.XML.
+ * @constructor
+ * @namespace YAHOO.tool
+ * @class TestReporter
+ */
+YAHOO.tool.TestReporter = function(url /*:String*/, format /*:Function*/) {
+
+    /**
+     * The URL to submit the data to.
+     * @type String
+     * @property url
+     */
+    this.url /*:String*/ = url;
+
+    /**
+     * The formatting function to call when submitting the data.
+     * @type Function
+     * @property format
+     */
+    this.format /*:Function*/ = format || YAHOO.tool.TestFormat.XML;
+
+    /**
+     * Extra fields to submit with the request.
+     * @type Object
+     * @property _fields
+     * @private
+     */
+    this._fields /*:Object*/ = new Object();
+    
+    /**
+     * The form element used to submit the results.
+     * @type HTMLFormElement
+     * @property _form
+     * @private
+     */
+    this._form /*:HTMLElement*/ = null;
+
+    /**
+     * Iframe used as a target for form submission.
+     * @type HTMLIFrameElement
+     * @property _iframe
+     * @private
+     */
+    this._iframe /*:HTMLElement*/ = null;
+};
+
+YAHOO.tool.TestReporter.prototype = {
+
+    //restore missing constructor
+    constructor: YAHOO.tool.TestReporter,
+
+    /**
+     * Adds a field to the form that submits the results.
+     * @param {String} name The name of the field.
+     * @param {Variant} value The value of the field.
+     * @return {Void}
+     * @method addField
+     */
+    addField : function (name /*:String*/, value /*:Variant*/) /*:Void*/{
+        this._fields[name] = value;    
+    },
+    
+    /**
+     * Removes all previous defined fields.
+     * @return {Void}
+     * @method addField
+     */
+    clearFields : function() /*:Void*/{
+        this._fields = new Object();
+    },
+
+    /**
+     * Cleans up the memory associated with the TestReporter, removing DOM elements
+     * that were created.
+     * @return {Void}
+     * @method destroy
+     */
+    destroy : function() /*:Void*/ {
+        if (this._form){
+            this._form.parentNode.removeChild(this._form);
+            this._form = null;
+        }        
+        if (this._iframe){
+            this._iframe.parentNode.removeChild(this._iframe);
+            this._iframe = null;
+        }
+        this._fields = null;
+    },
+
+    /**
+     * Sends the report to the server.
+     * @param {Object} results The results object created by TestRunner.
+     * @return {Void}
+     * @method report
+     */
+    report : function(results /*:Object*/) /*:Void*/{
+    
+        //if the form hasn't been created yet, create it
+        if (!this._form){
+            this._form = document.createElement("form");
+            this._form.method = "post";
+            this._form.style.visibility = "hidden";
+            this._form.style.position = "absolute";
+            this._form.style.top = 0;
+            document.body.appendChild(this._form);
+        
+            //IE won't let you assign a name using the DOM, must do it the hacky way
+            if (YAHOO.env.ua.ie){
+                this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");
+            } else {
+                this._iframe = document.createElement("iframe");
+                this._iframe.name = "yuiTestTarget";
+            }
+
+            this._iframe.src = "javascript:false";
+            this._iframe.style.visibility = "hidden";
+            this._iframe.style.position = "absolute";
+            this._iframe.style.top = 0;
+            document.body.appendChild(this._iframe);
+
+            this._form.target = "yuiTestTarget";
+        }
+
+        //set the form's action
+        this._form.action = this.url;
+    
+        //remove any existing fields
+        while(this._form.hasChildNodes()){
+            this._form.removeChild(this._form.lastChild);
+        }
+        
+        //create default fields
+        this._fields.results = this.format(results);
+        this._fields.useragent = navigator.userAgent;
+        this._fields.timestamp = (new Date()).toLocaleString();
+
+        //add fields to the form
+        for (var prop in this._fields){
+            if (YAHOO.lang.hasOwnProperty(this._fields, prop) && typeof this._fields[prop] != "function"){
+                input = document.createElement("input");
+                input.type = "hidden";
+                input.name = prop;
+                input.value = this._fields[prop];
+                this._form.appendChild(input);
+            }
+        }
+
+        //remove default fields
+        delete this._fields.results;
+        delete this._fields.useragent;
+        delete this._fields.timestamp;
+        
+        if (arguments[1] !== false){
+            this._form.submit();
+        }
+    
+    }
+
+};
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
index 2501793c2d06c8a282c3a237c6cfb21b93870c7a..c916cc71061b458c117bf7efbfdcf43600c7e19b 100755 (executable)
@@ -1,73 +1,11 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
-
-YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(element,config){YAHOO.tool.TestLogger.superclass.constructor.call(this,element,config);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(message){var category=message.category;var text=this.html2Text(message.msg);return"<pre><p><span class=\""+category+"\">"+category.toUpperCase()+"</span> "+text+"</p></pre>";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}
-this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(testRunner){if(this._runner){this.clearTestRunner();}
-this._runner=testRunner;testRunner.subscribe(testRunner.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(data){var TestRunner=YAHOO.tool.TestRunner;var message="";var messageType="";switch(data.type){case TestRunner.BEGIN_EVENT:message="Testing began at "+(new Date()).toString()+".";messageType="info";break;case TestRunner.COMPLETE_EVENT:message="Testing completed at "+(new Date()).toString()+".\nPassed:"
-+data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;case TestRunner.TEST_FAIL_EVENT:message=data.testName+": "+data.error.getMessage();messageType="fail";break;case TestRunner.TEST_IGNORE_EVENT:message=data.testName+": ignored.";messageType="ignore";break;case TestRunner.TEST_PASS_EVENT:message=data.testName+": passed.";messageType="pass";break;case TestRunner.TEST_SUITE_BEGIN_EVENT:message="Test suite \""+data.testSuite.name+"\" started.";messageType="info";break;case TestRunner.TEST_SUITE_COMPLETE_EVENT:message="Test suite \""+data.testSuite.name+"\" completed.\nPassed:"
-+data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;case TestRunner.TEST_CASE_BEGIN_EVENT:message="Test case \""+data.testCase.name+"\" started.";messageType="info";break;case TestRunner.TEST_CASE_COMPLETE_EVENT:message="Test case \""+data.testCase.name+"\" completed.\nPassed:"
-+data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;default:message="Unexpected event "+data.type;message="info";}
-YAHOO.log(message,messageType,"TestRunner");}});YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function TestRunner(){TestRunner.superclass.constructor.apply(this,arguments);this.items=[];var events=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var i=0;i<events.length;i++){this.createEvent(events[i],{scope:this});}}
-YAHOO.lang.extend(TestRunner,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_runTestCase:function(testCase){var results={};this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:testCase});var tests=[];for(var prop in testCase){if(prop.indexOf("test")===0&&typeof testCase[prop]=="function"){tests.push(prop);}}
-var shouldFail=testCase._should.fail||{};var shouldError=testCase._should.error||{};var shouldIgnore=testCase._should.ignore||{};var failCount=0;var passCount=0;var runCount=0;for(var i=0;i<tests.length;i++){if(shouldIgnore[tests[i]]){this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:testCase,testName:tests[i]});continue;}
-var failed=false;var error=null;testCase.setUp();try{testCase[tests[i]]();if(shouldFail[tests[i]]){error=new YAHOO.util.ShouldFail();failed=true;}else if(shouldError[tests[i]]){error=new YAHOO.util.ShouldError();failed=true;}}catch(thrown){if(thrown instanceof YAHOO.util.AssertionError){if(!shouldFail[tests[i]]){error=thrown;failed=true;}}else{if(!shouldError[tests[i]]){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}else{if(YAHOO.lang.isString(shouldError[tests[i]])){if(thrown.message!=shouldError[tests[i]]){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}}else if(YAHOO.lang.isObject(shouldError[tests[i]])){if(!(thrown instanceof shouldError[tests[i]].constructor)||thrown.message!=shouldError[tests[i]].message){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}}}}}finally{if(failed){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:testCase,testName:tests[i],error:error});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:testCase,testName:tests[i]});}}
-testCase.tearDown();results[tests[i]]={result:failed?"fail":"pass",message:error?error.getMessage():"Test passed"};runCount++;failCount+=(failed?1:0);passCount+=(failed?0:1);}
-results.total=runCount;results.failed=failCount;results.passed=passCount;this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:testCase,results:results});return results;},_runTestSuite:function(testSuite){var results={passed:0,failed:0,total:0};this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:testSuite});for(var i=0;i<testSuite.items.length;i++){var result=null;if(testSuite.items[i]instanceof YAHOO.tool.TestSuite){result=this._runTestSuite(testSuite.items[i]);}else if(testSuite.items[i]instanceof YAHOO.tool.TestCase){result=this._runTestCase(testSuite.items[i]);}
-if(result!==null){results.total+=result.total;results.passed+=result.passed;results.failed+=result.failed;results[testSuite.items[i].name]=result;}}
-this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:testSuite,results:results});return results;},_run:function(testObject){if(YAHOO.lang.isObject(testObject)){if(testObject instanceof YAHOO.tool.TestSuite){return this._runTestSuite(testObject);}else if(testObject instanceof YAHOO.tool.TestCase){return this._runTestCase(testObject);}else{throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");}}},fireEvent:function(type,data){data=data||{};data.type=type;TestRunner.superclass.fireEvent.call(this,type,data);},add:function(testObject){this.items.push(testObject);},clear:function(){while(this.items.length){this.items.pop();}},run:function(testObject){var results=null;this.fireEvent(this.BEGIN_EVENT);if(YAHOO.lang.isObject(testObject)){results=this._run(testObject);}else{results={passed:0,failed:0,total:0};for(var i=0;i<this.items.length;i++){var result=this._run(this.items[i]);results.passed+=result.passed;results.failed+=result.failed;results.total+=result.total;results[this.items[i].name]=result;}}
-this.fireEvent(this.COMPLETE_EVENT,{results:results});}});return new TestRunner();})();YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(name){this.name=name||YAHOO.util.Dom.generateId(null,"testSuite");this.items=[];};YAHOO.tool.TestSuite.prototype={add:function(testObject){if(testObject instanceof YAHOO.tool.TestSuite||testObject instanceof YAHOO.tool.TestCase){this.items.push(testObject);}}};YAHOO.namespace("tool");YAHOO.tool.TestCase=function(template){this._should={};for(var prop in template){this[prop]=template[prop];}
-if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={setUp:function(){},tearDown:function(){}};YAHOO.namespace("util");YAHOO.util.Assert={fail:function(message){throw new YAHOO.util.AssertionError(message||"Test force-failed.");},areEqual:function(expected,actual,message){if(expected!=actual){throw new YAHOO.util.ComparisonFailure(message||"Values should be equal.",expected,actual);}},areNotEqual:function(unexpected,actual,message){if(unexpected==actual){throw new YAHOO.util.UnexpectedValue(message||"Values should not be equal.",unexpected);}},areNotSame:function(unexpected,actual,message){if(unexpected===actual){throw new YAHOO.util.UnexpectedValue(message||"Values should not be the same.",unexpected);}},areSame:function(expected,actual,message){if(expected!==actual){throw new YAHOO.util.ComparisonFailure(message||"Values should be the same.",expected,actual);}},isFalse:function(actual,message){if(false!==actual){throw new YAHOO.util.ComparisonFailure(message||"Value should be false.",false,actual);}},isTrue:function(actual,message){if(true!==actual){throw new YAHOO.util.ComparisonFailure(message||"Value should be true.",true,actual);}},isNaN:function(actual,message){if(!isNaN(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be NaN.",NaN,actual);}},isNotNaN:function(actual,message){if(isNaN(actual)){throw new YAHOO.util.UnexpectedValue(message||"Values should not be NaN.",NaN);}},isNotNull:function(actual,message){if(YAHOO.lang.isNull(actual)){throw new YAHOO.util.UnexpectedValue(message||"Values should not be null.",null);}},isNotUndefined:function(actual,message){if(YAHOO.lang.isUndefined(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should not be undefined.",undefined);}},isNull:function(actual,message){if(!YAHOO.lang.isNull(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be null.",null,actual);}},isUndefined:function(actual,message){if(!YAHOO.lang.isUndefined(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be undefined.",undefined,actual);}},isArray:function(actual,message){if(!YAHOO.lang.isArray(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be an array.",actual);}},isBoolean:function(actual,message){if(!YAHOO.lang.isBoolean(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a Boolean.",actual);}},isFunction:function(actual,message){if(!YAHOO.lang.isFunction(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a function.",actual);}},isInstanceOf:function(expected,actual,message){if(!(actual instanceof expected)){throw new YAHOO.util.ComparisonFailure(message||"Value isn't an instance of expected type.",expected,actual);}},isNumber:function(actual,message){if(!YAHOO.lang.isNumber(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a number.",actual);}},isObject:function(actual,message){if(!YAHOO.lang.isObject(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be an object.",actual);}},isString:function(actual,message){if(!YAHOO.lang.isString(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a string.",actual);}},isTypeOf:function(expectedType,actualValue,message){if(typeof actualValue!=expectedType){throw new YAHOO.util.ComparisonFailure(message||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(message){arguments.callee.superclass.constructor.call(this,message);this.message=message;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(message,expected,actual){arguments.callee.superclass.constructor.call(this,message);this.expected=expected;this.actual=actual;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")"+"\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(message,unexpected){arguments.callee.superclass.constructor.call(this,message);this.unexpected=unexpected;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(message){arguments.callee.superclass.constructor.call(this,message||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(message){arguments.callee.superclass.constructor.call(this,message||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(cause){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+cause.message);this.cause=cause;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(needle,haystack,message){var found=false;for(var i=0;i<haystack.length&&!found;i++){if(haystack[i]===needle){found=true;}}
-if(!found){YAHOO.util.Assert.fail(message||"Value ("+needle+") not found in array.");}},containsItems:function(needles,haystack,message){for(var i=0;i<needles.length;i++){this.contains(needles[i],haystack,message);}
-if(!found){YAHOO.util.Assert.fail(message||"Value not found in array.");}},containsMatch:function(matcher,haystack,message){if(typeof matcher!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}
-var found=false;for(var i=0;i<haystack.length&&!found;i++){if(matcher(haystack[i])){found=true;}}
-if(!found){YAHOO.util.Assert.fail(message||"No match found in array.");}},doesNotContain:function(needle,haystack,message){var found=false;for(var i=0;i<haystack.length&&!found;i++){if(haystack[i]===needle){found=true;}}
-if(found){YAHOO.util.Assert.fail(message||"Value found in array.");}},doesNotContainItems:function(needles,haystack,message){for(var i=0;i<needles.length;i++){this.doesNotContain(needles[i],haystack,message);}},doesNotContainMatch:function(matcher,haystack,message){if(typeof matcher!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}
-var found=false;for(var i=0;i<haystack.length&&!found;i++){if(matcher(haystack[i])){found=true;}}
-if(found){YAHOO.util.Assert.fail(message||"Value found in array.");}},indexOf:function(needle,haystack,index,message){for(var i=0;i<haystack.length;i++){if(haystack[i]===needle){YAHOO.util.Assert.areEqual(index,i,message||"Value exists at index "+i+" but should be at index "+index+".");return;}}
-YAHOO.util.Assert.fail(message||"Value doesn't exist in array.");},itemsAreEqual:function(expected,actual,message){var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){YAHOO.util.Assert.areEqual(expected[i],actual[i],message||"Values in position "+i+" are not equal.");}},itemsAreEquivalent:function(expected,actual,comparator,message){if(typeof comparator!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}
-var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){if(!comparator(expected[i],actual[i])){throw new YAHOO.util.ComparisonFailure(message||"Values in position "+i+" are not equivalent.",expected[i],actual[i]);}}},isEmpty:function(actual,message){if(actual.length>0){YAHOO.util.Assert.fail(message||"Array should be empty.");}},isNotEmpty:function(actual,message){if(actual.length===0){YAHOO.util.Assert.fail(message||"Array should not be empty.");}},itemsAreSame:function(expected,actual,message){var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){YAHOO.util.Assert.areSame(expected[i],actual[i],message||"Values in position "+i+" are not the same.");}},lastIndexOf:function(needle,haystack,index,message){for(var i=haystack.length;i>=0;i--){if(haystack[i]===needle){YAHOO.util.Assert.areEqual(index,i,message||"Value exists at index "+i+" but should be at index "+index+".");return;}}
-YAHOO.util.Assert.fail(message||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(expected,actual,message){var properties=[];for(var property in expected){properties.push(property);}
-for(var i=0;i<properties.length;i++){YAHOO.util.Assert.isNotUndefined(actual[properties[i]],message||"Property'"+properties[i]+"' expected.");}},hasProperty:function(propertyName,object,message){if(YAHOO.lang.isUndefined(object[propertyName])){YAHOO.util.Assert.fail(message||"Property "+propertyName+" not found on object.");}},hasOwnProperty:function(propertyName,object,message){if(!YAHOO.lang.hasOwnProperty(object,propertyName)){YAHOO.util.Assert.fail(message||"Property "+propertyName+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(expected,actual,message){if(expected instanceof Date&&actual instanceof Date){YAHOO.util.Assert.areEqual(expected.getFullYear(),actual.getFullYear(),message||"Years should be equal.");YAHOO.util.Assert.areEqual(expected.getMonth(),actual.getMonth(),message||"Months should be equal.");YAHOO.util.Assert.areEqual(expected.getDate(),actual.getDate(),message||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(expected,actual,message){if(expected instanceof Date&&actual instanceof Date){YAHOO.util.Assert.areEqual(expected.getHours(),actual.getHours(),message||"Hours should be equal.");YAHOO.util.Assert.areEqual(expected.getMinutes(),actual.getMinutes(),message||"Minutes should be equal.");YAHOO.util.Assert.areEqual(expected.getSeconds(),actual.getSeconds(),message||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.namespace("util");YAHOO.util.UserAction={simulateKeyEvent:function(target,type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode)
-{target=YAHOO.util.Dom.get(target);if(!target){throw new Error("simulateKeyEvent(): Invalid target.");}
-if(YAHOO.lang.isString(type)){type=type.toLowerCase();switch(type){case"keyup":case"keydown":case"keypress":break;case"textevent":type="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+type+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}
-if(!YAHOO.lang.isBoolean(bubbles)){bubbles=true;}
-if(!YAHOO.lang.isBoolean(cancelable)){cancelable=true;}
-if(!YAHOO.lang.isObject(view)){view=window;}
-if(!YAHOO.lang.isBoolean(ctrlKey)){ctrlKey=false;}
-if(!YAHOO.lang.isBoolean(altKey)){altKey=false;}
-if(!YAHOO.lang.isBoolean(shiftKey)){shiftKey=false;}
-if(!YAHOO.lang.isBoolean(metaKey)){metaKey=false;}
-if(!YAHOO.lang.isNumber(keyCode)){keyCode=0;}
-if(!YAHOO.lang.isNumber(charCode)){charCode=0;}
-if(YAHOO.lang.isFunction(document.createEvent)){var event=null;try{event=document.createEvent("KeyEvents");event.initKeyEvent(type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode);}catch(ex){try{event=document.createEvent("Events");}catch(uierror){event=document.createEvent("UIEvents");}finally{event.initEvent(type,bubbles,cancelable);event.view=view;event.altKey=altKey;event.ctrlKey=ctrlKey;event.shiftKey=shiftKey;event.metaKey=metaKey;event.keyCode=keyCode;event.charCode=charCode;}}
-target.dispatchEvent(event);}else if(YAHOO.lang.isObject(document.createEventObject)){event=document.createEventObject();event.bubbles=bubbles;event.cancelable=cancelable;event.view=view;event.ctrlKey=ctrlKey;event.altKey=altKey;event.shiftKey=shiftKey;event.metaKey=metaKey;event.keyCode=(charCode>0)?charCode:keyCode;target.fireEvent("on"+type,event);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}},simulateMouseEvent:function(target,type,bubbles,cancelable,view,detail,screenX,screenY,clientX,clientY,ctrlKey,altKey,shiftKey,metaKey,button,relatedTarget)
-{target=YAHOO.util.Dom.get(target);if(!target){throw new Error("simulateMouseEvent(): Invalid target.");}
-if(YAHOO.lang.isString(type)){type=type.toLowerCase();switch(type){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+type+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}
-if(!YAHOO.lang.isBoolean(bubbles)){bubbles=true;}
-if(!YAHOO.lang.isBoolean(cancelable)){cancelable=(type!="mousemove");}
-if(!YAHOO.lang.isObject(view)){view=window;}
-if(!YAHOO.lang.isNumber(detail)){detail=1;}
-if(!YAHOO.lang.isNumber(screenX)){screenX=0;}
-if(!YAHOO.lang.isNumber(screenY)){screenY=0;}
-if(!YAHOO.lang.isNumber(clientX)){clientX=0;}
-if(!YAHOO.lang.isNumber(clientY)){clientY=0;}
-if(!YAHOO.lang.isBoolean(ctrlKey)){ctrlKey=false;}
-if(!YAHOO.lang.isBoolean(altKey)){altKey=false;}
-if(!YAHOO.lang.isBoolean(shiftKey)){shiftKey=false;}
-if(!YAHOO.lang.isBoolean(metaKey)){metaKey=false;}
-if(!YAHOO.lang.isNumber(button)){button=0;}
-if(YAHOO.lang.isFunction(document.createEvent)){var event=document.createEvent("MouseEvents");if(event.initMouseEvent){event.initMouseEvent(type,bubbles,cancelable,view,detail,screenX,screenY,clientX,clientY,ctrlKey,altKey,shiftKey,metaKey,button,relatedTarget);}else{event=document.createEvent("UIEvents");event.initEvent(type,bubbles,cancelable);event.view=view;event.detail=detail;event.screenX=screenX;event.screenY=screenY;event.clientX=clientX;event.clientY=clientY;event.ctrlKey=ctrlKey;event.altKey=altKey;event.metaKey=metaKey;event.shiftKey=shiftKey;event.button=button;event.relatedTarget=relatedTarget;}
-if(relatedTarget&&!event.relatedTarget){if(type=="mouseout"){event.toElement=relatedTarget;}else if(type=="mouseover"){event.fromElement=relatedTarget;}}
-target.dispatchEvent(event);}else if(YAHOO.lang.isObject(document.createEventObject)){event=document.createEventObject();event.bubbles=bubbles;event.cancelable=cancelable;event.view=view;event.detail=detail;event.screenX=screenX;event.screenY=screenY;event.clientX=clientX;event.clientY=clientY;event.ctrlKey=ctrlKey;event.altKey=altKey;event.metaKey=metaKey;event.shiftKey=shiftKey;switch(button){case 0:event.button=1;break;case 1:event.button=4;break;case 2:break;default:event.button=0;}
-event.relatedTarget=relatedTarget;target.fireEvent("on"+type,event);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}},fireMouseEvent:function(target,type,options)
-{options=options||{};this.simulateMouseEvent(target,type,options.bubbles,options.cancelable,options.view,options.detail,options.screenX,options.screenY,options.clientX,options.clientY,options.ctrlKey,options.altKey,options.shiftKey,options.metaKey,options.button,options.relatedTarget);},click:function(target,options){this.fireMouseEvent(target,"click",options);},dblclick:function(target,options){this.fireMouseEvent(target,"dblclick",options);},mousedown:function(target,options){this.fireMouseEvent(target,"mousedown",options);},mousemove:function(target,options){this.fireMouseEvent(target,"mousemove",options);},mouseout:function(target,options){this.fireMouseEvent(target,"mouseout",options);},mouseover:function(target,options){this.fireMouseEvent(target,"mouseover",options);},mouseup:function(target,options){this.fireMouseEvent(target,"mouseup",options);},fireKeyEvent:function(type,target,options)
-{options=options||{};this.simulateKeyEvent(target,type,options.bubbles,options.cancelable,options.view,options.ctrlKey,options.altKey,options.shiftKey,options.metaKey,options.keyCode,options.charCode);},keydown:function(target,options){this.fireKeyEvent("keydown",target,options);},keypress:function(target,options){this.fireKeyEvent("keypress",target,options);},keyup:function(target,options){this.fireKeyEvent("keyup",target,options);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(data){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:data.results});this._processResults(this._curPage,data.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}},_processResults:function(page,results){var r=this._results;r.page_results[page]=results;if(results.passed){r.pages_passed++;r.tests_passed+=results.passed;}
-if(results.failed){r.pages_failed++;r.tests_failed+=results.failed;r.failed.push(page);}else{r.passed.push(page);}
-if(!this._pages.length){this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var TestRunner=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(TestRunner);TestRunner.subscribe(TestRunner.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);TestRunner.run();}}},setPages:function(pages){this._pages=pages;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var frame=document.createElement("iframe");frame.style.visibility="hidden";frame.style.position="absolute";document.body.appendChild(frame);this._frame=frame.contentWindow||frame.contentDocument.ownerWindow;}
-if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}
-this._initialized=true;}
-this._results={pages_passed:0,pages_failed:0,tests_passed:0,tests_failed:0,passed:[],failed:[],page_results:{}};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.register("yuitest",YAHOO.tool.TestRunner,{version:"2.3.0",build:"442"});
\ No newline at end of file
+YAHOO.namespace("tool");YAHOO.tool.TestCase=function(A){this._should={};for(var B in A){this[B]=A[B];}if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={resume:function(A){YAHOO.tool.TestRunner.resume(A);},wait:function(B,A){throw new YAHOO.tool.TestCase.Wait(B,A);},setUp:function(){},tearDown:function(){}};YAHOO.tool.TestCase.Wait=function(B,A){this.segment=(YAHOO.lang.isFunction(B)?B:null);this.delay=(YAHOO.lang.isNumber(A)?A:0);};YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(A){this.name="";this.items=[];if(YAHOO.lang.isString(A)){this.name=A;}else{if(YAHOO.lang.isObject(A)){YAHOO.lang.augmentObject(this,A,true);}}if(this.name===""){this.name=YAHOO.util.Dom.generateId(null,"testSuite");}};YAHOO.tool.TestSuite.prototype={add:function(A){if(A instanceof YAHOO.tool.TestSuite||A instanceof YAHOO.tool.TestCase){this.items.push(A);}},setUp:function(){},tearDown:function(){}};YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function B(C){this.testObject=C;this.firstChild=null;this.lastChild=null;this.parent=null;this.next=null;this.results={passed:0,failed:0,total:0,ignored:0};if(C instanceof YAHOO.tool.TestSuite){this.results.type="testsuite";this.results.name=C.name;}else{if(C instanceof YAHOO.tool.TestCase){this.results.type="testcase";this.results.name=C.name;}}}B.prototype={appendChild:function(C){var D=new B(C);if(this.firstChild===null){this.firstChild=this.lastChild=D;}else{this.lastChild.next=D;this.lastChild=D;}D.parent=this;return D;}};function A(){A.superclass.constructor.apply(this,arguments);this.masterSuite=new YAHOO.tool.TestSuite("YUI Test Results");this._cur=null;this._root=null;var D=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var C=0;C<D.length;C++){this.createEvent(D[C],{scope:this});}}YAHOO.lang.extend(A,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(C,D){var E=C.appendChild(D);for(var F in D){if(F.indexOf("test")===0&&YAHOO.lang.isFunction(D[F])){E.appendChild(F);}}},_addTestSuiteToTestTree:function(C,F){var E=C.appendChild(F);for(var D=0;D<F.items.length;D++){if(F.items[D] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(E,F.items[D]);}else{if(F.items[D] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(E,F.items[D]);}}}},_buildTestTree:function(){this._root=new B(this.masterSuite);this._cur=this._root;for(var C=0;C<this.masterSuite.items.length;C++){if(this.masterSuite.items[C] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(this._root,this.masterSuite.items[C]);}else{if(this.masterSuite.items[C] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(this._root,this.masterSuite.items[C]);}}}},_handleTestObjectComplete:function(C){if(YAHOO.lang.isObject(C.testObject)){C.parent.results.passed+=C.results.passed;C.parent.results.failed+=C.results.failed;C.parent.results.total+=C.results.total;C.parent.results.ignored+=C.results.ignored;C.parent.results[C.testObject.name]=C.results;if(C.testObject instanceof YAHOO.tool.TestSuite){C.testObject.tearDown();this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:C.testObject,results:C.results});}else{if(C.testObject instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:C.testObject,results:C.results});}}}},_next:function(){if(this._cur.firstChild){this._cur=this._cur.firstChild;}else{if(this._cur.next){this._cur=this._cur.next;}else{while(this._cur&&!this._cur.next&&this._cur!==this._root){this._handleTestObjectComplete(this._cur);this._cur=this._cur.parent;}if(this._cur==this._root){this._cur.results.type="report";this._cur.results.timestamp=(new Date()).toLocaleString();this.fireEvent(this.COMPLETE_EVENT,{results:this._cur.results});this._cur=null;}else{this._handleTestObjectComplete(this._cur);this._cur=this._cur.next;}}}return this._cur;},_run:function(){var E=false;var D=this._next();if(D!==null){var C=D.testObject;if(YAHOO.lang.isObject(C)){if(C instanceof YAHOO.tool.TestSuite){this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:C});C.setUp();}else{if(C instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:C});}}if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{this._runTest(D);}}},_resumeTest:function(G){var C=this._cur;var H=C.testObject;var E=C.parent.testObject;var K=(E._should.fail||{})[H];var D=(E._should.error||{})[H];var F=false;var I=null;try{G.apply(E);if(K){I=new YAHOO.util.ShouldFail();F=true;}else{if(D){I=new YAHOO.util.ShouldError();F=true;}}}catch(J){if(J instanceof YAHOO.util.AssertionError){if(!K){I=J;F=true;}}else{if(J instanceof YAHOO.tool.TestCase.Wait){if(YAHOO.lang.isFunction(J.segment)){if(YAHOO.lang.isNumber(J.delay)){if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._resumeTest(J.segment);},J.delay);}else{throw new Error("Asynchronous tests not supported in this environment.");}}}return ;}else{if(!D){I=new YAHOO.util.UnexpectedError(J);F=true;}else{if(YAHOO.lang.isString(D)){if(J.message!=D){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isFunction(D)){if(!(J instanceof D)){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isObject(D)){if(!(J instanceof D.constructor)||J.message!=D.message){I=new YAHOO.util.UnexpectedError(J);F=true;}}}}}}}}if(F){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:E,testName:H,error:I});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:E,testName:H});}E.tearDown();C.parent.results[H]={result:F?"fail":"pass",message:I?I.getMessage():"Test passed",type:"test",name:H};
+if(F){C.parent.results.failed++;}else{C.parent.results.passed++;}C.parent.results.total++;if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}},_runTest:function(F){var C=F.testObject;var D=F.parent.testObject;var G=D[C];var E=(D._should.ignore||{})[C];if(E){F.parent.results[C]={result:"ignore",message:"Test ignored",type:"test",name:C};F.parent.results.ignored++;F.parent.results.total++;this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:D,testName:C});if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{D.setUp();this._resumeTest(G);}},fireEvent:function(C,D){D=D||{};D.type=C;A.superclass.fireEvent.call(this,C,D);},add:function(C){this.masterSuite.add(C);},clear:function(){this.masterSuite.items=[];},resume:function(C){this._resumeTest(C||function(){});},run:function(C){var D=YAHOO.tool.TestRunner;D._buildTestTree();D.fireEvent(D.BEGIN_EVENT);D._run();}});return new A();})();YAHOO.namespace("util");YAHOO.util.Assert={fail:function(A){throw new YAHOO.util.AssertionError(A||"Test force-failed.");},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(A||"Values should be equal.",B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be equal.",A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be the same.",A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(A||"Values should be the same.",B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be false.",false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be true.",true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be NaN.",NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be NaN.",NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be null.",null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should not be undefined.",undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be null.",null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be undefined.",undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an array.",B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a Boolean.",B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a function.",B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(A||"Value isn't an instance of expected type.",B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a number.",B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an object.",B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a string.",B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(B||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"Value ("+E+") not found in array.");}},containsItems:function(C,D,B){for(var A=0;A<C.length;A++){this.contains(C[A],D,B);}if(!found){YAHOO.util.Assert.fail(B||"Value not found in array.");}},containsMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"No match found in array.");}},doesNotContain:function(E,D,B){var C=false;
+for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},doesNotContainItems:function(C,D,B){for(var A=0;A<C.length;A++){this.doesNotContain(C[A],D,B);}},doesNotContainMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},indexOf:function(E,D,A,C){for(var B=0;B<D.length;B++){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");},itemsAreEqual:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areEqual(D[B],E[B],C||"Values in position "+B+" are not equal.");}},itemsAreEquivalent:function(E,F,B,D){if(typeof B!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}var A=Math.max(E.length,F.length);for(var C=0;C<A;C++){if(!B(E[C],F[C])){throw new YAHOO.util.ComparisonFailure(D||"Values in position "+C+" are not equivalent.",E[C],F[C]);}}},isEmpty:function(B,A){if(B.length>0){YAHOO.util.Assert.fail(A||"Array should be empty.");}},isNotEmpty:function(B,A){if(B.length===0){YAHOO.util.Assert.fail(A||"Array should not be empty.");}},itemsAreSame:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areSame(D[B],E[B],C||"Values in position "+B+" are not the same.");}},lastIndexOf:function(E,D,A,C){for(var B=D.length;B>=0;B--){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,F,C){var B=[];for(var E in D){B.push(E);}for(var A=0;A<B.length;A++){YAHOO.util.Assert.isNotUndefined(F[B[A]],C||"Property'"+B[A]+"' expected.");}},hasProperty:function(A,B,C){if(YAHOO.lang.isUndefined(B[A])){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object.");}},hasOwnProperty:function(A,B,C){if(!YAHOO.lang.hasOwnProperty(B,A)){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getFullYear(),C.getFullYear(),A||"Years should be equal.");YAHOO.util.Assert.areEqual(B.getMonth(),C.getMonth(),A||"Months should be equal.");YAHOO.util.Assert.areEqual(B.getDate(),C.getDate(),A||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getHours(),C.getHours(),A||"Hours should be equal.");YAHOO.util.Assert.areEqual(B.getMinutes(),C.getMinutes(),A||"Minutes should be equal.");YAHOO.util.Assert.areEqual(B.getSeconds(),C.getSeconds(),A||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.namespace("util");YAHOO.util.UserAction={simulateKeyEvent:function(F,J,E,C,L,B,A,K,H,N,M){F=YAHOO.util.Dom.get(F);if(!F){throw new Error("simulateKeyEvent(): Invalid target.");}if(YAHOO.lang.isString(J)){J=J.toLowerCase();switch(J){case"keyup":case"keydown":case"keypress":break;case"textevent":J="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+J+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(E)){E=true;}if(!YAHOO.lang.isBoolean(C)){C=true;}if(!YAHOO.lang.isObject(L)){L=window;}if(!YAHOO.lang.isBoolean(B)){B=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(K)){K=false;}if(!YAHOO.lang.isBoolean(H)){H=false;}if(!YAHOO.lang.isNumber(N)){N=0;}if(!YAHOO.lang.isNumber(M)){M=0;}var I=null;if(YAHOO.lang.isFunction(document.createEvent)){try{I=document.createEvent("KeyEvents");I.initKeyEvent(J,E,C,L,B,A,K,H,N,M);}catch(G){try{I=document.createEvent("Events");}catch(D){I=document.createEvent("UIEvents");}finally{I.initEvent(J,E,C);I.view=L;I.altKey=A;I.ctrlKey=B;I.shiftKey=K;I.metaKey=H;I.keyCode=N;I.charCode=M;}}F.dispatchEvent(I);}else{if(YAHOO.lang.isObject(document.createEventObject)){I=document.createEventObject();I.bubbles=E;I.cancelable=C;I.view=L;I.ctrlKey=B;I.altKey=A;I.shiftKey=K;I.metaKey=H;I.keyCode=(M>0)?M:N;F.fireEvent("on"+J,I);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}}},simulateMouseEvent:function(K,P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L){K=YAHOO.util.Dom.get(K);if(!K){throw new Error("simulateMouseEvent(): Invalid target.");}if(YAHOO.lang.isString(P)){P=P.toLowerCase();switch(P){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+P+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(H)){H=true;}if(!YAHOO.lang.isBoolean(E)){E=(P!="mousemove");}if(!YAHOO.lang.isObject(Q)){Q=window;}if(!YAHOO.lang.isNumber(J)){J=1;}if(!YAHOO.lang.isNumber(G)){G=0;}if(!YAHOO.lang.isNumber(F)){F=0;}if(!YAHOO.lang.isNumber(D)){D=0;}if(!YAHOO.lang.isNumber(B)){B=0;}if(!YAHOO.lang.isBoolean(C)){C=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(O)){O=false;}if(!YAHOO.lang.isBoolean(M)){M=false;}if(!YAHOO.lang.isNumber(I)){I=0;}var N=null;if(YAHOO.lang.isFunction(document.createEvent)){N=document.createEvent("MouseEvents");if(N.initMouseEvent){N.initMouseEvent(P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L);}else{N=document.createEvent("UIEvents");N.initEvent(P,H,E);N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;N.button=I;
+N.relatedTarget=L;}if(L&&!N.relatedTarget){if(P=="mouseout"){N.toElement=L;}else{if(P=="mouseover"){N.fromElement=L;}}}K.dispatchEvent(N);}else{if(YAHOO.lang.isObject(document.createEventObject)){N=document.createEventObject();N.bubbles=H;N.cancelable=E;N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;switch(I){case 0:N.button=1;break;case 1:N.button=4;break;case 2:break;default:N.button=0;}N.relatedTarget=L;K.fireEvent("on"+P,N);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}}},fireMouseEvent:function(C,B,A){A=A||{};this.simulateMouseEvent(C,B,A.bubbles,A.cancelable,A.view,A.detail,A.screenX,A.screenY,A.clientX,A.clientY,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.button,A.relatedTarget);},click:function(B,A){this.fireMouseEvent(B,"click",A);},dblclick:function(B,A){this.fireMouseEvent(B,"dblclick",A);},mousedown:function(B,A){this.fireMouseEvent(B,"mousedown",A);},mousemove:function(B,A){this.fireMouseEvent(B,"mousemove",A);},mouseout:function(B,A){this.fireMouseEvent(B,"mouseout",A);},mouseover:function(B,A){this.fireMouseEvent(B,"mouseover",A);},mouseup:function(B,A){this.fireMouseEvent(B,"mouseup",A);},fireKeyEvent:function(B,C,A){A=A||{};this.simulateKeyEvent(C,B,A.bubbles,A.cancelable,A.view,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.keyCode,A.charCode);},keydown:function(B,A){this.fireKeyEvent("keydown",B,A);},keypress:function(B,A){this.fireKeyEvent("keypress",B,A);},keyup:function(B,A){this.fireKeyEvent("keyup",B,A);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(A){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:A.results});this._processResults(this._curPage,A.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}else{this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_processResults:function(C,A){var B=this._results;B.passed+=A.passed;B.failed+=A.failed;B.ignored+=A.ignored;B.total+=A.total;if(A.failed){B.failedPages.push(C);}else{B.passedPages.push(C);}A.name=C;A.type="page";B[C]=A;},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var A=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(A);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);A.run();}}},setPages:function(A){this._pages=A;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var A=document.createElement("iframe");A.style.visibility="hidden";A.style.position="absolute";document.body.appendChild(A);this._frame=A.contentWindow||A.contentDocument.ownerWindow;}if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}this._initialized=true;}this._results={passed:0,failed:0,ignored:0,total:0,type:"report",name:"YUI Test Results",failedPages:[],passedPages:[]};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(B,A){YAHOO.tool.TestLogger.superclass.constructor.call(this,B,A);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(B){var A=B.category;var C=this.html2Text(B.msg);return"<pre><p><span class=\""+A+"\">"+A.toUpperCase()+"</span> "+C+"</p></pre>";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(A){if(this._runner){this.clearTestRunner();}this._runner=A;A.subscribe(A.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(D){var A=YAHOO.tool.TestRunner;var C="";var B="";switch(D.type){case A.BEGIN_EVENT:C="Testing began at "+(new Date()).toString()+".";B="info";break;case A.COMPLETE_EVENT:C="Testing completed at "+(new Date()).toString()+".\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_FAIL_EVENT:C=D.testName+": "+D.error.getMessage();B="fail";break;case A.TEST_IGNORE_EVENT:C=D.testName+": ignored.";B="ignore";break;case A.TEST_PASS_EVENT:C=D.testName+": passed.";B="pass";break;case A.TEST_SUITE_BEGIN_EVENT:C="Test suite \""+D.testSuite.name+"\" started.";B="info";break;case A.TEST_SUITE_COMPLETE_EVENT:C="Test suite \""+D.testSuite.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;
+B="info";break;case A.TEST_CASE_BEGIN_EVENT:C="Test case \""+D.testCase.name+"\" started.";B="info";break;case A.TEST_CASE_COMPLETE_EVENT:C="Test case \""+D.testCase.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;default:C="Unexpected event "+D.type;C="info";}YAHOO.log(C,B,"TestRunner");}});YAHOO.namespace("tool.TestFormat");YAHOO.tool.TestFormat.JSON=function(A){return YAHOO.lang.JSON.stringify(A);};YAHOO.tool.TestFormat.XML=function(C){var A=YAHOO.lang;var B="<"+C.type+" name=\""+C.name.replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"\"";if(C.type=="test"){B+=" result=\""+C.result+"\" message=\""+C.message+"\">";}else{B+=" passed=\""+C.passed+"\" failed=\""+C.failed+"\" ignored=\""+C.ignored+"\" total=\""+C.total+"\">";for(var D in C){if(A.hasOwnProperty(C,D)&&A.isObject(C[D])&&!A.isArray(C[D])){B+=arguments.callee(C[D]);}}}B+="</"+C.type+">";return B;};YAHOO.namespace("tool");YAHOO.tool.TestReporter=function(A,B){this.url=A;this.format=B||YAHOO.tool.TestFormat.XML;this._fields=new Object();this._form=null;this._iframe=null;};YAHOO.tool.TestReporter.prototype={constructor:YAHOO.tool.TestReporter,addField:function(A,B){this._fields[A]=B;},clearFields:function(){this._fields=new Object();},destroy:function(){if(this._form){this._form.parentNode.removeChild(this._form);this._form=null;}if(this._iframe){this._iframe.parentNode.removeChild(this._iframe);this._iframe=null;}this._fields=null;},report:function(A){if(!this._form){this._form=document.createElement("form");this._form.method="post";this._form.style.visibility="hidden";this._form.style.position="absolute";this._form.style.top=0;document.body.appendChild(this._form);if(YAHOO.env.ua.ie){this._iframe=document.createElement("<iframe name=\"yuiTestTarget\" />");}else{this._iframe=document.createElement("iframe");this._iframe.name="yuiTestTarget";}this._iframe.src="javascript:false";this._iframe.style.visibility="hidden";this._iframe.style.position="absolute";this._iframe.style.top=0;document.body.appendChild(this._iframe);this._form.target="yuiTestTarget";}this._form.action=this.url;while(this._form.hasChildNodes()){this._form.removeChild(this._form.lastChild);}this._fields.results=this.format(A);this._fields.useragent=navigator.userAgent;this._fields.timestamp=(new Date()).toLocaleString();for(var B in this._fields){if(YAHOO.lang.hasOwnProperty(this._fields,B)&&typeof this._fields[B]!="function"){input=document.createElement("input");input.type="hidden";input.name=B;input.value=this._fields[B];this._form.appendChild(input);}}delete this._fields.results;delete this._fields.useragent;delete this._fields.timestamp;if(arguments[1]!==false){this._form.submit();}}};YAHOO.register("yuitest",YAHOO.tool.TestRunner,{version:"2.5.0",build:"895"});
\ No newline at end of file
index 0efbbf536f6f28faeec4be0d89004d3dbe0771c2..ad114842e9e9432e17955b609ee25b6bbbb51943 100755 (executable)
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.3.0
+version: 2.5.0
 */
 YAHOO.namespace("tool");
 
 //-----------------------------------------------------------------------------
-// TestLogger object
+// TestCase object
 //-----------------------------------------------------------------------------
 
 /**
- * Displays test execution progress and results, providing filters based on
- * different key events.
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
  * @namespace YAHOO.tool
- * @class TestLogger
  * @constructor
- * @param {HTMLElement} element (Optional) The element to create the logger in.
- * @param {Object} config (Optional) Configuration options for the logger.
  */
-YAHOO.tool.TestLogger = function (element, config) {
-    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
-    this.init();
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
 };
 
-YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
 
-    footerEnabled : true,
-    newestOnTop : false,
+YAHOO.tool.TestCase.prototype = {  
 
     /**
-     * Formats message string to HTML for output to console.
-     * @private
-     * @method formatMsg
-     * @param oLogMsg {Object} Log message object.
-     * @return {String} HTML-formatted message for output to console.
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
      */
-    formatMsg : function(message /*:Object*/) {
-    
-        var category /*:String*/ = message.category;        
-        var text /*:String*/ = this.html2Text(message.msg);
-        
-        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
-    
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
     },
-    
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
     //-------------------------------------------------------------------------
-    // Private Methods
+    // Stub Methods
     //-------------------------------------------------------------------------
-    
-    /*
-     * Initializes the logger.
-     * @private
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
      */
-    init : function () {
-    
-        //attach to any available TestRunner
-        if (YAHOO.tool.TestRunner){
-            this.setTestRunner(YAHOO.tool.TestRunner);
-        }
-        
-        //hide useless sources
-        this.hideSource("global");
-        this.hideSource("LogReader");
-        
-        //hide useless message categories
-        this.hideCategory("warn");
-        this.hideCategory("window");
-        this.hideCategory("time");
-        
-        //reset the logger
-        this.clearConsole();
+    setUp : function () /*:Void*/ {
     },
     
     /**
-     * Clears the reference to the TestRunner from previous operations. This 
-     * unsubscribes all events and removes the object reference.
+     * Function to run after each test is executed.
      * @return {Void}
-     * @static
+     * @method tearDown
      */
-    clearTestRunner : function () /*:Void*/ {
-        if (this._runner){
-            this._runner.unsubscribeAll();
-            this._runner = null;
-        }
-    },
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
     
     /**
-     * Sets the source test runner that the logger should monitor.
-     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
-     * @return {Void}
-     * @static
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
      */
-    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
     
-        if (this._runner){
-            this.clearTestRunner();
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
         }
-        
-        this._runner = testRunner;
-        
-        //setup event _handlers
-        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
-        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
     },
     
     //-------------------------------------------------------------------------
-    // Event Handlers
+    // Stub Methods
     //-------------------------------------------------------------------------
-    
+
     /**
-     * Handles all TestRunner events, outputting appropriate data into the console.
-     * @param {Object} data The event data object.
+     * Function to run before each test is executed.
      * @return {Void}
-     * @private
+     * @method setUp
      */
-    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
-    
-        //shortcut variables
-        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
-    
-        //data variables
-        var message /*:String*/ = "";
-        var messageType /*:String*/ = "";
-        
-        switch(data.type){
-            case TestRunner.BEGIN_EVENT:
-                message = "Testing began at " + (new Date()).toString() + ".";
-                messageType = "info";
-                break;
-                
-            case TestRunner.COMPLETE_EVENT:
-                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_FAIL_EVENT:
-                message = data.testName + ": " + data.error.getMessage();
-                messageType = "fail";
-                break;
-                
-            case TestRunner.TEST_IGNORE_EVENT:
-                message = data.testName + ": ignored.";
-                messageType = "ignore";
-                break;
-                
-            case TestRunner.TEST_PASS_EVENT:
-                message = data.testName + ": passed.";
-                messageType = "pass";
-                break;
-                
-            case TestRunner.TEST_SUITE_BEGIN_EVENT:
-                message = "Test suite \"" + data.testSuite.name + "\" started.";
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
-                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_CASE_BEGIN_EVENT:
-                message = "Test case \"" + data.testCase.name + "\" started.";
-                messageType = "info";
-                break;
-                
-            case TestRunner.TEST_CASE_COMPLETE_EVENT:
-                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" 
-                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
-                messageType = "info";
-                break;
-            default:
-                message = "Unexpected event " + data.type;
-                message = "info";
-        }
+    setUp : function () /*:Void*/ {
+    },
     
-        YAHOO.log(message, messageType, "TestRunner");    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
     }
     
-});
+};
+
 YAHOO.namespace("tool");
 
 /**
@@ -211,20 +222,126 @@ YAHOO.namespace("tool");
  */
 YAHOO.tool.TestRunner = (function(){
 
-    function TestRunner(){
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
     
-        //inherit from EventProvider
-        TestRunner.superclass.constructor.apply(this,arguments);
-        
         /**
-         * The test objects to run.
-         * @type Array
-         * @private
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
          */
-        this.items /*:Array*/ = [];
+        this.testObject = testObject;
         
-        //create events
-        var events /*:Array*/ = [
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
             this.TEST_CASE_BEGIN_EVENT,
             this.TEST_CASE_COMPLETE_EVENT,
             this.TEST_SUITE_BEGIN_EVENT,
@@ -237,8 +354,7 @@ YAHOO.tool.TestRunner = (function(){
         ];
         for (var i=0; i < events.length; i++){
             this.createEvent(events[i], { scope: this });
-        }
-       
+        }       
    
     }
     
@@ -304,212 +420,373 @@ YAHOO.tool.TestRunner = (function(){
          * @event begin
          */        
         BEGIN_EVENT /*:String*/ : "begin",    
-    
+        
         //-------------------------------------------------------------------------
-        // Private Methods
+        // Test Tree-Related Methods
         //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
          
+        },
+        
         /**
-         * Runs a given test case.
-         * @param {YAHOO.tool.TestCase} testCase The test case to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @method _runTestCase
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
          * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
          * @static
+         * @private
+         * @method _buildTestTree
          */
-        _runTestCase : function (testCase /*YAHOO.tool.TestCase*/) /*:Void*/{
+        _buildTestTree : function () /*:Void*/ {
         
-            //object to store results
-            var results /*:Object*/ = {};
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
         
-            //test case begins
-            this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testCase });
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
         
-            //gather the test functions
-            var tests /*:Array*/ = [];
-            for (var prop in testCase){
-                if (prop.indexOf("test") === 0 && typeof testCase[prop] == "function") {
-                    tests.push(prop);
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
                 }
             }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
             
-            //get the "should" test cases
-            var shouldFail /*:Object*/ = testCase._should.fail || {};
-            var shouldError /*:Object*/ = testCase._should.error || {};
-            var shouldIgnore /*:Object*/ = testCase._should.ignore || {};
-            
-            //test counts
-            var failCount /*:int*/ = 0;
-            var passCount /*:int*/ = 0;
-            var runCount /*:int*/ = 0;
-            
-            //run each test
-            for (var i=0; i < tests.length; i++){
+            //get the next test node
+            var node = this._next();
             
-                //figure out if the test should be ignored or not
-                if (shouldIgnore[tests[i]]){
-                    this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: tests[i] });
-                    continue;
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
                 }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
             
-                //variable to hold whether or not the test failed
-                var failed /*:Boolean*/ = false;
-                var error /*:Error*/ = null;
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
             
-                //run the setup
-                testCase.setUp();
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
                 
-                //try the test
-                try {
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
                 
-                    //run the test
-                    testCase[tests[i]]();
-                    
-                    //if it should fail, and it got here, then it's a fail because it didn't
-                    if (shouldFail[tests[i]]){
-                        error = new YAHOO.util.ShouldFail();
-                        failed = true;
-                    } else if (shouldError[tests[i]]){
-                        error = new YAHOO.util.ShouldError();
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
                         failed = true;
                     }
-                               
-                } catch (thrown /*:Error*/){
-                    if (thrown instanceof YAHOO.util.AssertionError) {
-                        if (!shouldFail[tests[i]]){
-                            error = thrown;
-                            failed = true;
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
                         }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
                     } else {
-                        //first check to see if it should error
-                        if (!shouldError[tests[i]]) {                        
-                            error = new YAHOO.util.UnexpectedError(thrown);
-                            failed = true;
-                        } else {
-                            //check to see what type of data we have
-                            if (YAHOO.lang.isString(shouldError[tests[i]])){
-                                
-                                //if it's a string, check the error message
-                                if (thrown.message != shouldError[tests[i]]){
-                                    error = new YAHOO.util.UnexpectedError(thrown);
-                                    failed = true;                                    
-                                }
-                            } else if (YAHOO.lang.isObject(shouldError[tests[i]])){
-                            
-                                //if it's an object, check the instance and message
-                                if (!(thrown instanceof shouldError[tests[i]].constructor) || 
-                                        thrown.message != shouldError[tests[i]].message){
-                                    error = new YAHOO.util.UnexpectedError(thrown);
-                                    failed = true;                                    
-                                }
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
                             
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
                             }
                         
                         }
-                    }
                     
-                } finally {
-                
-                    //fireEvent appropriate event
-                    if (failed) {
-                        this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: tests[i], error: error });
-                    } else {
-                        this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: tests[i] });
-                    }            
+                    }
                 }
                 
-                //run the tear down
-                testCase.tearDown();
-                
-                //update results
-                results[tests[i]] = { 
-                    result: failed ? "fail" : "pass",
-                    message : error ? error.getMessage() : "Test passed"
-                };
-                
-                //update counts
-                runCount++;
-                failCount += (failed ? 1 : 0);
-                passCount += (failed ? 0 : 1);
             }
             
-            //add test counts to results
-            results.total = runCount;
-            results.failed = failCount;
-            results.passed = passCount;
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
             
-            //test case is done
-            this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: testCase, results: results });
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
             
-            //return results
-            return results;
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
         
         },
-        
+                
         /**
-         * Runs all the tests in a test suite.
-         * @param {YAHOO.tool.TestSuite} testSuite The test suite to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @method _runTestSuite
-         * @private
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
          * @static
+         * @private
+         * @name _runTest
          */
-        _runTestSuite : function (testSuite /*:YAHOO.tool.TestSuite*/) {
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
         
-            //object to store results
-            var results /*:Object*/ = {
-                passed: 0,
-                failed: 0,
-                total: 0
-            };
-        
-            //fireEvent event for beginning of test suite run
-            this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testSuite });
-        
-            //iterate over the test suite items
-            for (var i=0; i < testSuite.items.length; i++){
-                var result = null;
-                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
-                    result = this._runTestSuite(testSuite.items[i]);
-                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
-                    result = this._runTestCase(testSuite.items[i]);
-                }
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
                 
-                if (result !== null){
-                    results.total += result.total;
-                    results.passed += result.passed;
-                    results.failed += result.failed;
-                    results[testSuite.items[i].name] = result;
-                }
-            }
-    
-            //fireEvent event for completion of test suite run
-            this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: testSuite, results: results });
+                node.parent.results.ignored++;
+                node.parent.results.total++;
             
-            //return the results
-            return results;
-        
-        },
-        
-        /**
-         * Runs a test case or test suite, returning the results.
-         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
-         * @return {Object} Results of the execution with properties passed, failed, and total.
-         * @private
-         * @method _run
-         * @static
-         */
-        _run : function (testObject /*:YAHOO.tool.TestCase|YAHOO.tool.TestSuite*/) /*:Void*/ {
-            if (YAHOO.lang.isObject(testObject)){
-                if (testObject instanceof YAHOO.tool.TestSuite) {
-                    return this._runTestSuite(testObject);
-                } else if (testObject instanceof YAHOO.tool.TestCase) {
-                    return this._runTestCase(testObject);
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
                 } else {
-                    throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");
-                }    
-            }        
-        },
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
         
         //-------------------------------------------------------------------------
         // Protected Methods
@@ -538,171 +815,82 @@ YAHOO.tool.TestRunner = (function(){
         /**
          * Adds a test suite or test case to the list of test objects to run.
          * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
          */
         add : function (testObject /*:Object*/) /*:Void*/ {
-            this.items.push(testObject);
+            this.masterSuite.add(testObject);
         },
         
         /**
          * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
          */
         clear : function () /*:Void*/ {
-            while(this.items.length){
-                this.items.pop();
-            }
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
         },
     
         /**
          * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
          */
-        run : function (testObject /*:Object*/) /*:Void*/ { 
-            var results = null;
+        run : function (testObject /*:Object*/) /*:Void*/ {
             
-            this.fireEvent(this.BEGIN_EVENT);
-       
-            //an object passed in overrides everything else
-            if (YAHOO.lang.isObject(testObject)){
-                results = this._run(testObject);  
-            } else {
-                results = {
-                    passed: 0,
-                    failed: 0,
-                    total: 0
-                };
-                for (var i=0; i < this.items.length; i++){
-                    var result = this._run(this.items[i]);
-                    results.passed += result.passed;
-                    results.failed += result.failed;
-                    results.total += result.total;
-                    results[this.items[i].name] = result;
-                }            
-            }
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
             
-            this.fireEvent(this.COMPLETE_EVENT, { results: results });
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
         }    
     });
     
     return new TestRunner();
     
 })();
-YAHOO.namespace("tool");
 
+YAHOO.namespace("util");
 
 //-----------------------------------------------------------------------------
-// TestSuite object
+// Assert object
 //-----------------------------------------------------------------------------
 
 /**
- * A test suite that can contain a collection of TestCase and TestSuite objects.
- * @param {String} name The name of the test fixture.
- * @namespace YAHOO.tool
- * @class TestSuite
- * @constructor
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
  */
-YAHOO.tool.TestSuite = function (name /*:String*/) {
-
-    /**
-     * The name of the test suite.
-     */
-    this.name /*:String*/ = name || YAHOO.util.Dom.generateId(null, "testSuite");
-
-    /**
-     * Array of test suites and
-     * @private
-     */
-    this.items /*:Array*/ = [];
-
-};
+YAHOO.util.Assert = {
 
-YAHOO.tool.TestSuite.prototype = {
-    
-    /**
-     * Adds a test suite or test case to the test suite.
-     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
-     */
-    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
-        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
-            this.items.push(testObject);
-        }
-    }
-    
-};
-YAHOO.namespace("tool");
-
-//-----------------------------------------------------------------------------
-// TestCase object
-//-----------------------------------------------------------------------------
-
-/**
- * Test case containing various tests to run.
- * @param template An object containing any number of test methods, other methods,
- *                 an optional name, and anything else the test case needs.
- * @class TestCase
- * @namespace YAHOO.tool
- * @constructor
- */
-YAHOO.tool.TestCase = function (template /*:Object*/) {
-    
-    /**
-     * Special rules for the test case. Possible subobjects
-     * are fail, for tests that should fail, and error, for
-     * tests that should throw an error.
-     */
-    this._should /*:Object*/ = {};
-    
-    //copy over all properties from the template to this object
-    for (var prop in template) {
-        this[prop] = template[prop];
-    }    
-    
-    //check for a valid name
-    if (!YAHOO.lang.isString(this.name)){
-        /**
-         * Name for the test case.
-         */
-        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
-    }
-
-};
-
-YAHOO.tool.TestCase.prototype = {  
-
-    //-------------------------------------------------------------------------
-    // Test Methods
-    //-------------------------------------------------------------------------
-
-    /**
-     * Function to run before each test is executed.
-     */
-    setUp : function () /*:Void*/ {
-    },
-    
-    /**
-     * Function to run after each test is executed.
-     */
-    tearDown: function () /*:Void*/ {    
-    }
-};
-YAHOO.namespace("util");
-
-//-----------------------------------------------------------------------------
-// Assert object
-//-----------------------------------------------------------------------------
-
-/**
- * The Assert object provides functions to test JavaScript values against
- * known and expected results. Whenever a comparison (assertion) fails,
- * an error is thrown.
- *
- * @namespace YAHOO.util
- * @class Assert
- * @static
- */
-YAHOO.util.Assert = {
-
-    //-------------------------------------------------------------------------
-    // Generic Assertion Methods
-    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
     
     /** 
      * Forces an assertion error to occur.
@@ -1275,6 +1463,7 @@ YAHOO.util.UnexpectedError = function (cause /*:Object*/){
 
 //inherit methods
 YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
 //-----------------------------------------------------------------------------
 // ArrayAssert object
 //-----------------------------------------------------------------------------
@@ -1603,6 +1792,7 @@ YAHOO.util.ArrayAssert = {
     }
     
 };
+
 YAHOO.namespace("util");
 
 
@@ -1675,6 +1865,7 @@ YAHOO.util.ObjectAssert = {
         }     
     }
 };
+
 //-----------------------------------------------------------------------------
 // DateAssert object
 //-----------------------------------------------------------------------------
@@ -1727,6 +1918,7 @@ YAHOO.util.DateAssert = {
     }
     
 };
+
 YAHOO.namespace("util");
 
 /**
@@ -1839,17 +2031,17 @@ YAHOO.util.UserAction = {
         if (!YAHOO.lang.isNumber(charCode)){
             charCode = 0; 
         }
-        
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
         //check for DOM-compliant browsers first
         if (YAHOO.lang.isFunction(document.createEvent)){
         
-            //try to create a mouse event
-            var event /*:MouseEvent*/ = null;
-            
             try {
                 
                 //try to create key event
-                event = document.createEvent("KeyEvents");
+                customEvent = document.createEvent("KeyEvents");
                 
                 /*
                  * Interesting problem: Firefox implemented a non-standard
@@ -1860,7 +2052,7 @@ YAHOO.util.UserAction = {
                  * now, assume it's Firefox if the above line doesn't error.
                  */
                 //TODO: Decipher between Firefox's implementation and a correct one.
-                event.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
                     altKey, shiftKey, metaKey, keyCode, charCode);       
                 
             } catch (ex /*:Error*/){
@@ -1877,56 +2069,56 @@ YAHOO.util.UserAction = {
                 try {
 
                     //try to create generic event - will fail in Safari 2.x
-                    event = document.createEvent("Events");
+                    customEvent = document.createEvent("Events");
 
                 } catch (uierror /*:Error*/){
 
                     //the above failed, so create a UIEvent for Safari 2.x
-                    event = document.createEvent("UIEvents");
+                    customEvent = document.createEvent("UIEvents");
 
                 } finally {
 
-                    event.initEvent(type, bubbles, cancelable);
+                    customEvent.initEvent(type, bubbles, cancelable);
     
                     //initialize
-                    event.view = view;
-                    event.altKey = altKey;
-                    event.ctrlKey = ctrlKey;
-                    event.shiftKey = shiftKey;
-                    event.metaKey = metaKey;
-                    event.keyCode = keyCode;
-                    event.charCode = charCode;
+                    customEvent.view = view;
+                    customEvent.altKey = altKey;
+                    customEvent.ctrlKey = ctrlKey;
+                    customEvent.shiftKey = shiftKey;
+                    customEvent.metaKey = metaKey;
+                    customEvent.keyCode = keyCode;
+                    customEvent.charCode = charCode;
           
                 }          
              
             }
             
             //fire the event
-            target.dispatchEvent(event);
+            target.dispatchEvent(customEvent);
 
         } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
         
             //create an IE event object
-            event = document.createEventObject();
+            customEvent = document.createEventObject();
             
             //assign available properties
-            event.bubbles = bubbles;
-            event.cancelable = cancelable;
-            event.view = view;
-            event.ctrlKey = ctrlKey;
-            event.altKey = altKey;
-            event.shiftKey = shiftKey;
-            event.metaKey = metaKey;
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.shiftKey = shiftKey;
+            customEvent.metaKey = metaKey;
             
             /*
              * IE doesn't support charCode explicitly. CharCode should
              * take precedence over any keyCode value for accurate
              * representation.
              */
-            event.keyCode = (charCode > 0) ? charCode : keyCode;
+            customEvent.keyCode = (charCode > 0) ? charCode : keyCode;
             
             //fire the event
-            target.fireEvent("on" + type, event);  
+            target.fireEvent("on" + type, customEvent);  
                     
         } else {
             throw new Error("simulateKeyEvent(): No event simulation framework present.");
@@ -2058,36 +2250,38 @@ YAHOO.util.UserAction = {
         if (!YAHOO.lang.isNumber(button)){
             button = 0; 
         }
-        
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
         //check for DOM-compliant browsers first
         if (YAHOO.lang.isFunction(document.createEvent)){
         
-            //try to create a mouse event
-            var event /*:MouseEvent*/ = document.createEvent("MouseEvents");
-            
+            customEvent = document.createEvent("MouseEvents");
+        
             //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
-            if (event.initMouseEvent){
-                event.initMouseEvent(type, bubbles, cancelable, view, detail,
+            if (customEvent.initMouseEvent){
+                customEvent.initMouseEvent(type, bubbles, cancelable, view, detail,
                                      screenX, screenY, clientX, clientY, 
                                      ctrlKey, altKey, shiftKey, metaKey, 
                                      button, relatedTarget);
             } else { //Safari
             
                 //the closest thing available in Safari 2.x is UIEvents
-                event = document.createEvent("UIEvents");
-                event.initEvent(type, bubbles, cancelable);
-                event.view = view;
-                event.detail = detail;
-                event.screenX = screenX;
-                event.screenY = screenY;
-                event.clientX = clientX;
-                event.clientY = clientY;
-                event.ctrlKey = ctrlKey;
-                event.altKey = altKey;
-                event.metaKey = metaKey;
-                event.shiftKey = shiftKey;
-                event.button = button;
-                event.relatedTarget = relatedTarget;
+                customEvent = document.createEvent("UIEvents");
+                customEvent.initEvent(type, bubbles, cancelable);
+                customEvent.view = view;
+                customEvent.detail = detail;
+                customEvent.screenX = screenX;
+                customEvent.screenY = screenY;
+                customEvent.clientX = clientX;
+                customEvent.clientY = clientY;
+                customEvent.ctrlKey = ctrlKey;
+                customEvent.altKey = altKey;
+                customEvent.metaKey = metaKey;
+                customEvent.shiftKey = shiftKey;
+                customEvent.button = button;
+                customEvent.relatedTarget = relatedTarget;
             }
             
             /*
@@ -2099,60 +2293,60 @@ YAHOO.util.UserAction = {
              * for mouseout event and fromElement property for mouseover
              * event.
              */
-            if (relatedTarget && !event.relatedTarget){
+            if (relatedTarget && !customEvent.relatedTarget){
                 if (type == "mouseout"){
-                    event.toElement = relatedTarget;
+                    customEvent.toElement = relatedTarget;
                 } else if (type == "mouseover"){
-                    event.fromElement = relatedTarget;
+                    customEvent.fromElement = relatedTarget;
                 }
             }
             
             //fire the event
-            target.dispatchEvent(event);
+            target.dispatchEvent(customEvent);
 
         } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
         
             //create an IE event object
-            event = document.createEventObject();
+            customEvent = document.createEventObject();
             
             //assign available properties
-            event.bubbles = bubbles;
-            event.cancelable = cancelable;
-            event.view = view;
-            event.detail = detail;
-            event.screenX = screenX;
-            event.screenY = screenY;
-            event.clientX = clientX;
-            event.clientY = clientY;
-            event.ctrlKey = ctrlKey;
-            event.altKey = altKey;
-            event.metaKey = metaKey;
-            event.shiftKey = shiftKey;
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.detail = detail;
+            customEvent.screenX = screenX;
+            customEvent.screenY = screenY;
+            customEvent.clientX = clientX;
+            customEvent.clientY = clientY;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.metaKey = metaKey;
+            customEvent.shiftKey = shiftKey;
 
             //fix button property for IE's wacky implementation
             switch(button){
                 case 0:
-                    event.button = 1;
+                    customEvent.button = 1;
                     break;
                 case 1:
-                    event.button = 4;
+                    customEvent.button = 4;
                     break;
                 case 2:
                     //leave as is
                     break;
                 default:
-                    event.button = 0;                    
+                    customEvent.button = 0;                    
             }    
 
             /*
              * Have to use relatedTarget because IE won't allow assignment
              * to toElement or fromElement on generic events. This keeps
-             * YAHOO.util.Event.getRelatedTarget() functional.
+             * YAHOO.util.customEvent.getRelatedTarget() functional.
              */
-            event.relatedTarget = relatedTarget;
+            customEvent.relatedTarget = relatedTarget;
             
             //fire the event
-            target.fireEvent("on" + type, event);
+            target.fireEvent("on" + type, customEvent);
                     
         } else {
             throw new Error("simulateMouseEvent(): No event simulation framework present.");
@@ -2334,6 +2528,7 @@ YAHOO.util.UserAction = {
     
 
 };
+
 YAHOO.namespace("tool");
 
 //-----------------------------------------------------------------------------
@@ -2475,6 +2670,8 @@ YAHOO.tool.TestManager = {
             this._timeoutId = setTimeout(function(){
                 YAHOO.tool.TestManager._run();
             }, 1000);
+        } else {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
         }
     },
     
@@ -2488,26 +2685,22 @@ YAHOO.tool.TestManager = {
     _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
 
         var r = this._results;
-
-        r.page_results[page] = results;
-
-        if (results.passed) {
-            r.pages_passed++;
-            r.tests_passed += results.passed;
-        }
-
-        if (results.failed) {
-            r.pages_failed++;
-            r.tests_failed += results.failed;
-            r.failed.push(page);
+        
+        r.passed += results.passed;
+        r.failed += results.failed;
+        r.ignored += results.ignored;
+        r.total += results.total;
+        
+        if (results.failed){
+            r.failedPages.push(page);
         } else {
-            r.passed.push(page);
+            r.passedPages.push(page);
         }
-
-        if (!this._pages.length) {
-            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
-        }
-
+        
+        results.name = page;
+        results.type = "page";
+        
+        r[page] = results;
     },
     
     /**
@@ -2632,6 +2825,16 @@ YAHOO.tool.TestManager = {
 
         // reset the results cache
         this._results = {
+        
+            passed: 0,
+            failed: 0,
+            ignored: 0,
+            total: 0,
+            type: "report",
+            name: "YUI Test Results",
+            failedPages:[],
+            passedPages:[]
+            /*
             // number of pages that pass
             pages_passed: 0,
             // number of pages that fail
@@ -2645,7 +2848,7 @@ YAHOO.tool.TestManager = {
             // array of pages that failed
             failed: [],
             // map of full results for each page
-            page_results: {}
+            page_results: {}*/
         };
 
         this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
@@ -2666,4 +2869,400 @@ YAHOO.tool.TestManager = {
 
 YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
 
-YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.3.0", build: "442"});
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+
+YAHOO.namespace("tool.TestFormat");
+
+/**
+ * Returns test results formatted as a JSON string. Requires JSON utility.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method JSON
+ * @static
+ */
+YAHOO.tool.TestFormat.JSON = function(results /*:Object*/) /*:String*/ {
+    return YAHOO.lang.JSON.stringify(results);
+};
+
+/**
+ * Returns test results formatted as an XML string.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method XML
+ * @static
+ */
+YAHOO.tool.TestFormat.XML = function(results /*:Object*/) /*:String*/ {
+
+    var l = YAHOO.lang;
+    var xml /*:String*/ = "<" + results.type + " name=\"" + results.name.replace(/"/g, "&quot;").replace(/'/g, "&apos;") + "\"";
+    
+    if (results.type == "test"){
+        xml += " result=\"" + results.result + "\" message=\"" + results.message + "\">";
+    } else {
+        xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";
+        for (var prop in results) {
+            if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){
+                xml += arguments.callee(results[prop]);
+            }
+        }        
+    }
+
+    xml += "</" + results.type + ">";
+    
+    return xml;
+
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * An object capable of sending test results to a server.
+ * @param {String} url The URL to submit the results to.
+ * @param {Function} format (Optiona) A function that outputs the results in a specific format.
+ *      Default is YAHOO.tool.TestFormat.XML.
+ * @constructor
+ * @namespace YAHOO.tool
+ * @class TestReporter
+ */
+YAHOO.tool.TestReporter = function(url /*:String*/, format /*:Function*/) {
+
+    /**
+     * The URL to submit the data to.
+     * @type String
+     * @property url
+     */
+    this.url /*:String*/ = url;
+
+    /**
+     * The formatting function to call when submitting the data.
+     * @type Function
+     * @property format
+     */
+    this.format /*:Function*/ = format || YAHOO.tool.TestFormat.XML;
+
+    /**
+     * Extra fields to submit with the request.
+     * @type Object
+     * @property _fields
+     * @private
+     */
+    this._fields /*:Object*/ = new Object();
+    
+    /**
+     * The form element used to submit the results.
+     * @type HTMLFormElement
+     * @property _form
+     * @private
+     */
+    this._form /*:HTMLElement*/ = null;
+
+    /**
+     * Iframe used as a target for form submission.
+     * @type HTMLIFrameElement
+     * @property _iframe
+     * @private
+     */
+    this._iframe /*:HTMLElement*/ = null;
+};
+
+YAHOO.tool.TestReporter.prototype = {
+
+    //restore missing constructor
+    constructor: YAHOO.tool.TestReporter,
+
+    /**
+     * Adds a field to the form that submits the results.
+     * @param {String} name The name of the field.
+     * @param {Variant} value The value of the field.
+     * @return {Void}
+     * @method addField
+     */
+    addField : function (name /*:String*/, value /*:Variant*/) /*:Void*/{
+        this._fields[name] = value;    
+    },
+    
+    /**
+     * Removes all previous defined fields.
+     * @return {Void}
+     * @method addField
+     */
+    clearFields : function() /*:Void*/{
+        this._fields = new Object();
+    },
+
+    /**
+     * Cleans up the memory associated with the TestReporter, removing DOM elements
+     * that were created.
+     * @return {Void}
+     * @method destroy
+     */
+    destroy : function() /*:Void*/ {
+        if (this._form){
+            this._form.parentNode.removeChild(this._form);
+            this._form = null;
+        }        
+        if (this._iframe){
+            this._iframe.parentNode.removeChild(this._iframe);
+            this._iframe = null;
+        }
+        this._fields = null;
+    },
+
+    /**
+     * Sends the report to the server.
+     * @param {Object} results The results object created by TestRunner.
+     * @return {Void}
+     * @method report
+     */
+    report : function(results /*:Object*/) /*:Void*/{
+    
+        //if the form hasn't been created yet, create it
+        if (!this._form){
+            this._form = document.createElement("form");
+            this._form.method = "post";
+            this._form.style.visibility = "hidden";
+            this._form.style.position = "absolute";
+            this._form.style.top = 0;
+            document.body.appendChild(this._form);
+        
+            //IE won't let you assign a name using the DOM, must do it the hacky way
+            if (YAHOO.env.ua.ie){
+                this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");
+            } else {
+                this._iframe = document.createElement("iframe");
+                this._iframe.name = "yuiTestTarget";
+            }
+
+            this._iframe.src = "javascript:false";
+            this._iframe.style.visibility = "hidden";
+            this._iframe.style.position = "absolute";
+            this._iframe.style.top = 0;
+            document.body.appendChild(this._iframe);
+
+            this._form.target = "yuiTestTarget";
+        }
+
+        //set the form's action
+        this._form.action = this.url;
+    
+        //remove any existing fields
+        while(this._form.hasChildNodes()){
+            this._form.removeChild(this._form.lastChild);
+        }
+        
+        //create default fields
+        this._fields.results = this.format(results);
+        this._fields.useragent = navigator.userAgent;
+        this._fields.timestamp = (new Date()).toLocaleString();
+
+        //add fields to the form
+        for (var prop in this._fields){
+            if (YAHOO.lang.hasOwnProperty(this._fields, prop) && typeof this._fields[prop] != "function"){
+                input = document.createElement("input");
+                input.type = "hidden";
+                input.name = prop;
+                input.value = this._fields[prop];
+                this._form.appendChild(input);
+            }
+        }
+
+        //remove default fields
+        delete this._fields.results;
+        delete this._fields.useragent;
+        delete this._fields.timestamp;
+        
+        if (arguments[1] !== false){
+            this._form.submit();
+        }
+    
+    }
+
+};
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest-debug.js b/lib/yui/yuitest/yuitest-debug.js
new file mode 100644 (file)
index 0000000..ad11484
--- /dev/null
@@ -0,0 +1,3268 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+/**
+ * The UserAction object provides functions that simulate events occurring in
+ * the browser. Since these are simulated events, they do not behave exactly
+ * as regular, user-initiated events do, but can be used to test simple
+ * user interactions safely.
+ *
+ * @namespace YAHOO.util
+ * @class UserAction
+ * @static
+ */
+YAHOO.util.UserAction = {
+
+    //--------------------------------------------------------------------------
+    // Generic event methods
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a key event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks. Note: keydown causes Safari 2.x to
+     * crash.
+     * @method simulateKeyEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: keyup, keydown, and keypress.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 3 specifies that all key events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 3 specifies that all
+     *      key events can be cancelled. The default 
+     *      is true.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} keyCode (Optional) The code for the key that is in use. 
+     *      The default is 0.
+     * @param {int} charCode (Optional) The Unicode code for the character
+     *      associated with the key being used. The default is 0.
+     */
+    simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                 bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                 view /*:Window*/,
+                                 ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                 shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                 keyCode /*:int*/,        charCode /*:int*/) /*:Void*/                             
+    {
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateKeyEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "keyup":
+                case "keydown":
+                case "keypress":
+                    break;
+                case "textevent": //DOM Level 3
+                    type = "keypress";
+                    break;
+                    // @TODO was the fallthrough intentional, if so throw error
+                default:
+                    throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateKeyEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all key events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = true; //all key events can be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(keyCode)){
+            keyCode = 0;
+        }
+        if (!YAHOO.lang.isNumber(charCode)){
+            charCode = 0; 
+        }
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            try {
+                
+                //try to create key event
+                customEvent = document.createEvent("KeyEvents");
+                
+                /*
+                 * Interesting problem: Firefox implemented a non-standard
+                 * version of initKeyEvent() based on DOM Level 2 specs.
+                 * Key event was removed from DOM Level 2 and re-introduced
+                 * in DOM Level 3 with a different interface. Firefox is the
+                 * only browser with any implementation of Key Events, so for
+                 * now, assume it's Firefox if the above line doesn't error.
+                 */
+                //TODO: Decipher between Firefox's implementation and a correct one.
+                customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                    altKey, shiftKey, metaKey, keyCode, charCode);       
+                
+            } catch (ex /*:Error*/){
+
+                /*
+                 * If it got here, that means key events aren't officially supported. 
+                 * Safari/WebKit is a real problem now. WebKit 522 won't let you
+                 * set keyCode, charCode, or other properties if you use a
+                 * UIEvent, so we first must try to create a generic event. The
+                 * fun part is that this will throw an error on Safari 2.x. The
+                 * end result is that we need another try...catch statement just to
+                 * deal with this mess.
+                 */
+                try {
+
+                    //try to create generic event - will fail in Safari 2.x
+                    customEvent = document.createEvent("Events");
+
+                } catch (uierror /*:Error*/){
+
+                    //the above failed, so create a UIEvent for Safari 2.x
+                    customEvent = document.createEvent("UIEvents");
+
+                } finally {
+
+                    customEvent.initEvent(type, bubbles, cancelable);
+    
+                    //initialize
+                    customEvent.view = view;
+                    customEvent.altKey = altKey;
+                    customEvent.ctrlKey = ctrlKey;
+                    customEvent.shiftKey = shiftKey;
+                    customEvent.metaKey = metaKey;
+                    customEvent.keyCode = keyCode;
+                    customEvent.charCode = charCode;
+          
+                }          
+             
+            }
+            
+            //fire the event
+            target.dispatchEvent(customEvent);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            customEvent = document.createEventObject();
+            
+            //assign available properties
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.shiftKey = shiftKey;
+            customEvent.metaKey = metaKey;
+            
+            /*
+             * IE doesn't support charCode explicitly. CharCode should
+             * take precedence over any keyCode value for accurate
+             * representation.
+             */
+            customEvent.keyCode = (charCode > 0) ? charCode : keyCode;
+            
+            //fire the event
+            target.fireEvent("on" + type, customEvent);  
+                    
+        } else {
+            throw new Error("simulateKeyEvent(): No event simulation framework present.");
+        }
+    },
+
+    /**
+     * Simulates a mouse event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks.
+     * @method simulateMouseEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 2 specifies that all mouse events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 2 specifies that all
+     *      mouse events except mousemove can be cancelled. The default 
+     *      is true for all events except mousemove, for which the default 
+     *      is false.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {int} detail (Optional) The number of times the mouse button has
+     *      been used. The default value is 1.
+     * @param {int} screenX (Optional) The x-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} screenY (Optional) The y-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientX (Optional) The x-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientY (Optional) The y-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} button (Optional) The button being pressed while the event
+     *      is executing. The value should be 0 for the primary mouse button
+     *      (typically the left button), 1 for the terciary mouse button
+     *      (typically the middle button), and 2 for the secondary mouse button
+     *      (typically the right button). The default is 0.
+     * @param {HTMLElement} relatedTarget (Optional) For mouseout events,
+     *      this is the element that the mouse has moved to. For mouseover
+     *      events, this is the element that the mouse has moved from. This
+     *      argument is ignored for all other events. The default is null.
+     */
+    simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                   bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                   view /*:Window*/,        detail /*:int*/, 
+                                   screenX /*:int*/,        screenY /*:int*/, 
+                                   clientX /*:int*/,        clientY /*:int*/,       
+                                   ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                   shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                   button /*:int*/,         relatedTarget /*:HTMLElement*/) /*:Void*/
+    {
+        
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateMouseEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "mouseover":
+                case "mouseout":
+                case "mousedown":
+                case "mouseup":
+                case "click":
+                case "dblclick":
+                case "mousemove":
+                    break;
+                default:
+                    throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateMouseEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all mouse events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isNumber(detail)){
+            detail = 1;  //number of mouse clicks must be at least one
+        }
+        if (!YAHOO.lang.isNumber(screenX)){
+            screenX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(screenY)){
+            screenY = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientX)){
+            clientX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientY)){
+            clientY = 0; 
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(button)){
+            button = 0; 
+        }
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            customEvent = document.createEvent("MouseEvents");
+        
+            //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
+            if (customEvent.initMouseEvent){
+                customEvent.initMouseEvent(type, bubbles, cancelable, view, detail,
+                                     screenX, screenY, clientX, clientY, 
+                                     ctrlKey, altKey, shiftKey, metaKey, 
+                                     button, relatedTarget);
+            } else { //Safari
+            
+                //the closest thing available in Safari 2.x is UIEvents
+                customEvent = document.createEvent("UIEvents");
+                customEvent.initEvent(type, bubbles, cancelable);
+                customEvent.view = view;
+                customEvent.detail = detail;
+                customEvent.screenX = screenX;
+                customEvent.screenY = screenY;
+                customEvent.clientX = clientX;
+                customEvent.clientY = clientY;
+                customEvent.ctrlKey = ctrlKey;
+                customEvent.altKey = altKey;
+                customEvent.metaKey = metaKey;
+                customEvent.shiftKey = shiftKey;
+                customEvent.button = button;
+                customEvent.relatedTarget = relatedTarget;
+            }
+            
+            /*
+             * Check to see if relatedTarget has been assigned. Firefox
+             * versions less than 2.0 don't allow it to be assigned via
+             * initMouseEvent() and the property is readonly after event
+             * creation, so in order to keep YAHOO.util.getRelatedTarget()
+             * working, assign to the IE proprietary toElement property
+             * for mouseout event and fromElement property for mouseover
+             * event.
+             */
+            if (relatedTarget && !customEvent.relatedTarget){
+                if (type == "mouseout"){
+                    customEvent.toElement = relatedTarget;
+                } else if (type == "mouseover"){
+                    customEvent.fromElement = relatedTarget;
+                }
+            }
+            
+            //fire the event
+            target.dispatchEvent(customEvent);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            customEvent = document.createEventObject();
+            
+            //assign available properties
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.detail = detail;
+            customEvent.screenX = screenX;
+            customEvent.screenY = screenY;
+            customEvent.clientX = clientX;
+            customEvent.clientY = clientY;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.metaKey = metaKey;
+            customEvent.shiftKey = shiftKey;
+
+            //fix button property for IE's wacky implementation
+            switch(button){
+                case 0:
+                    customEvent.button = 1;
+                    break;
+                case 1:
+                    customEvent.button = 4;
+                    break;
+                case 2:
+                    //leave as is
+                    break;
+                default:
+                    customEvent.button = 0;                    
+            }    
+
+            /*
+             * Have to use relatedTarget because IE won't allow assignment
+             * to toElement or fromElement on generic events. This keeps
+             * YAHOO.util.customEvent.getRelatedTarget() functional.
+             */
+            customEvent.relatedTarget = relatedTarget;
+            
+            //fire the event
+            target.fireEvent("on" + type, customEvent);
+                    
+        } else {
+            throw new Error("simulateMouseEvent(): No event simulation framework present.");
+        }
+    },
+   
+    //--------------------------------------------------------------------------
+    // Mouse events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a mouse event on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseEvent
+     * @static
+     */
+    fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                           options /*:Object*/) /*:Void*/
+    {
+        options = options || {};
+        this.simulateMouseEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.detail, options.screenX,        
+            options.screenY, options.clientX, options.clientY, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, options.button,         
+            options.relatedTarget);        
+    },
+
+    /**
+     * Simulates a click on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method click
+     * @static     
+     */
+    click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "click", options);
+    },
+    
+    /**
+     * Simulates a double click on a particular element.
+     * @param {HTMLElement} target The element to double click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method dblclick
+     * @static
+     */
+    dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent( target, "dblclick", options);
+    },
+    
+    /**
+     * Simulates a mousedown on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousedown
+     * @static
+     */
+    mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousedown", options);
+    },
+    
+    /**
+     * Simulates a mousemove on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousemove
+     * @static
+     */
+    mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousemove", options);
+    },
+    
+    /**
+     * Simulates a mouseout event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved to.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * toElement is assigned in its place. IE doesn't allow toElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseout
+     * @static
+     */
+    mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseout", options);
+    },
+    
+    /**
+     * Simulates a mouseover event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved from.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * fromElement is assigned in its place. IE doesn't allow fromElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseover
+     * @static
+     */
+    mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseover", options);
+    },
+    
+    /**
+     * Simulates a mouseup on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseup
+     * @static
+     */
+    mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseup", options);
+    },
+    
+    //--------------------------------------------------------------------------
+    // Key events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Fires an event that normally would be fired by the keyboard (keyup,
+     * keydown, keypress). Make sure to specify either keyCode or charCode as
+     * an option.
+     * @private
+     * @param {String} type The type of event ("keyup", "keydown" or "keypress").
+     * @param {HTMLElement} target The target of the event.
+     * @param {Object} options Options for the event. Either keyCode or charCode
+     *                         are required.
+     * @method fireKeyEvent
+     * @static
+     */     
+    fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/,
+                             options /*:Object*/) /*:Void*/ 
+    {
+        options = options || {};
+        this.simulateKeyEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, 
+            options.keyCode, options.charCode);    
+    },
+    
+    /**
+     * Simulates a keydown event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keydown
+     * @static
+     */
+    keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keydown", target, options);
+    },
+    
+    /**
+     * Simulates a keypress on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keypress
+     * @static
+     */
+    keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keypress", target, options);
+    },
+    
+    /**
+     * Simulates a keyup event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keyup
+     * @static
+     */
+    keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireKeyEvent("keyup", target, options);
+    }
+    
+
+};
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestManager object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs pages containing test suite definitions.
+ * @namespace YAHOO.tool
+ * @class TestManager
+ * @static
+ */
+YAHOO.tool.TestManager = {
+
+    /**
+     * Constant for the testpagebegin custom event
+     * @property TEST_PAGE_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_BEGIN_EVENT /*:String*/ : "testpagebegin",
+
+    /**
+     * Constant for the testpagecomplete custom event
+     * @property TEST_PAGE_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_COMPLETE_EVENT /*:String*/ : "testpagecomplete",
+
+    /**
+     * Constant for the testmanagerbegin custom event
+     * @property TEST_MANAGER_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_BEGIN_EVENT /*:String*/ : "testmanagerbegin",
+
+    /**
+     * Constant for the testmanagercomplete custom event
+     * @property TEST_MANAGER_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_COMPLETE_EVENT /*:String*/ : "testmanagercomplete",
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+    
+    
+    /**
+     * The URL of the page currently being executed.
+     * @type String
+     * @private
+     * @property _curPage
+     * @static
+     */
+    _curPage /*:String*/ : null,
+    
+    /**
+     * The frame used to load and run tests.
+     * @type Window
+     * @private
+     * @property _frame
+     * @static
+     */
+    _frame /*:Window*/ : null,
+    
+    /**
+     * The logger used to output results from the various tests.
+     * @type YAHOO.tool.TestLogger
+     * @private
+     * @property _logger
+     * @static
+     */
+    _logger : null,
+    
+    /**
+     * The timeout ID for the next iteration through the tests.
+     * @type int
+     * @private
+     * @property _timeoutId
+     * @static
+     */
+    _timeoutId /*:int*/ : 0,
+    
+    /**
+     * Array of pages to load.
+     * @type String[]
+     * @private
+     * @property _pages
+     * @static
+     */
+    _pages /*:String[]*/ : [],
+    
+    /**
+     * Aggregated results
+     * @type Object
+     * @private
+     * @property _results
+     * @static
+     */
+    _results: null,
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles TestRunner.COMPLETE_EVENT, storing the results and beginning
+     * the loop again.
+     * @param {Object} data Data about the event.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _handleTestRunnerComplete : function (data /*:Object*/) /*:Void*/ {
+
+        this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT, {
+                page: this._curPage,
+                results: data.results
+            });
+    
+        //save results
+        //this._results[this.curPage] = data.results;
+        
+        //process 'em
+        this._processResults(this._curPage, data.results);
+        
+        this._logger.clearTestRunner();
+    
+        //if there's more to do, set a timeout to begin again
+        if (this._pages.length){
+            this._timeoutId = setTimeout(function(){
+                YAHOO.tool.TestManager._run();
+            }, 1000);
+        } else {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
+        }
+    },
+    
+    /**
+     * Processes the results of a test page run, outputting log messages
+     * for failed tests.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
+
+        var r = this._results;
+        
+        r.passed += results.passed;
+        r.failed += results.failed;
+        r.ignored += results.ignored;
+        r.total += results.total;
+        
+        if (results.failed){
+            r.failedPages.push(page);
+        } else {
+            r.passedPages.push(page);
+        }
+        
+        results.name = page;
+        results.type = "page";
+        
+        r[page] = results;
+    },
+    
+    /**
+     * Loads the next test page into the iframe.
+     * @return {Void}
+     * @static
+     * @private
+     */
+    _run : function () /*:Void*/ {
+    
+        //set the current page
+        this._curPage = this._pages.shift();
+
+        this.fireEvent(this.TEST_PAGE_BEGIN_EVENT, this._curPage);
+        
+        //load the frame - destroy history in case there are other iframes that
+        //need testing
+        this._frame.location.replace(this._curPage);
+    
+    },
+        
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Signals that a test page has been loaded. This should be called from
+     * within the test page itself to notify the TestManager that it is ready.
+     * @return {Void}
+     * @static
+     */
+    load : function () /*:Void*/ {
+        if (parent.YAHOO.tool.TestManager !== this){
+            parent.YAHOO.tool.TestManager.load();
+        } else {
+            
+            if (this._frame) {
+                //assign event handling
+                var TestRunner = this._frame.YAHOO.tool.TestRunner;
+
+                this._logger.setTestRunner(TestRunner);
+                TestRunner.subscribe(TestRunner.COMPLETE_EVENT, this._handleTestRunnerComplete, this, true);
+                
+                //run it
+                TestRunner.run();
+            }
+        }
+    },
+    
+    /**
+     * Sets the pages to be loaded.
+     * @param {String[]} pages An array of URLs to load.
+     * @return {Void}
+     * @static
+     */
+    setPages : function (pages /*:String[]*/) /*:Void*/ {
+        this._pages = pages;
+    },
+    
+    /**
+     * Begins the process of running the tests.
+     * @return {Void}
+     * @static
+     */
+    start : function () /*:Void*/ {
+
+        if (!this._initialized) {
+
+            /**
+             * Fires when loading a test page
+             * @event testpagebegin
+             * @param curPage {string} the page being loaded
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_BEGIN_EVENT);
+
+            /**
+             * Fires when a test page is complete
+             * @event testpagecomplete
+             * @param obj {page: string, results: object} the name of the
+             * page that was loaded, and the test suite results
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);
+
+            /**
+             * Fires when the test manager starts running all test pages
+             * @event testmanagerbegin
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);
+
+            /**
+             * Fires when the test manager finishes running all test pages.  External
+             * test runners should subscribe to this event in order to get the
+             * aggregated test results.
+             * @event testmanagercomplete
+             * @param obj { pages_passed: int, pages_failed: int, tests_passed: int
+             *              tests_failed: int, passed: string[], failed: string[],
+             *              page_results: {} }
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);
+
+            //create iframe if not already available
+            if (!this._frame){
+                var frame /*:HTMLElement*/ = document.createElement("iframe");
+                frame.style.visibility = "hidden";
+                frame.style.position = "absolute";
+                document.body.appendChild(frame);
+                this._frame = frame.contentWindow || frame.contentDocument.ownerWindow;
+            }
+            
+            //create test logger if not already available
+            if (!this._logger){
+                this._logger = new YAHOO.tool.TestLogger();
+            }
+
+            this._initialized = true;
+        }
+
+
+        // reset the results cache
+        this._results = {
+        
+            passed: 0,
+            failed: 0,
+            ignored: 0,
+            total: 0,
+            type: "report",
+            name: "YUI Test Results",
+            failedPages:[],
+            passedPages:[]
+            /*
+            // number of pages that pass
+            pages_passed: 0,
+            // number of pages that fail
+            pages_failed: 0,
+            // total number of tests passed
+            tests_passed: 0,
+            // total number of tests failed
+            tests_failed: 0,
+            // array of pages that passed
+            passed: [],
+            // array of pages that failed
+            failed: [],
+            // map of full results for each page
+            page_results: {}*/
+        };
+
+        this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
+        this._run();
+    
+    },
+
+    /**
+     * Stops the execution of tests.
+     * @return {Void}
+     * @static
+     */
+    stop : function () /*:Void*/ {
+        clearTimeout(this._timeoutId);
+    }
+
+};
+
+YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
+
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+
+YAHOO.namespace("tool.TestFormat");
+
+/**
+ * Returns test results formatted as a JSON string. Requires JSON utility.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method JSON
+ * @static
+ */
+YAHOO.tool.TestFormat.JSON = function(results /*:Object*/) /*:String*/ {
+    return YAHOO.lang.JSON.stringify(results);
+};
+
+/**
+ * Returns test results formatted as an XML string.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method XML
+ * @static
+ */
+YAHOO.tool.TestFormat.XML = function(results /*:Object*/) /*:String*/ {
+
+    var l = YAHOO.lang;
+    var xml /*:String*/ = "<" + results.type + " name=\"" + results.name.replace(/"/g, "&quot;").replace(/'/g, "&apos;") + "\"";
+    
+    if (results.type == "test"){
+        xml += " result=\"" + results.result + "\" message=\"" + results.message + "\">";
+    } else {
+        xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";
+        for (var prop in results) {
+            if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){
+                xml += arguments.callee(results[prop]);
+            }
+        }        
+    }
+
+    xml += "</" + results.type + ">";
+    
+    return xml;
+
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * An object capable of sending test results to a server.
+ * @param {String} url The URL to submit the results to.
+ * @param {Function} format (Optiona) A function that outputs the results in a specific format.
+ *      Default is YAHOO.tool.TestFormat.XML.
+ * @constructor
+ * @namespace YAHOO.tool
+ * @class TestReporter
+ */
+YAHOO.tool.TestReporter = function(url /*:String*/, format /*:Function*/) {
+
+    /**
+     * The URL to submit the data to.
+     * @type String
+     * @property url
+     */
+    this.url /*:String*/ = url;
+
+    /**
+     * The formatting function to call when submitting the data.
+     * @type Function
+     * @property format
+     */
+    this.format /*:Function*/ = format || YAHOO.tool.TestFormat.XML;
+
+    /**
+     * Extra fields to submit with the request.
+     * @type Object
+     * @property _fields
+     * @private
+     */
+    this._fields /*:Object*/ = new Object();
+    
+    /**
+     * The form element used to submit the results.
+     * @type HTMLFormElement
+     * @property _form
+     * @private
+     */
+    this._form /*:HTMLElement*/ = null;
+
+    /**
+     * Iframe used as a target for form submission.
+     * @type HTMLIFrameElement
+     * @property _iframe
+     * @private
+     */
+    this._iframe /*:HTMLElement*/ = null;
+};
+
+YAHOO.tool.TestReporter.prototype = {
+
+    //restore missing constructor
+    constructor: YAHOO.tool.TestReporter,
+
+    /**
+     * Adds a field to the form that submits the results.
+     * @param {String} name The name of the field.
+     * @param {Variant} value The value of the field.
+     * @return {Void}
+     * @method addField
+     */
+    addField : function (name /*:String*/, value /*:Variant*/) /*:Void*/{
+        this._fields[name] = value;    
+    },
+    
+    /**
+     * Removes all previous defined fields.
+     * @return {Void}
+     * @method addField
+     */
+    clearFields : function() /*:Void*/{
+        this._fields = new Object();
+    },
+
+    /**
+     * Cleans up the memory associated with the TestReporter, removing DOM elements
+     * that were created.
+     * @return {Void}
+     * @method destroy
+     */
+    destroy : function() /*:Void*/ {
+        if (this._form){
+            this._form.parentNode.removeChild(this._form);
+            this._form = null;
+        }        
+        if (this._iframe){
+            this._iframe.parentNode.removeChild(this._iframe);
+            this._iframe = null;
+        }
+        this._fields = null;
+    },
+
+    /**
+     * Sends the report to the server.
+     * @param {Object} results The results object created by TestRunner.
+     * @return {Void}
+     * @method report
+     */
+    report : function(results /*:Object*/) /*:Void*/{
+    
+        //if the form hasn't been created yet, create it
+        if (!this._form){
+            this._form = document.createElement("form");
+            this._form.method = "post";
+            this._form.style.visibility = "hidden";
+            this._form.style.position = "absolute";
+            this._form.style.top = 0;
+            document.body.appendChild(this._form);
+        
+            //IE won't let you assign a name using the DOM, must do it the hacky way
+            if (YAHOO.env.ua.ie){
+                this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");
+            } else {
+                this._iframe = document.createElement("iframe");
+                this._iframe.name = "yuiTestTarget";
+            }
+
+            this._iframe.src = "javascript:false";
+            this._iframe.style.visibility = "hidden";
+            this._iframe.style.position = "absolute";
+            this._iframe.style.top = 0;
+            document.body.appendChild(this._iframe);
+
+            this._form.target = "yuiTestTarget";
+        }
+
+        //set the form's action
+        this._form.action = this.url;
+    
+        //remove any existing fields
+        while(this._form.hasChildNodes()){
+            this._form.removeChild(this._form.lastChild);
+        }
+        
+        //create default fields
+        this._fields.results = this.format(results);
+        this._fields.useragent = navigator.userAgent;
+        this._fields.timestamp = (new Date()).toLocaleString();
+
+        //add fields to the form
+        for (var prop in this._fields){
+            if (YAHOO.lang.hasOwnProperty(this._fields, prop) && typeof this._fields[prop] != "function"){
+                input = document.createElement("input");
+                input.type = "hidden";
+                input.name = prop;
+                input.value = this._fields[prop];
+                this._form.appendChild(input);
+            }
+        }
+
+        //remove default fields
+        delete this._fields.results;
+        delete this._fields.useragent;
+        delete this._fields.timestamp;
+        
+        if (arguments[1] !== false){
+            this._form.submit();
+        }
+    
+    }
+
+};
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest-min.js b/lib/yui/yuitest/yuitest-min.js
new file mode 100644 (file)
index 0000000..c916cc7
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");YAHOO.tool.TestCase=function(A){this._should={};for(var B in A){this[B]=A[B];}if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={resume:function(A){YAHOO.tool.TestRunner.resume(A);},wait:function(B,A){throw new YAHOO.tool.TestCase.Wait(B,A);},setUp:function(){},tearDown:function(){}};YAHOO.tool.TestCase.Wait=function(B,A){this.segment=(YAHOO.lang.isFunction(B)?B:null);this.delay=(YAHOO.lang.isNumber(A)?A:0);};YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(A){this.name="";this.items=[];if(YAHOO.lang.isString(A)){this.name=A;}else{if(YAHOO.lang.isObject(A)){YAHOO.lang.augmentObject(this,A,true);}}if(this.name===""){this.name=YAHOO.util.Dom.generateId(null,"testSuite");}};YAHOO.tool.TestSuite.prototype={add:function(A){if(A instanceof YAHOO.tool.TestSuite||A instanceof YAHOO.tool.TestCase){this.items.push(A);}},setUp:function(){},tearDown:function(){}};YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function B(C){this.testObject=C;this.firstChild=null;this.lastChild=null;this.parent=null;this.next=null;this.results={passed:0,failed:0,total:0,ignored:0};if(C instanceof YAHOO.tool.TestSuite){this.results.type="testsuite";this.results.name=C.name;}else{if(C instanceof YAHOO.tool.TestCase){this.results.type="testcase";this.results.name=C.name;}}}B.prototype={appendChild:function(C){var D=new B(C);if(this.firstChild===null){this.firstChild=this.lastChild=D;}else{this.lastChild.next=D;this.lastChild=D;}D.parent=this;return D;}};function A(){A.superclass.constructor.apply(this,arguments);this.masterSuite=new YAHOO.tool.TestSuite("YUI Test Results");this._cur=null;this._root=null;var D=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var C=0;C<D.length;C++){this.createEvent(D[C],{scope:this});}}YAHOO.lang.extend(A,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(C,D){var E=C.appendChild(D);for(var F in D){if(F.indexOf("test")===0&&YAHOO.lang.isFunction(D[F])){E.appendChild(F);}}},_addTestSuiteToTestTree:function(C,F){var E=C.appendChild(F);for(var D=0;D<F.items.length;D++){if(F.items[D] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(E,F.items[D]);}else{if(F.items[D] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(E,F.items[D]);}}}},_buildTestTree:function(){this._root=new B(this.masterSuite);this._cur=this._root;for(var C=0;C<this.masterSuite.items.length;C++){if(this.masterSuite.items[C] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(this._root,this.masterSuite.items[C]);}else{if(this.masterSuite.items[C] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(this._root,this.masterSuite.items[C]);}}}},_handleTestObjectComplete:function(C){if(YAHOO.lang.isObject(C.testObject)){C.parent.results.passed+=C.results.passed;C.parent.results.failed+=C.results.failed;C.parent.results.total+=C.results.total;C.parent.results.ignored+=C.results.ignored;C.parent.results[C.testObject.name]=C.results;if(C.testObject instanceof YAHOO.tool.TestSuite){C.testObject.tearDown();this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:C.testObject,results:C.results});}else{if(C.testObject instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:C.testObject,results:C.results});}}}},_next:function(){if(this._cur.firstChild){this._cur=this._cur.firstChild;}else{if(this._cur.next){this._cur=this._cur.next;}else{while(this._cur&&!this._cur.next&&this._cur!==this._root){this._handleTestObjectComplete(this._cur);this._cur=this._cur.parent;}if(this._cur==this._root){this._cur.results.type="report";this._cur.results.timestamp=(new Date()).toLocaleString();this.fireEvent(this.COMPLETE_EVENT,{results:this._cur.results});this._cur=null;}else{this._handleTestObjectComplete(this._cur);this._cur=this._cur.next;}}}return this._cur;},_run:function(){var E=false;var D=this._next();if(D!==null){var C=D.testObject;if(YAHOO.lang.isObject(C)){if(C instanceof YAHOO.tool.TestSuite){this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:C});C.setUp();}else{if(C instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:C});}}if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{this._runTest(D);}}},_resumeTest:function(G){var C=this._cur;var H=C.testObject;var E=C.parent.testObject;var K=(E._should.fail||{})[H];var D=(E._should.error||{})[H];var F=false;var I=null;try{G.apply(E);if(K){I=new YAHOO.util.ShouldFail();F=true;}else{if(D){I=new YAHOO.util.ShouldError();F=true;}}}catch(J){if(J instanceof YAHOO.util.AssertionError){if(!K){I=J;F=true;}}else{if(J instanceof YAHOO.tool.TestCase.Wait){if(YAHOO.lang.isFunction(J.segment)){if(YAHOO.lang.isNumber(J.delay)){if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._resumeTest(J.segment);},J.delay);}else{throw new Error("Asynchronous tests not supported in this environment.");}}}return ;}else{if(!D){I=new YAHOO.util.UnexpectedError(J);F=true;}else{if(YAHOO.lang.isString(D)){if(J.message!=D){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isFunction(D)){if(!(J instanceof D)){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isObject(D)){if(!(J instanceof D.constructor)||J.message!=D.message){I=new YAHOO.util.UnexpectedError(J);F=true;}}}}}}}}if(F){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:E,testName:H,error:I});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:E,testName:H});}E.tearDown();C.parent.results[H]={result:F?"fail":"pass",message:I?I.getMessage():"Test passed",type:"test",name:H};
+if(F){C.parent.results.failed++;}else{C.parent.results.passed++;}C.parent.results.total++;if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}},_runTest:function(F){var C=F.testObject;var D=F.parent.testObject;var G=D[C];var E=(D._should.ignore||{})[C];if(E){F.parent.results[C]={result:"ignore",message:"Test ignored",type:"test",name:C};F.parent.results.ignored++;F.parent.results.total++;this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:D,testName:C});if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{D.setUp();this._resumeTest(G);}},fireEvent:function(C,D){D=D||{};D.type=C;A.superclass.fireEvent.call(this,C,D);},add:function(C){this.masterSuite.add(C);},clear:function(){this.masterSuite.items=[];},resume:function(C){this._resumeTest(C||function(){});},run:function(C){var D=YAHOO.tool.TestRunner;D._buildTestTree();D.fireEvent(D.BEGIN_EVENT);D._run();}});return new A();})();YAHOO.namespace("util");YAHOO.util.Assert={fail:function(A){throw new YAHOO.util.AssertionError(A||"Test force-failed.");},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(A||"Values should be equal.",B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be equal.",A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be the same.",A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(A||"Values should be the same.",B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be false.",false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be true.",true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be NaN.",NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be NaN.",NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be null.",null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should not be undefined.",undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be null.",null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be undefined.",undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an array.",B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a Boolean.",B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a function.",B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(A||"Value isn't an instance of expected type.",B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a number.",B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an object.",B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a string.",B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(B||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"Value ("+E+") not found in array.");}},containsItems:function(C,D,B){for(var A=0;A<C.length;A++){this.contains(C[A],D,B);}if(!found){YAHOO.util.Assert.fail(B||"Value not found in array.");}},containsMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"No match found in array.");}},doesNotContain:function(E,D,B){var C=false;
+for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},doesNotContainItems:function(C,D,B){for(var A=0;A<C.length;A++){this.doesNotContain(C[A],D,B);}},doesNotContainMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},indexOf:function(E,D,A,C){for(var B=0;B<D.length;B++){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");},itemsAreEqual:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areEqual(D[B],E[B],C||"Values in position "+B+" are not equal.");}},itemsAreEquivalent:function(E,F,B,D){if(typeof B!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}var A=Math.max(E.length,F.length);for(var C=0;C<A;C++){if(!B(E[C],F[C])){throw new YAHOO.util.ComparisonFailure(D||"Values in position "+C+" are not equivalent.",E[C],F[C]);}}},isEmpty:function(B,A){if(B.length>0){YAHOO.util.Assert.fail(A||"Array should be empty.");}},isNotEmpty:function(B,A){if(B.length===0){YAHOO.util.Assert.fail(A||"Array should not be empty.");}},itemsAreSame:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areSame(D[B],E[B],C||"Values in position "+B+" are not the same.");}},lastIndexOf:function(E,D,A,C){for(var B=D.length;B>=0;B--){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,F,C){var B=[];for(var E in D){B.push(E);}for(var A=0;A<B.length;A++){YAHOO.util.Assert.isNotUndefined(F[B[A]],C||"Property'"+B[A]+"' expected.");}},hasProperty:function(A,B,C){if(YAHOO.lang.isUndefined(B[A])){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object.");}},hasOwnProperty:function(A,B,C){if(!YAHOO.lang.hasOwnProperty(B,A)){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getFullYear(),C.getFullYear(),A||"Years should be equal.");YAHOO.util.Assert.areEqual(B.getMonth(),C.getMonth(),A||"Months should be equal.");YAHOO.util.Assert.areEqual(B.getDate(),C.getDate(),A||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getHours(),C.getHours(),A||"Hours should be equal.");YAHOO.util.Assert.areEqual(B.getMinutes(),C.getMinutes(),A||"Minutes should be equal.");YAHOO.util.Assert.areEqual(B.getSeconds(),C.getSeconds(),A||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.namespace("util");YAHOO.util.UserAction={simulateKeyEvent:function(F,J,E,C,L,B,A,K,H,N,M){F=YAHOO.util.Dom.get(F);if(!F){throw new Error("simulateKeyEvent(): Invalid target.");}if(YAHOO.lang.isString(J)){J=J.toLowerCase();switch(J){case"keyup":case"keydown":case"keypress":break;case"textevent":J="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+J+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(E)){E=true;}if(!YAHOO.lang.isBoolean(C)){C=true;}if(!YAHOO.lang.isObject(L)){L=window;}if(!YAHOO.lang.isBoolean(B)){B=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(K)){K=false;}if(!YAHOO.lang.isBoolean(H)){H=false;}if(!YAHOO.lang.isNumber(N)){N=0;}if(!YAHOO.lang.isNumber(M)){M=0;}var I=null;if(YAHOO.lang.isFunction(document.createEvent)){try{I=document.createEvent("KeyEvents");I.initKeyEvent(J,E,C,L,B,A,K,H,N,M);}catch(G){try{I=document.createEvent("Events");}catch(D){I=document.createEvent("UIEvents");}finally{I.initEvent(J,E,C);I.view=L;I.altKey=A;I.ctrlKey=B;I.shiftKey=K;I.metaKey=H;I.keyCode=N;I.charCode=M;}}F.dispatchEvent(I);}else{if(YAHOO.lang.isObject(document.createEventObject)){I=document.createEventObject();I.bubbles=E;I.cancelable=C;I.view=L;I.ctrlKey=B;I.altKey=A;I.shiftKey=K;I.metaKey=H;I.keyCode=(M>0)?M:N;F.fireEvent("on"+J,I);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}}},simulateMouseEvent:function(K,P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L){K=YAHOO.util.Dom.get(K);if(!K){throw new Error("simulateMouseEvent(): Invalid target.");}if(YAHOO.lang.isString(P)){P=P.toLowerCase();switch(P){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+P+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(H)){H=true;}if(!YAHOO.lang.isBoolean(E)){E=(P!="mousemove");}if(!YAHOO.lang.isObject(Q)){Q=window;}if(!YAHOO.lang.isNumber(J)){J=1;}if(!YAHOO.lang.isNumber(G)){G=0;}if(!YAHOO.lang.isNumber(F)){F=0;}if(!YAHOO.lang.isNumber(D)){D=0;}if(!YAHOO.lang.isNumber(B)){B=0;}if(!YAHOO.lang.isBoolean(C)){C=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(O)){O=false;}if(!YAHOO.lang.isBoolean(M)){M=false;}if(!YAHOO.lang.isNumber(I)){I=0;}var N=null;if(YAHOO.lang.isFunction(document.createEvent)){N=document.createEvent("MouseEvents");if(N.initMouseEvent){N.initMouseEvent(P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L);}else{N=document.createEvent("UIEvents");N.initEvent(P,H,E);N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;N.button=I;
+N.relatedTarget=L;}if(L&&!N.relatedTarget){if(P=="mouseout"){N.toElement=L;}else{if(P=="mouseover"){N.fromElement=L;}}}K.dispatchEvent(N);}else{if(YAHOO.lang.isObject(document.createEventObject)){N=document.createEventObject();N.bubbles=H;N.cancelable=E;N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;switch(I){case 0:N.button=1;break;case 1:N.button=4;break;case 2:break;default:N.button=0;}N.relatedTarget=L;K.fireEvent("on"+P,N);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}}},fireMouseEvent:function(C,B,A){A=A||{};this.simulateMouseEvent(C,B,A.bubbles,A.cancelable,A.view,A.detail,A.screenX,A.screenY,A.clientX,A.clientY,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.button,A.relatedTarget);},click:function(B,A){this.fireMouseEvent(B,"click",A);},dblclick:function(B,A){this.fireMouseEvent(B,"dblclick",A);},mousedown:function(B,A){this.fireMouseEvent(B,"mousedown",A);},mousemove:function(B,A){this.fireMouseEvent(B,"mousemove",A);},mouseout:function(B,A){this.fireMouseEvent(B,"mouseout",A);},mouseover:function(B,A){this.fireMouseEvent(B,"mouseover",A);},mouseup:function(B,A){this.fireMouseEvent(B,"mouseup",A);},fireKeyEvent:function(B,C,A){A=A||{};this.simulateKeyEvent(C,B,A.bubbles,A.cancelable,A.view,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.keyCode,A.charCode);},keydown:function(B,A){this.fireKeyEvent("keydown",B,A);},keypress:function(B,A){this.fireKeyEvent("keypress",B,A);},keyup:function(B,A){this.fireKeyEvent("keyup",B,A);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(A){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:A.results});this._processResults(this._curPage,A.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}else{this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_processResults:function(C,A){var B=this._results;B.passed+=A.passed;B.failed+=A.failed;B.ignored+=A.ignored;B.total+=A.total;if(A.failed){B.failedPages.push(C);}else{B.passedPages.push(C);}A.name=C;A.type="page";B[C]=A;},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var A=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(A);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);A.run();}}},setPages:function(A){this._pages=A;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var A=document.createElement("iframe");A.style.visibility="hidden";A.style.position="absolute";document.body.appendChild(A);this._frame=A.contentWindow||A.contentDocument.ownerWindow;}if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}this._initialized=true;}this._results={passed:0,failed:0,ignored:0,total:0,type:"report",name:"YUI Test Results",failedPages:[],passedPages:[]};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(B,A){YAHOO.tool.TestLogger.superclass.constructor.call(this,B,A);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(B){var A=B.category;var C=this.html2Text(B.msg);return"<pre><p><span class=\""+A+"\">"+A.toUpperCase()+"</span> "+C+"</p></pre>";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(A){if(this._runner){this.clearTestRunner();}this._runner=A;A.subscribe(A.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(D){var A=YAHOO.tool.TestRunner;var C="";var B="";switch(D.type){case A.BEGIN_EVENT:C="Testing began at "+(new Date()).toString()+".";B="info";break;case A.COMPLETE_EVENT:C="Testing completed at "+(new Date()).toString()+".\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_FAIL_EVENT:C=D.testName+": "+D.error.getMessage();B="fail";break;case A.TEST_IGNORE_EVENT:C=D.testName+": ignored.";B="ignore";break;case A.TEST_PASS_EVENT:C=D.testName+": passed.";B="pass";break;case A.TEST_SUITE_BEGIN_EVENT:C="Test suite \""+D.testSuite.name+"\" started.";B="info";break;case A.TEST_SUITE_COMPLETE_EVENT:C="Test suite \""+D.testSuite.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;
+B="info";break;case A.TEST_CASE_BEGIN_EVENT:C="Test case \""+D.testCase.name+"\" started.";B="info";break;case A.TEST_CASE_COMPLETE_EVENT:C="Test case \""+D.testCase.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;default:C="Unexpected event "+D.type;C="info";}YAHOO.log(C,B,"TestRunner");}});YAHOO.namespace("tool.TestFormat");YAHOO.tool.TestFormat.JSON=function(A){return YAHOO.lang.JSON.stringify(A);};YAHOO.tool.TestFormat.XML=function(C){var A=YAHOO.lang;var B="<"+C.type+" name=\""+C.name.replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"\"";if(C.type=="test"){B+=" result=\""+C.result+"\" message=\""+C.message+"\">";}else{B+=" passed=\""+C.passed+"\" failed=\""+C.failed+"\" ignored=\""+C.ignored+"\" total=\""+C.total+"\">";for(var D in C){if(A.hasOwnProperty(C,D)&&A.isObject(C[D])&&!A.isArray(C[D])){B+=arguments.callee(C[D]);}}}B+="</"+C.type+">";return B;};YAHOO.namespace("tool");YAHOO.tool.TestReporter=function(A,B){this.url=A;this.format=B||YAHOO.tool.TestFormat.XML;this._fields=new Object();this._form=null;this._iframe=null;};YAHOO.tool.TestReporter.prototype={constructor:YAHOO.tool.TestReporter,addField:function(A,B){this._fields[A]=B;},clearFields:function(){this._fields=new Object();},destroy:function(){if(this._form){this._form.parentNode.removeChild(this._form);this._form=null;}if(this._iframe){this._iframe.parentNode.removeChild(this._iframe);this._iframe=null;}this._fields=null;},report:function(A){if(!this._form){this._form=document.createElement("form");this._form.method="post";this._form.style.visibility="hidden";this._form.style.position="absolute";this._form.style.top=0;document.body.appendChild(this._form);if(YAHOO.env.ua.ie){this._iframe=document.createElement("<iframe name=\"yuiTestTarget\" />");}else{this._iframe=document.createElement("iframe");this._iframe.name="yuiTestTarget";}this._iframe.src="javascript:false";this._iframe.style.visibility="hidden";this._iframe.style.position="absolute";this._iframe.style.top=0;document.body.appendChild(this._iframe);this._form.target="yuiTestTarget";}this._form.action=this.url;while(this._form.hasChildNodes()){this._form.removeChild(this._form.lastChild);}this._fields.results=this.format(A);this._fields.useragent=navigator.userAgent;this._fields.timestamp=(new Date()).toLocaleString();for(var B in this._fields){if(YAHOO.lang.hasOwnProperty(this._fields,B)&&typeof this._fields[B]!="function"){input=document.createElement("input");input.type="hidden";input.name=B;input.value=this._fields[B];this._form.appendChild(input);}}delete this._fields.results;delete this._fields.useragent;delete this._fields.timestamp;if(arguments[1]!==false){this._form.submit();}}};YAHOO.register("yuitest",YAHOO.tool.TestRunner,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/yuitest/yuitest.js b/lib/yui/yuitest/yuitest.js
new file mode 100644 (file)
index 0000000..ad11484
--- /dev/null
@@ -0,0 +1,3268 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+/**
+ * The UserAction object provides functions that simulate events occurring in
+ * the browser. Since these are simulated events, they do not behave exactly
+ * as regular, user-initiated events do, but can be used to test simple
+ * user interactions safely.
+ *
+ * @namespace YAHOO.util
+ * @class UserAction
+ * @static
+ */
+YAHOO.util.UserAction = {
+
+    //--------------------------------------------------------------------------
+    // Generic event methods
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a key event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks. Note: keydown causes Safari 2.x to
+     * crash.
+     * @method simulateKeyEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: keyup, keydown, and keypress.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 3 specifies that all key events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 3 specifies that all
+     *      key events can be cancelled. The default 
+     *      is true.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} keyCode (Optional) The code for the key that is in use. 
+     *      The default is 0.
+     * @param {int} charCode (Optional) The Unicode code for the character
+     *      associated with the key being used. The default is 0.
+     */
+    simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                 bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                 view /*:Window*/,
+                                 ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                 shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                 keyCode /*:int*/,        charCode /*:int*/) /*:Void*/                             
+    {
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateKeyEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "keyup":
+                case "keydown":
+                case "keypress":
+                    break;
+                case "textevent": //DOM Level 3
+                    type = "keypress";
+                    break;
+                    // @TODO was the fallthrough intentional, if so throw error
+                default:
+                    throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateKeyEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all key events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = true; //all key events can be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(keyCode)){
+            keyCode = 0;
+        }
+        if (!YAHOO.lang.isNumber(charCode)){
+            charCode = 0; 
+        }
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            try {
+                
+                //try to create key event
+                customEvent = document.createEvent("KeyEvents");
+                
+                /*
+                 * Interesting problem: Firefox implemented a non-standard
+                 * version of initKeyEvent() based on DOM Level 2 specs.
+                 * Key event was removed from DOM Level 2 and re-introduced
+                 * in DOM Level 3 with a different interface. Firefox is the
+                 * only browser with any implementation of Key Events, so for
+                 * now, assume it's Firefox if the above line doesn't error.
+                 */
+                //TODO: Decipher between Firefox's implementation and a correct one.
+                customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                    altKey, shiftKey, metaKey, keyCode, charCode);       
+                
+            } catch (ex /*:Error*/){
+
+                /*
+                 * If it got here, that means key events aren't officially supported. 
+                 * Safari/WebKit is a real problem now. WebKit 522 won't let you
+                 * set keyCode, charCode, or other properties if you use a
+                 * UIEvent, so we first must try to create a generic event. The
+                 * fun part is that this will throw an error on Safari 2.x. The
+                 * end result is that we need another try...catch statement just to
+                 * deal with this mess.
+                 */
+                try {
+
+                    //try to create generic event - will fail in Safari 2.x
+                    customEvent = document.createEvent("Events");
+
+                } catch (uierror /*:Error*/){
+
+                    //the above failed, so create a UIEvent for Safari 2.x
+                    customEvent = document.createEvent("UIEvents");
+
+                } finally {
+
+                    customEvent.initEvent(type, bubbles, cancelable);
+    
+                    //initialize
+                    customEvent.view = view;
+                    customEvent.altKey = altKey;
+                    customEvent.ctrlKey = ctrlKey;
+                    customEvent.shiftKey = shiftKey;
+                    customEvent.metaKey = metaKey;
+                    customEvent.keyCode = keyCode;
+                    customEvent.charCode = charCode;
+          
+                }          
+             
+            }
+            
+            //fire the event
+            target.dispatchEvent(customEvent);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            customEvent = document.createEventObject();
+            
+            //assign available properties
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.shiftKey = shiftKey;
+            customEvent.metaKey = metaKey;
+            
+            /*
+             * IE doesn't support charCode explicitly. CharCode should
+             * take precedence over any keyCode value for accurate
+             * representation.
+             */
+            customEvent.keyCode = (charCode > 0) ? charCode : keyCode;
+            
+            //fire the event
+            target.fireEvent("on" + type, customEvent);  
+                    
+        } else {
+            throw new Error("simulateKeyEvent(): No event simulation framework present.");
+        }
+    },
+
+    /**
+     * Simulates a mouse event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks.
+     * @method simulateMouseEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 2 specifies that all mouse events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 2 specifies that all
+     *      mouse events except mousemove can be cancelled. The default 
+     *      is true for all events except mousemove, for which the default 
+     *      is false.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {int} detail (Optional) The number of times the mouse button has
+     *      been used. The default value is 1.
+     * @param {int} screenX (Optional) The x-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} screenY (Optional) The y-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientX (Optional) The x-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientY (Optional) The y-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} button (Optional) The button being pressed while the event
+     *      is executing. The value should be 0 for the primary mouse button
+     *      (typically the left button), 1 for the terciary mouse button
+     *      (typically the middle button), and 2 for the secondary mouse button
+     *      (typically the right button). The default is 0.
+     * @param {HTMLElement} relatedTarget (Optional) For mouseout events,
+     *      this is the element that the mouse has moved to. For mouseover
+     *      events, this is the element that the mouse has moved from. This
+     *      argument is ignored for all other events. The default is null.
+     */
+    simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                   bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                   view /*:Window*/,        detail /*:int*/, 
+                                   screenX /*:int*/,        screenY /*:int*/, 
+                                   clientX /*:int*/,        clientY /*:int*/,       
+                                   ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                   shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                   button /*:int*/,         relatedTarget /*:HTMLElement*/) /*:Void*/
+    {
+        
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateMouseEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "mouseover":
+                case "mouseout":
+                case "mousedown":
+                case "mouseup":
+                case "click":
+                case "dblclick":
+                case "mousemove":
+                    break;
+                default:
+                    throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateMouseEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all mouse events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isNumber(detail)){
+            detail = 1;  //number of mouse clicks must be at least one
+        }
+        if (!YAHOO.lang.isNumber(screenX)){
+            screenX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(screenY)){
+            screenY = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientX)){
+            clientX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientY)){
+            clientY = 0; 
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(button)){
+            button = 0; 
+        }
+
+        //try to create a mouse event
+        var customEvent /*:MouseEvent*/ = null;
+            
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            customEvent = document.createEvent("MouseEvents");
+        
+            //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
+            if (customEvent.initMouseEvent){
+                customEvent.initMouseEvent(type, bubbles, cancelable, view, detail,
+                                     screenX, screenY, clientX, clientY, 
+                                     ctrlKey, altKey, shiftKey, metaKey, 
+                                     button, relatedTarget);
+            } else { //Safari
+            
+                //the closest thing available in Safari 2.x is UIEvents
+                customEvent = document.createEvent("UIEvents");
+                customEvent.initEvent(type, bubbles, cancelable);
+                customEvent.view = view;
+                customEvent.detail = detail;
+                customEvent.screenX = screenX;
+                customEvent.screenY = screenY;
+                customEvent.clientX = clientX;
+                customEvent.clientY = clientY;
+                customEvent.ctrlKey = ctrlKey;
+                customEvent.altKey = altKey;
+                customEvent.metaKey = metaKey;
+                customEvent.shiftKey = shiftKey;
+                customEvent.button = button;
+                customEvent.relatedTarget = relatedTarget;
+            }
+            
+            /*
+             * Check to see if relatedTarget has been assigned. Firefox
+             * versions less than 2.0 don't allow it to be assigned via
+             * initMouseEvent() and the property is readonly after event
+             * creation, so in order to keep YAHOO.util.getRelatedTarget()
+             * working, assign to the IE proprietary toElement property
+             * for mouseout event and fromElement property for mouseover
+             * event.
+             */
+            if (relatedTarget && !customEvent.relatedTarget){
+                if (type == "mouseout"){
+                    customEvent.toElement = relatedTarget;
+                } else if (type == "mouseover"){
+                    customEvent.fromElement = relatedTarget;
+                }
+            }
+            
+            //fire the event
+            target.dispatchEvent(customEvent);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            customEvent = document.createEventObject();
+            
+            //assign available properties
+            customEvent.bubbles = bubbles;
+            customEvent.cancelable = cancelable;
+            customEvent.view = view;
+            customEvent.detail = detail;
+            customEvent.screenX = screenX;
+            customEvent.screenY = screenY;
+            customEvent.clientX = clientX;
+            customEvent.clientY = clientY;
+            customEvent.ctrlKey = ctrlKey;
+            customEvent.altKey = altKey;
+            customEvent.metaKey = metaKey;
+            customEvent.shiftKey = shiftKey;
+
+            //fix button property for IE's wacky implementation
+            switch(button){
+                case 0:
+                    customEvent.button = 1;
+                    break;
+                case 1:
+                    customEvent.button = 4;
+                    break;
+                case 2:
+                    //leave as is
+                    break;
+                default:
+                    customEvent.button = 0;                    
+            }    
+
+            /*
+             * Have to use relatedTarget because IE won't allow assignment
+             * to toElement or fromElement on generic events. This keeps
+             * YAHOO.util.customEvent.getRelatedTarget() functional.
+             */
+            customEvent.relatedTarget = relatedTarget;
+            
+            //fire the event
+            target.fireEvent("on" + type, customEvent);
+                    
+        } else {
+            throw new Error("simulateMouseEvent(): No event simulation framework present.");
+        }
+    },
+   
+    //--------------------------------------------------------------------------
+    // Mouse events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a mouse event on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseEvent
+     * @static
+     */
+    fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                           options /*:Object*/) /*:Void*/
+    {
+        options = options || {};
+        this.simulateMouseEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.detail, options.screenX,        
+            options.screenY, options.clientX, options.clientY, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, options.button,         
+            options.relatedTarget);        
+    },
+
+    /**
+     * Simulates a click on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method click
+     * @static     
+     */
+    click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "click", options);
+    },
+    
+    /**
+     * Simulates a double click on a particular element.
+     * @param {HTMLElement} target The element to double click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method dblclick
+     * @static
+     */
+    dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent( target, "dblclick", options);
+    },
+    
+    /**
+     * Simulates a mousedown on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousedown
+     * @static
+     */
+    mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousedown", options);
+    },
+    
+    /**
+     * Simulates a mousemove on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousemove
+     * @static
+     */
+    mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousemove", options);
+    },
+    
+    /**
+     * Simulates a mouseout event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved to.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * toElement is assigned in its place. IE doesn't allow toElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseout
+     * @static
+     */
+    mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseout", options);
+    },
+    
+    /**
+     * Simulates a mouseover event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved from.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * fromElement is assigned in its place. IE doesn't allow fromElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseover
+     * @static
+     */
+    mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseover", options);
+    },
+    
+    /**
+     * Simulates a mouseup on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseup
+     * @static
+     */
+    mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseup", options);
+    },
+    
+    //--------------------------------------------------------------------------
+    // Key events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Fires an event that normally would be fired by the keyboard (keyup,
+     * keydown, keypress). Make sure to specify either keyCode or charCode as
+     * an option.
+     * @private
+     * @param {String} type The type of event ("keyup", "keydown" or "keypress").
+     * @param {HTMLElement} target The target of the event.
+     * @param {Object} options Options for the event. Either keyCode or charCode
+     *                         are required.
+     * @method fireKeyEvent
+     * @static
+     */     
+    fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/,
+                             options /*:Object*/) /*:Void*/ 
+    {
+        options = options || {};
+        this.simulateKeyEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, 
+            options.keyCode, options.charCode);    
+    },
+    
+    /**
+     * Simulates a keydown event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keydown
+     * @static
+     */
+    keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keydown", target, options);
+    },
+    
+    /**
+     * Simulates a keypress on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keypress
+     * @static
+     */
+    keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keypress", target, options);
+    },
+    
+    /**
+     * Simulates a keyup event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keyup
+     * @static
+     */
+    keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireKeyEvent("keyup", target, options);
+    }
+    
+
+};
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestManager object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs pages containing test suite definitions.
+ * @namespace YAHOO.tool
+ * @class TestManager
+ * @static
+ */
+YAHOO.tool.TestManager = {
+
+    /**
+     * Constant for the testpagebegin custom event
+     * @property TEST_PAGE_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_BEGIN_EVENT /*:String*/ : "testpagebegin",
+
+    /**
+     * Constant for the testpagecomplete custom event
+     * @property TEST_PAGE_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_COMPLETE_EVENT /*:String*/ : "testpagecomplete",
+
+    /**
+     * Constant for the testmanagerbegin custom event
+     * @property TEST_MANAGER_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_BEGIN_EVENT /*:String*/ : "testmanagerbegin",
+
+    /**
+     * Constant for the testmanagercomplete custom event
+     * @property TEST_MANAGER_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_COMPLETE_EVENT /*:String*/ : "testmanagercomplete",
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+    
+    
+    /**
+     * The URL of the page currently being executed.
+     * @type String
+     * @private
+     * @property _curPage
+     * @static
+     */
+    _curPage /*:String*/ : null,
+    
+    /**
+     * The frame used to load and run tests.
+     * @type Window
+     * @private
+     * @property _frame
+     * @static
+     */
+    _frame /*:Window*/ : null,
+    
+    /**
+     * The logger used to output results from the various tests.
+     * @type YAHOO.tool.TestLogger
+     * @private
+     * @property _logger
+     * @static
+     */
+    _logger : null,
+    
+    /**
+     * The timeout ID for the next iteration through the tests.
+     * @type int
+     * @private
+     * @property _timeoutId
+     * @static
+     */
+    _timeoutId /*:int*/ : 0,
+    
+    /**
+     * Array of pages to load.
+     * @type String[]
+     * @private
+     * @property _pages
+     * @static
+     */
+    _pages /*:String[]*/ : [],
+    
+    /**
+     * Aggregated results
+     * @type Object
+     * @private
+     * @property _results
+     * @static
+     */
+    _results: null,
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles TestRunner.COMPLETE_EVENT, storing the results and beginning
+     * the loop again.
+     * @param {Object} data Data about the event.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _handleTestRunnerComplete : function (data /*:Object*/) /*:Void*/ {
+
+        this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT, {
+                page: this._curPage,
+                results: data.results
+            });
+    
+        //save results
+        //this._results[this.curPage] = data.results;
+        
+        //process 'em
+        this._processResults(this._curPage, data.results);
+        
+        this._logger.clearTestRunner();
+    
+        //if there's more to do, set a timeout to begin again
+        if (this._pages.length){
+            this._timeoutId = setTimeout(function(){
+                YAHOO.tool.TestManager._run();
+            }, 1000);
+        } else {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
+        }
+    },
+    
+    /**
+     * Processes the results of a test page run, outputting log messages
+     * for failed tests.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
+
+        var r = this._results;
+        
+        r.passed += results.passed;
+        r.failed += results.failed;
+        r.ignored += results.ignored;
+        r.total += results.total;
+        
+        if (results.failed){
+            r.failedPages.push(page);
+        } else {
+            r.passedPages.push(page);
+        }
+        
+        results.name = page;
+        results.type = "page";
+        
+        r[page] = results;
+    },
+    
+    /**
+     * Loads the next test page into the iframe.
+     * @return {Void}
+     * @static
+     * @private
+     */
+    _run : function () /*:Void*/ {
+    
+        //set the current page
+        this._curPage = this._pages.shift();
+
+        this.fireEvent(this.TEST_PAGE_BEGIN_EVENT, this._curPage);
+        
+        //load the frame - destroy history in case there are other iframes that
+        //need testing
+        this._frame.location.replace(this._curPage);
+    
+    },
+        
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Signals that a test page has been loaded. This should be called from
+     * within the test page itself to notify the TestManager that it is ready.
+     * @return {Void}
+     * @static
+     */
+    load : function () /*:Void*/ {
+        if (parent.YAHOO.tool.TestManager !== this){
+            parent.YAHOO.tool.TestManager.load();
+        } else {
+            
+            if (this._frame) {
+                //assign event handling
+                var TestRunner = this._frame.YAHOO.tool.TestRunner;
+
+                this._logger.setTestRunner(TestRunner);
+                TestRunner.subscribe(TestRunner.COMPLETE_EVENT, this._handleTestRunnerComplete, this, true);
+                
+                //run it
+                TestRunner.run();
+            }
+        }
+    },
+    
+    /**
+     * Sets the pages to be loaded.
+     * @param {String[]} pages An array of URLs to load.
+     * @return {Void}
+     * @static
+     */
+    setPages : function (pages /*:String[]*/) /*:Void*/ {
+        this._pages = pages;
+    },
+    
+    /**
+     * Begins the process of running the tests.
+     * @return {Void}
+     * @static
+     */
+    start : function () /*:Void*/ {
+
+        if (!this._initialized) {
+
+            /**
+             * Fires when loading a test page
+             * @event testpagebegin
+             * @param curPage {string} the page being loaded
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_BEGIN_EVENT);
+
+            /**
+             * Fires when a test page is complete
+             * @event testpagecomplete
+             * @param obj {page: string, results: object} the name of the
+             * page that was loaded, and the test suite results
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);
+
+            /**
+             * Fires when the test manager starts running all test pages
+             * @event testmanagerbegin
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);
+
+            /**
+             * Fires when the test manager finishes running all test pages.  External
+             * test runners should subscribe to this event in order to get the
+             * aggregated test results.
+             * @event testmanagercomplete
+             * @param obj { pages_passed: int, pages_failed: int, tests_passed: int
+             *              tests_failed: int, passed: string[], failed: string[],
+             *              page_results: {} }
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);
+
+            //create iframe if not already available
+            if (!this._frame){
+                var frame /*:HTMLElement*/ = document.createElement("iframe");
+                frame.style.visibility = "hidden";
+                frame.style.position = "absolute";
+                document.body.appendChild(frame);
+                this._frame = frame.contentWindow || frame.contentDocument.ownerWindow;
+            }
+            
+            //create test logger if not already available
+            if (!this._logger){
+                this._logger = new YAHOO.tool.TestLogger();
+            }
+
+            this._initialized = true;
+        }
+
+
+        // reset the results cache
+        this._results = {
+        
+            passed: 0,
+            failed: 0,
+            ignored: 0,
+            total: 0,
+            type: "report",
+            name: "YUI Test Results",
+            failedPages:[],
+            passedPages:[]
+            /*
+            // number of pages that pass
+            pages_passed: 0,
+            // number of pages that fail
+            pages_failed: 0,
+            // total number of tests passed
+            tests_passed: 0,
+            // total number of tests failed
+            tests_failed: 0,
+            // array of pages that passed
+            passed: [],
+            // array of pages that failed
+            failed: [],
+            // map of full results for each page
+            page_results: {}*/
+        };
+
+        this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
+        this._run();
+    
+    },
+
+    /**
+     * Stops the execution of tests.
+     * @return {Void}
+     * @static
+     */
+    stop : function () /*:Void*/ {
+        clearTimeout(this._timeoutId);
+    }
+
+};
+
+YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
+
+
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" + 
+                    data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+
+YAHOO.namespace("tool.TestFormat");
+
+/**
+ * Returns test results formatted as a JSON string. Requires JSON utility.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method JSON
+ * @static
+ */
+YAHOO.tool.TestFormat.JSON = function(results /*:Object*/) /*:String*/ {
+    return YAHOO.lang.JSON.stringify(results);
+};
+
+/**
+ * Returns test results formatted as an XML string.
+ * @param {Object} result The results object created by TestRunner.
+ * @return {String} An XML-formatted string of results.
+ * @namespace YAHOO.tool.TestFormat
+ * @method XML
+ * @static
+ */
+YAHOO.tool.TestFormat.XML = function(results /*:Object*/) /*:String*/ {
+
+    var l = YAHOO.lang;
+    var xml /*:String*/ = "<" + results.type + " name=\"" + results.name.replace(/"/g, "&quot;").replace(/'/g, "&apos;") + "\"";
+    
+    if (results.type == "test"){
+        xml += " result=\"" + results.result + "\" message=\"" + results.message + "\">";
+    } else {
+        xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";
+        for (var prop in results) {
+            if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){
+                xml += arguments.callee(results[prop]);
+            }
+        }        
+    }
+
+    xml += "</" + results.type + ">";
+    
+    return xml;
+
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * An object capable of sending test results to a server.
+ * @param {String} url The URL to submit the results to.
+ * @param {Function} format (Optiona) A function that outputs the results in a specific format.
+ *      Default is YAHOO.tool.TestFormat.XML.
+ * @constructor
+ * @namespace YAHOO.tool
+ * @class TestReporter
+ */
+YAHOO.tool.TestReporter = function(url /*:String*/, format /*:Function*/) {
+
+    /**
+     * The URL to submit the data to.
+     * @type String
+     * @property url
+     */
+    this.url /*:String*/ = url;
+
+    /**
+     * The formatting function to call when submitting the data.
+     * @type Function
+     * @property format
+     */
+    this.format /*:Function*/ = format || YAHOO.tool.TestFormat.XML;
+
+    /**
+     * Extra fields to submit with the request.
+     * @type Object
+     * @property _fields
+     * @private
+     */
+    this._fields /*:Object*/ = new Object();
+    
+    /**
+     * The form element used to submit the results.
+     * @type HTMLFormElement
+     * @property _form
+     * @private
+     */
+    this._form /*:HTMLElement*/ = null;
+
+    /**
+     * Iframe used as a target for form submission.
+     * @type HTMLIFrameElement
+     * @property _iframe
+     * @private
+     */
+    this._iframe /*:HTMLElement*/ = null;
+};
+
+YAHOO.tool.TestReporter.prototype = {
+
+    //restore missing constructor
+    constructor: YAHOO.tool.TestReporter,
+
+    /**
+     * Adds a field to the form that submits the results.
+     * @param {String} name The name of the field.
+     * @param {Variant} value The value of the field.
+     * @return {Void}
+     * @method addField
+     */
+    addField : function (name /*:String*/, value /*:Variant*/) /*:Void*/{
+        this._fields[name] = value;    
+    },
+    
+    /**
+     * Removes all previous defined fields.
+     * @return {Void}
+     * @method addField
+     */
+    clearFields : function() /*:Void*/{
+        this._fields = new Object();
+    },
+
+    /**
+     * Cleans up the memory associated with the TestReporter, removing DOM elements
+     * that were created.
+     * @return {Void}
+     * @method destroy
+     */
+    destroy : function() /*:Void*/ {
+        if (this._form){
+            this._form.parentNode.removeChild(this._form);
+            this._form = null;
+        }        
+        if (this._iframe){
+            this._iframe.parentNode.removeChild(this._iframe);
+            this._iframe = null;
+        }
+        this._fields = null;
+    },
+
+    /**
+     * Sends the report to the server.
+     * @param {Object} results The results object created by TestRunner.
+     * @return {Void}
+     * @method report
+     */
+    report : function(results /*:Object*/) /*:Void*/{
+    
+        //if the form hasn't been created yet, create it
+        if (!this._form){
+            this._form = document.createElement("form");
+            this._form.method = "post";
+            this._form.style.visibility = "hidden";
+            this._form.style.position = "absolute";
+            this._form.style.top = 0;
+            document.body.appendChild(this._form);
+        
+            //IE won't let you assign a name using the DOM, must do it the hacky way
+            if (YAHOO.env.ua.ie){
+                this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");
+            } else {
+                this._iframe = document.createElement("iframe");
+                this._iframe.name = "yuiTestTarget";
+            }
+
+            this._iframe.src = "javascript:false";
+            this._iframe.style.visibility = "hidden";
+            this._iframe.style.position = "absolute";
+            this._iframe.style.top = 0;
+            document.body.appendChild(this._iframe);
+
+            this._form.target = "yuiTestTarget";
+        }
+
+        //set the form's action
+        this._form.action = this.url;
+    
+        //remove any existing fields
+        while(this._form.hasChildNodes()){
+            this._form.removeChild(this._form.lastChild);
+        }
+        
+        //create default fields
+        this._fields.results = this.format(results);
+        this._fields.useragent = navigator.userAgent;
+        this._fields.timestamp = (new Date()).toLocaleString();
+
+        //add fields to the form
+        for (var prop in this._fields){
+            if (YAHOO.lang.hasOwnProperty(this._fields, prop) && typeof this._fields[prop] != "function"){
+                input = document.createElement("input");
+                input.type = "hidden";
+                input.name = prop;
+                input.value = this._fields[prop];
+                this._form.appendChild(input);
+            }
+        }
+
+        //remove default fields
+        delete this._fields.results;
+        delete this._fields.useragent;
+        delete this._fields.timestamp;
+        
+        if (arguments[1] !== false){
+            this._form.submit();
+        }
+    
+    }
+
+};
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest_core-beta-debug.js b/lib/yui/yuitest/yuitest_core-beta-debug.js
new file mode 100644 (file)
index 0000000..8a431c2
--- /dev/null
@@ -0,0 +1,1922 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.register("yuitest_core", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest_core-beta-min.js b/lib/yui/yuitest/yuitest_core-beta-min.js
new file mode 100644 (file)
index 0000000..dcb313f
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");YAHOO.tool.TestCase=function(A){this._should={};for(var B in A){this[B]=A[B];}if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={resume:function(A){YAHOO.tool.TestRunner.resume(A);},wait:function(B,A){throw new YAHOO.tool.TestCase.Wait(B,A);},setUp:function(){},tearDown:function(){}};YAHOO.tool.TestCase.Wait=function(B,A){this.segment=(YAHOO.lang.isFunction(B)?B:null);this.delay=(YAHOO.lang.isNumber(A)?A:0);};YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(A){this.name="";this.items=[];if(YAHOO.lang.isString(A)){this.name=A;}else{if(YAHOO.lang.isObject(A)){YAHOO.lang.augmentObject(this,A,true);}}if(this.name===""){this.name=YAHOO.util.Dom.generateId(null,"testSuite");}};YAHOO.tool.TestSuite.prototype={add:function(A){if(A instanceof YAHOO.tool.TestSuite||A instanceof YAHOO.tool.TestCase){this.items.push(A);}},setUp:function(){},tearDown:function(){}};YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function B(C){this.testObject=C;this.firstChild=null;this.lastChild=null;this.parent=null;this.next=null;this.results={passed:0,failed:0,total:0,ignored:0};if(C instanceof YAHOO.tool.TestSuite){this.results.type="testsuite";this.results.name=C.name;}else{if(C instanceof YAHOO.tool.TestCase){this.results.type="testcase";this.results.name=C.name;}}}B.prototype={appendChild:function(C){var D=new B(C);if(this.firstChild===null){this.firstChild=this.lastChild=D;}else{this.lastChild.next=D;this.lastChild=D;}D.parent=this;return D;}};function A(){A.superclass.constructor.apply(this,arguments);this.masterSuite=new YAHOO.tool.TestSuite("YUI Test Results");this._cur=null;this._root=null;var D=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var C=0;C<D.length;C++){this.createEvent(D[C],{scope:this});}}YAHOO.lang.extend(A,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(C,D){var E=C.appendChild(D);for(var F in D){if(F.indexOf("test")===0&&YAHOO.lang.isFunction(D[F])){E.appendChild(F);}}},_addTestSuiteToTestTree:function(C,F){var E=C.appendChild(F);for(var D=0;D<F.items.length;D++){if(F.items[D] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(E,F.items[D]);}else{if(F.items[D] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(E,F.items[D]);}}}},_buildTestTree:function(){this._root=new B(this.masterSuite);this._cur=this._root;for(var C=0;C<this.masterSuite.items.length;C++){if(this.masterSuite.items[C] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(this._root,this.masterSuite.items[C]);}else{if(this.masterSuite.items[C] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(this._root,this.masterSuite.items[C]);}}}},_handleTestObjectComplete:function(C){if(YAHOO.lang.isObject(C.testObject)){C.parent.results.passed+=C.results.passed;C.parent.results.failed+=C.results.failed;C.parent.results.total+=C.results.total;C.parent.results.ignored+=C.results.ignored;C.parent.results[C.testObject.name]=C.results;if(C.testObject instanceof YAHOO.tool.TestSuite){C.testObject.tearDown();this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:C.testObject,results:C.results});}else{if(C.testObject instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:C.testObject,results:C.results});}}}},_next:function(){if(this._cur.firstChild){this._cur=this._cur.firstChild;}else{if(this._cur.next){this._cur=this._cur.next;}else{while(this._cur&&!this._cur.next&&this._cur!==this._root){this._handleTestObjectComplete(this._cur);this._cur=this._cur.parent;}if(this._cur==this._root){this._cur.results.type="report";this._cur.results.timestamp=(new Date()).toLocaleString();this.fireEvent(this.COMPLETE_EVENT,{results:this._cur.results});this._cur=null;}else{this._handleTestObjectComplete(this._cur);this._cur=this._cur.next;}}}return this._cur;},_run:function(){var E=false;var D=this._next();if(D!==null){var C=D.testObject;if(YAHOO.lang.isObject(C)){if(C instanceof YAHOO.tool.TestSuite){this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:C});C.setUp();}else{if(C instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:C});}}if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{this._runTest(D);}}},_resumeTest:function(G){var C=this._cur;var H=C.testObject;var E=C.parent.testObject;var K=(E._should.fail||{})[H];var D=(E._should.error||{})[H];var F=false;var I=null;try{G.apply(E);if(K){I=new YAHOO.util.ShouldFail();F=true;}else{if(D){I=new YAHOO.util.ShouldError();F=true;}}}catch(J){if(J instanceof YAHOO.util.AssertionError){if(!K){I=J;F=true;}}else{if(J instanceof YAHOO.tool.TestCase.Wait){if(YAHOO.lang.isFunction(J.segment)){if(YAHOO.lang.isNumber(J.delay)){if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._resumeTest(J.segment);},J.delay);}else{throw new Error("Asynchronous tests not supported in this environment.");}}}return ;}else{if(!D){I=new YAHOO.util.UnexpectedError(J);F=true;}else{if(YAHOO.lang.isString(D)){if(J.message!=D){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isFunction(D)){if(!(J instanceof D)){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isObject(D)){if(!(J instanceof D.constructor)||J.message!=D.message){I=new YAHOO.util.UnexpectedError(J);F=true;}}}}}}}}if(F){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:E,testName:H,error:I});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:E,testName:H});}E.tearDown();C.parent.results[H]={result:F?"fail":"pass",message:I?I.getMessage():"Test passed",type:"test",name:H};
+if(F){C.parent.results.failed++;}else{C.parent.results.passed++;}C.parent.results.total++;if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}},_runTest:function(F){var C=F.testObject;var D=F.parent.testObject;var G=D[C];var E=(D._should.ignore||{})[C];if(E){F.parent.results[C]={result:"ignore",message:"Test ignored",type:"test",name:C};F.parent.results.ignored++;F.parent.results.total++;this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:D,testName:C});if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{D.setUp();this._resumeTest(G);}},fireEvent:function(C,D){D=D||{};D.type=C;A.superclass.fireEvent.call(this,C,D);},add:function(C){this.masterSuite.add(C);},clear:function(){this.masterSuite.items=[];},resume:function(C){this._resumeTest(C||function(){});},run:function(C){var D=YAHOO.tool.TestRunner;D._buildTestTree();D.fireEvent(D.BEGIN_EVENT);D._run();}});return new A();})();YAHOO.namespace("util");YAHOO.util.Assert={fail:function(A){throw new YAHOO.util.AssertionError(A||"Test force-failed.");},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(A||"Values should be equal.",B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be equal.",A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be the same.",A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(A||"Values should be the same.",B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be false.",false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be true.",true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be NaN.",NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be NaN.",NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be null.",null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should not be undefined.",undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be null.",null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be undefined.",undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an array.",B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a Boolean.",B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a function.",B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(A||"Value isn't an instance of expected type.",B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a number.",B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an object.",B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a string.",B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(B||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"Value ("+E+") not found in array.");}},containsItems:function(C,D,B){for(var A=0;A<C.length;A++){this.contains(C[A],D,B);}if(!found){YAHOO.util.Assert.fail(B||"Value not found in array.");}},containsMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"No match found in array.");}},doesNotContain:function(E,D,B){var C=false;
+for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},doesNotContainItems:function(C,D,B){for(var A=0;A<C.length;A++){this.doesNotContain(C[A],D,B);}},doesNotContainMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},indexOf:function(E,D,A,C){for(var B=0;B<D.length;B++){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");},itemsAreEqual:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areEqual(D[B],E[B],C||"Values in position "+B+" are not equal.");}},itemsAreEquivalent:function(E,F,B,D){if(typeof B!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}var A=Math.max(E.length,F.length);for(var C=0;C<A;C++){if(!B(E[C],F[C])){throw new YAHOO.util.ComparisonFailure(D||"Values in position "+C+" are not equivalent.",E[C],F[C]);}}},isEmpty:function(B,A){if(B.length>0){YAHOO.util.Assert.fail(A||"Array should be empty.");}},isNotEmpty:function(B,A){if(B.length===0){YAHOO.util.Assert.fail(A||"Array should not be empty.");}},itemsAreSame:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areSame(D[B],E[B],C||"Values in position "+B+" are not the same.");}},lastIndexOf:function(E,D,A,C){for(var B=D.length;B>=0;B--){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,F,C){var B=[];for(var E in D){B.push(E);}for(var A=0;A<B.length;A++){YAHOO.util.Assert.isNotUndefined(F[B[A]],C||"Property'"+B[A]+"' expected.");}},hasProperty:function(A,B,C){if(YAHOO.lang.isUndefined(B[A])){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object.");}},hasOwnProperty:function(A,B,C){if(!YAHOO.lang.hasOwnProperty(B,A)){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getFullYear(),C.getFullYear(),A||"Years should be equal.");YAHOO.util.Assert.areEqual(B.getMonth(),C.getMonth(),A||"Months should be equal.");YAHOO.util.Assert.areEqual(B.getDate(),C.getDate(),A||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getHours(),C.getHours(),A||"Hours should be equal.");YAHOO.util.Assert.areEqual(B.getMinutes(),C.getMinutes(),A||"Minutes should be equal.");YAHOO.util.Assert.areEqual(B.getSeconds(),C.getSeconds(),A||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.register("yuitest_core",YAHOO.tool.TestRunner,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/yuitest/yuitest_core-beta.js b/lib/yui/yuitest/yuitest_core-beta.js
new file mode 100644 (file)
index 0000000..8a431c2
--- /dev/null
@@ -0,0 +1,1922 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.register("yuitest_core", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest_core-debug.js b/lib/yui/yuitest/yuitest_core-debug.js
new file mode 100644 (file)
index 0000000..8a431c2
--- /dev/null
@@ -0,0 +1,1922 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.register("yuitest_core", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});
diff --git a/lib/yui/yuitest/yuitest_core-min.js b/lib/yui/yuitest/yuitest_core-min.js
new file mode 100644 (file)
index 0000000..dcb313f
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");YAHOO.tool.TestCase=function(A){this._should={};for(var B in A){this[B]=A[B];}if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={resume:function(A){YAHOO.tool.TestRunner.resume(A);},wait:function(B,A){throw new YAHOO.tool.TestCase.Wait(B,A);},setUp:function(){},tearDown:function(){}};YAHOO.tool.TestCase.Wait=function(B,A){this.segment=(YAHOO.lang.isFunction(B)?B:null);this.delay=(YAHOO.lang.isNumber(A)?A:0);};YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(A){this.name="";this.items=[];if(YAHOO.lang.isString(A)){this.name=A;}else{if(YAHOO.lang.isObject(A)){YAHOO.lang.augmentObject(this,A,true);}}if(this.name===""){this.name=YAHOO.util.Dom.generateId(null,"testSuite");}};YAHOO.tool.TestSuite.prototype={add:function(A){if(A instanceof YAHOO.tool.TestSuite||A instanceof YAHOO.tool.TestCase){this.items.push(A);}},setUp:function(){},tearDown:function(){}};YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function B(C){this.testObject=C;this.firstChild=null;this.lastChild=null;this.parent=null;this.next=null;this.results={passed:0,failed:0,total:0,ignored:0};if(C instanceof YAHOO.tool.TestSuite){this.results.type="testsuite";this.results.name=C.name;}else{if(C instanceof YAHOO.tool.TestCase){this.results.type="testcase";this.results.name=C.name;}}}B.prototype={appendChild:function(C){var D=new B(C);if(this.firstChild===null){this.firstChild=this.lastChild=D;}else{this.lastChild.next=D;this.lastChild=D;}D.parent=this;return D;}};function A(){A.superclass.constructor.apply(this,arguments);this.masterSuite=new YAHOO.tool.TestSuite("YUI Test Results");this._cur=null;this._root=null;var D=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var C=0;C<D.length;C++){this.createEvent(D[C],{scope:this});}}YAHOO.lang.extend(A,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(C,D){var E=C.appendChild(D);for(var F in D){if(F.indexOf("test")===0&&YAHOO.lang.isFunction(D[F])){E.appendChild(F);}}},_addTestSuiteToTestTree:function(C,F){var E=C.appendChild(F);for(var D=0;D<F.items.length;D++){if(F.items[D] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(E,F.items[D]);}else{if(F.items[D] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(E,F.items[D]);}}}},_buildTestTree:function(){this._root=new B(this.masterSuite);this._cur=this._root;for(var C=0;C<this.masterSuite.items.length;C++){if(this.masterSuite.items[C] instanceof YAHOO.tool.TestSuite){this._addTestSuiteToTestTree(this._root,this.masterSuite.items[C]);}else{if(this.masterSuite.items[C] instanceof YAHOO.tool.TestCase){this._addTestCaseToTestTree(this._root,this.masterSuite.items[C]);}}}},_handleTestObjectComplete:function(C){if(YAHOO.lang.isObject(C.testObject)){C.parent.results.passed+=C.results.passed;C.parent.results.failed+=C.results.failed;C.parent.results.total+=C.results.total;C.parent.results.ignored+=C.results.ignored;C.parent.results[C.testObject.name]=C.results;if(C.testObject instanceof YAHOO.tool.TestSuite){C.testObject.tearDown();this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:C.testObject,results:C.results});}else{if(C.testObject instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:C.testObject,results:C.results});}}}},_next:function(){if(this._cur.firstChild){this._cur=this._cur.firstChild;}else{if(this._cur.next){this._cur=this._cur.next;}else{while(this._cur&&!this._cur.next&&this._cur!==this._root){this._handleTestObjectComplete(this._cur);this._cur=this._cur.parent;}if(this._cur==this._root){this._cur.results.type="report";this._cur.results.timestamp=(new Date()).toLocaleString();this.fireEvent(this.COMPLETE_EVENT,{results:this._cur.results});this._cur=null;}else{this._handleTestObjectComplete(this._cur);this._cur=this._cur.next;}}}return this._cur;},_run:function(){var E=false;var D=this._next();if(D!==null){var C=D.testObject;if(YAHOO.lang.isObject(C)){if(C instanceof YAHOO.tool.TestSuite){this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:C});C.setUp();}else{if(C instanceof YAHOO.tool.TestCase){this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:C});}}if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{this._runTest(D);}}},_resumeTest:function(G){var C=this._cur;var H=C.testObject;var E=C.parent.testObject;var K=(E._should.fail||{})[H];var D=(E._should.error||{})[H];var F=false;var I=null;try{G.apply(E);if(K){I=new YAHOO.util.ShouldFail();F=true;}else{if(D){I=new YAHOO.util.ShouldError();F=true;}}}catch(J){if(J instanceof YAHOO.util.AssertionError){if(!K){I=J;F=true;}}else{if(J instanceof YAHOO.tool.TestCase.Wait){if(YAHOO.lang.isFunction(J.segment)){if(YAHOO.lang.isNumber(J.delay)){if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._resumeTest(J.segment);},J.delay);}else{throw new Error("Asynchronous tests not supported in this environment.");}}}return ;}else{if(!D){I=new YAHOO.util.UnexpectedError(J);F=true;}else{if(YAHOO.lang.isString(D)){if(J.message!=D){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isFunction(D)){if(!(J instanceof D)){I=new YAHOO.util.UnexpectedError(J);F=true;}}else{if(YAHOO.lang.isObject(D)){if(!(J instanceof D.constructor)||J.message!=D.message){I=new YAHOO.util.UnexpectedError(J);F=true;}}}}}}}}if(F){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:E,testName:H,error:I});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:E,testName:H});}E.tearDown();C.parent.results[H]={result:F?"fail":"pass",message:I?I.getMessage():"Test passed",type:"test",name:H};
+if(F){C.parent.results.failed++;}else{C.parent.results.passed++;}C.parent.results.total++;if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}},_runTest:function(F){var C=F.testObject;var D=F.parent.testObject;var G=D[C];var E=(D._should.ignore||{})[C];if(E){F.parent.results[C]={result:"ignore",message:"Test ignored",type:"test",name:C};F.parent.results.ignored++;F.parent.results.total++;this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:D,testName:C});if(typeof setTimeout!="undefined"){setTimeout(function(){YAHOO.tool.TestRunner._run();},0);}else{this._run();}}else{D.setUp();this._resumeTest(G);}},fireEvent:function(C,D){D=D||{};D.type=C;A.superclass.fireEvent.call(this,C,D);},add:function(C){this.masterSuite.add(C);},clear:function(){this.masterSuite.items=[];},resume:function(C){this._resumeTest(C||function(){});},run:function(C){var D=YAHOO.tool.TestRunner;D._buildTestTree();D.fireEvent(D.BEGIN_EVENT);D._run();}});return new A();})();YAHOO.namespace("util");YAHOO.util.Assert={fail:function(A){throw new YAHOO.util.AssertionError(A||"Test force-failed.");},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(A||"Values should be equal.",B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be equal.",A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(B||"Values should not be the same.",A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(A||"Values should be the same.",B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be false.",false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(A||"Value should be true.",true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be NaN.",NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be NaN.",NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(A||"Values should not be null.",null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should not be undefined.",undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be null.",null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(A||"Value should be undefined.",undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an array.",B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a Boolean.",B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a function.",B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(A||"Value isn't an instance of expected type.",B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a number.",B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be an object.",B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(A||"Value should be a string.",B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(B||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"Value ("+E+") not found in array.");}},containsItems:function(C,D,B){for(var A=0;A<C.length;A++){this.contains(C[A],D,B);}if(!found){YAHOO.util.Assert.fail(B||"Value not found in array.");}},containsMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(!C){YAHOO.util.Assert.fail(B||"No match found in array.");}},doesNotContain:function(E,D,B){var C=false;
+for(var A=0;A<D.length&&!C;A++){if(D[A]===E){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},doesNotContainItems:function(C,D,B){for(var A=0;A<C.length;A++){this.doesNotContain(C[A],D,B);}},doesNotContainMatch:function(E,D,B){if(typeof E!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}var C=false;for(var A=0;A<D.length&&!C;A++){if(E(D[A])){C=true;}}if(C){YAHOO.util.Assert.fail(B||"Value found in array.");}},indexOf:function(E,D,A,C){for(var B=0;B<D.length;B++){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");},itemsAreEqual:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areEqual(D[B],E[B],C||"Values in position "+B+" are not equal.");}},itemsAreEquivalent:function(E,F,B,D){if(typeof B!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}var A=Math.max(E.length,F.length);for(var C=0;C<A;C++){if(!B(E[C],F[C])){throw new YAHOO.util.ComparisonFailure(D||"Values in position "+C+" are not equivalent.",E[C],F[C]);}}},isEmpty:function(B,A){if(B.length>0){YAHOO.util.Assert.fail(A||"Array should be empty.");}},isNotEmpty:function(B,A){if(B.length===0){YAHOO.util.Assert.fail(A||"Array should not be empty.");}},itemsAreSame:function(D,E,C){var A=Math.max(D.length,E.length);for(var B=0;B<A;B++){YAHOO.util.Assert.areSame(D[B],E[B],C||"Values in position "+B+" are not the same.");}},lastIndexOf:function(E,D,A,C){for(var B=D.length;B>=0;B--){if(D[B]===E){YAHOO.util.Assert.areEqual(A,B,C||"Value exists at index "+B+" but should be at index "+A+".");return ;}}YAHOO.util.Assert.fail(C||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,F,C){var B=[];for(var E in D){B.push(E);}for(var A=0;A<B.length;A++){YAHOO.util.Assert.isNotUndefined(F[B[A]],C||"Property'"+B[A]+"' expected.");}},hasProperty:function(A,B,C){if(YAHOO.lang.isUndefined(B[A])){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object.");}},hasOwnProperty:function(A,B,C){if(!YAHOO.lang.hasOwnProperty(B,A)){YAHOO.util.Assert.fail(C||"Property "+A+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getFullYear(),C.getFullYear(),A||"Years should be equal.");YAHOO.util.Assert.areEqual(B.getMonth(),C.getMonth(),A||"Months should be equal.");YAHOO.util.Assert.areEqual(B.getDate(),C.getDate(),A||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(B,C,A){if(B instanceof Date&&C instanceof Date){YAHOO.util.Assert.areEqual(B.getHours(),C.getHours(),A||"Hours should be equal.");YAHOO.util.Assert.areEqual(B.getMinutes(),C.getMinutes(),A||"Minutes should be equal.");YAHOO.util.Assert.areEqual(B.getSeconds(),C.getSeconds(),A||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.register("yuitest_core",YAHOO.tool.TestRunner,{version:"2.5.0",build:"895"});
\ No newline at end of file
diff --git a/lib/yui/yuitest/yuitest_core.js b/lib/yui/yuitest/yuitest_core.js
new file mode 100644 (file)
index 0000000..8a431c2
--- /dev/null
@@ -0,0 +1,1922 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+
+YAHOO.tool.TestCase.prototype = {  
+
+    /**
+     * Resumes a paused test and runs the given function.
+     * @param {Function} segment (Optional) The function to run.
+     *      If omitted, the test automatically passes.
+     * @return {Void}
+     * @method resume
+     */
+    resume : function (segment /*:Function*/) /*:Void*/ {
+        YAHOO.tool.TestRunner.resume(segment);
+    },
+
+    /**
+     * Causes the test case to wait a specified amount of time and then
+     * continue executing the given code.
+     * @param {Function} segment (Optional) The function to run after the delay.
+     *      If omitted, the TestRunner will wait until resume() is called.
+     * @param {int} delay (Optional) The number of milliseconds to wait before running
+     *      the function. If omitted, defaults to zero.
+     * @return {Void}
+     * @method wait
+     */
+    wait : function (segment /*:Function*/, delay /*:int*/) /*:Void*/{
+        throw new YAHOO.tool.TestCase.Wait(segment, delay);
+    },
+
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+
+/**
+ * Represents a stoppage in test execution to wait for an amount of time before
+ * continuing.
+ * @param {Function} segment A function to run when the wait is over.
+ * @param {int} delay The number of milliseconds to wait before running the code.
+ * @class Wait
+ * @namespace YAHOO.tool.TestCase
+ * @constructor
+ *
+ */
+YAHOO.tool.TestCase.Wait = function (segment /*:Function*/, delay /*:int*/) {
+    
+    /**
+     * The segment of code to run when the wait is over.
+     * @type Function
+     * @property segment
+     */
+    this.segment /*:Function*/ = (YAHOO.lang.isFunction(segment) ? segment : null);
+
+    /**
+     * The delay before running the segment of code.
+     * @type int
+     * @property delay
+     */
+    this.delay /*:int*/ = (YAHOO.lang.isNumber(delay) ? delay : 0);
+
+};
+
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String||Object} data The name of the test suite or an object containing
+ *      a name property as well as setUp and tearDown methods.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (data /*:String||Object*/) {
+
+    /**
+     * The name of the test suite.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "";
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+    //initialize the properties
+    if (YAHOO.lang.isString(data)){
+        this.name = data;
+    } else if (YAHOO.lang.isObject(data)){
+        YAHOO.lang.augmentObject(this, data, true);
+    }
+
+    //double-check name
+    if (this.name === ""){
+        this.name = YAHOO.util.Dom.generateId(null, "testSuite");
+    }
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     * @return {Void}
+     * @method add
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    },
+    
+    //-------------------------------------------------------------------------
+    // Stub Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     * @return {Void}
+     * @method setUp
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     * @return {Void}
+     * @method tearDown
+     */
+    tearDown: function () /*:Void*/ {
+    }
+    
+};
+
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    /**
+     * A node in the test tree structure. May represent a TestSuite, TestCase, or
+     * test function.
+     * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+     * @class TestNode
+     * @constructor
+     * @private
+     */
+    function TestNode(testObject /*:Variant*/){
+    
+        /**
+         * The TestSuite, TestCase, or test function represented by this node.
+         * @type Variant
+         * @property testObject
+         */
+        this.testObject = testObject;
+        
+        /**
+         * Pointer to this node's first child.
+         * @type TestNode
+         * @property firstChild
+         */        
+        this.firstChild /*:TestNode*/ = null;
+        
+        /**
+         * Pointer to this node's last child.
+         * @type TestNode
+         * @property lastChild
+         */        
+        this.lastChild = null;
+        
+        /**
+         * Pointer to this node's parent.
+         * @type TestNode
+         * @property parent
+         */        
+        this.parent = null; 
+   
+        /**
+         * Pointer to this node's next sibling.
+         * @type TestNode
+         * @property next
+         */        
+        this.next = null;
+        
+        /**
+         * Test results for this test object.
+         * @type object
+         * @property results
+         */                
+        this.results /*:Object*/ = {
+            passed : 0,
+            failed : 0,
+            total : 0,
+            ignored : 0
+        };
+        
+        //initialize results
+        if (testObject instanceof YAHOO.tool.TestSuite){
+            this.results.type = "testsuite";
+            this.results.name = testObject.name;
+        } else if (testObject instanceof YAHOO.tool.TestCase){
+            this.results.type = "testcase";
+            this.results.name = testObject.name;
+        }
+       
+    }
+    
+    TestNode.prototype = {
+    
+        /**
+         * Appends a new test object (TestSuite, TestCase, or test function name) as a child
+         * of this node.
+         * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
+         * @return {Void}
+         */
+        appendChild : function (testObject /*:Variant*/) /*:Void*/{
+            var node = new TestNode(testObject);
+            if (this.firstChild === null){
+                this.firstChild = this.lastChild = node;
+            } else {
+                this.lastChild.next = node;
+                this.lastChild = node;
+            }
+            node.parent = this;
+            return node;
+        }       
+    };
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * Suite on which to attach all TestSuites and TestCases to be run.
+         * @type YAHOO.tool.TestSuite
+         * @property masterSuite
+         * @private
+         */
+        this.masterSuite /*:YAHOO.tool.TestSuite*/ = new YAHOO.tool.TestSuite("YUI Test Results");        
+
+        /**
+         * Pointer to the current node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _cur
+         */
+        this._cur = null;
+        
+        /**
+         * Pointer to the root node in the test tree.
+         * @type TestNode
+         * @private
+         * @property _root
+         */
+        this._root = null;
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+        
+        //-------------------------------------------------------------------------
+        // Test Tree-Related Methods
+        //-------------------------------------------------------------------------
+
+        /**
+         * Adds a test case to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test case to as a child.
+         * @param {YAHOO.tool.TestCase} testCase The test case to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestCaseToTestTree
+         */
+       _addTestCaseToTestTree : function (parentNode /*:TestNode*/, testCase /*:YAHOO.tool.TestCase*/) /*:Void*/{
+            
+            //add the test suite
+            var node = parentNode.appendChild(testCase);
+            
+            //iterate over the items in the test case
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && YAHOO.lang.isFunction(testCase[prop])){
+                    node.appendChild(prop);
+                }
+            }
+         
+        },
+        
+        /**
+         * Adds a test suite to the test tree as a child of the specified node.
+         * @param {TestNode} parentNode The node to add the test suite to as a child.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to add.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _addTestSuiteToTestTree
+         */
+        _addTestSuiteToTestTree : function (parentNode /*:TestNode*/, testSuite /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+            
+            //add the test suite
+            var node = parentNode.appendChild(testSuite);
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < testSuite.items.length; i++){
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(node, testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(node, testSuite.items[i]);
+                }                   
+            }            
+        },
+        
+        /**
+         * Builds the test tree based on items in the master suite. The tree is a hierarchical
+         * representation of the test suites, test cases, and test functions. The resulting tree
+         * is stored in _root and the pointer _cur is set to the root initially.
+         * @return {Void}
+         * @static
+         * @private
+         * @method _buildTestTree
+         */
+        _buildTestTree : function () /*:Void*/ {
+        
+            this._root = new TestNode(this.masterSuite);
+            this._cur = this._root;
+            
+            //iterate over the items in the master suite
+            for (var i=0; i < this.masterSuite.items.length; i++){
+                if (this.masterSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);
+                } else if (this.masterSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);
+                }                   
+            }            
+        
+        }, 
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Handles the completion of a test object's tests. Tallies test results 
+         * from one level up to the next.
+         * @param {TestNode} node The TestNode representing the test object.
+         * @return {Void}
+         * @method _handleTestObjectComplete
+         * @private
+         */
+        _handleTestObjectComplete : function (node /*:TestNode*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(node.testObject)){
+                node.parent.results.passed += node.results.passed;
+                node.parent.results.failed += node.results.failed;
+                node.parent.results.total += node.results.total;                
+                node.parent.results.ignored += node.results.ignored;                
+                node.parent.results[node.testObject.name] = node.results;
+            
+                if (node.testObject instanceof YAHOO.tool.TestSuite){
+                    node.testObject.tearDown();
+                    this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: node.testObject, results: node.results});
+                } else if (node.testObject instanceof YAHOO.tool.TestCase){
+                    this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: node.testObject, results: node.results});
+                }      
+            } 
+        },                
+        
+        //-------------------------------------------------------------------------
+        // Navigation Methods
+        //-------------------------------------------------------------------------
+        
+        /**
+         * Retrieves the next node in the test tree.
+         * @return {TestNode} The next node in the test tree or null if the end is reached.
+         * @private
+         * @static
+         * @method _next
+         */
+        _next : function () /*:TestNode*/ {
+        
+            if (this._cur.firstChild) {
+                this._cur = this._cur.firstChild;
+            } else if (this._cur.next) {
+                this._cur = this._cur.next;            
+            } else {
+                while (this._cur && !this._cur.next && this._cur !== this._root){
+                    this._handleTestObjectComplete(this._cur);
+                    this._cur = this._cur.parent;
+                }
+                
+                if (this._cur == this._root){
+                    this._cur.results.type = "report";
+                    this._cur.results.timestamp = (new Date()).toLocaleString();
+                    this.fireEvent(this.COMPLETE_EVENT, { results: this._cur.results});
+                    this._cur = null;
+                } else {
+                    this._handleTestObjectComplete(this._cur);               
+                    this._cur = this._cur.next;                
+                }
+            }
+        
+            return this._cur;
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function () /*:Void*/ {
+        
+            //flag to indicate if the TestRunner should wait before continuing
+            var shouldWait /*:Boolean*/ = false;
+            
+            //get the next test node
+            var node = this._next();
+            
+            if (node !== null) {
+                var testObject = node.testObject;
+                
+                //figure out what to do
+                if (YAHOO.lang.isObject(testObject)){
+                    if (testObject instanceof YAHOO.tool.TestSuite){
+                        this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testObject });
+                        testObject.setUp();
+                    } else if (testObject instanceof YAHOO.tool.TestCase){
+                        this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testObject });
+                    }
+                    
+                    //some environments don't support setTimeout
+                    if (typeof setTimeout != "undefined"){                    
+                        setTimeout(function(){
+                            YAHOO.tool.TestRunner._run();
+                        }, 0);
+                    } else {
+                        this._run();
+                    }
+                } else {
+                    this._runTest(node);
+                }
+
+            }
+        },
+        
+        _resumeTest : function (segment /*:Function*/) /*:Void*/ {
+        
+            //get relevant information
+            var node /*:TestNode*/ = this._cur;
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = (testCase._should.fail || {})[testName];
+            var shouldError /*:Object*/ = (testCase._should.error || {})[testName];
+            
+            //variable to hold whether or not the test failed
+            var failed /*:Boolean*/ = false;
+            var error /*:Error*/ = null;
+                
+            //try the test
+            try {
+            
+                //run the test
+                segment.apply(testCase);
+                
+                //if it should fail, and it got here, then it's a fail because it didn't
+                if (shouldFail){
+                    error = new YAHOO.util.ShouldFail();
+                    failed = true;
+                } else if (shouldError){
+                    error = new YAHOO.util.ShouldError();
+                    failed = true;
+                }
+                           
+            } catch (thrown /*:Error*/){
+                if (thrown instanceof YAHOO.util.AssertionError) {
+                    if (!shouldFail){
+                        error = thrown;
+                        failed = true;
+                    }
+                } else if (thrown instanceof YAHOO.tool.TestCase.Wait){
+                
+                    if (YAHOO.lang.isFunction(thrown.segment)){
+                        if (YAHOO.lang.isNumber(thrown.delay)){
+                        
+                            //some environments don't support setTimeout
+                            if (typeof setTimeout != "undefined"){
+                                setTimeout(function(){
+                                    YAHOO.tool.TestRunner._resumeTest(thrown.segment);
+                                }, thrown.delay);
+                            } else {
+                                throw new Error("Asynchronous tests not supported in this environment.");
+                            }
+                        }
+                    }
+                    
+                    return;
+                
+                } else {
+                    //first check to see if it should error
+                    if (!shouldError) {                        
+                        error = new YAHOO.util.UnexpectedError(thrown);
+                        failed = true;
+                    } else {
+                        //check to see what type of data we have
+                        if (YAHOO.lang.isString(shouldError)){
+                            
+                            //if it's a string, check the error message
+                            if (thrown.message != shouldError){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        } else if (YAHOO.lang.isFunction(shouldError)){
+                        
+                            //if it's a function, see if the error is an instance of it
+                            if (!(thrown instanceof shouldError)){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;
+                            }
+                        
+                        } else if (YAHOO.lang.isObject(shouldError)){
+                        
+                            //if it's an object, check the instance and message
+                            if (!(thrown instanceof shouldError.constructor) || 
+                                    thrown.message != shouldError.message){
+                                error = new YAHOO.util.UnexpectedError(thrown);
+                                failed = true;                                    
+                            }
+                        
+                        }
+                    
+                    }
+                }
+                
+            }
+            
+            //fireEvent appropriate event
+            if (failed) {
+                this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: testName, error: error });
+            } else {
+                this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: testName });
+            }
+            
+            //run the tear down
+            testCase.tearDown();
+            
+            //update results
+            node.parent.results[testName] = { 
+                result: failed ? "fail" : "pass",
+                message: error ? error.getMessage() : "Test passed",
+                type: "test",
+                name: testName
+            };
+            
+            if (failed){
+                node.parent.results.failed++;
+            } else {
+                node.parent.results.passed++;
+            }
+            node.parent.results.total++;
+
+            //set timeout not supported in all environments
+            if (typeof setTimeout != "undefined"){
+                setTimeout(function(){
+                    YAHOO.tool.TestRunner._run();
+                }, 0);
+            } else {
+                this._run();
+            }
+        
+        },
+                
+        /**
+         * Runs a single test based on the data provided in the node.
+         * @param {TestNode} node The TestNode representing the test to run.
+         * @return {Void}
+         * @static
+         * @private
+         * @name _runTest
+         */
+        _runTest : function (node /*:TestNode*/) /*:Void*/ {
+        
+            //get relevant information
+            var testName /*:String*/ = node.testObject;
+            var testCase /*:YAHOO.tool.TestCase*/ = node.parent.testObject;
+            var test /*:Function*/ = testCase[testName];
+            
+            //get the "should" test cases
+            var shouldIgnore /*:Object*/ = (testCase._should.ignore || {})[testName];
+            
+            //figure out if the test should be ignored or not
+            if (shouldIgnore){
+            
+                //update results
+                node.parent.results[testName] = { 
+                    result: "ignore",
+                    message: "Test ignored",
+                    type: "test",
+                    name: testName
+                };
+                
+                node.parent.results.ignored++;
+                node.parent.results.total++;
+            
+                this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: testName });
+                
+                //some environments don't support setTimeout
+                if (typeof setTimeout != "undefined"){                    
+                    setTimeout(function(){
+                        YAHOO.tool.TestRunner._run();
+                    }, 0);              
+                } else {
+                    this._run();
+                }
+
+            } else {
+            
+                //run the setup
+                testCase.setUp();
+                
+                //now call the body of the test
+                this._resumeTest(test);                
+            }
+
+        },        
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         * @return {Void}
+         * @method add
+         * @static
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.masterSuite.add(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         * @return {Void}
+         * @method clear
+         * @static
+         */
+        clear : function () /*:Void*/ {
+            this.masterSuite.items = [];
+        },
+        
+        /**
+         * Resumes the TestRunner after wait() was called.
+         * @param {Function} segment The function to run as the rest
+         *      of the haulted test.
+         * @return {Void}
+         * @method resume
+         * @static
+         */
+        resume : function (segment /*:Function*/) /*:Void*/ {
+            this._resumeTest(segment || function(){});
+        },
+    
+        /**
+         * Runs the test suite.
+         * @return {Void}
+         * @method run
+         * @static
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ {
+            
+            //pointer to runner to avoid scope issues 
+            var runner = YAHOO.tool.TestRunner;
+
+            //build the test tree
+            runner._buildTestTree();
+            
+            //fire the begin event
+            runner.fireEvent(runner.BEGIN_EVENT);
+       
+            //begin the testing
+            runner._run();
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+
+YAHOO.register("yuitest_core", YAHOO.tool.TestRunner, {version: "2.5.0", build: "895"});